net.minecraft.entity.passive.EntityBat Java Examples

The following examples show how to use net.minecraft.entity.passive.EntityBat. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MoCreatures.java    From mocreaturesdev with GNU General Public License v3.0 6 votes vote down vote up
public static void ClearVanillaSpawnLists()
{
    for (int i = 0; i < BiomeGenBase.biomeList.length; i++)
    {
        if (BiomeGenBase.biomeList[i] != null)
        {
            EntityRegistry.removeSpawn(EntityCow.class, EnumCreatureType.creature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityPig.class, EnumCreatureType.creature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySheep.class, EnumCreatureType.creature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityChicken.class, EnumCreatureType.creature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityWolf.class, EnumCreatureType.creature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySquid.class, EnumCreatureType.waterCreature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityOcelot.class, EnumCreatureType.creature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityBat.class, EnumCreatureType.ambient, BiomeGenBase.biomeList[i]);
        }
    }
}
 
Example #2
Source File: HackableHandler.java    From PneumaticCraft with GNU General Public License v3.0 6 votes vote down vote up
public static void addDefaultEntries(){
    PneumaticRegistry.getInstance().addHackable(Blocks.tnt, HackableTNT.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.mob_spawner, HackableMobSpawner.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.lever, HackableLever.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.stone_button, HackableButton.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.wooden_button, HackableButton.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.wooden_door, HackableDoor.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.tripwire_hook, HackableTripwire.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.dispenser, HackableDispenser.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.dropper, HackableDispenser.class);
    PneumaticRegistry.getInstance().addHackable(Blockss.securityStation, HackableSecurityStation.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.monster_egg, HackableTripwire.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.noteblock, HackableNoteblock.class);
    PneumaticRegistry.getInstance().addHackable(Blocks.jukebox, HackableJukebox.class);

    PneumaticRegistry.getInstance().addHackable(EntityCreeper.class, HackableCreeper.class);
    PneumaticRegistry.getInstance().addHackable(EntityTameable.class, HackableTameable.class);
    PneumaticRegistry.getInstance().addHackable(EntityCow.class, HackableCow.class);
    PneumaticRegistry.getInstance().addHackable(EntityCaveSpider.class, HackableCaveSpider.class);
    PneumaticRegistry.getInstance().addHackable(EntityBlaze.class, HackableBlaze.class);
    PneumaticRegistry.getInstance().addHackable(EntityGhast.class, HackableGhast.class);
    PneumaticRegistry.getInstance().addHackable(EntityWitch.class, HackableWitch.class);
    PneumaticRegistry.getInstance().addHackable(EntityLiving.class, HackableLivingDisarm.class);
    PneumaticRegistry.getInstance().addHackable(EntityEnderman.class, HackableEnderman.class);
    PneumaticRegistry.getInstance().addHackable(EntityBat.class, HackableBat.class);
}
 
Example #3
Source File: EntityBatMetaProvider.java    From OpenPeripheral-Integration with MIT License 5 votes vote down vote up
@Override
public Object getMeta(EntityBat target, Vec3 relativePos) {
	Map<String, Object> map = Maps.newHashMap();

	map.put("isHanging", target.getIsBatHanging());

	return map;
}
 
Example #4
Source File: CustomSpawner.java    From mocreaturesdev with GNU General Public License v3.0 5 votes vote down vote up
public CustomSpawner()
{
    biomeList = new ArrayList<BiomeGenBase>();
    log.setParent(FMLLog.getLogger());
    try
    {
        for (BiomeGenBase biomegenbase : BiomeGenBase.biomeList)
        {
            if (biomegenbase == null)
            {
                continue;
            }
            biomeList.add(biomegenbase);
        }

        customCreatureSpawnList = new List[biomeList.size()];
        customMobSpawnList = new List[biomeList.size()];
        customAmbientSpawnList = new List[biomeList.size()];
        customAquaticSpawnList = new List[biomeList.size()];
        entityClasses = new List[4];
        vanillaClassList = new ArrayList<Class>();
        vanillaClassList.add(EntityChicken.class);
        vanillaClassList.add(EntityCow.class);
        vanillaClassList.add(EntityPig.class);
        vanillaClassList.add(EntitySheep.class);
        vanillaClassList.add(EntityWolf.class);
        vanillaClassList.add(EntitySquid.class);
        vanillaClassList.add(EntityOcelot.class);
        vanillaClassList.add(EntityBat.class);
        clearLists();
    }
    catch (Exception ex)
    {
        throw new RuntimeException(ex);
    }
}
 
Example #5
Source File: EntityUtils.java    From LiquidBounce with GNU General Public License v3.0 4 votes vote down vote up
public static boolean isAnimal(final Entity entity) {
    return entity instanceof EntityAnimal || entity instanceof EntitySquid || entity instanceof EntityGolem ||
            entity instanceof EntityBat;
}
 
Example #6
Source File: CraftBat.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
public CraftBat(CraftServer server, EntityBat entity) {
    super(server, entity);
}
 
Example #7
Source File: CraftBat.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
@Override
public EntityBat getHandle() {
    return (EntityBat) entity;
}
 
Example #8
Source File: AntiBatsMod.java    From ForgeHax with MIT License 4 votes vote down vote up
@Override
public boolean isMobType(Entity entity) {
  return entity instanceof EntityBat;
}
 
Example #9
Source File: AntiBatsMod.java    From ForgeHax with MIT License 4 votes vote down vote up
@SubscribeEvent
public void onRenderLiving(RenderLivingEvent.Pre<?> event) {
  if (event.getEntity() instanceof EntityBat) {
    event.setCanceled(true);
  }
}
 
Example #10
Source File: CivilizationHandlers.java    From ToroQuest with GNU General Public License v3.0 4 votes vote down vote up
private int getRepuationAdjustmentFor(EntityLivingBase victim, Province province) {

		if (province == null || province.civilization == null) {
			return 0;
		}

		if (victim instanceof EntityFugitive) {
			return 5;
		}

		if (victim.getClass().getName().equals("net.minecraft.entity.passive.EntityVillager")) {
			return -10;
		}

		if (isHostileMob(victim)) {
			return 1;
		}

		if (victim instanceof EntityToroNpc) {
			CivilizationType npcCiv = ((EntityToroNpc) victim).getCivilization();

			int amount = 0;

			if (npcCiv == null) {
				amount = -1;
			} else if (npcCiv.equals(province.civilization)) {
				amount = -10;
			} else {
				amount = 10;
			}

			if (victim instanceof EntityVillageLord) {
				amount *= 10;
			}

			return amount;
		}

		if (victim instanceof EntityBat) {
			return 0;
		}

		if (ToroQuestConfiguration.animalsAffectRep && isAnimal(victim)) {
			return -1;
		} else {
			return 0;
		}

	}
 
Example #11
Source File: CraftBat.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
public CraftBat(CraftServer server, EntityBat entity) {
    super(server, entity);
}
 
Example #12
Source File: CraftBat.java    From Thermos with GNU General Public License v3.0 4 votes vote down vote up
@Override
public EntityBat getHandle() {
    return (EntityBat) entity;
}
 
Example #13
Source File: HackableBat.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean canHack(Entity entity, EntityPlayer player){
    return entity.getClass() == EntityBat.class;
}