Created
December 31, 2019 19:53
-
-
Save czaux/2bc0b9fdef62ae37953fc6db6dfa8bf0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SubscribeEvent | |
public void EnteringChunk(net.minecraftforge.event.entity.EntityEvent.EnteringChunk event) { | |
if(KMCFConfig.Stop_Cellien_Spawns) { | |
if(event.getEntity() instanceof EntityPlayer) return; | |
if(event.getEntity() instanceof EntityLivingBase) { | |
Entity aa = event.getEntity(); | |
String name = aa.getName(); | |
if(name.indexOf("Cellien") != -1) { | |
//TODO: Probably match mod name but can't find how to do that. | |
switch(name) { | |
case "Cellien": | |
case "Red Cellien": | |
case "Big Cellien": | |
case "Big Red Cellien": { | |
this.handleCellienSpawn(aa); | |
} | |
default: {} | |
} | |
} | |
} | |
} | |
} | |
private void handleCellienSpawn(Entity entity) { | |
if(KMCFConfig.Stop_Cellien_Spawns) { | |
entity.setInvisible(true); | |
entity.setSilent(true); | |
World world = entity.getEntityWorld(); | |
world.removeEntity(entity); | |
KMCFMod.logger.info("removed cellien"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment