Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package theishiopian.sandbox.handler;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.util.EnumParticleTypes;
- import net.minecraftforge.event.entity.living.LivingSpawnEvent;
- import net.minecraftforge.fml.common.eventhandler.Event.Result;
- import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
- import theishiopian.sandbox.world.ScarecrowTracking;
- public class SpawnHandler
- {
- @SubscribeEvent
- public void spawnHandler(LivingSpawnEvent.CheckSpawn event)
- {
- if((!(event.getEntity() instanceof EntityPlayer))&&(!(event.getWorld().isRemote)))
- {
- if(ScarecrowTracking.get(event.getWorld()).inRange(event.getEntity()))event.setResult(Result.DENY);
- event.getWorld().spawnParticle(EnumParticleTypes.SMOKE_NORMAL, true, event.getX(), event.getY(), event.getZ(), 0, 0, 0, new int[0]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement