Code Cleanup -- Optional

This commit is contained in:
CDAGaming 2017-10-30 19:06:00 -05:00
parent 124aa77d06
commit 05a805eb46
98 changed files with 314 additions and 325 deletions

View File

@ -23,22 +23,22 @@ public interface IHornHarvestable {
* Returns true if this block can be uprooted.
* Note that the stack param can be null if it's a drum breaking it.
*/
public boolean canHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType);
boolean canHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType);
/**
* Returns true if harvestByHorn() should be called. If false it just uses the normal
* block breaking method.
* Note that the stack param can be null if it's a drum breaking it.
*/
public boolean hasSpecialHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType);
boolean hasSpecialHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType);
/**
* Called to harvest by a horn.
* Note that the stack param can be null if it's a drum breaking it.
*/
public void harvestByHorn(World world, BlockPos pos, ItemStack stack, EnumHornType hornType);
void harvestByHorn(World world, BlockPos pos, ItemStack stack, EnumHornType hornType);
public static enum EnumHornType {
enum EnumHornType {
/**
* Horn of the Wild, for grass and crops
@ -60,6 +60,6 @@ public interface IHornHarvestable {
return values[Math.min(values.length - 1, meta)];
}
};
}
}

View File

@ -147,10 +147,10 @@ public class BOPBiomes
return instance;
}
public static interface IBiomeRegistry
public interface IBiomeRegistry
{
public IExtendedBiome registerBiome(IExtendedBiome biome, String idName);
public IExtendedBiome getExtendedBiome(Biome biome);
public ImmutableSet<Biome> getPresentBiomes();
IExtendedBiome registerBiome(IExtendedBiome biome, String idName);
IExtendedBiome getExtendedBiome(Biome biome);
ImmutableSet<Biome> getPresentBiomes();
}
}

View File

@ -10,5 +10,5 @@ package biomesoplenty.api.biome;
public enum BiomeOwner
{
BIOMESOPLENTY, OTHER;
BIOMESOPLENTY, OTHER
}

View File

@ -21,19 +21,19 @@ import net.minecraft.world.biome.Biome;
public interface IExtendedBiome
{
public void applySettings(IBOPWorldSettings settings);
public void configure(IConfigObj conf);
void applySettings(IBOPWorldSettings settings);
void configure(IConfigObj conf);
public BiomeOwner getBiomeOwner();
public void addGenerator(String name, GeneratorStage stage, IGenerator generator);
public IGenerationManager getGenerationManager();
public Map<BOPClimates, Integer> getWeightMap();
public void clearWeights();
public void addWeight(BOPClimates climate, int weight);
BiomeOwner getBiomeOwner();
void addGenerator(String name, GeneratorStage stage, IGenerator generator);
IGenerationManager getGenerationManager();
Map<BOPClimates, Integer> getWeightMap();
void clearWeights();
void addWeight(BOPClimates climate, int weight);
public ResourceLocation getBeachLocation();
ResourceLocation getBeachLocation();
/**Get the base biome associated with this extension**/
public Biome getBaseBiome();
public ResourceLocation getResourceLocation();
Biome getBaseBiome();
ResourceLocation getResourceLocation();
}

View File

@ -13,5 +13,5 @@ import net.minecraft.world.World;
// for queries on a particular block position in the world
public interface IBlockPosQuery
{
public boolean matches(World world, BlockPos pos);
boolean matches(World world, BlockPos pos);
}

View File

@ -11,10 +11,10 @@ public interface IBOPWorldSettings
{
boolean isEnabled(GeneratorType type);
public static enum GeneratorType
enum GeneratorType
{
GEMS, SOILS, TREES, GRASSES, FOLIAGE, FLOWERS, PLANTS, WATER_PLANTS, MUSHROOMS,
ROCK_FORMATIONS, POISON_IVY, BERRY_BUSHES, THORNS, QUICKSAND, LIQUID_POISON, HOT_SPRINGS,
NETHER_HIVES, END_FEATURES;
NETHER_HIVES, END_FEATURES
}
}

View File

@ -18,62 +18,62 @@ import net.minecraft.util.ResourceLocation;
public interface IConfigObj
{
public JsonElement serializeDefaults();
public void addMessage(String message);
public void addMessage(String extraPrefix, String message);
public List<String> flushMessages();
public boolean isEmpty();
public boolean has(String name);
public Set<String> getKeys();
JsonElement serializeDefaults();
void addMessage(String message);
void addMessage(String extraPrefix, String message);
List<String> flushMessages();
boolean isEmpty();
boolean has(String name);
Set<String> getKeys();
public IConfigObj getObject(String name);
public ArrayList<IConfigObj> getObjectArray(String name);
public IConfigObj getObject(String name, boolean warnIfMissing);
public ArrayList<IConfigObj> getObjectArray(String name, boolean warnIfMissing);
IConfigObj getObject(String name);
ArrayList<IConfigObj> getObjectArray(String name);
IConfigObj getObject(String name, boolean warnIfMissing);
ArrayList<IConfigObj> getObjectArray(String name, boolean warnIfMissing);
// Use the methods below when you want to obtain a value from a config file, if it is present, but you have a default value to use if it isn't
// No warning messages will be logged using these methods if the value is missing
public Boolean getBool(String name, Boolean defaultVal);
public String getString(String name, String defaultVal);
public Integer getInt(String name, Integer defaultVal);
public Float getFloat(String name, Float defaultVal);
public IBlockState getBlockState(String name, IBlockState defaultVal);
public IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal);
public ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal);
public <E extends Enum> E getEnum(String name, E defaultVal, Class<E> clazz);
Boolean getBool(String name, Boolean defaultVal);
String getString(String name, String defaultVal);
Integer getInt(String name, Integer defaultVal);
Float getFloat(String name, Float defaultVal);
IBlockState getBlockState(String name, IBlockState defaultVal);
IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal);
ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal);
<E extends Enum> E getEnum(String name, E defaultVal, Class<E> clazz);
// Use the methods below when you want to obtain a value from a config file which SHOULD be present
// If the value is missing, a warning message is logged, and null is returned
public Boolean getBool(String name);
public String getString(String name);
public Integer getInt(String name);
public Float getFloat(String name);
public IBlockState getBlockState(String name);
public IBlockPosQuery getBlockPosQuery(String name);
public ResourceLocation getResourceLocation(String name);
public <E extends Enum> E getEnum(String name, Class<E> clazz);
Boolean getBool(String name);
String getString(String name);
Integer getInt(String name);
Float getFloat(String name);
IBlockState getBlockState(String name);
IBlockPosQuery getBlockPosQuery(String name);
ResourceLocation getResourceLocation(String name);
<E extends Enum> E getEnum(String name, Class<E> clazz);
// Use the methods below when you want to obtain an array of values from a config file, if it is present, but you have a default value to use if it isn't
// No warning messages will be logged using these methods if the value is missing
public ArrayList<Boolean> getBoolArray(String name, ArrayList<Boolean> defaultVal);
public ArrayList<String> getStringArray(String name, ArrayList<String> defaultVal);
public ArrayList<Integer> getIntArray(String name, ArrayList<Integer> defaultVal);
public ArrayList<Float> getFloatArray(String name, ArrayList<Float> defaultVal);
public ArrayList<IBlockState> getBlockStateArray(String name, ArrayList<IBlockState> defaultVal);
public ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name, ArrayList<IBlockPosQuery> defaultVal);
public ArrayList<ResourceLocation> getResourceLocationArray(String name, ArrayList<ResourceLocation> defaultVal);
public <E extends Enum> ArrayList<E> getEnumArray(String name, ArrayList<E> defaultVal, Class<E> clazz);
ArrayList<Boolean> getBoolArray(String name, ArrayList<Boolean> defaultVal);
ArrayList<String> getStringArray(String name, ArrayList<String> defaultVal);
ArrayList<Integer> getIntArray(String name, ArrayList<Integer> defaultVal);
ArrayList<Float> getFloatArray(String name, ArrayList<Float> defaultVal);
ArrayList<IBlockState> getBlockStateArray(String name, ArrayList<IBlockState> defaultVal);
ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name, ArrayList<IBlockPosQuery> defaultVal);
ArrayList<ResourceLocation> getResourceLocationArray(String name, ArrayList<ResourceLocation> defaultVal);
<E extends Enum> ArrayList<E> getEnumArray(String name, ArrayList<E> defaultVal, Class<E> clazz);
// Use the methods below when you want to obtain an array of values from a config file which SHOULD be present
// If the value is missing, a warning message is logged, and null is returned
public ArrayList<Boolean> getBoolArray(String name);
public ArrayList<String> getStringArray(String name);
public ArrayList<Integer> getIntArray(String name);
public ArrayList<Float> getFloatArray(String name);
public ArrayList<IBlockState> getBlockStateArray(String name);
public ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name);
public ArrayList<ResourceLocation> getResourceLocationArray(String name);
public <E extends Enum> ArrayList<E> getEnumArray(String name, Class<E> clazz);
ArrayList<Boolean> getBoolArray(String name);
ArrayList<String> getStringArray(String name);
ArrayList<Integer> getIntArray(String name);
ArrayList<Float> getFloatArray(String name);
ArrayList<IBlockState> getBlockStateArray(String name);
ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name);
ArrayList<ResourceLocation> getResourceLocationArray(String name);
<E extends Enum> ArrayList<E> getEnumArray(String name, Class<E> clazz);
}

View File

@ -31,7 +31,7 @@ public enum BOPClimates {
private ArrayList<WeightedBiomeEntry> landBiomes = new ArrayList<WeightedBiomeEntry>();
private BOPClimates(BiomeType biomeType)
BOPClimates(BiomeType biomeType)
{
this.biomeType = biomeType;
}

View File

@ -23,4 +23,4 @@ public enum BOPGems implements IStringSerializable
{
return this.getName();
}
};
}

View File

