Update to Minecraft 1.18-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-11-22 09:00:00 +11:00
parent a852b81a69
commit 43702a9e10
700 changed files with 10286 additions and 10098 deletions

View File

@@ -14,13 +14,13 @@
+
public class EntitySlime extends EntityInsentient implements IMonster {
private static final DataWatcherObject<Integer> ID_SIZE = DataWatcher.a(EntitySlime.class, DataWatcherRegistry.INT);
private static final DataWatcherObject<Integer> ID_SIZE = DataWatcher.defineId(EntitySlime.class, DataWatcherRegistry.INT);
@@ -186,7 +194,7 @@
@Override
public EntityTypes<? extends EntitySlime> getEntityType() {
- return super.getEntityType();
+ return (EntityTypes<? extends EntitySlime>) super.getEntityType(); // CraftBukkit - decompile error
public EntityTypes<? extends EntitySlime> getType() {
- return super.getType();
+ return (EntityTypes<? extends EntitySlime>) super.getType(); // CraftBukkit - decompile error
}
@Override
@@ -35,7 +35,7 @@
+ if (!event.isCancelled() && event.getCount() > 0) {
+ k = event.getCount();
+ } else {
+ super.a(entity_removalreason);
+ super.remove(entity_removalreason);
+ return;
+ }
+ List<EntityLiving> slimes = new ArrayList<>(j);
@@ -47,20 +47,20 @@
@@ -214,8 +235,18 @@
entityslime.setInvulnerable(this.isInvulnerable());
entityslime.setSize(j, true);
entityslime.setPositionRotation(this.locX() + (double) f1, this.locY() + 0.5D, this.locZ() + (double) f2, this.random.nextFloat() * 360.0F, 0.0F);
- this.level.addEntity(entityslime);
entityslime.moveTo(this.getX() + (double) f1, this.getY() + 0.5D, this.getZ() + (double) f2, this.random.nextFloat() * 360.0F, 0.0F);
- this.level.addFreshEntity(entityslime);
+ slimes.add(entityslime); // CraftBukkit
+ }
+
+ // CraftBukkit start
+ if (CraftEventFactory.callEntityTransformEvent(this, slimes, EntityTransformEvent.TransformReason.SPLIT).isCancelled()) {
+ super.a(entity_removalreason);
+ super.remove(entity_removalreason);
+ return;
+ }
+ for (EntityLiving living : slimes) {
+ this.level.addEntity(living, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SLIME_SPLIT); // CraftBukkit - SpawnReason
+ this.level.addFreshEntity(living, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SLIME_SPLIT); // CraftBukkit - SpawnReason
}
+ // CraftBukkit end
}
super.a(entity_removalreason);
super.remove(entity_removalreason);