From bf3d7207140a295c35d4024a43cd188824c5a359 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 11 Sep 2020 07:00:00 +1000 Subject: [PATCH] Update to Minecraft 1.16.3 --- nms-patches/CommandListenerWrapper.patch | 2 +- nms-patches/DedicatedServer.patch | 6 ++-- nms-patches/Entity.patch | 2 +- nms-patches/EntityArmorStand.patch | 9 ------ nms-patches/EntityBoat.patch | 2 +- nms-patches/EntityCow.patch | 2 +- nms-patches/EntityEnderSignal.patch | 6 ++-- nms-patches/EntityIllagerWizard.patch | 2 +- nms-patches/EntityInsentient.patch | 28 +++++++----------- nms-patches/EntityLiving.patch | 29 +++++++------------ nms-patches/EntityPlayer.patch | 4 +-- nms-patches/EntityTrackerEntry.patch | 2 +- nms-patches/ItemActionContext.patch | 11 ------- nms-patches/ItemEnderEye.patch | 2 +- nms-patches/MinecraftServer.patch | 21 ++++---------- nms-patches/TileEntityBarrel.patch | 4 +-- nms-patches/World.patch | 2 +- nms-patches/WorldServer.patch | 2 +- pom.xml | 4 +-- .../org/bukkit/craftbukkit/CraftServer.java | 10 +++---- .../java/org/bukkit/craftbukkit/Main.java | 6 ++-- .../bukkit/craftbukkit/block/CraftBarrel.java | 2 +- .../bukkit/craftbukkit/block/CraftBlock.java | 2 +- .../craftbukkit/entity/CraftArmorStand.java | 6 ++-- .../craftbukkit/entity/CraftEnderSignal.java | 4 +-- .../craftbukkit/entity/CraftLivingEntity.java | 8 ++--- .../craftbukkit/util/CraftMagicNumbers.java | 2 +- 27 files changed, 67 insertions(+), 113 deletions(-) delete mode 100644 nms-patches/ItemActionContext.patch diff --git a/nms-patches/CommandListenerWrapper.patch b/nms-patches/CommandListenerWrapper.patch index 16ade7a3e9..3dd3ade5c7 100644 --- a/nms-patches/CommandListenerWrapper.patch +++ b/nms-patches/CommandListenerWrapper.patch @@ -51,7 +51,7 @@ } @@ -252,4 +268,10 @@ public IRegistryCustom q() { - return this.i.aX(); + return this.i.getCustomRegistry(); } + + // CraftBukkit start diff --git a/nms-patches/DedicatedServer.patch b/nms-patches/DedicatedServer.patch index 3aebd2f4d8..751bda7717 100644 --- a/nms-patches/DedicatedServer.patch +++ b/nms-patches/DedicatedServer.patch @@ -121,7 +121,7 @@ } + // CraftBukkit start -+ this.a((PlayerList) (new DedicatedPlayerList(this, this.f, this.worldNBTStorage))); ++ this.a((PlayerList) (new DedicatedPlayerList(this, this.customRegistry, this.worldNBTStorage))); + server.loadPlugins(); + server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.STARTUP); + // CraftBukkit end @@ -133,8 +133,8 @@ if (!NameReferencingFileConverter.e(this)) { return false; } else { -- this.a((PlayerList) (new DedicatedPlayerList(this, this.f, this.worldNBTStorage))); -+ // this.a((PlayerList) (new DedicatedPlayerList(this, this.f, this.worldNBTStorage))); // CraftBukkit - moved up +- this.a((PlayerList) (new DedicatedPlayerList(this, this.customRegistry, this.worldNBTStorage))); ++ // this.a((PlayerList) (new DedicatedPlayerList(this, this.customRegistry, this.worldNBTStorage))); // CraftBukkit - moved up long i = SystemUtils.getMonotonicNanos(); this.c(dedicatedserverproperties.maxBuildHeight); diff --git a/nms-patches/Entity.patch b/nms-patches/Entity.patch index f8c286b07a..ead9b52484 100644 --- a/nms-patches/Entity.patch +++ b/nms-patches/Entity.patch @@ -607,7 +607,7 @@ + // CraftBukkit end this.world.getMethodProfiler().enter("reposition"); - ShapeDetectorShape shapedetectorshape = this.a(worldserver); -+ ShapeDetectorShape shapedetectorshape = (location == null) ? this.a(worldserver) : new ShapeDetectorShape(new Vec3D(location.getX(), location.getY(), location.getZ()), Vec3D.a, this.yaw, this.pitch, worldserver, null); // CraftBukkit ++ ShapeDetectorShape shapedetectorshape = (location == null) ? this.a(worldserver) : new ShapeDetectorShape(new Vec3D(location.getX(), location.getY(), location.getZ()), Vec3D.ORIGIN, this.yaw, this.pitch, worldserver, null); // CraftBukkit if (shapedetectorshape == null) { return null; diff --git a/nms-patches/EntityArmorStand.patch b/nms-patches/EntityArmorStand.patch index b4e017e06b..7de504dcde 100644 --- a/nms-patches/EntityArmorStand.patch +++ b/nms-patches/EntityArmorStand.patch @@ -16,15 +16,6 @@ public class EntityArmorStand extends EntityLiving { private static final Vector3f bj = new Vector3f(0.0F, 0.0F, 0.0F); -@@ -29,7 +38,7 @@ - private final NonNullList armorItems; - private boolean armorStandInvisible; - public long bi; -- private int bv; -+ public int bv; //PAIL private -> public, rename disabledSlots - public Vector3f headPose; - public Vector3f bodyPose; - public Vector3f leftArmPose; @@ -55,6 +64,13 @@ this.setPosition(d0, d1, d2); } diff --git a/nms-patches/EntityBoat.patch b/nms-patches/EntityBoat.patch index d3b5c01fa2..ce60e757ae 100644 --- a/nms-patches/EntityBoat.patch +++ b/nms-patches/EntityBoat.patch @@ -106,7 +106,7 @@ public void tick() { this.ay = this.ax; @@ -225,6 +285,22 @@ - this.setMot(Vec3D.a); + this.setMot(Vec3D.ORIGIN); } + // CraftBukkit start diff --git a/nms-patches/EntityCow.patch b/nms-patches/EntityCow.patch index 131985bc20..b65637538b 100644 --- a/nms-patches/EntityCow.patch +++ b/nms-patches/EntityCow.patch @@ -24,7 +24,7 @@ + // CraftBukkit end + entityhuman.playSound(SoundEffects.ENTITY_COW_MILK, 1.0F, 1.0F); -- ItemStack itemstack1 = ItemLiquidUtil.a(itemstack, entityhuman, Items.MILK_BUCKET.r()); +- ItemStack itemstack1 = ItemLiquidUtil.a(itemstack, entityhuman, Items.MILK_BUCKET.createItemStack()); + ItemStack itemstack1 = ItemLiquidUtil.a(itemstack, entityhuman, CraftItemStack.asNMSCopy(event.getItemStack())); // CraftBukkit entityhuman.a(enumhand, itemstack1); diff --git a/nms-patches/EntityEnderSignal.patch b/nms-patches/EntityEnderSignal.patch index 42abc7028c..68577115ed 100644 --- a/nms-patches/EntityEnderSignal.patch +++ b/nms-patches/EntityEnderSignal.patch @@ -3,7 +3,7 @@ @@ -20,8 +20,8 @@ } - public void b(ItemStack itemstack) { + public void setItem(ItemStack itemstack) { - if (itemstack.getItem() != Items.ENDER_EYE || itemstack.hasTag()) { - this.getDataWatcher().set(EntityEnderSignal.b, SystemUtils.a((Object) itemstack.cloneItemStack(), (itemstack1) -> { + if (true || itemstack.getItem() != Items.ENDER_EYE || itemstack.hasTag()) { // CraftBukkit - always allow item changing @@ -15,8 +15,8 @@ public void loadData(NBTTagCompound nbttagcompound) { ItemStack itemstack = ItemStack.a(nbttagcompound.getCompound("Item")); -- this.b(itemstack); -+ if (!itemstack.isEmpty()) this.b(itemstack); // CraftBukkit - SPIGOT-6103 summon, see also SPIGOT-5474 +- this.setItem(itemstack); ++ if (!itemstack.isEmpty()) this.setItem(itemstack); // CraftBukkit - SPIGOT-6103 summon, see also SPIGOT-5474 } @Override diff --git a/nms-patches/EntityIllagerWizard.patch b/nms-patches/EntityIllagerWizard.patch index 71ae430e27..403b29719f 100644 --- a/nms-patches/EntityIllagerWizard.patch +++ b/nms-patches/EntityIllagerWizard.patch @@ -5,7 +5,7 @@ --this.b; if (this.b == 0) { + // CraftBukkit start -+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleEntitySpellCastEvent(EntityIllagerWizard.this, l())) { // PAIL rename getSpell ++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleEntitySpellCastEvent(EntityIllagerWizard.this, this.getCastSpell())) { + return; + } + // CraftBukkit end diff --git a/nms-patches/EntityInsentient.patch b/nms-patches/EntityInsentient.patch index 04f6595188..f2392c31bf 100644 --- a/nms-patches/EntityInsentient.patch +++ b/nms-patches/EntityInsentient.patch @@ -209,15 +209,7 @@ this.world.getMethodProfiler().enter("sensing"); this.bo.a(); this.world.getMethodProfiler().exit(); -@@ -807,6 +890,7 @@ - - this.a(itemstack); - } -+ this.setSlot(enumitemslot, ItemStack.b); // CraftBukkit - SPIGOT-6109 - } - - } -@@ -1023,6 +1107,12 @@ +@@ -1024,6 +1107,12 @@ if (!this.isAlive()) { return EnumInteractionResult.PASS; } else if (this.getLeashHolder() == entityhuman) { @@ -230,7 +222,7 @@ this.unleash(true, !entityhuman.abilities.canInstantlyBuild); return EnumInteractionResult.a(this.world.isClientSide); } else { -@@ -1041,6 +1131,12 @@ +@@ -1042,6 +1131,12 @@ ItemStack itemstack = entityhuman.b(enumhand); if (itemstack.getItem() == Items.LEAD && this.a(entityhuman)) { @@ -243,7 +235,7 @@ this.setLeashHolder(entityhuman, true); itemstack.subtract(1); return EnumInteractionResult.a(this.world.isClientSide); -@@ -1056,7 +1152,7 @@ +@@ -1057,7 +1152,7 @@ if (itemstack.getItem() instanceof ItemMonsterEgg) { if (this.world instanceof WorldServer) { ItemMonsterEgg itemmonsteregg = (ItemMonsterEgg) itemstack.getItem(); @@ -252,7 +244,7 @@ optional.ifPresent((entityinsentient) -> { this.a(entityhuman, entityinsentient); -@@ -1102,12 +1198,19 @@ +@@ -1103,12 +1198,19 @@ return this.bA != -1.0F; } @@ -273,7 +265,7 @@ t0.u(this); t0.setBaby(this.isBaby()); -@@ -1139,7 +1242,12 @@ +@@ -1140,7 +1242,12 @@ } } @@ -287,7 +279,7 @@ if (this.isPassenger()) { Entity entity = this.getVehicle(); -@@ -1159,6 +1267,7 @@ +@@ -1160,6 +1267,7 @@ if (this.leashHolder != null) { if (!this.isAlive() || !this.leashHolder.isAlive()) { @@ -295,7 +287,7 @@ this.unleash(true, true); } -@@ -1175,7 +1284,9 @@ +@@ -1176,7 +1284,9 @@ this.leashHolder = null; this.by = null; if (!this.world.isClientSide && flag1) { @@ -305,7 +297,7 @@ } if (!this.world.isClientSide && flag && this.world instanceof WorldServer) { -@@ -1225,6 +1336,7 @@ +@@ -1226,6 +1336,7 @@ boolean flag1 = super.a(entity, flag); if (flag1 && this.isLeashed()) { @@ -313,7 +305,7 @@ this.unleash(true, true); } -@@ -1357,7 +1469,14 @@ +@@ -1358,7 +1469,14 @@ int i = EnchantmentManager.getFireAspectEnchantmentLevel(this); if (i > 0) { @@ -329,7 +321,7 @@ } boolean flag = entity.damageEntity(DamageSource.mobAttack(this), f); -@@ -1419,6 +1538,7 @@ +@@ -1420,6 +1538,7 @@ @Override protected void bM() { super.bM(); diff --git a/nms-patches/EntityLiving.patch b/nms-patches/EntityLiving.patch index d28781e851..6d8db8510b 100644 --- a/nms-patches/EntityLiving.patch +++ b/nms-patches/EntityLiving.patch @@ -28,15 +28,6 @@ public abstract class EntityLiving extends Entity { private static final UUID b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D"); -@@ -30,7 +51,7 @@ - public static final DataWatcherObject HEALTH = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.c); - private static final DataWatcherObject f = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.b); - private static final DataWatcherObject g = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.i); -- private static final DataWatcherObject bh = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.b); -+ public static final DataWatcherObject bh = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.b); // PAIL private -> public, rename ARROWS_IN_BODY - private static final DataWatcherObject bi = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.b); - private static final DataWatcherObject> bj = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.m); - protected static final EntitySize ah = EntitySize.c(0.2F, 0.2F); @@ -106,6 +127,21 @@ private float bB; private float bC; @@ -752,7 +743,7 @@ } public final void setArrowCount(int i) { -- this.datawatcher.set(EntityLiving.bh, i); +- this.datawatcher.set(EntityLiving.ARROWS_IN_BODY, i); + // CraftBukkit start + setArrowCount(i, false); } @@ -762,14 +753,14 @@ + if (event.isCancelled()) { + return; + } -+ this.datawatcher.set(EntityLiving.bh, event.getNewAmount()); ++ this.datawatcher.set(EntityLiving.ARROWS_IN_BODY, event.getNewAmount()); + } + // CraftBukkit end + public final int dy() { return (Integer) this.datawatcher.get(EntityLiving.bi); } -@@ -1815,6 +2222,7 @@ +@@ -1816,6 +2223,7 @@ } if (this.onGround && !this.world.isClientSide) { @@ -777,7 +768,7 @@ this.setFlag(7, false); } } else { -@@ -2320,6 +2728,7 @@ +@@ -2321,6 +2729,7 @@ } if (!this.world.isClientSide) { @@ -785,7 +776,7 @@ this.setFlag(7, flag); } -@@ -2440,6 +2849,7 @@ +@@ -2441,6 +2850,7 @@ } public boolean hasLineOfSight(Entity entity) { @@ -793,7 +784,7 @@ Vec3D vec3d = new Vec3D(this.locX(), this.getHeadY(), this.locZ()); Vec3D vec3d1 = new Vec3D(entity.locX(), entity.getHeadY(), entity.locZ()); -@@ -2457,14 +2867,21 @@ +@@ -2458,14 +2868,21 @@ @Override public boolean isInteractable() { @@ -817,7 +808,7 @@ @Override protected void velocityChanged() { this.velocityChanged = this.random.nextDouble() >= this.b(GenericAttributes.KNOCKBACK_RESISTANCE); -@@ -2657,7 +3074,25 @@ +@@ -2658,7 +3075,25 @@ } else { if (!this.activeItem.isEmpty() && this.isHandRaised()) { this.b(this.activeItem, 16); @@ -844,7 +835,7 @@ if (itemstack != this.activeItem) { this.a(enumhand, itemstack); -@@ -2749,10 +3184,18 @@ +@@ -2750,10 +3185,18 @@ } if (flag2) { @@ -866,7 +857,7 @@ } } -@@ -2849,7 +3292,7 @@ +@@ -2850,7 +3293,7 @@ } public void entityWakeup() { @@ -875,7 +866,7 @@ World world = this.world; this.world.getClass(); -@@ -2920,7 +3363,7 @@ +@@ -2921,7 +3364,7 @@ Pair pair = (Pair) iterator.next(); if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) { diff --git a/nms-patches/EntityPlayer.patch b/nms-patches/EntityPlayer.patch index 3a75aed350..f94155c88f 100644 --- a/nms-patches/EntityPlayer.patch +++ b/nms-patches/EntityPlayer.patch @@ -370,8 +370,8 @@ + if (shapedetectorshape != null && this.world.getTypeKey() == DimensionManager.OVERWORLD && worldserver != null && worldserver.getTypeKey() == DimensionManager.THE_END) { // CraftBukkit Vec3D vec3d = shapedetectorshape.position.add(0.0D, -1.0D, 0.0D); -- return new ShapeDetectorShape(vec3d, Vec3D.a, 90.0F, 0.0F); -+ return new ShapeDetectorShape(vec3d, Vec3D.a, 90.0F, 0.0F, worldserver, shapedetectorshape.portalEventInfo); // CraftBukkit +- return new ShapeDetectorShape(vec3d, Vec3D.ORIGIN, 90.0F, 0.0F); ++ return new ShapeDetectorShape(vec3d, Vec3D.ORIGIN, 90.0F, 0.0F, worldserver, shapedetectorshape.portalEventInfo); // CraftBukkit } else { return shapedetectorshape; } diff --git a/nms-patches/EntityTrackerEntry.patch b/nms-patches/EntityTrackerEntry.patch index bcd4869567..7434c607da 100644 --- a/nms-patches/EntityTrackerEntry.patch +++ b/nms-patches/EntityTrackerEntry.patch @@ -23,7 +23,7 @@ + public EntityTrackerEntry(WorldServer worldserver, Entity entity, int i, boolean flag, Consumer> consumer, Set trackedPlayers) { + this.trackedPlayers = trackedPlayers; + // CraftBukkit end - this.m = Vec3D.a; + this.m = Vec3D.ORIGIN; this.p = Collections.emptyList(); this.b = worldserver; @@ -52,16 +61,17 @@ diff --git a/nms-patches/ItemActionContext.patch b/nms-patches/ItemActionContext.patch deleted file mode 100644 index 28a5640fc5..0000000000 --- a/nms-patches/ItemActionContext.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/server/ItemActionContext.java -+++ b/net/minecraft/server/ItemActionContext.java -@@ -15,7 +15,7 @@ - this(entityhuman.world, entityhuman, enumhand, entityhuman.b(enumhand), movingobjectpositionblock); - } - -- protected ItemActionContext(World world, @Nullable EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack, MovingObjectPositionBlock movingobjectpositionblock) { -+ public ItemActionContext(World world, @Nullable EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack, MovingObjectPositionBlock movingobjectpositionblock) { // PAIL protected -> public - this.a = entityhuman; - this.b = enumhand; - this.c = movingobjectpositionblock; diff --git a/nms-patches/ItemEnderEye.patch b/nms-patches/ItemEnderEye.patch index fb6e1c9113..70a234cc1d 100644 --- a/nms-patches/ItemEnderEye.patch +++ b/nms-patches/ItemEnderEye.patch @@ -2,7 +2,7 @@ +++ b/net/minecraft/server/ItemEnderEye.java @@ -61,7 +61,11 @@ - entityendersignal.b(itemstack); + entityendersignal.setItem(itemstack); entityendersignal.a(blockposition); - world.addEntity(entityendersignal); + // CraftBukkit start diff --git a/nms-patches/MinecraftServer.patch b/nms-patches/MinecraftServer.patch index 57728e1953..6474373dbb 100644 --- a/nms-patches/MinecraftServer.patch +++ b/nms-patches/MinecraftServer.patch @@ -25,15 +25,6 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant implements IMojangStatistics, ICommandListener, AutoCloseable { -@@ -73,7 +84,7 @@ - public final DataFixer dataConverterManager; - private String serverIp; - private int serverPort; -- protected final IRegistryCustom.Dimension f; -+ public final IRegistryCustom.Dimension f; - public final Map, WorldServer> worldServer; - private PlayerList playerList; - private volatile boolean isRunning; @@ -124,6 +135,20 @@ private final DefinedStructureManager ak; protected SaveData saveData; @@ -211,7 +202,7 @@ + + org.bukkit.generator.ChunkGenerator gen = this.server.getGenerator(name); + -+ IRegistryCustom.Dimension iregistrycustom_dimension = this.f; ++ IRegistryCustom.Dimension iregistrycustom_dimension = this.customRegistry; + + RegistryReadOps registryreadops = RegistryReadOps.a((DynamicOps) DynamicOpsNBT.a, this.dataPackResources.h(), iregistrycustom_dimension); + worlddata = (WorldDataServer) worldSession.a((DynamicOps) registryreadops, datapackconfiguration); @@ -252,8 +243,8 @@ + ChunkGenerator chunkgenerator; + + if (worlddimension == null) { -+ dimensionmanager = (DimensionManager) this.f.a().d(DimensionManager.OVERWORLD); -+ chunkgenerator = GeneratorSettings.a(this.f.b(IRegistry.ay), this.f.b(IRegistry.ar), (new Random()).nextLong()); ++ dimensionmanager = (DimensionManager) this.customRegistry.a().d(DimensionManager.OVERWORLD); ++ chunkgenerator = GeneratorSettings.a(customRegistry.b(IRegistry.ay), customRegistry.b(IRegistry.ar), (new Random()).nextLong()); + } else { + dimensionmanager = worlddimension.b(); + chunkgenerator = worlddimension.c(); @@ -320,8 +311,8 @@ - Object object; - - if (worlddimension == null) { -- dimensionmanager = (DimensionManager) this.f.a().d(DimensionManager.OVERWORLD); -- object = GeneratorSettings.a(this.f.b(IRegistry.ay), this.f.b(IRegistry.ar), (new Random()).nextLong()); +- dimensionmanager = (DimensionManager) this.customRegistry.a().d(DimensionManager.OVERWORLD); +- object = GeneratorSettings.a(this.customRegistry.b(IRegistry.ay), this.customRegistry.b(IRegistry.ar), (new Random()).nextLong()); - } else { - dimensionmanager = worlddimension.b(); - object = worlddimension.c(); @@ -475,7 +466,7 @@ iworlddataserver.a(worldserver1.getWorldBorder().t()); this.saveData.setCustomBossEvents(this.getBossBattleCustomData().save()); - this.convertable.a(this.f, this.saveData, this.getPlayerList().save()); + this.convertable.a(this.customRegistry, this.saveData, this.getPlayerList().save()); + */ + // CraftBukkit end return flag3; diff --git a/nms-patches/TileEntityBarrel.patch b/nms-patches/TileEntityBarrel.patch index b72513844e..a5779db1fd 100644 --- a/nms-patches/TileEntityBarrel.patch +++ b/nms-patches/TileEntityBarrel.patch @@ -60,8 +60,8 @@ return; } -- boolean flag = (Boolean) iblockdata.get(BlockBarrel.b); -+ boolean flag = (Boolean) iblockdata.get(BlockBarrel.b) && !opened; // CraftBukkit - only set flag if Barrel isn't set open by API. +- boolean flag = (Boolean) iblockdata.get(BlockBarrel.OPEN); ++ boolean flag = (Boolean) iblockdata.get(BlockBarrel.OPEN) && !opened; // CraftBukkit - only set flag if Barrel isn't set open by API. if (flag) { this.playOpenSound(iblockdata, SoundEffects.BLOCK_BARREL_CLOSE); diff --git a/nms-patches/World.patch b/nms-patches/World.patch index c0ee86f6a0..9571fc948c 100644 --- a/nms-patches/World.patch +++ b/nms-patches/World.patch @@ -62,7 +62,7 @@ + this.ticksPerWaterSpawns = this.getServer().getTicksPerWaterSpawns(); // CraftBukkit + this.ticksPerWaterAmbientSpawns = this.getServer().getTicksPerWaterAmbientSpawns(); // CraftBukkit + this.ticksPerAmbientSpawns = this.getServer().getTicksPerAmbientSpawns(); // CraftBukkit -+ this.typeKey = (ResourceKey) this.getServer().getHandle().getServer().f.a().c(dimensionmanager).orElseThrow(() -> { ++ this.typeKey = (ResourceKey) this.getServer().getHandle().getServer().customRegistry.a().c(dimensionmanager).orElseThrow(() -> { + return new IllegalStateException("Unregistered dimension type: " + dimensionmanager); + }); + // CraftBukkit end diff --git a/nms-patches/WorldServer.patch b/nms-patches/WorldServer.patch index fa90a2719b..2e096ae013 100644 --- a/nms-patches/WorldServer.patch +++ b/nms-patches/WorldServer.patch @@ -319,7 +319,7 @@ + + worldDataServer.a(worldserver1.getWorldBorder().t()); + worldDataServer.setCustomBossEvents(this.server.getBossBattleCustomData().save()); -+ convertable.a(this.server.f, this.worldDataServer, this.server.getPlayerList().save()); ++ convertable.a(this.server.customRegistry, this.worldDataServer, this.server.getPlayerList().save()); + // CraftBukkit end } diff --git a/pom.xml b/pom.xml index eb0ffbbfe6..80d5c5bca2 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.bukkit craftbukkit jar - 1.16.2-R0.1-SNAPSHOT + 1.16.3-R0.1-SNAPSHOT CraftBukkit https://www.spigotmc.org/ @@ -12,7 +12,7 @@ true UTF-8 unknown - 1.16.2 + 1.16.3 1_16_R2 1.8 1.8 diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 1084abd710..3607707c1b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -751,7 +751,7 @@ public final class CraftServer implements Server { configuration = YamlConfiguration.loadConfiguration(getConfigFile()); commandsConfiguration = YamlConfiguration.loadConfiguration(getCommandsConfigFile()); - console.propertyManager = new DedicatedServerSettings(console.aX(), console.options); + console.propertyManager = new DedicatedServerSettings(console.getCustomRegistry(), console.options); DedicatedServerProperties config = console.propertyManager.getProperties(); console.setPVP(config.pvp); @@ -983,7 +983,7 @@ public final class CraftServer implements Server { boolean hardcore = creator.hardcore(); - RegistryReadOps registryreadops = RegistryReadOps.a((DynamicOps) DynamicOpsNBT.a, console.dataPackResources.h(), console.f); + RegistryReadOps registryreadops = RegistryReadOps.a((DynamicOps) DynamicOpsNBT.a, console.dataPackResources.h(), console.customRegistry); WorldDataServer worlddata = (WorldDataServer) worldSession.a((DynamicOps) registryreadops, console.datapackconfiguration); WorldSettings worldSettings; @@ -995,7 +995,7 @@ public final class CraftServer implements Server { properties.put("generate-structures", Objects.toString(creator.generateStructures())); properties.put("level-type", Objects.toString(creator.type().getName())); - GeneratorSettings generatorsettings = GeneratorSettings.a(console.aX(), properties); + GeneratorSettings generatorsettings = GeneratorSettings.a(console.getCustomRegistry(), properties); worldSettings = new WorldSettings(name, EnumGamemode.getById(getDefaultGameMode().getValue()), hardcore, EnumDifficulty.EASY, false, new GameRules(), console.datapackconfiguration); worlddata = new WorldDataServer(worldSettings, generatorsettings, Lifecycle.stable()); } @@ -1018,8 +1018,8 @@ public final class CraftServer implements Server { net.minecraft.server.ChunkGenerator chunkgenerator; if (worlddimension == null) { - dimensionmanager = (DimensionManager) console.f.a().d(DimensionManager.OVERWORLD); - chunkgenerator = GeneratorSettings.a(console.f.b(IRegistry.ay), console.f.b(IRegistry.ar), (new Random()).nextLong()); + dimensionmanager = (DimensionManager) console.customRegistry.a().d(DimensionManager.OVERWORLD); + chunkgenerator = GeneratorSettings.a(console.customRegistry.b(IRegistry.ay), console.customRegistry.b(IRegistry.ar), (new Random()).nextLong()); } else { dimensionmanager = worlddimension.b(); chunkgenerator = worlddimension.c(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java index e1b28958f7..17b9475b25 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -149,8 +149,8 @@ public class Main { } float javaVersion = Float.parseFloat(System.getProperty("java.class.version")); - if (javaVersion > 58.0) { - System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 14 is supported."); + if (javaVersion > 59.0) { + System.err.println("Unsupported Java detected (" + javaVersion + "). Only up to Java 15 is supported."); return; } @@ -177,7 +177,7 @@ public class Main { useConsole = false; } - if (false && Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { + if (Main.class.getPackage().getImplementationVendor() != null && System.getProperty("IReallyKnowWhatIAmDoingISwear") == null) { Date buildDate = new Date(Integer.parseInt(Main.class.getPackage().getImplementationVendor()) * 1000L); Calendar deadline = Calendar.getInstance(); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java index c9d9469086..9bfd2d7efd 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java @@ -39,7 +39,7 @@ public class CraftBarrel extends CraftLootable implements Barr requirePlaced(); if (!getTileEntity().opened) { IBlockData blockData = getTileEntity().getBlock(); - boolean open = blockData.get(BlockBarrel.b); + boolean open = blockData.get(BlockBarrel.OPEN); if (!open) { getTileEntity().setOpenFlag(blockData, true); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index 334728b191..5de8463c94 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -636,7 +636,7 @@ public class CraftBlock implements Block { @Override public boolean applyBoneMeal(BlockFace face) { EnumDirection direction = blockFaceToNotch(face); - ItemActionContext context = new ItemActionContext(getCraftWorld().getHandle(), null, EnumHand.MAIN_HAND, Items.BONE_MEAL.r(), new MovingObjectPositionBlock(Vec3D.a, direction, getPosition(), false)); // PAIL rename createItemStack, ZERO + ItemActionContext context = new ItemActionContext(getCraftWorld().getHandle(), null, EnumHand.MAIN_HAND, Items.BONE_MEAL.createItemStack(), new MovingObjectPositionBlock(Vec3D.ORIGIN, direction, getPosition(), false)); return ItemBoneMeal.applyBonemeal(context) == EnumInteractionResult.SUCCESS; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java index 2530338783..7d07f95e66 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArmorStand.java @@ -216,16 +216,16 @@ public class CraftArmorStand extends CraftLivingEntity implements ArmorStand { @Override public void addEquipmentLock(EquipmentSlot equipmentSlot, LockType lockType) { - getHandle().bv |= (1 << CraftEquipmentSlot.getNMS(equipmentSlot).c() + lockType.ordinal() * 8); // PAIL c() rename getSlotFlag() + getHandle().disabledSlots |= (1 << CraftEquipmentSlot.getNMS(equipmentSlot).getSlotFlag() + lockType.ordinal() * 8); } @Override public void removeEquipmentLock(EquipmentSlot equipmentSlot, LockType lockType) { - getHandle().bv &= ~(1 << CraftEquipmentSlot.getNMS(equipmentSlot).c() + lockType.ordinal() * 8); + getHandle().disabledSlots &= ~(1 << CraftEquipmentSlot.getNMS(equipmentSlot).getSlotFlag() + lockType.ordinal() * 8); } @Override public boolean hasEquipmentLock(EquipmentSlot equipmentSlot, LockType lockType) { - return (getHandle().bv & (1 << CraftEquipmentSlot.getNMS(equipmentSlot).c() + lockType.ordinal() * 8)) != 0; + return (getHandle().disabledSlots & (1 << CraftEquipmentSlot.getNMS(equipmentSlot).getSlotFlag() + lockType.ordinal() * 8)) != 0; } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java index dadc7635f0..346764b2b9 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEnderSignal.java @@ -54,12 +54,12 @@ public class CraftEnderSignal extends CraftEntity implements EnderSignal { @Override public ItemStack getItem() { - return CraftItemStack.asBukkitCopy(getHandle().g()); // PAIL rename getItemStack + return CraftItemStack.asBukkitCopy(getHandle().getItem()); } @Override public void setItem(ItemStack item) { - getHandle().b(item != null ? CraftItemStack.asNMSCopy(item) : Items.ENDER_EYE.r()); // PAIL rename setItemStack, createItemStack + getHandle().setItem(item != null ? CraftItemStack.asNMSCopy(item) : Items.ENDER_EYE.createItemStack()); } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 41b25999b1..1a89a83c32 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -248,12 +248,12 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @Override public int getArrowCooldown() { - return getHandle().al; // PAIL rename arrowCooldown + return getHandle().arrowCooldown; } @Override public void setArrowCooldown(int ticks) { - getHandle().al = ticks; + getHandle().arrowCooldown = ticks; } @Override @@ -264,7 +264,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { @Override public void setArrowsInBody(int count) { Preconditions.checkArgument(count >= 0, "New arrow amount must be >= 0"); - getHandle().getDataWatcher().set(EntityLiving.bh, count); + getHandle().getDataWatcher().set(EntityLiving.ARROWS_IN_BODY, count); } @Override @@ -669,7 +669,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { return EntityCategory.ARTHROPOD; } else if (type == EnumMonsterType.ILLAGER) { return EntityCategory.ILLAGER; - } else if (type == EnumMonsterType.e) { // PAIL rename WATER_MOB + } else if (type == EnumMonsterType.WATER_MOB) { return EntityCategory.WATER; } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java index 1afaa24299..4d8cd8234a 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -204,7 +204,7 @@ public final class CraftMagicNumbers implements UnsafeValues { * @return string */ public String getMappingsVersion() { - return "c2d5d7871edcc4fb0f81d18959c647af"; + return "09f04031f41cb54f1077c6ac348cc220"; } @Override