mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Exploit fix, turning spawned pigs into zombie pigmans using lightning stike allows you gain XP
This commit is contained in:
parent
dcd79e87e1
commit
34447ef874
@ -31,6 +31,7 @@ import org.bukkit.event.entity.EntityTameEvent;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||
import org.bukkit.event.entity.PigZapEvent;
|
||||
import org.bukkit.event.entity.PotionSplashEvent;
|
||||
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -702,4 +703,13 @@ public class EntityListener implements Listener {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onPigZapEvent(PigZapEvent event)
|
||||
{
|
||||
if (event.getEntity().hasMetadata(mcMMO.entityMetadataKey))
|
||||
{
|
||||
event.getPigZombie().setMetadata(mcMMO.entityMetadataKey, mcMMO.metadataValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user