From 89c52b7b0eced8aef6ebbab4adcc1d77e7e4c35f Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 14 May 2019 10:00:00 +1000 Subject: [PATCH] Update to Minecraft 1.14.1 --- nms-patches/BehaviorFarm.patch | 20 +-- nms-patches/BehaviorInteractDoor.patch | 4 +- nms-patches/BehaviorMakeLove.patch | 10 +- nms-patches/Block.patch | 6 +- nms-patches/BlockCommand.patch | 2 +- nms-patches/BlockMushroom.patch | 2 +- nms-patches/BlockTNT.patch | 6 +- nms-patches/Chunk.patch | 55 +++++--- nms-patches/ChunkProviderServer.patch | 28 ++--- nms-patches/CommandTeleport.patch | 9 -- nms-patches/ContainerCartography.patch | 2 +- nms-patches/CustomFunctionData.patch | 2 +- nms-patches/DefinedStructure.patch | 4 +- nms-patches/DimensionManager.patch | 40 +++--- nms-patches/EnchantmentFrostWalker.patch | 4 +- nms-patches/Entity.patch | 6 +- nms-patches/EntityEnderman.patch | 4 +- nms-patches/EntityFox.patch | 66 ---------- nms-patches/EntityItem.patch | 16 +-- ...maTrader.patch => EntityLlamaTrader.patch} | 6 +- nms-patches/EntityMushroomCow.patch | 11 +- nms-patches/EntityPlayer.patch | 2 +- nms-patches/EntityVillager.patch | 22 ++-- nms-patches/EntityVillagerAbstract.patch | 7 +- nms-patches/EntityZombieVillager.patch | 10 +- nms-patches/ItemCrossbow.patch | 10 +- nms-patches/MerchantRecipe.patch | 2 +- nms-patches/MinecraftServer.patch | 18 +-- nms-patches/MobSpawnerAbstract.patch | 2 +- nms-patches/PathfinderGoalEatTile.patch | 2 +- nms-patches/PathfinderGoalSit.patch | 2 +- nms-patches/PlayerChunk.patch | 19 ++- nms-patches/PlayerChunkMap.patch | 88 ++++++------- nms-patches/PlayerList.patch | 6 +- nms-patches/TickListServer.patch | 68 +--------- nms-patches/TileEntity.patch | 16 +-- nms-patches/TileEntityBeacon.patch | 2 +- nms-patches/TileEntityBrewingStand.patch | 4 +- nms-patches/TileEntityCampfire.patch | 4 +- nms-patches/TileEntityConduit.patch | 12 +- nms-patches/TileEntityEndGateway.patch | 2 +- nms-patches/TileEntityHopper.patch | 6 +- nms-patches/TileEntitySign.patch | 10 +- nms-patches/World.patch | 20 +-- nms-patches/WorldData.patch | 8 +- nms-patches/WorldServer.patch | 82 ++++++------ pom.xml | 4 +- .../org/bukkit/craftbukkit/CraftServer.java | 4 +- .../org/bukkit/craftbukkit/CraftWorld.java | 2 +- .../java/org/bukkit/craftbukkit/Main.java | 2 +- .../bukkit/craftbukkit/block/CraftSign.java | 4 +- .../bukkit/craftbukkit/entity/CraftCat.java | 4 +- .../craftbukkit/entity/CraftEntity.java | 6 +- .../bukkit/craftbukkit/entity/CraftFox.java | 14 +-- .../craftbukkit/entity/CraftMushroomCow.java | 4 +- .../craftbukkit/entity/CraftTraderLlama.java | 8 +- .../inventory/CraftMerchantCustom.java | 6 +- .../craftbukkit/util/CraftMagicNumbers.java | 2 +- .../util/DummyGeneratorAccess.java | 5 - .../bukkit/craftbukkit/util/HashTreeSet.java | 117 ------------------ 60 files changed, 322 insertions(+), 587 deletions(-) delete mode 100644 nms-patches/EntityFox.patch rename nms-patches/{EntityLLamaTrader.patch => EntityLlamaTrader.patch} (74%) delete mode 100644 src/main/java/org/bukkit/craftbukkit/util/HashTreeSet.java diff --git a/nms-patches/BehaviorFarm.patch b/nms-patches/BehaviorFarm.patch index 4b7d1c9862..5649fc1f31 100644 --- a/nms-patches/BehaviorFarm.patch +++ b/nms-patches/BehaviorFarm.patch @@ -1,26 +1,26 @@ --- a/net/minecraft/server/BehaviorFarm.java +++ b/net/minecraft/server/BehaviorFarm.java -@@ -31,7 +31,7 @@ +@@ -27,7 +27,7 @@ } else if (entityvillager.getVillagerData().getProfession() != VillagerProfession.FARMER) { return false; } else { -- Set set = (Set) ((List) entityvillager.getBehaviorController().c(MemoryModuleType.SECONDARY_JOB_SITE).get()).stream().map(GlobalPos::b).collect(Collectors.toSet()); -+ Set set = (Set) (entityvillager.getBehaviorController().c(MemoryModuleType.SECONDARY_JOB_SITE).get()).stream().map(GlobalPos::b).collect(Collectors.toSet()); // CraftBukkit - decompile error +- Set set = (Set) ((List) entityvillager.getBehaviorController().getMemory(MemoryModuleType.SECONDARY_JOB_SITE).get()).stream().map(GlobalPos::b).collect(Collectors.toSet()); ++ Set set = (Set) (entityvillager.getBehaviorController().getMemory(MemoryModuleType.SECONDARY_JOB_SITE).get()).stream().map(GlobalPos::b).collect(Collectors.toSet()); // CraftBukkit - decompile error BlockPosition blockposition = new BlockPosition(entityvillager); Stream stream = ImmutableList.of(blockposition.down(), blockposition.south(), blockposition.north(), blockposition.east(), blockposition.west()).stream(); -@@ -61,8 +61,8 @@ +@@ -57,8 +57,8 @@ protected void a(WorldServer worldserver, EntityVillager entityvillager, long i) { if (i > this.d && this.a != null) { -- entityvillager.getBehaviorController().a(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorTarget(this.a))); -- entityvillager.getBehaviorController().a(MemoryModuleType.WALK_TARGET, (Object) (new MemoryTarget(new BehaviorTarget(this.a), 0.5F, 1))); -+ entityvillager.getBehaviorController().a(MemoryModuleType.LOOK_TARGET, (new BehaviorTarget(this.a))); // CraftBukkit - decompile error -+ entityvillager.getBehaviorController().a(MemoryModuleType.WALK_TARGET, (new MemoryTarget(new BehaviorTarget(this.a), 0.5F, 1))); // CraftBukkit - decompile error +- entityvillager.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (Object) (new BehaviorTarget(this.a))); +- entityvillager.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (Object) (new MemoryTarget(new BehaviorTarget(this.a), 0.5F, 1))); ++ entityvillager.getBehaviorController().setMemory(MemoryModuleType.LOOK_TARGET, (new BehaviorTarget(this.a))); // CraftBukkit - decompile error ++ entityvillager.getBehaviorController().setMemory(MemoryModuleType.WALK_TARGET, (new MemoryTarget(new BehaviorTarget(this.a), 0.5F, 1))); // CraftBukkit - decompile error } } -@@ -80,7 +80,11 @@ +@@ -76,7 +76,11 @@ Block block = iblockdata.getBlock(); if (block instanceof BlockCrops && ((BlockCrops) block).isRipe(iblockdata) && this.c) { @@ -33,7 +33,7 @@ } else if (iblockdata.isAir() && this.b) { InventorySubcontainer inventorysubcontainer = entityvillager.getInventory(); -@@ -89,19 +93,28 @@ +@@ -85,19 +89,28 @@ boolean flag = false; if (!itemstack.isEmpty()) { diff --git a/nms-patches/BehaviorInteractDoor.patch b/nms-patches/BehaviorInteractDoor.patch index 97ec9002b8..797190c7bd 100644 --- a/nms-patches/BehaviorInteractDoor.patch +++ b/nms-patches/BehaviorInteractDoor.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/BehaviorInteractDoor.java +++ b/net/minecraft/server/BehaviorInteractDoor.java -@@ -27,7 +27,7 @@ +@@ -23,7 +23,7 @@ Set set = this.a(worldserver, list, list1); int j = pathentity.f() - 1; @@ -9,7 +9,7 @@ } private Set a(WorldServer worldserver, List list, List list1) { -@@ -39,13 +39,20 @@ +@@ -35,13 +35,20 @@ return (Set) stream.filter(list1::contains).collect(Collectors.toSet()); } diff --git a/nms-patches/BehaviorMakeLove.patch b/nms-patches/BehaviorMakeLove.patch index a0cefad904..976bdd5e54 100644 --- a/nms-patches/BehaviorMakeLove.patch +++ b/nms-patches/BehaviorMakeLove.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/BehaviorMakeLove.java +++ b/net/minecraft/server/BehaviorMakeLove.java -@@ -100,6 +100,11 @@ +@@ -93,6 +93,11 @@ private Optional a(EntityVillager entityvillager, EntityVillager entityvillager1) { EntityVillager entityvillager2 = entityvillager.createChild(entityvillager1); @@ -12,7 +12,7 @@ if (entityvillager2 == null) { return Optional.empty(); -@@ -108,7 +113,7 @@ +@@ -101,7 +106,7 @@ entityvillager1.setAgeRaw(6000); entityvillager2.setAgeRaw(-24000); entityvillager2.setPositionRotation(entityvillager.locX, entityvillager.locY, entityvillager.locZ, 0.0F, 0.0F); @@ -21,11 +21,11 @@ entityvillager.world.broadcastEntityEffect(entityvillager2, (byte) 12); return Optional.of(entityvillager2); } -@@ -117,6 +122,6 @@ +@@ -110,6 +115,6 @@ private void a(WorldServer worldserver, EntityVillager entityvillager, BlockPosition blockposition) { GlobalPos globalpos = GlobalPos.a(worldserver.getWorldProvider().getDimensionManager(), blockposition); -- entityvillager.getBehaviorController().a(MemoryModuleType.HOME, (Object) globalpos); -+ entityvillager.getBehaviorController().a(MemoryModuleType.HOME, globalpos); // CraftBukkit - decompile error +- entityvillager.getBehaviorController().setMemory(MemoryModuleType.HOME, (Object) globalpos); ++ entityvillager.getBehaviorController().setMemory(MemoryModuleType.HOME, globalpos); // CraftBukkit - decompile error } } diff --git a/nms-patches/Block.patch b/nms-patches/Block.patch index 1936e3406f..af4b5d57e1 100644 --- a/nms-patches/Block.patch +++ b/nms-patches/Block.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/Block.java +++ b/net/minecraft/server/Block.java -@@ -427,7 +427,8 @@ +@@ -435,7 +435,8 @@ } public static List getDrops(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, @Nullable TileEntity tileentity, Entity entity, ItemStack itemstack) { @@ -10,7 +10,7 @@ return iblockdata.a(loottableinfo_builder); } -@@ -481,7 +482,13 @@ +@@ -489,7 +490,13 @@ EntityItem entityitem = new EntityItem(world, (double) blockposition.getX() + d0, (double) blockposition.getY() + d1, (double) blockposition.getZ() + d2, itemstack); entityitem.defaultPickupDelay(); @@ -25,7 +25,7 @@ } } -@@ -678,6 +685,12 @@ +@@ -686,6 +693,12 @@ return block == Blocks.DIRT || block == Blocks.COARSE_DIRT || block == Blocks.PODZOL; } diff --git a/nms-patches/BlockCommand.patch b/nms-patches/BlockCommand.patch index cad4d41ec7..68f51c0dc6 100644 --- a/nms-patches/BlockCommand.patch +++ b/nms-patches/BlockCommand.patch @@ -24,4 +24,4 @@ + // CraftBukkit end tileentitycommand.a(flag1); - if (!flag2 && !tileentitycommand.f() && tileentitycommand.t() != TileEntityCommand.Type.SEQUENCE) { + if (!flag2 && !tileentitycommand.f() && tileentitycommand.u() != TileEntityCommand.Type.SEQUENCE) { diff --git a/nms-patches/BlockMushroom.patch b/nms-patches/BlockMushroom.patch index b660edc74f..73da96da96 100644 --- a/nms-patches/BlockMushroom.patch +++ b/nms-patches/BlockMushroom.patch @@ -21,7 +21,7 @@ } @@ -70,8 +74,10 @@ - WorldGenerator worldgenerator = null; + WorldGenerator worldgenerator = null; if (this == Blocks.BROWN_MUSHROOM) { + BlockSapling.treeType = TreeType.BROWN_MUSHROOM; // CraftBukkit diff --git a/nms-patches/BlockTNT.patch b/nms-patches/BlockTNT.patch index 85fa622873..6501898526 100644 --- a/nms-patches/BlockTNT.patch +++ b/nms-patches/BlockTNT.patch @@ -1,14 +1,14 @@ --- a/net/minecraft/server/BlockTNT.java +++ b/net/minecraft/server/BlockTNT.java -@@ -92,6 +92,11 @@ - Entity entity1 = entityarrow.getShooter(); +@@ -93,6 +93,11 @@ if (entityarrow.isBurning()) { + BlockPosition blockposition = movingobjectpositionblock.getBlockPosition(); + // CraftBukkit start + if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(entityarrow, blockposition, Blocks.AIR.getBlockData()).isCancelled()) { + return; + } + // CraftBukkit end + a(world, blockposition, entity1 instanceof EntityLiving ? (EntityLiving) entity1 : null); world.a(blockposition, false); - } diff --git a/nms-patches/Chunk.patch b/nms-patches/Chunk.patch index b3e573bbf6..923879ef94 100644 --- a/nms-patches/Chunk.patch +++ b/nms-patches/Chunk.patch @@ -14,7 +14,7 @@ public class Chunk implements IChunkAccess { private static final Logger LOGGER = LogManager.getLogger(); -@@ -91,8 +98,19 @@ +@@ -95,8 +102,19 @@ } } @@ -34,7 +34,7 @@ public Chunk(World world, ProtoChunk protochunk) { this(world, protochunk.getPos(), protochunk.getBiomeIndex(), protochunk.p(), protochunk.n(), protochunk.o(), protochunk.q(), protochunk.getSections(), (Consumer) null); Iterator iterator = protochunk.y().iterator(); -@@ -134,6 +152,7 @@ +@@ -138,6 +156,7 @@ this.b(protochunk.r()); this.s = true; @@ -42,7 +42,7 @@ } @Override -@@ -224,9 +243,16 @@ +@@ -228,9 +247,16 @@ } } @@ -59,7 +59,7 @@ int i = blockposition.getX() & 15; int j = blockposition.getY(); int k = blockposition.getZ() & 15; -@@ -278,7 +304,8 @@ +@@ -282,7 +308,8 @@ } } @@ -69,7 +69,7 @@ iblockdata.onPlace(this.world, blockposition, iblockdata1, flag); } -@@ -378,7 +405,12 @@ +@@ -382,7 +409,12 @@ @Nullable public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { @@ -83,7 +83,7 @@ if (tileentity == null) { NBTTagCompound nbttagcompound = (NBTTagCompound) this.e.remove(blockposition); -@@ -425,6 +457,13 @@ +@@ -429,6 +461,13 @@ tileentity1.m(); } @@ -97,7 +97,7 @@ } } -@@ -453,6 +492,41 @@ +@@ -457,6 +496,41 @@ } @@ -139,7 +139,7 @@ public void markDirty() { this.s = true; } -@@ -527,7 +601,7 @@ +@@ -531,7 +605,7 @@ Iterator iterator = this.entitySlices[k].a(oclass).iterator(); while (iterator.hasNext()) { @@ -148,7 +148,7 @@ if (t0.getBoundingBox().c(axisalignedbb) && (predicate == null || predicate.test(t0))) { list.add(t0); -@@ -601,7 +675,7 @@ +@@ -605,7 +679,7 @@ @Override public boolean isNeedsSaving() { @@ -157,21 +157,36 @@ } public void d(boolean flag) { -@@ -691,7 +765,7 @@ - } +@@ -746,7 +820,7 @@ + public void B() { if (this.o instanceof ProtoChunkTickList) { -- ((ProtoChunkTickList) this.o).a(this.world.getBlockTickList(), (blockposition1) -> { -+ ((ProtoChunkTickList) this.o).a(this.world.getBlockTickList(), (blockposition1) -> { // CraftBukkit - decompile error - return this.getType(blockposition1).getBlock(); +- ((ProtoChunkTickList) this.o).a(this.world.getBlockTickList(), (blockposition) -> { ++ ((ProtoChunkTickList) this.o).a(this.world.getBlockTickList(), (blockposition) -> { // CraftBukkit - decompile error + return this.getType(blockposition).getBlock(); }); - } else if (this.o instanceof TickListChunk) { -@@ -700,7 +774,7 @@ + this.o = TickListEmpty.a(); +@@ -756,7 +830,7 @@ } if (this.p instanceof ProtoChunkTickList) { -- ((ProtoChunkTickList) this.p).a(this.world.getFluidTickList(), (blockposition1) -> { -+ ((ProtoChunkTickList) this.p).a(this.world.getFluidTickList(), (blockposition1) -> { // CraftBukkit - decompile error - return this.getFluid(blockposition1).getType(); +- ((ProtoChunkTickList) this.p).a(this.world.getFluidTickList(), (blockposition) -> { ++ ((ProtoChunkTickList) this.p).a(this.world.getFluidTickList(), (blockposition) -> { // CraftBukkit - decompile error + return this.getFluid(blockposition).getType(); }); - } else if (this.p instanceof TickListChunk) { + this.p = TickListEmpty.a(); +@@ -768,12 +842,12 @@ + } + + public void a(WorldServer worldserver) { +- if (this.o == TickListEmpty.a()) { ++ if (this.o == TickListEmpty.a()) { // CraftBukkit - decompile error + this.o = new TickListChunk<>(IRegistry.BLOCK::getKey, worldserver.getBlockTickList().a(true, this.loc)); + this.setNeedsSaving(true); + } + +- if (this.p == TickListEmpty.a()) { ++ if (this.p == TickListEmpty.a()) { // CraftBukkit - decompile error + this.p = new TickListChunk<>(IRegistry.FLUID::getKey, worldserver.getFluidTickList().a(true, this.loc)); + this.setNeedsSaving(true); + } diff --git a/nms-patches/ChunkProviderServer.patch b/nms-patches/ChunkProviderServer.patch index 4621159cb1..02e71aa065 100644 --- a/nms-patches/ChunkProviderServer.patch +++ b/nms-patches/ChunkProviderServer.patch @@ -1,15 +1,6 @@ --- a/net/minecraft/server/ChunkProviderServer.java +++ b/net/minecraft/server/ChunkProviderServer.java -@@ -82,7 +82,7 @@ - - if (flag1) { - completablefuture = this.getChunkFutureMainThread(i, j, chunkstatus, flag); -- this.serverThreadQueue.awaitTasks(completablefuture::isDone); -+ this.serverThreadQueue.awaitTasks((BooleanSupplier) completablefuture::isDone); // CraftBukkit - decompile error - } else { - completablefuture = CompletableFuture.supplyAsync(() -> { - return this.getChunkFutureMainThread(i, j, chunkstatus, flag); -@@ -193,6 +193,17 @@ +@@ -241,6 +241,17 @@ this.playerChunkMap.close(); } @@ -27,7 +18,7 @@ public void tick(BooleanSupplier booleansupplier) { this.world.getMethodProfiler().enter("purge"); this.chunkMapDistance.purgeTickets(); -@@ -211,14 +222,14 @@ +@@ -260,13 +271,13 @@ this.lastTickTime = i; WorldData worlddata = this.world.getWorldData(); boolean flag = worlddata.getType() == WorldType.DEBUG_ALL_BLOCK_STATES; @@ -36,15 +27,14 @@ if (!flag) { this.world.getMethodProfiler().enter("pollingChunks"); - int k = this.chunkMapDistance.b(); - int l = this.world.getGameRules().c("randomTickSpeed"); + int k = this.world.getGameRules().c("randomTickSpeed"); BlockPosition blockposition = this.world.getSpawn(); - boolean flag2 = worlddata.getTime() % 400L == 0L; + boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit // PAIL: TODO monster ticks - EnumCreatureType[] aenumcreaturetype = EnumCreatureType.values(); - Object2IntMap object2intmap = this.world.l(); - ObjectBidirectionalIterator objectbidirectionaliterator = this.playerChunkMap.f(); -@@ -244,8 +255,30 @@ + + this.world.getMethodProfiler().enter("naturalSpawnCount"); + int l = this.chunkMapDistance.b(); +@@ -299,8 +310,30 @@ for (int j1 = 0; j1 < i1; ++j1) { EnumCreatureType enumcreaturetype = aenumcreaturetype1[j1]; @@ -71,8 +61,8 @@ + // CraftBukkit end + if (enumcreaturetype != EnumCreatureType.MISC && (!enumcreaturetype.c() || this.allowAnimals) && (enumcreaturetype.c() || this.allowMonsters) && (!enumcreaturetype.d() || flag2)) { -- int k1 = enumcreaturetype.b() * k / ChunkProviderServer.b; -+ int k1 = limit * k / ChunkProviderServer.b; // CraftBukkit - use per-world limits +- int k1 = enumcreaturetype.b() * l / ChunkProviderServer.b; ++ int k1 = limit * l / ChunkProviderServer.b; // CraftBukkit - use per-world limits if (object2intmap.getInt(enumcreaturetype) <= k1) { SpawnerCreature.a(enumcreaturetype, (World) this.world, chunk, blockposition); diff --git a/nms-patches/CommandTeleport.patch b/nms-patches/CommandTeleport.patch index 3406408951..3bc8874c9b 100644 --- a/nms-patches/CommandTeleport.patch +++ b/nms-patches/CommandTeleport.patch @@ -12,15 +12,6 @@ public class CommandTeleport { -@@ -47,7 +52,7 @@ - while (iterator.hasNext()) { - Entity entity1 = (Entity) iterator.next(); - -- a(commandlistenerwrapper, entity1, commandlistenerwrapper.getWorld(), entity.locX, entity.locY, entity.locZ, EnumSet.noneOf(PacketPlayOutPosition.EnumPlayerTeleportFlags.class), entity.yaw, entity.pitch, (CommandTeleport.a) null); -+ a(commandlistenerwrapper, entity1, (WorldServer) entity.world, entity.locX, entity.locY, entity.locZ, EnumSet.noneOf(PacketPlayOutPosition.EnumPlayerTeleportFlags.class), entity.yaw, entity.pitch, (CommandTeleport.a) null); // SPIGOT-4245, MC-128441 - use target world as destination - } - - if (collection.size() == 1) { @@ -118,9 +123,9 @@ } diff --git a/nms-patches/ContainerCartography.patch b/nms-patches/ContainerCartography.patch index 84b2dea868..788c1198e4 100644 --- a/nms-patches/ContainerCartography.patch +++ b/nms-patches/ContainerCartography.patch @@ -22,7 +22,7 @@ + return bukkitEntity; + } + -+ CraftInventoryCartography inventory = new CraftInventoryCartography(this.inventory, this.f); ++ CraftInventoryCartography inventory = new CraftInventoryCartography(this.inventory, this.resultInventory); + bukkitEntity = new CraftInventoryView(this.player, inventory, this); + return bukkitEntity; + } diff --git a/nms-patches/CustomFunctionData.patch b/nms-patches/CustomFunctionData.patch index d7d1b8a1a0..42d53929c3 100644 --- a/nms-patches/CustomFunctionData.patch +++ b/nms-patches/CustomFunctionData.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/CustomFunctionData.java +++ b/net/minecraft/server/CustomFunctionData.java -@@ -53,7 +53,7 @@ +@@ -54,7 +54,7 @@ } public com.mojang.brigadier.CommandDispatcher d() { diff --git a/nms-patches/DefinedStructure.patch b/nms-patches/DefinedStructure.patch index cbf2f7aceb..203f463d2f 100644 --- a/nms-patches/DefinedStructure.patch +++ b/nms-patches/DefinedStructure.patch @@ -9,7 +9,7 @@ return !(entity instanceof EntityHuman); }); -@@ -384,11 +384,13 @@ +@@ -388,11 +388,13 @@ } private static Optional a(GeneratorAccess generatoraccess, NBTTagCompound nbttagcompound) { @@ -27,7 +27,7 @@ } public BlockPosition a(EnumBlockRotation enumblockrotation) { -@@ -797,7 +799,7 @@ +@@ -801,7 +803,7 @@ public IBlockData a(int i) { IBlockData iblockdata = (IBlockData) this.b.fromId(i); diff --git a/nms-patches/DimensionManager.patch b/nms-patches/DimensionManager.patch index 200fee1f8a..c11910c464 100644 --- a/nms-patches/DimensionManager.patch +++ b/nms-patches/DimensionManager.patch @@ -1,38 +1,32 @@ --- a/net/minecraft/server/DimensionManager.java +++ b/net/minecraft/server/DimensionManager.java -@@ -8,25 +8,29 @@ +@@ -8,9 +8,11 @@ public class DimensionManager implements MinecraftSerializable { -- public static final DimensionManager OVERWORLD = a("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true)); -- public static final DimensionManager NETHER = a("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false)); -- public static final DimensionManager THE_END = a("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false)); +- public static final DimensionManager OVERWORLD = register("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true)); +- public static final DimensionManager NETHER = register("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false)); +- public static final DimensionManager THE_END = register("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false)); + // CraftBukkit start -+ public static final DimensionManager OVERWORLD = a("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true, null)); -+ public static final DimensionManager NETHER = a("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false, null)); -+ public static final DimensionManager THE_END = a("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false, null)); ++ public static final DimensionManager OVERWORLD = register("overworld", new DimensionManager(1, "", "", WorldProviderNormal::new, true, null)); ++ public static final DimensionManager NETHER = register("the_nether", new DimensionManager(0, "_nether", "DIM-1", WorldProviderHell::new, false, null)); ++ public static final DimensionManager THE_END = register("the_end", new DimensionManager(2, "_end", "DIM1", WorldProviderTheEnd::new, false, null)); + // CraftBukkit end - private final int d; - private final String e; -- private final String f; -- private final BiFunction g; -+ public final String f; -+ public final BiFunction g; - private final boolean h; - -- private static DimensionManager a(String s, DimensionManager dimensionmanager) { -+ public static DimensionManager a(String s, DimensionManager dimensionmanager) { - return (DimensionManager) IRegistry.a(IRegistry.DIMENSION_TYPE, dimensionmanager.d, s, dimensionmanager); + private final int id; + private final String suffix; + public final String folder; +@@ -21,12 +23,14 @@ + return (DimensionManager) IRegistry.a(IRegistry.DIMENSION_TYPE, dimensionmanager.id, s, dimensionmanager); } - public DimensionManager(int i, String s, String s1, BiFunction bifunction, boolean flag) { + // CraftBukkit - add type + public DimensionManager(int i, String s, String s1, BiFunction bifunction, boolean flag, DimensionManager type) { - this.d = i; - this.e = s; - this.f = s1; - this.g = bifunction; - this.h = flag; + this.id = i; + this.suffix = s; + this.folder = s1; + this.providerFactory = bifunction; + this.hasSkyLight = flag; + this.type = type; // CraftBukkit } diff --git a/nms-patches/EnchantmentFrostWalker.patch b/nms-patches/EnchantmentFrostWalker.patch index 3940ba3fb7..3232fd80e2 100644 --- a/nms-patches/EnchantmentFrostWalker.patch +++ b/nms-patches/EnchantmentFrostWalker.patch @@ -16,10 +16,10 @@ if (iblockdata2.getMaterial() == Material.WATER && (Integer) iblockdata2.get(BlockFluids.LEVEL) == 0 && iblockdata.canPlace(world, blockposition1) && world.a(iblockdata, blockposition1, VoxelShapeCollision.a())) { - world.setTypeUpdate(blockposition1, iblockdata); -- world.getBlockTickList().a(blockposition1.immutableCopy(), Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120)); +- world.getBlockTickList().a(blockposition1, Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120)); + // CraftBukkit Start - Call EntityBlockFormEvent for Frost Walker + if (org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(world, blockposition1, iblockdata, entityliving)) { -+ world.getBlockTickList().a(blockposition1.immutableCopy(), Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120)); ++ world.getBlockTickList().a(blockposition1, Blocks.FROSTED_ICE, MathHelper.nextInt(entityliving.getRandom(), 60, 120)); + } + // CraftBukkit End } diff --git a/nms-patches/Entity.patch b/nms-patches/Entity.patch index 2fbfa5eac3..8691e74483 100644 --- a/nms-patches/Entity.patch +++ b/nms-patches/Entity.patch @@ -78,14 +78,14 @@ @@ -204,6 +263,12 @@ } - protected void b(EntityPose entitypose) { + protected void setPose(EntityPose entitypose) { + // CraftBukkit start -+ if (entitypose == this.Z()) { ++ if (entitypose == this.getPose()) { + return; + } + this.world.getServer().getPluginManager().callEvent(new EntityPoseChangeEvent(this.getBukkitEntity(), Pose.values()[entitypose.ordinal()])); + // CraftBukkit end - this.datawatcher.set(Entity.X, entitypose); + this.datawatcher.set(Entity.POSE, entitypose); } @@ -212,6 +277,33 @@ diff --git a/nms-patches/EntityEnderman.patch b/nms-patches/EntityEnderman.patch index e9390fd4fe..c4c0854f75 100644 --- a/nms-patches/EntityEnderman.patch +++ b/nms-patches/EntityEnderman.patch @@ -27,7 +27,7 @@ } -@@ -294,8 +305,12 @@ +@@ -304,8 +315,12 @@ boolean flag = movingobjectpositionblock.getType() != MovingObjectPosition.EnumMovingObjectType.MISS && movingobjectpositionblock.getBlockPosition().equals(blockposition); if (block.a(TagsBlock.ENDERMAN_HOLDABLE) && flag) { @@ -42,7 +42,7 @@ } } -@@ -328,8 +343,12 @@ +@@ -338,8 +353,12 @@ IBlockData iblockdata2 = this.a.getCarried(); if (iblockdata2 != null && this.a(world, blockposition, iblockdata2, iblockdata, iblockdata1, blockposition1)) { diff --git a/nms-patches/EntityFox.patch b/nms-patches/EntityFox.patch deleted file mode 100644 index fe02a5eed0..0000000000 --- a/nms-patches/EntityFox.patch +++ /dev/null @@ -1,66 +0,0 @@ ---- a/net/minecraft/server/EntityFox.java -+++ b/net/minecraft/server/EntityFox.java -@@ -96,7 +96,7 @@ - this.goalSelector.a(10, new EntityFox.p()); - this.goalSelector.a(11, new EntityFox.j(this, EntityHuman.class, 24.0F)); - this.goalSelector.a(12, new EntityFox.r()); -- this.targetSelector.a(3, new EntityFox.a(EntityLiving.class, false, false, (entityliving) -> { -+ this.targetSelector.a(3, new EntityFox.a(EntityLiving.class, false, false, (entityliving) -> { // CraftBukkit - decompile error - return EntityFox.bF.test(entityliving) && !this.c(entityliving.getUniqueID()); - })); - } -@@ -260,15 +260,15 @@ - return EntityFox.Type.a((Integer) this.datawatcher.get(EntityFox.bz)); - } - -- private void a(EntityFox.Type entityfox_type) { -+ public void a(EntityFox.Type entityfox_type) { // PAIL - this.datawatcher.set(EntityFox.bz, entityfox_type.c()); - } - - private List ek() { - List list = Lists.newArrayList(); - -- list.add(((Optional) this.datawatcher.get(EntityFox.bB)).orElse((Object) null)); -- list.add(((Optional) this.datawatcher.get(EntityFox.bD)).orElse((Object) null)); -+ list.add((this.datawatcher.get(EntityFox.bB)).orElse(null)); // CraftBukkit - decompile error -+ list.add((this.datawatcher.get(EntityFox.bD)).orElse(null)); // CraftBukkit - decompile error - return list; - } - -@@ -348,7 +348,7 @@ - return this.r(32); - } - -- private void x(boolean flag) { -+ public void x(boolean flag) { // PAIL - this.d(32, flag); - } - -@@ -983,7 +983,7 @@ - private int f; - - public r() { -- super(null); -+ super(); // CraftBukkit - decompile error - this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK)); - } - -@@ -1035,7 +1035,7 @@ - private int c; - - public t() { -- super(null); -+ super(); // CraftBukkit - decompile error - this.c = EntityFox.this.random.nextInt(140); - this.a(EnumSet.of(PathfinderGoal.Type.MOVE, PathfinderGoal.Type.LOOK, PathfinderGoal.Type.JUMP)); - } -@@ -1146,7 +1146,7 @@ - private EntityLiving k; - private int l; - -- public a(Class oclass, boolean flag, boolean flag1, Predicate predicate) { -+ public a(Class oclass, boolean flag, boolean flag1, Predicate predicate) { // CraftBukkit - decompile error - super(EntityFox.this, oclass, 10, flag, flag1, predicate); - } - diff --git a/nms-patches/EntityItem.patch b/nms-patches/EntityItem.patch index 026ebd5c00..38f79d4cba 100644 --- a/nms-patches/EntityItem.patch +++ b/nms-patches/EntityItem.patch @@ -35,8 +35,8 @@ this.lastX = this.locX; this.lastY = this.locY; -@@ -99,9 +107,11 @@ - this.setMot(this.getMot().d(1.0D, -0.5D, 1.0D)); +@@ -101,9 +109,11 @@ + } } + /* Craftbukkit start - moved up @@ -47,7 +47,7 @@ this.impulse |= this.ax(); if (!this.world.isClientSide) { -@@ -113,6 +123,12 @@ +@@ -115,6 +125,12 @@ } if (!this.world.isClientSide && this.age >= 6000) { @@ -60,7 +60,7 @@ this.die(); } -@@ -173,13 +189,14 @@ +@@ -175,13 +191,14 @@ } private static void a(EntityItem entityitem, ItemStack itemstack, EntityItem entityitem1, ItemStack itemstack1) { @@ -76,7 +76,7 @@ entityitem.pickupDelay = Math.max(entityitem.pickupDelay, entityitem1.pickupDelay); entityitem.age = Math.min(entityitem.age, entityitem1.age); if (itemstack1.isEmpty()) { -@@ -193,7 +210,7 @@ +@@ -195,7 +212,7 @@ } @Override @@ -85,7 +85,7 @@ this.damageEntity(DamageSource.FIRE, (float) i); } -@@ -204,6 +221,11 @@ +@@ -206,6 +223,11 @@ } else if (!this.getItemStack().isEmpty() && this.getItemStack().getItem() == Items.NETHER_STAR && damagesource.isExplosion()) { return false; } else { @@ -97,7 +97,7 @@ this.velocityChanged(); this.f = (int) ((float) this.f - f); if (this.f <= 0) { -@@ -265,6 +287,35 @@ +@@ -267,6 +289,35 @@ Item item = itemstack.getItem(); int i = itemstack.getCount(); @@ -133,7 +133,7 @@ if (this.pickupDelay == 0 && (this.owner == null || 6000 - this.age <= 200 || this.owner.equals(entityhuman.getUniqueID())) && entityhuman.inventory.pickup(itemstack)) { entityhuman.receive(this, i); if (itemstack.isEmpty()) { -@@ -307,7 +358,9 @@ +@@ -309,7 +360,9 @@ } public void setItemStack(ItemStack itemstack) { diff --git a/nms-patches/EntityLLamaTrader.patch b/nms-patches/EntityLlamaTrader.patch similarity index 74% rename from nms-patches/EntityLLamaTrader.patch rename to nms-patches/EntityLlamaTrader.patch index cd05a6c86d..5894e6b926 100644 --- a/nms-patches/EntityLLamaTrader.patch +++ b/nms-patches/EntityLlamaTrader.patch @@ -1,6 +1,6 @@ ---- a/net/minecraft/server/EntityLLamaTrader.java -+++ b/net/minecraft/server/EntityLLamaTrader.java -@@ -113,7 +113,7 @@ +--- a/net/minecraft/server/EntityLlamaTrader.java ++++ b/net/minecraft/server/EntityLlamaTrader.java +@@ -129,7 +129,7 @@ @Override public void c() { diff --git a/nms-patches/EntityMushroomCow.patch b/nms-patches/EntityMushroomCow.patch index 36e1818843..cd75264177 100644 --- a/nms-patches/EntityMushroomCow.patch +++ b/nms-patches/EntityMushroomCow.patch @@ -46,13 +46,4 @@ + // CraftBukkit end for (i = 0; i < 5; ++i) { - this.world.addEntity(new EntityItem(this.world, this.locX, this.locY + (double) this.getHeight(), this.locZ, new ItemStack(this.dV().d.getBlock()))); -@@ -156,7 +176,7 @@ - return Pair.of(blockflowers.d(), blockflowers.e()); - } - -- private void a(EntityMushroomCow.Type entitymushroomcow_type) { -+ public void a(EntityMushroomCow.Type entitymushroomcow_type) { // PAIL - this.datawatcher.set(EntityMushroomCow.bz, entitymushroomcow_type.c); - } - + this.world.addEntity(new EntityItem(this.world, this.locX, this.locY + (double) this.getHeight(), this.locZ, new ItemStack(this.getVariant().d.getBlock()))); diff --git a/nms-patches/EntityPlayer.patch b/nms-patches/EntityPlayer.patch index 7d8ae4383f..7991875c3b 100644 --- a/nms-patches/EntityPlayer.patch +++ b/nms-patches/EntityPlayer.patch @@ -646,7 +646,7 @@ this.setShoulderEntityLeft(entityplayer.getShoulderEntityLeft()); this.setShoulderEntityRight(entityplayer.getShoulderEntityRight()); + -+ this.S = false; // SPIGOT-4767 ++ this.inLava = false; // SPIGOT-4767 } @Override diff --git a/nms-patches/EntityVillager.patch b/nms-patches/EntityVillager.patch index 9d8ce62a92..8f800f0628 100644 --- a/nms-patches/EntityVillager.patch +++ b/nms-patches/EntityVillager.patch @@ -33,7 +33,7 @@ - this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this); + this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error this.world.getMethodProfiler().exit(); - if (!this.dX() && this.bE > 0) { + if (!this.dY() && this.bE > 0) { --this.bE; @@ -136,7 +146,7 @@ this.bF = false; @@ -44,23 +44,23 @@ } } -@@ -247,7 +257,14 @@ +@@ -258,7 +268,14 @@ while (iterator.hasNext()) { MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next(); -- merchantrecipe.increaseUses(-MathHelper.d((float) i * merchantrecipe.m())); +- merchantrecipe.increaseSpecialPrice(-MathHelper.d((float) i * merchantrecipe.getPriceMultiplier())); + // CraftBukkit start -+ int bonus = -MathHelper.d((float) i * merchantrecipe.m()); ++ int bonus = -MathHelper.d((float) i * merchantrecipe.getPriceMultiplier()); + VillagerReplenishTradeEvent event = new VillagerReplenishTradeEvent((Villager) this.getBukkitEntity(), merchantrecipe.asBukkit(), bonus); + Bukkit.getPluginManager().callEvent(event); + if (!event.isCancelled()) { -+ merchantrecipe.increaseUses(event.getBonus()); ++ merchantrecipe.increaseSpecialPrice(event.getBonus()); + } + // CraftBukkit end } } -@@ -553,7 +570,12 @@ +@@ -558,7 +575,12 @@ entitywitch.setCustomNameVisible(this.getCustomNameVisible()); } @@ -74,7 +74,7 @@ this.die(); } -@@ -725,7 +747,7 @@ +@@ -730,7 +752,7 @@ if (entityirongolem != null) { if (entityirongolem.a((GeneratorAccess) this.world, EnumMobSpawn.MOB_SUMMONED) && entityirongolem.a((IWorldReader) this.world)) { @@ -83,12 +83,12 @@ return entityirongolem; } -@@ -775,7 +797,7 @@ - EntityVillager.a entityvillager_a = (EntityVillager.a) this.getBehaviorController().c(MemoryModuleType.GOLEM_SPAWN_CONDITIONS).orElseGet(EntityVillager.a::new); +@@ -780,7 +802,7 @@ + EntityVillager.a entityvillager_a = (EntityVillager.a) this.getBehaviorController().getMemory(MemoryModuleType.GOLEM_SPAWN_CONDITIONS).orElseGet(EntityVillager.a::new); entityvillager_a.b(this.world.getTime()); -- this.br.a(MemoryModuleType.GOLEM_SPAWN_CONDITIONS, (Object) entityvillager_a); -+ this.br.a(MemoryModuleType.GOLEM_SPAWN_CONDITIONS, entityvillager_a); // CraftBukkit - decompile error +- this.br.setMemory(MemoryModuleType.GOLEM_SPAWN_CONDITIONS, (Object) entityvillager_a); ++ this.br.setMemory(MemoryModuleType.GOLEM_SPAWN_CONDITIONS, entityvillager_a); // CraftBukkit - decompile error } public static final class a { diff --git a/nms-patches/EntityVillagerAbstract.patch b/nms-patches/EntityVillagerAbstract.patch index 88814adc6d..fe53b77ce4 100644 --- a/nms-patches/EntityVillagerAbstract.patch +++ b/nms-patches/EntityVillagerAbstract.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/EntityVillagerAbstract.java +++ b/net/minecraft/server/EntityVillagerAbstract.java -@@ -4,14 +4,29 @@ +@@ -4,15 +4,30 @@ import java.util.Iterator; import java.util.Set; import javax.annotation.Nullable; @@ -22,16 +22,17 @@ + return (craftMerchant == null) ? craftMerchant = new CraftMerchant(this) : craftMerchant; + } + // CraftBukkit end + private static final DataWatcherObject bA = DataWatcher.a(EntityVillagerAbstract.class, DataWatcherRegistry.b); @Nullable private EntityHuman tradingPlayer; @Nullable protected MerchantRecipeList trades; - private final InventorySubcontainer inventory = new InventorySubcontainer(8); + private final InventorySubcontainer inventory = new InventorySubcontainer(8, (org.bukkit.craftbukkit.entity.CraftAbstractVillager) this.getBukkitEntity()); // CraftBukkit add argument - private int bC; public EntityVillagerAbstract(EntityTypes entitytypes, World world) { -@@ -198,7 +213,16 @@ + super(entitytypes, world); +@@ -204,7 +219,16 @@ MerchantRecipe merchantrecipe = villagertrades_imerchantrecipeoption.a(this, this.random); if (merchantrecipe != null) { diff --git a/nms-patches/EntityZombieVillager.patch b/nms-patches/EntityZombieVillager.patch index 2bdeb7ec6a..051d0aabf7 100644 --- a/nms-patches/EntityZombieVillager.patch +++ b/nms-patches/EntityZombieVillager.patch @@ -19,7 +19,7 @@ public EntityZombieVillager(EntityTypes entitytypes, World world) { super(entitytypes, world); -@@ -68,6 +73,11 @@ +@@ -66,6 +71,11 @@ public void tick() { if (!this.world.isClientSide && this.isAlive() && this.isConverting()) { int i = this.getConversionProgress(); @@ -31,7 +31,7 @@ this.conversionTime -= i; if (this.conversionTime <= 0) { -@@ -115,8 +125,11 @@ +@@ -113,8 +123,11 @@ this.conversionPlayer = uuid; this.conversionTime = i; this.getDataWatcher().set(EntityZombieVillager.CONVERTING, true); @@ -45,7 +45,7 @@ this.world.broadcastEntityEffect(this, (byte) 16); } -@@ -135,14 +148,20 @@ +@@ -133,14 +146,20 @@ entityvillager.setAgeRaw(-24000); } @@ -68,12 +68,12 @@ if (this.conversionPlayer != null) { EntityHuman entityhuman = worldserver.b(this.conversionPlayer); -@@ -152,7 +171,7 @@ +@@ -150,7 +169,7 @@ } } - entityvillager.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0)); + entityvillager.addEffect(new MobEffect(MobEffects.CONFUSION, 200, 0), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.CONVERSION); // CraftBukkit - worldserver.a((EntityHuman) null, 1027, new BlockPosition((int) this.locX, (int) this.locY, (int) this.locZ), 0); + worldserver.a((EntityHuman) null, 1027, new BlockPosition(this), 0); } diff --git a/nms-patches/ItemCrossbow.patch b/nms-patches/ItemCrossbow.patch index 0d3ef271dc..3b251852a2 100644 --- a/nms-patches/ItemCrossbow.patch +++ b/nms-patches/ItemCrossbow.patch @@ -18,19 +18,19 @@ } @Override -@@ -88,6 +92,11 @@ +@@ -87,6 +91,11 @@ itemstack1 = new ItemStack(Items.ARROW); itemstack2 = itemstack1.cloneItemStack(); } + // CraftBukkit start - SPIGOT-4870, MC-150847 + else if (itemstack1.isEmpty()) { -+ return; ++ return false; + } + // CraftBukkit end - a(entityliving, itemstack, itemstack1, k > 0, flag); - } -@@ -203,11 +212,27 @@ + if (!a(entityliving, itemstack, itemstack1, k > 0, flag)) { + return false; +@@ -210,11 +219,27 @@ vector3fa.a(quaternion); ((IProjectile) object).shoot((double) vector3fa.a(), (double) vector3fa.b(), (double) vector3fa.c(), f1, f2); } diff --git a/nms-patches/MerchantRecipe.patch b/nms-patches/MerchantRecipe.patch index 4279e0008c..8c880303f1 100644 --- a/nms-patches/MerchantRecipe.patch +++ b/nms-patches/MerchantRecipe.patch @@ -9,7 +9,7 @@ public ItemStack buyingItem1; @@ -12,6 +14,18 @@ - private int h; + private int demand; public float priceMultiplier; public int xp; + // CraftBukkit start diff --git a/nms-patches/MinecraftServer.patch b/nms-patches/MinecraftServer.patch index a88175ba77..477b32e6ac 100644 --- a/nms-patches/MinecraftServer.patch +++ b/nms-patches/MinecraftServer.patch @@ -118,8 +118,8 @@ + WorldData worlddata = this.getConvertable().b(s); // CraftBukkit if (worlddata != null) { -- WorldUpgrader worldupgrader = new WorldUpgrader(this.getWorld(), this.getConvertable(), worlddata, this.as); -+ WorldUpgrader worldupgrader = new WorldUpgrader(s, this.getConvertable(), worlddata, this.as); // CraftBukkit +- WorldUpgrader worldupgrader = new WorldUpgrader(this.getWorld(), this.getConvertable(), worlddata, this.eraseCache); ++ WorldUpgrader worldupgrader = new WorldUpgrader(s, this.getConvertable(), worlddata, this.eraseCache); // CraftBukkit IChatBaseComponent ichatbasecomponent = null; while (!worldupgrader.b()) { @@ -359,15 +359,15 @@ chunkproviderserver.addTicket(TicketType.START, new ChunkCoordIntPair(blockposition), 11, Unit.INSTANCE); while (chunkproviderserver.b() != 441) { -- this.nextTick += 100L; +- this.nextTick = SystemUtils.getMonotonicMillis() + 10L; - this.sleepForTick(); + // CraftBukkit start -+ // this.nextTick += 100L; ++ // this.nextTick = SystemUtils.getMonotonicMillis() + 10L; + this.executeModerately(); + // CraftBukkit end } -- this.nextTick += 100L; +- this.nextTick = SystemUtils.getMonotonicMillis() + 10L; - this.sleepForTick(); - Iterator iterator = DimensionManager.a().iterator(); - @@ -375,7 +375,7 @@ - DimensionManager dimensionmanager = (DimensionManager) iterator.next(); - ForcedChunk forcedchunk = (ForcedChunk) this.getWorldServer(dimensionmanager).getWorldPersistentData().b(ForcedChunk::new, "chunks"); + // CraftBukkit start -+ // this.nextTick += 100L; ++ // this.nextTick = SystemUtils.getMonotonicMillis() + 10L; + this.executeModerately(); + // Iterator iterator = DimensionManager.a().iterator(); + @@ -390,10 +390,10 @@ } } -- this.nextTick += 100L; +- this.nextTick = SystemUtils.getMonotonicMillis() + 10L; - this.sleepForTick(); + // CraftBukkit start -+ // this.nextTick += 100L; ++ // this.nextTick = SystemUtils.getMonotonicMillis() + 10L; + this.executeModerately(); + // CraftBukkit end worldloadlistener.b(); @@ -635,7 +635,7 @@ + } + + if (optionset.has("eraseCache")) { -+ dedicatedserver.c(true); ++ dedicatedserver.setEraseCache(true); + } + + dedicatedserver.serverThread.start(); diff --git a/nms-patches/MobSpawnerAbstract.patch b/nms-patches/MobSpawnerAbstract.patch index a9d5124e5e..2b2c2b5961 100644 --- a/nms-patches/MobSpawnerAbstract.patch +++ b/nms-patches/MobSpawnerAbstract.patch @@ -3,7 +3,7 @@ @@ -42,6 +42,7 @@ public void setMobName(EntityTypes entitytypes) { - this.spawnData.b().setString("id", IRegistry.ENTITY_TYPE.getKey(entitytypes).toString()); + this.spawnData.getEntity().setString("id", IRegistry.ENTITY_TYPE.getKey(entitytypes).toString()); + this.mobs.clear(); // CraftBukkit - SPIGOT-3496, MC-92282 } diff --git a/nms-patches/PathfinderGoalEatTile.patch b/nms-patches/PathfinderGoalEatTile.patch index 20990ffd9c..c4401a5641 100644 --- a/nms-patches/PathfinderGoalEatTile.patch +++ b/nms-patches/PathfinderGoalEatTile.patch @@ -12,7 +12,7 @@ private static final Predicate a = BlockStatePredicate.a(Blocks.GRASS); @@ -55,7 +59,8 @@ - BlockPosition blockposition = new BlockPosition(this.b.locX, this.b.locY, this.b.locZ); + BlockPosition blockposition = new BlockPosition(this.b); if (PathfinderGoalEatTile.a.test(this.c.getType(blockposition))) { - if (this.c.getGameRules().getBoolean("mobGriefing")) { diff --git a/nms-patches/PathfinderGoalSit.patch b/nms-patches/PathfinderGoalSit.patch index ed7625c291..cd751f9fbe 100644 --- a/nms-patches/PathfinderGoalSit.patch +++ b/nms-patches/PathfinderGoalSit.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/PathfinderGoalSit.java +++ b/net/minecraft/server/PathfinderGoalSit.java -@@ -15,7 +15,7 @@ +@@ -20,7 +20,7 @@ @Override public boolean a() { if (!this.entity.isTamed()) { diff --git a/nms-patches/PlayerChunk.patch b/nms-patches/PlayerChunk.patch index 47ab734500..27a5ae70b5 100644 --- a/nms-patches/PlayerChunk.patch +++ b/nms-patches/PlayerChunk.patch @@ -1,7 +1,7 @@ --- a/net/minecraft/server/PlayerChunk.java +++ b/net/minecraft/server/PlayerChunk.java -@@ -41,7 +41,7 @@ - this.statusFutures = new AtomicReferenceArray(PlayerChunk.CHUNK_STATUSES.size()); +@@ -43,7 +43,7 @@ + this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE; this.tickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE; this.entityTickingFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE; - this.chunkSave = CompletableFuture.completedFuture((Object) null); @@ -9,7 +9,7 @@ this.dirtyBlocks = new short[64]; this.location = chunkcoordintpair; this.lightEngine = lightengine; -@@ -74,9 +74,9 @@ +@@ -76,9 +76,9 @@ @Nullable public Chunk getChunk() { CompletableFuture> completablefuture = this.a(); @@ -21,7 +21,7 @@ } public CompletableFuture getChunkSave() { -@@ -199,7 +199,7 @@ +@@ -201,7 +201,7 @@ CompletableFuture> completablefuture = (CompletableFuture) this.statusFutures.get(i); if (completablefuture != null) { @@ -30,7 +30,7 @@ if (either == null || either.left().isPresent()) { return completablefuture; -@@ -211,6 +211,15 @@ +@@ -213,6 +213,15 @@ this.a(completablefuture1); this.statusFutures.set(i, completablefuture1); @@ -46,3 +46,12 @@ return completablefuture1; } else { return completablefuture == null ? PlayerChunk.UNLOADED_CHUNK_ACCESS_FUTURE : completablefuture; +@@ -294,7 +303,7 @@ + if (flag2 && !flag3) { + completablefuture = this.fullChunkFuture; + this.fullChunkFuture = PlayerChunk.UNLOADED_CHUNK_FUTURE; +- this.a(completablefuture.thenApply((either1) -> { ++ this.a(((CompletableFuture>) completablefuture).thenApply((either1) -> { // CraftBukkit - decompile error + playerchunkmap.getClass(); + return either1.ifLeft(playerchunkmap::a); + })); diff --git a/nms-patches/PlayerChunkMap.patch b/nms-patches/PlayerChunkMap.patch index e9eeb035c9..753e103c6e 100644 --- a/nms-patches/PlayerChunkMap.patch +++ b/nms-patches/PlayerChunkMap.patch @@ -1,19 +1,17 @@ --- a/net/minecraft/server/PlayerChunkMap.java +++ b/net/minecraft/server/PlayerChunkMap.java -@@ -33,6 +33,12 @@ - import javax.annotation.Nullable; +@@ -35,6 +35,10 @@ + import org.apache.commons.lang3.mutable.MutableBoolean; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +// CraftBukkit start -+import org.bukkit.craftbukkit.event.CraftEventFactory; +import org.bukkit.entity.Player; -+import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.event.world.ChunkUnloadEvent; +// CraftBukkit end public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { -@@ -179,9 +185,12 @@ +@@ -181,9 +185,12 @@ return completablefuture1.thenApply((list1) -> { List list2 = Lists.newArrayList(); @@ -28,19 +26,16 @@ final Either either = (Either) iterator.next(); Optional optional = either.left(); -@@ -257,9 +266,9 @@ - }).forEach((completablefuture) -> { - if (flag) { - this.executor.awaitTasks(completablefuture::isDone); -- ((Either) completablefuture.join()).ifLeft(this::saveChunk); -+ (completablefuture.join()).ifLeft(this::saveChunk); // CraftBukkit - decompile error - } else { -- ((Either) completablefuture.getNow(PlayerChunk.UNLOADED_CHUNK_ACCESS)).ifLeft(this::saveChunk); -+ (completablefuture.getNow(PlayerChunk.UNLOADED_CHUNK_ACCESS)).ifLeft(this::saveChunk); // CraftBukkit - decompile error - } +@@ -279,7 +286,7 @@ + PlayerChunkMap.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", this.x.getName()); + } else { + this.visibleChunks.values().stream().filter(PlayerChunk::hasBeenLoaded).forEach((playerchunk) -> { +- IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkSave().getNow((Object) null); ++ IChunkAccess ichunkaccess = (IChunkAccess) playerchunk.getChunkSave().getNow(null); // CraftBukkit - decompile error - }); -@@ -268,7 +277,6 @@ + if (ichunkaccess instanceof ProtoChunkExtension || ichunkaccess instanceof Chunk) { + this.saveChunk(ichunkaccess); +@@ -290,7 +297,6 @@ } } @@ -48,12 +43,8 @@ protected void unloadChunks(BooleanSupplier booleansupplier) { GameProfilerFiller gameprofilerfiller = this.world.getMethodProfiler(); -@@ -304,13 +312,22 @@ - this.a(i, playerchunk); - } else { - if (this.g.remove(i, playerchunk) && ichunkaccess != null) { -- this.saveChunk(ichunkaccess); - if (this.h.remove(i) && ichunkaccess instanceof Chunk) { +@@ -330,9 +336,19 @@ + if (this.loadedChunks.remove(i) && ichunkaccess instanceof Chunk) { Chunk chunk = (Chunk) ichunkaccess; + // CraftBukkit start @@ -62,7 +53,7 @@ + this.saveChunk(ichunkaccess, event.isSaveChunk()); + // CraftBukkit end + - chunk.c(false); + chunk.setLoaded(false); this.world.unloadChunk(chunk); + // CraftBukkit start + } else { @@ -72,7 +63,7 @@ this.lightEngine.a(ichunkaccess.getPos()); this.lightEngine.queueUpdate(); -@@ -394,7 +411,7 @@ +@@ -416,7 +432,7 @@ return CompletableFuture.completedFuture(Either.right(playerchunk_failure)); }); }, (runnable) -> { @@ -81,16 +72,16 @@ }); } } -@@ -476,7 +493,7 @@ +@@ -498,7 +514,7 @@ long i = playerchunk.h().pair(); playerchunk.getClass(); -- mailbox.a((Object) ChunkTaskQueueSorter.a(runnable, i, playerchunk::i)); -+ mailbox.a(ChunkTaskQueueSorter.a(runnable, i, playerchunk::i)); // CraftBukkit - decompile error +- mailbox.a((Object) ChunkTaskQueueSorter.a(runnable, i, playerchunk::getTicketLevel)); ++ mailbox.a(ChunkTaskQueueSorter.a(runnable, i, playerchunk::getTicketLevel)); // CraftBukkit - decompile error }); } -@@ -493,7 +510,7 @@ +@@ -515,7 +531,7 @@ return Either.left(chunk); }); }, (runnable) -> { @@ -99,7 +90,7 @@ }); completablefuture1.thenAcceptAsync((either) -> { -@@ -507,7 +524,7 @@ +@@ -529,7 +545,7 @@ return Either.left(chunk); }); }, (runnable) -> { @@ -108,23 +99,32 @@ }); return completablefuture1; } -@@ -517,8 +534,14 @@ +@@ -543,7 +559,7 @@ + return chunk; + }); + }, (runnable) -> { +- this.mailboxMain.a((Object) ChunkTaskQueueSorter.a(playerchunk, runnable)); ++ this.mailboxMain.a(ChunkTaskQueueSorter.a(playerchunk, runnable)); // CraftBukkit - decompile error + }); } - public void saveChunk(IChunkAccess ichunkaccess) { +@@ -552,8 +568,14 @@ + } + + public boolean saveChunk(IChunkAccess ichunkaccess) { + // CraftBukkit start -+ this.saveChunk(ichunkaccess, ichunkaccess.isNeedsSaving()); ++ return this.saveChunk(ichunkaccess, ichunkaccess.isNeedsSaving()); + } + -+ public void saveChunk(IChunkAccess ichunkaccess, boolean save) { ++ public boolean saveChunk(IChunkAccess ichunkaccess, boolean save) { + // CraftBukkit end this.n.a(ichunkaccess.getPos()); -- if (ichunkaccess.isNeedsSaving()) { -+ if (save) { // CraftBukkit +- if (!ichunkaccess.isNeedsSaving()) { ++ if (!save) { // CraftBukkit + return false; + } else { try { - this.world.checkSession(); - } catch (ExceptionWorldConflict exceptionworldconflict) { -@@ -569,9 +592,10 @@ +@@ -607,9 +629,10 @@ ChunkCoordIntPair chunkcoordintpair = playerchunk.h(); Packet[] apacket = new Packet[2]; @@ -133,11 +133,11 @@ int i1 = b(chunkcoordintpair, entityplayer, true); - boolean flag = i1 <= l; + boolean flag = i1 <= finall; // CraftBukkit - decompile error - boolean flag1 = i1 <= this.A; + boolean flag1 = i1 <= this.viewDistance; this.sendChunk(entityplayer, chunkcoordintpair, apacket, flag, flag1); -@@ -626,7 +650,7 @@ - private NBTTagCompound f(ChunkCoordIntPair chunkcoordintpair) throws IOException { +@@ -664,7 +687,7 @@ + private NBTTagCompound readChunkData(ChunkCoordIntPair chunkcoordintpair) throws IOException { NBTTagCompound nbttagcompound = this.read(chunkcoordintpair); - return nbttagcompound == null ? null : this.getChunkData(this.world.getWorldProvider().getDimensionManager(), this.m, nbttagcompound); @@ -145,7 +145,7 @@ } boolean d(ChunkCoordIntPair chunkcoordintpair) { -@@ -946,7 +970,7 @@ +@@ -984,7 +1007,7 @@ public final Set trackedPlayers = Sets.newHashSet(); public EntityTracker(Entity entity, int i, int j, boolean flag) { @@ -154,7 +154,7 @@ this.tracker = entity; this.trackingDistance = i; this.e = SectionPosition.a(entity); -@@ -1015,6 +1039,17 @@ +@@ -1053,6 +1076,17 @@ } } diff --git a/nms-patches/PlayerList.patch b/nms-patches/PlayerList.patch index f9cbc37c9e..a460223475 100644 --- a/nms-patches/PlayerList.patch +++ b/nms-patches/PlayerList.patch @@ -99,9 +99,9 @@ this.a(entityplayer, (EntityPlayer) null, worldserver); PlayerConnection playerconnection = new PlayerConnection(this.server, networkmanager, entityplayer); -- playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager(), this.getMaxPlayers(), worlddata.getType(), this.s, worldserver.getGameRules().getBoolean("reducedDebugInfo"))); +- playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager(), this.getMaxPlayers(), worlddata.getType(), this.viewDistance, worldserver.getGameRules().getBoolean("reducedDebugInfo"))); + // CraftBukkit - getType() -+ playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager().getType(), this.getMaxPlayers(), worlddata.getType(), this.s, worldserver.getGameRules().getBoolean("reducedDebugInfo"))); ++ playerconnection.sendPacket(new PacketPlayOutLogin(entityplayer.getId(), entityplayer.playerInteractManager.getGameMode(), worlddata.isHardcore(), worldserver.worldProvider.getDimensionManager().getType(), this.getMaxPlayers(), worlddata.getType(), this.viewDistance, worldserver.getGameRules().getBoolean("reducedDebugInfo"))); + entityplayer.getBukkitEntity().sendSupportedChannels(); // CraftBukkit playerconnection.sendPacket(new PacketPlayOutCustomPayload(PacketPlayOutCustomPayload.a, (new PacketDataSerializer(Unpooled.buffer())).a(this.getServer().getServerModName()))); playerconnection.sendPacket(new PacketPlayOutServerDifficulty(worlddata.getDifficulty(), worlddata.isDifficultyLocked())); @@ -637,7 +637,7 @@ + // entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(7, worldserver.h(1.0F))); + // entityplayer.playerConnection.sendPacket(new PacketPlayOutGameStateChange(8, worldserver.f(1.0F))); + entityplayer.setPlayerWeather(org.bukkit.WeatherType.DOWNFALL, false); -+ entityplayer.updateWeather(-worldserver.l, worldserver.l, -worldserver.n, worldserver.n); ++ entityplayer.updateWeather(-worldserver.rainLevel, worldserver.rainLevel, -worldserver.thunderLevel, worldserver.thunderLevel); + // CraftBukkit end } diff --git a/nms-patches/TickListServer.patch b/nms-patches/TickListServer.patch index 7923be79e9..7658dc2449 100644 --- a/nms-patches/TickListServer.patch +++ b/nms-patches/TickListServer.patch @@ -1,25 +1,7 @@ --- a/net/minecraft/server/TickListServer.java +++ b/net/minecraft/server/TickListServer.java -@@ -12,14 +12,15 @@ - import java.util.function.Function; - import java.util.function.Predicate; - import java.util.stream.Stream; -+import org.bukkit.craftbukkit.util.HashTreeSet; // CraftBukkit - - public class TickListServer implements TickList { - - protected final Predicate a; - protected final Function b; - protected final Function c; -- protected final Set> nextTickListHash = Sets.newHashSet(); -- protected final TreeSet> nextTickList = new TreeSet(); -+ // protected final Set> nextTickListHash = Sets.newHashSet(); -+ protected final HashTreeSet nextTickList = new HashTreeSet<>(); // CraftBukkit - HashTreeSet - private final WorldServer f; - private final List> g = Lists.newArrayList(); - private final Consumer> h; -@@ -35,16 +36,22 @@ - public void a() { +@@ -37,11 +37,17 @@ + this.b(); int i = this.nextTickList.size(); - if (i != this.nextTickListHash.size()) { @@ -37,48 +19,4 @@ + // CraftBukkit end } - this.f.getMethodProfiler().enter("cleaning"); - -- NextTickListEntry nextticklistentry; -+ NextTickListEntry nextticklistentry; // CraftBukkit - decompile error - - for (int j = 0; j < i; ++j) { - nextticklistentry = (NextTickListEntry) this.nextTickList.first(); -@@ -53,7 +60,7 @@ - } - - this.nextTickList.remove(nextticklistentry); -- this.nextTickListHash.remove(nextticklistentry); -+ // this.nextTickListHash.remove(nextticklistentry); // CraftBukkit - use nextTickList - this.g.add(nextticklistentry); - } - -@@ -122,7 +129,7 @@ - if (blockposition.getX() >= structureboundingbox.a && blockposition.getX() < structureboundingbox.d && blockposition.getZ() >= structureboundingbox.c && blockposition.getZ() < structureboundingbox.f) { - if (flag) { - if (i == 0) { -- this.nextTickListHash.remove(nextticklistentry); -+ // this.nextTickListHash.remove(nextticklistentry); // CraftBukkit - removed - } - - iterator.remove(); -@@ -196,7 +203,7 @@ - - @Override - public boolean a(BlockPosition blockposition, T t0) { -- return this.nextTickListHash.contains(new NextTickListEntry<>(blockposition, t0)); -+ return this.nextTickList.contains(new NextTickListEntry<>(blockposition, t0)); // CraftBukkit - } - - @Override -@@ -220,8 +227,8 @@ - } - - private void a(NextTickListEntry nextticklistentry) { -- if (!this.nextTickListHash.contains(nextticklistentry)) { -- this.nextTickListHash.add(nextticklistentry); -+ // CraftBukkit - use nextTickList -+ if (!this.nextTickList.contains(nextticklistentry)) { - this.nextTickList.add(nextticklistentry); - } - + this.h.getMethodProfiler().enter("selecting"); diff --git a/nms-patches/TileEntity.patch b/nms-patches/TileEntity.patch index 2f11fbf960..99e6f0a22d 100644 --- a/nms-patches/TileEntity.patch +++ b/nms-patches/TileEntity.patch @@ -1,9 +1,9 @@ --- a/net/minecraft/server/TileEntity.java +++ b/net/minecraft/server/TileEntity.java -@@ -3,9 +3,18 @@ - import javax.annotation.Nullable; +@@ -4,9 +4,18 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; + import org.apache.logging.log4j.util.Supplier; +// CraftBukkit start +import org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer; +import org.bukkit.craftbukkit.persistence.CraftPersistentDataTypeRegistry; @@ -19,7 +19,7 @@ private static final Logger LOGGER = LogManager.getLogger(); private final TileEntityTypes b; @Nullable -@@ -35,6 +44,12 @@ +@@ -37,6 +46,12 @@ public void load(NBTTagCompound nbttagcompound) { this.position = new BlockPosition(nbttagcompound.getInt("x"), nbttagcompound.getInt("y"), nbttagcompound.getInt("z")); @@ -32,7 +32,7 @@ } public NBTTagCompound save(NBTTagCompound nbttagcompound) { -@@ -51,12 +66,24 @@ +@@ -53,12 +68,24 @@ nbttagcompound.setInt("x", this.position.getX()); nbttagcompound.setInt("y", this.position.getY()); nbttagcompound.setInt("z", this.position.getZ()); @@ -57,7 +57,7 @@ String s = nbttagcompound.getString("id"); return (TileEntity) IRegistry.BLOCK_ENTITY_TYPE.getOptional(new MinecraftKey(s)).map((tileentitytypes) -> { -@@ -68,6 +95,7 @@ +@@ -70,6 +97,7 @@ } }).map((tileentity) -> { try { @@ -65,9 +65,9 @@ tileentity.load(nbttagcompound); return tileentity; } catch (Throwable throwable) { -@@ -157,4 +185,13 @@ - public TileEntityTypes q() { - return this.b; +@@ -168,4 +196,13 @@ + }, this::getPosition}); + } } + + // CraftBukkit start - add method diff --git a/nms-patches/TileEntityBeacon.patch b/nms-patches/TileEntityBeacon.patch index 5742910ca3..3e15884fe9 100644 --- a/nms-patches/TileEntityBeacon.patch +++ b/nms-patches/TileEntityBeacon.patch @@ -61,7 +61,7 @@ + { + double d0 = (double) (this.levels * 10 + 10); + - AxisAlignedBB axisalignedbb = (new AxisAlignedBB(this.position)).g(d0).b(0.0D, (double) this.world.getHeight(), 0.0D); + AxisAlignedBB axisalignedbb = (new AxisAlignedBB(this.position)).g(d0).b(0.0D, (double) this.world.getBuildHeight(), 0.0D); List list = this.world.a(EntityHuman.class, axisalignedbb); + + return list; diff --git a/nms-patches/TileEntityBrewingStand.patch b/nms-patches/TileEntityBrewingStand.patch index 3cccd28592..6057a17131 100644 --- a/nms-patches/TileEntityBrewingStand.patch +++ b/nms-patches/TileEntityBrewingStand.patch @@ -92,10 +92,10 @@ + // CraftBukkit end if (flag2 && flag) { - this.s(); + this.t(); @@ -168,6 +224,16 @@ - private void s() { + private void t() { ItemStack itemstack = (ItemStack) this.items.get(3); + // CraftBukkit start + InventoryHolder owner = this.getOwner(); diff --git a/nms-patches/TileEntityCampfire.patch b/nms-patches/TileEntityCampfire.patch index 7b9660279f..d252bb8568 100644 --- a/nms-patches/TileEntityCampfire.patch +++ b/nms-patches/TileEntityCampfire.patch @@ -12,7 +12,7 @@ public class TileEntityCampfire extends TileEntity implements Clearable, ITickable { -@@ -59,6 +64,20 @@ +@@ -55,6 +60,20 @@ }).orElse(itemstack); BlockPosition blockposition = this.getPosition(); @@ -32,4 +32,4 @@ + // CraftBukkit end InventoryUtils.dropItem(this.world, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), itemstack1); this.items.set(i, ItemStack.a); - this.s(); + this.t(); diff --git a/nms-patches/TileEntityConduit.patch b/nms-patches/TileEntityConduit.patch index 74ef7d6de7..07f2785d81 100644 --- a/nms-patches/TileEntityConduit.patch +++ b/nms-patches/TileEntityConduit.patch @@ -21,11 +21,11 @@ } @@ -175,7 +179,7 @@ - this.target = this.v(); + this.target = this.x(); this.k = null; } else if (this.target == null) { -- List list = this.world.a(EntityLiving.class, this.u(), (entityliving1) -> { -+ List list = this.world.a(EntityLiving.class, this.u(), (java.util.function.Predicate) (entityliving1) -> { // CraftBukkit - decompile error +- List list = this.world.a(EntityLiving.class, this.v(), (entityliving1) -> { ++ List list = this.world.a(EntityLiving.class, this.v(), (java.util.function.Predicate) (entityliving1) -> { // CraftBukkit - decompile error return entityliving1 instanceof IMonster && entityliving1.isInWaterOrRain(); }); @@ -48,9 +48,9 @@ @@ -221,7 +230,7 @@ @Nullable - private EntityLiving v() { -- List list = this.world.a(EntityLiving.class, this.u(), (entityliving) -> { -+ List list = this.world.a(EntityLiving.class, this.u(), (java.util.function.Predicate) (entityliving) -> { // CraftBukkit - decompile error + private EntityLiving x() { +- List list = this.world.a(EntityLiving.class, this.v(), (entityliving) -> { ++ List list = this.world.a(EntityLiving.class, this.v(), (java.util.function.Predicate) (entityliving) -> { // CraftBukkit - decompile error return entityliving.getUniqueID().equals(this.k); }); diff --git a/nms-patches/TileEntityEndGateway.patch b/nms-patches/TileEntityEndGateway.patch index f224628ac4..0e5b35f5ad 100644 --- a/nms-patches/TileEntityEndGateway.patch +++ b/nms-patches/TileEntityEndGateway.patch @@ -15,7 +15,7 @@ @@ -119,6 +125,26 @@ if (this.exitPortal != null) { - BlockPosition blockposition = this.exactTeleport ? this.exitPortal : this.s(); + BlockPosition blockposition = this.exactTeleport ? this.exitPortal : this.t(); + // CraftBukkit start - Fire PlayerTeleportEvent + if (entity instanceof EntityPlayer) { diff --git a/nms-patches/TileEntityHopper.patch b/nms-patches/TileEntityHopper.patch index f36c49dbe2..43e629004c 100644 --- a/nms-patches/TileEntityHopper.patch +++ b/nms-patches/TileEntityHopper.patch @@ -52,7 +52,7 @@ public TileEntityHopper() { super(TileEntityTypes.HOPPER); this.items = NonNullList.a(5, ItemStack.a); -@@ -161,7 +200,28 @@ +@@ -159,7 +198,28 @@ for (int i = 0; i < this.getSize(); ++i) { if (!this.getItem(i).isEmpty()) { ItemStack itemstack = this.getItem(i).cloneItemStack(); @@ -82,7 +82,7 @@ if (itemstack1.isEmpty()) { iinventory.update(); -@@ -226,7 +286,34 @@ +@@ -224,7 +284,34 @@ if (!itemstack.isEmpty() && b(iinventory, itemstack, i, enumdirection)) { ItemStack itemstack1 = itemstack.cloneItemStack(); @@ -118,7 +118,7 @@ if (itemstack2.isEmpty()) { iinventory.update(); -@@ -241,6 +328,13 @@ +@@ -239,6 +326,13 @@ public static boolean a(IInventory iinventory, EntityItem entityitem) { boolean flag = false; diff --git a/nms-patches/TileEntitySign.patch b/nms-patches/TileEntitySign.patch index 9bde15700c..25789f53d2 100644 --- a/nms-patches/TileEntitySign.patch +++ b/nms-patches/TileEntitySign.patch @@ -19,12 +19,12 @@ + } + // CraftBukkit end + - nbttagcompound.setString("Color", this.l.b()); + nbttagcompound.setString("Color", this.color.b()); return nbttagcompound; } @@ -39,18 +45,38 @@ super.load(nbttagcompound); - this.l = EnumColor.a(nbttagcompound.getString("Color"), EnumColor.BLACK); + this.color = EnumColor.a(nbttagcompound.getString("Color"), EnumColor.BLACK); + // CraftBukkit start - Add an option to convert signs correctly + // This is done with a flag instead of all the time because @@ -34,13 +34,13 @@ + for (int i = 0; i < 4; ++i) { String s = nbttagcompound.getString("Text" + (i + 1)); -- IChatBaseComponent ichatbasecomponent = IChatBaseComponent.ChatSerializer.a(s); +- IChatBaseComponent ichatbasecomponent = IChatBaseComponent.ChatSerializer.a(s.isEmpty() ? "\"\"" : s); + if (s != null && s.length() > 2048) { + s = "\"\""; + } + + try { -+ IChatBaseComponent ichatbasecomponent = IChatBaseComponent.ChatSerializer.a(s); ++ IChatBaseComponent ichatbasecomponent = IChatBaseComponent.ChatSerializer.a(s.isEmpty() ? "\"\"" : s); - if (this.world instanceof WorldServer) { - try { @@ -106,4 +106,4 @@ + return new CommandListenerWrapper(this, new Vec3D((double) this.position.getX() + 0.5D, (double) this.position.getY() + 0.5D, (double) this.position.getZ() + 0.5D), Vec2F.a, (WorldServer) this.world, 2, s, (IChatBaseComponent) object, this.world.getMinecraftServer(), entityplayer); } - public EnumColor f() { + public EnumColor getColor() { diff --git a/nms-patches/World.patch b/nms-patches/World.patch index 301ea3435f..fdf2d66d07 100644 --- a/nms-patches/World.patch +++ b/nms-patches/World.patch @@ -79,7 +79,7 @@ @@ -49,6 +109,35 @@ this.isClientSide = flag; this.worldBorder = this.worldProvider.getWorldBorder(); - this.c = Thread.currentThread(); + this.serverThread = Thread.currentThread(); + // CraftBukkit start + getWorldBorder().world = (WorldServer) this; + // From PlayerList.setPlayerFileData @@ -136,7 +136,7 @@ + return true; + } + // CraftBukkit end - if (isInsideWorld(blockposition)) { + if (isOutsideWorld(blockposition)) { return false; } else if (!this.isClientSide && this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) { @@ -126,9 +235,23 @@ @@ -283,10 +283,10 @@ + } + } + // CraftBukkit end - if (isInsideWorld(blockposition)) { + if (isOutsideWorld(blockposition)) { return Blocks.VOID_AIR.getBlockData(); } else { -@@ -454,9 +658,11 @@ +@@ -459,9 +663,11 @@ TileEntity tileentity1 = (TileEntity) this.tileEntityListPending.get(i); if (!tileentity1.isRemoved()) { @@ -298,7 +298,7 @@ if (this.isLoaded(tileentity1.getPosition())) { Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition()); -@@ -464,6 +670,12 @@ +@@ -469,6 +675,12 @@ chunk.setTileEntity(tileentity1.getPosition(), tileentity1); this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3); @@ -311,7 +311,7 @@ } } } -@@ -626,6 +838,7 @@ +@@ -631,6 +843,7 @@ } } @@ -319,8 +319,8 @@ @Nullable @Override public TileEntity getTileEntity(BlockPosition blockposition) { -@@ -634,6 +847,12 @@ - } else if (!this.isClientSide && Thread.currentThread() != this.c) { +@@ -639,6 +852,12 @@ + } else if (!this.isClientSide && Thread.currentThread() != this.serverThread) { return null; } else { + // CraftBukkit start @@ -332,9 +332,9 @@ TileEntity tileentity = null; if (this.tickingTileEntities) { -@@ -668,6 +887,14 @@ +@@ -673,6 +892,14 @@ public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) { - if (!isInsideWorld(blockposition)) { + if (!isOutsideWorld(blockposition)) { if (tileentity != null && !tileentity.isRemoved()) { + // CraftBukkit start + if (captureBlockStates) { diff --git a/nms-patches/WorldData.patch b/nms-patches/WorldData.patch index 5f0a6d82bd..c1260b63c6 100644 --- a/nms-patches/WorldData.patch +++ b/nms-patches/WorldData.patch @@ -33,7 +33,7 @@ public void setThundering(boolean flag) { + // CraftBukkit start -+ if (this.z == flag) { ++ if (this.thundering == flag) { + return; + } + @@ -46,7 +46,7 @@ + } + } + // CraftBukkit end - this.z = flag; + this.thundering = flag; } @@ -524,6 +545,20 @@ @@ -54,7 +54,7 @@ public void setStorm(boolean flag) { + // CraftBukkit start -+ if (this.x == flag) { ++ if (this.raining == flag) { + return; + } + @@ -67,7 +67,7 @@ + } + } + // CraftBukkit end - this.x = flag; + this.raining = flag; } @@ -673,6 +708,12 @@ diff --git a/nms-patches/WorldServer.patch b/nms-patches/WorldServer.patch index 4d992025c2..a0022f8e8e 100644 --- a/nms-patches/WorldServer.patch +++ b/nms-patches/WorldServer.patch @@ -1,19 +1,13 @@ --- a/net/minecraft/server/WorldServer.java +++ b/net/minecraft/server/WorldServer.java -@@ -31,6 +31,21 @@ +@@ -30,6 +30,15 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +// CraftBukkit start -+import java.util.logging.Level; +import org.bukkit.Bukkit; -+ +import org.bukkit.WeatherType; -+import org.bukkit.block.BlockState; +import org.bukkit.craftbukkit.event.CraftEventFactory; -+import org.bukkit.craftbukkit.util.HashTreeSet; -+ -+import org.bukkit.event.block.BlockFormEvent; +import org.bukkit.event.entity.CreatureSpawnEvent; +import org.bukkit.event.server.MapInitializeEvent; +import org.bukkit.event.weather.LightningStrikeEvent; @@ -22,7 +16,7 @@ public class WorldServer extends World { private static final Logger LOGGER = LogManager.getLogger(); -@@ -56,12 +71,29 @@ +@@ -55,12 +64,29 @@ @Nullable private final MobSpawnerTrader mobSpawnerTrader; @@ -55,7 +49,7 @@ this.nextTickListBlock = new TickListServer<>(this, (block) -> { return block == null || block.getBlockData().isAir(); }, IRegistry.BLOCK::getKey, IRegistry.BLOCK::get, this::b); -@@ -84,7 +116,8 @@ +@@ -83,7 +109,8 @@ this.getWorldData().setGameType(minecraftserver.getGamemode()); } @@ -65,17 +59,17 @@ } public void doTick(BooleanSupplier booleansupplier) { -@@ -161,6 +194,7 @@ - this.m = MathHelper.a(this.m, 0.0F, 1.0F); +@@ -160,6 +187,7 @@ + this.rainLevel = MathHelper.a(this.rainLevel, 0.0F, 1.0F); } + /* CraftBukkit start - if (this.l != this.m) { - this.server.getPlayerList().a((Packet) (new PacketPlayOutGameStateChange(7, this.m)), this.worldProvider.getDimensionManager()); + if (this.lastRainLevel != this.rainLevel) { + this.server.getPlayerList().a((Packet) (new PacketPlayOutGameStateChange(7, this.rainLevel)), this.worldProvider.getDimensionManager()); } -@@ -179,13 +213,34 @@ - this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(7, this.m)); - this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(8, this.o)); +@@ -178,13 +206,34 @@ + this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(7, this.rainLevel)); + this.server.getPlayerList().sendAll(new PacketPlayOutGameStateChange(8, this.thunderLevel)); } + // */ + for (int idx = 0; idx < this.players.size(); ++idx) { @@ -94,7 +88,7 @@ + } + for (int idx = 0; idx < this.players.size(); ++idx) { + if (((EntityPlayer) this.players.get(idx)).world == this) { -+ ((EntityPlayer) this.players.get(idx)).updateWeather(this.l, this.m, this.n, this.o); ++ ((EntityPlayer) this.players.get(idx)).updateWeather(this.lastRainLevel, this.rainLevel, this.lastThunderLevel, this.thunderLevel); + } + } + // CraftBukkit end @@ -109,7 +103,7 @@ })) { this.D = false; if (this.getGameRules().getBoolean("doDaylightCycle")) { -@@ -226,7 +281,7 @@ +@@ -225,7 +274,7 @@ this.ae(); this.ticking = false; gameprofilerfiller.exitEnter("entities"); @@ -118,7 +112,7 @@ if (flag3) { this.resetEmptyTime(); -@@ -240,6 +295,11 @@ +@@ -239,6 +288,11 @@ for (i = 0; i < this.globalEntityList.size(); ++i) { entity = (Entity) this.globalEntityList.get(i); @@ -130,7 +124,7 @@ this.a((entity1) -> { ++entity1.ticksLived; entity1.tick(); -@@ -258,6 +318,7 @@ +@@ -257,6 +311,7 @@ Entity entity1 = (Entity) entry.getValue(); Entity entity2 = entity1.getVehicle(); @@ -138,7 +132,7 @@ if (!this.server.getSpawnAnimals() && (entity1 instanceof EntityAnimal || entity1 instanceof EntityWaterAnimal)) { entity1.die(); } -@@ -265,6 +326,7 @@ +@@ -264,6 +319,7 @@ if (!this.server.getSpawnNPCs() && entity1 instanceof NPC) { entity1.die(); } @@ -146,7 +140,7 @@ if (entity2 != null) { if (!entity2.dead && entity2.w(entity1)) { -@@ -325,10 +387,10 @@ +@@ -324,10 +380,10 @@ entityhorseskeleton.r(true); entityhorseskeleton.setAgeRaw(0); entityhorseskeleton.setPosition((double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ()); @@ -159,7 +153,7 @@ } } -@@ -339,11 +401,11 @@ +@@ -338,11 +394,11 @@ BiomeBase biomebase = this.getBiome(blockposition); if (biomebase.a((IWorldReader) this, blockposition1)) { @@ -173,16 +167,16 @@ } if (flag && this.getBiome(blockposition1).b() == BiomeBase.Precipitation.RAIN) { -@@ -390,7 +452,7 @@ +@@ -389,7 +445,7 @@ protected BlockPosition a(BlockPosition blockposition) { BlockPosition blockposition1 = this.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING, blockposition); - AxisAlignedBB axisalignedbb = (new AxisAlignedBB(blockposition1, new BlockPosition(blockposition1.getX(), this.getHeight(), blockposition1.getZ()))).g(3.0D); + AxisAlignedBB axisalignedbb = (new AxisAlignedBB(blockposition1, new BlockPosition(blockposition1.getX(), this.getBuildHeight(), blockposition1.getZ()))).g(3.0D); - List list = this.a(EntityLiving.class, axisalignedbb, (entityliving) -> { + List list = this.a(EntityLiving.class, axisalignedbb, (java.util.function.Predicate) (entityliving) -> { // CraftBukkit - decompile error return entityliving != null && entityliving.isAlive() && this.f(entityliving.getChunkCoordinates()); }); -@@ -419,7 +481,7 @@ +@@ -418,7 +474,7 @@ while (iterator.hasNext()) { EntityPlayer entityplayer = (EntityPlayer) iterator.next(); @@ -191,7 +185,7 @@ ++i; } else if (entityplayer.isSleeping()) { ++j; -@@ -437,10 +499,22 @@ +@@ -436,10 +492,22 @@ } private void clearWeather() { @@ -216,7 +210,7 @@ } public void resetEmptyTime() { -@@ -478,6 +552,7 @@ +@@ -477,6 +545,7 @@ return IRegistry.ENTITY_TYPE.getKey(entity.getEntityType()).toString(); }); entity.tick(); @@ -224,7 +218,7 @@ this.getMethodProfiler().exit(); } -@@ -563,6 +638,22 @@ +@@ -562,6 +631,22 @@ BlockPosition blockposition = worldchunkmanager.a(0, 0, 256, list, random); ChunkCoordIntPair chunkcoordintpair = blockposition == null ? new ChunkCoordIntPair(0, 0) : new ChunkCoordIntPair(blockposition); @@ -247,7 +241,7 @@ if (blockposition == null) { WorldServer.LOGGER.warn("Unable to find spawn biome"); } -@@ -638,6 +729,7 @@ +@@ -637,6 +722,7 @@ ChunkProviderServer chunkproviderserver = this.getChunkProvider(); if (!flag1) { @@ -255,7 +249,7 @@ if (iprogressupdate != null) { iprogressupdate.a(new ChatMessage("menu.savingLevel", new Object[0])); } -@@ -716,8 +808,16 @@ +@@ -715,8 +801,16 @@ while (objectiterator.hasNext()) { Entity entity = (Entity) objectiterator.next(); @@ -272,8 +266,8 @@ + // CraftBukkit end EnumCreatureType enumcreaturetype = entity.getEntityType().d(); - if (enumcreaturetype != EnumCreatureType.MISC) { -@@ -733,11 +833,24 @@ + if (enumcreaturetype != EnumCreatureType.MISC && this.getChunkProvider().a(entity)) { +@@ -732,11 +826,24 @@ @Override public boolean addEntity(Entity entity) { @@ -300,7 +294,7 @@ } public void addEntityTeleport(Entity entity) { -@@ -787,13 +900,18 @@ +@@ -786,13 +893,18 @@ this.registerEntity(entityplayer); } @@ -321,7 +315,7 @@ IChunkAccess ichunkaccess = this.getChunkAt(MathHelper.floor(entity.locX / 16.0D), MathHelper.floor(entity.locZ / 16.0D), ChunkStatus.FULL, entity.attachedToPlayer); if (!(ichunkaccess instanceof Chunk)) { -@@ -821,7 +939,7 @@ +@@ -820,7 +932,7 @@ if (entity1 == null) { return false; } else { @@ -330,7 +324,7 @@ return true; } } -@@ -876,6 +994,7 @@ +@@ -875,6 +987,7 @@ this.I.remove(((EntityInsentient) entity).getNavigation()); } @@ -338,7 +332,7 @@ } private void registerEntity(Entity entity) { -@@ -899,6 +1018,7 @@ +@@ -898,6 +1011,7 @@ if (entity instanceof EntityInsentient) { this.I.add(((EntityInsentient) entity).getNavigation()); } @@ -346,7 +340,7 @@ } } -@@ -929,6 +1049,18 @@ +@@ -928,6 +1042,18 @@ } public void strikeLightning(EntityLightning entitylightning) { @@ -365,7 +359,7 @@ this.globalEntityList.add(entitylightning); this.server.getPlayerList().sendPacketNearby((EntityHuman) null, entitylightning.locX, entitylightning.locY, entitylightning.locZ, 512.0D, this.worldProvider.getDimensionManager(), new PacketPlayOutSpawnEntityWeather(entitylightning)); } -@@ -937,6 +1069,12 @@ +@@ -936,6 +1062,12 @@ public void a(int i, BlockPosition blockposition, int j) { Iterator iterator = this.server.getPlayerList().getPlayers().iterator(); @@ -378,7 +372,7 @@ while (iterator.hasNext()) { EntityPlayer entityplayer = (EntityPlayer) iterator.next(); -@@ -945,6 +1083,12 @@ +@@ -944,6 +1076,12 @@ double d1 = (double) blockposition.getY() - entityplayer.locY; double d2 = (double) blockposition.getZ() - entityplayer.locZ; @@ -391,7 +385,7 @@ if (d0 * d0 + d1 * d1 + d2 * d2 < 1024.0D) { entityplayer.playerConnection.sendPacket(new PacketPlayOutBlockBreakAnimation(i, blockposition, j)); } -@@ -1005,6 +1149,14 @@ +@@ -1004,6 +1142,14 @@ @Override public Explosion createExplosion(@Nullable Entity entity, DamageSource damagesource, double d0, double d1, double d2, float f, boolean flag, Explosion.Effect explosion_effect) { @@ -406,7 +400,7 @@ Explosion explosion = new Explosion(this, entity, d0, d1, d2, f, flag, explosion_effect); if (damagesource != null) { -@@ -1013,6 +1165,8 @@ +@@ -1012,6 +1158,8 @@ explosion.a(); explosion.a(false); @@ -415,7 +409,7 @@ if (explosion_effect == Explosion.Effect.NONE) { explosion.clearBlocks(); } -@@ -1083,13 +1237,20 @@ +@@ -1076,13 +1224,20 @@ } public int a(T t0, double d0, double d1, double d2, int i, double d3, double d4, double d5, double d6) { @@ -438,7 +432,7 @@ ++j; } } -@@ -1172,7 +1333,13 @@ +@@ -1165,7 +1320,13 @@ @Override public WorldMap a(String s) { return (WorldMap) this.getMinecraftServer().getWorldServer(DimensionManager.OVERWORLD).getWorldPersistentData().b(() -> { diff --git a/pom.xml b/pom.xml index 2d444b6a1c..f3207c403d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.bukkit craftbukkit jar - 1.14-R0.1-SNAPSHOT + 1.14.1-R0.1-SNAPSHOT CraftBukkit https://www.spigotmc.org/ @@ -12,7 +12,7 @@ true UTF-8 unknown - 1.14 + 1.14.1 1_14_R1 git-Bukkit- diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 55f3614bb0..dbd8354213 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -918,12 +918,12 @@ public final class CraftServer implements Server { } worlddata = new WorldData(worldSettings, name); } else { - worlddata.a(name); + worlddata.setName(name); worldSettings = new WorldSettings(worlddata); } DimensionManager actualDimension = DimensionManager.a(creator.environment().getId()); - DimensionManager internalDimension = DimensionManager.a(name, new DimensionManager(dimension, actualDimension.c(), actualDimension.f, (w, manager) -> actualDimension.g.apply(w, manager), actualDimension.hasSkyLight(), actualDimension)); + DimensionManager internalDimension = DimensionManager.register(name, new DimensionManager(dimension, actualDimension.getSuffix(), actualDimension.folder, (w, manager) -> actualDimension.providerFactory.apply(w, manager), actualDimension.hasSkyLight(), actualDimension)); WorldServer internal = (WorldServer) new WorldServer(console, console.executorService, sdm, worlddata, internalDimension, console.getMethodProfiler(), getServer().worldLoadListenerFactory.create(11), creator.environment(), generator); if (!(worlds.containsKey(name.toLowerCase(java.util.Locale.ENGLISH)))) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index d5e3e31421..950fe8b99f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -1643,7 +1643,7 @@ public class CraftWorld implements World { @Override public int getMaxHeight() { - return world.getHeight(); + return world.getBuildHeight(); } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java index fa05704946..f971d426a3 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -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 SimpleDateFormat("yyyyMMdd-HHmm").parse(Main.class.getPackage().getImplementationVendor()); Calendar deadline = Calendar.getInstance(); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java index e7e58877e2..15022ada0c 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java @@ -59,12 +59,12 @@ public class CraftSign extends CraftBlockEntityState implements @Override public DyeColor getColor() { - return DyeColor.getByWoolData((byte) getSnapshot().f().getColorIndex()); + return DyeColor.getByWoolData((byte) getSnapshot().getColor().getColorIndex()); } @Override public void setColor(DyeColor color) { - getSnapshot().a(EnumColor.fromColorIndex(color.getWoolData())); + getSnapshot().setColor(EnumColor.fromColorIndex(color.getWoolData())); } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java index 71084be470..836110b00f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftCat.java @@ -43,11 +43,11 @@ public class CraftCat extends CraftTameableAnimal implements Cat { @Override public DyeColor getCollarColor() { - return DyeColor.getByWoolData((byte) getHandle().ei().getColorIndex()); + return DyeColor.getByWoolData((byte) getHandle().getCollarColor().getColorIndex()); } @Override public void setCollarColor(DyeColor color) { - getHandle().a(EnumColor.fromColorIndex(color.getWoolData())); + getHandle().setCollarColor(EnumColor.fromColorIndex(color.getWoolData())); } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index aa64af97ab..ba50e98462 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -66,13 +66,13 @@ import net.minecraft.server.EntityIllagerWizard; import net.minecraft.server.EntityIronGolem; import net.minecraft.server.EntityItem; import net.minecraft.server.EntityItemFrame; -import net.minecraft.server.EntityLLamaTrader; import net.minecraft.server.EntityLargeFireball; import net.minecraft.server.EntityLeash; import net.minecraft.server.EntityLightning; import net.minecraft.server.EntityLiving; import net.minecraft.server.EntityLlama; import net.minecraft.server.EntityLlamaSpit; +import net.minecraft.server.EntityLlamaTrader; import net.minecraft.server.EntityMagmaCube; import net.minecraft.server.EntityMinecartAbstract; import net.minecraft.server.EntityMinecartChest; @@ -220,7 +220,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { if (entity instanceof EntityHorseChestedAbstract){ if (entity instanceof EntityHorseDonkey) { return new CraftDonkey(server, (EntityHorseDonkey) entity); } else if (entity instanceof EntityHorseMule) { return new CraftMule(server, (EntityHorseMule) entity); } - else if (entity instanceof EntityLLamaTrader) { return new CraftTraderLlama(server, (EntityLLamaTrader) entity); } + else if (entity instanceof EntityLlamaTrader) { return new CraftTraderLlama(server, (EntityLlamaTrader) entity); } else if (entity instanceof EntityLlama) { return new CraftLlama(server, (EntityLlama) entity); } } else if (entity instanceof EntityHorse) { return new CraftHorse(server, (EntityHorse) entity); } else if (entity instanceof EntityHorseSkeleton) { return new CraftSkeletonHorse(server, (EntityHorseSkeleton) entity); } @@ -933,7 +933,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @Override public Pose getPose() { - return Pose.values()[getHandle().Z().ordinal()]; + return Pose.values()[getHandle().getPose().ordinal()]; } public void storeBukkitValues(NBTTagCompound c) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java index a78cad292a..2e2c253f4a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java @@ -29,38 +29,38 @@ public class CraftFox extends CraftAnimals implements Fox { @Override public Type getFoxType() { - return Type.values()[getHandle().dV().ordinal()]; + return Type.values()[getHandle().getFoxType().ordinal()]; } @Override public void setFoxType(Type type) { Preconditions.checkArgument(type != null, "type"); - getHandle().a(EntityFox.Type.values()[type.ordinal()]); + getHandle().setFoxType(EntityFox.Type.values()[type.ordinal()]); } @Override public boolean isCrouching() { - return getHandle().ef(); + return getHandle().isCrouching(); } @Override public void setCrouching(boolean crouching) { - getHandle().t(crouching); + getHandle().setCrouching(crouching); } @Override public boolean isSitting() { - return getHandle().dW(); + return getHandle().isSitting(); } @Override public void setSitting(boolean sitting) { - getHandle().r(sitting); + getHandle().setSitting(sitting); } @Override public void setSleeping(boolean sleeping) { - getHandle().x(sleeping); + getHandle().setSleeping(sleeping); } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java index 5d1f2741eb..1ca04ec4ee 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftMushroomCow.java @@ -18,14 +18,14 @@ public class CraftMushroomCow extends CraftCow implements MushroomCow { @Override public Variant getVariant() { - return Variant.values()[getHandle().dV().ordinal()]; + return Variant.values()[getHandle().getVariant().ordinal()]; } @Override public void setVariant(Variant variant) { Preconditions.checkArgument(variant != null, "variant"); - getHandle().a(EntityMushroomCow.Type.values()[variant.ordinal()]); + getHandle().setVariant(EntityMushroomCow.Type.values()[variant.ordinal()]); } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTraderLlama.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTraderLlama.java index a8ecddf78e..38a8649c66 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTraderLlama.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTraderLlama.java @@ -1,19 +1,19 @@ package org.bukkit.craftbukkit.entity; -import net.minecraft.server.EntityLLamaTrader; +import net.minecraft.server.EntityLlamaTrader; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.EntityType; import org.bukkit.entity.TraderLlama; public class CraftTraderLlama extends CraftLlama implements TraderLlama { - public CraftTraderLlama(CraftServer server, EntityLLamaTrader entity) { + public CraftTraderLlama(CraftServer server, EntityLlamaTrader entity) { super(server, entity); } @Override - public EntityLLamaTrader getHandle() { - return (EntityLLamaTrader) super.getHandle(); + public EntityLlamaTrader getHandle() { + return (EntityLlamaTrader) super.getHandle(); } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java index 32427499a6..52d832f805 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchantCustom.java @@ -83,16 +83,16 @@ public class CraftMerchantCustom extends CraftMerchant { } @Override - public int dV() { + public int getExperience() { return 0; // xp } @Override - public void q(int i) { + public void r(int i) { } @Override - public boolean dZ() { + public boolean ea() { return true; } } diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java index 06728e53d5..bed9719216 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -186,7 +186,7 @@ public final class CraftMagicNumbers implements UnsafeValues { * @return string */ public String getMappingsVersion() { - return "30f0a3bd4ceb5c03fe41ac0cfea4ffe3"; + return "48be70f51ffe914d865f175ed3bf992d"; } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java index e81fc4a7f4..755f7f2649 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java +++ b/src/main/java/org/bukkit/craftbukkit/util/DummyGeneratorAccess.java @@ -142,11 +142,6 @@ public class DummyGeneratorAccess implements GeneratorAccess { throw new UnsupportedOperationException("Not supported yet."); } - @Override - public int a(BlockPosition bp, EnumDirection ed) { - throw new UnsupportedOperationException("Not supported yet."); - } - @Override public boolean e() { throw new UnsupportedOperationException("Not supported yet."); diff --git a/src/main/java/org/bukkit/craftbukkit/util/HashTreeSet.java b/src/main/java/org/bukkit/craftbukkit/util/HashTreeSet.java deleted file mode 100644 index 80a5c29f3b..0000000000 --- a/src/main/java/org/bukkit/craftbukkit/util/HashTreeSet.java +++ /dev/null @@ -1,117 +0,0 @@ -package org.bukkit.craftbukkit.util; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import java.util.TreeSet; - -public class HashTreeSet implements Set { - - private HashSet hash = new HashSet(); - private TreeSet tree = new TreeSet(); - - public HashTreeSet() { - - } - - @Override - public int size() { - return hash.size(); - } - - @Override - public boolean isEmpty() { - return hash.isEmpty(); - } - - @Override - public boolean contains(Object o) { - return hash.contains(o); - } - - @Override - public Iterator iterator() { - return new Iterator() { - - private Iterator it = tree.iterator(); - private V last; - - @Override - public boolean hasNext() { - return it.hasNext(); - } - - @Override - public V next() { - return last = it.next(); - } - - @Override - public void remove() { - if (last == null) { - throw new IllegalStateException(); - } - it.remove(); - hash.remove(last); - last = null; - } - }; - } - - @Override - public Object[] toArray() { - return hash.toArray(); - } - - @Override - public Object[] toArray(Object[] a) { - return hash.toArray(a); - } - - @Override - public boolean add(V e) { - hash.add(e); - return tree.add(e); - } - - @Override - public boolean remove(Object o) { - hash.remove(o); - return tree.remove(o); - } - - @Override - public boolean containsAll(Collection c) { - return hash.containsAll(c); - } - - @Override - public boolean addAll(Collection c) { - tree.addAll(c); - return hash.addAll(c); - } - - @Override - public boolean retainAll(Collection c) { - tree.retainAll(c); - return hash.retainAll(c); - } - - @Override - public boolean removeAll(Collection c) { - tree.removeAll(c); - return hash.removeAll(c); - } - - @Override - public void clear() { - hash.clear(); - tree.clear(); - } - - public V first() { - return tree.first(); - } - -}