mirror of
https://github.com/shansen/EggCatcher.git
synced 2024-11-26 12:05:45 +01:00
Caught pigs with saddles will now drop their saddle.
This commit is contained in:
parent
1e2170db6a
commit
1934aa4bf9
@ -248,6 +248,7 @@ public class EggCatcherEntityListener implements Listener {
|
||||
}
|
||||
|
||||
ItemStack eggStack = new ItemStack(383, 1, eggType.getCreatureId());
|
||||
|
||||
String customName = ((LivingEntity) entity).getCustomName();
|
||||
|
||||
if (customName != null) {
|
||||
@ -257,6 +258,12 @@ public class EggCatcherEntityListener implements Listener {
|
||||
eggStack.setItemMeta(meta);
|
||||
}
|
||||
|
||||
if(entity instanceof Pig) {
|
||||
if(((Pig)entity).hasSaddle()) {
|
||||
entity.getWorld().dropItem(entity.getLocation(), new ItemStack(329, 1));
|
||||
}
|
||||
}
|
||||
|
||||
entity.getWorld().dropItem(entity.getLocation(), eggStack);
|
||||
|
||||
if (!this.spawnChickenOnSuccess) {
|
||||
|
Loading…
Reference in New Issue
Block a user