Update to Minecraft 1.21

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-06-14 01:05:00 +10:00
parent 7c6204e1a9
commit eed041d629
255 changed files with 3585 additions and 3261 deletions

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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;