Update to Minecraft 1.16.1

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2020-06-25 10:00:00 +10:00
parent 3862d2811e
commit 50503fd516
424 changed files with 5960 additions and 5636 deletions

View File

@@ -1,9 +1,9 @@
--- a/net/minecraft/server/EntityVillager.java
+++ b/net/minecraft/server/EntityVillager.java
@@ -16,6 +16,16 @@
import java.util.function.BiPredicate;
@@ -18,6 +18,16 @@
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.entity.CraftVillager;
@@ -17,7 +17,7 @@
public class EntityVillager extends EntityVillagerAbstract implements ReputationHandler, VillagerDataHolder {
@@ -60,7 +70,7 @@
@@ -64,7 +74,7 @@
@Override
public BehaviorController<EntityVillager> getBehaviorController() {
@@ -26,17 +26,26 @@
}
@Override
@@ -124,7 +134,7 @@
@@ -83,7 +93,7 @@
public void b(WorldServer worldserver) {
BehaviorController<EntityVillager> behaviorcontroller = this.getBehaviorController();
- behaviorcontroller.b(worldserver, (EntityLiving) this);
+ behaviorcontroller.b(worldserver, this); // CraftBukkit - decompile error
this.bn = behaviorcontroller.h();
this.a(this.getBehaviorController());
}
@@ -133,7 +143,7 @@
@Override
protected void mobTick() {
this.world.getMethodProfiler().enter("brain");
this.world.getMethodProfiler().enter("villagerBrain");
- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this);
+ this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error
this.world.getMethodProfiler().exit();
if (!this.et() && this.bB > 0) {
--this.bB;
@@ -134,7 +144,7 @@
this.bC = false;
if (this.bM) {
this.bM = false;
@@ -147,7 +157,7 @@
this.bB = false;
}
- this.addEffect(new MobEffect(MobEffects.REGENERATION, 200, 0));
@@ -44,7 +53,7 @@
}
}
@@ -353,7 +363,14 @@
@@ -358,7 +368,14 @@
while (iterator.hasNext()) {
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
@@ -60,30 +69,39 @@
}
}
@@ -661,7 +678,12 @@
entitywitch.setCustomNameVisible(this.getCustomNameVisible());
}
@@ -387,7 +404,7 @@
@Override
public void saveData(NBTTagCompound nbttagcompound) {
super.saveData(nbttagcompound);
- DataResult dataresult = VillagerData.a.encodeStart(DynamicOpsNBT.a, this.getVillagerData());
+ DataResult<NBTBase> dataresult = VillagerData.a.encodeStart(DynamicOpsNBT.a, this.getVillagerData()); // CraftBukkit - decompile error
Logger logger = EntityVillager.LOGGER;
- this.world.addEntity(entitywitch);
+ // CraftBukkit start
+ if (CraftEventFactory.callEntityTransformEvent(this, entitywitch, EntityTransformEvent.TransformReason.LIGHTNING).isCancelled()) {
+ return;
+ }
+ this.world.addEntity(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING);
+ // CraftBukkit end
this.die();
}
logger.getClass();
@@ -695,7 +712,12 @@
}
@@ -811,7 +833,7 @@
entitywitch.setPersistent();
- this.world.addEntity(entitywitch);
+ // CraftBukkit start
+ if (CraftEventFactory.callEntityTransformEvent(this, entitywitch, EntityTransformEvent.TransformReason.LIGHTNING).isCancelled()) {
+ return;
+ }
+ this.world.addEntity(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING);
+ // CraftBukkit end
this.die();
} else {
super.onLightningStrike(entitylightning);
@@ -812,7 +834,7 @@
}
private void b(long i) {
- this.bo.setMemory(MemoryModuleType.GOLEM_LAST_SEEN_TIME, (Object) i);
+ this.bo.setMemory(MemoryModuleType.GOLEM_LAST_SEEN_TIME, i); // CraftBukkit - decompile error
- this.bn.setMemory(MemoryModuleType.GOLEM_LAST_SEEN_TIME, (Object) i);
+ this.bn.setMemory(MemoryModuleType.GOLEM_LAST_SEEN_TIME, i); // CraftBukkit - decompile error
}
private boolean c(long i) {
@@ -860,7 +882,7 @@
@@ -845,7 +867,7 @@
if (entityirongolem != null) {
if (entityirongolem.a((GeneratorAccess) this.world, EnumMobSpawn.MOB_SUMMONED) && entityirongolem.a((IWorldReader) this.world)) {
@@ -92,19 +110,21 @@
return entityirongolem;
}
@@ -922,13 +944,13 @@
@@ -923,7 +945,7 @@
@Override
public void entitySleep(BlockPosition blockposition) {
super.entitySleep(blockposition);
- this.bo.setMemory(MemoryModuleType.LAST_SLEPT, (Object) MinecraftSerializableLong.a(this.world.getTime()));
+ this.bo.setMemory(MemoryModuleType.LAST_SLEPT, MinecraftSerializableLong.a(this.world.getTime())); // CraftBukkit - decompile error
- this.bn.setMemory(MemoryModuleType.LAST_SLEPT, (Object) this.world.getTime());
+ this.bn.setMemory(MemoryModuleType.LAST_SLEPT, this.world.getTime()); // CraftBukkit - decompile error
this.bn.removeMemory(MemoryModuleType.WALK_TARGET);
this.bn.removeMemory(MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE);
}
@@ -931,7 +953,7 @@
@Override
public void entityWakeup() {
super.entityWakeup();
- this.bo.setMemory(MemoryModuleType.LAST_WOKEN, (Object) MinecraftSerializableLong.a(this.world.getTime()));
+ this.bo.setMemory(MemoryModuleType.LAST_WOKEN, MinecraftSerializableLong.a(this.world.getTime())); // CraftBukkit - decompile error
- this.bn.setMemory(MemoryModuleType.LAST_WOKEN, (Object) this.world.getTime());
+ this.bn.setMemory(MemoryModuleType.LAST_WOKEN, this.world.getTime()); // CraftBukkit - decompile error
}
private boolean d(long i) {