修复大锤合成被消耗的bug

This commit is contained in:
Atsuihsio 2024-06-19 14:41:00 +08:00
parent e2b74166a0
commit c9bea4933b
2 changed files with 7 additions and 6 deletions

View file

@ -179,9 +179,9 @@ public class MortarEntity extends PathfinderMob implements GeoEntity, AnimatedEn
entityToSpawn.setPos(this.getX(), this.getEyeY(), this.getZ());
entityToSpawn.shoot(this.getLookAngle().x, this.getLookAngle().y, this.getLookAngle().z, 8, (float) 0.5);
level.addFreshEntity(entityToSpawn);
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE, (this.getX() + 2.2 * this.getLookAngle().x), (this.getY() + 0.1 + 2.2 * this.getLookAngle().y), (this.getZ() + 2.2 * this.getLookAngle().z), 40, 0.4, 0.4, 0.4,
0.015);
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE, (this.getX() + 3 * this.getLookAngle().x), (this.getY() + 0.1 + 3 * this.getLookAngle().y), (this.getZ() + 3 * this.getLookAngle().z), 40, 0.4, 0.4, 0.4,
0.01);
server.sendParticles(ParticleTypes.CAMPFIRE_COSY_SMOKE, this.getX(), this.getY(), this.getZ(), 100, 2.5, 0.04, 2.5, 0.005);
}
});
}

View file

@ -43,11 +43,12 @@ public class Hammer extends SwordItem {
@Override
public ItemStack getCraftingRemainingItem(ItemStack itemstack) {
itemstack.setDamageValue(itemstack.getDamageValue() + 1);
if (itemstack.getDamageValue() >= itemstack.getMaxDamage()) {
ItemStack retval = new ItemStack(this);
retval.setDamageValue(itemstack.getDamageValue() + 1);
if (retval.getDamageValue() >= retval.getMaxDamage()) {
return ItemStack.EMPTY;
}
return itemstack;
return retval;
}
@Override