Reset Ender Crystals on Dragon Spawn

Crystals can end up in a bad state in certain conditions which causes
an exception on the expected number of crystals going negative.

This ensures the crystals/pillars are in expected state when the dragon spawns.

See #3522
This commit is contained in:
Aikar 2016-06-01 23:29:17 -04:00
parent 1d8508b7ac
commit c760673958

View file

@ -32,7 +32,15 @@
this.dragonUUID = null;
}
}
@@ -513,7 +519,7 @@
@@ -469,6 +475,7 @@
entityenderdragon.moveTo((double) this.origin.getX(), (double) (128 + this.origin.getY()), (double) this.origin.getZ(), this.level.random.nextFloat() * 360.0F, 0.0F);
this.level.addFreshEntity(entityenderdragon);
this.dragonUUID = entityenderdragon.getUUID();
+ this.resetSpikeCrystals(); // Paper - Reset ender crystals on dragon spawn
}
return entityenderdragon;
@@ -513,7 +520,7 @@
return this.previouslyKilled;
}
@ -41,7 +49,7 @@
if (this.dragonKilled && this.respawnStage == null) {
BlockPos blockposition = this.portalLocation;
@@ -540,19 +546,19 @@
@@ -540,19 +547,19 @@
List<EndCrystal> list1 = this.level.getEntitiesOfClass(EndCrystal.class, new AABB(blockposition1.relative(enumdirection, 2)));
if (list1.isEmpty()) {
@ -65,7 +73,7 @@
if (this.dragonKilled && this.respawnStage == null) {
for (BlockPattern.BlockPatternMatch shapedetector_shapedetectorcollection = this.findExitPortal(); shapedetector_shapedetectorcollection != null; shapedetector_shapedetectorcollection = this.findExitPortal()) {
for (int i = 0; i < this.exitPortalPattern.getWidth(); ++i) {
@@ -571,9 +577,10 @@
@@ -571,9 +578,10 @@
this.respawnStage = DragonRespawnAnimation.START;
this.respawnTime = 0;
this.spawnExitPortal(false);