Begin code cleanup for generics, types, warnings, nulls, and spelling

This commit is contained in:
mezz committed 2016-02-25 19:11:29 -08:00
1 parent c9b2f7bd3e
commit 406392e7f7
98 files changed
+472 -314

No files matched your search

@@ -25,7 +25,7 @@ public class BeeManager {
/**
* List of items that can induce swarming. Integer denotes x in 1000 chance.
*/
public static HashMap<ItemStack, Integer> inducers = new HashMap<ItemStack, Integer>();
public static HashMap<ItemStack, Integer> inducers = new HashMap<>();
/**
* Convenient access to AlleleManager.alleleRegistry.getSpeciesRoot("rootBees")
@@ -44,7 +44,7 @@ public enum EnumBeeChromosome implements IChromosomeType {
*/
TEMPERATURE_TOLERANCE(IAlleleTolerance.class),
/**
* Slightly incorrectly named. If true, a naturally dirunal bee can work during the night. If true, a naturally nocturnal bee can work during the day.
* Slightly incorrectly named. If true, a naturally diurnal bee can work during the night. If true, a naturally nocturnal bee can work during the day.
*/
NOCTURNAL(IAlleleBoolean.class),
/**
@@ -81,15 +81,15 @@ public enum EnumBeeChromosome implements IChromosomeType {
*/
EFFECT(IAlleleBeeEffect.class);
Class<? extends IAllele> clss;
private final Class<? extends IAllele> alleleClass;
EnumBeeChromosome(Class<? extends IAllele> clss) {
this.clss = clss;
EnumBeeChromosome(Class<? extends IAllele> alleleClass) {
this.alleleClass = alleleClass;
}
@Override
public Class<? extends IAllele> getAlleleClass() {
return clss;
return alleleClass;
}
@Override
@@ -5,6 +5,8 @@
******************************************************************************/
package forestry.api.apiculture;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List;
import java.util.Set;
@@ -26,12 +28,14 @@ public interface IBee extends IIndividualLiving {
/**
* @return Bee's genetic information.
*/
@Nonnull
@Override
IBeeGenome getGenome();
/**
* @return Genetic information of the bee's mate, null if unmated.
*/
@Nullable
@Override
IBeeGenome getMate();
@@ -7,13 +7,14 @@ package forestry.api.apiculture.hives;
import java.util.List;
import forestry.api.apiculture.IHiveDrop;
import net.minecraft.util.IStringSerializable;
import forestry.api.apiculture.IHiveDrop;
public interface IHiveRegistry {
/* Forestry Hive Names */
public static enum HiveType implements IStringSerializable{
enum HiveType implements IStringSerializable {
FOREST("Forestry:forest"),
MEADOWS("Forestry:meadows"),
DESERT("Forestry:desert"),
@@ -22,11 +23,11 @@ public interface IHiveRegistry {
SNOW("Forestry:snow"),
SWAMP("Forestry:swamp");
private HiveType(String name) {
HiveType(String name) {
this.name = name;
}
public String name;
private final String name;
public String getHiveName()
{