@ -24,7 +24,7 @@ public abstract class BOPGeneratorBase extends WorldGenerator implements IGenera
protected BOPGeneratorBase(float amountPerChunk)
{
this.identifier = Generators.registry.getIdentifier((Class<? extends IGenerator>)this.getClass());
this.identifier = Generators.registry.getIdentifier(this.getClass());
if (this.identifier == null)
{

View File

@ -68,7 +68,7 @@ public enum GeneratorStage
private Decorate.EventType decorateType;
private GeneratorStage(Decorate.EventType decorateType)
GeneratorStage(Decorate.EventType decorateType)
{
this.decorateType = decorateType;
}

View File

@ -16,25 +16,25 @@ import net.minecraft.world.World;
public interface IGenerator
{
public void scatter(World world, Random random, BlockPos pos);
public boolean generate(World world, Random random, BlockPos pos);
void scatter(World world, Random random, BlockPos pos);
boolean generate(World world, Random random, BlockPos pos);
public void setStage(GeneratorStage stage);
public void setName(String name);
void setStage(GeneratorStage stage);
void setName(String name);
/**
* A unique name used to classify the purpose of a generator. For example, emeralds and ruby use the
* same generator (and thus, have the same identifier) but have differing names.
*/
public String getName();
String getName();
/**The identifier for this generator should be consistent across all instances of the same type*/
public String getIdentifier();
public GeneratorStage getStage();
String getIdentifier();
GeneratorStage getStage();
public static interface IGeneratorBuilder<T extends IGenerator>
interface IGeneratorBuilder<T extends IGenerator>
{
public T create();
T create();
}
public void configure(IConfigObj conf);
void configure(IConfigObj conf);
}

View File

@ -2,5 +2,5 @@ package biomesoplenty.api.particle;
public enum BOPParticleTypes
{
PIXIETRAIL, MUD, PLAYER_TRAIL;
PIXIETRAIL, MUD, PLAYER_TRAIL
}

View File

@ -76,7 +76,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
}
}
private static enum Actions
private enum Actions
{
PREVIOUS (301),
NEXT (302),
@ -87,7 +87,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
private int id;
private Actions(int id)
Actions(int id)
{
this.id = id;
}
@ -166,7 +166,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
}
private static enum GuiEntries
private enum GuiEntries
{
TEMP_SCHEME (101),
GENERATE_BOP_GEMS (102),
@ -201,7 +201,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
private int id;
private GuiEntries(int id)
GuiEntries(int id)
{
this.id = id;
}
@ -318,7 +318,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
case HEIGHT_SCALE:
case UPPER_LIMIT_SCALE:
case LOWER_LIMIT_SCALE:
return String.format("%5.3f", new Object[] {Float.valueOf(value)});
return String.format("%5.3f", Float.valueOf(value));
default:
return "";
}
@ -474,14 +474,12 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
@Override
public void handleStringSelection(int fieldId, String value)
{
;
}
@Override
public void handleIntSelection(int fieldId, int value)
{
;
}
@ -583,7 +581,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
{
this.prevButton.enabled = this.pageManager.getActivePage().pageNumber != 0;
this.nextButton.enabled = this.pageManager.getActivePage().pageNumber != this.pageManager.getNumPages() - 1;
this.pageInfo = I18n.format("book.pageIndicator", new Object[] {Integer.valueOf(this.pageManager.getActivePage().pageNumber + 1), Integer.valueOf(this.pageManager.getNumPages())});
this.pageInfo = I18n.format("book.pageIndicator", Integer.valueOf(this.pageManager.getActivePage().pageNumber + 1), Integer.valueOf(this.pageManager.getNumPages()));
this.page0Title = this.pageNames[this.pageManager.getActivePage().pageNumber];
}
@ -678,9 +676,9 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
bufferBuilder.pos((double)(this.width / 2 + 90), 100.0D, 0.0D).tex(5.625D, 0.0D).color(64, 64, 64, 64).endVertex();
bufferBuilder.pos((double)(this.width / 2 - 90), 100.0D, 0.0D).tex(0.0D, 0.0D).color(64, 64, 64, 64).endVertex();
tessellator.draw();
this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirmTitle", new Object[0]), this.width / 2, 105, 16777215);
this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm1", new Object[0]), this.width / 2, 125, 16777215);
this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm2", new Object[0]), this.width / 2, 135, 16777215);
this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirmTitle"), this.width / 2, 105, 16777215);
this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm1"), this.width / 2, 125, 16777215);
this.drawCenteredString(this.fontRenderer, I18n.format("createWorld.customize.custom.confirm2"), this.width / 2, 135, 16777215);
this.yesButton.drawButton(this.mc, mouseX, mouseY, partialTicks);
this.noButton.drawButton(this.mc, mouseX, mouseY, partialTicks);
}

View File

@ -372,7 +372,7 @@ public abstract class GuiBOPPageList extends GuiBOPPageDelegate
public EditBoxEntry(int fieldId, String labelText, boolean isVisible, Predicate validator)
{
super(fieldId, labelText, isVisible);
this.validator = (Predicate) MoreObjects.firstNonNull(validator, Predicates.alwaysTrue());
this.validator = MoreObjects.firstNonNull(validator, Predicates.alwaysTrue());
}
public Predicate getValidator()

View File

@ -131,8 +131,8 @@ public class GuiBOPPageTable extends GuiBOPPageList
{
GuiBOPPageList.GuiFieldEntry guilistentryLeft = this.fields[i];
GuiBOPPageList.GuiFieldEntry guilistentryRight = i < this.fields.length - 1 ? this.fields[i + 1] : null;
Gui guiLeft = (Gui)this.fieldIdToGuiMap.get(guilistentryLeft.getFieldId());
Gui guiRight = guilistentryRight != null ? (Gui)this.fieldIdToGuiMap.get(guilistentryRight.getFieldId()) : null;
Gui guiLeft = this.fieldIdToGuiMap.get(guilistentryLeft.getFieldId());
Gui guiRight = guilistentryRight != null ? this.fieldIdToGuiMap.get(guilistentryRight.getFieldId()) : null;
GuiBOPPageList.GuiRowEntry guientry = new GuiBOPPageList.GuiRowEntry(guiLeft, guiRight);
this.allRows.add(guientry);
}
@ -147,7 +147,7 @@ public class GuiBOPPageTable extends GuiBOPPageList
@Override
public Gui getGui(int fieldId)
{
return (Gui)this.fieldIdToGuiMap.get(fieldId);
return this.fieldIdToGuiMap.get(fieldId);
}
@ -156,23 +156,23 @@ public class GuiBOPPageTable extends GuiBOPPageList
{
if (field instanceof GuiBOPPageList.GuiSlideEntry)
{
return (Gui)this.createSlider(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiSlideEntry)field);
return this.createSlider(this.width / 2 - 155 + xOffset, 0, (GuiSlideEntry)field);
}
else if (field instanceof GuiBOPPageList.GuiButtonEntry)
{
return (Gui)this.createListButton(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiButtonEntry)field);
return this.createListButton(this.width / 2 - 155 + xOffset, 0, (GuiButtonEntry)field);
}
else if (field instanceof GuiBOPPageList.EditBoxEntry)
{
return (Gui)this.createTextField(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.EditBoxEntry)field);
return this.createTextField(this.width / 2 - 155 + xOffset, 0, (EditBoxEntry)field);
}
else if (field instanceof GuiBOPPageList.GuiLabelEntry)
{
return (Gui)this.createLabel(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiLabelEntry)field, hasNoNeighbor);
return this.createLabel(this.width / 2 - 155 + xOffset, 0, (GuiLabelEntry)field, hasNoNeighbor);
}
else if (field instanceof GuiBOPPageList.GuiEnumButtonEntry)
{
return (Gui)this.createEnumButton(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiEnumButtonEntry)field);
return this.createEnumButton(this.width / 2 - 155 + xOffset, 0, (GuiEnumButtonEntry)field);
}
else
{
@ -268,7 +268,7 @@ public class GuiBOPPageTable extends GuiBOPPageList
++focusedGuiIndex; //Cycle forwards through the text fields
}
this.focusedGui = (Gui)this.allTextFieldGuis.get(focusedGuiIndex);
this.focusedGui = this.allTextFieldGuis.get(focusedGuiIndex);
guitextfield = (GuiTextField)this.focusedGui;
guitextfield.setFocused(true);
int k1 = guitextfield.y + this.slotHeight;
@ -300,7 +300,7 @@ public class GuiBOPPageTable extends GuiBOPPageList
for (int i1 = 0; i1 < l; ++i1)
{
String s1 = astring1[i1];
((GuiTextField)this.allTextFieldGuis.get(k)).setText(s1);
this.allTextFieldGuis.get(k).setText(s1);
if (k == this.allTextFieldGuis.size() - 1)
{
@ -322,7 +322,7 @@ public class GuiBOPPageTable extends GuiBOPPageList
public GuiBOPPageList.GuiRowEntry getRow(int rowNum)
{
return (GuiBOPPageList.GuiRowEntry)this.allRows.get(rowNum);
return this.allRows.get(rowNum);
}
@Override

View File

@ -24,7 +24,7 @@ public class GuiEnumButton<T extends Enum> extends GuiButton
private String buildDisplayString()
{
return I18n.format(this.localizationStr, new Object[] {this.value.toString()});
return I18n.format(this.localizationStr, this.value.toString());
}
public void setValue(T value)

View File

@ -43,7 +43,7 @@ public class EntityPixieTrailFX extends Particle
this.particleScale *= par14;
this.particleMaxAge = (int)((8.0D / (Math.random() * 0.8D + 0.2D)) * 8);
this.particleMaxAge = (int)((float)this.particleMaxAge * par14);
this.particleAge = (particleMaxAge / 2) + (int)((particleMaxAge / 2) * world.rand.nextInt(7));
this.particleAge = (particleMaxAge / 2) + (particleMaxAge / 2) * world.rand.nextInt(7);
this.particleAlpha = 1.0F;
this.particleRed = 1.0F;
this.particleGreen = 1.0F;

View File

@ -19,7 +19,7 @@ public class ForgeRedirectedResourcePack extends FMLFileResourcePack
{
super(container);
this.bopResourcePack = (IResourcePack)FMLClientHandler.instance().getResourcePackFor(BiomesOPlenty.MOD_ID);
this.bopResourcePack = FMLClientHandler.instance().getResourcePackFor(BiomesOPlenty.MOD_ID);
}
@Override

View File

@ -16,6 +16,6 @@ public class TextureUtils
public static ResourceLocation completeResourceLocation(ResourceLocation location, int mode)
{
return mode == 0 ? new ResourceLocation(location.getResourceDomain(), String.format("%s/%s%s", new Object[] {TEXTURES_BASE_PATH, location.getResourcePath(), ".png"})) : new ResourceLocation(location.getResourceDomain(), String.format("%s/mipmaps/%s.%d%s", new Object[] {TEXTURES_BASE_PATH, location.getResourcePath(), Integer.valueOf(mode), ".png"}));
return mode == 0 ? new ResourceLocation(location.getResourceDomain(), String.format("%s/%s%s", TEXTURES_BASE_PATH, location.getResourcePath(), ".png")) : new ResourceLocation(location.getResourceDomain(), String.format("%s/mipmaps/%s.%d%s", TEXTURES_BASE_PATH, location.getResourcePath(), Integer.valueOf(mode), ".png"));
}
}

View File

@ -36,7 +36,7 @@ import net.minecraft.world.biome.Biome.SpawnListEntry;
public class BiomeGenAlps extends BOPOverworldBiome
{
public static enum AlpsType {ALPS, ALPS_FOOTHILLS}
public enum AlpsType {ALPS, ALPS_FOOTHILLS}
public AlpsType type;

View File

@ -51,7 +51,7 @@ import net.minecraft.world.chunk.ChunkPrimer;
public class BiomeGenMountain extends BOPOverworldBiome
{
public static enum MountainType {MOUNTAIN, MOUNTAIN_FOOTHILLS}
public enum MountainType {MOUNTAIN, MOUNTAIN_FOOTHILLS}
public MountainType type;
public IBlockState grassBlock;

View File

@ -79,7 +79,7 @@ public class BlockBOPAsh extends BlockBOPGeneric
{
if (random.nextInt(2) == 0)
{
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + random.nextFloat(), pos.getY() + 1.1F, pos.getZ() + random.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + random.nextFloat(), pos.getY() + 1.1F, pos.getZ() + random.nextFloat(), 0.0D, 0.0D, 0.0D);
}
}

View File

@ -34,7 +34,7 @@ public class BlockBOPBamboo extends BlockBOPDecoration
// add properties
public static final PropertyInteger AGE = PropertyInteger.create("age", 0, 15);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { AGE });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, AGE);}
public BlockBOPBamboo()
@ -104,7 +104,7 @@ public class BlockBOPBamboo extends BlockBOPDecoration
@Override
public int getMetaFromState(IBlockState state)
{
return ((Integer)state.getValue(AGE)).intValue();
return state.getValue(AGE).intValue();
}
@Override
@ -128,7 +128,7 @@ public class BlockBOPBamboo extends BlockBOPDecoration
{
if (this.checkAndDropBlock(worldIn, pos, state) && worldIn.isAirBlock(pos.up()))
{
int age = ((Integer)state.getValue(AGE)).intValue();
int age = state.getValue(AGE).intValue();
int treeHeight = 1;
while (worldIn.getBlockState(pos.down(treeHeight)).getBlock() == this) {++treeHeight;}

View File

@ -48,7 +48,6 @@ public class BlockBOPBiomeBlock extends BlockBOPGeneric
biomesWithEssence = new ArrayList<Biome>();
List<Biome> vanillaBiomesToExclude = Arrays.asList(
new Biome[] {
Biomes.DEFAULT,
Biomes.SKY,
Biomes.HELL,
@ -96,9 +95,7 @@ public class BlockBOPBiomeBlock extends BlockBOPGeneric
Biomes.MUTATED_TAIGA_COLD,
Biomes.REDWOOD_TAIGA_HILLS,
Biomes.SAVANNA_PLATEAU,
Biomes.TAIGA_HILLS
}
);
Biomes.TAIGA_HILLS);
for (Biome biome : BiomeUtils.getRegisteredBiomes())
{

View File

@ -24,7 +24,7 @@ import net.minecraft.world.World;
public class BlockBOPCoral extends BlockBOPDecoration
{
public static enum CoralType implements IStringSerializable
public enum CoralType implements IStringSerializable
{
PINK, ORANGE, BLUE, GLOWING, ALGAE;
@Override
@ -37,10 +37,11 @@ public class BlockBOPCoral extends BlockBOPDecoration
{
return this.getName();
}
};
}
public static PropertyEnum VARIANT = PropertyEnum.create("variant", CoralType.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { LEVEL, VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, LEVEL, VARIANT);}
// implement IBOPBlock
@Override

View File

@ -59,12 +59,7 @@ public class BlockBOPCrystal extends Block implements IBOPBlock
public boolean canEntityDestroy(IBlockState state, IBlockAccess world, BlockPos pos, Entity entity)
{
//Prevent the ender dragon from destroying this block
if (entity instanceof EntityDragon)
{
return false;
}
return true;
return !(entity instanceof EntityDragon);
}
@Override

View File

@ -37,7 +37,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockBOPDirt extends Block implements IBOPBlock, ISustainsPlantType
{
// add properties
public static enum BOPDirtType implements IStringSerializable, IPagedVariants
public enum BOPDirtType implements IStringSerializable, IPagedVariants
{
LOAMY, SANDY, SILTY;
@Override
@ -50,11 +50,12 @@ public class BlockBOPDirt extends Block implements IBOPBlock, ISustainsPlantType
{
return this.getName();
}
};
}
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BOPDirtType.class);
public static final PropertyBool COARSE = PropertyBool.create("coarse");
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { COARSE, VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, COARSE, VARIANT);}
// implement IBOPBlock
@Override

