summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeuin <[email protected]>2021-01-17 01:46:38 +0800
committerkeuin <[email protected]>2021-01-17 01:46:38 +0800
commit8b8a8ccbb1a0885911136e89e5c28df8a59563f6 (patch)
tree87b8090263d7feff6a244df6c707946321d7d280 /src
parent81b6c329ae1c886dbed7ea3253580c985fcea92d (diff)
BugFix: Bamboo 0-tick fix is not valid, because of the absent of Mixin config entry.
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/keuin/ohmyvanillamc/mixin/Mc113809BambooBlockMixin.java30
-rw-r--r--src/main/resources/ohmyvanillamc.mixins.json1
2 files changed, 16 insertions, 15 deletions
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
@@ -34,21 +34,6 @@ public abstract class Mc113809BambooBlockMixin extends Block {
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.
*
* @reason reintroduce 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": {