From cc500b9c94769b9439ff2accca174226922cf8ca Mon Sep 17 00:00:00 2001 From: Draylar <17728338+Draylar@users.noreply.github.com> Date: Fri, 8 Apr 2022 19:52:00 -0500 Subject: [PATCH] 1.18.2 update --- gradle.properties | 10 ++++---- .../gateofbabylon/item/CustomShieldItem.java | 2 +- .../gateofbabylon/item/WaraxeItem.java | 2 +- .../mixin/FallingBlockEntityAccessor.java | 9 +++++++ .../mixin/FallingBlockEntityMixin.java | 24 ------------------- .../resources/gate-of-babylon.mixins.json | 1 - 6 files changed, 16 insertions(+), 32 deletions(-) delete mode 100644 src/main/java/draylar/gateofbabylon/mixin/FallingBlockEntityMixin.java diff --git a/gradle.properties b/gradle.properties index 1979897..4262b50 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,13 +3,13 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use -minecraft_version=1.18.1 -yarn_mappings=1.18.1+build.22 -loader_version=0.13.1 -fabric_version=0.46.4+1.18 +minecraft_version=1.18.2 +yarn_mappings=1.18.2+build.2 +loader_version=0.13.3 +fabric_version=0.48.0+1.18.2 # Mod Properties -mod_version=1.6.0 +mod_version=1.7.0 maven_group=draylar archives_base_name=gate-of-babylon diff --git a/src/main/java/draylar/gateofbabylon/item/CustomShieldItem.java b/src/main/java/draylar/gateofbabylon/item/CustomShieldItem.java index ec4a7b4..76db533 100644 --- a/src/main/java/draylar/gateofbabylon/item/CustomShieldItem.java +++ b/src/main/java/draylar/gateofbabylon/item/CustomShieldItem.java @@ -55,7 +55,7 @@ public TypedActionResult use(World world, PlayerEntity user, Hand han @Override public boolean canRepair(ItemStack stack, ItemStack ingredient) { - return ItemTags.PLANKS.contains(ingredient.getItem()) || super.canRepair(stack, ingredient); + return ingredient.isIn(ItemTags.PLANKS) || super.canRepair(stack, ingredient); } public static DyeColor getColor(ItemStack stack) { diff --git a/src/main/java/draylar/gateofbabylon/item/WaraxeItem.java b/src/main/java/draylar/gateofbabylon/item/WaraxeItem.java index 614decb..9539077 100644 --- a/src/main/java/draylar/gateofbabylon/item/WaraxeItem.java +++ b/src/main/java/draylar/gateofbabylon/item/WaraxeItem.java @@ -96,7 +96,7 @@ public TypedActionResult use(World world, PlayerEntity user, Hand han } public void spawnEntity(ServerWorld world, Vec3d pos, LivingEntity source, BlockState state) { - FallingBlockEntity spawn = new FallingBlockEntity(world, pos.getX(), pos.getY(), pos.getZ(), state); + FallingBlockEntity spawn = FallingBlockEntityAccessor.createFallingBlockEntity(world, pos.getX(), pos.getY(), pos.getZ(), state); // setup velocity Vec3d difference = pos.subtract(source.getPos()).multiply(.1); diff --git a/src/main/java/draylar/gateofbabylon/mixin/FallingBlockEntityAccessor.java b/src/main/java/draylar/gateofbabylon/mixin/FallingBlockEntityAccessor.java index 8b3f4b2..f87bba5 100644 --- a/src/main/java/draylar/gateofbabylon/mixin/FallingBlockEntityAccessor.java +++ b/src/main/java/draylar/gateofbabylon/mixin/FallingBlockEntityAccessor.java @@ -1,11 +1,20 @@ package draylar.gateofbabylon.mixin; +import net.minecraft.block.BlockState; import net.minecraft.entity.FallingBlockEntity; +import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; +import org.spongepowered.asm.mixin.gen.Invoker; @Mixin(FallingBlockEntity.class) public interface FallingBlockEntityAccessor { + + @Invoker("") + static FallingBlockEntity createFallingBlockEntity(World world, double x, double y, double z, BlockState block) { + throw new UnsupportedOperationException(); + } + @Accessor void setDestroyedOnLanding(boolean destroyedOnLanding); } diff --git a/src/main/java/draylar/gateofbabylon/mixin/FallingBlockEntityMixin.java b/src/main/java/draylar/gateofbabylon/mixin/FallingBlockEntityMixin.java deleted file mode 100644 index 3df7d2a..0000000 --- a/src/main/java/draylar/gateofbabylon/mixin/FallingBlockEntityMixin.java +++ /dev/null @@ -1,24 +0,0 @@ -package draylar.gateofbabylon.mixin; - -import net.minecraft.entity.FallingBlockEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Redirect; - -@Mixin(FallingBlockEntity.class) -public class FallingBlockEntityMixin { - - @Redirect( - method = "tick", - at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;removeBlock(Lnet/minecraft/util/math/BlockPos;Z)Z") - ) - private boolean sidedRemoval(World world, BlockPos pos, boolean move) { - if(!world.isClient) { - world.removeBlock(pos, move); - } - - return move; - } -} diff --git a/src/main/resources/gate-of-babylon.mixins.json b/src/main/resources/gate-of-babylon.mixins.json index 17cb3c2..ae37db4 100644 --- a/src/main/resources/gate-of-babylon.mixins.json +++ b/src/main/resources/gate-of-babylon.mixins.json @@ -10,7 +10,6 @@ "EnchantmentHelperMixin", "EnchantmentMixin", "FallingBlockEntityAccessor", - "FallingBlockEntityMixin", "MobEntityMixin", "PersistentProjectileEntityMixin", "PlayerEntityLungeMixin",