View File

@ -28,7 +28,7 @@ import net.minecraft.world.World;
public class BlockBOPDoubleDecoration extends BlockBOPDecoration {
// add half property
public static enum Half implements IStringSerializable
public enum Half implements IStringSerializable
{
LOWER, UPPER;
@Override
@ -41,10 +41,11 @@ public class BlockBOPDoubleDecoration extends BlockBOPDecoration {
{
return this.getName();
}
};
}
public static final PropertyEnum HALF = PropertyEnum.create("half", Half.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { HALF });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, HALF);}
@Override
public IProperty[] getNonRenderingProperties() { return null; }

View File

@ -42,7 +42,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockBOPDoublePlant extends BlockBOPDoubleDecoration implements IShearable
{
// add properties (note we inherit HALF from BlockDoubleDecoration)
public static enum DoublePlantType implements IStringSerializable
public enum DoublePlantType implements IStringSerializable
{
FLAX, TALL_CATTAIL, EYEBULB;
@Override
@ -55,10 +55,11 @@ public class BlockBOPDoublePlant extends BlockBOPDoubleDecoration implements ISh
{
return this.getName();
}
};
}
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", DoublePlantType.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { HALF, VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, HALF, VARIANT);}
// implement IBOPBlock
@ -72,7 +73,7 @@ public class BlockBOPDoublePlant extends BlockBOPDoubleDecoration implements ISh
return ((DoublePlantType) state.getValue(VARIANT)).getName();
}
public enum ColoringType {PLAIN, LIKE_LEAVES, LIKE_GRASS};
public enum ColoringType {PLAIN, LIKE_LEAVES, LIKE_GRASS}
public static ColoringType getColoringType(DoublePlantType plant)
{

View File

@ -72,7 +72,7 @@ public class BlockBOPDoubleWoodSlab extends BlockSlab implements IBOPBlock
protected BlockStateContainer createBlockState()
{
this.variantProperty = currentVariantProperty; // get from static variable
return new BlockStateContainer(this, new IProperty[] { HALF, this.variantProperty });
return new BlockStateContainer(this, HALF, this.variantProperty);
}
// implement IBOPBlock

View File

@ -62,7 +62,7 @@ public class BlockBOPFarmland extends BlockFarmland implements IBOPBlock
protected BlockStateContainer createBlockState()
{
this.variantProperty = currentVariantProperty;
return new BlockStateContainer(this, new IProperty[] { MOISTURE, this.variantProperty });
return new BlockStateContainer(this, MOISTURE, this.variantProperty);
}
@Override

View File

@ -77,7 +77,7 @@ public class BlockBOPFlower extends BlockBOPDecoration implements IShearable, IH
protected BlockStateContainer createBlockState()
{
this.variantProperty = currentVariantProperty; // get from static variable
return new BlockStateContainer(this, new IProperty[] { this.variantProperty });
return new BlockStateContainer(this, this.variantProperty);
}
@ -220,16 +220,16 @@ public class BlockBOPFlower extends BlockBOPDecoration implements IShearable, IH
{
case DEATHBLOOM:
if (rand.nextInt(4) != 0)
world.spawnParticle(EnumParticleTypes.TOWN_AURA, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.TOWN_AURA, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D);
if (rand.nextInt(4) == 0)
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D);
break;
case BURNING_BLOSSOM:
if (rand.nextInt(2) == 0)
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D);
if (rand.nextInt(4) == 0)
world.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.FLAME, pos.getX() + rand.nextFloat(), pos.getY() + rand.nextFloat(), pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D);
break;
default:

View File

@ -28,7 +28,7 @@ public class BlockBOPGem extends Block implements IBOPBlock
// add properties
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BOPGems.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);}
// implement IBOPBlock

View File

@ -38,7 +38,7 @@ public class BlockBOPGemOre extends Block implements IBOPBlock
// add properties (note VARIANT is imported statically from the BlockGem class)
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);}
// implement IBOPBlock

View File

@ -49,7 +49,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockBOPGrass extends BlockGrass implements IBOPBlock, ISustainsPlantType
{
// add properties (note we also inherit the SNOWY property from BlockGrass)
public static enum BOPGrassType implements IStringSerializable
public enum BOPGrassType implements IStringSerializable
{
SPECTRAL_MOSS, OVERGROWN_STONE, LOAMY, SANDY, SILTY, ORIGIN, OVERGROWN_NETHERRACK, DAISY, MYCELIAL_NETHERRACK;
@Override
@ -62,10 +62,11 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock, ISustainsPla
{
return this.getName();
}
};
}
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", BOPGrassType.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { SNOWY, VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, SNOWY, VARIANT);}
// implement IBOPBlock
@ -466,7 +467,7 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock, ISustainsPla
{
if (rand.nextInt(10) == 0)
{
world.spawnParticle(EnumParticleTypes.TOWN_AURA, (double)((float)pos.getX() + rand.nextFloat()), (double)((float)pos.getY() + 1.1F), (double)((float)pos.getZ() + rand.nextFloat()), 0.0D, 0.0D, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.TOWN_AURA, (double)((float)pos.getX() + rand.nextFloat()), (double)((float)pos.getY() + 1.1F), (double)((float)pos.getZ() + rand.nextFloat()), 0.0D, 0.0D, 0.0D);
}
}
}

