fix: egg not respawning when dropped in the void if egg_inv is true
This commit is contained in:
parent
1ddf48d6ba
commit
bf50a33b32
1 changed files with 5 additions and 22 deletions
|
|
@ -47,24 +47,7 @@ public class EventScheduler extends BukkitRunnable {
|
|||
Location respawnLoc = data.getEggEntity().getLocation();
|
||||
Egg.removeEgg(data.getEggEntity());
|
||||
|
||||
if (config.getEggInvulnerable()) {
|
||||
// get coords for egg to spawn at
|
||||
//get highest block
|
||||
Block highestBlock = respawnLoc.getWorld().getHighestBlockAt(respawnLoc);
|
||||
int yPos = highestBlock.getY()+1;
|
||||
|
||||
//if no highest block, default to sea level
|
||||
if (highestBlock.isEmpty()) {
|
||||
yPos = respawnLoc.getWorld().getSeaLevel();
|
||||
}
|
||||
respawnLoc.setY(yPos);
|
||||
EggController.spawnEggItem(respawnLoc, config, data); //do not need to update data with this location since item spawn event will be called
|
||||
data.resetEggOwner(true, config);
|
||||
} else {
|
||||
//alert and respawn if applicable
|
||||
EggController.eggDestroyed(config, data, logger);
|
||||
}
|
||||
|
||||
EggController.eggDestroyed(config, data, logger);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue