Update to Minecraft 1.12-pre2

This commit is contained in:
md_5
2017-05-14 12:00:00 +10:00
parent 6e3cec8bc7
commit 5195487ec6
210 changed files with 2280 additions and 1974 deletions

View File

@@ -22,9 +22,9 @@
public abstract class World implements IBlockAccess {
private int a = 63;
@@ -56,7 +71,51 @@
private final WorldBorder N;
int[] H;
@@ -58,7 +73,51 @@
private final WorldBorder P;
int[] J;
- protected World(IDataManager idatamanager, WorldData worlddata, WorldProvider worldprovider, MethodProfiler methodprofiler, boolean flag) {
+ // CraftBukkit start Added the following
@@ -73,12 +73,12 @@
+ this.ticksPerMonsterSpawns = this.getServer().getTicksPerMonsterSpawns(); // CraftBukkit
+ // CraftBukkit end
this.u = Lists.newArrayList(new IWorldAccess[] { this.t});
this.L = Calendar.getInstance();
this.N = Calendar.getInstance();
this.scoreboard = new Scoreboard();
@@ -69,6 +128,36 @@
@@ -71,6 +130,36 @@
this.worldProvider = worldprovider;
this.isClientSide = flag;
this.N = worldprovider.getWorldBorder();
this.P = worldprovider.getWorldBorder();
+ // CraftBukkit start
+ getWorldBorder().world = (WorldServer) this;
+ // From PlayerList.setPlayerFileData
@@ -112,7 +112,7 @@
}
public World b() {
@@ -206,6 +295,27 @@
@@ -208,6 +297,27 @@
}
public boolean setTypeAndData(BlockPosition blockposition, IBlockData iblockdata, int i) {
@@ -140,7 +140,7 @@
if (this.E(blockposition)) {
return false;
} else if (!this.isClientSide && this.worldData.getType() == WorldType.DEBUG_ALL_BLOCK_STATES) {
@@ -213,9 +323,23 @@
@@ -215,9 +325,23 @@
} else {
Chunk chunk = this.getChunkAtWorldCoords(blockposition);
Block block = iblockdata.getBlock();
@@ -164,7 +164,7 @@
return false;
} else {
if (iblockdata.c() != iblockdata1.c() || iblockdata.d() != iblockdata1.d()) {
@@ -224,6 +348,7 @@
@@ -226,6 +350,7 @@
this.methodProfiler.b();
}
@@ -172,7 +172,7 @@
if ((i & 2) != 0 && (!this.isClientSide || (i & 4) == 0) && chunk.isReady()) {
this.notify(blockposition, iblockdata1, iblockdata, i);
}
@@ -236,12 +361,37 @@
@@ -238,12 +363,37 @@
} else if (!this.isClientSide && (i & 16) == 0) {
this.c(blockposition, block);
}
@@ -210,7 +210,7 @@
public boolean setAir(BlockPosition blockposition) {
return this.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 3);
}
@@ -275,6 +425,11 @@
@@ -277,6 +427,11 @@
public void update(BlockPosition blockposition, Block block, boolean flag) {
if (this.worldData.getType() != WorldType.DEBUG_ALL_BLOCK_STATES) {
@@ -222,7 +222,7 @@
this.applyPhysics(blockposition, block, flag);
}
@@ -363,6 +518,17 @@
@@ -365,6 +520,17 @@
IBlockData iblockdata = this.getType(blockposition);
try {
@@ -240,7 +240,7 @@
iblockdata.doPhysics(this, blockposition, block, blockposition1);
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Exception while updating neighbours");
@@ -580,6 +746,17 @@
@@ -582,6 +748,17 @@
}
public IBlockData getType(BlockPosition blockposition) {
@@ -258,7 +258,7 @@
if (this.E(blockposition)) {
return Blocks.AIR.getBlockData();
} else {
@@ -785,6 +962,13 @@
@@ -787,6 +964,13 @@
}
public boolean addEntity(Entity entity) {
@@ -272,7 +272,7 @@
int i = MathHelper.floor(entity.locX / 16.0D);
int j = MathHelper.floor(entity.locZ / 16.0D);
boolean flag = entity.attachedToPlayer;
@@ -793,6 +977,37 @@
@@ -795,6 +979,37 @@
flag = true;
}
@@ -310,7 +310,7 @@
if (!flag && !this.isChunkLoaded(i, j, false)) {
return false;
} else {
@@ -815,6 +1030,7 @@
@@ -817,6 +1032,7 @@
((IWorldAccess) this.u.get(i)).a(entity);
}
@@ -318,7 +318,7 @@
}
protected void c(Entity entity) {
@@ -822,6 +1038,7 @@
@@ -824,6 +1040,7 @@
((IWorldAccess) this.u.get(i)).b(entity);
}
@@ -326,7 +326,7 @@
}
public void kill(Entity entity) {
@@ -857,7 +1074,15 @@
@@ -859,7 +1076,15 @@
this.getChunkAt(i, j).b(entity);
}
@@ -343,7 +343,7 @@
this.c(entity);
}
@@ -974,7 +1199,7 @@
@@ -976,7 +1201,7 @@
}
public boolean a(AxisAlignedBB axisalignedbb) {
@@ -352,7 +352,7 @@
}
public int a(float f) {
@@ -1044,6 +1269,11 @@
@@ -1046,6 +1271,11 @@
for (i = 0; i < this.j.size(); ++i) {
entity = (Entity) this.j.get(i);
@@ -364,7 +364,7 @@
try {
++entity.ticksLived;
@@ -1092,8 +1322,10 @@
@@ -1094,8 +1324,10 @@
CrashReportSystemDetails crashreportsystemdetails1;
CrashReport crashreport1;
@@ -374,10 +374,10 @@
+ for (this.tickPosition = 0; this.tickPosition < this.entityList.size(); ++this.tickPosition) {
+ entity = (Entity) this.entityList.get(this.tickPosition);
+ // CraftBukkit end
Entity entity1 = entity.bB();
Entity entity1 = entity.bH();
if (entity1 != null) {
@@ -1126,7 +1358,7 @@
@@ -1128,7 +1360,7 @@
this.getChunkAt(j, l).b(entity);
}
@@ -386,10 +386,10 @@
this.c(entity);
}
@@ -1135,6 +1367,13 @@
@@ -1137,6 +1369,13 @@
this.methodProfiler.c("blockEntities");
this.M = true;
this.O = true;
+ // CraftBukkit start - From below, clean up tile entities before ticking them
+ if (!this.tileEntityListUnload.isEmpty()) {
+ this.tileEntityListTick.removeAll(this.tileEntityListUnload);
@@ -400,19 +400,19 @@
Iterator iterator = this.tileEntityListTick.iterator();
while (iterator.hasNext()) {
@@ -1145,7 +1384,7 @@
@@ -1147,7 +1386,7 @@
if (this.isLoaded(blockposition) && this.N.a(blockposition)) {
if (this.isLoaded(blockposition) && this.P.a(blockposition)) {
try {
- this.methodProfiler.a(tileentity.getClass().getSimpleName());
+ this.methodProfiler.a("ticking"/*tileentity.getClass().getSimpleName()*/); // CraftBukkit: SPIGOT-1900
((ITickable) tileentity).F_();
((ITickable) tileentity).e();
this.methodProfiler.b();
} catch (Throwable throwable2) {
@@ -1167,11 +1406,13 @@
@@ -1169,11 +1408,13 @@
}
this.M = false;
this.O = false;
+ /* CraftBukkit start - Moved up
if (!this.tileEntityListUnload.isEmpty()) {
this.tileEntityListTick.removeAll(this.tileEntityListUnload);
@@ -423,7 +423,7 @@
this.methodProfiler.c("pendingBlockEntities");
if (!this.b.isEmpty()) {
@@ -1179,9 +1420,11 @@
@@ -1181,9 +1422,11 @@
TileEntity tileentity1 = (TileEntity) this.b.get(i1);
if (!tileentity1.y()) {
@@ -435,7 +435,7 @@
if (this.isLoaded(tileentity1.getPosition())) {
Chunk chunk = this.getChunkAtWorldCoords(tileentity1.getPosition());
@@ -1189,6 +1432,12 @@
@@ -1191,6 +1434,12 @@
chunk.a(tileentity1.getPosition(), tileentity1);
this.notify(tileentity1.getPosition(), iblockdata, iblockdata, 3);
@@ -448,7 +448,7 @@
}
}
}
@@ -1243,7 +1492,10 @@
@@ -1245,7 +1494,10 @@
int j = MathHelper.floor(entity.locZ);
boolean flag1 = true;
@@ -460,15 +460,15 @@
entity.M = entity.locX;
entity.N = entity.locY;
entity.O = entity.locZ;
@@ -1255,6 +1507,7 @@
entity.aw();
@@ -1257,6 +1509,7 @@
entity.leaveVehicle();
} else {
entity.A_();
entity.B_();
+ entity.postTick(); // CraftBukkit
}
}
@@ -1547,11 +1800,18 @@
@@ -1549,11 +1802,18 @@
}
}
@@ -486,8 +486,8 @@
+
TileEntity tileentity = null;
if (this.M) {
@@ -1586,6 +1846,14 @@
if (this.O) {
@@ -1588,6 +1848,14 @@
public void setTileEntity(BlockPosition blockposition, @Nullable TileEntity tileentity) {
if (!this.E(blockposition)) {
if (tileentity != null && !tileentity.y()) {
@@ -499,10 +499,10 @@
+ return;
+ }
+ // CraftBukkit end
if (this.M) {
if (this.O) {
tileentity.setPosition(blockposition);
Iterator iterator = this.b.iterator();
@@ -1745,6 +2013,14 @@
@@ -1747,6 +2015,14 @@
}
this.o = MathHelper.a(this.o, 0.0F, 1.0F);
@@ -517,7 +517,7 @@
}
}
}
@@ -1876,7 +2152,10 @@
@@ -1878,7 +2154,10 @@
}
public boolean c(EnumSkyBlock enumskyblock, BlockPosition blockposition) {
@@ -529,7 +529,7 @@
return false;
} else {
int i = 0;
@@ -2043,7 +2322,7 @@
@@ -2045,7 +2324,7 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
@@ -538,7 +538,7 @@
arraylist.add(entity);
}
}
@@ -2058,7 +2337,7 @@
@@ -2060,7 +2339,7 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
@@ -547,7 +547,7 @@
arraylist.add(entity);
}
}
@@ -2107,7 +2386,7 @@
@@ -2109,7 +2388,7 @@
}
}
@@ -556,12 +556,10 @@
}
@Nullable
@@ -2128,8 +2407,17 @@
@@ -2130,8 +2409,17 @@
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
-
- if ((!(entity instanceof EntityInsentient) || !((EntityInsentient) entity).isPersistent()) && oclass.isAssignableFrom(entity.getClass())) {
+ // CraftBukkit start - Split out persistent check, don't apply it to special persistent mobs
+ if (entity instanceof EntityInsentient) {
+ EntityInsentient entityinsentient = (EntityInsentient) entity;
@@ -569,14 +567,15 @@
+ continue;
+ }
+ }
+
- if ((!(entity instanceof EntityInsentient) || !((EntityInsentient) entity).isPersistent()) && oclass.isAssignableFrom(entity.getClass())) {
+ if (oclass.isAssignableFrom(entity.getClass())) {
+ // if ((!(entity instanceof EntityInsentient) || !((EntityInsentient) entity).isPersistent()) && oclass.isAssignableFrom(entity.getClass())) {
+ // CraftBukkit end
++i;
}
}
@@ -2138,12 +2426,18 @@
@@ -2140,12 +2428,18 @@
}
public void a(Collection<Entity> collection) {
@@ -596,7 +595,7 @@
this.b(entity);
}
@@ -2157,7 +2451,13 @@
@@ -2159,7 +2453,13 @@
IBlockData iblockdata = this.getType(blockposition);
AxisAlignedBB axisalignedbb = flag ? null : block.getBlockData().c(this, blockposition);
@@ -610,8 +609,8 @@
+ // CraftBukkit end
}
public int K() {
@@ -2267,6 +2567,11 @@
public int getSeaLevel() {
@@ -2269,6 +2569,11 @@
for (int i = 0; i < this.players.size(); ++i) {
EntityHuman entityhuman1 = (EntityHuman) this.players.get(i);
@@ -623,7 +622,7 @@
if (predicate.apply(entityhuman1)) {
double d5 = entityhuman1.d(d0, d1, d2);
@@ -2435,6 +2740,16 @@
@@ -2437,6 +2742,16 @@
public void everyoneSleeping() {}
@@ -640,7 +639,7 @@
public float h(float f) {
return (this.p + (this.q - this.p) * f) * this.j(f);
}
@@ -2652,7 +2967,7 @@
@@ -2654,7 +2969,7 @@
int l = j * 16 + 8 - blockposition.getZ();
boolean flag = true;