View File

@ -47,7 +47,7 @@ public class BlockBOPGrassPath extends BlockGrassPath implements IBOPBlock
protected BlockStateContainer createBlockState()
{
this.variantProperty = currentVariantProperty;
return new BlockStateContainer(this, new IProperty[] { this.variantProperty });
return new BlockStateContainer(this, this.variantProperty);
}
@Override

View File

@ -42,7 +42,7 @@ public class BlockBOPHalfOtherSlab extends BlockSlab implements IBOPBlock
{
// add properties
public static enum SlabType implements IStringSerializable
public enum SlabType implements IStringSerializable
{
MUD_BRICK, WHITE_SANDSTONE;
@Override
@ -73,12 +73,12 @@ public class BlockBOPHalfOtherSlab extends BlockSlab implements IBOPBlock
}
return state;
}
};
}
// add properties (note we inherit HALF property from parent BlockSlab)
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", SlabType.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { HALF, VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, HALF, VARIANT);}
// implement IBOPBlock

View File

@ -71,7 +71,7 @@ public class BlockBOPHalfWoodSlab extends BlockSlab implements IBOPBlock
protected BlockStateContainer createBlockState()
{
this.variantProperty = currentVariantProperty; // get from static variable
return new BlockStateContainer(this, new IProperty[] { HALF, this.variantProperty });
return new BlockStateContainer(this, HALF, this.variantProperty);
}
// implement IBOPBlock

View File

@ -37,7 +37,7 @@ public class BlockBOPHive extends Block implements IBOPBlock
{
// add properties
public static enum HiveType implements IStringSerializable
public enum HiveType implements IStringSerializable
{
HIVE, HONEYCOMB, EMPTY_HONEYCOMB, FILLED_HONEYCOMB;
@Override
@ -50,10 +50,11 @@ public class BlockBOPHive extends Block implements IBOPBlock
{
return this.getName();
}
};
}
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", HiveType.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);}
// implement IBOPBlock

View File

@ -82,7 +82,7 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock
protected BlockStateContainer createBlockState()
{
this.variantProperty = currentVariantProperty; // get from static variable
return new BlockStateContainer(this, new IProperty[] { CHECK_DECAY, DECAYABLE, this.variantProperty });
return new BlockStateContainer(this, CHECK_DECAY, DECAYABLE, this.variantProperty);
}
@ -106,7 +106,7 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock
}
}
public enum ColoringType {PLAIN, TINTED, OVERLAY};
public enum ColoringType {PLAIN, TINTED, OVERLAY}
public static ColoringType getColoringType(BOPTrees tree)
{
@ -174,11 +174,11 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock
{
BOPTrees tree = (BOPTrees) state.getValue(this.variantProperty);
int meta = paging.getIndex(tree);
if (!((Boolean)state.getValue(DECAYABLE)).booleanValue())
if (!state.getValue(DECAYABLE).booleanValue())
{
meta |= 4;
}
if (((Boolean)state.getValue(CHECK_DECAY)).booleanValue())
if (state.getValue(CHECK_DECAY).booleanValue())
{
meta |= 8;
}

View File

@ -32,7 +32,7 @@ public class BlockBOPLilypad extends BlockLilyPad implements IBOPBlock
{
// add properties
public static enum LilypadType implements IStringSerializable
public enum LilypadType implements IStringSerializable
{
MEDIUM, SMALL, TINY, FLOWER;
@Override
@ -45,10 +45,11 @@ public class BlockBOPLilypad extends BlockLilyPad implements IBOPBlock
{
return this.getName();
}
};
}
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", LilypadType.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);}
// implement IBOPBlock

View File

@ -63,7 +63,7 @@ public class BlockBOPLog extends BlockLog implements IBOPBlock
protected BlockStateContainer createBlockState()
{
this.variantProperty = currentVariantProperty; // get from static variable
return new BlockStateContainer(this, new IProperty[] { LOG_AXIS, this.variantProperty });
return new BlockStateContainer(this, LOG_AXIS, this.variantProperty);
}
@ -114,7 +114,7 @@ public class BlockBOPLog extends BlockLog implements IBOPBlock
public int getMetaFromState(IBlockState state)
{
BOPWoods wood = (BOPWoods) state.getValue(this.variantProperty);
return ((BlockLog.EnumAxis) state.getValue(LOG_AXIS)).ordinal() * 4 + paging.getIndex(wood);
return state.getValue(LOG_AXIS).ordinal() * 4 + paging.getIndex(wood);
}
// discard the axis information - otherwise logs facing different directions would not stack together

View File

@ -45,7 +45,7 @@ public class BlockBOPMud extends Block implements IBOPBlock, ISustainsPlantType
protected static final AxisAlignedBB MUD_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 1.0D, 0.875D, 1.0D);
// add properties
public static enum MudType implements IStringSerializable
public enum MudType implements IStringSerializable
{
MUD;
@Override
@ -58,10 +58,11 @@ public class BlockBOPMud extends Block implements IBOPBlock, ISustainsPlantType
{
return this.getName();
}
};
}
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", MudType.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);}
// implement IBOPBlock

View File

@ -29,7 +29,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockBOPMushroom extends BlockBOPDecoration
{
// add properties
public static enum MushroomType implements IStringSerializable
public enum MushroomType implements IStringSerializable
{
TOADSTOOL, PORTOBELLO, BLUE_MILK_CAP, GLOWSHROOM, FLAT_MUSHROOM, SHADOW_SHROOM;
@Override
@ -42,10 +42,11 @@ public class BlockBOPMushroom extends BlockBOPDecoration
{
return this.getName();
}
};
}
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", MushroomType.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);}
// implement IBOPBlock
@ -98,7 +99,7 @@ public class BlockBOPMushroom extends BlockBOPDecoration
@Override
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
{
MushroomType plant = (MushroomType) state.getValue(this.VARIANT);
MushroomType plant = (MushroomType) state.getValue(VARIANT);
switch (plant)
{
case GLOWSHROOM: case SHADOW_SHROOM:

View File

@ -60,7 +60,7 @@ public class BlockBOPPlanks extends Block implements IBOPBlock
protected BlockStateContainer createBlockState()
{
this.variantProperty = currentVariantProperty; // get from static variable
return new BlockStateContainer(this, new IProperty[] { this.variantProperty });
return new BlockStateContainer(this, this.variantProperty);
}

View File

@ -91,7 +91,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo
protected BlockStateContainer createBlockState()
{
this.variantProperty = currentVariantProperty; // get from static variable
return new BlockStateContainer(this, new IProperty[] { this.variantProperty });
return new BlockStateContainer(this, this.variantProperty);
}
@ -114,7 +114,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo
}
}
public enum ColoringType {PLAIN, LIKE_LEAVES, LIKE_GRASS};
public enum ColoringType {PLAIN, LIKE_LEAVES, LIKE_GRASS}
public static ColoringType getColoringType(BOPPlants plant)
{

View File

@ -85,7 +85,7 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable, IP
protected BlockStateContainer createBlockState()
{
this.variantProperty = currentVariantProperty; // get from static variable
return new BlockStateContainer(this, new IProperty[] { STAGE, this.variantProperty });
return new BlockStateContainer(this, STAGE, this.variantProperty);
}
@ -122,7 +122,7 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable, IP
public int getMetaFromState(IBlockState state)
{
BOPTrees tree = (BOPTrees)state.getValue(this.variantProperty);
return ((Integer)state.getValue(STAGE)).intValue() * 8 + paging.getIndex(tree);
return state.getValue(STAGE).intValue() * 8 + paging.getIndex(tree);
}
// which types of mushroom can live on which types of block
@ -261,7 +261,7 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable, IP
@Override
public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state)
{
if (((Integer)state.getValue(STAGE)).intValue() == 0)
if (state.getValue(STAGE).intValue() == 0)
{
worldIn.setBlockState(pos, state.cycleProperty(STAGE), 4);
}
@ -313,7 +313,7 @@ public class BlockBOPSapling extends BlockBOPDecoration implements IGrowable, IP
// otherwise, try to grow a small tree
if (smallTreeGenerator != null)
{
if (this.generateSmallOrBigTree(worldIn, pos, state, rand, smallTreeGenerator)) {return true;}
return this.generateSmallOrBigTree(worldIn, pos, state, rand, smallTreeGenerator);
}
return false;
}

View File

