fix: egg not respawning when dropped in the void if egg_inv is true

This commit is contained in:
HerozDotExe 2026-02-17 21:50:08 +01:00
parent 1ddf48d6ba
commit bf50a33b32

View file

@ -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);
}
}