blob: 565b4148d70fe766c6be8f38dd2d0ec50e0bdf29 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
package gregtech.api.util;
import java.util.ArrayList;
import java.util.List;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn;
public class GT_SpawnEventHandler {
public static volatile List <int[]> mobReps = new ArrayList();
public GT_SpawnEventHandler(){
MinecraftForge.EVENT_BUS.register(this);
}
@SubscribeEvent
public void denyMobSpawn(CheckSpawn event)
{
if (event.getResult() == Event.Result.ALLOW) {return;}
if (event.entityLiving.isCreatureType(EnumCreatureType.monster, false))
{
for(int[] rep : mobReps){
if(rep[3] == event.entity.worldObj.provider.dimensionId){
TileEntity tTile = event.entity.worldObj.getTileEntity(rep[0], rep[1], rep[2]);
}
}
}
}
}
|