@ -30,7 +30,7 @@ public class BlockBOPSeaweed extends BlockBOPDecoration implements IBOPBlock
// TODO: is it supposed to grow?
public static enum SeaweedType implements IStringSerializable
public enum SeaweedType implements IStringSerializable
{
KELP;
@Override
@ -43,9 +43,9 @@ public class BlockBOPSeaweed extends BlockBOPDecoration implements IBOPBlock
{
return this.getName();
}
};
public static enum SeaweedPosition implements IStringSerializable
}
public enum SeaweedPosition implements IStringSerializable
{
SINGLE, BOTTOM, MIDDLE, TOP;
@Override
@ -64,7 +64,7 @@ public class BlockBOPSeaweed extends BlockBOPDecoration implements IBOPBlock
public static final PropertyEnum POSITION = PropertyEnum.create("position", SeaweedPosition.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { LEVEL, POSITION, VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, LEVEL, POSITION, VARIANT);}
// implement IBOPBlock

View File

@ -31,7 +31,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public class BlockBOPStoneFormations extends BlockBOPDecoration implements IBOPBlock
{
// add properties
public static enum FormationType implements IStringSerializable
public enum FormationType implements IStringSerializable
{
STONE_FORMATION;
@Override
@ -44,9 +44,9 @@ public class BlockBOPStoneFormations extends BlockBOPDecoration implements IBOPB
{
return this.getName();
}
};
public static enum FormationPosition implements IStringSerializable
}
public enum FormationPosition implements IStringSerializable
{
STALAGMITE_SMALL, STALACTITE_SMALL, STAL_SINGLE, STAL_CONNECTOR, STALAGMITE_MEDIUM, STALACTITE_MEDIUM, STALAGMITE_TOP, STALACTITE_BOTTOM;
@Override
@ -64,7 +64,7 @@ public class BlockBOPStoneFormations extends BlockBOPDecoration implements IBOPB
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", FormationType.class);
public static final PropertyEnum POSITION = PropertyEnum.create("position", FormationPosition.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { POSITION, VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, POSITION, VARIANT);}
// implement IBOPBlock

View File

@ -34,7 +34,7 @@ public class BlockBOPTerrarium extends Block implements IBOPBlock
protected static final AxisAlignedBB BOUNDING_BOX = new AxisAlignedBB(0.19999998807D, 0.0D, 0.19999998807D, 0.69999998808D, 0.69999998808D, 0.69999998808D);
// add properties
public static enum TerrariumType implements IStringSerializable
public enum TerrariumType implements IStringSerializable
{
FERN, MUSHROOM, CACTUS, FLAX, FLOWER, KORU, BAMBOO, SAPLING, GLOWSHROOM, DEAD, MYSTIC, OMINOUS, WASTELAND, ORIGIN, NETHER, ENDER;
@Override
@ -47,10 +47,11 @@ public class BlockBOPTerrarium extends Block implements IBOPBlock
{
return this.getName();
}
};
}
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", TerrariumType.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);}
// implement IBOPBlock
@ -99,7 +100,7 @@ public class BlockBOPTerrarium extends Block implements IBOPBlock
@Override
public int getLightValue(IBlockState state)
{
switch ((TerrariumType) state.getValue(this.VARIANT))
switch ((TerrariumType) state.getValue(VARIANT))
{
case GLOWSHROOM:
return 5;

View File

@ -39,7 +39,7 @@ public class BlockBOPWhiteSandstone extends Block implements IBOPBlock
{
// add properties
public static enum StoneType implements IStringSerializable
public enum StoneType implements IStringSerializable
{
DEFAULT, CHISELED, SMOOTH;
@Override
@ -52,10 +52,11 @@ public class BlockBOPWhiteSandstone extends Block implements IBOPBlock
{
return this.getName();
}
};
}
public static final PropertyEnum VARIANT = PropertyEnum.create("variant", StoneType.class);
@Override
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, VARIANT);}
// implement IBOPBlock

View File

@ -18,13 +18,13 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public interface IBOPBlock {
public Class<? extends ItemBlock> getItemClass();
public IProperty[] getPresetProperties();
public IProperty[] getNonRenderingProperties();
public String getStateName(IBlockState state);
Class<? extends ItemBlock> getItemClass();
IProperty[] getPresetProperties();
IProperty[] getNonRenderingProperties();
String getStateName(IBlockState state);
@SideOnly(Side.CLIENT)
public IBlockColor getBlockColor();
IBlockColor getBlockColor();
@SideOnly(Side.CLIENT)
public IItemColor getItemColor();
IItemColor getItemColor();
}

View File

@ -14,5 +14,5 @@ import net.minecraftforge.common.EnumPlantType;
public interface ISustainsPlantType
{
public boolean canSustainPlantType(IBlockAccess world, BlockPos pos, EnumPlantType plantType);
boolean canSustainPlantType(IBlockAccess world, BlockPos pos, EnumPlantType plantType);
}

View File

@ -142,8 +142,7 @@ public class BOPCommand extends CommandBase
}
}
private void printStats(ICommandSender sender, String[] args) throws CommandException
{
private void printStats(ICommandSender sender, String[] args) {
TextComponentTranslation text = new TextComponentTranslation("commands.biomesoplenty.stats.blocks", blockCount);
text.getStyle().setColor(TextFormatting.GREEN);

View File

@ -186,11 +186,7 @@ public class EntityPixie extends EntityFlying implements IMob {
return false;
}
}
if (this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar)))
{
return false;
}
return true;
return !this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar));
}
}

View File

@ -151,11 +151,7 @@ public class EntityWasp extends EntityFlying implements IMob {
return false;
}
}
if (this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar)))
{
return false;
}
return true;
return !this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar));
}
}

View File

