Updated to support new relationship system
package com.matt.forgehax.mods;
+import com.matt.forgehax.util.common.PriorityEnum;
import com.matt.forgehax.util.entity.EntityUtils;
+import com.matt.forgehax.util.entity.mobtypes.MobType;
+import com.matt.forgehax.util.entity.mobtypes.MobTypeEnum;
+import com.matt.forgehax.util.entity.mobtypes.MobTypeRegistry;
import com.matt.forgehax.util.mod.ToggleMod;
import com.matt.forgehax.util.mod.loader.RegisterMod;
+import net.minecraft.entity.Entity;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.init.SoundEvents;
import net.minecraftforge.client.event.RenderLivingEvent;
@@ -11,17 +16,36 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@RegisterMod
public class AntiBatsMod extends ToggleMod {
+ private static final MobType BATS_MOBTYPE = new MobType() {
+ @Override
+ protected PriorityEnum getPriority() {
+ return PriorityEnum.LOW;
+ }
+
+ @Override
+ public boolean isMobType(Entity entity) {
+ return entity instanceof EntityBat;
+ }
+
+ @Override
+ protected MobTypeEnum getMobTypeUnchecked(Entity entity) {
+ return MobTypeEnum.INVALID;
+ }
+ };
+
public AntiBatsMod() {
super("AntiBats", false, "666 KILL BATS 666");
}
@Override
public void onEnabled() {
+ MobTypeRegistry.register(BATS_MOBTYPE);
EntityUtils.isBatsDisabled = true;
}
@Override
public void onDisabled() {
+ MobTypeRegistry.unregister(BATS_MOBTYPE);
EntityUtils.isBatsDisabled = false;
}
