mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-20 20:22:35 +00:00
Work on GardenLogic and localize the tubes
This commit is contained in:
1 parent
1cd3dc1ac8
commit
cef5f4963f
16 files changed
+308
-367
No files matched your search
@@ -16,6 +16,7 @@ import forestry.core.blocks.IColoredBlock;
|
||||
import forestry.core.render.TextureManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -24,6 +25,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
@@ -33,8 +35,12 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipassBlock<BlockType>, IColoredBlock, ISpriteRegister {
|
||||
|
||||
public static final PropertyEnum<TileType> TYPE = PropertyEnum.create("type", TileType.class);
|
||||
|
||||
public BlockCeramicBrick() {
|
||||
super(Material.ROCK);
|
||||
this.setHardness(1.0f);
|
||||
@@ -158,7 +164,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
return type.color2.getColor(false);
|
||||
}
|
||||
|
||||
public enum TileType {
|
||||
public enum TileType implements IStringSerializable {
|
||||
Tile("tile", "Ceramic Tile"),
|
||||
Brick("brick", "Ceramic Bricks"),
|
||||
StripeBrick("brickstripe", "Striped Ceramic Bricks"),
|
||||
@@ -431,6 +437,11 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
private boolean isMortar(final ItemStack stack) {
|
||||
return stack.getItem() == Botany.misc && stack.getItemDamage() == BotanyItems.Mortar.ordinal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
}
|
||||
|
||||
public static class BlockType {
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileCeramic extends TileEntity {
|
||||
|
||||
protected EnumFlowerColor color;
|
||||
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.farming.FarmDirection;
|
||||
import forestry.api.farming.IFarmHousing;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
public class CircuitGarden extends BinnieCircuit {
|
||||
private Class<? extends FarmLogic> logicClass;
|
||||
@@ -16,77 +17,93 @@ public class CircuitGarden extends BinnieCircuit {
|
||||
private ItemStack icon;
|
||||
private EnumMoisture moisture;
|
||||
private EnumAcidity acidity;
|
||||
|
||||
public CircuitGarden(final EnumMoisture moisture, final EnumAcidity ph, final boolean manual, final boolean fertilised, final ItemStack recipe, final ItemStack icon) {
|
||||
super("garden." + moisture.getName() + ((ph != null) ? ("." + ph.getName()) : "") + (manual ? ".manual" : "") + (fertilised ? ".fert" : ""), 4, manual ? ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual") : ChipsetManager.circuitRegistry.getLayout("forestry.farms.managed"), recipe);
|
||||
this.isManual = false;
|
||||
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;
|
||||
this.isManual = manual;
|
||||
this.isFertilised = fertilised;
|
||||
this.moisture = moisture;
|
||||
this.acidity = ph;
|
||||
this.icon = icon;
|
||||
this.logic = new GardenLogic(this.moisture, this.acidity, this.isManual, this.isFertilised, this.icon, Binnie.Language.localise(this.getUnlocalizedName()));
|
||||
String info = "";
|
||||
if (moisture == EnumMoisture.Dry) {
|
||||
info += "§eDry§f";
|
||||
}
|
||||
if (moisture == EnumMoisture.Damp) {
|
||||
info += "§9Damp§f";
|
||||
}
|
||||
if (this.acidity == EnumAcidity.Acid) {
|
||||
if (info.length() > 0) {
|
||||
info += ", ";
|
||||
}
|
||||
info += "§cAcidic§f";
|
||||
}
|
||||
if (this.acidity == EnumAcidity.Neutral) {
|
||||
if (info.length() > 0) {
|
||||
info += ", ";
|
||||
}
|
||||
info += "§aNeutral§f";
|
||||
}
|
||||
if (this.acidity == EnumAcidity.Alkaline) {
|
||||
if (info.length() > 0) {
|
||||
info += ", ";
|
||||
}
|
||||
info += "§bAlkaline§f";
|
||||
if (moisture != EnumMoisture.Normal) {
|
||||
info+=TextFormatting.GRAY + Binnie.Language.localise("botany.moisture") + ": " + moisture.getTranslated(true);
|
||||
}
|
||||
if (info.length() > 0) {
|
||||
info = " (" + info + "§f)";
|
||||
info += ", ";
|
||||
}
|
||||
if (ph != null) {
|
||||
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){
|
||||
String name = "garden." + moisture.getName();
|
||||
if(ph != null){
|
||||
name += "." + ph.getName();
|
||||
}
|
||||
if(manual){
|
||||
name += ".manual";
|
||||
}
|
||||
if(fertilised){
|
||||
name += ".fert";
|
||||
}
|
||||
return name;
|
||||
}
|
||||
|
||||
public CircuitGarden setManual() {
|
||||
isManual = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCircuitable(Object tile) {
|
||||
return tile instanceof IFarmHousing;
|
||||
}
|
||||
|
||||
private IFarmHousing getCircuitable(Object tile) {
|
||||
if (!isCircuitable(tile)) {
|
||||
return null;
|
||||
}
|
||||
return (IFarmHousing) tile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInsertion(int slot, Object tile) {
|
||||
if (!this.isCircuitable(tile)) {
|
||||
IFarmHousing housing = getCircuitable(tile);
|
||||
if (housing == null) {
|
||||
return;
|
||||
}
|
||||
final GardenLogic logic = new GardenLogic((IFarmHousing) tile);
|
||||
logic.setData(this.moisture, this.acidity, this.isManual, this.isFertilised, this.icon, Binnie.Language.localise(this.getUnlocalizedName()));
|
||||
((IFarmHousing) tile).setFarmLogic(FarmDirection.values()[slot], logic);
|
||||
|
||||
logic.setManual(isManual);
|
||||
|
||||
housing.setFarmLogic(FarmDirection.values()[slot], logic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad(int slot, Object tile) {
|
||||
this.onInsertion(slot, tile);
|
||||
onInsertion(slot, tile);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRemoval(int slot, Object tile) {
|
||||
if (!this.isCircuitable(tile)) {
|
||||
IFarmHousing farmHousing = getCircuitable(tile);
|
||||
if (farmHousing == null) {
|
||||
return;
|
||||
}
|
||||
((IFarmHousing) tile).resetFarmLogic(FarmDirection.values()[slot]);
|
||||
|
||||
farmHousing.resetFarmLogic(FarmDirection.values()[slot]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTick(int arg0, Object arg1) {
|
||||
public void onTick(int slot, Object tile) {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.botany.farm;
|
||||
|
||||
import forestry.api.farming.FarmDirection;
|
||||
import forestry.api.farming.IFarmHousing;
|
||||
import forestry.api.farming.IFarmLogic;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -11,45 +9,40 @@ import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class FarmLogic implements IFarmLogic {
|
||||
World world;
|
||||
IFarmHousing housing;
|
||||
boolean isManual;
|
||||
|
||||
public FarmLogic(final IFarmHousing housing) {
|
||||
this.housing = housing;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFarmLogic setManual(final boolean flag) {
|
||||
this.isManual = flag;
|
||||
return this;
|
||||
}
|
||||
|
||||
protected final boolean isAirBlock(final Vect position) {
|
||||
return this.world.isAirBlock(new BlockPos(position.x, position.y, position.z));
|
||||
protected final boolean isAirBlock(World world, BlockPos pos) {
|
||||
return world.isAirBlock(pos);
|
||||
}
|
||||
|
||||
protected final boolean isWaterBlock(final Vect position) {
|
||||
return this.world.getBlockState(new BlockPos(position.x, position.y, position.z)).getBlock() == Blocks.WATER;
|
||||
protected final IBlockState getBlockState(World world, BlockPos pos) {
|
||||
return world.getBlockState(pos);
|
||||
}
|
||||
|
||||
protected final Block getBlock(World world, BlockPos pos) {
|
||||
return getBlockState(world, pos).getBlock();
|
||||
}
|
||||
|
||||
protected final IBlockState getBlock(final Vect position) {
|
||||
return this.world.getBlockState(new BlockPos(position.x, position.y, position.z));
|
||||
protected final int getBlockMeta(World world, BlockPos pos) {
|
||||
IBlockState blockState = world.getBlockState(pos);
|
||||
return blockState.getBlock().getMetaFromState(blockState);
|
||||
}
|
||||
|
||||
protected final int getBlockMeta(final Vect position) {
|
||||
return this.getBlock(position).getBlock().getMetaFromState(getBlock(position));
|
||||
protected final ItemStack getAsItemStack(World world, BlockPos position) {
|
||||
return new ItemStack(getBlock(world, position), 1, getBlockMeta(world, position));
|
||||
}
|
||||
|
||||
protected final ItemStack getAsItemStack(final Vect position) {
|
||||
return new ItemStack(this.getBlock(position).getBlock(), 1, this.getBlockMeta(position));
|
||||
protected final boolean isWaterBlock(World world, BlockPos pos) {
|
||||
return getBlock(world, pos) == Blocks.WATER;
|
||||
}
|
||||
|
||||
protected final Vect translateWithOffset(final int x, final int y, final int z, final FarmDirection direction, final int step) {
|
||||
return new Vect(x + direction.getFacing().getFrontOffsetX() * step, y + direction.getFacing().getFrontOffsetY() * step, z + direction.getFacing().getFrontOffsetZ() * step);
|
||||
}
|
||||
|
||||
protected final void setBlock(final Vect position, final Block block, final int meta) {
|
||||
this.world.setBlockState(new BlockPos(position.x, position.y, position.z), getBlock(position), 2);
|
||||
protected final void setBlock(World world, BlockPos pos, final Block block, final int meta) {
|
||||
world.setBlockState(pos, block.getStateFromMeta(meta), 2);
|
||||
}
|
||||
}
|
||||
@@ -4,15 +4,23 @@ import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.botany.api.EnumSoilType;
|
||||
import binnie.botany.api.gardening.IBlockSoil;
|
||||
import binnie.botany.flower.TileEntityFlower;
|
||||
import binnie.botany.gardening.Gardening;
|
||||
import forestry.api.farming.FarmDirection;
|
||||
import forestry.api.farming.ICrop;
|
||||
import forestry.api.farming.IFarmHousing;
|
||||
import forestry.api.farming.IFarmable;
|
||||
import forestry.core.owner.IOwnedTile;
|
||||
import forestry.core.utils.BlockUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
@@ -31,11 +39,16 @@ public class GardenLogic extends FarmLogic {
|
||||
private ItemStack icon;
|
||||
List<IFarmable> farmables;
|
||||
|
||||
public GardenLogic(final IFarmHousing housing) {
|
||||
super(housing);
|
||||
public GardenLogic(EnumMoisture moisture2, EnumAcidity acidity2, boolean isManual, boolean isFertilised, ItemStack icon2, String name2) {
|
||||
this.produce = new ArrayList<>();
|
||||
(this.farmables = new ArrayList<>()).add(new FarmableFlower());
|
||||
this.farmables.add(new FarmableVanillaFlower());
|
||||
this.moisture = moisture2;
|
||||
this.acidity = acidity2;
|
||||
this.isManual = isManual;
|
||||
this.fertilised = isFertilised;
|
||||
this.icon = icon2;
|
||||
this.name = name2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -52,120 +65,119 @@ 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() {
|
||||
// final Collection<ItemStack> products = this.produce;
|
||||
// this.produce = new ArrayList<ItemStack>();
|
||||
// return products;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean cultivate(final int x, final int y, final int z, final FarmDirection direction, final int extent) {
|
||||
// this.world = this.housing.getWorld();
|
||||
// return this.maintainSoil(x, y, z, direction, extent) || (!this.isManual && this.maintainWater(x, y, z, direction, extent)) || this.maintainCrops(x, y + 1, z, direction, extent);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public Collection<ItemStack> collect(World world, IFarmHousing farmHousing) {
|
||||
final Collection<ItemStack> products = this.produce;
|
||||
this.produce = new ArrayList<ItemStack>();
|
||||
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);
|
||||
}
|
||||
|
||||
private boolean isWaste(final ItemStack stack) {
|
||||
return stack.getItem() == Item.getItemFromBlock(Blocks.DIRT);
|
||||
}
|
||||
|
||||
private boolean maintainSoil(final int x2, final int y2, final int z2, final FarmDirection direction, final int extent) {
|
||||
// for (int i = 0; i < extent; ++i) {
|
||||
// final Vect position = this.translateWithOffset(x2, y2, z2, direction, i);
|
||||
// if (this.fertilised && Gardening.isSoil(this.world.getBlock(position.x, position.y, position.z))) {
|
||||
// final IBlockSoil soil = (IBlockSoil) this.world.getBlock(position.x, position.y, position.z);
|
||||
// if (soil.fertilise(this.world, position.x, position.y, position.z, EnumSoilType.FLOWERBED)) {
|
||||
// continue;
|
||||
// }
|
||||
// }
|
||||
// if (this.world.getBlock(position.x, position.y + 1, position.z) == Botany.plant) {
|
||||
// this.world.setBlockToAir(position.x, position.y + 1, position.z);
|
||||
// }
|
||||
// else {
|
||||
// if (this.acidity != null && Gardening.isSoil(this.world.getBlock(position.x, position.y, position.z))) {
|
||||
// final IBlockSoil soil = (IBlockSoil) this.world.getBlock(position.x, position.y, position.z);
|
||||
// final EnumAcidity pH = soil.getPH(this.world, position.x, position.y, position.z);
|
||||
// if (pH.ordinal() < this.acidity.ordinal()) {
|
||||
// final ItemStack stack = this.getAvailableAlkaline();
|
||||
// if (stack != null && soil.setPH(this.world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() + 1])) {
|
||||
// this.housing.getFarmInventory().removeResources(new ItemStack[] { stack });
|
||||
// continue;
|
||||
// }
|
||||
// }
|
||||
// if (pH.ordinal() > this.acidity.ordinal()) {
|
||||
// final ItemStack stack = this.getAvailableAcid();
|
||||
// if (stack != null && soil.setPH(this.world, position.x, position.y, position.z, EnumAcidity.values()[pH.ordinal() - 1])) {
|
||||
// this.housing.getFarmInventory().removeResources(new ItemStack[] { stack });
|
||||
// continue;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// if (!this.isAirBlock(position) && !this.world.getBlock(position.x, position.y, position.z).isReplaceable(this.world, position.x, position.y, position.z)) {
|
||||
// final ItemStack block = this.getAsItemStack(position);
|
||||
// final ItemStack loam = this.getAvailableLoam();
|
||||
// if (this.isWaste(block) && loam != null) {
|
||||
// this.produce.addAll(Blocks.DIRT.getDrops(this.world, position.x, position.y, position.z, block.getItemDamage(), 0));
|
||||
// this.setBlock(position, Blocks.AIR, 0);
|
||||
// return this.trySetSoil(position, loam);
|
||||
// }
|
||||
// }
|
||||
// else if (!this.isManual) {
|
||||
// if (!this.isWaterBlock(position)) {
|
||||
// if (i % 2 == 0) {
|
||||
// return this.trySetSoil(position);
|
||||
// }
|
||||
// FarmDirection cclock = FarmDirection.EAST;
|
||||
// if (direction == FarmDirection.EAST) {
|
||||
// cclock = FarmDirection.SOUTH;
|
||||
// }
|
||||
// else if (direction == FarmDirection.SOUTH) {
|
||||
// cclock = FarmDirection.EAST;
|
||||
// }
|
||||
// else if (direction == FarmDirection.WEST) {
|
||||
// cclock = FarmDirection.SOUTH;
|
||||
// }
|
||||
// final Vect previous = this.translateWithOffset(position.x, position.y, position.z, cclock, 1);
|
||||
// final ItemStack soil2 = this.getAsItemStack(previous);
|
||||
// if (!Gardening.isSoil(soil2.getItem())) {
|
||||
// this.trySetSoil(position);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
private boolean maintainSoil(World world, BlockPos pos, FarmDirection direction, int extent, IFarmHousing housing) {
|
||||
for (int i = 0; i < extent; ++i) {
|
||||
BlockPos position = pos.offset(direction.getFacing(), i);
|
||||
if (this.fertilised && Gardening.isSoil(getBlock(world, position))) {
|
||||
IBlockSoil soil = (IBlockSoil) getBlock(world, position);
|
||||
if (soil.fertilise(world, position, EnumSoilType.FLOWERBED)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (getBlock(world, position.up()) == Botany.plant) {
|
||||
world.setBlockToAir(position.up());
|
||||
}
|
||||
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 });
|
||||
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 });
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!this.isAirBlock(world, position) && !BlockUtil.isReplaceableBlock(getBlockState(world, position), world, position)) {
|
||||
ItemStack block = this.getAsItemStack(world, position);
|
||||
ItemStack loam = this.getAvailableLoam(housing);
|
||||
if (this.isWaste(block) && loam != null) {
|
||||
this.produce.addAll(Blocks.DIRT.getDrops(world, position, Block.getBlockFromItem(block.getItem()).getStateFromMeta(block.getItemDamage()), 0));
|
||||
this.setBlock(world, position, Blocks.AIR, 0);
|
||||
return trySetSoil(world, position, loam, housing);
|
||||
}
|
||||
}
|
||||
else if (!this.isManual) {
|
||||
if (!this.isWaterBlock(world, position)) {
|
||||
if (i % 2 == 0) {
|
||||
return trySetSoil(world, position, housing);
|
||||
}
|
||||
FarmDirection cclock = FarmDirection.EAST;
|
||||
if (direction == FarmDirection.EAST) {
|
||||
cclock = FarmDirection.SOUTH;
|
||||
}
|
||||
else if (direction == FarmDirection.SOUTH) {
|
||||
cclock = FarmDirection.EAST;
|
||||
}
|
||||
else if (direction == FarmDirection.WEST) {
|
||||
cclock = FarmDirection.SOUTH;
|
||||
}
|
||||
BlockPos previous = position.offset(cclock.getFacing());
|
||||
final ItemStack soil2 = this.getAsItemStack(world, previous);
|
||||
if (!Gardening.isSoil(soil2.getItem())) {
|
||||
this.trySetSoil(world, position, housing);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean maintainWater(final int x, final int y, final int z, final FarmDirection direction, final int extent) {
|
||||
// for (int i = 0; i < extent; ++i) {
|
||||
// final Vect position = this.translateWithOffset(x, y, z, direction, i);
|
||||
// if (this.isAirBlock(position) || this.world.getBlock(x, y, z).isReplaceable(this.world, position.x, position.y, position.z)) {
|
||||
// if (!this.isWaterBlock(position)) {
|
||||
// boolean isEnclosed = true;
|
||||
// if (this.world.isAirBlock(position.x + 1, position.y, position.z)) {
|
||||
// isEnclosed = false;
|
||||
// }
|
||||
// else if (this.world.isAirBlock(position.x - 1, position.y, position.z)) {
|
||||
// isEnclosed = false;
|
||||
// }
|
||||
// else if (this.world.isAirBlock(position.x, position.y, position.z + 1)) {
|
||||
// isEnclosed = false;
|
||||
// }
|
||||
// else if (this.world.isAirBlock(position.x, position.y, position.z - 1)) {
|
||||
// isEnclosed = false;
|
||||
// }
|
||||
// isEnclosed = (isEnclosed || this.moisture != EnumMoisture.Damp);
|
||||
// if (isEnclosed) {
|
||||
// return this.trySetWater(position);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
private boolean maintainWater(World world, BlockPos pos, FarmDirection direction, int extent, IFarmHousing housing) {
|
||||
for (int i = 0; i < extent; ++i) {
|
||||
BlockPos position = pos.offset(direction.getFacing(), i);
|
||||
if (this.isAirBlock(world, position) || BlockUtil.isReplaceableBlock(getBlockState(world, position), world, position)) {
|
||||
if (!this.isWaterBlock(world, position)) {
|
||||
boolean isEnclosed = true;
|
||||
if (world.isAirBlock(position.east())) {
|
||||
isEnclosed = false;
|
||||
}
|
||||
else if (world.isAirBlock(position.west())) {
|
||||
isEnclosed = false;
|
||||
}
|
||||
else if (world.isAirBlock(position.south())) {
|
||||
isEnclosed = false;
|
||||
}
|
||||
else if (world.isAirBlock(position.north())) {
|
||||
isEnclosed = false;
|
||||
}
|
||||
isEnclosed = (isEnclosed || this.moisture != EnumMoisture.Damp);
|
||||
if (isEnclosed) {
|
||||
return this.trySetWater(world, position, housing);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private ItemStack getAvailableLoam() {
|
||||
private ItemStack getAvailableLoam(IFarmHousing housing) {
|
||||
EnumMoisture[] moistures;
|
||||
if (this.moisture == EnumMoisture.Damp) {
|
||||
moistures = new EnumMoisture[]{EnumMoisture.Damp, EnumMoisture.Normal, EnumMoisture.Dry};
|
||||
@@ -180,54 +192,54 @@ public class GardenLogic extends FarmLogic {
|
||||
for (final Block type : new Block[]{Botany.flowerbed, Botany.loam, Botany.soil}) {
|
||||
final int meta = acid.ordinal() * 3 + moist.ordinal();
|
||||
final ItemStack[] resource = {new ItemStack(type, 1, meta)};
|
||||
if (this.housing.getFarmInventory().hasResources(resource)) {
|
||||
if (housing.getFarmInventory().hasResources(resource)) {
|
||||
return resource[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.housing.getFarmInventory().hasResources(new ItemStack[]{new ItemStack(Blocks.DIRT)})) {
|
||||
if (housing.getFarmInventory().hasResources(new ItemStack[]{new ItemStack(Blocks.DIRT)})) {
|
||||
return new ItemStack(Blocks.DIRT);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean trySetSoil(final Vect position) {
|
||||
return this.trySetSoil(position, this.getAvailableLoam());
|
||||
private boolean trySetSoil(World world, BlockPos position, IFarmHousing housing) {
|
||||
return this.trySetSoil(world, position, this.getAvailableLoam(housing), housing);
|
||||
}
|
||||
|
||||
private boolean trySetSoil(final Vect position, ItemStack loam) {
|
||||
private boolean trySetSoil(World world, BlockPos position, ItemStack loam, IFarmHousing housing) {
|
||||
ItemStack copy = loam;
|
||||
if (loam != null) {
|
||||
if (loam.getItem() == Item.getItemFromBlock(Blocks.DIRT)) {
|
||||
loam = new ItemStack(Botany.soil, 0, 4);
|
||||
}
|
||||
//this.setBlock(position, ((ItemBlock) loam.getItem()).field_150939_a, loam.getItemDamage());
|
||||
this.housing.getFarmInventory().removeResources(new ItemStack[]{copy});
|
||||
setBlock(world, position, ((ItemBlock) loam.getItem()).getBlock(), loam.getItemDamage());
|
||||
housing.getFarmInventory().removeResources(new ItemStack[]{copy});
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean trySetWater(final Vect position) {
|
||||
private boolean trySetWater(World world, BlockPos position, IFarmHousing housing) {
|
||||
final FluidStack water = Binnie.Liquid.getFluidStack("water", 1000);
|
||||
if (this.moisture == EnumMoisture.Damp) {
|
||||
if (!this.housing.hasLiquid(water)) {
|
||||
if (!housing.hasLiquid(water)) {
|
||||
return false;
|
||||
}
|
||||
this.setBlock(position, Blocks.WATER, 0);
|
||||
this.housing.removeLiquid(water);
|
||||
this.setBlock(world, position, Blocks.WATER, 0);
|
||||
housing.removeLiquid(water);
|
||||
return true;
|
||||
} else {
|
||||
if (this.moisture != EnumMoisture.Dry) {
|
||||
return this.trySetSoil(position);
|
||||
return trySetSoil(world, position, housing);
|
||||
}
|
||||
final ItemStack[] sand = {new ItemStack(Blocks.SAND, 1)};
|
||||
if (!this.housing.getFarmInventory().hasResources(sand)) {
|
||||
if (!housing.getFarmInventory().hasResources(sand)) {
|
||||
return false;
|
||||
}
|
||||
this.setBlock(position, Blocks.SAND, 0);
|
||||
this.housing.getFarmInventory().removeResources(sand);
|
||||
this.setBlock(world, position, Blocks.SAND, 0);
|
||||
housing.getFarmInventory().removeResources(sand);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -245,43 +257,17 @@ public class GardenLogic extends FarmLogic {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ItemStack> collect(World world, IFarmHousing farmHousing) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean cultivate(World world, IFarmHousing farmHousing, BlockPos pos, FarmDirection direction, int extent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Collection<ICrop> harvest(World world, BlockPos pos, FarmDirection direction, int extent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResourceLocation getTextureMap() {
|
||||
return null;
|
||||
return TextureMap.LOCATION_BLOCKS_TEXTURE;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Collection<ICrop> harvest(final int x, final int y, final int z, final FarmDirection direction, final int extent) {
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public IIcon getIcon() {
|
||||
// return this.icon.getIconIndex();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ResourceLocation getSpriteSheet() {
|
||||
// return TextureMap.locationBlocksTexture;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.name;
|
||||
@@ -289,72 +275,56 @@ public class GardenLogic extends FarmLogic {
|
||||
|
||||
@Override
|
||||
public ItemStack getIconItemStack() {
|
||||
return null;
|
||||
return icon;
|
||||
}
|
||||
|
||||
protected boolean maintainCrops(final BlockPos pos, final FarmDirection direction, final int extent) {
|
||||
// for (int i = 0; i < extent; ++i) {
|
||||
// final Vect position = this.translateWithOffset(pos, direction, i);
|
||||
// if (this.isAirBlock(position) || this.world.getBlockState(pos).getBlock().isReplaceable(this.world, position.x, position.y, position.z)) {
|
||||
// final ItemStack below = this.getAsItemStack(position.add(new Vect(0, -1, 0)));
|
||||
// if (Gardening.isSoil(below.getItem())) {
|
||||
// return this.trySetCrop(position);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
protected boolean maintainCrops(World world, BlockPos pos, FarmDirection direction, int extent, IFarmHousing housing) {
|
||||
for (int i = 0; i < extent; ++i) {
|
||||
BlockPos position = pos.offset(direction.getFacing(), i);
|
||||
if (this.isAirBlock(world, position) || BlockUtil.isReplaceableBlock(getBlockState(world, position), world, position)) {
|
||||
ItemStack below = this.getAsItemStack(world, position.down());
|
||||
if (Gardening.isSoil(below.getItem())) {
|
||||
return trySetCrop(world, position, housing);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean trySetCrop(final Vect position) {
|
||||
// for (final IFarmable farmable : this.farmables) {
|
||||
// final boolean success = this.housing.plantGermling(farmable, this.world, position.x, position.y, position.z);
|
||||
// if (success && this.housing instanceof IOwnable) {
|
||||
// final TileEntity tile = this.housing.getWorld().getTileEntity(position.x, position.y, position.z);
|
||||
// if (tile instanceof TileEntityFlower) {
|
||||
// try {
|
||||
// final IOwnable housing2 = (IOwnable) this.housing;
|
||||
// GameProfile prof = null;
|
||||
// if (Mods.Forestry.dev()) {
|
||||
// prof = (GameProfile) IOwnable.class.getMethod("getOwner", new Class[0]).invoke(housing2, new Object[0]);
|
||||
// }
|
||||
// else {
|
||||
// prof = (GameProfile) IOwnable.class.getMethod("getOwnerProfile", new Class[0]).invoke(housing2, new Object[0]);
|
||||
// }
|
||||
// ((TileEntityFlower) tile).setOwner(prof);
|
||||
// } catch (Exception ex) {
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
private boolean trySetCrop(World world, BlockPos position, IFarmHousing housing) {
|
||||
for (IFarmable farmable : this.farmables) {
|
||||
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 false;
|
||||
}
|
||||
|
||||
public ItemStack getAvailableAcid() {
|
||||
public ItemStack getAvailableAcid(IFarmHousing housing) {
|
||||
for (final ItemStack stack : Gardening.getAcidFertilisers()) {
|
||||
if (stack != null && stack.getItem() != null && this.housing.getFarmInventory().hasResources(new ItemStack[]{stack})) {
|
||||
if (stack != null && stack.getItem() != null && housing.getFarmInventory().hasResources(new ItemStack[]{stack})) {
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public ItemStack getAvailableAlkaline() {
|
||||
public ItemStack getAvailableAlkaline(IFarmHousing housing) {
|
||||
for (final ItemStack stack : Gardening.getAlkalineFertilisers()) {
|
||||
if (stack != null && stack.getItem() != null && this.housing.getFarmInventory().hasResources(new ItemStack[]{stack})) {
|
||||
if (stack != null && stack.getItem() != null && housing.getFarmInventory().hasResources(new ItemStack[]{stack})) {
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setData(final EnumMoisture moisture2, final EnumAcidity acidity2, final boolean isManual, final boolean isFertilised, final ItemStack icon2, final String name2) {
|
||||
this.moisture = moisture2;
|
||||
this.acidity = acidity2;
|
||||
this.isManual = isManual;
|
||||
this.fertilised = isFertilised;
|
||||
this.icon = icon2;
|
||||
this.name = name2;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,74 +0,0 @@
|
||||
package binnie.botany.farm;
|
||||
|
||||
public class Vect {
|
||||
public int x;
|
||||
public int y;
|
||||
public int z;
|
||||
|
||||
public Vect(final int[] dim) {
|
||||
if (dim.length != 3) {
|
||||
throw new RuntimeException("Cannot instantiate a vector with less or more than 3 points.");
|
||||
}
|
||||
this.x = dim[0];
|
||||
this.y = dim[1];
|
||||
this.z = dim[2];
|
||||
}
|
||||
|
||||
public Vect(final int x, final int y, final int z) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
}
|
||||
|
||||
public Vect add(final Vect other) {
|
||||
final Vect vect;
|
||||
final Vect result = vect = new Vect(this.x, this.y, this.z);
|
||||
vect.x += other.x;
|
||||
final Vect vect2 = result;
|
||||
vect2.y += other.y;
|
||||
final Vect vect3 = result;
|
||||
vect3.z += other.z;
|
||||
return result;
|
||||
}
|
||||
|
||||
public Vect multiply(final float factor) {
|
||||
final Vect vect;
|
||||
final Vect result = vect = new Vect(this.x, this.y, this.z);
|
||||
vect.x *= (int) factor;
|
||||
final Vect vect2 = result;
|
||||
vect2.y *= (int) factor;
|
||||
final Vect vect3 = result;
|
||||
vect3.z *= (int) factor;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%sx%sx%s;", this.x, this.y, this.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = 31 * result + this.x;
|
||||
result = 31 * result + this.y;
|
||||
result = 31 * result + this.z;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (this.getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final Vect other = (Vect) obj;
|
||||
return this.x == other.x && this.y == other.y && this.z == other.z;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.core.item.ItemCore;
|
||||
import forestry.api.core.IModelManager;
|
||||
@@ -47,7 +48,7 @@ public class ItemInsulatedTube extends ItemCore implements IColoredItem {
|
||||
if (tintIndex == 0) {
|
||||
return 16777215;
|
||||
} else if (tintIndex == 1) {
|
||||
Material.get(stack.getItemDamage()).getColor();
|
||||
return Material.get(stack.getItemDamage()).getColor();
|
||||
}
|
||||
return Insulate.get(stack.getItemDamage()).getColor();
|
||||
}
|
||||
@@ -60,7 +61,7 @@ public class ItemInsulatedTube extends ItemCore implements IColoredItem {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack p_77653_1_) {
|
||||
return Material.get(p_77653_1_.getItemDamage()).getName() + " Insulated Tube";
|
||||
return Material.get(p_77653_1_.getItemDamage()).getName() + " " + super.getItemStackDisplayName(p_77653_1_);
|
||||
}
|
||||
|
||||
public static String getInsulate(ItemStack stack) {
|
||||
|
||||
@@ -155,6 +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 boolean isOpaqueCube(IBlockState state) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.gardening;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
@@ -12,8 +14,12 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.ItemMeshDefinition;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
@@ -53,11 +59,10 @@ public class ItemTrowel extends Item implements IItemModelRegister {
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
if (facing == EnumFacing.DOWN || (!world.isAirBlock(pos.up()) && world.getBlockState(pos.up()).getBlock() != Botany.flower) || (block != Blocks.GRASS && block != Blocks.DIRT)) {
|
||||
if (facing == EnumFacing.DOWN || (!world.isAirBlock(pos.up()) && world.getBlockState(pos.up()).getBlock() != Botany.flower) || (block != Blocks.GRASS && block != Blocks.DIRT && block != Blocks.GRASS_PATH)) {
|
||||
return EnumActionResult.PASS;
|
||||
}
|
||||
Block block2 = Botany.soil;
|
||||
world.playSound(player, hitX + 0.5f, hitY + 0.5f, hitZ + 0.5f, block2.getSoundType().getStepSound(), SoundCategory.NEUTRAL, (block2.getSoundType().getVolume() + 1.0f) / 2.0f, block2.getSoundType().getPitch() * 0.8f);
|
||||
world.playSound(player, pos, SoundEvents.ITEM_SHOVEL_FLATTEN, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
if (world.isRemote) {
|
||||
return EnumActionResult.SUCCESS;
|
||||
}
|
||||
@@ -67,6 +72,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));
|
||||
}
|
||||
|
||||
return multimap;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -108,10 +108,17 @@ public class ModuleGardening implements IInitializable {
|
||||
final ItemStack yellow = new ItemStack(Blocks.YELLOW_FLOWER, 1);
|
||||
final ItemStack red = new ItemStack(Blocks.RED_FLOWER, 1);
|
||||
final ItemStack blue = new ItemStack(Blocks.RED_FLOWER, 1, 7);
|
||||
for (final boolean manual : new boolean[]{true, false}) {
|
||||
for (final boolean fertilised : new boolean[]{true, false}) {
|
||||
for (final EnumMoisture moist : EnumMoisture.values()) {
|
||||
final ItemStack icon = (moist == EnumMoisture.Dry) ? yellow : ((moist == EnumMoisture.Normal) ? red : blue);
|
||||
for (boolean manual : new boolean[]{true, false}) {
|
||||
for (boolean fertilised : new boolean[]{true, false}) {
|
||||
for (EnumMoisture moist : EnumMoisture.values()) {
|
||||
ItemStack icon;
|
||||
if(moist == EnumMoisture.Dry){
|
||||
icon = yellow;
|
||||
}else if(moist == EnumMoisture.Normal){
|
||||
icon = red;
|
||||
}else{
|
||||
icon = blue;
|
||||
}
|
||||
int insulate = 2 - moist.ordinal();
|
||||
if (fertilised) {
|
||||
insulate += 3;
|
||||
|
||||
@@ -42,21 +42,6 @@ public class BinnieCircuit implements ICircuit {
|
||||
return this.uid;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean requiresDiscovery() {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getLimit() {
|
||||
// return this.limit;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public String getName() {
|
||||
// return this.uid;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void addTooltip(final List<String> list) {
|
||||
for (final String string : this.tooltips) {
|
||||
|
||||
@@ -7,12 +7,9 @@ import binnie.core.machines.power.TankInfo;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
import net.minecraftforge.fluids.capability.FluidTankProperties;
|
||||
import net.minecraftforge.fluids.capability.FluidTankPropertiesWrapper;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandler;
|
||||
import net.minecraftforge.fluids.capability.IFluidTankProperties;
|
||||
|
||||
|
||||
@@ -37,10 +37,10 @@ public class ControlSequencerProgress extends ControlProgressBase {
|
||||
final int k = rand.nextInt(4);
|
||||
final String code = codes[k];
|
||||
if (rand.nextFloat() < this.progress) {
|
||||
final String col = "§" + colors[k];
|
||||
text = text + "§r" + col + "§l" + code;
|
||||
final String col = "§" + colors[k];
|
||||
text = text + "§r" + col + "§l" + code;
|
||||
} else {
|
||||
text = text + "§r§7§k§l" + code;
|
||||
text = text + "§r§7§k§l" + code;
|
||||
}
|
||||
}
|
||||
this.textControl.setValue(text);
|
||||
|
||||
@@ -27,10 +27,6 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
@Mod(modid = Constants.EXTRA_BEES_MOD_ID, name = "Binnie's Extra Bees", useMetadata = true, dependencies = "required-after:" + Constants.CORE_MOD_ID)
|
||||
public class ExtraBees extends AbstractMod {
|
||||
|
||||
public ExtraBees() {
|
||||
getClass();
|
||||
}
|
||||
|
||||
@Mod.Instance(Constants.EXTRA_BEES_MOD_ID)
|
||||
public static ExtraBees instance;
|
||||
@SidedProxy(clientSide = "binnie.extrabees.proxy.ExtraBeesProxyClient", serverSide = "binnie.extrabees.proxy.ExtraBeesProxyServer")
|
||||
|
||||
@@ -48,9 +48,9 @@ public class ModuleMachine implements IInitializable {
|
||||
Acclimatiser.setupRecipes();
|
||||
final Object[] standardCircuit = {Mods.Forestry.stack("chipsets", 1, 1)};
|
||||
final Object[] advCircuit = {GeneticsItems.IntegratedCircuit.get(1)};
|
||||
final String ironGear = OreDictionary.getOres("gearIron").isEmpty() ? "gearIron" : "ingotIron";
|
||||
final String goldGear = OreDictionary.getOres("gearGold").isEmpty() ? "gearIron" : "ingotIron";
|
||||
final String diamondGear = OreDictionary.getOres("gearDiamond").isEmpty() ? "gearIron" : "ingotIron";
|
||||
final String ironGear = !OreDictionary.getOres("gearIron").isEmpty() ? "gearIron" : "ingotIron";
|
||||
final String goldGear = !OreDictionary.getOres("gearGold").isEmpty() ? "gearIron" : "ingotIron";
|
||||
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;
|
||||
|
||||
Reference in new issue
Block a user