net.minecraft.world.level.levelgen.structure.structures
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/structures/DesertPyramidStructure.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/structures/DesertPyramidStructure.java
|
||||
@@ -68,6 +68,15 @@
|
||||
|
||||
private static void placeSuspiciousSand(BoundingBox box, WorldGenLevel world, BlockPos pos) {
|
||||
if (box.isInside(pos)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (world instanceof org.bukkit.craftbukkit.util.TransformerGeneratorAccess transformerAccess) {
|
||||
+ org.bukkit.craftbukkit.block.CraftBrushableBlock brushableState = (org.bukkit.craftbukkit.block.CraftBrushableBlock) org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(world, pos, Blocks.SUSPICIOUS_SAND.defaultBlockState(), null);
|
||||
+ brushableState.setLootTable(org.bukkit.craftbukkit.CraftLootTable.minecraftToBukkit(BuiltInLootTables.DESERT_PYRAMID_ARCHAEOLOGY));
|
||||
+ brushableState.setSeed(pos.asLong());
|
||||
+ transformerAccess.setCraftBlock(pos, brushableState, 2);
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.setBlock(pos, Blocks.SUSPICIOUS_SAND.defaultBlockState(), 2);
|
||||
world.getBlockEntity(pos, BlockEntityType.BRUSHABLE_BLOCK).ifPresent((brushableblockentity) -> {
|
||||
brushableblockentity.setLootTable(BuiltInLootTables.DESERT_PYRAMID_ARCHAEOLOGY, pos.asLong());
|
||||
@@ -1,16 +0,0 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/structures/EndCityPieces.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/structures/EndCityPieces.java
|
||||
@@ -285,7 +285,12 @@
|
||||
BlockPos blockposition1 = pos.below();
|
||||
|
||||
if (boundingBox.isInside(blockposition1)) {
|
||||
- RandomizableContainer.setBlockEntityLootTable(world, random, blockposition1, BuiltInLootTables.END_CITY_TREASURE);
|
||||
+ // CraftBukkit start - ensure block transformation
|
||||
+ /*
|
||||
+ RandomizableContainer.setBlockEntityLootTable(worldaccess, randomsource, blockposition1, LootTables.END_CITY_TREASURE);
|
||||
+ */
|
||||
+ this.setCraftLootTable(world, blockposition1, random, BuiltInLootTables.END_CITY_TREASURE);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
} else if (boundingBox.isInside(pos) && Level.isInSpawnableBounds(pos)) {
|
||||
if (metadata.startsWith("Sentry")) {
|
||||
@@ -1,31 +0,0 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/structures/IglooPieces.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/structures/IglooPieces.java
|
||||
@@ -14,8 +14,6 @@
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.Mirror;
|
||||
import net.minecraft.world.level.block.Rotation;
|
||||
-import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
-import net.minecraft.world.level.block.entity.ChestBlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
@@ -86,11 +84,16 @@
|
||||
protected void handleDataMarker(String metadata, BlockPos pos, ServerLevelAccessor world, RandomSource random, BoundingBox boundingBox) {
|
||||
if ("chest".equals(metadata)) {
|
||||
world.setBlock(pos, Blocks.AIR.defaultBlockState(), 3);
|
||||
- BlockEntity tileentity = world.getBlockEntity(pos.below());
|
||||
+ // CraftBukkit start - ensure block transformation
|
||||
+ /*
|
||||
+ TileEntity tileentity = worldaccess.getBlockEntity(blockposition.below());
|
||||
|
||||
- if (tileentity instanceof ChestBlockEntity) {
|
||||
- ((ChestBlockEntity) tileentity).setLootTable(BuiltInLootTables.IGLOO_CHEST, random.nextLong());
|
||||
+ if (tileentity instanceof TileEntityChest) {
|
||||
+ ((TileEntityChest) tileentity).setLootTable(LootTables.IGLOO_CHEST, randomsource.nextLong());
|
||||
}
|
||||
+ */
|
||||
+ this.setCraftLootTable(world, pos.below(), random, BuiltInLootTables.IGLOO_CHEST);
|
||||
+ // CraftBukkit end
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/structures/MineshaftPieces.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/structures/MineshaftPieces.java
|
||||
@@ -12,6 +12,7 @@
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtOps;
|
||||
+import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.tags.BiomeTags;
|
||||
import net.minecraft.util.RandomSource;
|
||||
@@ -30,8 +31,6 @@
|
||||
import net.minecraft.world.level.block.FenceBlock;
|
||||
import net.minecraft.world.level.block.RailBlock;
|
||||
import net.minecraft.world.level.block.WallTorchBlock;
|
||||
-import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
-import net.minecraft.world.level.block.entity.SpawnerBlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.properties.RailShape;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
@@ -520,14 +519,19 @@
|
||||
|
||||
if (chunkBox.isInside(blockposition_mutableblockposition) && this.isInterior(world, 1, 0, l, chunkBox)) {
|
||||
this.hasPlacedSpider = true;
|
||||
- world.setBlock(blockposition_mutableblockposition, Blocks.SPAWNER.defaultBlockState(), 2);
|
||||
- BlockEntity tileentity = world.getBlockEntity(blockposition_mutableblockposition);
|
||||
-
|
||||
- if (tileentity instanceof SpawnerBlockEntity) {
|
||||
- SpawnerBlockEntity tileentitymobspawner = (SpawnerBlockEntity) tileentity;
|
||||
+ // CraftBukkit start
|
||||
+ /*
|
||||
+ generatoraccessseed.setBlock(blockposition_mutableblockposition, Blocks.SPAWNER.defaultBlockState(), 2);
|
||||
+ TileEntity tileentity = generatoraccessseed.getBlockEntity(blockposition_mutableblockposition);
|
||||
|
||||
- tileentitymobspawner.setEntityId(EntityType.CAVE_SPIDER, random);
|
||||
+ if (tileentity instanceof TileEntityMobSpawner) {
|
||||
+ TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner) tileentity;
|
||||
+
|
||||
+ tileentitymobspawner.setEntityId(EntityTypes.CAVE_SPIDER, randomsource);
|
||||
}
|
||||
+ */
|
||||
+ this.placeCraftSpawner(world, blockposition_mutableblockposition, org.bukkit.entity.EntityType.CAVE_SPIDER, 2);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -819,11 +823,11 @@
|
||||
|
||||
public MineShaftRoom(CompoundTag nbt) {
|
||||
super(StructurePieceType.MINE_SHAFT_ROOM, nbt);
|
||||
- DataResult dataresult = BoundingBox.CODEC.listOf().parse(NbtOps.INSTANCE, nbt.getList("Entrances", 11));
|
||||
+ DataResult<List<BoundingBox>> dataresult = BoundingBox.CODEC.listOf().parse(NbtOps.INSTANCE, nbt.getList("Entrances", 11)); // CraftBukkit - decompile error
|
||||
Logger logger = MineshaftPieces.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
- Optional optional = dataresult.resultOrPartial(logger::error);
|
||||
+ Optional<List<BoundingBox>> optional = dataresult.resultOrPartial(logger::error); // CraftBukkit - decompile error
|
||||
List list = this.childEntranceBoxes;
|
||||
|
||||
Objects.requireNonNull(this.childEntranceBoxes);
|
||||
@@ -929,7 +933,7 @@
|
||||
@Override
|
||||
protected void addAdditionalSaveData(StructurePieceSerializationContext context, CompoundTag nbt) {
|
||||
super.addAdditionalSaveData(context, nbt);
|
||||
- DataResult dataresult = BoundingBox.CODEC.listOf().encodeStart(NbtOps.INSTANCE, this.childEntranceBoxes);
|
||||
+ DataResult<Tag> dataresult = BoundingBox.CODEC.listOf().encodeStart(NbtOps.INSTANCE, this.childEntranceBoxes); // CraftBukkit - decompile error
|
||||
Logger logger = MineshaftPieces.LOGGER;
|
||||
|
||||
Objects.requireNonNull(logger);
|
||||
@@ -1,45 +0,0 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/structures/NetherFortressPieces.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/structures/NetherFortressPieces.java
|
||||
@@ -8,15 +8,12 @@
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.RandomSource;
|
||||
-import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.StructureManager;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.FenceBlock;
|
||||
import net.minecraft.world.level.block.StairBlock;
|
||||
-import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
-import net.minecraft.world.level.block.entity.SpawnerBlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.structure.BoundingBox;
|
||||
@@ -428,14 +425,19 @@
|
||||
|
||||
if (chunkBox.isInside(blockposition_mutableblockposition)) {
|
||||
this.hasPlacedSpawner = true;
|
||||
- world.setBlock(blockposition_mutableblockposition, Blocks.SPAWNER.defaultBlockState(), 2);
|
||||
- BlockEntity tileentity = world.getBlockEntity(blockposition_mutableblockposition);
|
||||
-
|
||||
- if (tileentity instanceof SpawnerBlockEntity) {
|
||||
- SpawnerBlockEntity tileentitymobspawner = (SpawnerBlockEntity) tileentity;
|
||||
-
|
||||
- tileentitymobspawner.setEntityId(EntityType.BLAZE, random);
|
||||
+ // CraftBukkit start
|
||||
+ /*
|
||||
+ generatoraccessseed.setBlock(blockposition_mutableblockposition, Blocks.SPAWNER.defaultBlockState(), 2);
|
||||
+ TileEntity tileentity = generatoraccessseed.getBlockEntity(blockposition_mutableblockposition);
|
||||
+
|
||||
+ if (tileentity instanceof TileEntityMobSpawner) {
|
||||
+ TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner) tileentity;
|
||||
+
|
||||
+ tileentitymobspawner.setEntityId(EntityTypes.BLAZE, randomsource);
|
||||
}
|
||||
+ */
|
||||
+ this.placeCraftSpawner(world, blockposition_mutableblockposition, org.bukkit.entity.EntityType.BLAZE, 2);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/structures/OceanRuinPieces.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/structures/OceanRuinPieces.java
|
||||
@@ -27,8 +27,6 @@
|
||||
import net.minecraft.world.level.block.ChestBlock;
|
||||
import net.minecraft.world.level.block.Mirror;
|
||||
import net.minecraft.world.level.block.Rotation;
|
||||
-import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
-import net.minecraft.world.level.block.entity.ChestBlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.Heightmap;
|
||||
@@ -200,12 +198,20 @@
|
||||
@Override
|
||||
protected void handleDataMarker(String metadata, BlockPos pos, ServerLevelAccessor world, RandomSource random, BoundingBox boundingBox) {
|
||||
if ("chest".equals(metadata)) {
|
||||
- world.setBlock(pos, (BlockState) Blocks.CHEST.defaultBlockState().setValue(ChestBlock.WATERLOGGED, world.getFluidState(pos).is(FluidTags.WATER)), 2);
|
||||
- BlockEntity tileentity = world.getBlockEntity(pos);
|
||||
-
|
||||
- if (tileentity instanceof ChestBlockEntity) {
|
||||
- ((ChestBlockEntity) tileentity).setLootTable(this.isLarge ? BuiltInLootTables.UNDERWATER_RUIN_BIG : BuiltInLootTables.UNDERWATER_RUIN_SMALL, random.nextLong());
|
||||
+ // CraftBukkit start - transform block to ensure loot table is accessible
|
||||
+ /*
|
||||
+ worldaccess.setBlock(blockposition, (IBlockData) Blocks.CHEST.defaultBlockState().setValue(BlockChest.WATERLOGGED, worldaccess.getFluidState(blockposition).is(TagsFluid.WATER)), 2);
|
||||
+ TileEntity tileentity = worldaccess.getBlockEntity(blockposition);
|
||||
+
|
||||
+ if (tileentity instanceof TileEntityChest) {
|
||||
+ ((TileEntityChest) tileentity).setLootTable(this.isLarge ? LootTables.UNDERWATER_RUIN_BIG : LootTables.UNDERWATER_RUIN_SMALL, randomsource.nextLong());
|
||||
}
|
||||
+ */
|
||||
+ org.bukkit.craftbukkit.block.CraftChest craftChest = (org.bukkit.craftbukkit.block.CraftChest) org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(world, pos, Blocks.CHEST.defaultBlockState().setValue(ChestBlock.WATERLOGGED, world.getFluidState(pos).is(FluidTags.WATER)), null);
|
||||
+ craftChest.setSeed(random.nextLong());
|
||||
+ craftChest.setLootTable(org.bukkit.craftbukkit.CraftLootTable.minecraftToBukkit(this.isLarge ? BuiltInLootTables.UNDERWATER_RUIN_BIG : BuiltInLootTables.UNDERWATER_RUIN_SMALL));
|
||||
+ this.placeCraftBlockEntity(world, pos, craftChest, 2);
|
||||
+ // CraftBukkit end
|
||||
} else if ("drowned".equals(metadata)) {
|
||||
Drowned entitydrowned = (Drowned) EntityType.DROWNED.create(world.getLevel(), EntitySpawnReason.STRUCTURE);
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/structures/ShipwreckPieces.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/structures/ShipwreckPieces.java
|
||||
@@ -79,7 +79,12 @@
|
||||
ResourceKey<LootTable> resourcekey = (ResourceKey) ShipwreckPieces.MARKERS_TO_LOOT.get(metadata);
|
||||
|
||||
if (resourcekey != null) {
|
||||
- RandomizableContainer.setBlockEntityLootTable(world, random, pos.below(), resourcekey);
|
||||
+ // CraftBukkit start - ensure block transformation
|
||||
+ /*
|
||||
+ RandomizableContainer.setBlockEntityLootTable(worldaccess, randomsource, blockposition.below(), resourcekey);
|
||||
+ */
|
||||
+ this.setCraftLootTable(world, pos.below(), random, resourcekey);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/structures/StrongholdPieces.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/structures/StrongholdPieces.java
|
||||
@@ -8,7 +8,6 @@
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.util.RandomSource;
|
||||
-import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.StructureManager;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
@@ -22,8 +21,6 @@
|
||||
import net.minecraft.world.level.block.SlabBlock;
|
||||
import net.minecraft.world.level.block.StairBlock;
|
||||
import net.minecraft.world.level.block.WallTorchBlock;
|
||||
-import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
-import net.minecraft.world.level.block.entity.SpawnerBlockEntity;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.state.properties.DoubleBlockHalf;
|
||||
import net.minecraft.world.level.block.state.properties.SlabType;
|
||||
@@ -53,7 +50,7 @@
|
||||
public boolean doPlace(int chainLength) {
|
||||
return super.doPlace(chainLength) && chainLength > 5;
|
||||
}
|
||||
- }};
|
||||
+ } }; // CraftBukkit - fix decompile styling
|
||||
private static List<StrongholdPieces.PieceWeight> currentPieces;
|
||||
static Class<? extends StrongholdPieces.StrongholdPiece> imposedPiece;
|
||||
private static int totalWeight;
|
||||
@@ -1136,14 +1133,19 @@
|
||||
|
||||
if (chunkBox.isInside(blockposition_mutableblockposition)) {
|
||||
this.hasPlacedSpawner = true;
|
||||
- world.setBlock(blockposition_mutableblockposition, Blocks.SPAWNER.defaultBlockState(), 2);
|
||||
- BlockEntity tileentity = world.getBlockEntity(blockposition_mutableblockposition);
|
||||
-
|
||||
- if (tileentity instanceof SpawnerBlockEntity) {
|
||||
- SpawnerBlockEntity tileentitymobspawner = (SpawnerBlockEntity) tileentity;
|
||||
-
|
||||
- tileentitymobspawner.setEntityId(EntityType.SILVERFISH, random);
|
||||
+ // CraftBukkit start
|
||||
+ /*
|
||||
+ generatoraccessseed.setBlock(blockposition_mutableblockposition, Blocks.SPAWNER.defaultBlockState(), 2);
|
||||
+ TileEntity tileentity = generatoraccessseed.getBlockEntity(blockposition_mutableblockposition);
|
||||
+
|
||||
+ if (tileentity instanceof TileEntityMobSpawner) {
|
||||
+ TileEntityMobSpawner tileentitymobspawner = (TileEntityMobSpawner) tileentity;
|
||||
+
|
||||
+ tileentitymobspawner.setEntityId(EntityTypes.SILVERFISH, randomsource);
|
||||
}
|
||||
+ */
|
||||
+ this.placeCraftSpawner(world, blockposition_mutableblockposition, org.bukkit.entity.EntityType.SILVERFISH, 2);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/structures/SwampHutPiece.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/structures/SwampHutPiece.java
|
||||
@@ -100,7 +100,7 @@
|
||||
entitywitch.setPersistenceRequired();
|
||||
entitywitch.moveTo((double) blockposition_mutableblockposition.getX() + 0.5D, (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D, 0.0F, 0.0F);
|
||||
entitywitch.finalizeSpawn(world, world.getCurrentDifficultyAt(blockposition_mutableblockposition), EntitySpawnReason.STRUCTURE, (SpawnGroupData) null);
|
||||
- world.addFreshEntityWithPassengers(entitywitch);
|
||||
+ world.addFreshEntityWithPassengers(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,7 @@
|
||||
entitycat.setPersistenceRequired();
|
||||
entitycat.moveTo((double) blockposition_mutableblockposition.getX() + 0.5D, (double) blockposition_mutableblockposition.getY(), (double) blockposition_mutableblockposition.getZ() + 0.5D, 0.0F, 0.0F);
|
||||
entitycat.finalizeSpawn(world, world.getCurrentDifficultyAt(blockposition_mutableblockposition), EntitySpawnReason.STRUCTURE, (SpawnGroupData) null);
|
||||
- world.addFreshEntityWithPassengers(entitycat);
|
||||
+ world.addFreshEntityWithPassengers(entitycat, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CHUNK_GEN); // CraftBukkit - add SpawnReason
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user