Update to Minecraft 1.13.2

This commit is contained in:
md_5 2018-10-23 06:00:00 +11:00
parent a639ae44d2
commit b4230a9a7e
47 changed files with 184 additions and 262 deletions

View File

@ -29,7 +29,7 @@
dynamic = dynamic.set("DataVersion", dynamic.createInt(1343)); dynamic = dynamic.set("DataVersion", dynamic.createInt(1343));
@@ -148,7 +148,7 @@ @@ -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"); 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());
+ Map<MinecraftKey, AdvancementProgress> map = (Map) AdvancementDataPlayer.b.getAdapter(AdvancementDataPlayer.c).fromJsonTree((JsonElement) dynamic.getValue()); // CraftBukkit - decompile error + Map<MinecraftKey, AdvancementProgress> map = (Map) AdvancementDataPlayer.b.getAdapter(AdvancementDataPlayer.c).fromJsonTree((JsonElement) dynamic.getValue()); // CraftBukkit - decompile error

View File

@ -11,7 +11,7 @@
@@ -32,8 +34,13 @@ @@ -32,8 +34,13 @@
float f = (float) blockposition.getY() + (6.0F + (float) (3 * i)) / 16.0F; 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 + // CraftBukkit start
+ if (!this.changeLevel(world, blockposition, iblockdata, i - 1, entity, CauldronLevelChangeEvent.ChangeReason.EXTINGUISH)) { + if (!this.changeLevel(world, blockposition, iblockdata, i - 1, entity, CauldronLevelChangeEvent.ChangeReason.EXTINGUISH)) {
+ return; + return;

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/Chunk.java --- a/net/minecraft/server/Chunk.java
+++ b/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.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -10,8 +10,8 @@
private static final Logger d = LogManager.getLogger(); private static final Logger d = LogManager.getLogger();
@@ -57,6 +59,35 @@ @@ -57,6 +59,35 @@
private int D;
private final AtomicInteger E; private final AtomicInteger E;
private final ChunkCoordIntPair F;
+ // CraftBukkit start - Neighbor loaded cache for chunk lighting and entity ticking + // CraftBukkit start - Neighbor loaded cache for chunk lighting and entity ticking
+ private int neighbors = 0x1 << 12; + private int neighbors = 0x1 << 12;
@ -45,7 +45,7 @@
public Chunk(World world, int i, int j, BiomeBase[] abiomebase, ChunkConverter chunkconverter, TickList<Block> ticklist, TickList<FluidType> ticklist1, long k) { public Chunk(World world, int i, int j, BiomeBase[] abiomebase, ChunkConverter chunkconverter, TickList<Block> ticklist, TickList<FluidType> ticklist1, long k) {
this.sections = new ChunkSection[16]; this.sections = new ChunkSection[16];
this.g = new boolean[256]; this.g = new boolean[256];
@@ -94,8 +125,16 @@ @@ -95,8 +126,16 @@
this.s = ticklist; this.s = ticklist;
this.t = ticklist1; this.t = ticklist1;
this.z = k; this.z = k;
@ -62,7 +62,7 @@
public Chunk(World world, ProtoChunk protochunk, int i, int j) { public Chunk(World world, ProtoChunk protochunk, int i, int j) {
this(world, i, j, protochunk.getBiomeIndex(), protochunk.v(), protochunk.n(), protochunk.o(), protochunk.m()); 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(); HeightMap.Type heightmap_type = (HeightMap.Type) iterator.next();
if (heightmap_type.c() == HeightMap.Use.LIVE_WORLD) { if (heightmap_type.c() == HeightMap.Use.LIVE_WORLD) {
@ -80,23 +80,23 @@
} }
public Set<BlockPosition> t() { public Set<BlockPosition> t() {
@@ -412,8 +452,15 @@ @@ -413,8 +453,15 @@
} }
} }
+ // CraftBukkit start + // CraftBukkit start
@Nullable @Nullable
public IBlockData a(BlockPosition blockposition, IBlockData iblockdata, boolean flag) { public IBlockData setType(BlockPosition blockposition, IBlockData iblockdata, boolean flag) {
+ return this.a(blockposition, iblockdata, flag, true); + return this.setType(blockposition, iblockdata, flag, true);
+ } + }
+ +
+ @Nullable + @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 + // CraftBukkit end
int i = blockposition.getX() & 15; int i = blockposition.getX() & 15;
int j = blockposition.getY(); int j = blockposition.getY();
int k = blockposition.getZ() & 15; int k = blockposition.getZ() & 15;
@@ -473,7 +520,8 @@ @@ -474,7 +521,8 @@
} }
} }
@ -106,7 +106,7 @@
iblockdata.onPlace(this.world, blockposition, iblockdata1); iblockdata.onPlace(this.world, blockposition, iblockdata1);
} }
@@ -653,7 +701,19 @@ @@ -654,7 +702,12 @@
@Nullable @Nullable
public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) { public TileEntity a(BlockPosition blockposition, Chunk.EnumTileEntityState chunk_enumtileentitystate) {
@ -116,33 +116,14 @@
+ if (tileentity == null) { + if (tileentity == null) {
+ tileentity = (TileEntity) this.tileEntities.get(blockposition); + 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 + // CraftBukkit end
if (tileentity == null) { if (tileentity == null) {
if (chunk_enumtileentitystate == Chunk.EnumTileEntityState.IMMEDIATE) { NBTTagCompound nbttagcompound = (NBTTagCompound) this.h.remove(blockposition);
@@ -679,6 +739,11 @@ @@ -701,6 +754,13 @@
}
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 @@
tileentity.z(); tileentity.z();
this.tileEntities.put(blockposition, tileentity); this.tileEntities.put(blockposition.h(), tileentity);
+ // CraftBukkit start + // CraftBukkit start
+ } else { + } else {
+ System.out.println("Attempted to place a tile entity (" + tileentity + ") at " + tileentity.position.getX() + "," + tileentity.position.getY() + "," + tileentity.position.getZ() + 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() { public void removeEntities() {
@@ -736,9 +842,21 @@ @@ -749,9 +843,21 @@
int i = aentityslice.length; int i = aentityslice.length;
for (int j = 0; j < i; ++j) { for (int j = 0; j < i; ++j) {
@ -204,21 +185,21 @@
+ java.util.Iterator<Entity> iter = newList.iterator(); + java.util.Iterator<Entity> iter = newList.iterator();
+ while (iter.hasNext()) { + while (iter.hasNext()) {
+ Entity entity = iter.next(); + Entity entity = iter.next();
+
- this.world.b((Collection) entityslice);
+ // Do not pass along players, as doing so can get them stuck outside of time. + // 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) + // (which for example disables inventory icon updates and prevents block breaking)
+ if (entity instanceof EntityPlayer) { + if (entity instanceof EntityPlayer) {
+ iter.remove(); + iter.remove();
+ } + }
+ } + }
+
- this.world.b((Collection) entityslice);
+ this.world.b((Collection) newList); + this.world.b((Collection) newList);
+ // CraftBukkit end + // CraftBukkit end
} }
} }
@@ -800,8 +918,8 @@ @@ -813,8 +919,8 @@
while (iterator.hasNext()) { while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next(); Entity entity = (Entity) iterator.next();
@ -229,7 +210,7 @@
} }
} }
} }
@@ -1007,13 +1125,13 @@ @@ -1020,13 +1126,13 @@
@Nullable @Nullable
public LongSet b(String s) { public LongSet b(String s) {
@ -245,7 +226,7 @@
return new LongOpenHashSet(); return new LongOpenHashSet();
})).add(i); })).add(i);
} }
@@ -1061,18 +1179,18 @@ @@ -1074,14 +1180,14 @@
} }
if (this.s instanceof ProtoChunkTickList) { 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;
}

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/ChunkProviderServer.java --- a/net/minecraft/server/ChunkProviderServer.java
+++ b/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.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
@ -12,13 +12,6 @@
public class ChunkProviderServer implements IChunkProvider { public class ChunkProviderServer implements IChunkProvider {
private static final Logger a = LogManager.getLogger(); 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<Chunk> chunks = Long2ObjectMaps.synchronize(new ChunkMap(8192));
private Chunk lastChunk;
private final ChunkTaskScheduler chunkScheduler;
@@ -36,7 +41,7 @@ @@ -36,7 +41,7 @@
this.chunkLoader = ichunkloader; this.chunkLoader = ichunkloader;
this.chunkGenerator = chunkgenerator; this.chunkGenerator = chunkgenerator;

View File

@ -6,7 +6,7 @@
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(argumentvec2i_a.a >> 4, argumentvec2i_a.b >> 4); ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(argumentvec2i_a.a >> 4, argumentvec2i_a.b >> 4);
- DimensionManager dimensionmanager = commandlistenerwrapper.getWorld().o().getDimensionManager(); - DimensionManager dimensionmanager = commandlistenerwrapper.getWorld().o().getDimensionManager();
+ DimensionManager dimensionmanager = commandlistenerwrapper.getWorld().dimension; // CraftBukkit + 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) { if (flag) {
@@ -59,7 +59,7 @@ @@ -59,7 +59,7 @@
@ -28,9 +28,9 @@
LongSet longset = worldserver.ag(); LongSet longset = worldserver.ag();
- longset.forEach((i) -> { - 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 + 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); commandlistenerwrapper.sendMessage(new ChatMessage("commands.forceload.removed.all", new Object[] { dimensionmanager}), true);
return 0; return 0;

View File

@ -1,8 +1,8 @@
--- a/net/minecraft/server/DataConverterRegistry.java --- a/net/minecraft/server/DataConverterRegistry.java
+++ b/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)); datafixerbuilder.addFixer(new DataConverterItemFrame(schema46, false));
Schema schema47 = datafixerbuilder.addSchema(1458, DataConverterRegistry.c); Schema schema47 = datafixerbuilder.addSchema(1458, DataConverterRegistry.b);
+ // CraftBukkit start + // CraftBukkit start
+ datafixerbuilder.addFixer(new com.mojang.datafixers.DataFix(schema47, false) { + datafixerbuilder.addFixer(new com.mojang.datafixers.DataFix(schema47, false) {

View File

@ -273,9 +273,9 @@
} }
@@ -706,6 +884,7 @@ @@ -706,6 +884,7 @@
this.locX = (axisalignedbb.a + axisalignedbb.d) / 2.0D; this.locX = (axisalignedbb.minX + axisalignedbb.maxX) / 2.0D;
this.locY = axisalignedbb.b; this.locY = axisalignedbb.minY;
this.locZ = (axisalignedbb.c + axisalignedbb.f) / 2.0D; this.locZ = (axisalignedbb.minZ + axisalignedbb.maxZ) / 2.0D;
+ if (valid) world.entityJoinedWorld(this, false); // CraftBukkit + if (valid) world.entityJoinedWorld(this, false); // CraftBukkit
} }
@ -453,8 +453,8 @@
} }
this.vehicle = entity; this.vehicle = entity;
- this.vehicle.o(this); - this.vehicle.addPassenger(this);
+ if (!this.vehicle.o(this)) this.vehicle = null; // CraftBukkit + if (!this.vehicle.addPassenger(this)) this.vehicle = null; // CraftBukkit
return true; return true;
} }
} }
@ -468,8 +468,8 @@
} }
- protected void o(Entity entity) { - protected void addPassenger(Entity entity) {
+ protected boolean o(Entity entity) { // CraftBukkit + protected boolean addPassenger(Entity entity) { // CraftBukkit
if (entity.getVehicle() != this) { if (entity.getVehicle() != this) {
throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)"); throw new IllegalStateException("Use x.startRiding(y), not y.addPassenger(x)");
} else { } else {
@ -733,24 +733,24 @@
public void a(AxisAlignedBB axisalignedbb) { public void a(AxisAlignedBB axisalignedbb) {
- this.boundingBox = axisalignedbb; - this.boundingBox = axisalignedbb;
+ // CraftBukkit start - block invalid bounding boxes + // CraftBukkit start - block invalid bounding boxes
+ double a = axisalignedbb.a, + double minX = axisalignedbb.minX,
+ b = axisalignedbb.b, + minY = axisalignedbb.minY,
+ c = axisalignedbb.c, + minZ = axisalignedbb.minZ,
+ d = axisalignedbb.d, + maxX = axisalignedbb.maxX,
+ e = axisalignedbb.e, + maxY = axisalignedbb.maxY,
+ f = axisalignedbb.f; + maxZ = axisalignedbb.maxZ;
+ double len = axisalignedbb.d - axisalignedbb.a; + double len = axisalignedbb.maxX - axisalignedbb.minX;
+ if (len < 0) d = a; + if (len < 0) maxX = minX;
+ if (len > 64) d = a + 64.0; + if (len > 64) maxX = minX + 64.0;
+ +
+ len = axisalignedbb.e - axisalignedbb.b; + len = axisalignedbb.maxY - axisalignedbb.minY;
+ if (len < 0) e = b; + if (len < 0) maxY = minY;
+ if (len > 64) e = b + 64.0; + if (len > 64) maxY = minY + 64.0;
+ +
+ len = axisalignedbb.f - axisalignedbb.c; + len = axisalignedbb.maxZ - axisalignedbb.minZ;
+ if (len < 0) f = c; + if (len < 0) maxZ = minZ;
+ if (len > 64) f = c + 64.0; + if (len > 64) maxZ = minZ + 64.0;
+ this.boundingBox = new AxisAlignedBB(a, b, c, d, e, f); + this.boundingBox = new AxisAlignedBB(minX, minY, minZ, maxX, maxY, maxZ);
+ // CraftBukkit end + // CraftBukkit end
} }

View File

@ -1,11 +1,9 @@
--- a/net/minecraft/server/EntityAnimal.java --- a/net/minecraft/server/EntityAnimal.java
+++ b/net/minecraft/server/EntityAnimal.java +++ b/net/minecraft/server/EntityAnimal.java
@@ -7,7 +7,8 @@ @@ -8,6 +8,7 @@
protected Block bF; protected Block bF;
private int bC; private int bC;
- private UUID bD; public UUID breedCause;
+ public UUID bD; // PAIL
+ public ItemStack breedItem; // CraftBukkit - Add breedItem variable + public ItemStack breedItem; // CraftBukkit - Add breedItem variable
protected EntityAnimal(EntityTypes<?> entitytypes, World world) { 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; return iworldreader.getType(blockposition.down()).getBlock() == this.bF ? 10.0F : iworldreader.A(blockposition) - 0.5F;
@@ -134,6 +139,7 @@ @@ -134,6 +139,7 @@
if (entityhuman != null) { if (entityhuman != null) {
this.bD = entityhuman.getUniqueID(); this.breedCause = entityhuman.getUniqueID();
} }
+ this.breedItem = entityhuman.inventory.getItemInHand(); // CraftBukkit + this.breedItem = entityhuman.inventory.getItemInHand(); // CraftBukkit

View File

@ -70,7 +70,7 @@
@@ -134,9 +173,25 @@ @@ -134,9 +173,25 @@
public void collide(Entity entity) { public void collide(Entity entity) {
if (entity instanceof EntityBoat) { if (entity instanceof EntityBoat) {
if (entity.getBoundingBox().b < this.getBoundingBox().e) { if (entity.getBoundingBox().minY < this.getBoundingBox().maxY) {
+ // CraftBukkit start + // CraftBukkit start
+ VehicleEntityCollisionEvent event = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); + VehicleEntityCollisionEvent event = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity());
+ this.world.getServer().getPluginManager().callEvent(event); + this.world.getServer().getPluginManager().callEvent(event);
@ -81,7 +81,7 @@
+ // CraftBukkit end + // CraftBukkit end
super.collide(entity); super.collide(entity);
} }
} else if (entity.getBoundingBox().b <= this.getBoundingBox().b) { } else if (entity.getBoundingBox().minY <= this.getBoundingBox().minY) {
+ // CraftBukkit start + // CraftBukkit start
+ VehicleEntityCollisionEvent event = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity()); + VehicleEntityCollisionEvent event = new VehicleEntityCollisionEvent((Vehicle) this.getBukkitEntity(), entity.getBukkitEntity());
+ this.world.getServer().getPluginManager().callEvent(event); + this.world.getServer().getPluginManager().callEvent(event);

View File

@ -47,7 +47,7 @@
} }
@@ -399,6 +412,10 @@ @@ -399,6 +412,10 @@
int j1 = MathHelper.floor(axisalignedbb.f); int j1 = MathHelper.floor(axisalignedbb.maxZ);
boolean flag = false; boolean flag = false;
boolean flag1 = false; boolean flag1 = false;
+ // CraftBukkit start - Create a list to hold all the destroyed blocks + // CraftBukkit start - Create a list to hold all the destroyed blocks
@ -111,5 +111,5 @@
+ // CraftBukkit end + // CraftBukkit end
+ +
if (flag1) { if (flag1) {
double d0 = axisalignedbb.a + (axisalignedbb.d - axisalignedbb.a) * (double) this.random.nextFloat(); double d0 = axisalignedbb.minX + (axisalignedbb.maxX - axisalignedbb.minX) * (double) this.random.nextFloat();
double d1 = axisalignedbb.b + (axisalignedbb.e - axisalignedbb.b) * (double) this.random.nextFloat(); double d1 = axisalignedbb.minY + (axisalignedbb.maxY - axisalignedbb.minY) * (double) this.random.nextFloat();

View File

@ -1,18 +1,18 @@
--- a/net/minecraft/server/EntityFish.java --- a/net/minecraft/server/EntityFish.java
+++ b/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 !this.isFromBucket() && !this.hasCustomName();
+ return true; // CraftBukkit + return true; // CraftBukkit
} }
public boolean l() { public int dg() {
@@ -71,6 +71,7 @@ @@ -47,6 +47,7 @@
public void setFromBucket(boolean flag) { 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 + this.persistent = this.isPersistent(); // CraftBukkit - SPIGOT-4106 update persistence
} }

View File

@ -44,7 +44,7 @@
+ // CraftBukkit end + // CraftBukkit end
this.motY = (double) (-0.4F * MathHelper.a(this.random, 0.6F, 1.0F)); 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); 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 @@ @@ -389,6 +406,14 @@
int i = 0; int i = 0;

View File

@ -15,7 +15,7 @@
@@ -170,6 +175,12 @@ @@ -170,6 +175,12 @@
} }
private void setItem(ItemStack itemstack, boolean flag) { public void setItem(ItemStack itemstack, boolean flag) {
+ // CraftBukkit start + // CraftBukkit start
+ this.setItem(itemstack, flag, true); + this.setItem(itemstack, flag, true);
+ } + }

View File

@ -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
}

View File

@ -3,7 +3,7 @@
@@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
} }
protected boolean isTypeNotPersistent() { public boolean isTypeNotPersistent() {
- return !this.isTamed() && this.ticksLived > 2400; - return !this.isTamed() && this.ticksLived > 2400;
+ return !this.isTamed() /*&& this.ticksLived > 2400*/; // CraftBukkit + return !this.isTamed() /*&& this.ticksLived > 2400*/; // CraftBukkit
} }