@ -105,14 +105,14 @@ public class EntityAIEatBOPGrass extends EntityAIEatGrass
if (stateDown.getBlock() instanceof BlockBOPGrass)
{
BlockBOPGrass grass = (BlockBOPGrass) stateDown.getBlock();
Block dirtBlock = grass.getDirtBlockState(stateDown).getBlock();
Block dirtBlock = BlockBOPGrass.getDirtBlockState(stateDown).getBlock();
if (dirtBlock instanceof BlockBOPDirt)
{
if (this.world.getGameRules().getBoolean("mobGriefing"))
{
this.world.playEvent(2001, posDown, Block.getIdFromBlock(BOPBlocks.grass));
this.world.setBlockState(posDown, grass.getDirtBlockState(stateDown), 2);
this.world.setBlockState(posDown, BlockBOPGrass.getDirtBlockState(stateDown), 2);
}
} else if (stateDown.getValue(BlockBOPGrass.VARIANT) == BlockBOPGrass.BOPGrassType.DAISY)

View File

@ -73,7 +73,7 @@ public class BlockBloodFluid extends BlockFluidClassic
if (flag)
{
Integer integer = (Integer)state.getValue(LEVEL);
Integer integer = state.getValue(LEVEL);
if (integer.intValue() == 0)
{

View File

@ -88,7 +88,7 @@ public class BlockHoneyFluid extends BlockFluidFinite
if (flag)
{
Integer integer = (Integer)state.getValue(LEVEL);
Integer integer = state.getValue(LEVEL);
if (integer.intValue() == 0)
{

View File

@ -55,7 +55,7 @@ public class BlockHotSpringWaterFluid extends BlockFluidClassic
super.randomDisplayTick(state, world, pos, rand);
if (rand.nextInt(25)==0)
{
world.spawnParticle(EnumParticleTypes.CLOUD, pos.getX() + rand.nextFloat(), pos.getY() + 1.0F, pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D, new int[0]);
world.spawnParticle(EnumParticleTypes.CLOUD, pos.getX() + rand.nextFloat(), pos.getY() + 1.0F, pos.getZ() + rand.nextFloat(), 0.0D, 0.0D, 0.0D);
}
}
@ -103,7 +103,7 @@ public class BlockHotSpringWaterFluid extends BlockFluidClassic
if (flag)
{
Integer integer = (Integer)state.getValue(LEVEL);
Integer integer = state.getValue(LEVEL);
if (integer.intValue() == 0)
{

View File

@ -88,7 +88,7 @@ public class BlockPoisonFluid extends BlockFluidClassic
if (flag)
{
Integer integer = (Integer)state.getValue(LEVEL);
Integer integer = state.getValue(LEVEL);
if (integer.intValue() == 0)
{

View File

@ -78,7 +78,7 @@ public class BlockQuicksandFluid extends BlockFluidClassic
if (flag)
{
Integer integer = (Integer)state.getValue(LEVEL);
Integer integer = state.getValue(LEVEL);
if (integer.intValue() == 0)
{

View File

@ -47,23 +47,23 @@ public class BucketEventHandler
// determine if the block is one of our BOP fluids
IBlockState iblockstate = event.getWorld().getBlockState(blockpos);
Fluid filled_fluid = null;
if (iblockstate.getBlock() == BOPBlocks.sand && ((Integer)iblockstate.getValue(BlockQuicksandFluid.LEVEL)).intValue() == 0)
if (iblockstate.getBlock() == BOPBlocks.sand && iblockstate.getValue(BlockQuicksandFluid.LEVEL).intValue() == 0)
{
filled_fluid = QuicksandFluid.instance;
}
else if (iblockstate.getBlock() == BOPBlocks.honey && ((Integer)iblockstate.getValue(BlockHoneyFluid.LEVEL)).intValue() == 0)
else if (iblockstate.getBlock() == BOPBlocks.honey && iblockstate.getValue(BlockHoneyFluid.LEVEL).intValue() == 0)
{
filled_fluid = HoneyFluid.instance;
}
else if (iblockstate.getBlock() == BOPBlocks.blood && ((Integer)iblockstate.getValue(BlockBloodFluid.LEVEL)).intValue() == 0)
else if (iblockstate.getBlock() == BOPBlocks.blood && iblockstate.getValue(BlockBloodFluid.LEVEL).intValue() == 0)
{
filled_fluid = BloodFluid.instance;
}
else if (iblockstate.getBlock() == BOPBlocks.poison && ((Integer)iblockstate.getValue(BlockPoisonFluid.LEVEL)).intValue() == 0)
else if (iblockstate.getBlock() == BOPBlocks.poison && iblockstate.getValue(BlockPoisonFluid.LEVEL).intValue() == 0)
{
filled_fluid = PoisonFluid.instance;
}
else if (iblockstate.getBlock() == BOPBlocks.hot_spring_water && ((Integer)iblockstate.getValue(BlockHotSpringWaterFluid.LEVEL)).intValue() == 0)
else if (iblockstate.getBlock() == BOPBlocks.hot_spring_water && iblockstate.getValue(BlockHotSpringWaterFluid.LEVEL).intValue() == 0)
{
filled_fluid = HotSpringWaterFluid.instance;
}

View File

@ -34,7 +34,7 @@ public class TrailsEventHandler
if (event.phase == TickEvent.Phase.START)
{
Minecraft minecraft = Minecraft.getMinecraft();
EntityPlayer player = (EntityPlayer)event.player;
EntityPlayer player = event.player;
//Check if the player has a trail
if (minecraft.player != null && TrailManager.trailsMap.containsKey(player.getUniqueID()))

View File

@ -631,7 +631,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
if (biome.canGenerateVillages)
BiomeManager.addVillageBiome(biome, true);
return Optional.of((Biome)biome);
return Optional.of(biome);
} else {
return Optional.absent();
@ -653,7 +653,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
biome.setRegistryName(biome.getResourceLocation());
ForgeRegistries.BIOMES.register(biome);
return Optional.of((Biome)biome);
return Optional.of(biome);
} else {
return Optional.absent();

View File

@ -164,7 +164,7 @@ public class ModBlockQueries
// reed needs the ground block to be water, but the block below that to NOT be water
@Override public boolean matches(World world, BlockPos pos) {
BlockPos groundPos = pos.down();
return (world.getBlockState(pos).getMaterial() == Material.WATER && ((Integer)world.getBlockState(pos).getValue(BlockLiquid.LEVEL)).intValue() == 0 || world.getBlockState(pos).getMaterial() == Material.ICE) &&
return (world.getBlockState(pos).getMaterial() == Material.WATER && world.getBlockState(pos).getValue(BlockLiquid.LEVEL).intValue() == 0 || world.getBlockState(pos).getMaterial() == Material.ICE) &&
(world.getBlockState(groundPos).getBlock() != Blocks.WATER && world.getBlockState(groundPos).isSideSolid(world, groundPos, EnumFacing.UP));
}
}).withLightAboveAtLeast(8).create();

View File

@ -409,7 +409,7 @@ public class ModBlocks
{
try
{
Item itemBlock = clazz != null ? (Item)clazz.getConstructor(Block.class).newInstance(block) : null;
Item itemBlock = clazz != null ? clazz.getConstructor(Block.class).newInstance(block) : null;
ResourceLocation location = new ResourceLocation(BiomesOPlenty.MOD_ID, blockName);
block.setRegistryName(new ResourceLocation(BiomesOPlenty.MOD_ID, blockName));

View File

@ -46,7 +46,7 @@ public class ModCompatibility
// Creates a mutable version of the current biome type's biome array and wraps entries to support .equals()
List<WrappedBiomeEntry> entries = Lists.transform(Lists.newArrayList(BiomeManager.getBiomes(type)), WRAP_BIOME_ENTRIES);
// Custom types may have been added, we only want the vanilla ones
final List<WrappedBiomeEntry> vanillaEntries = type.ordinal() < vanillaBiomes.length ? Lists.transform(vanillaBiomes[type.ordinal()], WRAP_BIOME_ENTRIES) : (List)Lists.newArrayList();
final List<WrappedBiomeEntry> vanillaEntries = type.ordinal() < vanillaBiomes.length ? Lists.transform(vanillaBiomes[type.ordinal()], WRAP_BIOME_ENTRIES) : Lists.newArrayList();
//Remove all default biomes from the entries list
entries.removeAll(vanillaEntries);

View File

@ -66,7 +66,7 @@ public class ModEntities
{
if (clazz != null)
{
entity = (Entity)clazz.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn});
entity = clazz.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn});
}
}
catch (Exception exception)

View File

@ -25,7 +25,7 @@ public class ModVanillaCompat
MapGenStructureIO.registerStructure(BOPMapGenScatteredFeature.Start.class, "BOPTemple");
List<Biome> mansionBiomes = BiomeUtils.filterPresentBiomes(BOPBiomes.coniferous_forest, BOPBiomes.dead_forest, BOPBiomes.ominous_woods, BOPBiomes.snowy_coniferous_forest, BOPBiomes.woodland);
mansionBiomes.addAll(Lists.<Biome>newArrayList(Biomes.ROOFED_FOREST, Biomes.MUTATED_ROOFED_FOREST));
mansionBiomes.addAll(Lists.newArrayList(Biomes.ROOFED_FOREST, Biomes.MUTATED_ROOFED_FOREST));
WoodlandMansion.ALLOWED_BIOMES = mansionBiomes;
}

View File

@ -82,7 +82,7 @@ public class ContainerFlowerBasket extends Container
public ItemStack transferStackInSlot(EntityPlayer player, int index)
{
ItemStack oldStack = ItemStack.EMPTY;
Slot slot = (Slot)this.inventorySlots.get(index);
Slot slot = this.inventorySlots.get(index);
//Ensure there is a slot at this index and it has an item in it
if (slot != null && slot.getHasStack())

View File

@ -14,5 +14,5 @@ import net.minecraftforge.fml.relauncher.SideOnly;
public interface IColoredItem
{
@SideOnly(Side.CLIENT)
public IItemColor getItemColor();
IItemColor getItemColor();
}

View File

@ -60,7 +60,7 @@ public class ItemBOPLilypad extends ItemBOPBlock {
BlockPos blockpos1 = blockpos.up();
IBlockState iblockstate = worldIn.getBlockState(blockpos);
if (iblockstate.getMaterial() == Material.WATER && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.isAirBlock(blockpos1))
if (iblockstate.getMaterial() == Material.WATER && iblockstate.getValue(BlockLiquid.LEVEL).intValue() == 0 && worldIn.isAirBlock(blockpos1))
{
// special case for handling block placement with water lilies
net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(worldIn, blockpos1);

View File

@ -68,7 +68,7 @@ public class ItemBOPPlant extends ItemBOPBlock {
BlockPos blockpos1 = blockpos.up();
IBlockState iblockstate = worldIn.getBlockState(blockpos);
if (iblockstate.getMaterial() == Material.WATER && ((Integer)iblockstate.getValue(BlockLiquid.LEVEL)).intValue() == 0 && worldIn.isAirBlock(blockpos1))
if (iblockstate.getMaterial() == Material.WATER && iblockstate.getValue(BlockLiquid.LEVEL).intValue() == 0 && worldIn.isAirBlock(blockpos1))
{
// special case for handling block placement with reeds
net.minecraftforge.common.util.BlockSnapshot blocksnapshot = net.minecraftforge.common.util.BlockSnapshot.getBlockSnapshot(worldIn, blockpos1);

View File

@ -56,8 +56,8 @@ public class TrailManager
}
}
public static enum TrailVisibilityMode
public enum TrailVisibilityMode
{
ALL, OTHERS, NOBODY; //TODO: Implement NOBODY mode
ALL, OTHERS, NOBODY //TODO: Implement NOBODY mode
}
}

View File

@ -81,7 +81,7 @@ public class GeneratorUtils
return null;
}
public static enum ScatterYMethod
public enum ScatterYMethod
{
ANYWHERE, NETHER_SURFACE, NETHER_ROOF, AT_SURFACE, AT_GROUND, BELOW_SURFACE, BELOW_GROUND, ABOVE_SURFACE, ABOVE_GROUND;
public BlockPos getBlockPos(World world, Random random, int x, int z)

View File

@ -39,16 +39,16 @@ import net.minecraftforge.common.EnumPlantType;
public class BlockQuery
{
// for compound queries
public static interface ICompoundBlockPosQuery extends IBlockPosQuery
public interface ICompoundBlockPosQuery extends IBlockPosQuery
{
public void add(IBlockPosQuery a);
public IBlockPosQuery instance();
void add(IBlockPosQuery a);
IBlockPosQuery instance();
}
// for queries which depend only on the block state, and not on it's neighbors or position in the world
public static interface IBlockQuery extends IBlockPosQuery
public interface IBlockQuery extends IBlockPosQuery
{
public boolean matches(IBlockState state);
boolean matches(IBlockState state);
}
@ -296,7 +296,7 @@ public class BlockQuery
case Crop: return block == Blocks.FARMLAND || block == BOPBlocks.farmland_0 || block == BOPBlocks.farmland_1;
case Cave: return block.isSideSolid(state, world, pos, EnumFacing.UP);
case Plains: return block == Blocks.GRASS || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SILTY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SANDY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.DAISY) || block == Blocks.DIRT || block == BOPBlocks.dirt || block == Blocks.FARMLAND || block == BOPBlocks.farmland_0 || block == BOPBlocks.farmland_1 || block == Blocks.MYCELIUM;
case Water: return state.getMaterial() == Material.WATER && ((Integer)state.getValue(BlockLiquid.LEVEL)) == 0;
case Water: return state.getMaterial() == Material.WATER && state.getValue(BlockLiquid.LEVEL) == 0;
case Beach:
boolean isBeach = block == Blocks.GRASS || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.LOAMY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SILTY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.SANDY) || state == BOPBlocks.grass.getDefaultState().withProperty(BlockBOPGrass.VARIANT, BlockBOPGrass.BOPGrassType.DAISY) || block == Blocks.DIRT || block == BOPBlocks.dirt || block == BOPBlocks.white_sand || block == Blocks.SAND || block == Blocks.MYCELIUM;
boolean hasWater = (world.getBlockState(pos.east()).getMaterial() == Material.WATER ||
@ -448,7 +448,7 @@ public class BlockQuery
{
if (((IProperty)property).getName().equalsIgnoreCase(this.propName))
{
String thisPropValue = ((Comparable)properties.get(property)).toString();
String thisPropValue = properties.get(property).toString();
for (String value : this.propValues)
{
if (thisPropValue.equalsIgnoreCase(value))
@ -501,7 +501,8 @@ public class BlockQuery
IBlockQuery bm = new BlockQueryMaterial((Material)mat);
return negated ? new BlockQueryNot(bm) : bm;
}
} catch (Exception e) {;}
} catch (Exception e) {
}
throw new BlockQueryParseException("No block material found called "+materialName);
}
}

View File

@ -82,7 +82,7 @@ public class BlockStateUtils
// only works on blocks supporting IBOPBlock - returns an empty set for vanilla blocks
public static ImmutableSet<IBlockState> getBlockPresets(Block block)
{
if (!(block instanceof IBOPBlock)) {return ImmutableSet.<IBlockState>of();}
if (!(block instanceof IBOPBlock)) {return ImmutableSet.of();}
IBlockState defaultState = block.getDefaultState();
if (defaultState == null) {defaultState = block.getBlockState().getBaseState();}
return getStatesSet(defaultState, ((IBOPBlock)block).getPresetProperties());
@ -141,7 +141,7 @@ public class BlockStateUtils
public static IProperty getPropertyByName(IBlockState blockState, String propertyName)
{
for (IProperty property : (ImmutableSet<IProperty<?>>) blockState.getProperties().keySet())
for (IProperty property : blockState.getProperties().keySet())
{
if (property.getName().equals(propertyName))
return property;

View File

@ -60,7 +60,7 @@ public class VariantPagingHelper<B extends Block, V extends Enum<V> & IStringSer
public VariantPagingHelper(int variantsPerPage, Class<V> variantsEnumClass)
{
this(variantsPerPage, variantsEnumClass, Predicates.<V>alwaysTrue());
this(variantsPerPage, variantsEnumClass, Predicates.alwaysTrue());
}
public VariantPagingHelper(int variantsPerPage, Class<V> variantsEnumClass, Predicate<V> filter)

View File

@ -37,7 +37,7 @@ public class BOPConfig
public static Gson serializer = new GsonBuilder().setPrettyPrinting().create();
public static JsonParser parser = new JsonParser();
private static enum Types {BOOLEAN, STRING, INTEGER, FLOAT, BLOCKSTATE, BLOCKPOSQUERY, RESOURCELOCATION}
private enum Types {BOOLEAN, STRING, INTEGER, FLOAT, BLOCKSTATE, BLOCKPOSQUERY, RESOURCELOCATION}
public static boolean writeFile(File outputFile, Object obj)
{
@ -232,68 +232,68 @@ public class BOPConfig
@Override
public Boolean getBool(String name, Boolean defaultVal) {return this.<Boolean>get(name, defaultVal, false, Types.BOOLEAN);}
@Override
public String getString(String name, String defaultVal) {return this.<String>get(name, defaultVal, false, Types.STRING);}
public String getString(String name, String defaultVal) {return this.get(name, defaultVal, false, Types.STRING);}
@Override
public Integer getInt(String name, Integer defaultVal) {return this.<Integer>get(name, defaultVal, false, Types.INTEGER);}
@Override
public Float getFloat(String name, Float defaultVal) {return this.<Float>get(name, defaultVal, false, Types.FLOAT);}
@Override
public IBlockState getBlockState(String name, IBlockState defaultVal) {return this.<IBlockState>get(name, defaultVal, false, Types.BLOCKSTATE);}
public IBlockState getBlockState(String name, IBlockState defaultVal) {return this.get(name, defaultVal, false, Types.BLOCKSTATE);}
@Override
public IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal) {return this.<IBlockPosQuery>get(name, defaultVal, false, Types.BLOCKPOSQUERY);}
public IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal) {return this.get(name, defaultVal, false, Types.BLOCKPOSQUERY);}
@Override
public ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal) {return this.<ResourceLocation>get(name, defaultVal, false, Types.RESOURCELOCATION);}
public ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal) {return this.get(name, defaultVal, false, Types.RESOURCELOCATION);}
@Override
public <E extends Enum> E getEnum(String name, E defaultVal, Class<E> clazz) {return this.getEnum(name, defaultVal, false, clazz);}
@Override
public Boolean getBool(String name) {return this.<Boolean>get(name, null, true, Types.BOOLEAN);}
@Override
public String getString(String name) {return this.<String>get(name, null, true, Types.STRING);}
public String getString(String name) {return this.get(name, null, true, Types.STRING);}
@Override
public Integer getInt(String name) {return this.<Integer>get(name, null, true, Types.INTEGER);}
@Override
public Float getFloat(String name) {return this.<Float>get(name, null, true, Types.FLOAT);}
@Override
public IBlockState getBlockState(String name) {return this.<IBlockState>get(name, null, true, Types.BLOCKSTATE);}
public IBlockState getBlockState(String name) {return this.get(name, null, true, Types.BLOCKSTATE);}
@Override
public IBlockPosQuery getBlockPosQuery(String name) {return this.<IBlockPosQuery>get(name, null, true, Types.BLOCKPOSQUERY);}
public IBlockPosQuery getBlockPosQuery(String name) {return this.get(name, null, true, Types.BLOCKPOSQUERY);}
@Override
public ResourceLocation getResourceLocation(String name) {return this.<ResourceLocation>get(name, null, true, Types.RESOURCELOCATION);}
public ResourceLocation getResourceLocation(String name) {return this.get(name, null, true, Types.RESOURCELOCATION);}
@Override
public <E extends Enum> E getEnum(String name, Class<E> clazz) {return this.getEnum(name, null, true, clazz);}
@Override
public ArrayList<Boolean> getBoolArray(String name, ArrayList<Boolean> defaultVal) {return this.<Boolean>getArray(name, defaultVal, false, Types.BOOLEAN);}
public ArrayList<Boolean> getBoolArray(String name, ArrayList<Boolean> defaultVal) {return this.getArray(name, defaultVal, false, Types.BOOLEAN);}
@Override
public ArrayList<String> getStringArray(String name, ArrayList<String> defaultVal) {return this.<String>getArray(name, defaultVal, false, Types.STRING);}
public ArrayList<String> getStringArray(String name, ArrayList<String> defaultVal) {return this.getArray(name, defaultVal, false, Types.STRING);}
@Override
public ArrayList<Integer> getIntArray(String name, ArrayList<Integer> defaultVal) {return this.<Integer>getArray(name, defaultVal, false, Types.INTEGER);}
public ArrayList<Integer> getIntArray(String name, ArrayList<Integer> defaultVal) {return this.getArray(name, defaultVal, false, Types.INTEGER);}
@Override
public ArrayList<Float> getFloatArray(String name, ArrayList<Float> defaultVal) {return this.<Float>getArray(name, defaultVal, false, Types.FLOAT);}
public ArrayList<Float> getFloatArray(String name, ArrayList<Float> defaultVal) {return this.getArray(name, defaultVal, false, Types.FLOAT);}
@Override
public ArrayList<IBlockState> getBlockStateArray(String name, ArrayList<IBlockState> defaultVal) {return this.<IBlockState>getArray(name, defaultVal, false, Types.BLOCKSTATE);}
public ArrayList<IBlockState> getBlockStateArray(String name, ArrayList<IBlockState> defaultVal) {return this.getArray(name, defaultVal, false, Types.BLOCKSTATE);}
@Override
public ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name, ArrayList<IBlockPosQuery> defaultVal) {return this.<IBlockPosQuery>getArray(name, defaultVal, false, Types.BLOCKPOSQUERY);}
public ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name, ArrayList<IBlockPosQuery> defaultVal) {return this.getArray(name, defaultVal, false, Types.BLOCKPOSQUERY);}
@Override
public ArrayList<ResourceLocation> getResourceLocationArray(String name, ArrayList<ResourceLocation> defaultVal) {return this.<ResourceLocation>getArray(name, defaultVal, false, Types.RESOURCELOCATION);}
public ArrayList<ResourceLocation> getResourceLocationArray(String name, ArrayList<ResourceLocation> defaultVal) {return this.getArray(name, defaultVal, false, Types.RESOURCELOCATION);}
@Override
public <E extends Enum> ArrayList<E> getEnumArray(String name, ArrayList<E> defaultVal, Class<E> clazz) {return this.getEnumArray(name, defaultVal, false, clazz);}
@Override
public ArrayList<Boolean> getBoolArray(String name) {return this.<Boolean>getArray(name, null, true, Types.BOOLEAN);}
public ArrayList<Boolean> getBoolArray(String name) {return this.getArray(name, null, true, Types.BOOLEAN);}
@Override
public ArrayList<String> getStringArray(String name) {return this.<String>getArray(name, null, true, Types.STRING);}
public ArrayList<String> getStringArray(String name) {return this.getArray(name, null, true, Types.STRING);}
@Override
public ArrayList<Integer> getIntArray(String name) {return this.<Integer>getArray(name, null, true, Types.INTEGER);}
public ArrayList<Integer> getIntArray(String name) {return this.getArray(name, null, true, Types.INTEGER);}
@Override
public ArrayList<Float> getFloatArray(String name) {return this.<Float>getArray(name, null, true, Types.FLOAT);}
public ArrayList<Float> getFloatArray(String name) {return this.getArray(name, null, true, Types.FLOAT);}
@Override
public ArrayList<IBlockState> getBlockStateArray(String name) {return this.<IBlockState>getArray(name, null, true, Types.BLOCKSTATE);}
public ArrayList<IBlockState> getBlockStateArray(String name) {return this.getArray(name, null, true, Types.BLOCKSTATE);}
@Override
public ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name) {return this.<IBlockPosQuery>getArray(name, null, true, Types.BLOCKPOSQUERY);}
public ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name) {return this.getArray(name, null, true, Types.BLOCKPOSQUERY);}
@Override
public ArrayList<ResourceLocation> getResourceLocationArray(String name) {return this.<ResourceLocation>getArray(name, null, true, Types.RESOURCELOCATION);}
public ArrayList<ResourceLocation> getResourceLocationArray(String name) {return this.getArray(name, null, true, Types.RESOURCELOCATION);}
@Override
public <E extends Enum> ArrayList<E> getEnumArray(String name, Class<E> clazz) {return this.getEnumArray(name, null, true, clazz);}
@ -316,7 +316,7 @@ public class BOPConfig
JsonArray arr = this.members.get(name).getAsJsonArray();
for (int i = 0; i < arr.size(); i++)
{
E ele = this.<E>asEnum(arr.get(i), clazz, name + "." + i);
E ele = this.asEnum(arr.get(i), clazz, name + "." + i);
if (ele != null) {list.add(ele);}
}
} catch (Exception e) {
@ -335,7 +335,7 @@ public class BOPConfig
}
return defaultVal;
}
E out = this.<E>asEnum(this.members.get(name), clazz, name);
E out = this.asEnum(this.members.get(name), clazz, name);
return out == null ? defaultVal : out;
}
@ -357,7 +357,7 @@ public class BOPConfig
}
return defaultVal;
}
T out = this.<T>as(this.members.get(name), type, name);
T out = this.as(this.members.get(name), type, name);
// warn people who try to copy-paste default configs
if (this.warnIfDefault && out != null && out.equals(defaultVal))
{
@ -382,7 +382,7 @@ public class BOPConfig
JsonArray arr = this.members.get(name).getAsJsonArray();
for (int i = 0; i < arr.size(); i++)
{
T ele = this.<T>as(arr.get(i), type, name + "." + i);
T ele = this.as(arr.get(i), type, name + "." + i);
if (ele != null) {list.add(ele);}
}
} catch (Exception e) {

View File

@ -29,7 +29,7 @@ import java.util.*;
public class CraftingUtil
{
private static final Gson SERIALIZER = new GsonBuilder().setPrettyPrinting().create();
public static final File RECIPES_DIR = new File(BiomesOPlenty.configDirectory, "recipes");;
public static final File RECIPES_DIR = new File(BiomesOPlenty.configDirectory, "recipes");
// We should no longer need this now we've switched over to JSON, however
// it might be handy to keep around for future reference

View File

@ -44,7 +44,7 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature
public BOPMapGenScatteredFeature()
{
this.scatteredFeatureSpawnList = Lists.<Biome.SpawnListEntry>newArrayList();
this.scatteredFeatureSpawnList = Lists.newArrayList();
this.maxDistanceBetweenScatteredFeatures = 32;
this.minDistanceBetweenScatteredFeatures = 8;
this.scatteredFeatureSpawnList.add(new Biome.SpawnListEntry(EntityWitch.class, 1, 1, 1));
@ -58,7 +58,7 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature
{
if (entry.getKey().equals("distance"))
{
this.maxDistanceBetweenScatteredFeatures = MathHelper.getInt((String)entry.getValue(), this.maxDistanceBetweenScatteredFeatures, 9);
this.maxDistanceBetweenScatteredFeatures = MathHelper.getInt(entry.getValue(), this.maxDistanceBetweenScatteredFeatures, 9);
}
}
}
@ -97,10 +97,7 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature
{
Biome biome = this.world.getBiomeProvider().getBiome(new BlockPos(i * 16 + 8, 0, j * 16 + 8));
if (biome != null && (JUNGLE_BIOMES.contains(biome) || SWAMP_BIOMES.contains(biome) || DESERT_BIOMES.contains(biome) || ICE_BIOMES.contains(biome)))
{
return true;
}
return biome != null && (JUNGLE_BIOMES.contains(biome) || SWAMP_BIOMES.contains(biome) || DESERT_BIOMES.contains(biome) || ICE_BIOMES.contains(biome));
}
return false;

View File

@ -24,31 +24,31 @@ public class BOPWorldSettings implements IBOPWorldSettings
public static Gson serializer = new GsonBuilder().create();
public static enum LandMassScheme
public enum LandMassScheme
{
VANILLA,
CONTINENTS,
ARCHIPELAGO;
ARCHIPELAGO
}
public static enum TemperatureVariationScheme
public enum TemperatureVariationScheme
{
LATITUDE,
SMALL_ZONES,
MEDIUM_ZONES,
LARGE_ZONES,
RANDOM;
RANDOM
}
public static enum RainfallVariationScheme
public enum RainfallVariationScheme
{
SMALL_ZONES,
MEDIUM_ZONES,
LARGE_ZONES,
RANDOM;
RANDOM
}
public static enum BiomeSize
public enum BiomeSize
{
TINY (2),
SMALL (3),

View File

@ -337,7 +337,7 @@ public class ChunkGeneratorHellBOP implements IChunkGenerator
this.genNetherBridge.generate(this.world, chunkX, chunkZ, chunkprimer);
}
Biome[] biomes = this.world.getBiomeProvider().getBiomes((Biome[])null, chunkX * 16, chunkZ * 16, 16, 16);
Biome[] biomes = this.world.getBiomeProvider().getBiomes(null, chunkX * 16, chunkZ * 16, 16, 16);
this.replaceBlocksForBiome(chunkX, chunkZ, chunkprimer, biomes);
Chunk chunk = new Chunk(this.world, chunkprimer, chunkX, chunkZ);
@ -578,12 +578,12 @@ public class ChunkGeneratorHellBOP implements IChunkGenerator
@Override
public boolean isInsideStructure(World world, String structureName, BlockPos pos)
{
return "Fortress".equals(structureName) && this.genNetherBridge != null ? this.genNetherBridge.isInsideStructure(pos) : false;
return ("Fortress".equals(structureName) && this.genNetherBridge != null) && this.genNetherBridge.isInsideStructure(pos);
}
@Override
public void recreateStructures(Chunk chunkIn, int x, int z)
{
this.genNetherBridge.generate(this.world, x, z, (ChunkPrimer)null);
this.genNetherBridge.generate(this.world, x, z, null);
}
}

View File

@ -645,32 +645,32 @@ public class ChunkGeneratorOverworldBOP implements IChunkGenerator
{
if (this.settings.useMineShafts)
{
this.mineshaftGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null);
this.mineshaftGenerator.generate(this.world, chunkX, chunkZ, null);
}
if (this.settings.useVillages)
{
this.villageGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null);
this.villageGenerator.generate(this.world, chunkX, chunkZ, null);
}
if (this.settings.useStrongholds)
{
this.strongholdGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null);
this.strongholdGenerator.generate(this.world, chunkX, chunkZ, null);
}
if (this.settings.useTemples)
{
this.scatteredFeatureGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null);
this.scatteredFeatureGenerator.generate(this.world, chunkX, chunkZ, null);
}
if (this.settings.useMonuments)
{
this.oceanMonumentGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null);
this.oceanMonumentGenerator.generate(this.world, chunkX, chunkZ, null);
}
if (this.settings.useMansions)
{
this.woodlandMansionGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null);
this.woodlandMansionGenerator.generate(this.world, chunkX, chunkZ, null);
}
}
}
@ -704,7 +704,7 @@ public class ChunkGeneratorOverworldBOP implements IChunkGenerator
}
else
{
return "Temple".equals(structureName) && this.scatteredFeatureGenerator != null ? this.scatteredFeatureGenerator.isInsideStructure(pos) : false;
return ("Temple".equals(structureName) && this.scatteredFeatureGenerator != null) && this.scatteredFeatureGenerator.isInsideStructure(pos);
}
}

