mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 05:47:45 +01:00
Fix nerfed slime when splitting
This commit is contained in:
parent
b656aa3c21
commit
2ff5ce988f
@ -55,7 +55,7 @@
|
||||
int i = this.getSize();
|
||||
|
||||
if (!this.level().isClientSide && i > 1 && this.isDeadOrDying()) {
|
||||
@@ -211,18 +232,45 @@
|
||||
@@ -211,18 +232,46 @@
|
||||
int k = 2 + this.random.nextInt(3);
|
||||
PlayerTeam scoreboardteam = this.getTeam();
|
||||
|
||||
@ -78,6 +78,7 @@
|
||||
|
||||
- this.convertTo(this.getType(), new ConversionParams(ConversionType.SPLIT_ON_DEATH, false, false, scoreboardteam), EntitySpawnReason.TRIGGERED, (entityslime) -> {
|
||||
+ Slime converted = this.convertTo(this.getType(), new ConversionParams(ConversionType.SPLIT_ON_DEATH, false, false, scoreboardteam), EntitySpawnReason.TRIGGERED, (entityslime) -> { // CraftBukkit
|
||||
+ entityslime.aware = this.aware; // Paper - Fix nerfed slime when splitting
|
||||
entityslime.setSize(j, true);
|
||||
entityslime.moveTo(this.getX() + (double) f2, this.getY() + 0.5D, this.getZ() + (double) f3, this.random.nextFloat() * 360.0F, 0.0F);
|
||||
- });
|
||||
@ -87,7 +88,7 @@
|
||||
+ slimes.add(converted);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
+ }
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callEntityTransformEvent(this, slimes, EntityTransformEvent.TransformReason.SPLIT).isCancelled()) {
|
||||
+ super.remove(entity_removalreason, cause); // CraftBukkit - add Bukkit remove cause
|
||||
@ -95,7 +96,7 @@
|
||||
+ }
|
||||
+ for (LivingEntity living : slimes) {
|
||||
+ this.level().addFreshEntity(living, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SLIME_SPLIT); // CraftBukkit - SpawnReason
|
||||
+ }
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
@ -104,7 +105,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -300,7 +348,7 @@
|
||||
@@ -300,7 +349,7 @@
|
||||
}
|
||||
|
||||
ChunkPos chunkcoordintpair = new ChunkPos(pos);
|
||||
@ -113,7 +114,7 @@
|
||||
|
||||
if (random.nextInt(10) == 0 && flag && pos.getY() < 40) {
|
||||
return checkMobSpawnRules(type, world, spawnReason, pos, random);
|
||||
@@ -432,7 +480,7 @@
|
||||
@@ -432,7 +481,7 @@
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
@ -122,7 +123,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -469,7 +517,15 @@
|
||||
@@ -469,7 +518,15 @@
|
||||
public boolean canUse() {
|
||||
LivingEntity entityliving = this.slime.getTarget();
|
||||
|
||||
@ -139,7 +140,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -482,7 +538,15 @@
|
||||
@@ -482,7 +539,15 @@
|
||||
public boolean canContinueToUse() {
|
||||
LivingEntity entityliving = this.slime.getTarget();
|
||||
|
||||
@ -156,7 +157,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -505,6 +569,13 @@
|
||||
@@ -505,6 +570,13 @@
|
||||
}
|
||||
|
||||
}
|
||||
@ -170,7 +171,7 @@
|
||||
}
|
||||
|
||||
private static class SlimeRandomDirectionGoal extends Goal {
|
||||
@@ -520,7 +591,7 @@
|
||||
@@ -520,7 +592,7 @@
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
@ -179,7 +180,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -528,6 +599,11 @@
|
||||
@@ -528,6 +600,11 @@
|
||||
if (--this.nextRandomizeTime <= 0) {
|
||||
this.nextRandomizeTime = this.adjustedTickDelay(40 + this.slime.getRandom().nextInt(60));
|
||||
this.chosenDegrees = (float) this.slime.getRandom().nextInt(360);
|
||||
@ -191,7 +192,7 @@
|
||||
}
|
||||
|
||||
MoveControl controllermove = this.slime.getMoveControl();
|
||||
@@ -550,7 +626,7 @@
|
||||
@@ -550,7 +627,7 @@
|
||||
|
||||
@Override
|
||||
public boolean canUse() {
|
||||
@ -200,7 +201,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -563,4 +639,15 @@
|
||||
@@ -563,4 +640,15 @@
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user