View File

@ -30,4 +30,4 @@
+ // CraftBukkit end + // CraftBukkit end
this.soundDelay = this.random.nextInt(40); this.soundDelay = this.random.nextInt(40);
if (entity instanceof EntityLiving) { if (entity instanceof EntityLiving) {
this.a((EntityLiving) entity); this.setLastDamager((EntityLiving) entity);

View File

@ -522,7 +522,7 @@
+ this.world.getServer().getScoreboardManager().getScoreboardScores(statistic, this.getName(), ScoreboardScore::c); // CraftBukkit - Get our scores instead + this.world.getServer().getScoreboardManager().getScoreboardScores(statistic, this.getName(), ScoreboardScore::c); // CraftBukkit - Get our scores instead
} }
public int a(Collection<IRecipe> collection) { public int discoverRecipes(Collection<IRecipe> collection) {
@@ -830,8 +1059,17 @@ @@ -830,8 +1059,17 @@
public void triggerHealthUpdate() { public void triggerHealthUpdate() {

View File

@ -20,7 +20,7 @@
} }
public void die(DamageSource damagesource) { public void die(DamageSource damagesource) {
@@ -441,8 +445,12 @@ @@ -435,8 +439,12 @@
} else if (this.f.bK > 200) { } else if (this.f.bK > 200) {
World world = this.f.world; World world = this.f.world;

View File

@ -15,15 +15,6 @@
public class EntityVillager extends EntityAgeable implements NPC, IMerchant { 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 @@ @@ -38,7 +46,7 @@
public EntityVillager(World world, int i) { public EntityVillager(World world, int i) {

View File

@ -57,8 +57,8 @@
+ } + }
+ // CraftBukkit end + // CraftBukkit end
+ +
if (packethandshakinginsetprotocol.c() > 401) { if (packethandshakinginsetprotocol.c() > 404) {
chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.13.1"}); chatmessage = new ChatMessage("multiplayer.disconnect.outdated_server", new Object[] { "1.13.2"});
this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage)); this.b.sendPacket(new PacketLoginOutDisconnect(chatmessage));
@@ -26,6 +71,7 @@ @@ -26,6 +71,7 @@
this.b.close(chatmessage); this.b.close(chatmessage);

View File

@ -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);
}

View File

@ -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();

View File

@ -13,7 +13,7 @@
public ItemWorldMap(Item.Info item_info) { public ItemWorldMap(Item.Info item_info) {
@@ -15,7 +20,7 @@ @@ -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); ItemStack itemstack = new ItemStack(Items.FILLED_MAP);
- a(itemstack, world, i, j, b0, flag, flag1, world.worldProvider.getDimensionManager()); - a(itemstack, world, i, j, b0, flag, flag1, world.worldProvider.getDimensionManager());

View File

@ -500,7 +500,7 @@
- if (worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { - if (worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) {
+ if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit + if (true || worldserver.worldProvider.getDimensionManager() == DimensionManager.OVERWORLD || this.getAllowNether()) { // CraftBukkit
this.methodProfiler.a(() -> { this.methodProfiler.a(() -> {
return worldserver.getWorldData().getName(); return "dim-" + worldserver.worldProvider.getDimensionManager().getDimensionID();
}); });
+ /* Drop global time updates + /* Drop global time updates
if (this.ticks % 20 == 0) { if (this.ticks % 20 == 0) {

View File

@ -33,11 +33,11 @@
public PacketDataSerializer a(ItemStack itemstack) { public PacketDataSerializer a(ItemStack itemstack) {
- if (itemstack.isEmpty()) { - if (itemstack.isEmpty()) {
+ if (itemstack.isEmpty() || itemstack.getItem() == null) { // CraftBukkit - NPE fix itemstack.getItem() + if (itemstack.isEmpty() || itemstack.getItem() == null) { // CraftBukkit - NPE fix itemstack.getItem()
this.writeShort(-1); this.writeBoolean(false);
} else { } else {
Item item = itemstack.getItem(); this.writeBoolean(true);
@@ -263,6 +265,11 @@ @@ -263,6 +265,11 @@
ItemStack itemstack = new ItemStack(Item.getById(short0), b0); ItemStack itemstack = new ItemStack(Item.getById(i), b0);
itemstack.setTag(this.j()); itemstack.setTag(this.j());
+ // CraftBukkit start + // CraftBukkit start

View File

@ -6,7 +6,7 @@
public boolean b() { public boolean b() {
+ // CraftBukkit start - introduce a temporary timeout hack until this is fixed properly + // CraftBukkit start - introduce a temporary timeout hack until this is fixed properly
+ if ((this.a.ticksLived - this.a.hurtTimestamp) > 100) { + if ((this.a.ticksLived - this.a.hurtTimestamp) > 100) {
+ this.a.a((EntityLiving) null); // PAIL setLastDamager + this.a.setLastDamager((EntityLiving) null);
+ return false; + return false;
+ } + }
+ // CraftBukkit end + // CraftBukkit end

View File

@ -282,7 +282,7 @@
+ } + }
+ // CraftBukkit end + // 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.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)); 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 @@ @@ -243,7 +437,7 @@
@ -298,7 +298,7 @@
} }
this.teleportPos = null; 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; this.A = this.e;
if (this.player.isPassenger()) { 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.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 + this.allowedPlayerTicks = 20; // CraftBukkit
} else { } else {
+ // CraftBukkit - Make sure the move is valid but then reset it for plugins to modify + // CraftBukkit - Make sure the move is valid but then reset it for plugins to modify

View File

@ -245,7 +245,7 @@
+ // CraftBukkit end + // CraftBukkit end
} }
public void d(EntityPlayer entityplayer) { public void updateChunks(EntityPlayer entityplayer) {
entityplayer.getWorldServer().getPlayerChunkMap().movePlayer(entityplayer); entityplayer.getWorldServer().getPlayerChunkMap().movePlayer(entityplayer);
} }

View File

@ -68,7 +68,7 @@
return new LongOpenHashSet(); return new LongOpenHashSet();
})).add(i); })).add(i);
this.c = true; this.c = true;
@@ -493,7 +494,7 @@ @@ -496,7 +497,7 @@
} }
public BitSet a(WorldGenStage.Features worldgenstage_features) { public BitSet a(WorldGenStage.Features worldgenstage_features) {

View File

@ -72,7 +72,7 @@
if (l1 <= k) { if (l1 <= k) {
@@ -76,8 +107,10 @@ @@ -76,8 +107,10 @@
label128: label137:
while (iterator1.hasNext()) { while (iterator1.hasNext()) {
- ChunkCoordIntPair chunkcoordintpair1 = (ChunkCoordIntPair) iterator1.next(); - ChunkCoordIntPair chunkcoordintpair1 = (ChunkCoordIntPair) iterator1.next();
- BlockPosition blockposition1 = getRandomPosition(worldserver, chunkcoordintpair1.x, chunkcoordintpair1.z); - BlockPosition blockposition1 = getRandomPosition(worldserver, chunkcoordintpair1.x, chunkcoordintpair1.z);
@ -83,23 +83,23 @@
int i2 = blockposition1.getX(); int i2 = blockposition1.getX();
int j2 = blockposition1.getY(); int j2 = blockposition1.getY();
int k2 = blockposition1.getZ(); int k2 = blockposition1.getZ();
@@ -136,9 +169,12 @@ @@ -140,9 +173,12 @@
if (entityinsentient.a((GeneratorAccess) worldserver, false) && entityinsentient.a((IWorldReader) worldserver)) { 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); groupdataentity = entityinsentient.prepare(worldserver.getDamageScaler(new BlockPosition(entityinsentient)), groupdataentity, (NBTTagCompound) null);
if (entityinsentient.a((IWorldReader) worldserver)) { if (entityinsentient.a((IWorldReader) worldserver)) {
- ++l2; - ++l2;
- ++j4; - ++j4;
- worldserver.addEntity(entityinsentient); - worldserver.addEntity(entityinsentient);
+ // CraftBukkit start + // CraftBukkit start
+ if (worldserver.addEntity(entityinsentient, SpawnReason.NATURAL)) { + if (worldserver.addEntity(entityinsentient, SpawnReason.NATURAL)) {
+ ++l2; + ++l2;
+ ++j4; + ++j4;
+ } + }
+ // CraftBukkit end + // CraftBukkit end
} else { } else {
entityinsentient.die(); entityinsentient.die();
} }
@@ -255,7 +291,7 @@ @@ -260,7 +296,7 @@
entityinsentient.setPositionRotation(d0, (double) blockposition.getY(), d1, random.nextFloat() * 360.0F, 0.0F); entityinsentient.setPositionRotation(d0, (double) blockposition.getY(), d1, random.nextFloat() * 360.0F, 0.0F);
if (entityinsentient.a(generatoraccess, false) && entityinsentient.a((IWorldReader) generatoraccess)) { if (entityinsentient.a(generatoraccess, false) && entityinsentient.a((IWorldReader) generatoraccess)) {
groupdataentity = entityinsentient.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityinsentient)), groupdataentity, (NBTTagCompound) null); groupdataentity = entityinsentient.prepare(generatoraccess.getDamageScaler(new BlockPosition(entityinsentient)), groupdataentity, (NBTTagCompound) null);

View File

@ -21,9 +21,9 @@
} }
@@ -169,8 +173,8 @@ @@ -169,8 +173,8 @@
this.j = this.l(); this.target = this.l();
this.k = null; this.k = null;
} else if (this.j == null) { } else if (this.target == null) {
- List list = this.world.a(EntityLiving.class, this.k(), (entityliving) -> { - List list = this.world.a(EntityLiving.class, this.k(), (entityliving) -> {
- return entityliving instanceof IMonster && entityliving.ao(); - return entityliving instanceof IMonster && entityliving.ao();
+ List list = this.world.a(EntityLiving.class, this.k(), (Predicate<EntityLiving>) (entitylivingx) -> { // CraftBukkit - decompile error + List list = this.world.a(EntityLiving.class, this.k(), (Predicate<EntityLiving>) (entitylivingx) -> { // CraftBukkit - decompile error
@ -34,19 +34,19 @@
@@ -181,8 +185,13 @@ @@ -181,8 +185,13 @@
} }
if (this.j != null) { if (this.target != 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.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.j.damageEntity(DamageSource.MAGIC, 4.0F); - this.target.damageEntity(DamageSource.MAGIC, 4.0F);
+ // CraftBukkit start + // CraftBukkit start
+ CraftEventFactory.blockDamage = CraftBlock.at(this.world, this.position); + CraftEventFactory.blockDamage = CraftBlock.at(this.world, this.position);
+ if (this.j.damageEntity(DamageSource.MAGIC, 4.0F)) { + if (this.target.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); + 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; + CraftEventFactory.blockDamage = null;
+ // CraftBukkit end + // CraftBukkit end
} }
if (entityliving != this.j) { if (entityliving != this.target) {
@@ -215,7 +224,7 @@ @@ -215,7 +224,7 @@
@Nullable @Nullable

View File

@ -1,6 +1,6 @@
--- a/net/minecraft/server/TileEntityFurnace.java --- a/net/minecraft/server/TileEntityFurnace.java
+++ b/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;
import java.util.Map.Entry; import java.util.Map.Entry;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -16,7 +16,7 @@
public class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput, ITickable { public class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput, ITickable {
@@ -93,6 +102,31 @@ @@ -92,6 +101,31 @@
return linkedhashmap; return linkedhashmap;
} }
@ -48,7 +48,7 @@
public TileEntityFurnace() { public TileEntityFurnace() {
super(TileEntityTypes.FURNACE); super(TileEntityTypes.FURNACE);
this.items = NonNullList.a(3, ItemStack.a); this.items = NonNullList.a(3, ItemStack.a);
@@ -220,7 +254,7 @@ @@ -219,7 +253,7 @@
} }
public void Y_() { public void Y_() {
@ -57,7 +57,7 @@
boolean flag1 = false; boolean flag1 = false;
if (this.isBurning()) { if (this.isBurning()) {
@@ -238,9 +272,20 @@ @@ -237,9 +271,20 @@
IRecipe irecipe = this.world.E().b(this, this.world); IRecipe irecipe = this.world.E().b(this, this.world);
if (!this.isBurning() && this.canBurn(irecipe)) { if (!this.isBurning() && this.canBurn(irecipe)) {
@ -80,7 +80,7 @@
flag1 = true; flag1 = true;
if (!itemstack.isEmpty()) { if (!itemstack.isEmpty()) {
Item item = itemstack.getItem(); Item item = itemstack.getItem();
@@ -271,6 +316,7 @@ @@ -270,6 +315,7 @@
if (flag != this.isBurning()) { if (flag != this.isBurning()) {
flag1 = true; flag1 = true;
this.world.setTypeAndData(this.position, (IBlockData) this.world.getType(this.position).set(BlockFurnace.LIT, Boolean.valueOf(this.isBurning())), 3); 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() { private int s() {
@ -97,7 +97,7 @@
return furnacerecipe != null ? furnacerecipe.h() : 200; return furnacerecipe != null ? furnacerecipe.h() : 200;
} }
@@ -308,11 +354,38 @@ @@ -307,11 +353,38 @@
ItemStack itemstack1 = irecipe.d(); ItemStack itemstack1 = irecipe.d();
ItemStack itemstack2 = (ItemStack) this.items.get(2); ItemStack itemstack2 = (ItemStack) this.items.get(2);

View File

@ -146,7 +146,7 @@
} else { } else {
Chunk chunk = this.getChunkAtWorldCoords(blockposition); Chunk chunk = this.getChunkAtWorldCoords(blockposition);
Block block = iblockdata.getBlock(); 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 + // CraftBukkit start - capture blockstates
+ CraftBlockState blockstate = null; + CraftBlockState blockstate = null;
@ -156,7 +156,7 @@
+ } + }
+ // CraftBukkit end + // 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) { if (iblockdata1 == null) {
+ // CraftBukkit start - remove blockstate if failed + // CraftBukkit start - remove blockstate if failed
@ -335,7 +335,7 @@
+ if (vehicle != null) { + if (vehicle != null) {
+ vehicle.dead = true; + vehicle.dead = true;
+ } + }
+ for (Entity passenger : entity.bQ()) { + for (Entity passenger : entity.getAllPassengers()) {
+ passenger.dead = true; + passenger.dead = true;
+ } + }
+ entity.dead = true; + entity.dead = true;
@ -595,7 +595,7 @@
if (predicate.test(entityhuman1)) { if (predicate.test(entityhuman1)) {
double d5 = entityhuman1.d(d0, d1, d2); double d5 = entityhuman1.d(d0, d1, d2);
@@ -2164,6 +2475,16 @@ @@ -2185,6 +2496,16 @@
public void everyoneSleeping() {} public void everyoneSleeping() {}
@ -612,7 +612,7 @@
public float g(float f) { public float g(float f) {
return (this.q + (this.r - this.q) * f) * this.i(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(); int l = j * 16 + 8 - blockposition.getZ();
boolean flag = true; boolean flag = true;

View File

@ -23,8 +23,8 @@
@@ -304,6 +310,7 @@ @@ -304,6 +310,7 @@
nbttagcompound2.setBoolean("Snapshot", false); nbttagcompound2.setBoolean("Snapshot", false);
nbttagcompound.set("Version", nbttagcompound2); nbttagcompound.set("Version", nbttagcompound2);
nbttagcompound.setInt("DataVersion", 1628); nbttagcompound.setInt("DataVersion", 1631);
+ if (org.bukkit.craftbukkit.util.CraftMagicNumbers.DATA_VERSION != 1628) throw new AssertionError(); // CraftBukkit - sentinel + if (org.bukkit.craftbukkit.util.CraftMagicNumbers.DATA_VERSION != 1631) throw new AssertionError(); // CraftBukkit - sentinel
nbttagcompound.setLong("RandomSeed", this.e); nbttagcompound.setLong("RandomSeed", this.e);
nbttagcompound.setString("generatorName", this.f.b()); nbttagcompound.setString("generatorName", this.f.b());
nbttagcompound.setInt("generatorVersion", this.f.getVersion()); nbttagcompound.setInt("generatorVersion", this.f.getVersion());

View File

@ -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<String, Class<? extends StructureStart>> b = Maps.newHashMap();
+ public static final Map<String, Class<? extends StructureStart>> b = Maps.newHashMap(); // CraftBukkit private -> public
private static final Map<Class<? extends StructureStart>, String> c = Maps.newHashMap();
private static final Map<String, Class<? extends StructurePiece>> d = Maps.newHashMap();
private static final Map<Class<? extends StructurePiece>, String> e = Maps.newHashMap();

View File

@ -4,14 +4,14 @@
<groupId>org.bukkit</groupId> <groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId> <artifactId>craftbukkit</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.13.1-R0.1-SNAPSHOT</version> <version>1.13.2-R0.1-SNAPSHOT</version>
<name>CraftBukkit</name> <name>CraftBukkit</name>
<url>http://www.bukkit.org</url> <url>http://www.bukkit.org</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<api.version>unknown</api.version> <api.version>unknown</api.version>
<minecraft.version>1.13.1</minecraft.version> <minecraft.version>1.13.2</minecraft.version>
<minecraft_version>1_13_R2</minecraft_version> <minecraft_version>1_13_R2</minecraft_version>
<buildtag.prefix>git-Bukkit-</buildtag.prefix> <buildtag.prefix>git-Bukkit-</buildtag.prefix>
<buildtag.suffix></buildtag.suffix> <buildtag.suffix></buildtag.suffix>
@ -48,13 +48,13 @@
<dependency> <dependency>
<groupId>org.xerial</groupId> <groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId> <artifactId>sqlite-jdbc</artifactId>
<version>3.23.1</version> <version>3.25.2</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>mysql</groupId> <groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId> <artifactId>mysql-connector-java</artifactId>
<version>5.1.46</version> <version>5.1.47</version>
<scope>runtime</scope> <scope>runtime</scope>
</dependency> </dependency>
<!-- testing --> <!-- testing -->

View File

@ -1273,10 +1273,10 @@ public final class CraftServer implements Server {
BlockPosition structurePosition = new BlockPosition(structureLocation.getBlockX(), structureLocation.getBlockY(), structureLocation.getBlockZ()); BlockPosition structurePosition = new BlockPosition(structureLocation.getBlockX(), structureLocation.getBlockY(), structureLocation.getBlockZ());
// Create map with trackPlayer = true, unlimitedTracking = true // 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 net.minecraft.server.ItemStack stack = ItemWorldMap.createFilledMapView(worldServer, structurePosition.getX(), structurePosition.getZ(), MapView.Scale.NORMAL.getValue(), true, true);
ItemWorldMap.a(worldServer, stack); // PAIL rename sepiaMapFilter ItemWorldMap.applySepiaFilter(worldServer, stack);
// "+" map ID taken from EntityVillager // "+" 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); return CraftItemStack.asBukkitCopy(stack);
} }

View File

@ -256,7 +256,7 @@ public class CraftWorld implements World {
} }
public boolean isChunkInUse(int x, int z) { 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) { public boolean loadChunk(int x, int z, boolean generate) {

View File

@ -177,11 +177,11 @@ public class Main {
useConsole = false; 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()); Date buildDate = new SimpleDateFormat("yyyyMMdd-HHmm").parse(Main.class.getPackage().getImplementationVendor());
Calendar deadline = Calendar.getInstance(); Calendar deadline = Calendar.getInstance();
deadline.add(Calendar.DAY_OF_YEAR, -10); deadline.add(Calendar.DAY_OF_YEAR, -7);
if (buildDate.before(deadline.getTime())) { if (buildDate.before(deadline.getTime())) {
System.err.println("*** Error, this build is outdated ***"); System.err.println("*** Error, this build is outdated ***");
System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/ ***"); System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/ ***");

View File

@ -600,6 +600,6 @@ public class CraftBlock implements Block {
@Override @Override
public boolean isPassable() { public boolean isPassable() {
return this.getData0().h(world, position).b(); // PAIL getCollisionShape, isEmpty return this.getData0().getCollisionShape(world, position).isEmpty();
} }
} }

View File

@ -23,11 +23,11 @@ public class CraftAnimals extends CraftAgeable implements Animals {
@Override @Override
public UUID getBreedCause() { public UUID getBreedCause() {
return getHandle().bD; return getHandle().breedCause;
} }
@Override @Override
public void setBreedCause(UUID uuid) { public void setBreedCause(UUID uuid) {
getHandle().bD = uuid; getHandle().breedCause = uuid;
} }
} }

View File

@ -467,7 +467,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@Override @Override
public int discoverRecipes(Collection<NamespacedKey> recipes) { public int discoverRecipes(Collection<NamespacedKey> recipes) {
return getHandle().a(bukkitKeysToMinecraftRecipes(recipes)); // PAIL rename discoverRecipes return getHandle().discoverRecipes(bukkitKeysToMinecraftRecipes(recipes));
} }
@Override @Override
@ -477,7 +477,7 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
@Override @Override
public int undiscoverRecipes(Collection<NamespacedKey> recipes) { public int undiscoverRecipes(Collection<NamespacedKey> recipes) {
return getHandle().b(bukkitKeysToMinecraftRecipes(recipes)); // PAIL rename undiscoverRecipes return getHandle().undiscoverRecipes(bukkitKeysToMinecraftRecipes(recipes));
} }
private Collection<IRecipe> bukkitKeysToMinecraftRecipes(Collection<NamespacedKey> recipeKeys) { private Collection<IRecipe> bukkitKeysToMinecraftRecipes(Collection<NamespacedKey> recipeKeys) {

View File

@ -70,7 +70,7 @@ public class CraftVillager extends CraftAgeable implements Villager, InventoryHo
if (resetTrades) { if (resetTrades) {
getHandle().trades = null; getHandle().trades = null;
getHandle().bQ = 0; // SPIGOT-4310 getHandle().careerLevel = 0; // SPIGOT-4310
getHandle().populateTrades(); getHandle().populateTrades();
} }
} }

View File

@ -157,6 +157,17 @@ public class CraftEventFactory {
return event; 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 * Bucket methods
*/ */

View File

@ -634,7 +634,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable {
if (entry.getValue().getSlot() != null) { if (entry.getValue().getSlot() != null) {
EnumItemSlot slot = CraftEquipmentSlot.getNMS(entry.getValue().getSlot()); EnumItemSlot slot = CraftEquipmentSlot.getNMS(entry.getValue().getSlot());
if (slot != null) { if (slot != null) {
sub.setString(ATTRIBUTES_SLOT.NBT, slot.d()); // PAIL rename getSlotName, getName sub.setString(ATTRIBUTES_SLOT.NBT, slot.getSlotName());
} }
} }
list.add(sub); list.add(sub);

View File

@ -144,7 +144,7 @@ public final class CraftMagicNumbers implements UnsafeValues {
return CraftBlockData.fromData(getBlock(material, data)); return CraftBlockData.fromData(getBlock(material, data));
} }
public static final int DATA_VERSION = 1628; public static final int DATA_VERSION = 1631;
@Override @Override
public int getDataVersion() { public int getDataVersion() {

View File

@ -22,7 +22,7 @@ public class StructureTypeTest extends AbstractTestingBase {
@Test @Test
public void testMinecraftToBukkit() { public void testMinecraftToBukkit() {
for (String key : WorldGenFactory.b.keySet()) { // PAIL rename structureStartMap for (String key : WorldGenFactory.structureStartMap.keySet()) {
Assert.assertNotNull(structures.get(key)); Assert.assertNotNull(structures.get(key));
} }
} }
@ -38,8 +38,8 @@ public class StructureTypeTest extends AbstractTestingBase {
@Test @Test
public void testBukkitToMinecraft() { public void testBukkitToMinecraft() {
for (Map.Entry<String, StructureType> entry : structures.entrySet()) { for (Map.Entry<String, StructureType> entry : structures.entrySet()) {
Assert.assertNotNull(WorldGenFactory.b.get(entry.getKey())); Assert.assertNotNull(WorldGenFactory.structureStartMap.get(entry.getKey()));
Assert.assertNotNull(WorldGenFactory.b.get(entry.getValue().getName())); Assert.assertNotNull(WorldGenFactory.structureStartMap.get(entry.getValue().getName()));
} }
} }
} }