From b4230a9a7efde35b30fefdb4a2492209d5334def Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 23 Oct 2018 06:00:00 +1100 Subject: [PATCH] Update to Minecraft 1.13.2 --- nms-patches/AdvancementDataPlayer.patch | 2 +- nms-patches/BlockCauldron.patch | 2 +- nms-patches/Chunk.patch | 117 ++++-------------- nms-patches/ChunkProviderServer.patch | 9 +- nms-patches/CommandForceload.patch | 6 +- nms-patches/DataConverterRegistry.patch | 4 +- nms-patches/Entity.patch | 46 +++---- nms-patches/EntityAnimal.patch | 8 +- nms-patches/EntityBoat.patch | 4 +- nms-patches/EntityEnderDragon.patch | 6 +- nms-patches/EntityFish.patch | 10 +- nms-patches/EntityFishingHook.patch | 2 +- nms-patches/EntityItemFrame.patch | 2 +- nms-patches/EntityMinecartMobSpawner.patch | 13 -- nms-patches/EntityOcelot.patch | 2 +- nms-patches/EntityPigZombie.patch | 2 +- nms-patches/EntityPlayer.patch | 2 +- nms-patches/EntityTurtle.patch | 2 +- nms-patches/EntityVillager.patch | 9 -- nms-patches/HandshakeListener.patch | 4 +- nms-patches/ItemArmorStand.patch | 14 +++ nms-patches/ItemEndCrystal.patch | 14 +++ nms-patches/ItemWorldMap.patch | 2 +- nms-patches/MinecraftServer.patch | 2 +- nms-patches/PacketDataSerializer.patch | 6 +- nms-patches/PathfinderGoalPanic.patch | 2 +- nms-patches/PlayerConnection.patch | 6 +- nms-patches/PlayerList.patch | 2 +- nms-patches/ProtoChunk.patch | 2 +- nms-patches/SpawnerCreature.patch | 36 +++--- nms-patches/TileEntityConduit.patch | 16 +-- nms-patches/TileEntityFurnace.patch | 14 +-- nms-patches/World.patch | 10 +- nms-patches/WorldData.patch | 4 +- nms-patches/WorldGenFactory.patch | 11 -- pom.xml | 8 +- .../org/bukkit/craftbukkit/CraftServer.java | 6 +- .../org/bukkit/craftbukkit/CraftWorld.java | 2 +- .../java/org/bukkit/craftbukkit/Main.java | 4 +- .../bukkit/craftbukkit/block/CraftBlock.java | 2 +- .../craftbukkit/entity/CraftAnimals.java | 4 +- .../craftbukkit/entity/CraftHumanEntity.java | 4 +- .../craftbukkit/entity/CraftVillager.java | 2 +- .../craftbukkit/event/CraftEventFactory.java | 11 ++ .../craftbukkit/inventory/CraftMetaItem.java | 2 +- .../craftbukkit/util/CraftMagicNumbers.java | 2 +- .../java/org/bukkit/StructureTypeTest.java | 6 +- 47 files changed, 184 insertions(+), 262 deletions(-) delete mode 100644 nms-patches/EntityMinecartMobSpawner.patch create mode 100644 nms-patches/ItemArmorStand.patch create mode 100644 nms-patches/ItemEndCrystal.patch delete mode 100644 nms-patches/WorldGenFactory.patch diff --git a/nms-patches/AdvancementDataPlayer.patch b/nms-patches/AdvancementDataPlayer.patch index bd0ee40199..7636d583e9 100644 --- a/nms-patches/AdvancementDataPlayer.patch +++ b/nms-patches/AdvancementDataPlayer.patch @@ -29,7 +29,7 @@ dynamic = dynamic.set("DataVersion", dynamic.createInt(1343)); @@ -148,7 +148,7 @@ - dynamic = this.d.az().update(DataFixTypes.ADVANCEMENTS, dynamic, dynamic.getInt("DataVersion"), 1628); + dynamic = this.d.az().update(DataFixTypes.ADVANCEMENTS, dynamic, dynamic.getInt("DataVersion"), 1631); dynamic = dynamic.remove("DataVersion"); - Map map = (Map) AdvancementDataPlayer.b.getAdapter(AdvancementDataPlayer.c).fromJsonTree((JsonElement) dynamic.getValue()); + Map map = (Map) AdvancementDataPlayer.b.getAdapter(AdvancementDataPlayer.c).fromJsonTree((JsonElement) dynamic.getValue()); // CraftBukkit - decompile error diff --git a/nms-patches/BlockCauldron.patch b/nms-patches/BlockCauldron.patch index 64498ab16e..7539f8d7dc 100644 --- a/nms-patches/BlockCauldron.patch +++ b/nms-patches/BlockCauldron.patch @@ -11,7 +11,7 @@ @@ -32,8 +34,13 @@ float f = (float) blockposition.getY() + (6.0F + (float) (3 * i)) / 16.0F; - if (!world.isClientSide && entity.isBurning() && i > 0 && entity.getBoundingBox().b <= (double) f) { + if (!world.isClientSide && entity.isBurning() && i > 0 && entity.getBoundingBox().minY <= (double) f) { + // CraftBukkit start + if (!this.changeLevel(world, blockposition, iblockdata, i - 1, entity, CauldronLevelChangeEvent.ChangeReason.EXTINGUISH)) { + return; diff --git a/nms-patches/Chunk.patch b/nms-patches/Chunk.patch index d8a2d75d75..908148dea6 100644 --- a/nms-patches/Chunk.patch +++ b/nms-patches/Chunk.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/Chunk.java +++ b/net/minecraft/server/Chunk.java -@@ -23,6 +23,8 @@ +@@ -22,6 +22,8 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -10,8 +10,8 @@ private static final Logger d = LogManager.getLogger(); @@ -57,6 +59,35 @@ - private int D; private final AtomicInteger E; + private final ChunkCoordIntPair F; + // CraftBukkit start - Neighbor loaded cache for chunk lighting and entity ticking + private int neighbors = 0x1 << 12; @@ -45,7 +45,7 @@ public Chunk(World world, int i, int j, BiomeBase[] abiomebase, ChunkConverter chunkconverter, TickList ticklist, TickList ticklist1, long k) { this.sections = new ChunkSection[16]; this.g = new boolean[256]; -@@ -94,8 +125,16 @@ +@@ -95,8 +126,16 @@ this.s = ticklist; this.t = ticklist1; this.z = k; @@ -62,7 +62,7 @@ public Chunk(World world, ProtoChunk protochunk, int i, int j) { this(world, i, j, protochunk.getBiomeIndex(), protochunk.v(), protochunk.n(), protochunk.o(), protochunk.m()); -@@ -135,14 +174,15 @@ +@@ -136,14 +175,15 @@ HeightMap.Type heightmap_type = (HeightMap.Type) iterator.next(); if (heightmap_type.c() == HeightMap.Use.LIVE_WORLD) { @@ -80,23 +80,23 @@ } public Set t() { -@@ -412,8 +452,15 @@ +@@ -413,8 +453,15 @@ } } + // CraftBukkit start @Nullable - public IBlockData a(BlockPosition blockposition, IBlockData iblockdata, boolean flag) { -+ return this.a(blockposition, iblockdata, flag, true); + public IBlockData setType(BlockPosition blockposition, IBlockData iblockdata, boolean flag) { ++ return this.setType(blockposition, iblockdata, flag, true); + } + + @Nullable -+ public IBlockData a(BlockPosition blockposition, IBlockData iblockdata, boolean flag, boolean doPlace) { ++ public IBlockData setType(BlockPosition blockposition, IBlockData iblockdata, boolean flag, boolean doPlace) { + // CraftBukkit end int i = blockposition.getX() & 15; int j = blockposition.getY(); int k = blockposition.getZ() & 15; -@@ -473,7 +520,8 @@ +@@ -474,7 +521,8 @@ } } @@ -106,7 +106,7 @@ iblockdata.onPlace(this.world, blockposition, iblockdata1); } -@@ -653,7 +701,19 @@ +@@ -654,7 +702,12 @@ @Nullable public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { @@ -116,33 +116,14 @@ + if (tileentity == null) { + tileentity = (TileEntity) this.tileEntities.get(blockposition); + } -+ if (tileentity == null) { -+ NBTTagCompound pending = this.h.remove(blockposition); -+ if (pending != null) { -+ this.processQueuedTile(blockposition, pending); -+ return this.a(blockposition, chunk_enumtileentitystate); -+ } -+ } + // CraftBukkit end if (tileentity == null) { - if (chunk_enumtileentitystate == Chunk.EnumTileEntityState.IMMEDIATE) { -@@ -679,6 +739,11 @@ - } - - public void a(BlockPosition blockposition, TileEntity tileentity) { -+ // CraftBukkit start -+ if (blockposition instanceof BlockPosition.MutableBlockPosition) { -+ blockposition = new BlockPosition(blockposition); -+ } -+ // CraftBukkit end - tileentity.setWorld(this.world); - tileentity.setPosition(blockposition); - if (this.getType(blockposition).getBlock() instanceof ITileEntity) { -@@ -688,6 +753,13 @@ + NBTTagCompound nbttagcompound = (NBTTagCompound) this.h.remove(blockposition); +@@ -701,6 +754,13 @@ tileentity.z(); - this.tileEntities.put(blockposition, tileentity); + this.tileEntities.put(blockposition.h(), tileentity); + // CraftBukkit start + } else { + System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ() @@ -153,7 +134,7 @@ } } -@@ -720,6 +792,40 @@ +@@ -733,6 +793,40 @@ })); } @@ -194,7 +175,7 @@ } public void removeEntities() { -@@ -736,9 +842,21 @@ +@@ -749,9 +843,21 @@ int i = aentityslice.length; for (int j = 0; j < i; ++j) { @@ -204,21 +185,21 @@ + java.util.Iterator iter = newList.iterator(); + while (iter.hasNext()) { + Entity entity = iter.next(); - -- this.world.b((Collection) entityslice); ++ + // Do not pass along players, as doing so can get them stuck outside of time. + // (which for example disables inventory icon updates and prevents block breaking) + if (entity instanceof EntityPlayer) { + iter.remove(); + } + } -+ + +- this.world.b((Collection) entityslice); + this.world.b((Collection) newList); + // CraftBukkit end } } -@@ -800,8 +918,8 @@ +@@ -813,8 +919,8 @@ while (iterator.hasNext()) { Entity entity = (Entity) iterator.next(); @@ -229,7 +210,7 @@ } } } -@@ -1007,13 +1125,13 @@ +@@ -1020,13 +1126,13 @@ @Nullable public LongSet b(String s) { @@ -245,7 +226,7 @@ return new LongOpenHashSet(); })).add(i); } -@@ -1061,18 +1179,18 @@ +@@ -1074,14 +1180,14 @@ } if (this.s instanceof ProtoChunkTickList) { @@ -264,59 +245,3 @@ }); } -- Iterator iterator = this.h.entrySet().iterator(); -+ Iterator iterator = Maps.newHashMap(this.h).entrySet().iterator(); // CraftBukkit - - while (iterator.hasNext()) { - Entry entry = (Entry) iterator.next(); -@@ -1080,6 +1198,8 @@ - NBTTagCompound nbttagcompound = (NBTTagCompound) entry.getValue(); - - if (this.getTileEntity(blockposition1) == null) { -+ // CraftBukkit start -+ /* - TileEntity tileentity; - - if ("DUMMY".equals(nbttagcompound.getString("id"))) { -@@ -1101,6 +1221,8 @@ - } else { - Chunk.d.warn("Tried to load a block entity for block {} but failed at location {}", this.getType(blockposition1), blockposition1); - } -+ */ -+ // CraftBukkit end - } - } - -@@ -1110,6 +1232,32 @@ - } - } - -+ // CraftBukkit start -+ private void processQueuedTile(BlockPosition blockposition1, NBTTagCompound nbttagcompound) { -+ TileEntity tileentity; -+ -+ if ("DUMMY".equals(nbttagcompound.getString("id"))) { -+ Block block = this.getType(blockposition1).getBlock(); -+ -+ if (block instanceof ITileEntity) { -+ tileentity = ((ITileEntity) block).a(this.world); -+ } else { -+ tileentity = null; -+ Chunk.d.warn("Tried to load a DUMMY block entity @ {} but found not tile entity block {} at location", blockposition1, this.getType(blockposition1)); -+ } -+ } else { -+ tileentity = TileEntity.create(nbttagcompound); -+ } -+ -+ if (tileentity != null) { -+ tileentity.setPosition(blockposition1); -+ this.a(tileentity); -+ } else { -+ Chunk.d.warn("Tried to load a block entity for block {} but failed at location {}", this.getType(blockposition1), blockposition1); -+ } -+ } -+ // CraftBukkit end -+ - public ChunkConverter F() { - return this.m; - } diff --git a/nms-patches/ChunkProviderServer.patch b/nms-patches/ChunkProviderServer.patch index 01b456d2b1..48ee4e8ddc 100644 --- a/nms-patches/ChunkProviderServer.patch +++ b/nms-patches/ChunkProviderServer.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/ChunkProviderServer.java +++ b/net/minecraft/server/ChunkProviderServer.java -@@ -18,12 +18,17 @@ +@@ -18,6 +18,11 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -12,13 +12,6 @@ public class ChunkProviderServer implements IChunkProvider { private static final Logger a = LogManager.getLogger(); - public final LongSet unloadQueue = new LongOpenHashSet(); - public final ChunkGenerator chunkGenerator; -- private final IChunkLoader chunkLoader; -+ public final IChunkLoader chunkLoader; // PAIL - public final Long2ObjectMap chunks = Long2ObjectMaps.synchronize(new ChunkMap(8192)); - private Chunk lastChunk; - private final ChunkTaskScheduler chunkScheduler; @@ -36,7 +41,7 @@ this.chunkLoader = ichunkloader; this.chunkGenerator = chunkgenerator; diff --git a/nms-patches/CommandForceload.patch b/nms-patches/CommandForceload.patch index 05924d1b41..98f7381139 100644 --- a/nms-patches/CommandForceload.patch +++ b/nms-patches/CommandForceload.patch @@ -6,7 +6,7 @@ ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(argumentvec2i_a.a >> 4, argumentvec2i_a.b >> 4); - DimensionManager dimensionmanager = commandlistenerwrapper.getWorld().o().getDimensionManager(); + DimensionManager dimensionmanager = commandlistenerwrapper.getWorld().dimension; // CraftBukkit - boolean flag = commandlistenerwrapper.getServer().getWorldServer(dimensionmanager).f(chunkcoordintpair.x, chunkcoordintpair.z); + boolean flag = commandlistenerwrapper.getServer().getWorldServer(dimensionmanager).isForceLoaded(chunkcoordintpair.x, chunkcoordintpair.z); if (flag) { @@ -59,7 +59,7 @@ @@ -28,9 +28,9 @@ LongSet longset = worldserver.ag(); - longset.forEach((i) -> { -- worldserver.b(ChunkCoordIntPair.a(i), ChunkCoordIntPair.b(i), false); +- worldserver.setForceLoaded(ChunkCoordIntPair.a(i), ChunkCoordIntPair.b(i), false); + longset.forEach((LongConsumer) (ix) -> { // CraftBukkit - decompile error -+ worldserver.b(ChunkCoordIntPair.a(ix), ChunkCoordIntPair.b(ix), false); // CraftBukkit - decompile error ++ worldserver.setForceLoaded(ChunkCoordIntPair.a(ix), ChunkCoordIntPair.b(ix), false); // CraftBukkit - decompile error }); commandlistenerwrapper.sendMessage(new ChatMessage("commands.forceload.removed.all", new Object[] { dimensionmanager}), true); return 0; diff --git a/nms-patches/DataConverterRegistry.patch b/nms-patches/DataConverterRegistry.patch index b2981bc249..98231b52f8 100644 --- a/nms-patches/DataConverterRegistry.patch +++ b/nms-patches/DataConverterRegistry.patch @@ -1,8 +1,8 @@ --- a/net/minecraft/server/DataConverterRegistry.java +++ b/net/minecraft/server/DataConverterRegistry.java -@@ -195,6 +195,18 @@ +@@ -185,6 +185,18 @@ datafixerbuilder.addFixer(new DataConverterItemFrame(schema46, false)); - Schema schema47 = datafixerbuilder.addSchema(1458, DataConverterRegistry.c); + Schema schema47 = datafixerbuilder.addSchema(1458, DataConverterRegistry.b); + // CraftBukkit start + datafixerbuilder.addFixer(new com.mojang.datafixers.DataFix(schema47, false) { diff --git a/nms-patches/Entity.patch b/nms-patches/Entity.patch index fd248cfc9e..f73dae4b91 100644 --- a/nms-patches/Entity.patch +++ b/nms-patches/Entity.patch @@ -273,9 +273,9 @@ } @@ -706,6 +884,7 @@ - this.locX = (axisalignedbb.a + axisalignedbb.d) / 2.0D; - this.locY = axisalignedbb.b; - this.locZ = (axisalignedbb.c + axisalignedbb.f) / 2.0D; + this.locX = (axisalignedbb.minX + axisalignedbb.maxX) / 2.0D; + this.locY = axisalignedbb.minY; + this.locZ = (axisalignedbb.minZ + axisalignedbb.maxZ) / 2.0D; + if (valid) world.entityJoinedWorld(this, false); // CraftBukkit } @@ -453,8 +453,8 @@ } this.vehicle = entity; -- this.vehicle.o(this); -+ if (!this.vehicle.o(this)) this.vehicle = null; // CraftBukkit +- this.vehicle.addPassenger(this); ++ if (!this.vehicle.addPassenger(this)) this.vehicle = null; // CraftBukkit return true; } } @@ -468,8 +468,8 @@ } -- protected void o(Entity entity) { -+ protected boolean o(Entity entity) { // CraftBukkit +- protected void addPassenger(Entity entity) { ++ protected boolean addPassenger(Entity entity) { // CraftBukkit if (entity.getVehicle() != this) { throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)"); } else { @@ -733,24 +733,24 @@ public void a(AxisAlignedBB axisalignedbb) { - this.boundingBox = axisalignedbb; + // CraftBukkit start - block invalid bounding boxes -+ double a = axisalignedbb.a, -+ b = axisalignedbb.b, -+ c = axisalignedbb.c, -+ d = axisalignedbb.d, -+ e = axisalignedbb.e, -+ f = axisalignedbb.f; -+ double len = axisalignedbb.d - axisalignedbb.a; -+ if (len < 0) d = a; -+ if (len > 64) d = a + 64.0; ++ double minX = axisalignedbb.minX, ++ minY = axisalignedbb.minY, ++ minZ = axisalignedbb.minZ, ++ maxX = axisalignedbb.maxX, ++ maxY = axisalignedbb.maxY, ++ maxZ = axisalignedbb.maxZ; ++ double len = axisalignedbb.maxX - axisalignedbb.minX; ++ if (len < 0) maxX = minX; ++ if (len > 64) maxX = minX + 64.0; + -+ len = axisalignedbb.e - axisalignedbb.b; -+ if (len < 0) e = b; -+ if (len > 64) e = b + 64.0; ++ len = axisalignedbb.maxY - axisalignedbb.minY; ++ if (len < 0) maxY = minY; ++ if (len > 64) maxY = minY + 64.0; + -+ len = axisalignedbb.f - axisalignedbb.c; -+ if (len < 0) f = c; -+ if (len > 64) f = c + 64.0; -+ this.boundingBox = new AxisAlignedBB(a, b, c, d, e, f); ++ len = axisalignedbb.maxZ - axisalignedbb.minZ; ++ if (len < 0) maxZ = minZ; ++ if (len > 64) maxZ = minZ + 64.0; ++ this.boundingBox = new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ); + // CraftBukkit end } diff --git a/nms-patches/EntityAnimal.patch b/nms-patches/EntityAnimal.patch index c89ce6e214..55cac48279 100644 --- a/nms-patches/EntityAnimal.patch +++ b/nms-patches/EntityAnimal.patch @@ -1,11 +1,9 @@ --- a/net/minecraft/server/EntityAnimal.java +++ b/net/minecraft/server/EntityAnimal.java -@@ -7,7 +7,8 @@ - +@@ -8,6 +8,7 @@ protected Block bF; private int bC; -- private UUID bD; -+ public UUID bD; // PAIL + public UUID breedCause; + public ItemStack breedItem; // CraftBukkit - Add breedItem variable protected EntityAnimal(EntityTypes entitytypes, World world) { @@ -30,7 +28,7 @@ return iworldreader.getType(blockposition.down()).getBlock() == this.bF ? 10.0F : iworldreader.A(blockposition) - 0.5F; @@ -134,6 +139,7 @@ if (entityhuman != null) { - this.bD = entityhuman.getUniqueID(); + this.breedCause = entityhuman.getUniqueID(); } + this.breedItem = entityhuman.inventory.getItemInHand(); // CraftBukkit diff --git a/nms-patches/EntityBoat.patch b/nms-patches/EntityBoat.patch index 949598f655..57e18afe86 100644 --- a/nms-patches/EntityBoat.patch +++ b/nms-patches/EntityBoat.patch @@ -70,7 +70,7 @@ @@ -134,9 +173,25 @@ public void collide(Entity entity) { if (entity instanceof EntityBoat) { - if (entity.getBoundingBox().b < this.getBoundingBox().e) { + if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) { + // CraftBukkit start + VehicleEntityCollisionEvent event = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); + this.world.getServer().getPluginManager().callEvent(event); @@ -81,7 +81,7 @@ + // CraftBukkit end super.collide(entity); } - } else if (entity.getBoundingBox().b <= this.getBoundingBox().b) { + } else if (entity.getBoundingBox().minY <= this.getBoundingBox().minY) { + // CraftBukkit start + VehicleEntityCollisionEvent event = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); + this.world.getServer().getPluginManager().callEvent(event); diff --git a/nms-patches/EntityEnderDragon.patch b/nms-patches/EntityEnderDragon.patch index 8c1b4cdee6..cd2593335b 100644 --- a/nms-patches/EntityEnderDragon.patch +++ b/nms-patches/EntityEnderDragon.patch @@ -47,7 +47,7 @@ } @@ -399,6 +412,10 @@ - int j1 = MathHelper.floor(axisalignedbb.f); + int j1 = MathHelper.floor(axisalignedbb.maxZ); boolean flag = false; boolean flag1 = false; + // CraftBukkit start - Create a list to hold all the destroyed blocks @@ -111,5 +111,5 @@ + // CraftBukkit end + if (flag1) { - double d0 = axisalignedbb.a + (axisalignedbb.d - axisalignedbb.a) * (double) this.random.nextFloat(); - double d1 = axisalignedbb.b + (axisalignedbb.e - axisalignedbb.b) * (double) this.random.nextFloat(); + double d0 = axisalignedbb.minX + (axisalignedbb.maxX - axisalignedbb.minX) * (double) this.random.nextFloat(); + double d1 = axisalignedbb.minY + (axisalignedbb.maxY - axisalignedbb.minY) * (double) this.random.nextFloat(); diff --git a/nms-patches/EntityFish.patch b/nms-patches/EntityFish.patch index 0fe7401b08..5aeed7d678 100644 --- a/nms-patches/EntityFish.patch +++ b/nms-patches/EntityFish.patch @@ -1,18 +1,18 @@ --- a/net/minecraft/server/EntityFish.java +++ b/net/minecraft/server/EntityFish.java -@@ -37,7 +37,7 @@ +@@ -29,7 +29,7 @@ } - protected boolean isTypeNotPersistent() { + public boolean isTypeNotPersistent() { - return !this.isFromBucket() && !this.hasCustomName(); + return true; // CraftBukkit } - public boolean l() { -@@ -71,6 +71,7 @@ + public int dg() { +@@ -47,6 +47,7 @@ public void setFromBucket(boolean flag) { - this.datawatcher.set(EntityFish.b, Boolean.valueOf(flag)); + this.datawatcher.set(EntityFish.a, Boolean.valueOf(flag)); + this.persistent = this.isPersistent(); // CraftBukkit - SPIGOT-4106 update persistence } diff --git a/nms-patches/EntityFishingHook.patch b/nms-patches/EntityFishingHook.patch index 372d49d512..7d8d7e4854 100644 --- a/nms-patches/EntityFishingHook.patch +++ b/nms-patches/EntityFishingHook.patch @@ -44,7 +44,7 @@ + // CraftBukkit end this.motY = (double) (-0.4F * MathHelper.a(this.random, 0.6F, 1.0F)); this.a(SoundEffects.ENTITY_FISHING_BOBBER_SPLASH, 0.25F, 1.0F + (this.random.nextFloat() - this.random.nextFloat()) * 0.4F); - double d3 = this.getBoundingBox().b + 0.5D; + double d3 = this.getBoundingBox().minY + 0.5D; @@ -389,6 +406,14 @@ int i = 0; diff --git a/nms-patches/EntityItemFrame.patch b/nms-patches/EntityItemFrame.patch index 2a0031ff51..f28cedd297 100644 --- a/nms-patches/EntityItemFrame.patch +++ b/nms-patches/EntityItemFrame.patch @@ -15,7 +15,7 @@ @@ -170,6 +175,12 @@ } - private void setItem(ItemStack itemstack, boolean flag) { + public void setItem(ItemStack itemstack, boolean flag) { + // CraftBukkit start + this.setItem(itemstack, flag, true); + } diff --git a/nms-patches/EntityMinecartMobSpawner.patch b/nms-patches/EntityMinecartMobSpawner.patch deleted file mode 100644 index 59a671ae25..0000000000 --- a/nms-patches/EntityMinecartMobSpawner.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- a/net/minecraft/server/EntityMinecartMobSpawner.java -+++ b/net/minecraft/server/EntityMinecartMobSpawner.java -@@ -46,4 +46,10 @@ - super.tick(); - this.a.c(); - } -+ -+ // CraftBukkit start -+ public boolean bM() { -+ return true; -+ } -+ // CraftBukkit end - } diff --git a/nms-patches/EntityOcelot.patch b/nms-patches/EntityOcelot.patch index 9f18245bc5..84ab0f737d 100644 --- a/nms-patches/EntityOcelot.patch +++ b/nms-patches/EntityOcelot.patch @@ -3,7 +3,7 @@ @@ -60,7 +60,7 @@ } - protected boolean isTypeNotPersistent() { + public boolean isTypeNotPersistent() { - return !this.isTamed() && this.ticksLived > 2400; + return !this.isTamed() /*&& this.ticksLived > 2400*/; // CraftBukkit } diff --git a/nms-patches/EntityPigZombie.patch b/nms-patches/EntityPigZombie.patch index 0ebbc60173..5420df19ce 100644 --- a/nms-patches/EntityPigZombie.patch +++ b/nms-patches/EntityPigZombie.patch @@ -30,4 +30,4 @@ + // CraftBukkit end this.soundDelay = this.random.nextInt(40); if (entity instanceof EntityLiving) { - this.a((EntityLiving) entity); + this.setLastDamager((EntityLiving) entity); diff --git a/nms-patches/EntityPlayer.patch b/nms-patches/EntityPlayer.patch index 7bc816c188..4f076c2a03 100644 --- a/nms-patches/EntityPlayer.patch +++ b/nms-patches/EntityPlayer.patch @@ -522,7 +522,7 @@ + this.world.getServer().getScoreboardManager().getScoreboardScores(statistic, this.getName(), ScoreboardScore::c); // CraftBukkit - Get our scores instead } - public int a(Collection collection) { + public int discoverRecipes(Collection collection) { @@ -830,8 +1059,17 @@ public void triggerHealthUpdate() { diff --git a/nms-patches/EntityTurtle.patch b/nms-patches/EntityTurtle.patch index 30b08c19c1..33cf763f27 100644 --- a/nms-patches/EntityTurtle.patch +++ b/nms-patches/EntityTurtle.patch @@ -20,7 +20,7 @@ } public void die(DamageSource damagesource) { -@@ -441,8 +445,12 @@ +@@ -435,8 +439,12 @@ } else if (this.f.bK > 200) { World world = this.f.world; diff --git a/nms-patches/EntityVillager.patch b/nms-patches/EntityVillager.patch index 140034fc1d..6cfcdfc52c 100644 --- a/nms-patches/EntityVillager.patch +++ b/nms-patches/EntityVillager.patch @@ -15,15 +15,6 @@ public class EntityVillager extends EntityAgeable implements NPC, IMerchant { -@@ -26,7 +34,7 @@ - public int riches; - private String bO; - public int careerId; -- private int bQ; -+ public int bQ; // PAIL private->public - private boolean bR; - private boolean bS; - public final InventorySubcontainer inventory; @@ -38,7 +46,7 @@ public EntityVillager(World world, int i) { diff --git a/nms-patches/HandshakeListener.patch b/nms-patches/HandshakeListener.patch index 83b69356d5..f4e8251d84 100644 --- a/nms-patches/HandshakeListener.patch +++ b/nms-patches/HandshakeListener.patch @@ -57,8 +57,8 @@ + } + // CraftBukkit end + - if (packethandshakinginsetprotocol.c() > 401) { - chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.13.1"}); + if (packethandshakinginsetprotocol.c() > 404) { + chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.13.2"}); this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage)); @@ -26,6 +71,7 @@ this.b.close(chatmessage); diff --git a/nms-patches/ItemArmorStand.patch b/nms-patches/ItemArmorStand.patch new file mode 100644 index 0000000000..08587855cb --- /dev/null +++ b/nms-patches/ItemArmorStand.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/server/ItemArmorStand.java ++++ b/net/minecraft/server/ItemArmorStand.java +@@ -40,6 +40,11 @@ + entityarmorstand.setPositionRotation(d0 + 0.5D, d1, d2 + 0.5D, f, 0.0F); + this.a(entityarmorstand, world.random); + EntityTypes.a(world, itemactioncontext.getEntity(), entityarmorstand, itemstack.getTag()); ++ // CraftBukkit start ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(itemactioncontext, entityarmorstand).isCancelled()) { ++ return EnumInteractionResult.FAIL; ++ } ++ // CraftBukkit end + world.addEntity(entityarmorstand); + world.a((EntityHuman) null, entityarmorstand.locX, entityarmorstand.locY, entityarmorstand.locZ, SoundEffects.ENTITY_ARMOR_STAND_PLACE, SoundCategory.BLOCKS, 0.75F, 0.8F); + } diff --git a/nms-patches/ItemEndCrystal.patch b/nms-patches/ItemEndCrystal.patch new file mode 100644 index 0000000000..6173162a83 --- /dev/null +++ b/nms-patches/ItemEndCrystal.patch @@ -0,0 +1,14 @@ +--- a/net/minecraft/server/ItemEndCrystal.java ++++ b/net/minecraft/server/ItemEndCrystal.java +@@ -33,6 +33,11 @@ + EntityEnderCrystal entityendercrystal = new EntityEnderCrystal(world, d0 + 0.5D, d1, d2 + 0.5D); + + entityendercrystal.setShowingBottom(false); ++ // CraftBukkit start ++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityPlaceEvent(itemactioncontext, entityendercrystal).isCancelled()) { ++ return EnumInteractionResult.FAIL; ++ } ++ // CraftBukkit end + world.addEntity(entityendercrystal); + if (world.worldProvider instanceof WorldProviderTheEnd) { + EnderDragonBattle enderdragonbattle = ((WorldProviderTheEnd) world.worldProvider).r(); diff --git a/nms-patches/ItemWorldMap.patch b/nms-patches/ItemWorldMap.patch index f7257b1d14..efd895649a 100644 --- a/nms-patches/ItemWorldMap.patch +++ b/nms-patches/ItemWorldMap.patch @@ -13,7 +13,7 @@ public ItemWorldMap(Item.Info item_info) { @@ -15,7 +20,7 @@ - public static ItemStack a(World world, int i, int j, byte b0, boolean flag, boolean flag1) { + public static ItemStack createFilledMapView(World world, int i, int j, byte b0, boolean flag, boolean flag1) { ItemStack itemstack = new ItemStack(Items.FILLED_MAP); - a(itemstack, world, i, j, b0, flag, flag1, world.worldProvider.getDimensionManager()); diff --git a/nms-patches/MinecraftServer.patch b/nms-patches/MinecraftServer.patch index 9c4cc3821e..ea6c46a14d 100644 --- a/nms-patches/MinecraftServer.patch +++ b/nms-patches/MinecraftServer.patch @@ -500,7 +500,7 @@ - if (worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { + if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit this.methodProfiler.a(() -> { - return worldserver.getWorldData().getName(); + return "dim-" + worldserver.worldProvider.getDimensionManager().getDimensionID(); }); + /* Drop global time updates if (this.ticks % 20 == 0) { diff --git a/nms-patches/PacketDataSerializer.patch b/nms-patches/PacketDataSerializer.patch index acfca3b059..7d514052b2 100644 --- a/nms-patches/PacketDataSerializer.patch +++ b/nms-patches/PacketDataSerializer.patch @@ -33,11 +33,11 @@ public PacketDataSerializer a(ItemStack itemstack) { - if (itemstack.isEmpty()) { + if (itemstack.isEmpty() || itemstack.getItem() == null) { // CraftBukkit - NPE fix itemstack.getItem() - this.writeShort(-1); + this.writeBoolean(false); } else { - Item item = itemstack.getItem(); + this.writeBoolean(true); @@ -263,6 +265,11 @@ - ItemStack itemstack = new ItemStack(Item.getById(short0), b0); + ItemStack itemstack = new ItemStack(Item.getById(i), b0); itemstack.setTag(this.j()); + // CraftBukkit start diff --git a/nms-patches/PathfinderGoalPanic.patch b/nms-patches/PathfinderGoalPanic.patch index 24babf0f04..9b0e4a6b4b 100644 --- a/nms-patches/PathfinderGoalPanic.patch +++ b/nms-patches/PathfinderGoalPanic.patch @@ -6,7 +6,7 @@ public boolean b() { + // CraftBukkit start - introduce a temporary timeout hack until this is fixed properly + if ((this.a.ticksLived - this.a.hurtTimestamp) > 100) { -+ this.a.a((EntityLiving) null); // PAIL setLastDamager ++ this.a.setLastDamager((EntityLiving) null); + return false; + } + // CraftBukkit end diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch index c878bb2cc7..878808f684 100644 --- a/nms-patches/PlayerConnection.patch +++ b/nms-patches/PlayerConnection.patch @@ -282,7 +282,7 @@ + } + // CraftBukkit end + - this.minecraftServer.getPlayerList().d(this.player); + this.minecraftServer.getPlayerList().updateChunks(this.player); this.player.checkMovement(this.player.locX - d0, this.player.locY - d1, this.player.locZ - d2); this.D = d11 >= -0.03125D && !this.minecraftServer.getAllowFlight() && !worldserver.a(entity.getBoundingBox().g(0.0625D).b(0.0D, -0.55D, 0.0D)); @@ -243,7 +437,7 @@ @@ -298,7 +298,7 @@ } this.teleportPos = null; -+ this.minecraftServer.getPlayerList().d(this.player); // CraftBukkit ++ this.minecraftServer.getPlayerList().updateChunks(this.player); // CraftBukkit } } @@ -376,7 +376,7 @@ this.A = this.e; if (this.player.isPassenger()) { this.player.setLocation(this.player.locX, this.player.locY, this.player.locZ, packetplayinflying.a(this.player.yaw), packetplayinflying.b(this.player.pitch)); - this.minecraftServer.getPlayerList().d(this.player); + this.minecraftServer.getPlayerList().updateChunks(this.player); + this.allowedPlayerTicks = 20; // CraftBukkit } else { + // CraftBukkit - Make sure the move is valid but then reset it for plugins to modify diff --git a/nms-patches/PlayerList.patch b/nms-patches/PlayerList.patch index 8e6151cde3..79a7b7a704 100644 --- a/nms-patches/PlayerList.patch +++ b/nms-patches/PlayerList.patch @@ -245,7 +245,7 @@ + // CraftBukkit end } - public void d(EntityPlayer entityplayer) { + public void updateChunks(EntityPlayer entityplayer) { entityplayer.getWorldServer().getPlayerChunkMap().movePlayer(entityplayer); } diff --git a/nms-patches/ProtoChunk.patch b/nms-patches/ProtoChunk.patch index 66a860e425..8dadf99cf4 100644 --- a/nms-patches/ProtoChunk.patch +++ b/nms-patches/ProtoChunk.patch @@ -68,7 +68,7 @@ return new LongOpenHashSet(); })).add(i); this.c = true; -@@ -493,7 +494,7 @@ +@@ -496,7 +497,7 @@ } public BitSet a(WorldGenStage.Features worldgenstage_features) { diff --git a/nms-patches/SpawnerCreature.patch b/nms-patches/SpawnerCreature.patch index dca91ed001..2482e10f1e 100644 --- a/nms-patches/SpawnerCreature.patch +++ b/nms-patches/SpawnerCreature.patch @@ -72,7 +72,7 @@ if (l1 <= k) { @@ -76,8 +107,10 @@ - label128: + label137: while (iterator1.hasNext()) { - ChunkCoordIntPair chunkcoordintpair1 = (ChunkCoordIntPair) iterator1.next(); - BlockPosition blockposition1 = getRandomPosition(worldserver, chunkcoordintpair1.x, chunkcoordintpair1.z); @@ -83,23 +83,23 @@ int i2 = blockposition1.getX(); int j2 = blockposition1.getY(); int k2 = blockposition1.getZ(); -@@ -136,9 +169,12 @@ - if (entityinsentient.a((GeneratorAccess) worldserver, false) && entityinsentient.a((IWorldReader) worldserver)) { - groupdataentity = entityinsentient.prepare(worldserver.getDamageScaler(new BlockPosition(entityinsentient)), groupdataentity, (NBTTagCompound) null); - if (entityinsentient.a((IWorldReader) worldserver)) { -- ++l2; -- ++j4; -- worldserver.addEntity(entityinsentient); -+ // CraftBukkit start -+ if (worldserver.addEntity(entityinsentient, SpawnReason.NATURAL)) { -+ ++l2; -+ ++j4; -+ } -+ // CraftBukkit end - } else { - entityinsentient.die(); - } -@@ -255,7 +291,7 @@ +@@ -140,9 +173,12 @@ + if ((d0 <= 16384.0D || !entityinsentient.isTypeNotPersistent()) && entityinsentient.a((GeneratorAccess) worldserver, false) && entityinsentient.a((IWorldReader) worldserver)) { + groupdataentity = entityinsentient.prepare(worldserver.getDamageScaler(new BlockPosition(entityinsentient)), groupdataentity, (NBTTagCompound) null); + if (entityinsentient.a((IWorldReader) worldserver)) { +- ++l2; +- ++j4; +- worldserver.addEntity(entityinsentient); ++ // CraftBukkit start ++ if (worldserver.addEntity(entityinsentient, SpawnReason.NATURAL)) { ++ ++l2; ++ ++j4; ++ } ++ // CraftBukkit end + } else { + entityinsentient.die(); + } +@@ -260,7 +296,7 @@ entityinsentient.setPositionRotation(d0, (double) blockposition.getY(), d1, random.nextFloat() * 360.0F, 0.0F); if (entityinsentient.a(generatoraccess, false) && entityinsentient.a((IWorldReader) generatoraccess)) { groupdataentity = entityinsentient.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityinsentient)), groupdataentity, (NBTTagCompound) null); diff --git a/nms-patches/TileEntityConduit.patch b/nms-patches/TileEntityConduit.patch index c830c74c85..c73526c8cf 100644 --- a/nms-patches/TileEntityConduit.patch +++ b/nms-patches/TileEntityConduit.patch @@ -21,9 +21,9 @@ } @@ -169,8 +173,8 @@ - this.j = this.l(); + this.target = this.l(); this.k = null; - } else if (this.j == null) { + } else if (this.target == null) { - List list = this.world.a(EntityLiving.class, this.k(), (entityliving) -> { - return entityliving instanceof IMonster && entityliving.ao(); + List list = this.world.a(EntityLiving.class, this.k(), (Predicate) (entitylivingx) -> { // CraftBukkit - decompile error @@ -34,19 +34,19 @@ @@ -181,8 +185,13 @@ } - if (this.j != null) { -- this.world.a((EntityHuman) null, this.j.locX, this.j.locY, this.j.locZ, SoundEffects.BLOCK_CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F); -- this.j.damageEntity(DamageSource.MAGIC, 4.0F); + if (this.target != null) { +- this.world.a((EntityHuman) null, this.target.locX, this.target.locY, this.target.locZ, SoundEffects.BLOCK_CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F); +- this.target.damageEntity(DamageSource.MAGIC, 4.0F); + // CraftBukkit start + CraftEventFactory.blockDamage = CraftBlock.at(this.world, this.position); -+ if (this.j.damageEntity(DamageSource.MAGIC, 4.0F)) { -+ this.world.a((EntityHuman) null, this.j.locX, this.j.locY, this.j.locZ, SoundEffects.BLOCK_CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F); ++ if (this.target.damageEntity(DamageSource.MAGIC, 4.0F)) { ++ this.world.a((EntityHuman) null, this.target.locX, this.target.locY, this.target.locZ, SoundEffects.BLOCK_CONDUIT_ATTACK_TARGET, SoundCategory.BLOCKS, 1.0F, 1.0F); + } + CraftEventFactory.blockDamage = null; + // CraftBukkit end } - if (entityliving != this.j) { + if (entityliving != this.target) { @@ -215,7 +224,7 @@ @Nullable diff --git a/nms-patches/TileEntityFurnace.patch b/nms-patches/TileEntityFurnace.patch index bb7892c82f..f23a402746 100644 --- a/nms-patches/TileEntityFurnace.patch +++ b/nms-patches/TileEntityFurnace.patch @@ -1,6 +1,6 @@ --- a/net/minecraft/server/TileEntityFurnace.java +++ b/net/minecraft/server/TileEntityFurnace.java -@@ -9,6 +9,15 @@ +@@ -8,6 +8,15 @@ import java.util.Map; import java.util.Map.Entry; import javax.annotation.Nullable; @@ -16,7 +16,7 @@ public class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput, ITickable { -@@ -93,6 +102,31 @@ +@@ -92,6 +101,31 @@ return linkedhashmap; } @@ -48,7 +48,7 @@ public TileEntityFurnace() { super(TileEntityTypes.FURNACE); this.items = NonNullList.a(3, ItemStack.a); -@@ -220,7 +254,7 @@ +@@ -219,7 +253,7 @@ } public void Y_() { @@ -57,7 +57,7 @@ boolean flag1 = false; if (this.isBurning()) { -@@ -238,9 +272,20 @@ +@@ -237,9 +271,20 @@ IRecipe irecipe = this.world.E().b(this, this.world); if (!this.isBurning() && this.canBurn(irecipe)) { @@ -80,7 +80,7 @@ flag1 = true; if (!itemstack.isEmpty()) { Item item = itemstack.getItem(); -@@ -271,6 +316,7 @@ +@@ -270,6 +315,7 @@ if (flag != this.isBurning()) { flag1 = true; this.world.setTypeAndData(this.position, (IBlockData) this.world.getType(this.position).set(BlockFurnace.LIT, Boolean.valueOf(this.isBurning())), 3); @@ -88,7 +88,7 @@ } } -@@ -281,7 +327,7 @@ +@@ -280,7 +326,7 @@ } private int s() { @@ -97,7 +97,7 @@ return furnacerecipe != null ? furnacerecipe.h() : 200; } -@@ -308,11 +354,38 @@ +@@ -307,11 +353,38 @@ ItemStack itemstack1 = irecipe.d(); ItemStack itemstack2 = (ItemStack) this.items.get(2); diff --git a/nms-patches/World.patch b/nms-patches/World.patch index 10d0c32187..d017d986d5 100644 --- a/nms-patches/World.patch +++ b/nms-patches/World.patch @@ -146,7 +146,7 @@ } else { Chunk chunk = this.getChunkAtWorldCoords(blockposition); Block block = iblockdata.getBlock(); -- IBlockData iblockdata1 = chunk.a(blockposition, iblockdata, (i & 64) != 0); +- IBlockData iblockdata1 = chunk.setType(blockposition, iblockdata, (i & 64) != 0); + + // CraftBukkit start - capture blockstates + CraftBlockState blockstate = null; @@ -156,7 +156,7 @@ + } + // CraftBukkit end + -+ IBlockData iblockdata1 = chunk.a(blockposition, iblockdata, (i & 64) != 0, (i & 1024) == 0); // CraftBukkit custom NO_PLACE flag ++ IBlockData iblockdata1 = chunk.setType(blockposition, iblockdata, (i & 64) != 0, (i & 1024) == 0); // CraftBukkit custom NO_PLACE flag if (iblockdata1 == null) { + // CraftBukkit start - remove blockstate if failed @@ -335,7 +335,7 @@ + if (vehicle != null) { + vehicle.dead = true; + } -+ for (Entity passenger : entity.bQ()) { ++ for (Entity passenger : entity.getAllPassengers()) { + passenger.dead = true; + } + entity.dead = true; @@ -595,7 +595,7 @@ if (predicate.test(entityhuman1)) { double d5 = entityhuman1.d(d0, d1, d2); -@@ -2164,6 +2475,16 @@ +@@ -2185,6 +2496,16 @@ public void everyoneSleeping() {} @@ -612,7 +612,7 @@ public float g(float f) { return (this.q + (this.r - this.q) * f) * this.i(f); } -@@ -2325,7 +2646,7 @@ +@@ -2346,7 +2667,7 @@ int l = j * 16 + 8 - blockposition.getZ(); boolean flag = true; diff --git a/nms-patches/WorldData.patch b/nms-patches/WorldData.patch index 256a27e067..fbd4882b3a 100644 --- a/nms-patches/WorldData.patch +++ b/nms-patches/WorldData.patch @@ -23,8 +23,8 @@ @@ -304,6 +310,7 @@ nbttagcompound2.setBoolean("Snapshot", false); nbttagcompound.set("Version", nbttagcompound2); - nbttagcompound.setInt("DataVersion", 1628); -+ if (org.bukkit.craftbukkit.util.CraftMagicNumbers.DATA_VERSION != 1628) throw new AssertionError(); // CraftBukkit - sentinel + nbttagcompound.setInt("DataVersion", 1631); ++ if (org.bukkit.craftbukkit.util.CraftMagicNumbers.DATA_VERSION != 1631) throw new AssertionError(); // CraftBukkit - sentinel nbttagcompound.setLong("RandomSeed", this.e); nbttagcompound.setString("generatorName", this.f.b()); nbttagcompound.setInt("generatorVersion", this.f.getVersion()); diff --git a/nms-patches/WorldGenFactory.patch b/nms-patches/WorldGenFactory.patch deleted file mode 100644 index ff6105677d..0000000000 --- a/nms-patches/WorldGenFactory.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/net/minecraft/server/WorldGenFactory.java -+++ b/net/minecraft/server/WorldGenFactory.java -@@ -9,7 +9,7 @@ - public class WorldGenFactory { - - private static final Logger a = LogManager.getLogger(); -- private static final Map> b = Maps.newHashMap(); -+ public static final Map> b = Maps.newHashMap(); // CraftBukkit private -> public - private static final Map, String> c = Maps.newHashMap(); - private static final Map> d = Maps.newHashMap(); - private static final Map, String> e = Maps.newHashMap(); diff --git a/pom.xml b/pom.xml index 942c6505aa..33d3f98c7c 100644 --- a/pom.xml +++ b/pom.xml @@ -4,14 +4,14 @@ org.bukkit craftbukkit jar - 1.13.1-R0.1-SNAPSHOT + 1.13.2-R0.1-SNAPSHOT CraftBukkit http://www.bukkit.org UTF-8 unknown - 1.13.1 + 1.13.2 1_13_R2 git-Bukkit- @@ -48,13 +48,13 @@ org.xerial sqlite-jdbc - 3.23.1 + 3.25.2 runtime mysql mysql-connector-java - 5.1.46 + 5.1.47 runtime diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index a0eefe04b6..a1eacecfa5 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -1273,10 +1273,10 @@ public final class CraftServer implements Server { BlockPosition structurePosition = new BlockPosition(structureLocation.getBlockX(), structureLocation.getBlockY(), structureLocation.getBlockZ()); // Create map with trackPlayer = true, unlimitedTracking = true - net.minecraft.server.ItemStack stack = ItemWorldMap.a(worldServer, structurePosition.getX(), structurePosition.getZ(), MapView.Scale.NORMAL.getValue(), true, true); //PAIL rename setFilledMapView - ItemWorldMap.a(worldServer, stack); // PAIL rename sepiaMapFilter + net.minecraft.server.ItemStack stack = ItemWorldMap.createFilledMapView(worldServer, structurePosition.getX(), structurePosition.getZ(), MapView.Scale.NORMAL.getValue(), true, true); + ItemWorldMap.applySepiaFilter(worldServer, stack); // "+" map ID taken from EntityVillager - ItemWorldMap.getSavedMap(stack, worldServer).a(stack, structurePosition, "+", MapIcon.Type.a(structureType.getMapIcon().getValue())); // PAIL rename decorateMap + ItemWorldMap.getSavedMap(stack, worldServer).decorateMap(stack, structurePosition, "+", MapIcon.Type.a(structureType.getMapIcon().getValue())); return CraftItemStack.asBukkitCopy(stack); } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index ddaeefb71c..cc10e2778f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -256,7 +256,7 @@ public class CraftWorld implements World { } public boolean isChunkInUse(int x, int z) { - return world.getPlayerChunkMap().isChunkInUse(x, z) || world.f(x, z); + return world.getPlayerChunkMap().isChunkInUse(x, z) || world.isForceLoaded(x, z); } public boolean loadChunk(int x, int z, boolean generate) { diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java index e5f39b664f..926efb0aec 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -177,11 +177,11 @@ 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(); - deadline.add(Calendar.DAY_OF_YEAR, -10); + deadline.add(Calendar.DAY_OF_YEAR, -7); if (buildDate.before(deadline.getTime())) { System.err.println("*** Error, this build is outdated ***"); System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/ ***"); diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index f3e060523f..1b2a8b6356 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -600,6 +600,6 @@ public class CraftBlock implements Block { @Override public boolean isPassable() { - return this.getData0().h(world, position).b(); // PAIL getCollisionShape, isEmpty + return this.getData0().getCollisionShape(world, position).isEmpty(); } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java index f671ad1238..2478b934b7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftAnimals.java @@ -23,11 +23,11 @@ public class CraftAnimals extends CraftAgeable implements Animals { @Override public UUID getBreedCause() { - return getHandle().bD; + return getHandle().breedCause; } @Override public void setBreedCause(UUID uuid) { - getHandle().bD = uuid; + getHandle().breedCause = uuid; } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 497783d4f3..be00d79e85 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -467,7 +467,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @Override public int discoverRecipes(Collection recipes) { - return getHandle().a(bukkitKeysToMinecraftRecipes(recipes)); // PAIL rename discoverRecipes + return getHandle().discoverRecipes(bukkitKeysToMinecraftRecipes(recipes)); } @Override @@ -477,7 +477,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @Override public int undiscoverRecipes(Collection recipes) { - return getHandle().b(bukkitKeysToMinecraftRecipes(recipes)); // PAIL rename undiscoverRecipes + return getHandle().undiscoverRecipes(bukkitKeysToMinecraftRecipes(recipes)); } private Collection bukkitKeysToMinecraftRecipes(Collection recipeKeys) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java index e92225808c..e21fe51a06 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java @@ -70,7 +70,7 @@ public class CraftVillager extends CraftAgeable implements Villager, InventoryHo if (resetTrades) { getHandle().trades = null; - getHandle().bQ = 0; // SPIGOT-4310 + getHandle().careerLevel = 0; // SPIGOT-4310 getHandle().populateTrades(); } } diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 67d2eb1b63..79d6578eac 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -157,6 +157,17 @@ public class CraftEventFactory { return event; } + public static EntityPlaceEvent callEntityPlaceEvent(ItemActionContext itemactioncontext, Entity entity) { + Player who = (itemactioncontext.getEntity() == null) ? null : (Player) itemactioncontext.getEntity().getBukkitEntity(); + org.bukkit.block.Block blockClicked = CraftBlock.at(itemactioncontext.getWorld(), itemactioncontext.getClickPosition()); + org.bukkit.block.BlockFace blockFace = org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(itemactioncontext.getClickedFace()); + + EntityPlaceEvent event = new EntityPlaceEvent(entity.getBukkitEntity(), who, blockClicked, blockFace); + entity.world.getServer().getPluginManager().callEvent(event); + + return event; + } + /** * Bucket methods */ diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java index a583547912..60cdd1dc89 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -634,7 +634,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable { if (entry.getValue().getSlot() != null) { EnumItemSlot slot = CraftEquipmentSlot.getNMS(entry.getValue().getSlot()); if (slot != null) { - sub.setString(ATTRIBUTES_SLOT.NBT, slot.d()); // PAIL rename getSlotName, getName + sub.setString(ATTRIBUTES_SLOT.NBT, slot.getSlotName()); } } list.add(sub); diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java index 848b9c92ea..89ef12fe64 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -144,7 +144,7 @@ public final class CraftMagicNumbers implements UnsafeValues { return CraftBlockData.fromData(getBlock(material, data)); } - public static final int DATA_VERSION = 1628; + public static final int DATA_VERSION = 1631; @Override public int getDataVersion() { diff --git a/src/test/java/org/bukkit/StructureTypeTest.java b/src/test/java/org/bukkit/StructureTypeTest.java index 57f68761a8..ad1c7a4d7d 100644 --- a/src/test/java/org/bukkit/StructureTypeTest.java +++ b/src/test/java/org/bukkit/StructureTypeTest.java @@ -22,7 +22,7 @@ public class StructureTypeTest extends AbstractTestingBase { @Test public void testMinecraftToBukkit() { - for (String key : WorldGenFactory.b.keySet()) { // PAIL rename structureStartMap + for (String key : WorldGenFactory.structureStartMap.keySet()) { Assert.assertNotNull(structures.get(key)); } } @@ -38,8 +38,8 @@ public class StructureTypeTest extends AbstractTestingBase { @Test public void testBukkitToMinecraft() { for (Map.Entry entry : structures.entrySet()) { - Assert.assertNotNull(WorldGenFactory.b.get(entry.getKey())); - Assert.assertNotNull(WorldGenFactory.b.get(entry.getValue().getName())); + Assert.assertNotNull(WorldGenFactory.structureStartMap.get(entry.getKey())); + Assert.assertNotNull(WorldGenFactory.structureStartMap.get(entry.getValue().getName())); } } }