Lots of warning cleanup.

This commit is contained in:
Ammon Lauritzen
2016-02-24 11:31:32 -06:00
parent 59cc6b0489
commit eb08df015c
13 changed files with 84 additions and 90 deletions

View File

@@ -23,7 +23,6 @@ import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
@Mod(modid = Version.MOD_ID, version = Version.VERSION)
public class FairyFactions {
@@ -36,15 +35,13 @@ public class FairyFactions {
public static final Logger LOGGER = LogManager.getFormatterLogger(Version.MOD_ID);
private File BaseDir;
private static FairyConfig Config;
private Spawner fairySpawner;
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
BaseDir = new File(event.getModConfigurationDirectory(), Version.MOD_ID);
Config = new FairyConfig(event.getSuggestedConfigurationFile());
final File BaseDir = new File(event.getModConfigurationDirectory(), Version.MOD_ID);
@SuppressWarnings("unused")
final FairyConfig Config = new FairyConfig(event.getSuggestedConfigurationFile());
if (!BaseDir.exists())
BaseDir.mkdir();
@@ -100,6 +97,7 @@ public class FairyFactions {
public static EntityFairy getFairy(int fairyID) {
for( WorldServer dim : DimensionManager.getWorlds() ) {
if( dim != null ) {
@SuppressWarnings("unchecked")
List<Entity> entities = dim.loadedEntityList;
if( entities != null && !entities.isEmpty() ) {
for( Entity entity : entities ) {

View File

@@ -76,9 +76,9 @@ public class FairyJob {
getNearbyChest3( x, y, z, world );
}
public ArrayList getGoodies( final World world ) {
final List list = world.getEntitiesWithinAABB( EntityItem.class, fairy.boundingBox.expand( 2.5D, 2.5D, 2.5D ) );
final ArrayList list2 = new ArrayList();
public ArrayList<EntityItem> getGoodies( final World world ) {
final List<?> list = world.getEntitiesWithinAABB( EntityItem.class, fairy.boundingBox.expand( 2.5D, 2.5D, 2.5D ) );
final ArrayList<EntityItem> list2 = new ArrayList<EntityItem>();
for ( int i = 0; i < list.size(); i++ ) {
final EntityItem entity1 = (EntityItem) list.get( i );
@@ -98,14 +98,14 @@ public class FairyJob {
}
}
public ArrayList getAnimals( final World world ) {
final List list = world.getEntitiesWithinAABB( EntityAnimal.class, fairy.boundingBox.expand( 5D, 5D, 5D ) );
public ArrayList<EntityAnimal> getAnimals( final World world ) {
final List<?> list = world.getEntitiesWithinAABB( EntityAnimal.class, fairy.boundingBox.expand( 5D, 5D, 5D ) );
if ( list.size() < 2 ) {
return null;
}
final ArrayList list2 = new ArrayList();
final ArrayList<EntityAnimal> list2 = new ArrayList<EntityAnimal>();
for ( int i = 0; i < list.size(); i++ ) {
final EntityAnimal entity1 = (EntityAnimal) list.get( i );
@@ -132,14 +132,14 @@ public class FairyJob {
}
}
public ArrayList getSheep( final World world ) {
final List list = world.getEntitiesWithinAABB( EntitySheep.class, fairy.boundingBox.expand( 5D, 5D, 5D ) );
public ArrayList<EntitySheep> getSheep( final World world ) {
final List<?> list = world.getEntitiesWithinAABB( EntitySheep.class, fairy.boundingBox.expand( 5D, 5D, 5D ) );
if ( list.size() < 1 ) {
return null;
}
final ArrayList list2 = new ArrayList();
final ArrayList<EntitySheep> list2 = new ArrayList<EntitySheep>();
for ( int i = 0; i < list.size(); i++ ) {
final EntitySheep entity1 = (EntitySheep) list.get( i );
@@ -512,7 +512,7 @@ public class FairyJob {
// Attempt to breed animals
private boolean onBreedingUse( final ItemStack stack, final World world ) {
final ArrayList animals = getAnimals( world );
final ArrayList<EntityAnimal> animals = getAnimals( world );
if ( animals == null ) {
return false;
@@ -559,7 +559,7 @@ public class FairyJob {
}
private boolean onShearingUse( final ItemStack stack, final World world ) {
final ArrayList sheep = getSheep( world );
final ArrayList<EntitySheep> sheep = getSheep( world );
triedShearing = true;
if ( sheep == null ) {
@@ -669,6 +669,8 @@ public class FairyJob {
}
// Check if it's a good place to put a sapling down
@SuppressWarnings("unused")
@Deprecated
private int goodPlaceForTrees( final int x, final int y, final int z, final World world ) {
final Block i = world.getBlock( x, y, z );
@@ -939,5 +941,5 @@ public class FairyJob {
// Make sure that shearing is only attempted once per chest.
private boolean triedShearing;
// A list of items on the ground.
private ArrayList goodies;
private ArrayList<EntityItem> goodies;
}

View File

@@ -2,8 +2,6 @@ package fairies.client.gui;
import org.lwjgl.input.Keyboard;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import fairies.FairyFactions;
import fairies.entity.EntityFairy;
import net.minecraft.client.gui.GuiButton;
@@ -14,7 +12,6 @@ public class GuiName extends GuiScreen
{
protected String screenTitle;
private EntityFairy fairy;
private int updateCounter;
private String nameText;
public GuiName(EntityFairy entityfairy)
@@ -31,7 +28,8 @@ public class GuiName extends GuiScreen
}
}
@Override
@SuppressWarnings("unchecked")
@Override
public void initGui()
{
buttonList.clear();
@@ -63,8 +61,6 @@ public class GuiName extends GuiScreen
@Override
public void updateScreen()
{
updateCounter++;
if (fairy == null || fairy.isDead)
{
mc.displayGuiScreen(null);

View File

@@ -14,7 +14,8 @@ import net.minecraft.client.renderer.Tessellator;
public class FairyModelRenderer
{
public FairyModelRenderer(final ModelBase modelbase, final int i, final int j)
@SuppressWarnings("unchecked")
public FairyModelRenderer(final ModelBase modelbase, final int i, final int j)
{
field_35971_a = 64F;
field_35970_b = 32F;

View File

@@ -228,8 +228,8 @@ public class RenderFairy extends RenderLiving
{
if (Minecraft.isGuiEnabled() && fairy != renderManager.livingPlayer)
{
float f = 1.6F;
float f1 = 0.01666667F * f;
// float f = 1.6F;
// float f1 = 0.01666667F * f;
float f2 = fairy.getDistanceToEntity(renderManager.livingPlayer);
float f3 = 12F;

View File

@@ -4,8 +4,6 @@ import java.lang.reflect.Method;
import java.util.Collections;
import java.util.List;
import org.apache.logging.log4j.Logger;
import cpw.mods.fml.relauncher.ReflectionHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -64,8 +62,6 @@ import net.minecraft.world.chunk.EmptyChunk;
public class EntityFairy extends EntityAnimal {
private static final Logger LOG = FairyFactions.LOGGER;
private boolean cower;
public boolean didHearts;
public boolean didSwing;
@@ -87,7 +83,7 @@ public class EntityFairy extends EntityAnimal {
// non-persistent fields
public float sinage; // what does this mean?
private boolean flag; // flagged for what, precisely?
//private boolean flag; // flagged for what, precisely?
private boolean createGroup;
private int listActions;
public int witherTime;
@@ -138,6 +134,7 @@ public class EntityFairy extends EntityAnimal {
dataWatcher.addObject(I_TOOL, new Integer(0));
}
@SuppressWarnings("unused")
private void _dump_() {
StringBuilder sb = new StringBuilder();
sb.append(this.getEntityId());
@@ -540,7 +537,7 @@ public class EntityFairy extends EntityAnimal {
public void despawnFollowers() {
if (queen() && getFaction() > 0) {
List list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
List<?> list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
boundingBox.expand(40D, 40D, 40D));
for (int j = 0; j < list.size(); j++) {
@@ -908,7 +905,7 @@ public class EntityFairy extends EntityAnimal {
d = 16D;
}
List list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
List<?> list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
boundingBox.expand(d, d, d));
for (int j = 0; j < list.size(); j++) {
@@ -934,7 +931,7 @@ public class EntityFairy extends EntityAnimal {
}
} else if (getFaction() == 0 && tamed()) {
// Looking for a player to follow.
List list = worldObj.getEntitiesWithinAABB(EntityPlayer.class,
List<?> list = worldObj.getEntitiesWithinAABB(EntityPlayer.class,
boundingBox.expand(16D, 16D, 16D));
for (int j = 0; j < list.size(); j++) {
@@ -1025,7 +1022,7 @@ public class EntityFairy extends EntityAnimal {
} else if (queen()) {
// If a leader has lost her followers
flag = true;
List list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
List<?> list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
boundingBox.expand(40D, 40D, 40D));
for (int j = 0; j < list.size(); j++) {
@@ -1114,7 +1111,7 @@ public class EntityFairy extends EntityAnimal {
return;
}
List list = worldObj.getEntitiesWithinAABBExcludingEntity(this,
List<?> list = worldObj.getEntitiesWithinAABBExcludingEntity(this,
boundingBox.expand(16D, 16D, 16D));
Collections.shuffle(list, rand);
@@ -1218,7 +1215,7 @@ public class EntityFairy extends EntityAnimal {
}
public boolean peacefulAnimal(EntityAnimal animal) {
Class thing = animal.getClass();
Class<? extends EntityAnimal> thing = animal.getClass();
return thing == EntityPig.class || thing == EntityCow.class
|| thing == EntityChicken.class || thing == EntitySheep.class
|| thing == EntityMooshroom.class;
@@ -1253,7 +1250,7 @@ public class EntityFairy extends EntityAnimal {
}
if (entityHeal == null && healTime <= 0) {
List list = worldObj.getEntitiesWithinAABBExcludingEntity(this,
List<?> list = worldObj.getEntitiesWithinAABBExcludingEntity(this,
boundingBox.expand(16D, 16D, 16D));
for (int j = 0; j < list.size(); j++) {
@@ -1388,7 +1385,7 @@ public class EntityFairy extends EntityAnimal {
return;
}
List list = worldObj.getEntitiesWithinAABBExcludingEntity(this,
List<?> list = worldObj.getEntitiesWithinAABBExcludingEntity(this,
boundingBox.expand(16D, 16D, 16D));
Collections.shuffle(list, rand);
@@ -1489,6 +1486,7 @@ public class EntityFairy extends EntityAnimal {
}
}
@SuppressWarnings("unused")
private int postedCount; // flag for counting posted checks
// The AI method which handles post-related activities.
private void handlePosted(boolean flag) {
@@ -2600,7 +2598,7 @@ public class EntityFairy extends EntityAnimal {
public void alertFollowers(Entity entity) {
if (queen() && getFaction() > 0) {
List list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
List<?> list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
boundingBox.expand(40D, 40D, 40D));
for (int j = 0; j < list.size(); j++) {
@@ -2629,7 +2627,7 @@ public class EntityFairy extends EntityAnimal {
&& sameTeam((EntityFairy) ruler)) {
EntityFairy queen = ( (EntityFairy) ruler );
boolean flag = false;
List list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
List<?> list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
queen.boundingBox.expand(40D, 40D, 40D));
for (int j = 0; j < list.size(); j++) {
@@ -2699,7 +2697,7 @@ public class EntityFairy extends EntityAnimal {
setPathToEntity((PathEntity) null);
setSitting(true);
onGround = true;
List list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
List<?> list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
boundingBox.expand(80D, 80D, 80D));
for (int j = 0; j < list.size(); j++) {
@@ -3076,7 +3074,7 @@ public class EntityFairy extends EntityAnimal {
&& ( biome.rootHeight + biome.heightVariation ) <= 0.5F
&& biome.temperature >= 0.1F && biome.temperature <= 1.0F
&& biome.rainfall > 0.0F && biome.rainfall <= 0.8F) {
List list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
List<?> list = worldObj.getEntitiesWithinAABB(EntityFairy.class,
this.boundingBox.expand(32D, 32D, 32D));
if (( list == null || list.size() < 1 ) && !worldObj.isRemote) {

View File

@@ -7,7 +7,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
@@ -284,7 +283,7 @@ public class FairyEntityFishHook extends Entity
}
Entity var4 = null;
List var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
List<?> var5 = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.motionX, this.motionY, this.motionZ).expand(1.0D, 1.0D, 1.0D));
double var6 = 0.0D;
double var13;

View File

@@ -12,7 +12,6 @@ import fairies.Version;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.NetHandlerPlayServer;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.PacketBuffer;
public class FairyEventListener {

View File

@@ -3,7 +3,6 @@ package fairies.event;
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
import fairies.Version;
import fairies.event.FairyEventListener.PacketType;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.PacketBuffer;

View File

@@ -2,10 +2,8 @@ package fairies.event;
import java.io.IOException;
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
import fairies.FairyFactions;
import fairies.entity.EntityFairy;
import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.network.NetHandlerPlayServer;
import net.minecraft.network.NetworkManager;

View File

@@ -46,6 +46,7 @@ public class CommonProxy {
private void registerEntity( int entityID, Class<?extends Entity> entityClass, String entityName ) {
EntityRegistry.registerModEntity( entityClass, entityName, entityID, FairyFactions.INSTANCE, 64, 4, true);
}
@SuppressWarnings("unchecked")
private void registerEntity( int entityID, Class<?extends Entity> entityClass, String entityName, int backgroundEggColor, int foregroundEggColor ) {
registerEntity( entityID, entityClass, entityName );
@@ -89,6 +90,7 @@ public class CommonProxy {
eventChannel.sendToServer( packet );
}
public void sendToAllPlayers(Packet packet) {
@SuppressWarnings("unchecked")
List<EntityPlayerMP> players = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
for( EntityPlayerMP player : players ) {
player.playerNetServerHandler.sendPacket(packet);

View File

@@ -29,7 +29,7 @@ public class FairyGroupGenerator
public boolean generate(final World world, final Random rand, final int i, final int j, final int k)
{
final List list = new ArrayList();
final List<int[]> list = new ArrayList<int[]>();
int halfrad = radius / 2;
final Block cordial = world.getBlock(i, j, k);

View File

@@ -40,23 +40,23 @@ public final class Spawner {
private int maxMobs = 60;
private int maxAquatic = 10;
public BiomeGenBase standardBiomes[];
public List biomeList;
public List<String> biomeList;
public List[] entityClasses;
protected List[] customMobSpawnList;
protected List[] customCreatureSpawnList;
protected List[] customAquaticSpawnList;
private Set eligibleChunksForSpawning = new HashSet();
private Set<ChunkCoordIntPair> eligibleChunksForSpawning = new HashSet<ChunkCoordIntPair>();
private List<Class> vanillaClassList;
public Spawner() {
biomeList = new ArrayList();
biomeList = new ArrayList<String>();
try {
Field afield[] = (BiomeGenBase.class).getDeclaredFields();
LinkedList linkedlist = new LinkedList();
LinkedList<BiomeGenBase> linkedlist = new LinkedList<BiomeGenBase>();
for (int j = 0; j < afield.length; j++) {
Class class1 = afield[j].getType();
Class<?> class1 = afield[j].getType();
if ((afield[j].getModifiers() & 8) != 0 && class1.isAssignableFrom(BiomeGenBase.class)) {
BiomeGenBase biomegenbase = (BiomeGenBase) afield[j].get(null);
@@ -92,7 +92,7 @@ public final class Spawner {
if( world != null && !world.isRemote
&& world.difficultySetting.getDifficultyId() > 0
&& world.getWorldInfo().getWorldTime() % 300L == 0L ) {
final List list = world.playerEntities;
final List<?> list = world.playerEntities;
if( list != null && list.size() > 0 ) {
final int maxNum = 12 + (list.size() * 6);
this.setMaxAnimals(maxNum);
@@ -111,18 +111,18 @@ public final class Spawner {
public void clearLists() {
for (int x = 0; x < biomeList.size(); x++) {
customCreatureSpawnList[x] = new ArrayList();
customMobSpawnList[x] = new ArrayList();
customAquaticSpawnList[x] = new ArrayList();
customCreatureSpawnList[x] = new ArrayList<Object>();
customMobSpawnList[x] = new ArrayList<Object>();
customAquaticSpawnList[x] = new ArrayList<Object>();
}
for (int x = 0; x < 3; x++) {
entityClasses[x] = new ArrayList();
entityClasses[x] = new ArrayList<Object>();
}
}
// this one spawns a single mob up to max times
public final int doSpecificSpawning(World worldObj, Class myClass, int max, EnumCreatureType enumcreaturetype) {
public final int doSpecificSpawning(World worldObj, Class<?> myClass, int max, EnumCreatureType enumcreaturetype) {
// boolean flag = false;
// this initialises chunks for spawning
eligibleChunksForSpawning.clear();
@@ -144,7 +144,7 @@ public final class Spawner {
countTotal = 0;
ChunkCoordinates chunkcoordspawn = worldObj.getSpawnPoint();
Iterator iterator = eligibleChunksForSpawning.iterator();
Iterator<ChunkCoordIntPair> iterator = eligibleChunksForSpawning.iterator();
label113:
while (iterator.hasNext()) {
@@ -224,6 +224,7 @@ public final class Spawner {
}
// regular spawning with list
@SuppressWarnings("unchecked")
public final int doCustomSpawning(World worldObj, boolean spawnMobs, boolean spawnAnmls) {
if (!spawnMobs && !spawnAnmls) {
return 0;
@@ -260,7 +261,7 @@ public final class Spawner {
// /
// 256))
{
Iterator iterator = eligibleChunksForSpawning.iterator();
Iterator<ChunkCoordIntPair> iterator = eligibleChunksForSpawning.iterator();
label113:
while (iterator.hasNext()) {
@@ -271,21 +272,21 @@ public final class Spawner {
// chunk is at
// i.e. forest,
// etc
List listspawns = getCustomBiomeSpawnList(getCustomSpawnableList(enumcreaturetype),
List<?> listspawns = getCustomBiomeSpawnList(getCustomSpawnableList(enumcreaturetype),
biomegenbase);
if (listspawns != null && !listspawns.isEmpty()) {
int var13 = 0;
SpawnListEntry spawnlistentry;
for (Iterator iteratorB = listspawns.iterator(); iteratorB
for (Iterator<?> iteratorB = listspawns.iterator(); iteratorB
.hasNext(); var13 += spawnlistentry.itemWeight) {
spawnlistentry = (SpawnListEntry) iteratorB.next();
}
int var40 = worldObj.rand.nextInt(var13);
spawnlistentry = (SpawnListEntry) listspawns.get(0);
Iterator iteratorC = listspawns.iterator();
Iterator<?> iteratorC = listspawns.iterator();
while (iteratorC.hasNext()) {
SpawnListEntry spawnlistentryA = (SpawnListEntry) iteratorC.next();
@@ -300,7 +301,7 @@ public final class Spawner {
int max = spawnlistentry.maxGroupCount;
if (max > 0) {
Class class1 = spawnlistentry.entityClass;
Class<?> class1 = spawnlistentry.entityClass;
if (class1 != null && (max > countEntities(class1, worldObj))) {
continue label113;
@@ -389,29 +390,30 @@ public final class Spawner {
}
}
public void AddCustomSpawn(Class class1, int i, int max, EnumCreatureType enumcreaturetype) {
public void AddCustomSpawn(Class<?> class1, int i, int max, EnumCreatureType enumcreaturetype) {
AddCustomSpawn(class1, i, -1, max, enumcreaturetype, null);
}
public void AddCustomSpawn(Class class1, int i, EnumCreatureType enumcreaturetype) {
public void AddCustomSpawn(Class<?> class1, int i, EnumCreatureType enumcreaturetype) {
AddCustomSpawn(class1, i, -1, -1, enumcreaturetype, null);
}
public void AddCustomSpawn(Class class1, int i, int max, EnumCreatureType enumcreaturetype,
public void AddCustomSpawn(Class<?> class1, int i, int max, EnumCreatureType enumcreaturetype,
BiomeGenBase abiomegenbase[]) {
AddCustomSpawn(class1, i, -1, max, enumcreaturetype, abiomegenbase);
}
public void AddCustomSpawn(Class class1, int i, EnumCreatureType enumcreaturetype, BiomeGenBase abiomegenbase[]) {
public void AddCustomSpawn(Class<?> class1, int i, EnumCreatureType enumcreaturetype, BiomeGenBase abiomegenbase[]) {
AddCustomSpawn(class1, i, -1, -1, enumcreaturetype, abiomegenbase);
}
// this one adds spawn where biome is not specified
public void AddCustomSpawn(Class class1, int i, int j, int k, EnumCreatureType enumcreaturetype) {
public void AddCustomSpawn(Class<?> class1, int i, int j, int k, EnumCreatureType enumcreaturetype) {
AddCustomSpawn(class1, i, j, k, enumcreaturetype, null);
}
public void AddCustomSpawn(Class class1, int i, int j, int k, EnumCreatureType enumcreaturetype,
@SuppressWarnings("unchecked")
public void AddCustomSpawn(Class<?> class1, int i, int j, int k, EnumCreatureType enumcreaturetype,
BiomeGenBase abiomegenbase[]) {
if (class1 == null) {
throw new IllegalArgumentException("entityClass cannot be null");
@@ -429,9 +431,9 @@ public final class Spawner {
{
boolean flag = false;
for (Iterator iterator = entityClasses[x1].iterator(); iterator.hasNext();) {
for (Iterator<?> iterator = entityClasses[x1].iterator(); iterator.hasNext();) {
if (iterator != null) {
Class class2 = (Class) iterator.next();
Class<?> class2 = (Class<?>) iterator.next();
if (class2 == class1) {
flag = true;
@@ -452,7 +454,7 @@ public final class Spawner {
int x = biomeList.indexOf(abiomegenbase[l].biomeName);
boolean flag = false;
for (Iterator iterator = fulllist[x].iterator(); iterator.hasNext();) {
for (Iterator<?> iterator = fulllist[x].iterator(); iterator.hasNext();) {
if (iterator != null) {
SpawnListEntry spawnlistentry = (SpawnListEntry) iterator.next();
@@ -473,11 +475,11 @@ public final class Spawner {
}
}
public void RemoveCustomSpawn(Class class1, EnumCreatureType enumcreaturetype) {
public void RemoveCustomSpawn(Class<?> class1, EnumCreatureType enumcreaturetype) {
RemoveCustomSpawn(class1, enumcreaturetype, null);
}
public void RemoveCustomSpawn(Class class1, EnumCreatureType enumcreaturetype, BiomeGenBase abiomegenbase[]) {
public void RemoveCustomSpawn(Class<?> class1, EnumCreatureType enumcreaturetype, BiomeGenBase abiomegenbase[]) {
if (class1 == null) {
throw new IllegalArgumentException("entityClass cannot be null");
}
@@ -496,7 +498,7 @@ public final class Spawner {
if (fulllist != null) {
int x = biomeList.indexOf(abiomegenbase[l].biomeName);
for (Iterator iterator = fulllist[x].iterator(); iterator.hasNext();) {
for (Iterator<?> iterator = fulllist[x].iterator(); iterator.hasNext();) {
if (iterator != null) {
SpawnListEntry spawnlistentry = (SpawnListEntry) iterator.next();
@@ -529,11 +531,11 @@ public final class Spawner {
int i = getEnumIndex(enumcreaturetype);
int finalcount = 0;
if( i > -1 ) {
boolean flag = false;
// boolean flag = false;
for (Iterator iterator = entityClasses[i].iterator(); iterator.hasNext();) {
for (Iterator<?> iterator = entityClasses[i].iterator(); iterator.hasNext();) {
if (iterator != null) {
Class class1 = (Class) iterator.next();
Class<?> class1 = (Class<?>) iterator.next();
if (class1 != null) {
finalcount += world.countEntities(class1);
@@ -560,7 +562,7 @@ public final class Spawner {
}
}
private List getCustomBiomeSpawnList(List[] fulllist, BiomeGenBase biomegenbase) {
private List<?> getCustomBiomeSpawnList(List[] fulllist, BiomeGenBase biomegenbase) {
int x = biomeList.indexOf(biomegenbase.biomeName);
if (x >= 0) {
@@ -615,7 +617,7 @@ public final class Spawner {
if (enumcreaturetype.getCreatureMaterial() == Material.water) {
final Block block = world.getBlock(i, j, k);
final Block blockAbove = world.getBlock(i, j + 1, k);
// final Block blockAbove = world.getBlock(i, j + 1, k);
return block.getMaterial().isLiquid() && !block.isNormalCube();
} else {
@@ -665,7 +667,7 @@ public final class Spawner {
return 0;
}
public final int countEntities(Class class1, World worldObj) {
public final int countEntities(Class<?> class1, World worldObj) {
int i = 0;
for (int j = 0; j < worldObj.loadedEntityList.size(); j++) {
@@ -710,7 +712,7 @@ public final class Spawner {
}
public final int despawnMob(World worldObj, Class... classList) {
List<Class> myList = new ArrayList();
List<Class> myList = new ArrayList<Class>();
for (int i = 0; i < classList.length; i++) {
myList.add(classList[i]);
@@ -733,9 +735,9 @@ public final class Spawner {
continue;
}
for (Iterator iterator = classList.iterator(); iterator.hasNext();) {
for (Iterator<Class> iterator = classList.iterator(); iterator.hasNext();) {
if (iterator != null) {
Class class2 = (Class) iterator.next();
Class<?> class2 = (Class<?>) iterator.next();
if (class2 == entity.getClass()) {
count += entityDespawnCheck(worldObj, (EntityLiving) entity);
@@ -747,7 +749,7 @@ public final class Spawner {
return count;
}
public final int despawnMobWithMinimum(World worldObj, Class class1, int minimum) {
public final int despawnMobWithMinimum(World worldObj, Class<?> class1, int minimum) {
int killedcount = 0;
int mobcount = countEntities(class1, worldObj);