@@ -14,7 +14,7 @@
|
||||
|
||||
public class EntitySlime extends EntityInsentient implements IMonster {
|
||||
|
||||
@@ -153,7 +160,7 @@
|
||||
@@ -147,7 +154,7 @@
|
||||
|
||||
@Override
|
||||
public EntityTypes<? extends EntitySlime> getEntityType() {
|
||||
@@ -23,16 +23,16 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -163,6 +170,19 @@
|
||||
if (!this.world.isClientSide && i > 1 && this.getHealth() <= 0.0F) {
|
||||
int j = 2 + this.random.nextInt(3);
|
||||
@@ -161,6 +168,19 @@
|
||||
int j = i / 2;
|
||||
int k = 2 + this.random.nextInt(3);
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ SlimeSplitEvent event = new SlimeSplitEvent((org.bukkit.entity.Slime) this.getBukkitEntity(), j);
|
||||
+ SlimeSplitEvent event = new SlimeSplitEvent((org.bukkit.entity.Slime) this.getBukkitEntity(), k);
|
||||
+ this.world.getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (!event.isCancelled() && event.getCount() > 0) {
|
||||
+ j = event.getCount();
|
||||
+ k = event.getCount();
|
||||
+ } else {
|
||||
+ super.die();
|
||||
+ return;
|
||||
@@ -40,15 +40,14 @@
|
||||
+ List<EntityLiving> slimes = new ArrayList<>(j);
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
for (int k = 0; k < j; ++k) {
|
||||
float f = ((float) (k % 2) - 0.5F) * (float) i / 4.0F;
|
||||
float f1 = ((float) (k / 2) - 0.5F) * (float) i / 4.0F;
|
||||
@@ -179,8 +199,18 @@
|
||||
for (int l = 0; l < k; ++l) {
|
||||
float f1 = ((float) (l % 2) - 0.5F) * f;
|
||||
float f2 = ((float) (l / 2) - 0.5F) * f;
|
||||
@@ -175,8 +195,17 @@
|
||||
entityslime.setInvulnerable(this.isInvulnerable());
|
||||
entityslime.setSize(i / 2, true);
|
||||
entityslime.setPositionRotation(this.locX() + (double) f, this.locY() + 0.5D, this.locZ() + (double) f1, this.random.nextFloat() * 360.0F, 0.0F);
|
||||
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.world.addEntity(entityslime);
|
||||
+
|
||||
+ slimes.add(entityslime); // CraftBukkit
|
||||
+ }
|
||||
+
|
||||
|
||||
Reference in New Issue
Block a user