mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-10 03:53:12 +01:00
Merge pull request #2026 from garyyo/mc1.16/dev
- Fixed incorrect damage displayed in the tooltip of potato cannons
This commit is contained in:
commit
77aa620fb9
2 changed files with 6 additions and 6 deletions
|
@ -226,7 +226,7 @@ public class PotatoCannonItem extends ShootableItem {
|
|||
public void appendHoverText(ItemStack stack, World world, List<ITextComponent> tooltip, ITooltipFlag flag) {
|
||||
int power = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.POWER_ARROWS, stack);
|
||||
int punch = EnchantmentHelper.getItemEnchantmentLevel(Enchantments.PUNCH_ARROWS, stack);
|
||||
final float additionalDamage = power * 2;
|
||||
final float additionalDamageMult = 1 + power * .2f;
|
||||
final float additionalKnockback = punch * .5f;
|
||||
|
||||
getAmmoforPreview(stack).ifPresent(ammo -> {
|
||||
|
@ -243,14 +243,14 @@ public class PotatoCannonItem extends ShootableItem {
|
|||
TextFormatting green = TextFormatting.GREEN;
|
||||
TextFormatting darkGreen = TextFormatting.DARK_GREEN;
|
||||
|
||||
float damageF = type.getDamage() + additionalDamage;
|
||||
float damageF = type.getDamage() * additionalDamageMult;
|
||||
IFormattableTextComponent damage = new StringTextComponent(
|
||||
damageF == MathHelper.floor(damageF) ? "" + MathHelper.floor(damageF) : "" + damageF);
|
||||
IFormattableTextComponent reloadTicks = new StringTextComponent("" + type.getReloadTicks());
|
||||
IFormattableTextComponent knockback =
|
||||
new StringTextComponent("" + (type.getKnockback() + additionalKnockback));
|
||||
|
||||
damage = damage.withStyle(additionalDamage > 0 ? green : darkGreen);
|
||||
damage = damage.withStyle(additionalDamageMult > 1 ? green : darkGreen);
|
||||
knockback = knockback.withStyle(additionalKnockback > 0 ? green : darkGreen);
|
||||
reloadTicks = reloadTicks.withStyle(darkGreen);
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ public class PotatoProjectileEntity extends DamagingProjectileEntity implements
|
|||
Vector3d hit = ray.getLocation();
|
||||
Entity target = ray.getEntity();
|
||||
PotatoCannonProjectileTypes projectileType = getProjectileType();
|
||||
float damage = MathHelper.floor(projectileType.getDamage() * additionalDamageMult);
|
||||
float damage = projectileType.getDamage() * additionalDamageMult;
|
||||
float knockback = projectileType.getKnockback() + additionalKnockback;
|
||||
Entity owner = this.getOwner();
|
||||
|
||||
|
|
Loading…
Reference in a new issue