View File

@ -46,7 +46,7 @@ public class GenerationManager implements IGenerationManager
out.add(generator);
}
}
return ImmutableList.<IGenerator>copyOf(out);
return ImmutableList.copyOf(out);
}
public void removeGenerator(String name)

View File

@ -16,10 +16,10 @@ public class NoiseGeneratorBOPByte
// TODO: get rid of the interpolater classes - there's only one sensible interpolater
/*** Interpolation ***/
public static interface IIntInterpolater
public interface IIntInterpolater
{
// interpolation between a and b, where t is the fraction (between 0 and 255)
public int interpolate(int t, int a, int b);
int interpolate(int t, int a, int b);
}
public static class IntInterpolateLinear implements IIntInterpolater

View File

@ -13,12 +13,12 @@ import net.minecraft.world.biome.Biome;
public class TerrainSettings
{
public static enum PresetOctaveWeights
public enum PresetOctaveWeights
{
DEFAULT (new double[] {1 / 24.0D, 2 / 24.0D, 4 / 24.0D, 8 / 24.0D, 6 / 24.0D, 3 / 24.0D});
private final double[] weights;
private PresetOctaveWeights(double[] weights)
PresetOctaveWeights(double[] weights)
{
this.weights = weights;
}

View File

@ -34,9 +34,9 @@ import net.minecraft.world.World;
public class GeneratorBigFlower extends BOPGeneratorBase
{
public static enum BigFlowerType
public enum BigFlowerType
{
RED, YELLOW;
RED, YELLOW
}
protected static IBlockState stem = BlockBOPLog.paging.getVariantState(BOPWoods.GIANT_FLOWER);

View File

@ -31,7 +31,7 @@ import net.minecraft.world.World;
public class GeneratorBigMushroom extends BOPGeneratorBase
{
public static enum BigMushroomType
public enum BigMushroomType
{
BROWN, RED;
public IBlockState getDefaultState()

View File

@ -100,7 +100,7 @@ public class GeneratorDoubleFlora extends GeneratorReplacing
{
canStay = ((BlockBOPDecoration)bottomBlock).canBlockStay(world, genPos, this.with);
} else if (bottomBlock instanceof BlockBush) {
canStay = ((BlockBush)bottomBlock).canPlaceBlockAt(world, genPos);
canStay = bottomBlock.canPlaceBlockAt(world, genPos);
} else {
canStay = bottomBlock.canPlaceBlockAt(world, genPos);
}

View File

@ -124,7 +124,7 @@ public class GeneratorFlora extends GeneratorReplacing
{
canStay = ((BlockBOPDecoration)block).canBlockStay(world, genPos, this.with);
} else if (block instanceof BlockBush) {
canStay = ((BlockBush)block).canPlaceBlockAt(world, genPos);
canStay = block.canPlaceBlockAt(world, genPos);
} else {
canStay = block.canPlaceBlockAt(world, genPos);
}

View File

@ -50,7 +50,7 @@ public class GeneratorHive extends GeneratorReplacing
{
// defaults
this.amountPerChunk = 1.0F;
this.placeOn = BlockQuery.buildAnd().states(Blocks.NETHERRACK.getDefaultState()).withAirBelow().create();;
this.placeOn = BlockQuery.buildAnd().states(Blocks.NETHERRACK.getDefaultState()).withAirBelow().create();
this.replace = new BlockQuery.BlockQueryMaterial(Material.AIR);
this.with = null;
this.scatterYMethod = GeneratorUtils.ScatterYMethod.NETHER_ROOF;

View File

@ -491,7 +491,6 @@ public class GeneratorBigTree extends GeneratorTreeBase
makeBranches();
} catch (RuntimeException e) {
// TODO: deal with this.
;
}
this.world = null; //Fix vanilla Mem leak, holds latest world

View File

@ -61,7 +61,7 @@ public class GeneratorProfileTree extends GeneratorTreeBase
this.profile = profile;
}
public static enum TreeProfile
public enum TreeProfile
{
POPLAR;

View File

@ -174,7 +174,7 @@ public class GenLayerShoreBOP extends BOPGenLayer
@Override
public boolean apply(Integer input)
{
return Biome.getBiome(input) != null && Biome.getBiome(input).getBiomeClass() == BiomeJungle.class ? true : input == Biome.getIdForBiome(Biomes.JUNGLE_EDGE) || input == Biome.getIdForBiome(Biomes.JUNGLE) || input == Biome.getIdForBiome(Biomes.JUNGLE_HILLS) || input == Biome.getIdForBiome(Biomes.FOREST) || input == Biome.getIdForBiome(Biomes.TAIGA) || isBiomeOceanic(input);
return Biome.getBiome(input) != null && Biome.getBiome(input).getBiomeClass() == BiomeJungle.class || (input == Biome.getIdForBiome(Biomes.JUNGLE_EDGE) || input == Biome.getIdForBiome(Biomes.JUNGLE) || input == Biome.getIdForBiome(Biomes.JUNGLE_HILLS) || input == Biome.getIdForBiome(Biomes.FOREST) || input == Biome.getIdForBiome(Biomes.TAIGA) || isBiomeOceanic(input));
}
};

View File

@ -172,7 +172,7 @@ public class ClientProxy extends CommonProxy
//Register colour handlers
if (item instanceof IColoredItem && ((IColoredItem)item).getItemColor() != null)
{
this.itemsToColor.add(item);
itemsToColor.add(item);
}
}
@ -204,7 +204,7 @@ public class ClientProxy extends CommonProxy
break;
case MUD:
int itemId = Item.getIdFromItem(BOPItems.mudball);
minecraft.world.spawnParticle(EnumParticleTypes.ITEM_CRACK, x, y, z, MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), new int[] {itemId});
minecraft.world.spawnParticle(EnumParticleTypes.ITEM_CRACK, x, y, z, MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), itemId);
return;
case PLAYER_TRAIL:
if (info.length < 1)