mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-21 12:42:53 +00:00
Minor cleanups (#50)
* Finalize, minor alloc reduction Also enable Jabel and generic injection * Update dependencies.gradle * Clean up Machine a bit * spotless more enhanced instanceof * Update ModuleMachine.java * More clen * WARN: Removed exception catching * Many, many tiny patches + birthday fix * Spotless * Spotless again * Fix getLow and clamp tolerance value * Revert event -> ignored on unused event parameters * Rename instanceof variables * Update Machine.java * Use StringBuilder * Cache getStack() * Oops, Jabel can't handle that * Spotless * Spotless again My IDE was fighting with it * Remove unused elements + scream test success
This commit is contained in:
1 parent
6b4f3eb1c7
commit
f0f14bb278
325 files changed
+1205
-1868
No files matched your search
@@ -6,6 +6,7 @@ import net.minecraft.item.Item;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.Tags;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.core.network.BinniePacketHandler;
|
||||
import binnie.core.proxy.IProxyCore;
|
||||
@@ -28,7 +29,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
@Mod(
|
||||
modid = "ExtraBees",
|
||||
name = "Extra Bees",
|
||||
version = BinnieCore.VERSION,
|
||||
version = Tags.VERSION,
|
||||
useMetadata = true,
|
||||
dependencies = "after:BinnieCore")
|
||||
public class ExtraBees extends AbstractMod {
|
||||
|
||||
@@ -7,12 +7,10 @@ import java.util.List;
|
||||
import binnie.extrabees.genetics.requirements.DummyMutationCondition;
|
||||
import binnie.extrabees.genetics.requirements.IMutationRequirement;
|
||||
import binnie.extrabees.genetics.requirements.RequirementPerson;
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeMutationCustom;
|
||||
import forestry.api.apiculture.IBeeRoot;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IMutation;
|
||||
import forestry.apiculture.genetics.BeeMutation;
|
||||
@@ -21,7 +19,7 @@ public class ExtraBeeMutation extends BeeMutation implements IBeeMutationCustom
|
||||
|
||||
public static List<IMutation> mutations = new ArrayList<>();
|
||||
|
||||
private List<IMutationRequirement> requirements;
|
||||
private final List<IMutationRequirement> requirements;
|
||||
|
||||
public ExtraBeeMutation(IAlleleBeeSpecies bee0, IAlleleBeeSpecies bee1, IAllele[] result, int chance) {
|
||||
super(bee0, bee1, result, chance);
|
||||
@@ -29,11 +27,6 @@ public class ExtraBeeMutation extends BeeMutation implements IBeeMutationCustom
|
||||
mutations.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeeRoot getRoot() {
|
||||
return BeeManager.beeRoot;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getChance(IBeeHousing housing, IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1,
|
||||
IBeeGenome genome0, IBeeGenome genome1) {
|
||||
|
||||
@@ -45,7 +45,7 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
MYSTICAL,
|
||||
BEDROCK;
|
||||
|
||||
protected boolean dominant;
|
||||
private final boolean dominant;
|
||||
|
||||
ExtraBeesFlowers() {
|
||||
dominant = true;
|
||||
@@ -87,41 +87,20 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
}
|
||||
|
||||
public ItemStack[] getItemStacks() {
|
||||
switch (this) {
|
||||
case WATER:
|
||||
return new ItemStack[] { new ItemStack(Blocks.waterlily) };
|
||||
|
||||
case SUGAR:
|
||||
return new ItemStack[] { new ItemStack(Blocks.reeds) };
|
||||
|
||||
case ROCK:
|
||||
return new ItemStack[] { new ItemStack(Blocks.cobblestone) };
|
||||
|
||||
case BOOK:
|
||||
return new ItemStack[] { new ItemStack(Blocks.bookshelf) };
|
||||
|
||||
case REDSTONE:
|
||||
return new ItemStack[] { new ItemStack(Blocks.redstone_torch) };
|
||||
|
||||
case DEAD:
|
||||
return new ItemStack[] { new ItemStack(Blocks.deadbush) };
|
||||
|
||||
case FRUIT:
|
||||
return new ItemStack[] { new ItemStack(Items.apple) };
|
||||
|
||||
case LEAVES:
|
||||
return new ItemStack[] { new ItemStack(Blocks.leaves) };
|
||||
|
||||
case SAPLING:
|
||||
return new ItemStack[] { new ItemStack(Blocks.sapling) };
|
||||
|
||||
case WOOD:
|
||||
return new ItemStack[] { new ItemStack(Blocks.log) };
|
||||
|
||||
case BEDROCK:
|
||||
return new ItemStack[] { new ItemStack(Blocks.bedrock) };
|
||||
}
|
||||
return new ItemStack[0];
|
||||
return switch (this) {
|
||||
case WATER -> new ItemStack[] { new ItemStack(Blocks.waterlily) };
|
||||
case SUGAR -> new ItemStack[] { new ItemStack(Blocks.reeds) };
|
||||
case ROCK -> new ItemStack[] { new ItemStack(Blocks.cobblestone) };
|
||||
case BOOK -> new ItemStack[] { new ItemStack(Blocks.bookshelf) };
|
||||
case REDSTONE -> new ItemStack[] { new ItemStack(Blocks.redstone_torch) };
|
||||
case DEAD -> new ItemStack[] { new ItemStack(Blocks.deadbush) };
|
||||
case FRUIT -> new ItemStack[] { new ItemStack(Items.apple) };
|
||||
case LEAVES -> new ItemStack[] { new ItemStack(Blocks.leaves) };
|
||||
case SAPLING -> new ItemStack[] { new ItemStack(Blocks.sapling) };
|
||||
case WOOD -> new ItemStack[] { new ItemStack(Blocks.log) };
|
||||
case BEDROCK -> new ItemStack[] { new ItemStack(Blocks.bedrock) };
|
||||
default -> new ItemStack[0];
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -136,57 +115,31 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (this) {
|
||||
case WATER:
|
||||
return block == Blocks.waterlily;
|
||||
|
||||
case ROCK:
|
||||
return block.getMaterial() == Material.rock;
|
||||
|
||||
case SUGAR:
|
||||
return block == Blocks.reeds;
|
||||
|
||||
case BOOK:
|
||||
return block == Blocks.bookshelf;
|
||||
|
||||
case REDSTONE:
|
||||
return block == Blocks.redstone_torch;
|
||||
|
||||
case DEAD:
|
||||
return block == Blocks.deadbush;
|
||||
|
||||
case WOOD:
|
||||
return block.isWood(world, x, y, z);
|
||||
|
||||
case FRUIT:
|
||||
return world.getTileEntity(x, y, z) instanceof IFruitBearer;
|
||||
|
||||
case LEAVES:
|
||||
return block.isLeaves(world, x, y, z);
|
||||
|
||||
case SAPLING:
|
||||
return block.getClass().getName().toLowerCase().contains("sapling");
|
||||
|
||||
case MYSTICAL:
|
||||
return block == Mods.botania.block("flower");
|
||||
case BEDROCK:
|
||||
return block == Blocks.bedrock;
|
||||
}
|
||||
return false;
|
||||
return switch (this) {
|
||||
case WATER -> block == Blocks.waterlily;
|
||||
case ROCK -> block.getMaterial() == Material.rock;
|
||||
case SUGAR -> block == Blocks.reeds;
|
||||
case BOOK -> block == Blocks.bookshelf;
|
||||
case REDSTONE -> block == Blocks.redstone_torch;
|
||||
case DEAD -> block == Blocks.deadbush;
|
||||
case WOOD -> block.isWood(world, x, y, z);
|
||||
case FRUIT -> world.getTileEntity(x, y, z) instanceof IFruitBearer;
|
||||
case LEAVES -> block.isLeaves(world, x, y, z);
|
||||
case SAPLING -> block.getClass().getName().toLowerCase().contains("sapling");
|
||||
case MYSTICAL -> block == Mods.botania.block("flower");
|
||||
case BEDROCK -> block == Blocks.bedrock;
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(World world, IIndividual individual, int x, int y, int z) {
|
||||
switch (this) {
|
||||
case WATER:
|
||||
return world.isAirBlock(x, y, z) && world.getBlock(x, y - 1, z) == Blocks.water
|
||||
&& world.setBlock(x, y, z, Blocks.waterlily, 0, 2);
|
||||
|
||||
case SUGAR:
|
||||
return world.getBlock(x, y - 1, z) == Blocks.reeds && world.isAirBlock(x, y, z)
|
||||
&& world.setBlock(x, y, z, Blocks.reeds, 0, 0);
|
||||
}
|
||||
return false;
|
||||
return switch (this) {
|
||||
case WATER -> world.isAirBlock(x, y, z) && world.getBlock(x, y - 1, z) == Blocks.water
|
||||
&& world.setBlock(x, y, z, Blocks.waterlily, 0, 2);
|
||||
case SUGAR -> world.getBlock(x, y - 1, z) == Blocks.reeds && world.isAirBlock(x, y, z)
|
||||
&& world.setBlock(x, y, z, Blocks.reeds, 0, 0);
|
||||
default -> false;
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,6 +26,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.genetics.ExtraBeesFlowers;
|
||||
@@ -67,18 +68,25 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
BONEMEAL_MUSHROOM,
|
||||
POWER;
|
||||
|
||||
protected static List<Birthday> birthdays;
|
||||
private static final List<Birthday> birthdays = new ArrayList<>();
|
||||
|
||||
static {
|
||||
birthdays = new ArrayList<>();
|
||||
birthdays.add(new Birthday(3, 10, "Binnie"));
|
||||
|
||||
// At the time Binnie abandoned this, the month was bumped by one, the day by two, and the order flipped.
|
||||
// That resulted in the actual date being Apr. 11th instead of Oct. 3rd. I fixed this, but the old behavior is
|
||||
// preserved outside NH, in case someone wasn't expecting that.
|
||||
if (Mods.dreamcraft.active()) {
|
||||
birthdays.add(new Birthday(3, 10, "Binnie"));
|
||||
} else {
|
||||
birthdays.add(new Birthday(11, 4, "Binnie"));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean combinable;
|
||||
public boolean dominant;
|
||||
public final boolean combinable;
|
||||
public final boolean dominant;
|
||||
public int id;
|
||||
String fx;
|
||||
private String uid;
|
||||
private final String uid;
|
||||
|
||||
ExtraBeesEffect() {
|
||||
fx = "";
|
||||
@@ -382,8 +390,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
|
||||
private void onFoodEffect(IBeeGenome genome, IBeeHousing housing) {
|
||||
for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
if (entity instanceof EntityPlayer player) {
|
||||
player.getFoodStats().addStats(2, 0.2f);
|
||||
}
|
||||
}
|
||||
@@ -391,8 +398,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
|
||||
private void onHungerEffect(IBeeGenome genome, IBeeHousing housing, World world) {
|
||||
for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
if (entity instanceof EntityPlayer player) {
|
||||
if (world.rand.nextInt(4) < wearsItems(player)) {
|
||||
continue;
|
||||
}
|
||||
@@ -405,8 +411,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
|
||||
private void onPotionEffect(IBeeGenome genome, IBeeHousing housing, World world, PotionEffect potion) {
|
||||
for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer) entity;
|
||||
if (entity instanceof EntityPlayer player) {
|
||||
if (world.rand.nextInt(4) < wearsItems(player)) {
|
||||
continue;
|
||||
}
|
||||
@@ -493,12 +498,12 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
}
|
||||
|
||||
List<Entity> entities = getEntities(Entity.class, genome, housing);
|
||||
if (entities.size() == 0) {
|
||||
if (entities.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Entity entity = entities.get(world.rand.nextInt(entities.size()));
|
||||
if (!(entity instanceof EntityLiving)) {
|
||||
if (!(entity instanceof EntityLiving living)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -509,7 +514,6 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
return;
|
||||
}
|
||||
|
||||
EntityLiving living = (EntityLiving) entity;
|
||||
living.setPositionAndUpdate(x, y, z);
|
||||
living.addPotionEffect(new PotionEffect(Potion.confusion.id, 160, 10));
|
||||
}
|
||||
@@ -562,21 +566,19 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
}
|
||||
}
|
||||
|
||||
protected int[] getModifiedArea(IBeeGenome genome, IBeeHousing housing) {
|
||||
private int[] getModifiedArea(IBeeGenome genome, IBeeHousing housing) {
|
||||
int[] territory;
|
||||
int[] area = territory = genome.getTerritory();
|
||||
int n = 0;
|
||||
territory[n] *= (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f)
|
||||
* 3.0f);
|
||||
|
||||
int[] array = area;
|
||||
int n2 = 1;
|
||||
array[n2] *= (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f)
|
||||
area[n2] *= (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f)
|
||||
* 3.0f);
|
||||
|
||||
int[] array2 = area;
|
||||
int n3 = 2;
|
||||
array2[n3] *= (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f)
|
||||
area[n3] *= (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f)
|
||||
* 3.0f);
|
||||
|
||||
if (area[0] < 1) {
|
||||
@@ -609,7 +611,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
|
||||
public <T extends Entity> List<T> getEntities(Class<T> eClass, IBeeGenome genome, IBeeHousing housing) {
|
||||
int[] area = genome.getTerritory();
|
||||
int[] offset = { -Math.round(area[0] / 2), -Math.round(area[1] / 2), -Math.round(area[2] / 2) };
|
||||
int[] offset = { -Math.round(area[0] / 2f), -Math.round(area[1] / 2f), -Math.round(area[2] / 2f) };
|
||||
int[] min = { housing.getCoordinates().posX + offset[0], housing.getCoordinates().posY + offset[1],
|
||||
housing.getCoordinates().posZ + offset[2] };
|
||||
int[] max = { housing.getCoordinates().posX + offset[0] + area[0],
|
||||
@@ -632,12 +634,13 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
|
||||
private Birthday(int day, int month, String name) {
|
||||
this.day = day;
|
||||
this.month = month + 1;
|
||||
this.month = month - 1;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public boolean isToday() {
|
||||
return Calendar.getInstance().get(5) == month && Calendar.getInstance().get(2) == day;
|
||||
return Calendar.getInstance().get(Calendar.MONTH) == month
|
||||
&& Calendar.getInstance().get(Calendar.DATE) == day;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
||||
@@ -53,7 +53,7 @@ public class FireworkCreator {
|
||||
nbt.setBoolean("Trail", true);
|
||||
}
|
||||
|
||||
if (colors.size() == 0) {
|
||||
if (colors.isEmpty()) {
|
||||
addColor(0xffffff);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class ItemDictionary extends Item {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
if (stack.getItemDamage() > 0) {
|
||||
tooltip.add(I18N.localise("extrabees.item.database.tooltip"));
|
||||
@@ -51,7 +51,7 @@ public class ItemDictionary extends Item {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
super.getSubItems(item, tab, list);
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ public class ControlProductsBox extends ControlListBox<Product> {
|
||||
|
||||
protected IAlleleBeeSpecies species;
|
||||
|
||||
private ProductType type;
|
||||
private final ProductType type;
|
||||
|
||||
public ControlProductsBox(IWidget parent, int x, int y, int width, int height, ProductType type) {
|
||||
super(parent, x, y, width, height, 12.0f);
|
||||
|
||||
@@ -20,9 +20,9 @@ public enum ExtraBeeLiquid implements ILiquidType {
|
||||
POISON("poison", new Color(0xeb14eb)),
|
||||
GLACIAL("liquidnitrogen", new Color(0x96c8c8));
|
||||
|
||||
protected String ident;
|
||||
protected IIcon icon;
|
||||
protected int color;
|
||||
private final String ident;
|
||||
private IIcon icon;
|
||||
private final int color;
|
||||
|
||||
ExtraBeeLiquid(String ident, Color color) {
|
||||
this.ident = ident;
|
||||
|
||||
@@ -101,12 +101,12 @@ public enum EnumHoneyComb implements IItemEnum {
|
||||
CYANITE(new Color(0x27204d), new Color(0x86ed)),
|
||||
BLUTONIUM(new Color(0x27204d), new Color(0x1b00e6));
|
||||
|
||||
public Map<ItemStack, Float> products;
|
||||
public final Map<ItemStack, Float> products;
|
||||
public final int primaryColor;
|
||||
public final int secondaryColor;
|
||||
public final String name;
|
||||
|
||||
protected boolean active;
|
||||
boolean active;
|
||||
|
||||
EnumHoneyComb(Color primaryColor, Color secondaryColor) {
|
||||
this.primaryColor = primaryColor.getRGB();
|
||||
|
||||
@@ -47,8 +47,8 @@ public enum EnumHoneyDrop implements IItemEnum {
|
||||
public final int primaryColor;
|
||||
public final int secondaryColor;
|
||||
|
||||
protected String liquidName;
|
||||
protected ItemStack remenant;
|
||||
private final String liquidName;
|
||||
private ItemStack remenant;
|
||||
|
||||
EnumHoneyDrop(Color primaryColor, Color secondaryColor, String liquid) {
|
||||
this.primaryColor = primaryColor.getRGB();
|
||||
|
||||
@@ -243,43 +243,23 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
EnumHoneyDrop drop = EnumHoneyDrop.values()[EnumHoneyDrop.RED.ordinal() + i];
|
||||
int[] dyeC = { 1, 11, 4, 2, 0, 15, 3, 14, 6, 5, 8, 12, 9, 10, 13, 7 };
|
||||
int k = dyeC[i];
|
||||
ItemStack dye = new ItemStack(Items.dye, 1, k);
|
||||
switch (k) {
|
||||
case 0:
|
||||
dye = ExtraBeeItems.BlackDye.get(1);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
dye = ExtraBeeItems.RedDye.get(1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
dye = ExtraBeeItems.GreenDye.get(1);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
dye = ExtraBeeItems.BrownDye.get(1);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
dye = ExtraBeeItems.BlueDye.get(1);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
dye = ExtraBeeItems.YellowDye.get(1);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
dye = ExtraBeeItems.WhiteDye.get(1);
|
||||
break;
|
||||
}
|
||||
ItemStack dye = switch (k) {
|
||||
case 0 -> ExtraBeeItems.BlackDye.get(1);
|
||||
case 1 -> ExtraBeeItems.RedDye.get(1);
|
||||
case 2 -> ExtraBeeItems.GreenDye.get(1);
|
||||
case 3 -> ExtraBeeItems.BrownDye.get(1);
|
||||
case 4 -> ExtraBeeItems.BlueDye.get(1);
|
||||
case 11 -> ExtraBeeItems.YellowDye.get(1);
|
||||
case 15 -> ExtraBeeItems.WhiteDye.get(1);
|
||||
default -> new ItemStack(Items.dye, 1, k);
|
||||
};
|
||||
type.addProduct(drop.get(1), 1.00f);
|
||||
drop.addRemenant(dye);
|
||||
}
|
||||
}
|
||||
|
||||
private static ItemStack getOreDictionary(String string) {
|
||||
if (OreDictionary.getOres(string).size() > 0) {
|
||||
if (!OreDictionary.getOres(string).isEmpty()) {
|
||||
return OreDictionary.getOres(string).get(0);
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ItemProduct extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (IItemEnum type : types) {
|
||||
if (type.isActive()) {
|
||||
list.add(new ItemStack(this, 1, type.ordinal()));
|
||||
|
||||
@@ -36,7 +36,7 @@ public class BlockExtraBeeHive extends Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> itemList) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public enum EnumHiveType {
|
||||
NETHER,
|
||||
MARBLE;
|
||||
|
||||
public List<IHiveDrop> drops;
|
||||
public final List<IHiveDrop> drops;
|
||||
|
||||
EnumHiveType() {
|
||||
drops = new ArrayList<>();
|
||||
|
||||
@@ -15,9 +15,9 @@ import forestry.api.genetics.IAllele;
|
||||
|
||||
public class HiveDrop implements IHiveDrop {
|
||||
|
||||
private IAllele[] template;
|
||||
private ArrayList<ItemStack> additional;
|
||||
private int chance;
|
||||
private final IAllele[] template;
|
||||
private final ArrayList<ItemStack> additional;
|
||||
private final int chance;
|
||||
|
||||
public HiveDrop(IAlleleBeeSpecies species, int chance) {
|
||||
this(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()), new ItemStack[0], chance);
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ItemBeehive extends ItemBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user