Fix debug world not generating modded blocks (#6926)

This commit is contained in:
sciwhiz12 authored and GitHub committed 2020-08-03 17:00:31 -07:00
1 parent 0984777c98
commit 493608e1b5
3 files changed
+19 -1

No files matched your search

@@ -0,0 +1,13 @@
--- a/net/minecraft/world/gen/DebugChunkGenerator.java
+++ b/net/minecraft/world/gen/DebugChunkGenerator.java
@@ -101,4 +101,10 @@
return blockstate;
}
+
+ public static void initValidStates() {
+ field_177464_a = StreamSupport.stream(Registry.field_212618_g.spliterator(), false).flatMap(block -> block.func_176194_O().func_177619_a().stream()).collect(Collectors.toList());
+ field_177462_b = MathHelper.func_76123_f(MathHelper.func_76129_c(field_177464_a.size()));
+ field_181039_c = MathHelper.func_76123_f((float) (field_177464_a.size() / field_177462_b));
+ }
}
@@ -56,6 +56,7 @@ import net.minecraft.util.registry.SimpleRegistry;
import net.minecraft.village.PointOfInterestType;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.gen.DebugChunkGenerator;
import net.minecraft.world.gen.blockplacer.BlockPlacerType;
import net.minecraft.world.gen.blockstateprovider.BlockStateProviderType;
import net.minecraft.world.gen.carver.WorldCarver;
@@ -472,6 +473,7 @@ public class GameData
block.getLootTable();
}
DebugChunkGenerator.initValidStates();
}
private static class BlockDummyAir extends AirBlock //A named class so DummyBlockReplacementTest can detect if its a dummy
@@ -302,9 +302,12 @@ public net.minecraft.world.biome.DeepFrozenOceanBiome func_180626_a(Lnet/minecra
public net.minecraft.world.biome.FrozenOceanBiome func_180626_a(Lnet/minecraft/util/math/BlockPos;)F # getTemperature
public net.minecraft.world.biome.provider.BiomeProvider field_201540_a # BIOMES_TO_SPAWN_IN
public net.minecraft.world.chunk.ChunkStatus <init>(Ljava/lang/String;Lnet/minecraft/world/chunk/ChunkStatus;ILjava/util/EnumSet;Lnet/minecraft/world/chunk/ChunkStatus$Type;Lnet/minecraft/world/chunk/ChunkStatus$IGenerationWorker;Lnet/minecraft/world/chunk/ChunkStatus$ILoadingWorker;)V
private-f net.minecraft.world.gen.DebugChunkGenerator field_177464_a #ALL_VALID_STATES
private-f net.minecraft.world.gen.DebugChunkGenerator field_177462_b #GRID_WIDTH
private-f net.minecraft.world.gen.DebugChunkGenerator field_181039_c #GRID_HEIGHT
public net.minecraft.world.gen.layer.LayerUtil func_202829_a(JLnet/minecraft/world/gen/layer/traits/IAreaTransformer1;Lnet/minecraft/world/gen/area/IAreaFactory;ILjava/util/function/LongFunction;)Lnet/minecraft/world/gen/area/IAreaFactory; # repeat
private-f net.minecraft.world.raid.Raid$WaveMember field_221284_f # VALUES
private-f net.minecraft.world.server.ChunkHolder field_219320_o # block update location
public net.minecraft.world.server.ServerChunkProvider field_186029_c # chunkGenerator
public net.minecraft.world.server.ServerChunkProvider field_73251_h # worldObj
public net.minecraft.world.storage.FolderName <init>(Ljava/lang/String;)V # constructor
public net.minecraft.world.storage.FolderName <init>(Ljava/lang/String;)V # constructor