Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-19 04:50:06 +01:00
Added Spawner Egg support to CreatureSpawnEvent.
Dieser Commit ist enthalten in:
Ursprung
54e45b7d66
Commit
4d563342ba
@ -18,12 +18,13 @@ public class ItemMonsterEgg extends Item {
|
|||||||
Entity entity = EntityTypes.a(itemstack.getData(), world);
|
Entity entity = EntityTypes.a(itemstack.getData(), world);
|
||||||
|
|
||||||
if (entity != null && entity instanceof EntityLiving) { // CraftBukkit
|
if (entity != null && entity instanceof EntityLiving) { // CraftBukkit
|
||||||
|
|
||||||
if (!entityhuman.abilities.canInstantlyBuild) {
|
if (!entityhuman.abilities.canInstantlyBuild) {
|
||||||
--itemstack.count;
|
--itemstack.count;
|
||||||
}
|
}
|
||||||
|
|
||||||
entity.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F);
|
entity.setPositionRotation((double) i + 0.5D, (double) j, (double) k + 0.5D, 0.0F, 0.0F);
|
||||||
world.addEntity(entity);
|
world.addEntity(entity, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SPAWNER_EGG); // CraftBukkit
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren