2021-11-21 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/level/chunk/IChunkAccess.java
|
|
|
|
+++ b/net/minecraft/world/level/chunk/IChunkAccess.java
|
2021-11-24 22:00:00 +01:00
|
|
|
@@ -94,7 +94,11 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
replaceMissingSections(levelheightaccessor, iregistry, this.sections);
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ this.biomeRegistry = iregistry;
|
|
|
|
}
|
|
|
|
+ public final IRegistry<BiomeBase> biomeRegistry;
|
|
|
|
+ // CraftBukkit end
|
|
|
|
|
|
|
|
private static void replaceMissingSections(LevelHeightAccessor levelheightaccessor, IRegistry<BiomeBase> iregistry, ChunkSection[] achunksection) {
|
|
|
|
for (int i = 0; i < achunksection.length; ++i) {
|
2021-11-24 22:00:00 +01:00
|
|
|
@@ -394,6 +398,27 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ public void setBiome(int i, int j, int k, BiomeBase biome) {
|
|
|
|
+ try {
|
|
|
|
+ int l = QuartPos.fromBlock(this.getMinBuildHeight());
|
|
|
|
+ int i1 = l + QuartPos.fromBlock(this.getHeight()) - 1;
|
|
|
|
+ int j1 = MathHelper.clamp(j, l, i1);
|
|
|
|
+ int k1 = this.getSectionIndex(QuartPos.toBlock(j1));
|
|
|
|
+
|
|
|
|
+ this.sections[k1].setBiome(i & 3, j1 & 3, k & 3, biome);
|
|
|
|
+ } catch (Throwable throwable) {
|
|
|
|
+ CrashReport crashreport = CrashReport.forThrowable(throwable, "Setting biome");
|
|
|
|
+ CrashReportSystemDetails crashreportsystemdetails = crashreport.addCategory("Biome being set");
|
|
|
|
+
|
|
|
|
+ crashreportsystemdetails.setDetail("Location", () -> {
|
|
|
|
+ return CrashReportSystemDetails.formatLocation(this, i, j, k);
|
|
|
|
+ });
|
|
|
|
+ throw new ReportedException(crashreport);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
|
|
|
+
|
|
|
|
public void fillBiomesFromNoise(BiomeResolver biomeresolver, Climate.Sampler climate_sampler) {
|
|
|
|
ChunkCoordIntPair chunkcoordintpair = this.getPos();
|
|
|
|
int i = QuartPos.fromBlock(chunkcoordintpair.getMinBlockX());
|
2021-11-24 22:00:00 +01:00
|
|
|
@@ -425,8 +450,10 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2021-11-24 22:00:00 +01:00
|
|
|
- public static record a(SerializableTickContainer<Block> a, SerializableTickContainer<FluidType> b) {
|
|
|
|
+ // CraftBukkit start - decompile error
|
|
|
|
+ public static record a(SerializableTickContainer<Block> blocks, SerializableTickContainer<FluidType> fluids) {
|
2021-11-21 23:00:00 +01:00
|
|
|
|
|
|
|
+ /*
|
|
|
|
private final SerializableTickContainer<Block> blocks;
|
|
|
|
private final SerializableTickContainer<FluidType> fluids;
|
|
|
|
|
2021-11-24 22:00:00 +01:00
|
|
|
@@ -442,5 +469,7 @@
|
|
|
|
public SerializableTickContainer<FluidType> fluids() {
|
|
|
|
return this.fluids;
|
2021-11-21 23:00:00 +01:00
|
|
|
}
|
|
|
|
+ */
|
|
|
|
+ // CraftBukkit end
|
2021-11-24 22:00:00 +01:00
|
|
|
}
|
|
|
|
}
|