Update to Minecraft 1.16.3

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2020-09-11 07:00:00 +10:00
parent 64a5548668
commit 5425f6ba43
27 changed files with 67 additions and 113 deletions

View File

@@ -51,7 +51,7 @@
}
@@ -252,4 +268,10 @@
public IRegistryCustom q() {
return this.i.aX();
return this.i.getCustomRegistry();
}
+
+ // CraftBukkit start

View File

@@ -121,7 +121,7 @@
}
+ // CraftBukkit start
+ this.a((PlayerList) (new DedicatedPlayerList(this, this.f, this.worldNBTStorage)));
+ this.a((PlayerList) (new DedicatedPlayerList(this, this.customRegistry, this.worldNBTStorage)));
+ server.loadPlugins();
+ server.enablePlugins(org.bukkit.plugin.PluginLoadOrder.STARTUP);
+ // CraftBukkit end
@@ -133,8 +133,8 @@
if (!NameReferencingFileConverter.e(this)) {
return false;
} else {
- this.a((PlayerList) (new DedicatedPlayerList(this, this.f, this.worldNBTStorage)));
+ // this.a((PlayerList) (new DedicatedPlayerList(this, this.f, this.worldNBTStorage))); // CraftBukkit - moved up
- this.a((PlayerList) (new DedicatedPlayerList(this, this.customRegistry, this.worldNBTStorage)));
+ // this.a((PlayerList) (new DedicatedPlayerList(this, this.customRegistry, this.worldNBTStorage))); // CraftBukkit - moved up
long i = SystemUtils.getMonotonicNanos();
this.c(dedicatedserverproperties.maxBuildHeight);

View File

@@ -607,7 +607,7 @@
+ // CraftBukkit end
this.world.getMethodProfiler().enter("reposition");
- ShapeDetectorShape shapedetectorshape = this.a(worldserver);
+ ShapeDetectorShape shapedetectorshape = (location == null) ? this.a(worldserver) : new ShapeDetectorShape(new Vec3D(location.getX(), location.getY(), location.getZ()), Vec3D.a, this.yaw, this.pitch, worldserver, null); // CraftBukkit
+ ShapeDetectorShape shapedetectorshape = (location == null) ? this.a(worldserver) : new ShapeDetectorShape(new Vec3D(location.getX(), location.getY(), location.getZ()), Vec3D.ORIGIN, this.yaw, this.pitch, worldserver, null); // CraftBukkit
if (shapedetectorshape == null) {
return null;

View File

@@ -16,15 +16,6 @@
public class EntityArmorStand extends EntityLiving {
private static final Vector3f bj = new Vector3f(0.0F, 0.0F, 0.0F);
@@ -29,7 +38,7 @@
private final NonNullList<ItemStack> armorItems;
private boolean armorStandInvisible;
public long bi;
- private int bv;
+ public int bv; //PAIL private -> public, rename disabledSlots
public Vector3f headPose;
public Vector3f bodyPose;
public Vector3f leftArmPose;
@@ -55,6 +64,13 @@
this.setPosition(d0, d1, d2);
}

View File

@@ -106,7 +106,7 @@
public void tick() {
this.ay = this.ax;
@@ -225,6 +285,22 @@
this.setMot(Vec3D.a);
this.setMot(Vec3D.ORIGIN);
}
+ // CraftBukkit start

View File

@@ -24,7 +24,7 @@
+ // CraftBukkit end
+
entityhuman.playSound(SoundEffects.ENTITY_COW_MILK, 1.0F, 1.0F);
- ItemStack itemstack1 = ItemLiquidUtil.a(itemstack, entityhuman, Items.MILK_BUCKET.r());
- ItemStack itemstack1 = ItemLiquidUtil.a(itemstack, entityhuman, Items.MILK_BUCKET.createItemStack());
+ ItemStack itemstack1 = ItemLiquidUtil.a(itemstack, entityhuman, CraftItemStack.asNMSCopy(event.getItemStack())); // CraftBukkit
entityhuman.a(enumhand, itemstack1);

View File

@@ -3,7 +3,7 @@
@@ -20,8 +20,8 @@
}
public void b(ItemStack itemstack) {
public void setItem(ItemStack itemstack) {
- if (itemstack.getItem() != Items.ENDER_EYE || itemstack.hasTag()) {
- this.getDataWatcher().set(EntityEnderSignal.b, SystemUtils.a((Object) itemstack.cloneItemStack(), (itemstack1) -> {
+ if (true || itemstack.getItem() != Items.ENDER_EYE || itemstack.hasTag()) { // CraftBukkit - always allow item changing
@@ -15,8 +15,8 @@
public void loadData(NBTTagCompound nbttagcompound) {
ItemStack itemstack = ItemStack.a(nbttagcompound.getCompound("Item"));
- this.b(itemstack);
+ if (!itemstack.isEmpty()) this.b(itemstack); // CraftBukkit - SPIGOT-6103 summon, see also SPIGOT-5474
- this.setItem(itemstack);
+ if (!itemstack.isEmpty()) this.setItem(itemstack); // CraftBukkit - SPIGOT-6103 summon, see also SPIGOT-5474
}
@Override

View File

@@ -5,7 +5,7 @@
--this.b;
if (this.b == 0) {
+ // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleEntitySpellCastEvent(EntityIllagerWizard.this, l())) { // PAIL rename getSpell
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.handleEntitySpellCastEvent(EntityIllagerWizard.this, this.getCastSpell())) {
+ return;
+ }
+ // CraftBukkit end

View File

@@ -209,15 +209,7 @@
this.world.getMethodProfiler().enter("sensing");
this.bo.a();
this.world.getMethodProfiler().exit();
@@ -807,6 +890,7 @@
this.a(itemstack);
}
+ this.setSlot(enumitemslot, ItemStack.b); // CraftBukkit - SPIGOT-6109
}
}
@@ -1023,6 +1107,12 @@
@@ -1024,6 +1107,12 @@
if (!this.isAlive()) {
return EnumInteractionResult.PASS;
} else if (this.getLeashHolder() == entityhuman) {
@@ -230,7 +222,7 @@
this.unleash(true, !entityhuman.abilities.canInstantlyBuild);
return EnumInteractionResult.a(this.world.isClientSide);
} else {
@@ -1041,6 +1131,12 @@
@@ -1042,6 +1131,12 @@
ItemStack itemstack = entityhuman.b(enumhand);
if (itemstack.getItem() == Items.LEAD && this.a(entityhuman)) {
@@ -243,7 +235,7 @@
this.setLeashHolder(entityhuman, true);
itemstack.subtract(1);
return EnumInteractionResult.a(this.world.isClientSide);
@@ -1056,7 +1152,7 @@
@@ -1057,7 +1152,7 @@
if (itemstack.getItem() instanceof ItemMonsterEgg) {
if (this.world instanceof WorldServer) {
ItemMonsterEgg itemmonsteregg = (ItemMonsterEgg) itemstack.getItem();
@@ -252,7 +244,7 @@
optional.ifPresent((entityinsentient) -> {
this.a(entityhuman, entityinsentient);
@@ -1102,12 +1198,19 @@
@@ -1103,12 +1198,19 @@
return this.bA != -1.0F;
}
@@ -273,7 +265,7 @@
t0.u(this);
t0.setBaby(this.isBaby());
@@ -1139,7 +1242,12 @@
@@ -1140,7 +1242,12 @@
}
}
@@ -287,7 +279,7 @@
if (this.isPassenger()) {
Entity entity = this.getVehicle();
@@ -1159,6 +1267,7 @@
@@ -1160,6 +1267,7 @@
if (this.leashHolder != null) {
if (!this.isAlive() || !this.leashHolder.isAlive()) {
@@ -295,7 +287,7 @@
this.unleash(true, true);
}
@@ -1175,7 +1284,9 @@
@@ -1176,7 +1284,9 @@
this.leashHolder = null;
this.by = null;
if (!this.world.isClientSide && flag1) {
@@ -305,7 +297,7 @@
}
if (!this.world.isClientSide && flag && this.world instanceof WorldServer) {
@@ -1225,6 +1336,7 @@
@@ -1226,6 +1336,7 @@
boolean flag1 = super.a(entity, flag);
if (flag1 && this.isLeashed()) {
@@ -313,7 +305,7 @@
this.unleash(true, true);
}
@@ -1357,7 +1469,14 @@
@@ -1358,7 +1469,14 @@
int i = EnchantmentManager.getFireAspectEnchantmentLevel(this);
if (i > 0) {
@@ -329,7 +321,7 @@
}
boolean flag = entity.damageEntity(DamageSource.mobAttack(this), f);
@@ -1419,6 +1538,7 @@
@@ -1420,6 +1538,7 @@
@Override
protected void bM() {
super.bM();

View File

@@ -28,15 +28,6 @@
public abstract class EntityLiving extends Entity {
private static final UUID b = UUID.fromString("662A6B8D-DA3E-4C1C-8813-96EA6097278D");
@@ -30,7 +51,7 @@
public static final DataWatcherObject<Float> HEALTH = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.c);
private static final DataWatcherObject<Integer> f = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Boolean> g = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.i);
- private static final DataWatcherObject<Integer> bh = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.b);
+ public static final DataWatcherObject<Integer> bh = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.b); // PAIL private -> public, rename ARROWS_IN_BODY
private static final DataWatcherObject<Integer> bi = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.b);
private static final DataWatcherObject<Optional<BlockPosition>> bj = DataWatcher.a(EntityLiving.class, DataWatcherRegistry.m);
protected static final EntitySize ah = EntitySize.c(0.2F, 0.2F);
@@ -106,6 +127,21 @@
private float bB;
private float bC;
@@ -752,7 +743,7 @@
}
public final void setArrowCount(int i) {
- this.datawatcher.set(EntityLiving.bh, i);
- this.datawatcher.set(EntityLiving.ARROWS_IN_BODY, i);
+ // CraftBukkit start
+ setArrowCount(i, false);
}
@@ -762,14 +753,14 @@
+ if (event.isCancelled()) {
+ return;
+ }
+ this.datawatcher.set(EntityLiving.bh, event.getNewAmount());
+ this.datawatcher.set(EntityLiving.ARROWS_IN_BODY, event.getNewAmount());
+ }
+ // CraftBukkit end
+
public final int dy() {
return (Integer) this.datawatcher.get(EntityLiving.bi);
}
@@ -1815,6 +2222,7 @@
@@ -1816,6 +2223,7 @@
}
if (this.onGround && !this.world.isClientSide) {
@@ -777,7 +768,7 @@
this.setFlag(7, false);
}
} else {
@@ -2320,6 +2728,7 @@
@@ -2321,6 +2729,7 @@
}
if (!this.world.isClientSide) {
@@ -785,7 +776,7 @@
this.setFlag(7, flag);
}
@@ -2440,6 +2849,7 @@
@@ -2441,6 +2850,7 @@
}
public boolean hasLineOfSight(Entity entity) {
@@ -793,7 +784,7 @@
Vec3D vec3d = new Vec3D(this.locX(), this.getHeadY(), this.locZ());
Vec3D vec3d1 = new Vec3D(entity.locX(), entity.getHeadY(), entity.locZ());
@@ -2457,14 +2867,21 @@
@@ -2458,14 +2868,21 @@
@Override
public boolean isInteractable() {
@@ -817,7 +808,7 @@
@Override
protected void velocityChanged() {
this.velocityChanged = this.random.nextDouble() >= this.b(GenericAttributes.KNOCKBACK_RESISTANCE);
@@ -2657,7 +3074,25 @@
@@ -2658,7 +3075,25 @@
} else {
if (!this.activeItem.isEmpty() && this.isHandRaised()) {
this.b(this.activeItem, 16);
@@ -844,7 +835,7 @@
if (itemstack != this.activeItem) {
this.a(enumhand, itemstack);
@@ -2749,10 +3184,18 @@
@@ -2750,10 +3185,18 @@
}
if (flag2) {
@@ -866,7 +857,7 @@
}
}
@@ -2849,7 +3292,7 @@
@@ -2850,7 +3293,7 @@
}
public void entityWakeup() {
@@ -875,7 +866,7 @@
World world = this.world;
this.world.getClass();
@@ -2920,7 +3363,7 @@
@@ -2921,7 +3364,7 @@
Pair<MobEffect, Float> pair = (Pair) iterator.next();
if (!world.isClientSide && pair.getFirst() != null && world.random.nextFloat() < (Float) pair.getSecond()) {

View File

@@ -370,8 +370,8 @@
+ if (shapedetectorshape != null && this.world.getTypeKey() == DimensionManager.OVERWORLD && worldserver != null && worldserver.getTypeKey() == DimensionManager.THE_END) { // CraftBukkit
Vec3D vec3d = shapedetectorshape.position.add(0.0D, -1.0D, 0.0D);
- return new ShapeDetectorShape(vec3d, Vec3D.a, 90.0F, 0.0F);
+ return new ShapeDetectorShape(vec3d, Vec3D.a, 90.0F, 0.0F, worldserver, shapedetectorshape.portalEventInfo); // CraftBukkit
- return new ShapeDetectorShape(vec3d, Vec3D.ORIGIN, 90.0F, 0.0F);
+ return new ShapeDetectorShape(vec3d, Vec3D.ORIGIN, 90.0F, 0.0F, worldserver, shapedetectorshape.portalEventInfo); // CraftBukkit
} else {
return shapedetectorshape;
}

View File

@@ -23,7 +23,7 @@
+ public EntityTrackerEntry(WorldServer worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<EntityPlayer> trackedPlayers) {
+ this.trackedPlayers = trackedPlayers;
+ // CraftBukkit end
this.m = Vec3D.a;
this.m = Vec3D.ORIGIN;
this.p = Collections.emptyList();
this.b = worldserver;
@@ -52,16 +61,17 @@

View File

@@ -1,11 +0,0 @@
--- a/net/minecraft/server/ItemActionContext.java
+++ b/net/minecraft/server/ItemActionContext.java
@@ -15,7 +15,7 @@
this(entityhuman.world, entityhuman, enumhand, entityhuman.b(enumhand), movingobjectpositionblock);
}
- protected ItemActionContext(World world, @Nullable EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack, MovingObjectPositionBlock movingobjectpositionblock) {
+ public ItemActionContext(World world, @Nullable EntityHuman entityhuman, EnumHand enumhand, ItemStack itemstack, MovingObjectPositionBlock movingobjectpositionblock) { // PAIL protected -> public
this.a = entityhuman;
this.b = enumhand;
this.c = movingobjectpositionblock;

View File

@@ -2,7 +2,7 @@
+++ b/net/minecraft/server/ItemEnderEye.java
@@ -61,7 +61,11 @@
entityendersignal.b(itemstack);
entityendersignal.setItem(itemstack);
entityendersignal.a(blockposition);
- world.addEntity(entityendersignal);
+ // CraftBukkit start

View File

@@ -25,15 +25,6 @@
public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant<TickTask> implements IMojangStatistics, ICommandListener, AutoCloseable {
@@ -73,7 +84,7 @@
public final DataFixer dataConverterManager;
private String serverIp;
private int serverPort;
- protected final IRegistryCustom.Dimension f;
+ public final IRegistryCustom.Dimension f;
public final Map<ResourceKey<World>, WorldServer> worldServer;
private PlayerList playerList;
private volatile boolean isRunning;
@@ -124,6 +135,20 @@
private final DefinedStructureManager ak;
protected SaveData saveData;
@@ -211,7 +202,7 @@
+
+ org.bukkit.generator.ChunkGenerator gen = this.server.getGenerator(name);
+
+ IRegistryCustom.Dimension iregistrycustom_dimension = this.f;
+ IRegistryCustom.Dimension iregistrycustom_dimension = this.customRegistry;
+
+ RegistryReadOps<NBTBase> registryreadops = RegistryReadOps.a((DynamicOps) DynamicOpsNBT.a, this.dataPackResources.h(), iregistrycustom_dimension);
+ worlddata = (WorldDataServer) worldSession.a((DynamicOps) registryreadops, datapackconfiguration);
@@ -252,8 +243,8 @@
+ ChunkGenerator chunkgenerator;
+
+ if (worlddimension == null) {
+ dimensionmanager = (DimensionManager) this.f.a().d(DimensionManager.OVERWORLD);
+ chunkgenerator = GeneratorSettings.a(this.f.b(IRegistry.ay), this.f.b(IRegistry.ar), (new Random()).nextLong());
+ dimensionmanager = (DimensionManager) this.customRegistry.a().d(DimensionManager.OVERWORLD);
+ chunkgenerator = GeneratorSettings.a(customRegistry.b(IRegistry.ay), customRegistry.b(IRegistry.ar), (new Random()).nextLong());
+ } else {
+ dimensionmanager = worlddimension.b();
+ chunkgenerator = worlddimension.c();
@@ -320,8 +311,8 @@
- Object object;
-
- if (worlddimension == null) {
- dimensionmanager = (DimensionManager) this.f.a().d(DimensionManager.OVERWORLD);
- object = GeneratorSettings.a(this.f.b(IRegistry.ay), this.f.b(IRegistry.ar), (new Random()).nextLong());
- dimensionmanager = (DimensionManager) this.customRegistry.a().d(DimensionManager.OVERWORLD);
- object = GeneratorSettings.a(this.customRegistry.b(IRegistry.ay), this.customRegistry.b(IRegistry.ar), (new Random()).nextLong());
- } else {
- dimensionmanager = worlddimension.b();
- object = worlddimension.c();
@@ -475,7 +466,7 @@
iworlddataserver.a(worldserver1.getWorldBorder().t());
this.saveData.setCustomBossEvents(this.getBossBattleCustomData().save());
this.convertable.a(this.f, this.saveData, this.getPlayerList().save());
this.convertable.a(this.customRegistry, this.saveData, this.getPlayerList().save());
+ */
+ // CraftBukkit end
return flag3;

View File

@@ -60,8 +60,8 @@
return;
}
- boolean flag = (Boolean) iblockdata.get(BlockBarrel.b);
+ boolean flag = (Boolean) iblockdata.get(BlockBarrel.b) && !opened; // CraftBukkit - only set flag if Barrel isn't set open by API.
- boolean flag = (Boolean) iblockdata.get(BlockBarrel.OPEN);
+ boolean flag = (Boolean) iblockdata.get(BlockBarrel.OPEN) && !opened; // CraftBukkit - only set flag if Barrel isn't set open by API.
if (flag) {
this.playOpenSound(iblockdata, SoundEffects.BLOCK_BARREL_CLOSE);

View File

@@ -62,7 +62,7 @@
+ this.ticksPerWaterSpawns = this.getServer().getTicksPerWaterSpawns(); // CraftBukkit
+ this.ticksPerWaterAmbientSpawns = this.getServer().getTicksPerWaterAmbientSpawns(); // CraftBukkit
+ this.ticksPerAmbientSpawns = this.getServer().getTicksPerAmbientSpawns(); // CraftBukkit
+ this.typeKey = (ResourceKey) this.getServer().getHandle().getServer().f.a().c(dimensionmanager).orElseThrow(() -> {
+ this.typeKey = (ResourceKey) this.getServer().getHandle().getServer().customRegistry.a().c(dimensionmanager).orElseThrow(() -> {
+ return new IllegalStateException("Unregistered dimension type: " + dimensionmanager);
+ });
+ // CraftBukkit end

View File

@@ -319,7 +319,7 @@
+
+ worldDataServer.a(worldserver1.getWorldBorder().t());
+ worldDataServer.setCustomBossEvents(this.server.getBossBattleCustomData().save());
+ convertable.a(this.server.f, this.worldDataServer, this.server.getPlayerList().save());
+ convertable.a(this.server.customRegistry, this.worldDataServer, this.server.getPlayerList().save());
+ // CraftBukkit end
}