diff --git a/src/main/java/com/nad2040/elytrabombing/ElytraBombingMod.java b/src/main/java/com/nad2040/elytrabombing/ElytraBombingMod.java index 13503ce..5536913 100644 --- a/src/main/java/com/nad2040/elytrabombing/ElytraBombingMod.java +++ b/src/main/java/com/nad2040/elytrabombing/ElytraBombingMod.java @@ -35,7 +35,7 @@ public void onInitialize() { } public static BlockPos VEC_3D_TO_POS(Vec3d vec3d) { - return new BlockPos(vec3d.x, vec3d.y, vec3d.z); + return new BlockPos((int)Math.round(vec3d.x), (int)Math.round(vec3d.y), (int)Math.round(vec3d.z)); } public static void log(Hand hand, Hand other_hand, ItemStack usedItemStack, ItemStack otherItemStack, Vec3d position, Vec3d velocity) { diff --git a/src/main/java/com/nad2040/elytrabombing/mixin/ItemMixin.java b/src/main/java/com/nad2040/elytrabombing/mixin/ItemMixin.java index 48c0ea1..838b4c4 100644 --- a/src/main/java/com/nad2040/elytrabombing/mixin/ItemMixin.java +++ b/src/main/java/com/nad2040/elytrabombing/mixin/ItemMixin.java @@ -4,6 +4,7 @@ import net.minecraft.block.AnvilBlock; import net.minecraft.block.Blocks; import net.minecraft.entity.EntityType; +import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.FallingBlockEntity; import net.minecraft.entity.TntEntity; import net.minecraft.entity.player.PlayerEntity; @@ -40,7 +41,7 @@ public void use(World world, PlayerEntity user, Hand hand, CallbackInfoReturnabl world.playSound(null, tntEntity.getX(), tntEntity.getY(), tntEntity.getZ(), SoundEvents.ENTITY_TNT_PRIMED, SoundCategory.BLOCKS, 1.0f, 1.0f); world.emitGameEvent(user, GameEvent.PRIME_FUSE, position); if (!user.getAbilities().creativeMode) { - usedItemStack.damage(1, user, p -> p.sendToolBreakStatus(hand)); + usedItemStack.damage(1, user, EquipmentSlot.MAINHAND); otherItemStack.decrement(1); } user.incrementStat(Stats.USED.getOrCreateStat((FlintAndSteelItem) (Object) this));