Repackage NMS

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-03-16 09:00:00 +11:00
parent 18496e998f
commit 9da047989c
968 changed files with 5448 additions and 5050 deletions

View File

@@ -1,12 +1,16 @@
--- a/net/minecraft/server/World.java
+++ b/net/minecraft/server/World.java
@@ -14,6 +14,17 @@
--- a/net/minecraft/world/level/World.java
+++ b/net/minecraft/world/level/World.java
@@ -62,6 +62,21 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import java.util.HashMap;
+import java.util.Map;
+import net.minecraft.network.protocol.game.PacketPlayOutWorldBorder;
+import net.minecraft.server.level.WorldServer;
+import net.minecraft.world.entity.item.EntityItem;
+import net.minecraft.world.level.border.IWorldBorderListener;
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.CraftServer;
+import org.bukkit.craftbukkit.CraftWorld;
@@ -18,7 +22,7 @@
public abstract class World implements GeneratorAccess, AutoCloseable {
protected static final Logger LOGGER = LogManager.getLogger();
@@ -45,7 +56,49 @@
@@ -93,7 +108,49 @@
private final BiomeManager biomeManager;
private final ResourceKey<World> dimensionKey;
@@ -69,7 +73,7 @@
this.methodProfiler = supplier;
this.worldData = worlddatamutable;
this.x = dimensionmanager;
@@ -55,12 +108,12 @@
@@ -103,12 +160,12 @@
this.worldBorder = new WorldBorder() {
@Override
public double getCenterX() {
@@ -84,7 +88,7 @@
}
};
} else {
@@ -70,6 +123,35 @@
@@ -118,6 +175,35 @@
this.serverThread = Thread.currentThread();
this.biomeManager = new BiomeManager(this, i, dimensionmanager.getGenLayerZoomer());
this.debugWorld = flag1;
@@ -120,7 +124,7 @@
}
@Override
@@ -133,6 +215,17 @@
@@ -181,6 +267,17 @@
@Override
public boolean a(BlockPosition blockposition, IBlockData iblockdata, int i, int j) {
@@ -138,7 +142,7 @@
if (isOutsideWorld(blockposition)) {
return false;
} else if (!this.isClientSide && this.isDebugWorld()) {
@@ -140,9 +233,24 @@
@@ -188,9 +285,24 @@
} else {
Chunk chunk = this.getChunkAtWorldCoords(blockposition);
Block block = iblockdata.getBlock();
@@ -164,7 +168,7 @@
return false;
} else {
IBlockData iblockdata2 = this.getType(blockposition);
@@ -153,6 +261,7 @@
@@ -201,6 +313,7 @@
this.getMethodProfiler().exit();
}
@@ -172,7 +176,7 @@
if (iblockdata2 == iblockdata) {
if (iblockdata1 != iblockdata2) {
this.b(blockposition, iblockdata1, iblockdata2);
@@ -179,12 +288,65 @@
@@ -227,12 +340,65 @@
this.a(blockposition, iblockdata1, iblockdata2);
}
@@ -238,7 +242,7 @@
public void a(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {}
@Override
@@ -266,6 +428,17 @@
@@ -314,6 +480,17 @@
IBlockData iblockdata = this.getType(blockposition);
try {
@@ -256,7 +260,7 @@
iblockdata.doPhysics(this, blockposition, block, blockposition1, false);
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Exception while updating neighbours");
@@ -308,6 +481,14 @@
@@ -356,6 +533,14 @@
@Override
public IBlockData getType(BlockPosition blockposition) {
@@ -271,7 +275,7 @@
if (isOutsideWorld(blockposition)) {
return Blocks.VOID_AIR.getBlockData();
} else {
@@ -455,9 +636,11 @@
@@ -503,9 +688,11 @@
TileEntity tileentity1 = (TileEntity) this.tileEntityListPending.get(i);
if (!tileentity1.isRemoved()) {
@@ -283,7 +287,7 @@
if (this.isLoaded(tileentity1.getPosition())) {
Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition());
@@ -465,6 +648,12 @@
@@ -513,6 +700,12 @@
chunk.setTileEntity(tileentity1.getPosition(), tileentity1);
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
@@ -296,7 +300,7 @@
}
}
}
@@ -509,12 +698,25 @@
@@ -557,12 +750,25 @@
@Nullable
@Override
@@ -306,7 +310,7 @@
+ }
+
+ @Nullable
+ protected TileEntity getTileEntity(BlockPosition blockposition, boolean validate) {
+ public TileEntity getTileEntity(BlockPosition blockposition, boolean validate) {
+ // CraftBukkit end
if (isOutsideWorld(blockposition)) {
return null;
@@ -322,7 +326,7 @@
TileEntity tileentity = null;
if (this.tickingTileEntities) {
@@ -549,6 +751,13 @@
@@ -597,6 +803,13 @@
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
if (!isOutsideWorld(blockposition)) {
if (tileentity != null && !tileentity.isRemoved()) {
@@ -336,7 +340,7 @@
if (this.tickingTileEntities) {
tileentity.setLocation(this, blockposition);
Iterator iterator = this.tileEntityListPending.iterator();
@@ -573,7 +782,7 @@
@@ -621,7 +834,7 @@
}
public void removeTileEntity(BlockPosition blockposition) {