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. --- .../mixin/Mc113809BambooBlockMixin.java | 30 +++++++++++----------- src/main/resources/ohmyvanillamc.mixins.json | 1 + 2 files changed, 16 insertions(+), 15 deletions(-) (limited to 'src') 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