From 8b8a8ccbb1a0885911136e89e5c28df8a59563f6 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sun, 17 Jan 2021 01:46:38 +0800 Subject: BugFix: Bamboo 0-tick fix is not valid, because of the absent of Mixin config entry. --- gradle.properties | 2 +- .../mixin/Mc113809BambooBlockMixin.java | 30 +++++++++++----------- src/main/resources/ohmyvanillamc.mixins.json | 1 + 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/gradle.properties b/gradle.properties index e790de9..9286e5b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ minecraft_version=1.16.4 yarn_mappings=1.16.4+build.9 loader_version=0.11.0 # Mod Properties -mod_version=1.5.4 +mod_version=1.5.5 maven_group=com.keuin.omvm archives_base_name=oh-my-vanilla-mc # Dependencies diff --git a/src/main/java/com/keuin/ohmyvanillamc/mixin/Mc113809BambooBlockMixin.java b/src/main/java/com/keuin/ohmyvanillamc/mixin/Mc113809BambooBlockMixin.java index ef4b9c1..07db52f 100644 --- a/src/main/java/com/keuin/ohmyvanillamc/mixin/Mc113809BambooBlockMixin.java +++ b/src/main/java/com/keuin/ohmyvanillamc/mixin/Mc113809BambooBlockMixin.java @@ -33,21 +33,6 @@ public abstract class Mc113809BambooBlockMixin extends Block { @Shadow protected abstract void updateLeaves(BlockState state, World world, BlockPos pos, Random random, int height); - /** - * Reintroduce the MC-113809 glitch for bamboo. The implementation is identical to Minecraft 1.15.2. - * - * @author trueKeuin - * @reason reintroduce MC-113809 for bamboo. - */ - @Overwrite - public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { - if (!state.canPlaceAt(world, pos)) { - world.breakBlock(pos, true); - } else if (OhMyVanillaMinecraft.getConfiguration().isReintroduceZeroTickFarm()) { - realGrow(state, world, pos, random); - } - } - /** * Reintroduce the base class's implementation. * @@ -76,6 +61,21 @@ public abstract class Mc113809BambooBlockMixin extends Block { } } + /** + * Reintroduce the MC-113809 glitch for bamboo. The implementation is identical to Minecraft 1.15.2. + * + * @author trueKeuin + * @reason reintroduce MC-113809 for bamboo. + */ + @Overwrite + public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { + if (!state.canPlaceAt(world, pos)) { + world.breakBlock(pos, true); + } else if (OhMyVanillaMinecraft.getConfiguration().isReintroduceZeroTickFarm()) { + realGrow(state, world, pos, random); + } + } + private void realGrow(BlockState state, ServerWorld world, BlockPos pos, Random random) { if (state.get(STAGE) == 0) { if (random.nextInt(3) == 0 && world.isAir(pos.up()) && world.getBaseLightLevel(pos.up(), 0) >= 9) { diff --git a/src/main/resources/ohmyvanillamc.mixins.json b/src/main/resources/ohmyvanillamc.mixins.json index ce61122..24537c7 100644 --- a/src/main/resources/ohmyvanillamc.mixins.json +++ b/src/main/resources/ohmyvanillamc.mixins.json @@ -12,6 +12,7 @@ "Mc113809SugarCaneBlockMixin", "Mc113809CactusBlockMixin", "Mc113809ChorusFlowerBlockMixin", + "Mc113809BambooBlockMixin", "Mc113809AbstractPlantStemBlockMixin" ], "injectors": { -- cgit v1.2.3