Replace ItemTag API with new API that also expands to Tiles and Entities

By: Bjarne Koll <LynxPlay101@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2019-04-25 14:36:46 +10:00
parent 4198bf7e21
commit c9a23d73a0
16 changed files with 797 additions and 221 deletions

View File

@@ -319,7 +319,19 @@
IChatBaseComponent ichatbasecomponent = this.getCustomName();
if (ichatbasecomponent != null) {
@@ -1414,6 +1595,42 @@
@@ -1331,6 +1512,11 @@
}
}
+ // CraftBukkit start - stores eventually existing bukkit values
+ if (this.bukkitEntity != null) {
+ this.bukkitEntity.storeBukkitValues(nbttagcompound);
+ }
+ // CraftBukkit end
return nbttagcompound;
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Saving entity NBT");
@@ -1414,6 +1600,42 @@
} else {
throw new IllegalStateException("Entity has invalid position");
}
@@ -362,7 +374,7 @@
} catch (Throwable throwable) {
CrashReport crashreport = CrashReport.a(throwable, "Loading entity NBT");
CrashReportSystemDetails crashreportsystemdetails = crashreport.a("Entity being loaded");
@@ -1489,9 +1706,22 @@
@@ -1489,9 +1711,22 @@
} else if (this.world.isClientSide) {
return null;
} else {
@@ -385,7 +397,7 @@
this.world.addEntity(entityitem);
return entityitem;
}
@@ -1595,7 +1825,7 @@
@@ -1595,7 +1830,7 @@
}
this.vehicle = entity;
@@ -394,7 +406,7 @@
return true;
}
}
@@ -1620,15 +1850,36 @@
@@ -1620,15 +1855,36 @@
Entity entity = this.vehicle;
this.vehicle = null;
@@ -433,7 +445,7 @@
if (!this.world.isClientSide && entity instanceof EntityHuman && !(this.getRidingPassenger() instanceof EntityHuman)) {
this.passengers.add(0, entity);
} else {
@@ -1636,15 +1887,33 @@
@@ -1636,15 +1892,33 @@
}
}
@@ -468,7 +480,7 @@
}
protected boolean q(Entity entity) {
@@ -1687,7 +1956,7 @@
@@ -1687,7 +1961,7 @@
int i = this.ab();
if (this.ai) {
@@ -477,7 +489,7 @@
this.world.getMethodProfiler().enter("portal");
this.aj = i;
this.portalCooldown = this.aW();
@@ -1771,6 +2040,13 @@
@@ -1771,6 +2045,13 @@
}
public void setSwimming(boolean flag) {
@@ -491,7 +503,7 @@
this.setFlag(4, flag);
}
@@ -1831,16 +2107,56 @@
@@ -1831,16 +2112,56 @@
}
public void setAirTicks(int i) {
@@ -551,7 +563,7 @@
}
public void j(boolean flag) {
@@ -1988,20 +2304,33 @@
@@ -1988,20 +2309,33 @@
@Nullable
public Entity a(DimensionManager dimensionmanager) {
@@ -588,7 +600,7 @@
if (dimensionmanager1 == DimensionManager.THE_END && dimensionmanager == DimensionManager.OVERWORLD) {
blockposition = worldserver1.getHighestBlockYAt(HeightMap.Type.MOTION_BLOCKING_NO_LEAVES, worldserver1.getSpawn());
} else if (dimensionmanager == DimensionManager.THE_END) {
@@ -2039,6 +2368,25 @@
@@ -2039,6 +2373,25 @@
vec3d = shapedetector_c.b;
f = (float) shapedetector_c.c;
}
@@ -614,7 +626,7 @@
this.world.getMethodProfiler().exitEnter("reloading");
Entity entity = this.getEntityType().a((World) worldserver1);
@@ -2048,6 +2396,14 @@
@@ -2048,6 +2401,14 @@
entity.setPositionRotation(blockposition, entity.yaw + f, entity.pitch);
entity.setMot(vec3d);
worldserver1.addEntityTeleport(entity);
@@ -629,7 +641,7 @@
}
this.dead = true;
@@ -2239,7 +2595,26 @@
@@ -2239,7 +2600,26 @@
}
public void a(AxisAlignedBB axisalignedbb) {