Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
Fixed #2826
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Nov 26, 2023
1 parent 4f3189c commit ea1bfad
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
17 changes: 16 additions & 1 deletion patches/minecraft/net/minecraft/world/World.java.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/net/minecraft/world/World.java
+++ b/net/minecraft/world/World.java
@@ -1,11 +_,15 @@
@@ -1,12 +_,17 @@
package net.minecraft.world;

import com.google.common.collect.Lists;
Expand All @@ -14,8 +14,10 @@
import java.util.List;
+import java.util.Map;
import java.util.Random;
+import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Consumer;
import java.util.function.Predicate;
import java.util.function.Supplier;
@@ -20,6 +_,7 @@
import net.minecraft.crash.ReportedException;
import net.minecraft.entity.Entity;
Expand Down Expand Up @@ -303,6 +305,19 @@
Block.func_220054_a(blockstate, this, p_241212_1_, tileentity, p_241212_3_, ItemStack.field_190927_a);
}

@@ -249,7 +_,12 @@
}
}

+ // Mohist start
+ public AtomicBoolean callEvent = new AtomicBoolean(false);
+ public BlockState mohist$defaultBlockState;
public boolean func_175656_a(BlockPos p_175656_1_, BlockState p_175656_2_) {
+ mohist$defaultBlockState = p_175656_2_;
+ if (callEvent.getAndSet(false)) return false;
return this.func_180501_a(p_175656_1_, p_175656_2_, 3);
}

@@ -259,6 +_,8 @@
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@
}
}

@@ -475,12 +_,13 @@
@@ -475,12 +_,15 @@
BlockPos blockpos2 = this.func_205770_a(Heightmap.Type.MOTION_BLOCKING, this.func_217383_a(i, 0, j, 15));
BlockPos blockpos3 = blockpos2.func_177977_b();
Biome biome = this.func_226691_t_(blockpos2);
Expand All @@ -406,7 +406,9 @@
- }
+ if (this.isAreaLoaded(blockpos2, 1)) // Forge: check area to avoid loading neighbors in unloaded chunks
+ if (biome.func_201848_a(this, blockpos3)) {
+ org.bukkit.craftbukkit.v1_16_R3.event.CraftEventFactory.handleBlockFormEvent(this, blockpos3, Blocks.field_150432_aD.func_176223_P(), null); // CraftBukkit
+ this.callEvent.set(true);
+ this.func_175656_a(blockpos3, Blocks.field_150432_aD.func_176223_P());
+ org.bukkit.craftbukkit.v1_16_R3.event.CraftEventFactory.handleBlockFormEvent(this, blockpos3, this.mohist$defaultBlockState, null); // CraftBukkit // Mohist
+ }

if (flag && biome.func_201850_b(this, blockpos2)) {
Expand Down

0 comments on commit ea1bfad

Please sign in to comment.