@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/levelgen/ChunkProviderFlat.java
|
||||
+++ b/net/minecraft/world/level/levelgen/ChunkProviderFlat.java
|
||||
@@ -35,10 +35,16 @@
|
||||
@@ -34,10 +34,16 @@
|
||||
private final GeneratorSettingsFlat settings;
|
||||
|
||||
public ChunkProviderFlat(GeneratorSettingsFlat generatorsettingsflat) {
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
--- a/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
|
||||
+++ b/net/minecraft/world/level/levelgen/feature/EndPlatformFeature.java
|
||||
@@ -8,6 +8,12 @@
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.WorldGenFeatureEmptyConfiguration;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.List;
|
||||
+import org.bukkit.block.BlockState;
|
||||
+import org.bukkit.event.world.PortalCreateEvent;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class EndPlatformFeature extends WorldGenerator<WorldGenFeatureEmptyConfiguration> {
|
||||
|
||||
public EndPlatformFeature(Codec<WorldGenFeatureEmptyConfiguration> codec) {
|
||||
@@ -21,6 +27,13 @@
|
||||
}
|
||||
|
||||
public static void createEndPlatform(WorldAccess worldaccess, BlockPosition blockposition, boolean flag) {
|
||||
+ createEndPlatform(worldaccess, blockposition, flag, null);
|
||||
+ // CraftBukkit start
|
||||
+ }
|
||||
+
|
||||
+ public static void createEndPlatform(WorldAccess worldaccess, BlockPosition blockposition, boolean flag, Entity entity) {
|
||||
+ org.bukkit.craftbukkit.util.BlockStateListPopulator blockList = new org.bukkit.craftbukkit.util.BlockStateListPopulator(worldaccess);
|
||||
+ // CraftBukkit end
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = blockposition.mutable();
|
||||
|
||||
for (int i = -2; i <= 2; ++i) {
|
||||
@@ -29,16 +42,27 @@
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition1 = blockposition_mutableblockposition.set(blockposition).move(j, k, i);
|
||||
Block block = k == -1 ? Blocks.OBSIDIAN : Blocks.AIR;
|
||||
|
||||
- if (!worldaccess.getBlockState(blockposition_mutableblockposition1).is(block)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (!blockList.getBlockState(blockposition_mutableblockposition1).is(block)) {
|
||||
if (flag) {
|
||||
- worldaccess.destroyBlock(blockposition_mutableblockposition1, true, (Entity) null);
|
||||
+ blockList.destroyBlock(blockposition_mutableblockposition1, true, (Entity) null);
|
||||
}
|
||||
|
||||
- worldaccess.setBlock(blockposition_mutableblockposition1, block.defaultBlockState(), 3);
|
||||
+ blockList.setBlock(blockposition_mutableblockposition1, block.defaultBlockState(), 3);
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.World bworld = worldaccess.getLevel().getWorld();
|
||||
+ PortalCreateEvent portalEvent = new PortalCreateEvent((List<BlockState>) (List) blockList.getList(), bworld, (entity == null) ? null : entity.getBukkitEntity(), org.bukkit.event.world.PortalCreateEvent.CreateReason.END_PLATFORM);
|
||||
+
|
||||
+ worldaccess.getLevel().getCraftServer().getPluginManager().callEvent(portalEvent);
|
||||
+ if (!portalEvent.isCancelled()) {
|
||||
+ blockList.updateList();
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
}
|
||||
}
|
||||
@@ -9,25 +9,7 @@
|
||||
|
||||
protected StructurePiece(WorldGenFeatureStructurePieceType worldgenfeaturestructurepiecetype, int i, StructureBoundingBox structureboundingbox) {
|
||||
this.type = worldgenfeaturestructurepiecetype;
|
||||
@@ -60,14 +60,11 @@
|
||||
}
|
||||
|
||||
public StructurePiece(WorldGenFeatureStructurePieceType worldgenfeaturestructurepiecetype, NBTTagCompound nbttagcompound) {
|
||||
- int i = nbttagcompound.getInt("GD");
|
||||
- DataResult dataresult = StructureBoundingBox.CODEC.parse(DynamicOpsNBT.INSTANCE, nbttagcompound.get("BB"));
|
||||
- Logger logger = StructurePiece.LOGGER;
|
||||
-
|
||||
- Objects.requireNonNull(logger);
|
||||
- this(worldgenfeaturestructurepiecetype, i, (StructureBoundingBox) dataresult.resultOrPartial(logger::error).orElseThrow(() -> {
|
||||
+ // CraftBukkit start - decompile error
|
||||
+ this(worldgenfeaturestructurepiecetype, nbttagcompound.getInt("GD"), (StructureBoundingBox) StructureBoundingBox.CODEC.parse(DynamicOpsNBT.INSTANCE, nbttagcompound.get("BB")).resultOrPartial(Objects.requireNonNull(StructurePiece.LOGGER)::error).orElseThrow(() -> {
|
||||
return new IllegalArgumentException("Invalid boundingbox");
|
||||
}));
|
||||
+ // CraftBukkit end
|
||||
int j = nbttagcompound.getInt("O");
|
||||
|
||||
this.setOrientation(j == -1 ? null : EnumDirection.from2DDataValue(j));
|
||||
@@ -85,13 +82,11 @@
|
||||
@@ -80,13 +80,11 @@
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
|
||||
nbttagcompound.putString("id", BuiltInRegistries.STRUCTURE_PIECE.getKey(this.getType()).toString());
|
||||
@@ -45,7 +27,7 @@
|
||||
EnumDirection enumdirection = this.getOrientation();
|
||||
|
||||
nbttagcompound.putInt("O", enumdirection == null ? -1 : enumdirection.get2DDataValue());
|
||||
@@ -191,6 +186,11 @@
|
||||
@@ -186,6 +184,11 @@
|
||||
}
|
||||
|
||||
generatoraccessseed.setBlock(blockposition_mutableblockposition, iblockdata, 2);
|
||||
@@ -57,7 +39,7 @@
|
||||
Fluid fluid = generatoraccessseed.getFluidState(blockposition_mutableblockposition);
|
||||
|
||||
if (!fluid.isEmpty()) {
|
||||
@@ -205,6 +205,38 @@
|
||||
@@ -200,6 +203,38 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,7 +78,7 @@
|
||||
protected boolean canBeReplaced(IWorldReader iworldreader, int i, int j, int k, StructureBoundingBox structureboundingbox) {
|
||||
return true;
|
||||
}
|
||||
@@ -398,12 +430,20 @@
|
||||
@@ -393,12 +428,20 @@
|
||||
iblockdata = reorient(worldaccess, blockposition, Blocks.CHEST.defaultBlockState());
|
||||
}
|
||||
|
||||
@@ -117,7 +99,7 @@
|
||||
|
||||
return true;
|
||||
} else {
|
||||
@@ -415,12 +455,31 @@
|
||||
@@ -410,12 +453,31 @@
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = this.getWorldPos(i, j, k);
|
||||
|
||||
if (structureboundingbox.isInside(blockposition_mutableblockposition) && !generatoraccessseed.getBlockState(blockposition_mutableblockposition).is(Blocks.DISPENSER)) {
|
||||
@@ -149,7 +131,7 @@
|
||||
|
||||
return true;
|
||||
} else {
|
||||
@@ -433,7 +492,7 @@
|
||||
@@ -428,7 +490,7 @@
|
||||
}
|
||||
|
||||
public static StructureBoundingBox createBoundingBox(Stream<StructurePiece> stream) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/structures/IglooPieces.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/structures/IglooPieces.java
|
||||
@@ -85,11 +85,16 @@
|
||||
@@ -86,11 +86,16 @@
|
||||
protected void handleDataMarker(String s, BlockPosition blockposition, WorldAccess worldaccess, RandomSource randomsource, StructureBoundingBox structureboundingbox) {
|
||||
if ("chest".equals(s)) {
|
||||
worldaccess.setBlock(blockposition, Blocks.AIR.defaultBlockState(), 3);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureInfo.java
|
||||
+++ b/net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureInfo.java
|
||||
@@ -22,7 +22,7 @@
|
||||
private boolean keepLiquids;
|
||||
private LiquidSettings liquidSettings;
|
||||
@Nullable
|
||||
private RandomSource random;
|
||||
- private int palette;
|
||||
|
||||
Reference in New Issue
Block a user