mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-25 14:34:33 +00:00
Merge branch 'master-MC1.10.2' of https://github.com/ForestryMC/Binnie into master-MC1.10.2
# Conflicts: # src/main/java/binnie/extratrees/genetics/ExtraTreeSpecies.java # src/main/java/binnie/extratrees/genetics/ModuleGenetics.java
This commit is contained in:
commit
8c9cd7c202
43 files changed
+258
-215
No files matched your search
@@ -24,8 +24,8 @@ public class CeramicDesignSystem implements IDesignSystem {
|
||||
Map<Integer, TextureAtlasSprite> secondary;
|
||||
|
||||
CeramicDesignSystem() {
|
||||
this.primary = new HashMap<Integer, TextureAtlasSprite>();
|
||||
this.secondary = new HashMap<Integer, TextureAtlasSprite>();
|
||||
this.primary = new HashMap<>();
|
||||
this.secondary = new HashMap<>();
|
||||
DesignerManager.instance.registerDesignSystem(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class CircuitGarden extends BinnieCircuit {
|
||||
private EnumMoisture moisture;
|
||||
private EnumAcidity acidity;
|
||||
private GardenLogic logic;
|
||||
|
||||
|
||||
public CircuitGarden(EnumMoisture moisture, EnumAcidity ph, boolean manual, boolean fertilised, ItemStack recipe, ItemStack icon) {
|
||||
super(getName(moisture, ph, manual, fertilised), 4, manual ? ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual") : ChipsetManager.circuitRegistry.getLayout("forestry.farms.managed"), recipe);
|
||||
this.isFertilised = false;
|
||||
@@ -30,34 +30,34 @@ public class CircuitGarden extends BinnieCircuit {
|
||||
this.logic = new GardenLogic(this.moisture, this.acidity, this.isManual, this.isFertilised, this.icon, Binnie.Language.localise(this.getUnlocalizedName()));
|
||||
String info = "";
|
||||
if (moisture != EnumMoisture.Normal) {
|
||||
info+=TextFormatting.GRAY + Binnie.Language.localise("botany.moisture") + ": " + moisture.getTranslated(true);
|
||||
info += TextFormatting.GRAY + Binnie.Language.localise("botany.moisture") + ": " + moisture.getTranslated(true);
|
||||
}
|
||||
if (info.length() > 0) {
|
||||
info += ", ";
|
||||
}
|
||||
if (ph != null) {
|
||||
info+=TextFormatting.GRAY + Binnie.Language.localise("botany.ph") + ": " + ph.getTranslated(true);
|
||||
info += TextFormatting.GRAY + Binnie.Language.localise("botany.ph") + ": " + ph.getTranslated(true);
|
||||
}
|
||||
if (info.length() > 0) {
|
||||
info = " (" + info + TextFormatting.RESET + ")";
|
||||
}
|
||||
this.addTooltipString("Flowers" + info);
|
||||
}
|
||||
|
||||
private static String getName(EnumMoisture moisture, EnumAcidity ph, boolean manual, boolean fertilised){
|
||||
|
||||
private static String getName(EnumMoisture moisture, EnumAcidity ph, boolean manual, boolean fertilised) {
|
||||
String name = "garden." + moisture.getName();
|
||||
if(ph != null){
|
||||
if (ph != null) {
|
||||
name += "." + ph.getName();
|
||||
}
|
||||
if(manual){
|
||||
if (manual) {
|
||||
name += ".manual";
|
||||
}
|
||||
if(fertilised){
|
||||
if (fertilised) {
|
||||
name += ".fert";
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
public CircuitGarden setManual() {
|
||||
isManual = true;
|
||||
return this;
|
||||
|
||||
@@ -65,14 +65,14 @@ public class GardenLogic extends FarmLogic {
|
||||
public boolean isAcceptedResource(final ItemStack itemstack) {
|
||||
return Gardening.isSoil(itemstack.getItem()) || itemstack.getItem() == Item.getItemFromBlock(Blocks.SAND) || itemstack.getItem() == Item.getItemFromBlock(Blocks.DIRT) || Gardening.isAcidFertiliser(itemstack) || Gardening.isAlkalineFertiliser(itemstack);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Collection<ItemStack> collect(World world, IFarmHousing farmHousing) {
|
||||
final Collection<ItemStack> products = this.produce;
|
||||
this.produce = new ArrayList<ItemStack>();
|
||||
this.produce = new ArrayList<>();
|
||||
return products;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean cultivate(World world, IFarmHousing farmHousing, BlockPos pos, FarmDirection direction, int extent) {
|
||||
return this.maintainSoil(world, pos, direction, extent, farmHousing) || (!this.isManual && this.maintainWater(world, pos, direction, extent, farmHousing)) || this.maintainCrops(world, pos.up(), direction, extent, farmHousing);
|
||||
@@ -93,22 +93,21 @@ public class GardenLogic extends FarmLogic {
|
||||
}
|
||||
if (getBlock(world, position.up()) == Botany.plant) {
|
||||
world.setBlockToAir(position.up());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (this.acidity != null && Gardening.isSoil(getBlock(world, position))) {
|
||||
IBlockSoil soil = (IBlockSoil) getBlock(world, position);
|
||||
EnumAcidity pH = soil.getPH(world, position);
|
||||
if (pH.ordinal() < this.acidity.ordinal()) {
|
||||
ItemStack stack = this.getAvailableAlkaline(housing);
|
||||
if (stack != null && soil.setPH(world, position, EnumAcidity.values()[pH.ordinal() + 1])) {
|
||||
housing.getFarmInventory().removeResources(new ItemStack[] { stack });
|
||||
housing.getFarmInventory().removeResources(new ItemStack[]{stack});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (pH.ordinal() > this.acidity.ordinal()) {
|
||||
final ItemStack stack = this.getAvailableAcid(housing);
|
||||
if (stack != null && soil.setPH(world, position, EnumAcidity.values()[pH.ordinal() - 1])) {
|
||||
housing.getFarmInventory().removeResources(new ItemStack[] { stack });
|
||||
housing.getFarmInventory().removeResources(new ItemStack[]{stack});
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -121,8 +120,7 @@ public class GardenLogic extends FarmLogic {
|
||||
this.setBlock(world, position, Blocks.AIR, 0);
|
||||
return trySetSoil(world, position, loam, housing);
|
||||
}
|
||||
}
|
||||
else if (!this.isManual) {
|
||||
} else if (!this.isManual) {
|
||||
if (!this.isWaterBlock(world, position)) {
|
||||
if (i % 2 == 0) {
|
||||
return trySetSoil(world, position, housing);
|
||||
@@ -130,11 +128,9 @@ public class GardenLogic extends FarmLogic {
|
||||
FarmDirection cclock = FarmDirection.EAST;
|
||||
if (direction == FarmDirection.EAST) {
|
||||
cclock = FarmDirection.SOUTH;
|
||||
}
|
||||
else if (direction == FarmDirection.SOUTH) {
|
||||
} else if (direction == FarmDirection.SOUTH) {
|
||||
cclock = FarmDirection.EAST;
|
||||
}
|
||||
else if (direction == FarmDirection.WEST) {
|
||||
} else if (direction == FarmDirection.WEST) {
|
||||
cclock = FarmDirection.SOUTH;
|
||||
}
|
||||
BlockPos previous = position.offset(cclock.getFacing());
|
||||
@@ -157,14 +153,11 @@ public class GardenLogic extends FarmLogic {
|
||||
boolean isEnclosed = true;
|
||||
if (world.isAirBlock(position.east())) {
|
||||
isEnclosed = false;
|
||||
}
|
||||
else if (world.isAirBlock(position.west())) {
|
||||
} else if (world.isAirBlock(position.west())) {
|
||||
isEnclosed = false;
|
||||
}
|
||||
else if (world.isAirBlock(position.south())) {
|
||||
} else if (world.isAirBlock(position.south())) {
|
||||
isEnclosed = false;
|
||||
}
|
||||
else if (world.isAirBlock(position.north())) {
|
||||
} else if (world.isAirBlock(position.north())) {
|
||||
isEnclosed = false;
|
||||
}
|
||||
isEnclosed = (isEnclosed || this.moisture != EnumMoisture.Damp);
|
||||
@@ -257,12 +250,12 @@ public class GardenLogic extends FarmLogic {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Collection<ICrop> harvest(World world, BlockPos pos, FarmDirection direction, int extent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureMap() {
|
||||
return TextureMap.LOCATION_BLOCKS_TEXTURE;
|
||||
@@ -293,17 +286,17 @@ public class GardenLogic extends FarmLogic {
|
||||
|
||||
private boolean trySetCrop(World world, BlockPos position, IFarmHousing housing) {
|
||||
for (IFarmable farmable : this.farmables) {
|
||||
if(housing.plantGermling(farmable, world, position)){
|
||||
if (housing.plantGermling(farmable, world, position)) {
|
||||
if (housing instanceof IOwnedTile) {
|
||||
TileEntity tile = world.getTileEntity(position);
|
||||
if (tile instanceof TileEntityFlower) {
|
||||
TileEntityFlower flower = (TileEntityFlower) tile;
|
||||
IOwnedTile owned = (IOwnedTile) housing;
|
||||
|
||||
|
||||
flower.setOwner(owned.getOwnerHandler().getOwner());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -243,7 +243,7 @@ public class BlockFlower extends BlockContainer implements IColoredBlock, IState
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
|
||||
ArrayList<ItemStack> drops = new ArrayList<>();
|
||||
TileEntity tile = world.getTileEntity(pos);
|
||||
if (tile instanceof TileEntityFlower && ((TileEntityFlower) tile).getSection() == 0) {
|
||||
ItemStack flower = ((TileEntityFlower) tile).getItemStack();
|
||||
|
||||
@@ -210,7 +210,7 @@ public class ItemBotany extends Item implements IColoredItem, IItemModelRegister
|
||||
pos = pos.offset(facing);
|
||||
}
|
||||
|
||||
if (stack.stackSize != 0 && player.canPlayerEdit(pos, facing, stack) && world.canBlockBePlaced(Botany.flower, pos, false, facing, (Entity) null, stack)) {
|
||||
if (stack.stackSize != 0 && player.canPlayerEdit(pos, facing, stack) && world.canBlockBePlaced(Botany.flower, pos, false, facing, null, stack)) {
|
||||
int i = this.getMetadata(stack.getMetadata());
|
||||
IBlockState iblockstate1 = Botany.flower.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, i, player, stack);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.core.item.ItemCore;
|
||||
import forestry.api.core.IModelManager;
|
||||
|
||||
@@ -155,15 +155,15 @@ public class BlockSoil extends Block implements IBlockSoil, IItemModelRegister {
|
||||
world.setBlockState(pos.up(), Botany.plant.getStateFromMeta(BlockPlant.Type.Weeds.ordinal()), 2);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn){
|
||||
super.neighborChanged(state, worldIn, pos, blockIn);
|
||||
|
||||
if (worldIn.getBlockState(pos.up()).getMaterial().isSolid()){
|
||||
worldIn.setBlockState(pos, Blocks.DIRT.getDefaultState());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn) {
|
||||
super.neighborChanged(state, worldIn, pos, blockIn);
|
||||
|
||||
if (worldIn.getBlockState(pos.up()).getMaterial().isSolid()) {
|
||||
worldIn.setBlockState(pos, Blocks.DIRT.getDefaultState());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import com.google.common.collect.Multimap;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -72,18 +71,18 @@ public class ItemTrowel extends Item implements IItemModelRegister {
|
||||
stack.damageItem(1, player);
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot){
|
||||
Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);
|
||||
|
||||
if (equipmentSlot == EntityEquipmentSlot.MAINHAND){
|
||||
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", theToolMaterial.getDamageVsEntity() + 0.5, 0));
|
||||
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", -1.5, 0));
|
||||
}
|
||||
@Override
|
||||
public Multimap<String, AttributeModifier> getItemAttributeModifiers(EntityEquipmentSlot equipmentSlot) {
|
||||
Multimap<String, AttributeModifier> multimap = super.getItemAttributeModifiers(equipmentSlot);
|
||||
|
||||
return multimap;
|
||||
}
|
||||
if (equipmentSlot == EntityEquipmentSlot.MAINHAND) {
|
||||
multimap.put(SharedMonsterAttributes.ATTACK_DAMAGE.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_DAMAGE_MODIFIER, "Tool modifier", theToolMaterial.getDamageVsEntity() + 0.5, 0));
|
||||
multimap.put(SharedMonsterAttributes.ATTACK_SPEED.getAttributeUnlocalizedName(), new AttributeModifier(ATTACK_SPEED_MODIFIER, "Tool modifier", -1.5, 0));
|
||||
}
|
||||
|
||||
return multimap;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -112,11 +112,11 @@ public class ModuleGardening implements IInitializable {
|
||||
for (boolean fertilised : new boolean[]{true, false}) {
|
||||
for (EnumMoisture moist : EnumMoisture.values()) {
|
||||
ItemStack icon;
|
||||
if(moist == EnumMoisture.Dry){
|
||||
if (moist == EnumMoisture.Dry) {
|
||||
icon = yellow;
|
||||
}else if(moist == EnumMoisture.Normal){
|
||||
} else if (moist == EnumMoisture.Normal) {
|
||||
icon = red;
|
||||
}else{
|
||||
} else {
|
||||
icon = blue;
|
||||
}
|
||||
int insulate = 2 - moist.ordinal();
|
||||
|
||||
@@ -5,83 +5,117 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.Loader;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion;
|
||||
import net.minecraftforge.fml.common.versioning.Restriction;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
|
||||
import java.util.Objects;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class Mods {
|
||||
public static Mod Forestry = new Mod("forestry") {
|
||||
@Override
|
||||
public boolean dev() {
|
||||
final String forVersion = Loader.instance().getIndexedModList().get("forestry").getVersion();
|
||||
final Restriction rest = new Restriction(new DefaultArtifactVersion("3.6"), true, null, false);
|
||||
return rest.containsVersion(new DefaultArtifactVersion(forVersion));
|
||||
}
|
||||
};
|
||||
public static ModNonnull Forestry = new ModNonnull("forestry");
|
||||
public static Mod IC2 = new Mod("IC2");
|
||||
public static Mod Botania = new Mod("Botania");
|
||||
private static boolean WARN = true;
|
||||
|
||||
private static Item findItem(final String modId, final String name) {
|
||||
final Item stack = Item.REGISTRY.getObject(new ResourceLocation(modId, name));
|
||||
if (stack == null && Mods.WARN && Objects.equals(modId, "forestry")) {
|
||||
//throw new RuntimeException("Item not found: " + modId + ":" + name);
|
||||
}
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
private static ItemStack findItemStack(final String modId, final String name, final int stackSize) {
|
||||
final ItemStack stack = GameRegistry.makeItemStack(modId + ":" + name, 0, stackSize, null);
|
||||
if (stack == null && Mods.WARN && Objects.equals(modId, "forestry")) {
|
||||
//throw new RuntimeException("Stack not found: " + modId + ":" + name);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
private static Block findBlock(final String modId, final String name) {
|
||||
final Block stack = Block.REGISTRY.getObject(new ResourceLocation(modId + ":" + name));
|
||||
if (stack == null && Mods.WARN && Objects.equals(modId, "forestry")) {
|
||||
//throw new RuntimeException("Block not found: " + modId + ":" + name);
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
public static class Mod {
|
||||
private String id;
|
||||
protected final String id;
|
||||
|
||||
private Mod(final String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Item item(final String name) {
|
||||
return findItem(this.id, name);
|
||||
ResourceLocation key = new ResourceLocation(this.id, name);
|
||||
if (!ForgeRegistries.ITEMS.containsKey(key)) {
|
||||
return null;
|
||||
}
|
||||
return ForgeRegistries.ITEMS.getValue(key);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Block block(final String name) {
|
||||
return findBlock(this.id, name);
|
||||
}
|
||||
|
||||
public ItemStack stack(final String name, final int stackSize) {
|
||||
return findItemStack(this.id, name, stackSize);
|
||||
ResourceLocation key = new ResourceLocation(this.id, name);
|
||||
if (!ForgeRegistries.BLOCKS.containsKey(key)) {
|
||||
throw new RuntimeException("Block not found: " + key);
|
||||
}
|
||||
return ForgeRegistries.BLOCKS.getValue(key);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ItemStack stack(final String name) {
|
||||
return this.stack(name, 1);
|
||||
Item item = this.item(name);
|
||||
if (item == null) {
|
||||
return null;
|
||||
}
|
||||
return new ItemStack(item);
|
||||
}
|
||||
|
||||
public ItemStack stack(final String string, final int amount, final int meta) {
|
||||
return new ItemStack(this.item(string), amount, meta);
|
||||
@Nullable
|
||||
public ItemStack stack(final String name, final int amount) {
|
||||
Item item = this.item(name);
|
||||
if (item == null) {
|
||||
return null;
|
||||
}
|
||||
return new ItemStack(item, amount);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ItemStack stack(final String name, final int amount, final int meta) {
|
||||
Item item = this.item(name);
|
||||
if (item == null) {
|
||||
return null;
|
||||
}
|
||||
return new ItemStack(item, amount, meta);
|
||||
}
|
||||
|
||||
public boolean active() {
|
||||
return Loader.isModLoaded(this.id);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean dev() {
|
||||
return false;
|
||||
public static class ModNonnull extends Mod {
|
||||
private ModNonnull(final String id) {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Item item(final String name) {
|
||||
Item item = super.item(name);
|
||||
if (item == null) {
|
||||
throw new RuntimeException("Item not found: " + this.id + ":" + name);
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Block block(final String name) {
|
||||
Block block = super.block(name);
|
||||
if (block == null) {
|
||||
throw new RuntimeException("Block not found: " + this.id + ":" + name);
|
||||
}
|
||||
return block;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack stack(final String name) {
|
||||
Item item = this.item(name);
|
||||
return new ItemStack(item);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack stack(final String name, final int amount) {
|
||||
Item item = this.item(name);
|
||||
return new ItemStack(item, amount);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public ItemStack stack(final String name, final int amount, final int meta) {
|
||||
Item item = this.item(name);
|
||||
return new ItemStack(item, amount, meta);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,13 @@ import binnie.core.Mods;
|
||||
import binnie.genetics.item.GeneticsItems;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public enum FluidContainer {
|
||||
Capsule,
|
||||
@@ -47,26 +53,42 @@ public enum FluidContainer {
|
||||
public ItemStack getEmpty() {
|
||||
switch (this) {
|
||||
case Can: {
|
||||
return Mods.Forestry.stack("canEmpty");
|
||||
return Mods.Forestry.stack("can");
|
||||
}
|
||||
case Capsule: {
|
||||
return Mods.Forestry.stack("waxCapsule");
|
||||
return Mods.Forestry.stack("capsule");
|
||||
}
|
||||
case Glass: {
|
||||
return new ItemStack(Items.GLASS_BOTTLE, 1, 0);
|
||||
}
|
||||
case Refractory: {
|
||||
return Mods.Forestry.stack("refractoryEmpty");
|
||||
return Mods.Forestry.stack("refractory");
|
||||
}
|
||||
case Cylinder: {
|
||||
return GeneticsItems.Cylinder.get(1);
|
||||
}
|
||||
default: {
|
||||
return null;
|
||||
throw new IllegalArgumentException("Unknown container: " + this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ItemStack getFilled(Fluid fluid) {
|
||||
ItemStack stack = getEmpty();
|
||||
if (stack != null) {
|
||||
stack = stack.copy();
|
||||
IFluidHandler fluidHandler = FluidUtil.getFluidHandler(stack);
|
||||
if (fluidHandler != null) {
|
||||
int fill = fluidHandler.fill(new FluidStack(fluid, Integer.MAX_VALUE), true);
|
||||
if (fill > 0) {
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void registerContainerData(final IFluidType fluid) {
|
||||
if (!this.isActive()) {
|
||||
return;
|
||||
|
||||
@@ -261,9 +261,9 @@ public class TileEntityMachineBase extends TileEntity implements IInventoryMachi
|
||||
public <T> T getCapability(Capability<T> capability, EnumFacing facing) {
|
||||
if (capability == CapabilityEnergy.ENERGY) {
|
||||
return CapabilityEnergy.ENERGY.cast(this);
|
||||
}else if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY){
|
||||
} else if (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) {
|
||||
return CapabilityItemHandler.ITEM_HANDLER_CAPABILITY.cast(new InvWrapper(getInventory()));
|
||||
}else if(capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY){
|
||||
} else if (capability == CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY) {
|
||||
return CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY.cast(getHandler(facing));
|
||||
}
|
||||
return super.getCapability(capability, facing);
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ComponentTankContainer extends MachineComponent implements ITankMac
|
||||
super(machine);
|
||||
this.tanks = new LinkedHashMap<>();
|
||||
this.handlers = new EnumMap<>(EnumFacing.class);
|
||||
for(EnumFacing facing : EnumFacing.VALUES){
|
||||
for (EnumFacing facing : EnumFacing.VALUES) {
|
||||
handlers.put(facing, new TankContainer(facing));
|
||||
}
|
||||
}
|
||||
@@ -153,19 +153,19 @@ public class ComponentTankContainer extends MachineComponent implements ITankMac
|
||||
this.getMachine().markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IFluidHandler getHandler(EnumFacing from) {
|
||||
return handlers.get(from);
|
||||
}
|
||||
|
||||
private class TankContainer implements IFluidHandler{
|
||||
|
||||
private class TankContainer implements IFluidHandler {
|
||||
EnumFacing from;
|
||||
|
||||
|
||||
public TankContainer(EnumFacing from) {
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public final int fill(final FluidStack resource, final boolean doFill) {
|
||||
final int index = getTankIndexToFill(from, resource);
|
||||
@@ -174,7 +174,7 @@ public class ComponentTankContainer extends MachineComponent implements ITankMac
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public FluidStack drain(final FluidStack resource, final boolean doDrain) {
|
||||
final int index = getTankIndexToDrain(from, null);
|
||||
@@ -192,7 +192,7 @@ public class ComponentTankContainer extends MachineComponent implements ITankMac
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IFluidTankProperties[] getTankProperties() {
|
||||
final IFluidTankProperties[] properties = new IFluidTankProperties[getTanks().length];
|
||||
|
||||
@@ -203,7 +203,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
@Override
|
||||
public void onEvent(final EventValueChanged event) {
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
final int i = ((Integer) event.getValue()).intValue();
|
||||
final int i = (Integer) event.getValue();
|
||||
nbt.setByte("i", (byte) i);
|
||||
Window.get(tab).sendClientAction("tab-change", nbt);
|
||||
WindowCompartment.this.currentTab = i;
|
||||
@@ -368,15 +368,10 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
}
|
||||
}
|
||||
if (this.sortByName) {
|
||||
final List<Entry<Integer, String>> list = new LinkedList(slotIds.entrySet());
|
||||
Collections.sort(list, new Comparator<Entry<Integer, String>>() {
|
||||
@Override
|
||||
public int compare(Entry<Integer, String> o1, Entry<Integer, String> o2) {
|
||||
return -o2.getValue().compareTo(o1.getValue());
|
||||
}
|
||||
});
|
||||
final Map result = new LinkedHashMap();
|
||||
for (final Map.Entry entry : list) {
|
||||
final List<Entry<Integer, String>> list = new LinkedList<>(slotIds.entrySet());
|
||||
list.sort((o1, o2) -> -o2.getValue().compareTo(o1.getValue()));
|
||||
final Map<Integer, String> result = new LinkedHashMap<>();
|
||||
for (final Map.Entry<Integer, String> entry : list) {
|
||||
result.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
slotIds = result;
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
|
||||
public class BinnieProxy extends BinnieModProxy implements IBinnieProxy {
|
||||
@@ -104,7 +105,7 @@ public class BinnieProxy extends BinnieModProxy implements IBinnieProxy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTileEntity(final Class<? extends TileEntity> tile, final String id, final Object renderer) {
|
||||
public void registerTileEntity(final Class<? extends TileEntity> tile, final String id, @Nullable final Object renderer) {
|
||||
GameRegistry.registerTileEntity(tile, id);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
@@ -129,7 +130,7 @@ public final class BinnieProxyClient extends BinnieProxy implements IBinnieProxy
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTileEntity(final Class<? extends TileEntity> tile, final String id, final Object renderer) {
|
||||
public void registerTileEntity(final Class<? extends TileEntity> tile, final String id, @Nullable final Object renderer) {
|
||||
if (renderer != null && renderer instanceof TileEntitySpecialRenderer) {
|
||||
ClientRegistry.registerTileEntity(tile, id, (TileEntitySpecialRenderer) renderer);
|
||||
} else {
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
|
||||
public interface IBinnieProxy extends IProxyCore {
|
||||
@@ -40,7 +41,7 @@ public interface IBinnieProxy extends IProxyCore {
|
||||
|
||||
Object createObject(final String p0);
|
||||
|
||||
void registerTileEntity(final Class<? extends TileEntity> p0, final String p1, final Object p2);
|
||||
void registerTileEntity(final Class<? extends TileEntity> tile, final String id, @Nullable final Object renderer);
|
||||
|
||||
void createPipe(final Item p0);
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package binnie.core.util;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
@@ -74,6 +75,7 @@ class FluidStackSet implements Set<FluidStack> {
|
||||
return this.itemStacks.isEmpty();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Iterator<FluidStack> iterator() {
|
||||
return this.itemStacks.iterator();
|
||||
@@ -85,8 +87,7 @@ class FluidStackSet implements Set<FluidStack> {
|
||||
final FluidStack r = (FluidStack) o;
|
||||
final FluidStack existing = this.getExisting(r);
|
||||
if (existing.amount > r.amount) {
|
||||
final FluidStack fluidStack = existing;
|
||||
fluidStack.amount -= r.amount;
|
||||
existing.amount -= r.amount;
|
||||
} else {
|
||||
this.itemStacks.remove(existing);
|
||||
}
|
||||
@@ -95,7 +96,7 @@ class FluidStackSet implements Set<FluidStack> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeAll(final Collection<?> c) {
|
||||
public boolean removeAll(@Nonnull final Collection<?> c) {
|
||||
boolean addedAll = true;
|
||||
for (final Object o : c) {
|
||||
final boolean removed = this.remove(o);
|
||||
@@ -105,7 +106,7 @@ class FluidStackSet implements Set<FluidStack> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean retainAll(final Collection<?> c) {
|
||||
public boolean retainAll(@Nonnull final Collection<?> c) {
|
||||
return this.itemStacks.retainAll(c);
|
||||
}
|
||||
|
||||
@@ -114,13 +115,15 @@ class FluidStackSet implements Set<FluidStack> {
|
||||
return this.itemStacks.size();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Object[] toArray() {
|
||||
return this.itemStacks.toArray();
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public <T> T[] toArray(final T[] a) {
|
||||
public <T> T[] toArray(@Nonnull final T[] a) {
|
||||
return this.itemStacks.toArray(a);
|
||||
}
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public class ContainerCraftGUI extends Container {
|
||||
private int errorType;
|
||||
private ErrorState error;
|
||||
private int mousedOverSlotNumber;
|
||||
private final Set<EntityPlayerMP> crafters = Sets.newConcurrentHashSet();
|
||||
private final Set<EntityPlayer> crafters = Sets.newConcurrentHashSet();
|
||||
|
||||
public ContainerCraftGUI(final Window window) {
|
||||
this.syncedNBT = new HashMap<>();
|
||||
@@ -219,7 +219,7 @@ public class ContainerCraftGUI extends Container {
|
||||
final int index = action.getShort("i");
|
||||
final int slotNumber = action.getShort("n");
|
||||
this.createServerSlot(InventoryType.values()[type % 4], index, slotNumber);
|
||||
for(IContainerListener listener : listeners){
|
||||
for (IContainerListener listener : listeners) {
|
||||
listener.updateCraftingInventory(this, this.getInventory());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
@@ -63,13 +64,17 @@ public class ModuleApiary implements IInitializable {
|
||||
@Override
|
||||
public void postInit() {
|
||||
EnumHiveFrame.init();
|
||||
GameRegistry.addRecipe(AlvearyMachine.Mutator.get(1), "g g", " a ", "t t", 'g', Items.GOLD_INGOT, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5));
|
||||
GameRegistry.addRecipe(AlvearyMachine.Frame.get(1), "iii", "tat", " t ", 'i', Items.IRON_INGOT, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4));
|
||||
GameRegistry.addRecipe(AlvearyMachine.RainShield.get(1), " b ", "bab", "t t", 'b', Items.BRICK, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4));
|
||||
GameRegistry.addRecipe(AlvearyMachine.Lighting.get(1), "iii", "iai", " t ", 'i', Items.GLOWSTONE_DUST, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4));
|
||||
GameRegistry.addRecipe(AlvearyMachine.Stimulator.get(1), "kik", "iai", " t ", 'i', Items.GOLD_NUGGET, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4), 'k', new ItemStack(Mods.Forestry.item("chipsets"), 1, 2));
|
||||
GameRegistry.addRecipe(AlvearyMachine.Hatchery.get(1), "i i", " a ", "iti", 'i', Blocks.GLASS_PANE, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(AlvearyMachine.Transmission.get(1), " t ", "tat", " t ", 'a', Mods.Forestry.block("alveary"), 't', "gearTin"));
|
||||
Block alveary = Mods.Forestry.block("alveary.plain");
|
||||
Item thermionicTubes = Mods.Forestry.item("thermionicTubes");
|
||||
Item chipsets = Mods.Forestry.item("chipsets");
|
||||
|
||||
GameRegistry.addRecipe(AlvearyMachine.Mutator.get(1), "g g", " a ", "t t", 'g', Items.GOLD_INGOT, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 5));
|
||||
GameRegistry.addRecipe(AlvearyMachine.Frame.get(1), "iii", "tat", " t ", 'i', Items.IRON_INGOT, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 4));
|
||||
GameRegistry.addRecipe(AlvearyMachine.RainShield.get(1), " b ", "bab", "t t", 'b', Items.BRICK, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 4));
|
||||
GameRegistry.addRecipe(AlvearyMachine.Lighting.get(1), "iii", "iai", " t ", 'i', Items.GLOWSTONE_DUST, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 4));
|
||||
GameRegistry.addRecipe(AlvearyMachine.Stimulator.get(1), "kik", "iai", " t ", 'i', Items.GOLD_NUGGET, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 4), 'k', new ItemStack(chipsets, 1, 2));
|
||||
GameRegistry.addRecipe(AlvearyMachine.Hatchery.get(1), "i i", " a ", "iti", 'i', Blocks.GLASS_PANE, 'a', alveary, 't', new ItemStack(thermionicTubes, 1, 5));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(AlvearyMachine.Transmission.get(1), " t ", "tat", " t ", 'a', alveary, 't', "gearTin"));
|
||||
for (final AlvearyStimulator.CircuitType type : AlvearyStimulator.CircuitType.values()) {
|
||||
type.createCircuit(this.stimulatorLayout);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -40,7 +41,7 @@ public class AlvearyMutator {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public static void addMutationItem(final ItemStack item, final float chance) {
|
||||
public static void addMutationItem(@Nullable final ItemStack item, final float chance) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraBees.proxy.localise("flowers." + this.name().toString().toLowerCase() + ".name");
|
||||
return ExtraBees.proxy.localise("flowers." + this.name().toLowerCase() + ".name");
|
||||
}
|
||||
|
||||
public void register() {
|
||||
|
||||
@@ -120,7 +120,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise("effect." + this.name().toString().toLowerCase() + ".name");
|
||||
return ExtraBees.proxy.localise("effect." + this.name().toLowerCase() + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -6,6 +6,7 @@ import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -143,7 +144,7 @@ public enum EnumHoneyComb implements IItemEnum {
|
||||
return ExtraBees.proxy.localise("item.comb." + this.name().toLowerCase());
|
||||
}
|
||||
|
||||
public boolean addProduct(final ItemStack item, final Float chance) {
|
||||
public boolean addProduct(@Nullable final ItemStack item, final Float chance) {
|
||||
if (item == null) {
|
||||
return false;
|
||||
}
|
||||
@@ -151,7 +152,7 @@ public enum EnumHoneyComb implements IItemEnum {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void tryAddProduct(final ItemStack item, final Float chance) {
|
||||
public void tryAddProduct(@Nullable final ItemStack item, final Float chance) {
|
||||
this.active = this.addProduct(item, chance);
|
||||
}
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ public class ItemHoneyComb extends ItemProduct implements IColoredItem {
|
||||
QUARTZ;
|
||||
|
||||
public ItemStack get() {
|
||||
return new ItemStack(Mods.Forestry.item("beeCombs"), 1, this.ordinal());
|
||||
return Mods.Forestry.stack("beeCombs", 1, this.ordinal());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,8 +24,8 @@ public enum DesignSystem implements IDesignSystem {
|
||||
Map<Integer, TextureAtlasSprite> secondary;
|
||||
|
||||
DesignSystem() {
|
||||
this.primary = new HashMap<Integer, TextureAtlasSprite>();
|
||||
this.secondary = new HashMap<Integer, TextureAtlasSprite>();
|
||||
this.primary = new HashMap<>();
|
||||
this.secondary = new HashMap<>();
|
||||
DesignerManager.instance.registerDesignSystem(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,5 +48,4 @@ public class ModuleGenetics implements IInitializable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class GeneItem implements INbtReadable, INbtWritable, IGeneItem {
|
||||
@Override
|
||||
public void getInfo(final List list) {
|
||||
final String chromosomeName = this.getBreedingSystem().getChromosomeName(this.gene.getChromosome());
|
||||
list.add(TextFormatting.GOLD +chromosomeName + TextFormatting.GRAY + ": " + this.gene.getName());
|
||||
list.add(TextFormatting.GOLD + chromosomeName + TextFormatting.GRAY + ": " + this.gene.getName());
|
||||
}
|
||||
|
||||
public BreedingSystem getBreedingSystem() {
|
||||
|
||||
@@ -27,7 +27,7 @@ public abstract class ControlToleranceBar<T extends Enum<T>> extends Control imp
|
||||
this.tolerated = EnumSet.noneOf(this.enumClass);
|
||||
this.fullSet = EnumSet.allOf(this.enumClass);
|
||||
if (this.enumClass == EnumTemperature.class) {
|
||||
this.fullSet.remove(EnumTemperature.NONE);
|
||||
this.fullSet.remove(this.enumClass.cast(EnumTemperature.NONE));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public abstract class ControlToleranceBar<T extends Enum<T>> extends Control imp
|
||||
final int type = (int) ((int) this.getRelativeMousePosition().x() / (this.getSize().x() / types));
|
||||
for (final T tol : this.fullSet) {
|
||||
if (tol.ordinal() - ((this.enumClass == EnumTemperature.class) ? 1 : 0) == type) {
|
||||
list.add((this.tolerated.contains(tol) ? "" : TextFormatting.DARK_GRAY ) + this.getName(tol));
|
||||
list.add((this.tolerated.contains(tol) ? "" : TextFormatting.DARK_GRAY) + this.getName(tol));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ public class ModuleItem implements IInitializable {
|
||||
'c', GeneticsItems.IntegratedCircuit.get(itemGenetics, 1),
|
||||
'a', Mods.Forestry.item("portableAlyzer"),
|
||||
'd', new ItemStack(Items.DIAMOND));
|
||||
|
||||
|
||||
final Item[] dbs = {ExtraBees.dictionary, ExtraTrees.itemDictionary, ExtraTrees.itemDictionaryLepi, Botany.database};
|
||||
if (BinnieCore.isBotanyActive() && BinnieCore.isExtraBeesActive() && BinnieCore.isExtraTreesActive()) {
|
||||
for (final Item a2 : dbs) {
|
||||
@@ -141,7 +141,7 @@ public class ModuleItem implements IInitializable {
|
||||
for (final Item c2 : dbs) {
|
||||
for (final Item d : dbs) {
|
||||
if (a2 != b2 && a2 != c2 && a2 != d && b2 != c2 && b2 != d && c2 != d) {
|
||||
GameRegistry.addShapedRecipe(new ItemStack(Genetics.registry), new Object[] { " b ", "fct", " l ", 'c', GeneticsItems.IntegratedCircuit.get(itemGenetics, 1), 'b', a2, 't', b2, 'f', c2, 'l', d });
|
||||
GameRegistry.addShapedRecipe(new ItemStack(Genetics.registry), new Object[]{" b ", "fct", " l ", 'c', GeneticsItems.IntegratedCircuit.get(itemGenetics, 1), 'b', a2, 't', b2, 'f', c2, 'l', d});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.genetics.machine;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.machines.MachineGroup;
|
||||
@@ -53,17 +52,8 @@ public class ModuleMachine implements IInitializable {
|
||||
final String diamondGear = !OreDictionary.getOres("gearDiamond").isEmpty() ? "gearIron" : "ingotIron";
|
||||
for (final Object circuit : standardCircuit) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.Incubator.get(1), "gFg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'F', Blocks.FURNACE, 'c', circuit, 'g', Blocks.GLASS_PANE, 'P', "gearBronze", 'a', ironGear));
|
||||
Item alyzer = null;
|
||||
if (BinnieCore.isApicultureActive()) {
|
||||
alyzer = Mods.Forestry.item("beealyzer");
|
||||
} else if (BinnieCore.isArboricultureActive()) {
|
||||
alyzer = Mods.Forestry.item("treealyzer");
|
||||
} else if (BinnieCore.isArboricultureActive()) {
|
||||
alyzer = Mods.Forestry.item("flutterlyzer");
|
||||
}
|
||||
if (alyzer != null) {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.Analyser.get(1), "gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', alyzer, 'c', circuit, 'g', Blocks.GLASS_PANE, 'P', "gearBronze", 'a', GeneticsItems.DNADye.get(1)));
|
||||
}
|
||||
Item alyzer = Mods.Forestry.item("portableAlyzer");
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.Analyser.get(1), "gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', alyzer, 'c', circuit, 'g', Blocks.GLASS_PANE, 'P', "gearBronze", 'a', GeneticsItems.DNADye.get(1)));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.Genepool.get(1), "gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', "gearBronze", 'c', circuit, 'g', Blocks.GLASS_PANE, 'P', "gearBronze", 'a', Blocks.GLASS));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(LaboratoryMachine.Acclimatiser.get(1), "gBg", "cCc", "aPa", 'C', GeneticsItems.LaboratoryCasing.get(1), 'B', Items.LAVA_BUCKET, 'c', circuit, 'g', Blocks.GLASS_PANE, 'P', "gearBronze", 'a', Items.WATER_BUCKET));
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ package binnie.genetics.machine.acclimatiser;
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.genetics.Tolerance;
|
||||
import binnie.core.liquid.FluidContainer;
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
@@ -14,6 +14,8 @@ import forestry.api.lepidopterology.EnumButterflyChromosome;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@@ -100,11 +102,11 @@ public class Acclimatiser {
|
||||
addTemperatureItem(new ItemStack(Blocks.ICE), -0.75f);
|
||||
addHumidityItem(new ItemStack(Items.WATER_BUCKET), 0.75f);
|
||||
addHumidityItem(new ItemStack(Blocks.SAND), -0.15f);
|
||||
addTemperatureItem(Mods.Forestry.stack("canLava"), 0.75f);
|
||||
addTemperatureItem(Mods.Forestry.stack("refractoryLava"), 0.75f);
|
||||
addHumidityItem(Mods.Forestry.stack("canWater"), 0.75f);
|
||||
addHumidityItem(Mods.Forestry.stack("refractoryWater"), 0.75f);
|
||||
addHumidityItem(Mods.Forestry.stack("waxCapsuleWater"), 0.75f);
|
||||
addTemperatureItem(FluidContainer.Can.getFilled(FluidRegistry.LAVA), 0.75f);
|
||||
addTemperatureItem(FluidContainer.Refractory.getFilled(FluidRegistry.LAVA), 0.75f);
|
||||
addHumidityItem(FluidContainer.Can.getFilled(FluidRegistry.WATER), 0.75f);
|
||||
addHumidityItem(FluidContainer.Refractory.getFilled(FluidRegistry.WATER), 0.75f);
|
||||
addHumidityItem(FluidContainer.Capsule.getFilled(FluidRegistry.WATER), 0.75f);
|
||||
}
|
||||
|
||||
public static boolean canAcclimatise(final ItemStack stack, final List<ItemStack> acclimatisers) {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package binnie.genetics.machine.acclimatiser;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import binnie.core.machines.IMachine;
|
||||
import binnie.core.machines.power.ComponentProcessIndefinate;
|
||||
import binnie.core.machines.power.ErrorState;
|
||||
import binnie.genetics.Genetics;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AcclimatiserLogic extends ComponentProcessIndefinate {
|
||||
public AcclimatiserLogic(final IMachine machine) {
|
||||
super(machine, 2.0f);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.genetics.machine.acclimatiser;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import binnie.core.genetics.Gene;
|
||||
import binnie.core.genetics.Tolerance;
|
||||
import binnie.genetics.machine.inoculator.Inoculator;
|
||||
@@ -13,6 +11,8 @@ import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
class ToleranceSystem {
|
||||
String uid;
|
||||
IChromosomeType chromosomeOrdinal;
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package binnie.genetics.machine.analyser;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.machines.IMachine;
|
||||
import binnie.core.machines.MachineComponent;
|
||||
@@ -19,6 +15,9 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class AnalyserFX extends MachineComponent implements IRender.DisplayTick, IRender.Render, INetwork.TilePacketSync {
|
||||
private final EntityItem dummyEntityItem;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.genetics.machine.genepool;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.machines.IMachine;
|
||||
import binnie.core.machines.MachineComponent;
|
||||
@@ -12,6 +10,8 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class GenepoolFX extends MachineComponent implements IRender.DisplayTick {
|
||||
public GenepoolFX(final IMachine machine) {
|
||||
super(machine);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.genetics.machine.incubator;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.power.ComponentProcessIndefinate;
|
||||
import binnie.core.machines.power.ErrorState;
|
||||
@@ -12,6 +10,8 @@ import binnie.genetics.api.IIncubatorRecipe;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class IncubatorLogic extends ComponentProcessIndefinate implements IProcess {
|
||||
IIncubatorRecipe recipe;
|
||||
private Random rand;
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
package binnie.genetics.machine.inoculator;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.machines.IMachine;
|
||||
import binnie.core.machines.MachineComponent;
|
||||
@@ -19,6 +15,9 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class InoculatorFX extends MachineComponent implements IRender.DisplayTick, IRender.Render, INetwork.TilePacketSync {
|
||||
private final EntityItem dummyEntityItem;
|
||||
|
||||
@@ -38,9 +38,9 @@ public class InoculatorLogic extends ComponentProcessSetCost implements IProcess
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
int n = this.getNumberOfGenes();
|
||||
if(n > 1){
|
||||
if (n > 1) {
|
||||
return String.format(Genetics.proxy.localise("genetics.machine.machine.inoculator.tooltips.logic.genes"), Integer.valueOf(n).toString());
|
||||
}else{
|
||||
} else {
|
||||
return Genetics.proxy.localise("genetics.machine.machine.inoculator.tooltips.logic.gene");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.genetics.machine.isolator;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.machines.IMachine;
|
||||
import binnie.core.machines.MachineComponent;
|
||||
@@ -12,6 +10,8 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class IsolaterFX extends MachineComponent implements IRender.RandomDisplayTick, IRender.DisplayTick {
|
||||
public IsolaterFX(final IMachine machine) {
|
||||
super(machine);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.genetics.machine.isolator;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.ComponentChargedSlots;
|
||||
@@ -24,6 +22,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class PackageIsolator extends GeneticMachine.PackageGeneticBase implements IMachineInformation {
|
||||
public PackageIsolator() {
|
||||
super("isolator", GeneticsTexture.Isolator, 16740111, true);
|
||||
@@ -36,7 +36,7 @@ public class PackageIsolator extends GeneticMachine.PackageGeneticBase implement
|
||||
InventorySlot slotEnzyme = inventory.addSlot(Isolator.SLOT_ENZYME, "enzyme");
|
||||
slotEnzyme.setValidator(new SlotValidator.Item(GeneticsItems.Enzyme.get(1), ModuleMachine.IconEnzyme));
|
||||
slotEnzyme.forbidExtraction();
|
||||
InventorySlot slotSequencer= inventory.addSlot(Isolator.SLOT_SEQUENCER_VIAL, "sequencervial");
|
||||
InventorySlot slotSequencer = inventory.addSlot(Isolator.SLOT_SEQUENCER_VIAL, "sequencervial");
|
||||
slotSequencer.setValidator(new SlotValidator.Item(GeneticsItems.EmptySequencer.get(1), ModuleMachine.IconSequencer));
|
||||
slotSequencer.forbidExtraction();
|
||||
for (InventorySlot slot : inventory.addSlotArray(Isolator.SLOT_RESERVE, "input")) {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.genetics.machine.polymeriser;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.machines.IMachine;
|
||||
import binnie.core.machines.MachineComponent;
|
||||
@@ -12,6 +10,8 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class PolymeriserFX extends MachineComponent implements IRender.DisplayTick {
|
||||
public PolymeriserFX(final IMachine machine) {
|
||||
super(machine);
|
||||
@@ -49,8 +49,7 @@ public class PolymeriserFX extends MachineComponent implements IRender.DisplayTi
|
||||
if (this.particleAge > 60) {
|
||||
if (this.particleAge > 120) {
|
||||
dist = 0.1;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
dist = 0.2 - 0.1 * ((this.particleAge - 60.0f) / 60.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,9 +72,9 @@ public class PolymeriserLogic extends ComponentProcessSetCost implements IProces
|
||||
public String getTooltip() {
|
||||
final ItemStack serum = this.getUtil().getStack(Polymeriser.SLOT_SERUM);
|
||||
int n = getNumberOfGenes(serum);
|
||||
if(n > 1){
|
||||
if (n > 1) {
|
||||
return String.format(Genetics.proxy.localise("genetics.machine.machine.polymeriser.tooltips.logic.genes"), Integer.valueOf(n).toString());
|
||||
}else{
|
||||
} else {
|
||||
return Genetics.proxy.localise("genetics.machine.machine.polymeriser.tooltips.logic.gene");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user