Skip to content

Commit

Permalink
Fix some bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgazul committed Oct 15, 2024
1 parent 320ee66 commit 4acc032
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
13 changes: 9 additions & 4 deletions patches/minecraft/net/minecraft/world/World.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
public final Thread field_217407_c;
private final boolean field_234916_c_;
private int field_73008_k;
@@ -92,8 +_,61 @@
@@ -92,8 +_,62 @@
private final WorldBorder field_175728_M;
private final BiomeManager field_226689_w_;
private final RegistryKey<World> field_73011_w;
Expand All @@ -84,7 +84,8 @@
+ public CraftWorld craftWorld; //Mohist - compat for Forge
+ public boolean pvpMode;
+ public boolean keepSpawnInMemory = true;
+ public static org.bukkit.generator.ChunkGenerator generator;
+ public static org.bukkit.generator.ChunkGenerator generator$mohist;
+ public org.bukkit.generator.ChunkGenerator generator;
+ public static org.bukkit.World.Environment environment;
+ public boolean captureBlockStates = false;
+ public boolean captureTreeGeneration = false;
Expand Down Expand Up @@ -116,7 +117,7 @@
+ }
+
+ public static void setGeneratorAndEnv(org.bukkit.generator.ChunkGenerator gen, org.bukkit.World.Environment env){
+ generator = gen;
+ generator$mohist = gen;
+ environment = env;
+ }

Expand All @@ -133,7 +134,7 @@
this.field_72984_F = p_i241925_4_;
this.field_72986_A = p_i241925_1_;
this.field_234921_x_ = p_i241925_3_;
@@ -102,17 +_,20 @@
@@ -102,20 +_,24 @@
if (p_i241925_3_.func_242724_f() != 1.0D) {
this.field_175728_M = new WorldBorder() {
public double func_230316_a_() {
Expand All @@ -157,6 +158,10 @@
this.field_217407_c = Thread.currentThread();
this.field_226689_w_ = new BiomeManager(this, p_i241925_7_, p_i241925_3_.func_227176_e_());
this.field_234916_c_ = p_i241925_6_;
+ this.generator = generator$mohist;
}

public boolean func_201670_d() {
@@ -155,6 +_,11 @@
return this.func_212866_a_(p_175726_1_.func_177958_n() >> 4, p_175726_1_.func_177952_p() >> 4);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@
+ this.worldDataServer = MohistDerivedWorldInfo.create((DerivedWorldInfo)p_i241885_4_);
+ }
+
+ if (generator != null) {
+ p_i241885_8_ = new CustomChunkGenerator(this, p_i241885_8_, generator);
+ if (generator$mohist != null) {
+ p_i241885_8_ = new CustomChunkGenerator(this, p_i241885_8_, generator$mohist);
+ } else {
+ generator = getCBServer().getGenerator(p_i241885_4_.func_76065_j());
+ generator$mohist = getCBServer().getGenerator(p_i241885_4_.func_76065_j());
+ }
+ worldDataServer.world = this;
+ this.spigotConfig = new SpigotWorldConfig(name); // Spigot
Expand All @@ -238,7 +238,7 @@
}
-
- }
+ this.craftWorld = new CraftWorld(this, generator, environment);
+ this.craftWorld = new CraftWorld(this, generator$mohist, environment);
+ this.getCBServer().addWorld(this.getWorld()); // CraftBukkit
+ this.initCapabilities();
+ }
Expand Down

0 comments on commit 4acc032

Please sign in to comment.