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

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/level/World.java
+++ b/net/minecraft/world/level/World.java
@@ -77,6 +77,28 @@
@@ -78,6 +78,28 @@
import net.minecraft.world.phys.Vec3D;
import net.minecraft.world.scores.Scoreboard;
@@ -29,7 +29,7 @@
public abstract class World implements GeneratorAccess, AutoCloseable {
public static final Codec<ResourceKey<World>> RESOURCE_KEY_CODEC = ResourceKey.codec(Registries.DIMENSION);
@@ -118,7 +140,42 @@
@@ -119,7 +141,42 @@
private final DamageSources damageSources;
private long subTickCount;
@@ -73,7 +73,7 @@
this.profiler = supplier;
this.levelData = worlddatamutable;
this.dimensionTypeRegistration = holder;
@@ -127,15 +184,15 @@
@@ -128,15 +185,15 @@
this.dimension = resourcekey;
this.isClientSide = flag;
if (dimensionmanager.coordinateScale() != 1.0D) {
@@ -92,7 +92,7 @@
}
};
} else {
@@ -148,6 +205,42 @@
@@ -149,6 +206,42 @@
this.neighborUpdater = new CollectingNeighborUpdater(this, j);
this.registryAccess = iregistrycustom;
this.damageSources = new DamageSources(iregistrycustom);
@@ -135,7 +135,7 @@
}
@Override
@@ -205,6 +298,18 @@
@@ -206,6 +299,18 @@
@Override
public boolean setBlock(BlockPosition blockposition, IBlockData iblockdata, int i, int j) {
@@ -154,7 +154,7 @@
if (this.isOutsideBuildHeight(blockposition)) {
return false;
} else if (!this.isClientSide && this.isDebug()) {
@@ -212,13 +317,29 @@
@@ -213,13 +318,29 @@
} else {
Chunk chunk = this.getChunkAt(blockposition);
Block block = iblockdata.getBlock();
@@ -185,7 +185,7 @@
if (iblockdata2 == iblockdata) {
if (iblockdata1 != iblockdata2) {
this.setBlocksDirty(blockposition, iblockdata1, iblockdata2);
@@ -245,12 +366,69 @@
@@ -246,12 +367,69 @@
this.onBlockStateChange(blockposition, iblockdata1, iblockdata2);
}
@@ -255,7 +255,7 @@
public void onBlockStateChange(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
@Override
@@ -336,6 +514,14 @@
@@ -337,6 +515,14 @@
@Override
public IBlockData getBlockState(BlockPosition blockposition) {
@@ -270,7 +270,7 @@
if (this.isOutsideBuildHeight(blockposition)) {
return Blocks.VOID_AIR.defaultBlockState();
} else {
@@ -518,6 +704,11 @@
@@ -523,6 +709,11 @@
case 4:
explosion_effect = Explosion.Effect.TRIGGER_BLOCK;
break;
@@ -282,7 +282,7 @@
default:
throw new MatchException((String) null, (Throwable) null);
}
@@ -539,6 +730,16 @@
@@ -544,6 +735,16 @@
@Nullable
@Override
public TileEntity getBlockEntity(BlockPosition blockposition) {
@@ -299,7 +299,7 @@
return this.isOutsideBuildHeight(blockposition) ? null : (!this.isClientSide && Thread.currentThread() != this.thread ? null : this.getChunkAt(blockposition).getBlockEntity(blockposition, Chunk.EnumTileEntityState.IMMEDIATE));
}
@@ -546,6 +747,12 @@
@@ -551,6 +752,12 @@
BlockPosition blockposition = tileentity.getBlockPos();
if (!this.isOutsideBuildHeight(blockposition)) {
@@ -312,7 +312,7 @@
this.getChunkAt(blockposition).addAndRegisterBlockEntity(tileentity);
}
}
@@ -675,7 +882,7 @@
@@ -680,7 +887,7 @@
for (int k = 0; k < j; ++k) {
EntityComplexPart entitycomplexpart = aentitycomplexpart[k];
@@ -321,12 +321,12 @@
if (t0 != null && predicate.test(t0)) {
list.add(t0);
@@ -953,7 +1160,7 @@
@@ -958,7 +1165,7 @@
public static enum a {
public static enum a implements INamable {
- NONE, BLOCK, MOB, TNT, BLOW;
+ NONE, BLOCK, MOB, TNT, BLOW, STANDARD; // CraftBukkit - Add STANDARD which will always use Explosion.Effect.DESTROY
- NONE("none"), BLOCK("block"), MOB("mob"), TNT("tnt"), TRIGGER("trigger");
+ NONE("none"), BLOCK("block"), MOB("mob"), TNT("tnt"), TRIGGER("trigger"), STANDARD("standard"); // CraftBukkit - Add STANDARD which will always use Explosion.Effect.DESTROY
private a() {}
}
public static final Codec<World.a> CODEC = INamable.fromEnum(World.a::values);
private final String id;