Revert "Code Cleanup -- Optional" & MCP Update
This commit is contained in:
parent
05a805eb46
commit
8aa95d1818
99 changed files with 327 additions and 316 deletions
|
@ -1,4 +1,4 @@
|
|||
minecraft_version=1.12.2
|
||||
forge_version=14.23.0.2517
|
||||
forge_version=14.23.0.2528
|
||||
mod_version=7.0.1
|
||||
mappings_version=snapshot_nodoc_20171030
|
||||
mappings_version=snapshot_nodoc_20171031
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
boolean canHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType);
|
||||
public 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.
|
||||
*/
|
||||
boolean hasSpecialHornHarvest(World world, BlockPos pos, ItemStack stack, EnumHornType hornType);
|
||||
public 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.
|
||||
*/
|
||||
void harvestByHorn(World world, BlockPos pos, ItemStack stack, EnumHornType hornType);
|
||||
public void harvestByHorn(World world, BlockPos pos, ItemStack stack, EnumHornType hornType);
|
||||
|
||||
enum EnumHornType {
|
||||
public static 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)];
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -147,10 +147,10 @@ public class BOPBiomes
|
|||
return instance;
|
||||
}
|
||||
|
||||
public interface IBiomeRegistry
|
||||
public static interface IBiomeRegistry
|
||||
{
|
||||
IExtendedBiome registerBiome(IExtendedBiome biome, String idName);
|
||||
IExtendedBiome getExtendedBiome(Biome biome);
|
||||
ImmutableSet<Biome> getPresentBiomes();
|
||||
public IExtendedBiome registerBiome(IExtendedBiome biome, String idName);
|
||||
public IExtendedBiome getExtendedBiome(Biome biome);
|
||||
public ImmutableSet<Biome> getPresentBiomes();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,5 +10,5 @@ package biomesoplenty.api.biome;
|
|||
|
||||
public enum BiomeOwner
|
||||
{
|
||||
BIOMESOPLENTY, OTHER
|
||||
BIOMESOPLENTY, OTHER;
|
||||
}
|
||||
|
|
|
@ -21,19 +21,19 @@ import net.minecraft.world.biome.Biome;
|
|||
|
||||
public interface IExtendedBiome
|
||||
{
|
||||
void applySettings(IBOPWorldSettings settings);
|
||||
void configure(IConfigObj conf);
|
||||
public void applySettings(IBOPWorldSettings settings);
|
||||
public void configure(IConfigObj conf);
|
||||
|
||||
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 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);
|
||||
|
||||
ResourceLocation getBeachLocation();
|
||||
public ResourceLocation getBeachLocation();
|
||||
|
||||
/**Get the base biome associated with this extension**/
|
||||
Biome getBaseBiome();
|
||||
ResourceLocation getResourceLocation();
|
||||
public Biome getBaseBiome();
|
||||
public ResourceLocation getResourceLocation();
|
||||
}
|
||||
|
|
|
@ -13,5 +13,5 @@ import net.minecraft.world.World;
|
|||
// for queries on a particular block position in the world
|
||||
public interface IBlockPosQuery
|
||||
{
|
||||
boolean matches(World world, BlockPos pos);
|
||||
public boolean matches(World world, BlockPos pos);
|
||||
}
|
|
@ -11,10 +11,10 @@ public interface IBOPWorldSettings
|
|||
{
|
||||
boolean isEnabled(GeneratorType type);
|
||||
|
||||
enum GeneratorType
|
||||
public static 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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,62 +18,62 @@ import net.minecraft.util.ResourceLocation;
|
|||
|
||||
public interface IConfigObj
|
||||
{
|
||||
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 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();
|
||||
|
||||
IConfigObj getObject(String name);
|
||||
ArrayList<IConfigObj> getObjectArray(String name);
|
||||
IConfigObj getObject(String name, boolean warnIfMissing);
|
||||
ArrayList<IConfigObj> getObjectArray(String name, boolean warnIfMissing);
|
||||
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);
|
||||
|
||||
// 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
|
||||
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);
|
||||
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);
|
||||
|
||||
// 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
|
||||
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);
|
||||
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);
|
||||
|
||||
// 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
|
||||
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);
|
||||
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);
|
||||
|
||||
// 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
|
||||
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);
|
||||
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);
|
||||
|
||||
|
||||
}
|
|
@ -31,7 +31,7 @@ public enum BOPClimates {
|
|||
|
||||
private ArrayList<WeightedBiomeEntry> landBiomes = new ArrayList<WeightedBiomeEntry>();
|
||||
|
||||
BOPClimates(BiomeType biomeType)
|
||||
private BOPClimates(BiomeType biomeType)
|
||||
{
|
||||
this.biomeType = biomeType;
|
||||
}
|
||||
|
|
|
@ -23,4 +23,4 @@ public enum BOPGems implements IStringSerializable
|
|||
{
|
||||
return this.getName();
|
||||
}
|
||||
}
|
||||
};
|
|
@ -24,7 +24,7 @@ public abstract class BOPGeneratorBase extends WorldGenerator implements IGenera
|
|||
|
||||
protected BOPGeneratorBase(float amountPerChunk)
|
||||
{
|
||||
this.identifier = Generators.registry.getIdentifier(this.getClass());
|
||||
this.identifier = Generators.registry.getIdentifier((Class<? extends IGenerator>)this.getClass());
|
||||
|
||||
if (this.identifier == null)
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@ public enum GeneratorStage
|
|||
|
||||
private Decorate.EventType decorateType;
|
||||
|
||||
GeneratorStage(Decorate.EventType decorateType)
|
||||
private GeneratorStage(Decorate.EventType decorateType)
|
||||
{
|
||||
this.decorateType = decorateType;
|
||||
}
|
||||
|
|
|
@ -16,25 +16,25 @@ import net.minecraft.world.World;
|
|||
|
||||
public interface IGenerator
|
||||
{
|
||||
void scatter(World world, Random random, BlockPos pos);
|
||||
boolean generate(World world, Random random, BlockPos pos);
|
||||
public void scatter(World world, Random random, BlockPos pos);
|
||||
public boolean generate(World world, Random random, BlockPos pos);
|
||||
|
||||
void setStage(GeneratorStage stage);
|
||||
void setName(String name);
|
||||
public void setStage(GeneratorStage stage);
|
||||
public 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.
|
||||
*/
|
||||
String getName();
|
||||
public String getName();
|
||||
/**The identifier for this generator should be consistent across all instances of the same type*/
|
||||
String getIdentifier();
|
||||
GeneratorStage getStage();
|
||||
public String getIdentifier();
|
||||
public GeneratorStage getStage();
|
||||
|
||||
interface IGeneratorBuilder<T extends IGenerator>
|
||||
public static interface IGeneratorBuilder<T extends IGenerator>
|
||||
{
|
||||
T create();
|
||||
public T create();
|
||||
}
|
||||
|
||||
void configure(IConfigObj conf);
|
||||
public void configure(IConfigObj conf);
|
||||
}
|
||||
|
|
|
@ -2,5 +2,5 @@ package biomesoplenty.api.particle;
|
|||
|
||||
public enum BOPParticleTypes
|
||||
{
|
||||
PIXIETRAIL, MUD, PLAYER_TRAIL
|
||||
PIXIETRAIL, MUD, PLAYER_TRAIL;
|
||||
}
|
|
@ -76,7 +76,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
|
|||
}
|
||||
}
|
||||
|
||||
private enum Actions
|
||||
private static enum Actions
|
||||
{
|
||||
PREVIOUS (301),
|
||||
NEXT (302),
|
||||
|
@ -87,7 +87,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
|
|||
|
||||
private int id;
|
||||
|
||||
Actions(int id)
|
||||
private Actions(int id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
|
|||
}
|
||||
|
||||
|
||||
private enum GuiEntries
|
||||
private static enum GuiEntries
|
||||
{
|
||||
TEMP_SCHEME (101),
|
||||
GENERATE_BOP_GEMS (102),
|
||||
|
@ -201,7 +201,7 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
|
|||
|
||||
private int id;
|
||||
|
||||
GuiEntries(int id)
|
||||
private 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", Float.valueOf(value));
|
||||
return String.format("%5.3f", new Object[] {Float.valueOf(value)});
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
|
@ -474,12 +474,14 @@ public class GuiBOPConfigureWorld extends GuiScreen implements GuiSlider.FormatH
|
|||
@Override
|
||||
public void handleStringSelection(int fieldId, String value)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void handleIntSelection(int fieldId, int value)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
|
@ -581,7 +583,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", Integer.valueOf(this.pageManager.getActivePage().pageNumber + 1), Integer.valueOf(this.pageManager.getNumPages()));
|
||||
this.pageInfo = I18n.format("book.pageIndicator", new Object[] {Integer.valueOf(this.pageManager.getActivePage().pageNumber + 1), Integer.valueOf(this.pageManager.getNumPages())});
|
||||
this.page0Title = this.pageNames[this.pageManager.getActivePage().pageNumber];
|
||||
}
|
||||
|
||||
|
@ -676,9 +678,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"), 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.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.yesButton.drawButton(this.mc, mouseX, mouseY, partialTicks);
|
||||
this.noButton.drawButton(this.mc, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
|
|
|
@ -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 = MoreObjects.firstNonNull(validator, Predicates.alwaysTrue());
|
||||
this.validator = (Predicate) MoreObjects.firstNonNull(validator, Predicates.alwaysTrue());
|
||||
}
|
||||
|
||||
public Predicate getValidator()
|
||||
|
|
|
@ -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 = this.fieldIdToGuiMap.get(guilistentryLeft.getFieldId());
|
||||
Gui guiRight = guilistentryRight != null ? this.fieldIdToGuiMap.get(guilistentryRight.getFieldId()) : null;
|
||||
Gui guiLeft = (Gui)this.fieldIdToGuiMap.get(guilistentryLeft.getFieldId());
|
||||
Gui guiRight = guilistentryRight != null ? (Gui)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 this.fieldIdToGuiMap.get(fieldId);
|
||||
return (Gui)this.fieldIdToGuiMap.get(fieldId);
|
||||
}
|
||||
|
||||
|
||||
|
@ -156,23 +156,23 @@ public class GuiBOPPageTable extends GuiBOPPageList
|
|||
{
|
||||
if (field instanceof GuiBOPPageList.GuiSlideEntry)
|
||||
{
|
||||
return this.createSlider(this.width / 2 - 155 + xOffset, 0, (GuiSlideEntry)field);
|
||||
return (Gui)this.createSlider(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiSlideEntry)field);
|
||||
}
|
||||
else if (field instanceof GuiBOPPageList.GuiButtonEntry)
|
||||
{
|
||||
return this.createListButton(this.width / 2 - 155 + xOffset, 0, (GuiButtonEntry)field);
|
||||
return (Gui)this.createListButton(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiButtonEntry)field);
|
||||
}
|
||||
else if (field instanceof GuiBOPPageList.EditBoxEntry)
|
||||
{
|
||||
return this.createTextField(this.width / 2 - 155 + xOffset, 0, (EditBoxEntry)field);
|
||||
return (Gui)this.createTextField(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.EditBoxEntry)field);
|
||||
}
|
||||
else if (field instanceof GuiBOPPageList.GuiLabelEntry)
|
||||
{
|
||||
return this.createLabel(this.width / 2 - 155 + xOffset, 0, (GuiLabelEntry)field, hasNoNeighbor);
|
||||
return (Gui)this.createLabel(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiLabelEntry)field, hasNoNeighbor);
|
||||
}
|
||||
else if (field instanceof GuiBOPPageList.GuiEnumButtonEntry)
|
||||
{
|
||||
return this.createEnumButton(this.width / 2 - 155 + xOffset, 0, (GuiEnumButtonEntry)field);
|
||||
return (Gui)this.createEnumButton(this.width / 2 - 155 + xOffset, 0, (GuiBOPPageList.GuiEnumButtonEntry)field);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -268,7 +268,7 @@ public class GuiBOPPageTable extends GuiBOPPageList
|
|||
++focusedGuiIndex; //Cycle forwards through the text fields
|
||||
}
|
||||
|
||||
this.focusedGui = this.allTextFieldGuis.get(focusedGuiIndex);
|
||||
this.focusedGui = (Gui)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];
|
||||
this.allTextFieldGuis.get(k).setText(s1);
|
||||
((GuiTextField)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 this.allRows.get(rowNum);
|
||||
return (GuiBOPPageList.GuiRowEntry)this.allRows.get(rowNum);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -24,7 +24,7 @@ public class GuiEnumButton<T extends Enum> extends GuiButton
|
|||
|
||||
private String buildDisplayString()
|
||||
{
|
||||
return I18n.format(this.localizationStr, this.value.toString());
|
||||
return I18n.format(this.localizationStr, new Object[] {this.value.toString()});
|
||||
}
|
||||
|
||||
public void setValue(T value)
|
||||
|
|
|
@ -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) + (particleMaxAge / 2) * world.rand.nextInt(7);
|
||||
this.particleAge = (particleMaxAge / 2) + (int)((particleMaxAge / 2) * world.rand.nextInt(7));
|
||||
this.particleAlpha = 1.0F;
|
||||
this.particleRed = 1.0F;
|
||||
this.particleGreen = 1.0F;
|
||||
|
|
|
@ -19,7 +19,7 @@ public class ForgeRedirectedResourcePack extends FMLFileResourcePack
|
|||
{
|
||||
super(container);
|
||||
|
||||
this.bopResourcePack = FMLClientHandler.instance().getResourcePackFor(BiomesOPlenty.MOD_ID);
|
||||
this.bopResourcePack = (IResourcePack)FMLClientHandler.instance().getResourcePackFor(BiomesOPlenty.MOD_ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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", 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"));
|
||||
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"}));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ import net.minecraft.world.biome.Biome.SpawnListEntry;
|
|||
|
||||
public class BiomeGenAlps extends BOPOverworldBiome
|
||||
{
|
||||
public enum AlpsType {ALPS, ALPS_FOOTHILLS}
|
||||
public static enum AlpsType {ALPS, ALPS_FOOTHILLS}
|
||||
|
||||
public AlpsType type;
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ import net.minecraft.world.chunk.ChunkPrimer;
|
|||
public class BiomeGenMountain extends BOPOverworldBiome
|
||||
{
|
||||
|
||||
public enum MountainType {MOUNTAIN, MOUNTAIN_FOOTHILLS}
|
||||
public static enum MountainType {MOUNTAIN, MOUNTAIN_FOOTHILLS}
|
||||
|
||||
public MountainType type;
|
||||
public IBlockState grassBlock;
|
||||
|
|
|
@ -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);
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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, AGE);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { AGE });}
|
||||
|
||||
|
||||
public BlockBOPBamboo()
|
||||
|
@ -104,7 +104,7 @@ public class BlockBOPBamboo extends BlockBOPDecoration
|
|||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return state.getValue(AGE).intValue();
|
||||
return ((Integer)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 = state.getValue(AGE).intValue();
|
||||
int age = ((Integer)state.getValue(AGE)).intValue();
|
||||
int treeHeight = 1;
|
||||
while (worldIn.getBlockState(pos.down(treeHeight)).getBlock() == this) {++treeHeight;}
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ public class BlockBOPBiomeBlock extends BlockBOPGeneric
|
|||
biomesWithEssence = new ArrayList<Biome>();
|
||||
|
||||
List<Biome> vanillaBiomesToExclude = Arrays.asList(
|
||||
new Biome[] {
|
||||
Biomes.DEFAULT,
|
||||
Biomes.SKY,
|
||||
Biomes.HELL,
|
||||
|
@ -95,7 +96,9 @@ 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())
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ import net.minecraft.world.World;
|
|||
public class BlockBOPCoral extends BlockBOPDecoration
|
||||
{
|
||||
|
||||
public enum CoralType implements IStringSerializable
|
||||
public static enum CoralType implements IStringSerializable
|
||||
{
|
||||
PINK, ORANGE, BLUE, GLOWING, ALGAE;
|
||||
@Override
|
||||
|
@ -37,11 +37,10 @@ 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, LEVEL, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { LEVEL, VARIANT });}
|
||||
|
||||
// implement IBOPBlock
|
||||
@Override
|
||||
|
|
|
@ -59,7 +59,12 @@ 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
|
||||
return !(entity instanceof EntityDragon);
|
||||
if (entity instanceof EntityDragon)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -37,7 +37,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
public class BlockBOPDirt extends Block implements IBOPBlock, ISustainsPlantType
|
||||
{
|
||||
// add properties
|
||||
public enum BOPDirtType implements IStringSerializable, IPagedVariants
|
||||
public static enum BOPDirtType implements IStringSerializable, IPagedVariants
|
||||
{
|
||||
LOAMY, SANDY, SILTY;
|
||||
@Override
|
||||
|
@ -50,12 +50,11 @@ 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, COARSE, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { COARSE, VARIANT });}
|
||||
|
||||
// implement IBOPBlock
|
||||
@Override
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.world.World;
|
|||
public class BlockBOPDoubleDecoration extends BlockBOPDecoration {
|
||||
|
||||
// add half property
|
||||
public enum Half implements IStringSerializable
|
||||
public static enum Half implements IStringSerializable
|
||||
{
|
||||
LOWER, UPPER;
|
||||
@Override
|
||||
|
@ -41,11 +41,10 @@ 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, HALF);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { HALF });}
|
||||
@Override
|
||||
public IProperty[] getNonRenderingProperties() { return null; }
|
||||
|
||||
|
|
|
@ -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 enum DoublePlantType implements IStringSerializable
|
||||
public static enum DoublePlantType implements IStringSerializable
|
||||
{
|
||||
FLAX, TALL_CATTAIL, EYEBULB;
|
||||
@Override
|
||||
|
@ -55,11 +55,10 @@ 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, HALF, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { HALF, VARIANT });}
|
||||
|
||||
|
||||
// implement IBOPBlock
|
||||
|
@ -73,7 +72,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)
|
||||
{
|
||||
|
|
|
@ -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, HALF, this.variantProperty);
|
||||
return new BlockStateContainer(this, new IProperty[] { HALF, this.variantProperty });
|
||||
}
|
||||
|
||||
// implement IBOPBlock
|
||||
|
|
|
@ -62,7 +62,7 @@ public class BlockBOPFarmland extends BlockFarmland implements IBOPBlock
|
|||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
this.variantProperty = currentVariantProperty;
|
||||
return new BlockStateContainer(this, MOISTURE, this.variantProperty);
|
||||
return new BlockStateContainer(this, new IProperty[] { MOISTURE, this.variantProperty });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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, this.variantProperty);
|
||||
return new BlockStateContainer(this, new IProperty[] { 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);
|
||||
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]);
|
||||
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);
|
||||
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]);
|
||||
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);
|
||||
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]);
|
||||
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);
|
||||
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]);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -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, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
|
||||
|
||||
|
||||
// implement IBOPBlock
|
||||
|
|
|
@ -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, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
|
||||
|
||||
|
||||
// implement IBOPBlock
|
||||
|
|
|
@ -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 enum BOPGrassType implements IStringSerializable
|
||||
public static enum BOPGrassType implements IStringSerializable
|
||||
{
|
||||
SPECTRAL_MOSS, OVERGROWN_STONE, LOAMY, SANDY, SILTY, ORIGIN, OVERGROWN_NETHERRACK, DAISY, MYCELIAL_NETHERRACK;
|
||||
@Override
|
||||
|
@ -62,11 +62,10 @@ 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, SNOWY, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { SNOWY, VARIANT });}
|
||||
|
||||
|
||||
// implement IBOPBlock
|
||||
|
@ -467,7 +466,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);
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class BlockBOPGrassPath extends BlockGrassPath implements IBOPBlock
|
|||
protected BlockStateContainer createBlockState()
|
||||
{
|
||||
this.variantProperty = currentVariantProperty;
|
||||
return new BlockStateContainer(this, this.variantProperty);
|
||||
return new BlockStateContainer(this, new IProperty[] { this.variantProperty });
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -42,7 +42,7 @@ public class BlockBOPHalfOtherSlab extends BlockSlab implements IBOPBlock
|
|||
{
|
||||
|
||||
// add properties
|
||||
public enum SlabType implements IStringSerializable
|
||||
public static 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, HALF, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { HALF, VARIANT });}
|
||||
|
||||
|
||||
// implement IBOPBlock
|
||||
|
|
|
@ -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, HALF, this.variantProperty);
|
||||
return new BlockStateContainer(this, new IProperty[] { HALF, this.variantProperty });
|
||||
}
|
||||
|
||||
// implement IBOPBlock
|
||||
|
|
|
@ -37,7 +37,7 @@ public class BlockBOPHive extends Block implements IBOPBlock
|
|||
{
|
||||
|
||||
// add properties
|
||||
public enum HiveType implements IStringSerializable
|
||||
public static enum HiveType implements IStringSerializable
|
||||
{
|
||||
HIVE, HONEYCOMB, EMPTY_HONEYCOMB, FILLED_HONEYCOMB;
|
||||
@Override
|
||||
|
@ -50,11 +50,10 @@ 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, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
|
||||
|
||||
|
||||
// implement IBOPBlock
|
||||
|
|
|
@ -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, CHECK_DECAY, DECAYABLE, this.variantProperty);
|
||||
return new BlockStateContainer(this, new IProperty[] { 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 (!state.getValue(DECAYABLE).booleanValue())
|
||||
if (!((Boolean)state.getValue(DECAYABLE)).booleanValue())
|
||||
{
|
||||
meta |= 4;
|
||||
}
|
||||
if (state.getValue(CHECK_DECAY).booleanValue())
|
||||
if (((Boolean)state.getValue(CHECK_DECAY)).booleanValue())
|
||||
{
|
||||
meta |= 8;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class BlockBOPLilypad extends BlockLilyPad implements IBOPBlock
|
|||
{
|
||||
|
||||
// add properties
|
||||
public enum LilypadType implements IStringSerializable
|
||||
public static enum LilypadType implements IStringSerializable
|
||||
{
|
||||
MEDIUM, SMALL, TINY, FLOWER;
|
||||
@Override
|
||||
|
@ -45,11 +45,10 @@ 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, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
|
||||
|
||||
|
||||
// implement IBOPBlock
|
||||
|
|
|
@ -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, LOG_AXIS, this.variantProperty);
|
||||
return new BlockStateContainer(this, new IProperty[] { 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 state.getValue(LOG_AXIS).ordinal() * 4 + paging.getIndex(wood);
|
||||
return ((BlockLog.EnumAxis) state.getValue(LOG_AXIS)).ordinal() * 4 + paging.getIndex(wood);
|
||||
}
|
||||
|
||||
// discard the axis information - otherwise logs facing different directions would not stack together
|
||||
|
|
|
@ -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 enum MudType implements IStringSerializable
|
||||
public static enum MudType implements IStringSerializable
|
||||
{
|
||||
MUD;
|
||||
@Override
|
||||
|
@ -58,11 +58,10 @@ 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, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
|
||||
|
||||
|
||||
// implement IBOPBlock
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
public class BlockBOPMushroom extends BlockBOPDecoration
|
||||
{
|
||||
// add properties
|
||||
public enum MushroomType implements IStringSerializable
|
||||
public static enum MushroomType implements IStringSerializable
|
||||
{
|
||||
TOADSTOOL, PORTOBELLO, BLUE_MILK_CAP, GLOWSHROOM, FLAT_MUSHROOM, SHADOW_SHROOM;
|
||||
@Override
|
||||
|
@ -42,11 +42,10 @@ 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, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
|
||||
|
||||
|
||||
// implement IBOPBlock
|
||||
|
@ -99,7 +98,7 @@ public class BlockBOPMushroom extends BlockBOPDecoration
|
|||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos)
|
||||
{
|
||||
MushroomType plant = (MushroomType) state.getValue(VARIANT);
|
||||
MushroomType plant = (MushroomType) state.getValue(this.VARIANT);
|
||||
switch (plant)
|
||||
{
|
||||
case GLOWSHROOM: case SHADOW_SHROOM:
|
||||
|
|
|
@ -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, this.variantProperty);
|
||||
return new BlockStateContainer(this, new IProperty[] { this.variantProperty });
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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, this.variantProperty);
|
||||
return new BlockStateContainer(this, new IProperty[] { 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)
|
||||
{
|
||||
|
|
|
@ -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, STAGE, this.variantProperty);
|
||||
return new BlockStateContainer(this, new IProperty[] { 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 state.getValue(STAGE).intValue() * 8 + paging.getIndex(tree);
|
||||
return ((Integer)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 (state.getValue(STAGE).intValue() == 0)
|
||||
if (((Integer)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)
|
||||
{
|
||||
return this.generateSmallOrBigTree(worldIn, pos, state, rand, smallTreeGenerator);
|
||||
if (this.generateSmallOrBigTree(worldIn, pos, state, rand, smallTreeGenerator)) {return true;}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public class BlockBOPSeaweed extends BlockBOPDecoration implements IBOPBlock
|
|||
|
||||
// TODO: is it supposed to grow?
|
||||
|
||||
public enum SeaweedType implements IStringSerializable
|
||||
public static enum SeaweedType implements IStringSerializable
|
||||
{
|
||||
KELP;
|
||||
@Override
|
||||
|
@ -43,9 +43,9 @@ public class BlockBOPSeaweed extends BlockBOPDecoration implements IBOPBlock
|
|||
{
|
||||
return this.getName();
|
||||
}
|
||||
}
|
||||
|
||||
public enum SeaweedPosition implements IStringSerializable
|
||||
};
|
||||
|
||||
public static 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, LEVEL, POSITION, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { LEVEL, POSITION, VARIANT });}
|
||||
|
||||
|
||||
// implement IBOPBlock
|
||||
|
|
|
@ -31,7 +31,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
public class BlockBOPStoneFormations extends BlockBOPDecoration implements IBOPBlock
|
||||
{
|
||||
// add properties
|
||||
public enum FormationType implements IStringSerializable
|
||||
public static enum FormationType implements IStringSerializable
|
||||
{
|
||||
STONE_FORMATION;
|
||||
@Override
|
||||
|
@ -44,9 +44,9 @@ public class BlockBOPStoneFormations extends BlockBOPDecoration implements IBOPB
|
|||
{
|
||||
return this.getName();
|
||||
}
|
||||
}
|
||||
|
||||
public enum FormationPosition implements IStringSerializable
|
||||
};
|
||||
|
||||
public static 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, POSITION, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { POSITION, VARIANT });}
|
||||
|
||||
|
||||
// implement IBOPBlock
|
||||
|
|
|
@ -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 enum TerrariumType implements IStringSerializable
|
||||
public static enum TerrariumType implements IStringSerializable
|
||||
{
|
||||
FERN, MUSHROOM, CACTUS, FLAX, FLOWER, KORU, BAMBOO, SAPLING, GLOWSHROOM, DEAD, MYSTIC, OMINOUS, WASTELAND, ORIGIN, NETHER, ENDER;
|
||||
@Override
|
||||
|
@ -47,11 +47,10 @@ 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, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
|
||||
|
||||
|
||||
// implement IBOPBlock
|
||||
|
@ -100,7 +99,7 @@ public class BlockBOPTerrarium extends Block implements IBOPBlock
|
|||
@Override
|
||||
public int getLightValue(IBlockState state)
|
||||
{
|
||||
switch ((TerrariumType) state.getValue(VARIANT))
|
||||
switch ((TerrariumType) state.getValue(this.VARIANT))
|
||||
{
|
||||
case GLOWSHROOM:
|
||||
return 5;
|
||||
|
|
|
@ -39,7 +39,7 @@ public class BlockBOPWhiteSandstone extends Block implements IBOPBlock
|
|||
{
|
||||
|
||||
// add properties
|
||||
public enum StoneType implements IStringSerializable
|
||||
public static enum StoneType implements IStringSerializable
|
||||
{
|
||||
DEFAULT, CHISELED, SMOOTH;
|
||||
@Override
|
||||
|
@ -52,11 +52,10 @@ 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, VARIANT);}
|
||||
protected BlockStateContainer createBlockState() {return new BlockStateContainer(this, new IProperty[] { VARIANT });}
|
||||
|
||||
|
||||
// implement IBOPBlock
|
||||
|
|
|
@ -18,13 +18,13 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
|
||||
public interface IBOPBlock {
|
||||
|
||||
Class<? extends ItemBlock> getItemClass();
|
||||
IProperty[] getPresetProperties();
|
||||
IProperty[] getNonRenderingProperties();
|
||||
String getStateName(IBlockState state);
|
||||
public Class<? extends ItemBlock> getItemClass();
|
||||
public IProperty[] getPresetProperties();
|
||||
public IProperty[] getNonRenderingProperties();
|
||||
public String getStateName(IBlockState state);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
IBlockColor getBlockColor();
|
||||
public IBlockColor getBlockColor();
|
||||
@SideOnly(Side.CLIENT)
|
||||
IItemColor getItemColor();
|
||||
public IItemColor getItemColor();
|
||||
}
|
|
@ -14,5 +14,5 @@ import net.minecraftforge.common.EnumPlantType;
|
|||
|
||||
public interface ISustainsPlantType
|
||||
{
|
||||
boolean canSustainPlantType(IBlockAccess world, BlockPos pos, EnumPlantType plantType);
|
||||
public boolean canSustainPlantType(IBlockAccess world, BlockPos pos, EnumPlantType plantType);
|
||||
}
|
|
@ -142,7 +142,8 @@ public class BOPCommand extends CommandBase
|
|||
}
|
||||
}
|
||||
|
||||
private void printStats(ICommandSender sender, String[] args) {
|
||||
private void printStats(ICommandSender sender, String[] args) throws CommandException
|
||||
{
|
||||
TextComponentTranslation text = new TextComponentTranslation("commands.biomesoplenty.stats.blocks", blockCount);
|
||||
|
||||
text.getStyle().setColor(TextFormatting.GREEN);
|
||||
|
|
|
@ -186,7 +186,11 @@ public class EntityPixie extends EntityFlying implements IMob {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
return !this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar));
|
||||
if (this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -151,7 +151,11 @@ public class EntityWasp extends EntityFlying implements IMob {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
return !this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar));
|
||||
if (this.isBoxBlocked(box.offset(this.aimX * howFar, this.aimY * howFar, this.aimZ * howFar)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -105,14 +105,14 @@ public class EntityAIEatBOPGrass extends EntityAIEatGrass
|
|||
if (stateDown.getBlock() instanceof BlockBOPGrass)
|
||||
{
|
||||
BlockBOPGrass grass = (BlockBOPGrass) stateDown.getBlock();
|
||||
Block dirtBlock = BlockBOPGrass.getDirtBlockState(stateDown).getBlock();
|
||||
Block dirtBlock = grass.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, BlockBOPGrass.getDirtBlockState(stateDown), 2);
|
||||
this.world.setBlockState(posDown, grass.getDirtBlockState(stateDown), 2);
|
||||
}
|
||||
|
||||
} else if (stateDown.getValue(BlockBOPGrass.VARIANT) == BlockBOPGrass.BOPGrassType.DAISY)
|
||||
|
|
|
@ -73,7 +73,7 @@ public class BlockBloodFluid extends BlockFluidClassic
|
|||
|
||||
if (flag)
|
||||
{
|
||||
Integer integer = state.getValue(LEVEL);
|
||||
Integer integer = (Integer)state.getValue(LEVEL);
|
||||
|
||||
if (integer.intValue() == 0)
|
||||
{
|
||||
|
|
|
@ -88,7 +88,7 @@ public class BlockHoneyFluid extends BlockFluidFinite
|
|||
|
||||
if (flag)
|
||||
{
|
||||
Integer integer = state.getValue(LEVEL);
|
||||
Integer integer = (Integer)state.getValue(LEVEL);
|
||||
|
||||
if (integer.intValue() == 0)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ public class BlockHotSpringWaterFluid extends BlockFluidClassic
|
|||
|
||||
if (flag)
|
||||
{
|
||||
Integer integer = state.getValue(LEVEL);
|
||||
Integer integer = (Integer)state.getValue(LEVEL);
|
||||
|
||||
if (integer.intValue() == 0)
|
||||
{
|
||||
|
|
|
@ -88,7 +88,7 @@ public class BlockPoisonFluid extends BlockFluidClassic
|
|||
|
||||
if (flag)
|
||||
{
|
||||
Integer integer = state.getValue(LEVEL);
|
||||
Integer integer = (Integer)state.getValue(LEVEL);
|
||||
|
||||
if (integer.intValue() == 0)
|
||||
{
|
||||
|
|
|
@ -78,7 +78,7 @@ public class BlockQuicksandFluid extends BlockFluidClassic
|
|||
|
||||
if (flag)
|
||||
{
|
||||
Integer integer = state.getValue(LEVEL);
|
||||
Integer integer = (Integer)state.getValue(LEVEL);
|
||||
|
||||
if (integer.intValue() == 0)
|
||||
{
|
||||
|
|
|
@ -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 && iblockstate.getValue(BlockQuicksandFluid.LEVEL).intValue() == 0)
|
||||
if (iblockstate.getBlock() == BOPBlocks.sand && ((Integer)iblockstate.getValue(BlockQuicksandFluid.LEVEL)).intValue() == 0)
|
||||
{
|
||||
filled_fluid = QuicksandFluid.instance;
|
||||
}
|
||||
else if (iblockstate.getBlock() == BOPBlocks.honey && iblockstate.getValue(BlockHoneyFluid.LEVEL).intValue() == 0)
|
||||
else if (iblockstate.getBlock() == BOPBlocks.honey && ((Integer)iblockstate.getValue(BlockHoneyFluid.LEVEL)).intValue() == 0)
|
||||
{
|
||||
filled_fluid = HoneyFluid.instance;
|
||||
}
|
||||
else if (iblockstate.getBlock() == BOPBlocks.blood && iblockstate.getValue(BlockBloodFluid.LEVEL).intValue() == 0)
|
||||
else if (iblockstate.getBlock() == BOPBlocks.blood && ((Integer)iblockstate.getValue(BlockBloodFluid.LEVEL)).intValue() == 0)
|
||||
{
|
||||
filled_fluid = BloodFluid.instance;
|
||||
}
|
||||
else if (iblockstate.getBlock() == BOPBlocks.poison && iblockstate.getValue(BlockPoisonFluid.LEVEL).intValue() == 0)
|
||||
else if (iblockstate.getBlock() == BOPBlocks.poison && ((Integer)iblockstate.getValue(BlockPoisonFluid.LEVEL)).intValue() == 0)
|
||||
{
|
||||
filled_fluid = PoisonFluid.instance;
|
||||
}
|
||||
else if (iblockstate.getBlock() == BOPBlocks.hot_spring_water && iblockstate.getValue(BlockHotSpringWaterFluid.LEVEL).intValue() == 0)
|
||||
else if (iblockstate.getBlock() == BOPBlocks.hot_spring_water && ((Integer)iblockstate.getValue(BlockHotSpringWaterFluid.LEVEL)).intValue() == 0)
|
||||
{
|
||||
filled_fluid = HotSpringWaterFluid.instance;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class TrailsEventHandler
|
|||
if (event.phase == TickEvent.Phase.START)
|
||||
{
|
||||
Minecraft minecraft = Minecraft.getMinecraft();
|
||||
EntityPlayer player = event.player;
|
||||
EntityPlayer player = (EntityPlayer)event.player;
|
||||
|
||||
//Check if the player has a trail
|
||||
if (minecraft.player != null && TrailManager.trailsMap.containsKey(player.getUniqueID()))
|
||||
|
|
|
@ -631,7 +631,7 @@ public class ModBiomes implements BOPBiomes.IBiomeRegistry
|
|||
if (biome.canGenerateVillages)
|
||||
BiomeManager.addVillageBiome(biome, true);
|
||||
|
||||
return Optional.of(biome);
|
||||
return Optional.of((Biome)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);
|
||||
return Optional.of((Biome)biome);
|
||||
|
||||
} else {
|
||||
return Optional.absent();
|
||||
|
|
|
@ -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 && world.getBlockState(pos).getValue(BlockLiquid.LEVEL).intValue() == 0 || world.getBlockState(pos).getMaterial() == Material.ICE) &&
|
||||
return (world.getBlockState(pos).getMaterial() == Material.WATER && ((Integer)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();
|
||||
|
|
|
@ -409,7 +409,7 @@ public class ModBlocks
|
|||
{
|
||||
try
|
||||
{
|
||||
Item itemBlock = clazz != null ? clazz.getConstructor(Block.class).newInstance(block) : null;
|
||||
Item itemBlock = clazz != null ? (Item)clazz.getConstructor(Block.class).newInstance(block) : null;
|
||||
ResourceLocation location = new ResourceLocation(BiomesOPlenty.MOD_ID, blockName);
|
||||
|
||||
block.setRegistryName(new ResourceLocation(BiomesOPlenty.MOD_ID, blockName));
|
||||
|
|
|
@ -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) : Lists.newArrayList();
|
||||
final List<WrappedBiomeEntry> vanillaEntries = type.ordinal() < vanillaBiomes.length ? Lists.transform(vanillaBiomes[type.ordinal()], WRAP_BIOME_ENTRIES) : (List)Lists.newArrayList();
|
||||
|
||||
//Remove all default biomes from the entries list
|
||||
entries.removeAll(vanillaEntries);
|
||||
|
|
|
@ -66,7 +66,7 @@ public class ModEntities
|
|||
{
|
||||
if (clazz != null)
|
||||
{
|
||||
entity = clazz.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn});
|
||||
entity = (Entity)clazz.getConstructor(new Class[] {World.class}).newInstance(new Object[] {worldIn});
|
||||
}
|
||||
}
|
||||
catch (Exception exception)
|
||||
|
|
|
@ -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.newArrayList(Biomes.ROOFED_FOREST, Biomes.MUTATED_ROOFED_FOREST));
|
||||
mansionBiomes.addAll(Lists.<Biome>newArrayList(Biomes.ROOFED_FOREST, Biomes.MUTATED_ROOFED_FOREST));
|
||||
WoodlandMansion.ALLOWED_BIOMES = mansionBiomes;
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ public class ContainerFlowerBasket extends Container
|
|||
public ItemStack transferStackInSlot(EntityPlayer player, int index)
|
||||
{
|
||||
ItemStack oldStack = ItemStack.EMPTY;
|
||||
Slot slot = this.inventorySlots.get(index);
|
||||
Slot 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())
|
||||
|
|
|
@ -14,5 +14,5 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
|||
public interface IColoredItem
|
||||
{
|
||||
@SideOnly(Side.CLIENT)
|
||||
IItemColor getItemColor();
|
||||
public IItemColor getItemColor();
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ public class ItemBOPLilypad extends ItemBOPBlock {
|
|||
BlockPos blockpos1 = blockpos.up();
|
||||
IBlockState iblockstate = worldIn.getBlockState(blockpos);
|
||||
|
||||
if (iblockstate.getMaterial() == Material.WATER && iblockstate.getValue(BlockLiquid.LEVEL).intValue() == 0 && worldIn.isAirBlock(blockpos1))
|
||||
if (iblockstate.getMaterial() == Material.WATER && ((Integer)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);
|
||||
|
|
|
@ -68,7 +68,7 @@ public class ItemBOPPlant extends ItemBOPBlock {
|
|||
BlockPos blockpos1 = blockpos.up();
|
||||
IBlockState iblockstate = worldIn.getBlockState(blockpos);
|
||||
|
||||
if (iblockstate.getMaterial() == Material.WATER && iblockstate.getValue(BlockLiquid.LEVEL).intValue() == 0 && worldIn.isAirBlock(blockpos1))
|
||||
if (iblockstate.getMaterial() == Material.WATER && ((Integer)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);
|
||||
|
|
|
@ -56,8 +56,8 @@ public class TrailManager
|
|||
}
|
||||
}
|
||||
|
||||
public enum TrailVisibilityMode
|
||||
public static enum TrailVisibilityMode
|
||||
{
|
||||
ALL, OTHERS, NOBODY //TODO: Implement NOBODY mode
|
||||
ALL, OTHERS, NOBODY; //TODO: Implement NOBODY mode
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public class GeneratorUtils
|
|||
return null;
|
||||
}
|
||||
|
||||
public enum ScatterYMethod
|
||||
public static 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)
|
||||
|
|
|
@ -39,16 +39,16 @@ import net.minecraftforge.common.EnumPlantType;
|
|||
public class BlockQuery
|
||||
{
|
||||
// for compound queries
|
||||
public interface ICompoundBlockPosQuery extends IBlockPosQuery
|
||||
public static interface ICompoundBlockPosQuery extends IBlockPosQuery
|
||||
{
|
||||
void add(IBlockPosQuery a);
|
||||
IBlockPosQuery instance();
|
||||
public void add(IBlockPosQuery a);
|
||||
public IBlockPosQuery instance();
|
||||
}
|
||||
|
||||
// for queries which depend only on the block state, and not on it's neighbors or position in the world
|
||||
public interface IBlockQuery extends IBlockPosQuery
|
||||
public static interface IBlockQuery extends IBlockPosQuery
|
||||
{
|
||||
boolean matches(IBlockState state);
|
||||
public 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 && state.getValue(BlockLiquid.LEVEL) == 0;
|
||||
case Water: return state.getMaterial() == Material.WATER && ((Integer)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 = properties.get(property).toString();
|
||||
String thisPropValue = ((Comparable)properties.get(property)).toString();
|
||||
for (String value : this.propValues)
|
||||
{
|
||||
if (thisPropValue.equalsIgnoreCase(value))
|
||||
|
@ -501,8 +501,7 @@ 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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.of();}
|
||||
if (!(block instanceof IBOPBlock)) {return ImmutableSet.<IBlockState>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 : blockState.getProperties().keySet())
|
||||
for (IProperty property : (ImmutableSet<IProperty<?>>) blockState.getProperties().keySet())
|
||||
{
|
||||
if (property.getName().equals(propertyName))
|
||||
return property;
|
||||
|
|
|
@ -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.alwaysTrue());
|
||||
this(variantsPerPage, variantsEnumClass, Predicates.<V>alwaysTrue());
|
||||
}
|
||||
|
||||
public VariantPagingHelper(int variantsPerPage, Class<V> variantsEnumClass, Predicate<V> filter)
|
||||
|
|
|
@ -37,7 +37,7 @@ public class BOPConfig
|
|||
|
||||
public static Gson serializer = new GsonBuilder().setPrettyPrinting().create();
|
||||
public static JsonParser parser = new JsonParser();
|
||||
private enum Types {BOOLEAN, STRING, INTEGER, FLOAT, BLOCKSTATE, BLOCKPOSQUERY, RESOURCELOCATION}
|
||||
private static 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.get(name, defaultVal, false, Types.STRING);}
|
||||
public String getString(String name, String defaultVal) {return this.<String>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.get(name, defaultVal, false, Types.BLOCKSTATE);}
|
||||
public IBlockState getBlockState(String name, IBlockState defaultVal) {return this.<IBlockState>get(name, defaultVal, false, Types.BLOCKSTATE);}
|
||||
@Override
|
||||
public IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal) {return this.get(name, defaultVal, false, Types.BLOCKPOSQUERY);}
|
||||
public IBlockPosQuery getBlockPosQuery(String name, IBlockPosQuery defaultVal) {return this.<IBlockPosQuery>get(name, defaultVal, false, Types.BLOCKPOSQUERY);}
|
||||
@Override
|
||||
public ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal) {return this.get(name, defaultVal, false, Types.RESOURCELOCATION);}
|
||||
public ResourceLocation getResourceLocation(String name, ResourceLocation defaultVal) {return this.<ResourceLocation>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.get(name, null, true, Types.STRING);}
|
||||
public String getString(String name) {return this.<String>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.get(name, null, true, Types.BLOCKSTATE);}
|
||||
public IBlockState getBlockState(String name) {return this.<IBlockState>get(name, null, true, Types.BLOCKSTATE);}
|
||||
@Override
|
||||
public IBlockPosQuery getBlockPosQuery(String name) {return this.get(name, null, true, Types.BLOCKPOSQUERY);}
|
||||
public IBlockPosQuery getBlockPosQuery(String name) {return this.<IBlockPosQuery>get(name, null, true, Types.BLOCKPOSQUERY);}
|
||||
@Override
|
||||
public ResourceLocation getResourceLocation(String name) {return this.get(name, null, true, Types.RESOURCELOCATION);}
|
||||
public ResourceLocation getResourceLocation(String name) {return this.<ResourceLocation>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.getArray(name, defaultVal, false, Types.BOOLEAN);}
|
||||
public ArrayList<Boolean> getBoolArray(String name, ArrayList<Boolean> defaultVal) {return this.<Boolean>getArray(name, defaultVal, false, Types.BOOLEAN);}
|
||||
@Override
|
||||
public ArrayList<String> getStringArray(String name, ArrayList<String> defaultVal) {return this.getArray(name, defaultVal, false, Types.STRING);}
|
||||
public ArrayList<String> getStringArray(String name, ArrayList<String> defaultVal) {return this.<String>getArray(name, defaultVal, false, Types.STRING);}
|
||||
@Override
|
||||
public ArrayList<Integer> getIntArray(String name, ArrayList<Integer> defaultVal) {return this.getArray(name, defaultVal, false, Types.INTEGER);}
|
||||
public ArrayList<Integer> getIntArray(String name, ArrayList<Integer> defaultVal) {return this.<Integer>getArray(name, defaultVal, false, Types.INTEGER);}
|
||||
@Override
|
||||
public ArrayList<Float> getFloatArray(String name, ArrayList<Float> defaultVal) {return this.getArray(name, defaultVal, false, Types.FLOAT);}
|
||||
public ArrayList<Float> getFloatArray(String name, ArrayList<Float> defaultVal) {return this.<Float>getArray(name, defaultVal, false, Types.FLOAT);}
|
||||
@Override
|
||||
public ArrayList<IBlockState> getBlockStateArray(String name, ArrayList<IBlockState> defaultVal) {return this.getArray(name, defaultVal, false, Types.BLOCKSTATE);}
|
||||
public ArrayList<IBlockState> getBlockStateArray(String name, ArrayList<IBlockState> defaultVal) {return this.<IBlockState>getArray(name, defaultVal, false, Types.BLOCKSTATE);}
|
||||
@Override
|
||||
public ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name, ArrayList<IBlockPosQuery> defaultVal) {return this.getArray(name, defaultVal, false, Types.BLOCKPOSQUERY);}
|
||||
public ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name, ArrayList<IBlockPosQuery> defaultVal) {return this.<IBlockPosQuery>getArray(name, defaultVal, false, Types.BLOCKPOSQUERY);}
|
||||
@Override
|
||||
public ArrayList<ResourceLocation> getResourceLocationArray(String name, ArrayList<ResourceLocation> defaultVal) {return this.getArray(name, defaultVal, false, Types.RESOURCELOCATION);}
|
||||
public ArrayList<ResourceLocation> getResourceLocationArray(String name, ArrayList<ResourceLocation> defaultVal) {return this.<ResourceLocation>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.getArray(name, null, true, Types.BOOLEAN);}
|
||||
public ArrayList<Boolean> getBoolArray(String name) {return this.<Boolean>getArray(name, null, true, Types.BOOLEAN);}
|
||||
@Override
|
||||
public ArrayList<String> getStringArray(String name) {return this.getArray(name, null, true, Types.STRING);}
|
||||
public ArrayList<String> getStringArray(String name) {return this.<String>getArray(name, null, true, Types.STRING);}
|
||||
@Override
|
||||
public ArrayList<Integer> getIntArray(String name) {return this.getArray(name, null, true, Types.INTEGER);}
|
||||
public ArrayList<Integer> getIntArray(String name) {return this.<Integer>getArray(name, null, true, Types.INTEGER);}
|
||||
@Override
|
||||
public ArrayList<Float> getFloatArray(String name) {return this.getArray(name, null, true, Types.FLOAT);}
|
||||
public ArrayList<Float> getFloatArray(String name) {return this.<Float>getArray(name, null, true, Types.FLOAT);}
|
||||
@Override
|
||||
public ArrayList<IBlockState> getBlockStateArray(String name) {return this.getArray(name, null, true, Types.BLOCKSTATE);}
|
||||
public ArrayList<IBlockState> getBlockStateArray(String name) {return this.<IBlockState>getArray(name, null, true, Types.BLOCKSTATE);}
|
||||
@Override
|
||||
public ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name) {return this.getArray(name, null, true, Types.BLOCKPOSQUERY);}
|
||||
public ArrayList<IBlockPosQuery> getBlockPosQueryArray(String name) {return this.<IBlockPosQuery>getArray(name, null, true, Types.BLOCKPOSQUERY);}
|
||||
@Override
|
||||
public ArrayList<ResourceLocation> getResourceLocationArray(String name) {return this.getArray(name, null, true, Types.RESOURCELOCATION);}
|
||||
public ArrayList<ResourceLocation> getResourceLocationArray(String name) {return this.<ResourceLocation>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.asEnum(arr.get(i), clazz, name + "." + i);
|
||||
E ele = this.<E>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.asEnum(this.members.get(name), clazz, name);
|
||||
E out = this.<E>asEnum(this.members.get(name), clazz, name);
|
||||
return out == null ? defaultVal : out;
|
||||
}
|
||||
|
||||
|
@ -357,7 +357,7 @@ public class BOPConfig
|
|||
}
|
||||
return defaultVal;
|
||||
}
|
||||
T out = this.as(this.members.get(name), type, name);
|
||||
T out = this.<T>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.as(arr.get(i), type, name + "." + i);
|
||||
T ele = this.<T>as(arr.get(i), type, name + "." + i);
|
||||
if (ele != null) {list.add(ele);}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -44,7 +44,7 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature
|
|||
|
||||
public BOPMapGenScatteredFeature()
|
||||
{
|
||||
this.scatteredFeatureSpawnList = Lists.newArrayList();
|
||||
this.scatteredFeatureSpawnList = Lists.<Biome.SpawnListEntry>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(entry.getValue(), this.maxDistanceBetweenScatteredFeatures, 9);
|
||||
this.maxDistanceBetweenScatteredFeatures = MathHelper.getInt((String)entry.getValue(), this.maxDistanceBetweenScatteredFeatures, 9);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -97,7 +97,10 @@ public class BOPMapGenScatteredFeature extends MapGenScatteredFeature
|
|||
{
|
||||
Biome biome = this.world.getBiomeProvider().getBiome(new BlockPos(i * 16 + 8, 0, j * 16 + 8));
|
||||
|
||||
return biome != null && (JUNGLE_BIOMES.contains(biome) || SWAMP_BIOMES.contains(biome) || DESERT_BIOMES.contains(biome) || ICE_BIOMES.contains(biome));
|
||||
if (biome != null && (JUNGLE_BIOMES.contains(biome) || SWAMP_BIOMES.contains(biome) || DESERT_BIOMES.contains(biome) || ICE_BIOMES.contains(biome)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -24,31 +24,31 @@ public class BOPWorldSettings implements IBOPWorldSettings
|
|||
|
||||
public static Gson serializer = new GsonBuilder().create();
|
||||
|
||||
public enum LandMassScheme
|
||||
public static enum LandMassScheme
|
||||
{
|
||||
VANILLA,
|
||||
CONTINENTS,
|
||||
ARCHIPELAGO
|
||||
ARCHIPELAGO;
|
||||
}
|
||||
|
||||
public enum TemperatureVariationScheme
|
||||
public static enum TemperatureVariationScheme
|
||||
{
|
||||
LATITUDE,
|
||||
SMALL_ZONES,
|
||||
MEDIUM_ZONES,
|
||||
LARGE_ZONES,
|
||||
RANDOM
|
||||
RANDOM;
|
||||
}
|
||||
|
||||
public enum RainfallVariationScheme
|
||||
public static enum RainfallVariationScheme
|
||||
{
|
||||
SMALL_ZONES,
|
||||
MEDIUM_ZONES,
|
||||
LARGE_ZONES,
|
||||
RANDOM
|
||||
RANDOM;
|
||||
}
|
||||
|
||||
public enum BiomeSize
|
||||
public static enum BiomeSize
|
||||
{
|
||||
TINY (2),
|
||||
SMALL (3),
|
||||
|
|
|
@ -337,7 +337,7 @@ public class ChunkGeneratorHellBOP implements IChunkGenerator
|
|||
this.genNetherBridge.generate(this.world, chunkX, chunkZ, chunkprimer);
|
||||
}
|
||||
|
||||
Biome[] biomes = this.world.getBiomeProvider().getBiomes(null, chunkX * 16, chunkZ * 16, 16, 16);
|
||||
Biome[] biomes = this.world.getBiomeProvider().getBiomes((Biome[])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);
|
||||
return "Fortress".equals(structureName) && this.genNetherBridge != null ? this.genNetherBridge.isInsideStructure(pos) : false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void recreateStructures(Chunk chunkIn, int x, int z)
|
||||
{
|
||||
this.genNetherBridge.generate(this.world, x, z, null);
|
||||
this.genNetherBridge.generate(this.world, x, z, (ChunkPrimer)null);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -645,32 +645,32 @@ public class ChunkGeneratorOverworldBOP implements IChunkGenerator
|
|||
{
|
||||
if (this.settings.useMineShafts)
|
||||
{
|
||||
this.mineshaftGenerator.generate(this.world, chunkX, chunkZ, null);
|
||||
this.mineshaftGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null);
|
||||
}
|
||||
|
||||
if (this.settings.useVillages)
|
||||
{
|
||||
this.villageGenerator.generate(this.world, chunkX, chunkZ, null);
|
||||
this.villageGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null);
|
||||
}
|
||||
|
||||
if (this.settings.useStrongholds)
|
||||
{
|
||||
this.strongholdGenerator.generate(this.world, chunkX, chunkZ, null);
|
||||
this.strongholdGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null);
|
||||
}
|
||||
|
||||
if (this.settings.useTemples)
|
||||
{
|
||||
this.scatteredFeatureGenerator.generate(this.world, chunkX, chunkZ, null);
|
||||
this.scatteredFeatureGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null);
|
||||
}
|
||||
|
||||
if (this.settings.useMonuments)
|
||||
{
|
||||
this.oceanMonumentGenerator.generate(this.world, chunkX, chunkZ, null);
|
||||
this.oceanMonumentGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null);
|
||||
}
|
||||
|
||||
if (this.settings.useMansions)
|
||||
{
|
||||
this.woodlandMansionGenerator.generate(this.world, chunkX, chunkZ, null);
|
||||
this.woodlandMansionGenerator.generate(this.world, chunkX, chunkZ, (ChunkPrimer)null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -704,7 +704,7 @@ public class ChunkGeneratorOverworldBOP implements IChunkGenerator
|
|||
}
|
||||
else
|
||||
{
|
||||
return ("Temple".equals(structureName) && this.scatteredFeatureGenerator != null) && this.scatteredFeatureGenerator.isInsideStructure(pos);
|
||||
return "Temple".equals(structureName) && this.scatteredFeatureGenerator != null ? this.scatteredFeatureGenerator.isInsideStructure(pos) : false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ public class GenerationManager implements IGenerationManager
|
|||
out.add(generator);
|
||||
}
|
||||
}
|
||||
return ImmutableList.copyOf(out);
|
||||
return ImmutableList.<IGenerator>copyOf(out);
|
||||
}
|
||||
|
||||
public void removeGenerator(String name)
|
||||
|
|
|
@ -16,10 +16,10 @@ public class NoiseGeneratorBOPByte
|
|||
// TODO: get rid of the interpolater classes - there's only one sensible interpolater
|
||||
/*** Interpolation ***/
|
||||
|
||||
public interface IIntInterpolater
|
||||
public static interface IIntInterpolater
|
||||
{
|
||||
// interpolation between a and b, where t is the fraction (between 0 and 255)
|
||||
int interpolate(int t, int a, int b);
|
||||
public int interpolate(int t, int a, int b);
|
||||
}
|
||||
|
||||
public static class IntInterpolateLinear implements IIntInterpolater
|
||||
|
|
|
@ -13,12 +13,12 @@ import net.minecraft.world.biome.Biome;
|
|||
|
||||
public class TerrainSettings
|
||||
{
|
||||
public enum PresetOctaveWeights
|
||||
public static 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;
|
||||
PresetOctaveWeights(double[] weights)
|
||||
private PresetOctaveWeights(double[] weights)
|
||||
{
|
||||
this.weights = weights;
|
||||
}
|
||||
|
|
|
@ -34,9 +34,9 @@ import net.minecraft.world.World;
|
|||
public class GeneratorBigFlower extends BOPGeneratorBase
|
||||
{
|
||||
|
||||
public enum BigFlowerType
|
||||
public static enum BigFlowerType
|
||||
{
|
||||
RED, YELLOW
|
||||
RED, YELLOW;
|
||||
}
|
||||
|
||||
protected static IBlockState stem = BlockBOPLog.paging.getVariantState(BOPWoods.GIANT_FLOWER);
|
||||
|
|
|
@ -31,7 +31,7 @@ import net.minecraft.world.World;
|
|||
public class GeneratorBigMushroom extends BOPGeneratorBase
|
||||
{
|
||||
|
||||
public enum BigMushroomType
|
||||
public static enum BigMushroomType
|
||||
{
|
||||
BROWN, RED;
|
||||
public IBlockState getDefaultState()
|
||||
|
|
|
@ -100,7 +100,7 @@ public class GeneratorDoubleFlora extends GeneratorReplacing
|
|||
{
|
||||
canStay = ((BlockBOPDecoration)bottomBlock).canBlockStay(world, genPos, this.with);
|
||||
} else if (bottomBlock instanceof BlockBush) {
|
||||
canStay = bottomBlock.canPlaceBlockAt(world, genPos);
|
||||
canStay = ((BlockBush)bottomBlock).canPlaceBlockAt(world, genPos);
|
||||
} else {
|
||||
canStay = bottomBlock.canPlaceBlockAt(world, genPos);
|
||||
}
|
||||
|
|
|
@ -124,7 +124,7 @@ public class GeneratorFlora extends GeneratorReplacing
|
|||
{
|
||||
canStay = ((BlockBOPDecoration)block).canBlockStay(world, genPos, this.with);
|
||||
} else if (block instanceof BlockBush) {
|
||||
canStay = block.canPlaceBlockAt(world, genPos);
|
||||
canStay = ((BlockBush)block).canPlaceBlockAt(world, genPos);
|
||||
} else {
|
||||
canStay = block.canPlaceBlockAt(world, genPos);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -491,6 +491,7 @@ public class GeneratorBigTree extends GeneratorTreeBase
|
|||
makeBranches();
|
||||
} catch (RuntimeException e) {
|
||||
// TODO: deal with this.
|
||||
;
|
||||
}
|
||||
|
||||
this.world = null; //Fix vanilla Mem leak, holds latest world
|
||||
|
|
|
@ -61,7 +61,7 @@ public class GeneratorProfileTree extends GeneratorTreeBase
|
|||
this.profile = profile;
|
||||
}
|
||||
|
||||
public enum TreeProfile
|
||||
public static enum TreeProfile
|
||||
{
|
||||
POPLAR;
|
||||
|
||||
|
|
|
@ -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 || (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 ? 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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -172,7 +172,7 @@ public class ClientProxy extends CommonProxy
|
|||
//Register colour handlers
|
||||
if (item instanceof IColoredItem && ((IColoredItem)item).getItemColor() != null)
|
||||
{
|
||||
itemsToColor.add(item);
|
||||
this.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), 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), new int[] {itemId});
|
||||
return;
|
||||
case PLAYER_TRAIL:
|
||||
if (info.length < 1)
|
||||
|
|
Loading…
Reference in a new issue