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