mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
removed dead code, started chemical plant rewrite, refactoring
This commit is contained in:
parent
78efaa49a1
commit
05892abbe7
@ -4,6 +4,5 @@ import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
public interface IFluidAcceptor extends IFluidContainer {
|
||||
|
||||
int getMaxFluidFill(FluidType type);
|
||||
|
||||
int getMaxFillForReceive(FluidType type);
|
||||
}
|
||||
|
||||
@ -8,15 +8,13 @@ import com.hbm.inventory.fluid.FluidType;
|
||||
public interface IFluidContainer {
|
||||
|
||||
//Args: fill, what the fill should be set to; index, index for array if there are multiple tanks
|
||||
public void setFillstate(int fill, int index);
|
||||
public void setFillForSync(int fill, int index);
|
||||
|
||||
//Args: fill: what the fill should be set to; type, what type the tank in question has
|
||||
void setFluidFill(int fill, FluidType type);
|
||||
void setFillForTransfer(int fill, FluidType type);
|
||||
|
||||
//Args: type, what the type should be set to; index, index for array if there are multiple tanks
|
||||
public void setType(FluidType type, int index);
|
||||
|
||||
public List<FluidTank> getTanks();
|
||||
public void setTypeForSync(FluidType type, int index);
|
||||
|
||||
//Args: type, what type the tank in question has
|
||||
int getFluidFill(FluidType type);
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.hbm.inventory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
@ -16,15 +18,21 @@ import com.hbm.hazard.HazardRegistry;
|
||||
import com.hbm.hazard.HazardSystem;
|
||||
import com.hbm.items.ItemEnums.EnumCokeType;
|
||||
import com.hbm.items.ItemEnums.EnumTarType;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent;
|
||||
|
||||
//the more i optimize this, the more it starts looking like gregtech
|
||||
public class OreDictManager {
|
||||
|
||||
/** Alternate, additional names for ore dict registration. Used mostly for DictGroups */
|
||||
private static final HashMap<String, HashSet<String>> reRegistration = new HashMap();
|
||||
|
||||
/*
|
||||
* Standard keys
|
||||
@ -225,14 +233,14 @@ public class OreDictManager {
|
||||
/*
|
||||
* COLLECTIONS
|
||||
*/
|
||||
public static final DictFrame ANY_PLASTIC = new DictFrame("AnyPlastic"); //using the Any prefix means that it's jsut the secondary prefix, and that shape prefixes are applicable
|
||||
public static final DictGroup ANY_PLASTIC = new DictGroup("AnyPlastic", POLYMER, BAKELITE); //using the Any prefix means that it's jsut the secondary prefix, and that shape prefixes are applicable
|
||||
public static final DictFrame ANY_GUNPOWDER = new DictFrame("AnyPropellant");
|
||||
public static final DictFrame ANY_SMOKELESS = new DictFrame("AnySmokeless");
|
||||
public static final DictFrame ANY_PLASTICEXPLOSIVE = new DictFrame("AnyPlasticexplosive");
|
||||
public static final DictFrame ANY_HIGHEXPLOSIVE = new DictFrame("AnyHighexplosive");
|
||||
public static final DictFrame ANY_COKE = new DictFrame("AnyCoke", "Coke");
|
||||
public static final DictFrame ANY_CONCRETE = new DictFrame("Concrete"); //no any prefix means that any has to be appended with the any() or anys() getters, registering works with the any (i.e. no shape) setter
|
||||
public static final DictFrame ANY_TAR = new DictFrame("Tar");
|
||||
public static final DictGroup ANY_TAR = new DictGroup("Tar", KEY_OIL_TAR, KEY_COAL_TAR, KEY_CRACK_TAR);
|
||||
|
||||
public static void registerOres() {
|
||||
|
||||
@ -377,14 +385,12 @@ public class OreDictManager {
|
||||
/*
|
||||
* COLLECTIONS
|
||||
*/
|
||||
ANY_PLASTIC .ingot(ingot_polymer, ingot_bakelite).dust(powder_polymer, powder_bakelite);
|
||||
ANY_GUNPOWDER .dust(Items.gunpowder, ballistite, cordite);
|
||||
ANY_SMOKELESS .dust(ballistite, cordite);
|
||||
ANY_PLASTICEXPLOSIVE .ingot(ingot_semtex);
|
||||
ANY_HIGHEXPLOSIVE .ingot(ball_tnt);
|
||||
ANY_CONCRETE .any(concrete, concrete_smooth, concrete_colored, concrete_asbestos, ducrete, ducrete_smooth);
|
||||
ANY_COKE .gem(fromAll(coke, EnumCokeType.class));
|
||||
ANY_TAR .any(fromAll(oil_tar, EnumTarType.class));
|
||||
|
||||
OreDictionary.registerOre(KEY_OIL_TAR, fromOne(oil_tar, EnumTarType.CRUDE));
|
||||
OreDictionary.registerOre(KEY_CRACK_TAR, fromOne(oil_tar, EnumTarType.CRACK));
|
||||
@ -448,8 +454,31 @@ public class OreDictManager {
|
||||
return GeneralConfig.enableReflectorCompat ? "plateDenseLead" : "plateTungCar"; //let's just mangle the name into "tungCar" so that it can't conflict with anything ever
|
||||
}
|
||||
|
||||
public void registerGroups() {
|
||||
public static void registerGroups() {
|
||||
ANY_PLASTIC.addPrefix(INGOT, true).addPrefix(DUST, true);
|
||||
ANY_TAR.addPrefix(ANY, false);
|
||||
}
|
||||
|
||||
private static boolean recursionBrake = false;
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRegisterOre(OreRegisterEvent event) {
|
||||
|
||||
if(recursionBrake)
|
||||
return;
|
||||
|
||||
recursionBrake = true;
|
||||
|
||||
HashSet<String> strings = reRegistration.get(event.Name);
|
||||
|
||||
if(strings != null) {
|
||||
for(String name : strings) {
|
||||
OreDictionary.registerOre(name, event.Ore);
|
||||
MainRegistry.logger.info("Re-registration for " + event.Name + " to " + name);
|
||||
}
|
||||
}
|
||||
|
||||
recursionBrake = false;
|
||||
}
|
||||
|
||||
public static class DictFrame {
|
||||
@ -618,51 +647,84 @@ public class OreDictManager {
|
||||
}
|
||||
}
|
||||
|
||||
/*public static class DictGroup {
|
||||
public static class DictGroup {
|
||||
|
||||
private String name;
|
||||
private HashSet<DictFrame> frames = new HashSet();
|
||||
private String groupName;
|
||||
private HashSet<String> names = new HashSet();
|
||||
|
||||
public DictGroup(String name) {
|
||||
this.name = name;
|
||||
public DictGroup(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
public DictGroup(String groupName, String... names) {
|
||||
this(groupName);
|
||||
this.addNames(names);
|
||||
}
|
||||
public DictGroup(String groupName, DictFrame... frames) {
|
||||
this(groupName);
|
||||
this.addFrames(frames);
|
||||
}
|
||||
|
||||
public DictGroup(String name, DictFrame... frames) {
|
||||
this(name);
|
||||
|
||||
for(DictFrame frame : frames) {
|
||||
this.frames.add(frame);
|
||||
}
|
||||
public DictGroup addNames(String... names) {
|
||||
for(String mat : names) this.names.add(mat);
|
||||
return this;
|
||||
}
|
||||
public DictGroup addFrames(DictFrame... frames) {
|
||||
for(DictFrame frame : frames) this.addNames(frame.mats);
|
||||
return this;
|
||||
}
|
||||
|
||||
public DictGroup prefix(String prefix) {
|
||||
/**
|
||||
* Will add a reregistration entry for every mat name of every added DictFrame for the given prefix
|
||||
* @param prefix The prefix of both the input and result of the reregistration
|
||||
* @return
|
||||
*/
|
||||
public DictGroup addPrefix(String prefix, boolean inputPrefix) {
|
||||
|
||||
String groupKey = prefix + name;
|
||||
String group = prefix + groupName;
|
||||
|
||||
for(DictFrame frame : this.frames) {
|
||||
String key = prefix + frame.mats[0];
|
||||
|
||||
List<ItemStack> ores = OreDictionary.getOres(key);
|
||||
|
||||
for(ItemStack stack : ores) {
|
||||
OreDictionary.registerOre(groupKey, stack);
|
||||
}
|
||||
for(String name : names) {
|
||||
String original = (inputPrefix ? prefix : "") + name;
|
||||
addReRegistration(original, group);
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Same thing as addPrefix, but the input for the reregistration is not bound by the prefix or any mat names
|
||||
* @param prefix The prefix for the resulting reregistration entry (in full: prefix + group name)
|
||||
* @param original The full original ore dict key, not bound by any naming conventions
|
||||
* @return
|
||||
*/
|
||||
public DictGroup addFixed(String prefix, String original) {
|
||||
|
||||
String group = prefix + groupName;
|
||||
addReRegistration(original, group);
|
||||
return this;
|
||||
}
|
||||
|
||||
public String any() { return ANY + name; }
|
||||
public String nugget() { return NUGGET + name; }
|
||||
public String tiny() { return TINY + name; }
|
||||
public String ingot() { return INGOT + name; }
|
||||
public String dustTiny() { return DUSTTINY + name; }
|
||||
public String dust() { return DUST + name; }
|
||||
public String gem() { return GEM + name; }
|
||||
public String crystal() { return CRYSTAL + name; }
|
||||
public String plate() { return PLATE + name; }
|
||||
public String billet() { return BILLET + name; }
|
||||
public String block() { return BLOCK + name; }
|
||||
public String ore() { return ORE + name; }
|
||||
}*/
|
||||
public String any() { return ANY + groupName; }
|
||||
public String nugget() { return NUGGET + groupName; }
|
||||
public String tiny() { return TINY + groupName; }
|
||||
public String ingot() { return INGOT + groupName; }
|
||||
public String dustTiny() { return DUSTTINY + groupName; }
|
||||
public String dust() { return DUST + groupName; }
|
||||
public String gem() { return GEM + groupName; }
|
||||
public String crystal() { return CRYSTAL + groupName; }
|
||||
public String plate() { return PLATE + groupName; }
|
||||
public String billet() { return BILLET + groupName; }
|
||||
public String block() { return BLOCK + groupName; }
|
||||
public String ore() { return ORE + groupName; }
|
||||
}
|
||||
|
||||
private static void addReRegistration(String original, String additional) {
|
||||
|
||||
HashSet<String> strings = reRegistration.get(original);
|
||||
|
||||
if(strings == null)
|
||||
strings = new HashSet();
|
||||
|
||||
strings.add(additional);
|
||||
|
||||
reRegistration.put(original, strings);
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,17 +242,61 @@ public class ChemplantRecipes {
|
||||
new ItemStack(ModItems.gem_tantalium),
|
||||
new ItemStack(ModItems.dust, 3))
|
||||
.outputFluids(new FluidStack(Fluids.WATER, 250)));
|
||||
recipes.add(new ChemRecipe(68, "VIT_LIQUID", 100));
|
||||
recipes.add(new ChemRecipe(69, "VIT_GAS", 100));
|
||||
recipes.add(new ChemRecipe(70, "TEL", 40));
|
||||
recipes.add(new ChemRecipe(71, "GASOLINE", 40));
|
||||
recipes.add(new ChemRecipe(72, "FRACKSOL", 20));
|
||||
recipes.add(new ChemRecipe(73, "HELIUM3", 200));
|
||||
recipes.add(new ChemRecipe(74, "OSMIRIDIUM_DEATH", 240));
|
||||
recipes.add(new ChemRecipe(75, "ETHANOL", 50));
|
||||
recipes.add(new ChemRecipe(76, "METH", 30));
|
||||
recipes.add(new ChemRecipe(77, "CO2", 60));
|
||||
recipes.add(new ChemRecipe(78, "HEAVY_ELECTROLYSIS", 150));
|
||||
recipes.add(new ChemRecipe(68, "VIT_LIQUID", 100)
|
||||
.inputItems(new ComparableStack(ModBlocks.sand_lead))
|
||||
.inputFluids(new FluidStack(Fluids.WASTEFLUID, 1000))
|
||||
.outputItems(new ItemStack(ModItems.nuclear_waste_vitrified)));
|
||||
recipes.add(new ChemRecipe(69, "VIT_GAS", 100)
|
||||
.inputItems(new ComparableStack(ModBlocks.sand_lead))
|
||||
.inputFluids(new FluidStack(Fluids.WASTEGAS, 1000))
|
||||
.outputItems(new ItemStack(ModItems.nuclear_waste_vitrified)));
|
||||
recipes.add(new ChemRecipe(70, "TEL", 40)
|
||||
.inputItems(
|
||||
new OreDictStack(ANY_TAR.any()),
|
||||
new OreDictStack(PB.dust()))
|
||||
.inputFluids(
|
||||
new FluidStack(Fluids.PETROLEUM, 100),
|
||||
new FluidStack(Fluids.STEAM, 1000))
|
||||
.outputItems(new ItemStack(ModItems.antiknock)));
|
||||
recipes.add(new ChemRecipe(71, "GASOLINE", 40)
|
||||
.inputItems(new ComparableStack(ModItems.antiknock))
|
||||
.inputFluids(new FluidStack(Fluids.PETROIL, 10_000))
|
||||
.outputFluids(new FluidStack(Fluids.GASOLINE, 12_000)));
|
||||
recipes.add(new ChemRecipe(72, "FRACKSOL", 20)
|
||||
.inputItems(new OreDictStack(S.dust()))
|
||||
.inputFluids(
|
||||
new FluidStack(Fluids.PETROLEUM, 100),
|
||||
new FluidStack(Fluids.WATER, 1000))
|
||||
.outputFluids(new FluidStack(Fluids.FRACKSOL, 1000)));
|
||||
recipes.add(new ChemRecipe(73, "HELIUM3", 200)
|
||||
.inputItems(new ComparableStack(ModBlocks.moon_turf, 8))
|
||||
.outputFluids(new FluidStack(Fluids.HELIUM3, 1000)));
|
||||
recipes.add(new ChemRecipe(74, "OSMIRIDIUM_DEATH", 240)
|
||||
.inputItems(
|
||||
new ComparableStack(ModItems.powder_paleogenite),
|
||||
new OreDictStack(F.dust(), 8),
|
||||
new ComparableStack(ModItems.nugget_bismuth, 4))
|
||||
.inputFluids(new FluidStack(Fluids.ACID, 1000))
|
||||
.outputFluids(new FluidStack(Fluids.DEATH, 1000)));
|
||||
recipes.add(new ChemRecipe(75, "ETHANOL", 50)
|
||||
.inputItems(new ComparableStack(Items.sugar, 6))
|
||||
.outputFluids(new FluidStack(Fluids.ETHANOL, 1000)));
|
||||
recipes.add(new ChemRecipe(76, "METH", 30)
|
||||
.inputItems(
|
||||
new ComparableStack(Items.wheat),
|
||||
new ComparableStack(Items.dye, 2, 3))
|
||||
.inputFluids(
|
||||
new FluidStack(Fluids.LUBRICANT, 400),
|
||||
new FluidStack(Fluids.ACID, 400))
|
||||
.outputItems(new ItemStack(ModItems.chocolate, 4)));
|
||||
recipes.add(new ChemRecipe(77, "CO2", 60)
|
||||
.inputFluids(new FluidStack(Fluids.GAS, 1000))
|
||||
.outputFluids(new FluidStack(Fluids.CARBONDIOXIDE, 1000)));
|
||||
recipes.add(new ChemRecipe(78, "HEAVY_ELECTROLYSIS", 150)
|
||||
.inputFluids(new FluidStack(Fluids.HEAVYWATER, 8000))
|
||||
.outputFluids(
|
||||
new FluidStack(Fluids.DEUTERIUM, 400),
|
||||
new FluidStack(Fluids.OXYGEN, 400)));
|
||||
|
||||
}
|
||||
|
||||
@ -315,10 +359,10 @@ public class ChemplantRecipes {
|
||||
|
||||
private int id;
|
||||
public String name;
|
||||
private AStack[] inputs;
|
||||
private FluidStack[] inputFluids;
|
||||
private ItemStack[] outputs;
|
||||
private FluidStack[] outputFluids;
|
||||
public AStack[] inputs;
|
||||
public FluidStack[] inputFluids;
|
||||
public ItemStack[] outputs;
|
||||
public FluidStack[] outputFluids;
|
||||
private int duration;
|
||||
|
||||
public ChemRecipe(int index, String name, int duration) {
|
||||
|
||||
@ -76,19 +76,6 @@ public class ItemAnalyzer extends Item {
|
||||
"Electricity: " + ((IEnergyConnector)te).getPower() + " HE"));
|
||||
}
|
||||
|
||||
if(te instanceof IFluidContainer) {
|
||||
|
||||
player.addChatMessage(new ChatComponentText(
|
||||
"Fluid Tanks:"));
|
||||
|
||||
List<FluidTank> tanks = ((IFluidContainer)te).getTanks();
|
||||
|
||||
for(int i = 0; i < tanks.size(); i++) {
|
||||
player.addChatMessage(new ChatComponentText(
|
||||
" *Tank " + (i + 1) + ": " + tanks.get(i).getFill() + "mB " + I18n.format(tanks.get(i).getTankType().getUnlocalizedName())));
|
||||
}
|
||||
}
|
||||
|
||||
if(te instanceof IFluidDuct) {
|
||||
|
||||
player.addChatMessage(new ChatComponentText(
|
||||
|
||||
@ -618,8 +618,8 @@ public class Library {
|
||||
}
|
||||
}
|
||||
|
||||
if(tileentity instanceof IFluidAcceptor && newTact && ((IFluidAcceptor)tileentity).getMaxFluidFill(type) > 0 &&
|
||||
((IFluidAcceptor)tileentity).getMaxFluidFill(type) - ((IFluidAcceptor)tileentity).getFluidFill(type) > 0) {
|
||||
if(tileentity instanceof IFluidAcceptor && newTact && ((IFluidAcceptor)tileentity).getMaxFillForReceive(type) > 0 &&
|
||||
((IFluidAcceptor)tileentity).getMaxFillForReceive(type) - ((IFluidAcceptor)tileentity).getFluidFill(type) > 0) {
|
||||
that.getFluidList(type).add((IFluidAcceptor)tileentity);
|
||||
}
|
||||
|
||||
@ -631,15 +631,15 @@ public class Library {
|
||||
int part = that.getFluidFill(type) / size;
|
||||
for(IFluidAcceptor consume : that.getFluidList(type))
|
||||
{
|
||||
if(consume.getFluidFill(type) < consume.getMaxFluidFill(type))
|
||||
if(consume.getFluidFill(type) < consume.getMaxFillForReceive(type))
|
||||
{
|
||||
if(consume.getMaxFluidFill(type) - consume.getFluidFill(type) >= part)
|
||||
if(consume.getMaxFillForReceive(type) - consume.getFluidFill(type) >= part)
|
||||
{
|
||||
that.setFluidFill(that.getFluidFill(type) - part, type);
|
||||
consume.setFluidFill(consume.getFluidFill(type) + part, type);
|
||||
that.setFillForTransfer(that.getFluidFill(type) - part, type);
|
||||
consume.setFillForTransfer(consume.getFluidFill(type) + part, type);
|
||||
} else {
|
||||
that.setFluidFill(that.getFluidFill(type) - (consume.getMaxFluidFill(type) - consume.getFluidFill(type)), type);
|
||||
consume.setFluidFill(consume.getMaxFluidFill(type), type);
|
||||
that.setFillForTransfer(that.getFluidFill(type) - (consume.getMaxFillForReceive(type) - consume.getFluidFill(type)), type);
|
||||
consume.setFillForTransfer(consume.getMaxFillForReceive(type), type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -263,6 +263,7 @@ public class MainRegistry {
|
||||
SiegeTier.registerTiers();
|
||||
HazardRegistry.registerItems();
|
||||
HazardRegistry.registerTrafos();
|
||||
OreDictManager.registerGroups();
|
||||
|
||||
Library.superuser.add("192af5d7-ed0f-48d8-bd89-9d41af8524f8");
|
||||
Library.superuser.add("5aee1e3d-3767-4987-a222-e7ce1fbdf88e");
|
||||
|
||||
@ -62,8 +62,8 @@ public class TEFluidPacket implements IMessage {
|
||||
if (te != null && te instanceof IFluidContainer) {
|
||||
|
||||
IFluidContainer gen = (IFluidContainer) te;
|
||||
gen.setFillstate(m.fill, m.index);
|
||||
gen.setType(Fluids.fromID(m.type), m.index);
|
||||
gen.setFillForSync(m.fill, m.index);
|
||||
gen.setTypeForSync(Fluids.fromID(m.type), m.index);
|
||||
}
|
||||
} catch(Exception x) { }
|
||||
return null;
|
||||
|
||||
@ -41,51 +41,38 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
|
||||
if(!fluid)
|
||||
return;
|
||||
|
||||
if(getTile() instanceof IFluidAcceptor) {
|
||||
((IFluidAcceptor)getTile()).setFillstate(fill, index);
|
||||
((IFluidAcceptor)getTile()).setFillForSync(fill, index);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
|
||||
if(!fluid)
|
||||
return;
|
||||
|
||||
if(getTile() instanceof IFluidAcceptor) {
|
||||
((IFluidAcceptor)getTile()).setFluidFill(fill, type);
|
||||
((IFluidAcceptor)getTile()).setFillForTransfer(fill, type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
|
||||
if(!fluid)
|
||||
return;
|
||||
|
||||
if(getTile() instanceof IFluidAcceptor) {
|
||||
((IFluidAcceptor)getTile()).setType(type, index);
|
||||
((IFluidAcceptor)getTile()).setTypeForSync(type, index);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
|
||||
if(!fluid)
|
||||
return null;
|
||||
|
||||
if(getTile() instanceof IFluidAcceptor) {
|
||||
return ((IFluidAcceptor)getTile()).getTanks();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
|
||||
@ -100,13 +87,13 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
|
||||
if(!fluid)
|
||||
return 0;
|
||||
|
||||
if(getTile() instanceof IFluidAcceptor) {
|
||||
return ((IFluidAcceptor)getTile()).getMaxFluidFill(type);
|
||||
return ((IFluidAcceptor)getTile()).getMaxFillForReceive(type);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@ -503,7 +503,7 @@ public class TileEntityCompactLauncher extends TileEntity implements ISidedInven
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -513,13 +513,13 @@ public class TileEntityCompactLauncher extends TileEntity implements ISidedInven
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(fill);
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -527,20 +527,11 @@ public class TileEntityCompactLauncher extends TileEntity implements ISidedInven
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
|
||||
@ -482,7 +482,7 @@ public class TileEntityLaunchTable extends TileEntity implements ISidedInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -492,13 +492,13 @@ public class TileEntityLaunchTable extends TileEntity implements ISidedInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(fill);
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -506,20 +506,11 @@ public class TileEntityLaunchTable extends TileEntity implements ISidedInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
|
||||
@ -469,7 +469,7 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IF
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -483,7 +483,7 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IF
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -509,13 +509,13 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IF
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 4 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 4 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
@ -531,15 +531,4 @@ public class TileEntityAMSBase extends TileEntity implements ISidedInventory, IF
|
||||
{
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
list.add(tanks[2]);
|
||||
list.add(tanks[3]);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -365,7 +365,7 @@ public class TileEntityAMSEmitter extends TileEntity implements ISidedInventory,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
@ -379,7 +379,7 @@ public class TileEntityAMSEmitter extends TileEntity implements ISidedInventory,
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
return tank.getMaxFill();
|
||||
else
|
||||
@ -387,12 +387,12 @@ public class TileEntityAMSEmitter extends TileEntity implements ISidedInventory,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@ -407,12 +407,4 @@ public class TileEntityAMSEmitter extends TileEntity implements ISidedInventory,
|
||||
{
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -379,7 +379,7 @@ public class TileEntityAMSLimiter extends TileEntity implements ISidedInventory,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
@ -393,7 +393,7 @@ public class TileEntityAMSLimiter extends TileEntity implements ISidedInventory,
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
return tank.getMaxFill();
|
||||
else
|
||||
@ -401,12 +401,12 @@ public class TileEntityAMSLimiter extends TileEntity implements ISidedInventory,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@ -421,13 +421,4 @@ public class TileEntityAMSLimiter extends TileEntity implements ISidedInventory,
|
||||
{
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -184,7 +184,7 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
|
||||
@ -192,25 +192,16 @@ public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
|
||||
@ -102,7 +102,7 @@ public class TileEntityCondenser extends TileEntity implements IFluidAcceptor, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -120,7 +120,7 @@ public class TileEntityCondenser extends TileEntity implements IFluidAcceptor, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
|
||||
@ -128,25 +128,16 @@ public class TileEntityCondenser extends TileEntity implements IFluidAcceptor, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
|
||||
@ -187,7 +187,7 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
@ -201,7 +201,7 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
return tank.getMaxFill();
|
||||
else
|
||||
@ -209,23 +209,15 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
this.power = i;
|
||||
|
||||
@ -103,7 +103,7 @@ public class TileEntityCoreInjector extends TileEntityMachineBase implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -113,7 +113,7 @@ public class TileEntityCoreInjector extends TileEntityMachineBase implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -131,25 +131,16 @@ public class TileEntityCoreInjector extends TileEntityMachineBase implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
@ -91,7 +91,7 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
@ -105,7 +105,7 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
return tank.getMaxFill();
|
||||
else
|
||||
@ -113,23 +113,15 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addEnergy(World world, int x, int y, int z, long energy, ForgeDirection dir) {
|
||||
|
||||
|
||||
@ -134,7 +134,7 @@ public class TileEntityDeuteriumExtractor extends TileEntityMachineBase implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -152,7 +152,7 @@ public class TileEntityDeuteriumExtractor extends TileEntityMachineBase implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
|
||||
@ -160,26 +160,17 @@ public class TileEntityDeuteriumExtractor extends TileEntityMachineBase implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
return list;
|
||||
|
||||
@ -386,19 +386,19 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 3 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 3 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[1].getTankType().name()))
|
||||
tanks[1].setFill(i);
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
@ -416,7 +416,7 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory,
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tanks[1].getTankType().name()))
|
||||
return tanks[1].getMaxFill();
|
||||
else if(type.name().equals(tanks[2].getTankType().name()))
|
||||
@ -424,14 +424,4 @@ public class TileEntityFWatzCore extends TileEntity implements ISidedInventory,
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
list.add(tanks[2]);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1197,19 +1197,19 @@ public class TileEntityFusionMultiblock extends TileEntity implements ISidedInve
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 3 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 3 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -1231,7 +1231,7 @@ public class TileEntityFusionMultiblock extends TileEntity implements ISidedInve
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -1241,15 +1241,4 @@ public class TileEntityFusionMultiblock extends TileEntity implements ISidedInve
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
list.add(tanks[2]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -308,7 +308,7 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
|
||||
@ -317,7 +317,7 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -327,7 +327,7 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
|
||||
@ -335,16 +335,6 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser
|
||||
plasma.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
list.add(plasma);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
@ -388,7 +378,7 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyUser
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
|
||||
@ -350,7 +350,7 @@ public class TileEntityMachineBoiler extends TileEntity implements ISidedInvento
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -368,7 +368,7 @@ public class TileEntityMachineBoiler extends TileEntity implements ISidedInvento
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
|
||||
@ -376,25 +376,16 @@ public class TileEntityMachineBoiler extends TileEntity implements ISidedInvento
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
|
||||
@ -352,7 +352,7 @@ public class TileEntityMachineBoilerElectric extends TileEntity implements ISide
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -370,7 +370,7 @@ public class TileEntityMachineBoilerElectric extends TileEntity implements ISide
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
|
||||
@ -378,25 +378,16 @@ public class TileEntityMachineBoilerElectric extends TileEntity implements ISide
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
|
||||
@ -335,17 +335,17 @@ public class TileEntityMachineCMBFactory extends TileEntity implements ISidedInv
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
@ -355,16 +355,8 @@ public class TileEntityMachineCMBFactory extends TileEntity implements ISidedInv
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -907,19 +907,19 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 4 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 4 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -945,7 +945,7 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -1016,15 +1016,4 @@ public class TileEntityMachineChemplant extends TileEntity implements ISidedInve
|
||||
if(type.name().equals(tanks[3].getTankType().name()))
|
||||
list2.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
list.add(tanks[2]);
|
||||
list.add(tanks[3]);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,130 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.ChemplantRecipes;
|
||||
import com.hbm.inventory.recipes.ChemplantRecipes.ChemRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class TileEntityMachineChemplantNew extends TileEntityMachineBase {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
public int progress;
|
||||
public int maxProgress = 100;
|
||||
|
||||
public FluidTank[] tanks;
|
||||
|
||||
//upgraded stats
|
||||
int consumption = 100;
|
||||
int speed = 100;
|
||||
|
||||
public TileEntityMachineChemplantNew() {
|
||||
super(21);
|
||||
/*
|
||||
* 0 Battery
|
||||
* 1-3 Upgrades
|
||||
* 4 Schematic
|
||||
* 5-8 Output
|
||||
* 9-10 FOut In
|
||||
* 11-12 FOut Out
|
||||
* 13-16 Input
|
||||
* 17-18 FIn In
|
||||
* 19-20 FIn Out
|
||||
*/
|
||||
|
||||
tanks = new FluidTank[4];
|
||||
for(int i = 0; i < 4; i++) {
|
||||
tanks[i] = new FluidTank(Fluids.NONE, 24_000, i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "container.chemplant";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
UpgradeManager.eval(slots, 1, 3);
|
||||
|
||||
int speedLevel = Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3);
|
||||
int powerLevel = Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3);
|
||||
int overLevel = UpgradeManager.getLevel(UpgradeType.OVERDRIVE);
|
||||
|
||||
speed -= speedLevel * 25;
|
||||
consumption += speedLevel * 300;
|
||||
speed += powerLevel * 5;
|
||||
consumption -= powerLevel * 30;
|
||||
speed /= (overLevel + 1);
|
||||
consumption *= (overLevel + 1);
|
||||
|
||||
if(!canProcess()) {
|
||||
this.progress = 0;
|
||||
} else {
|
||||
process();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
|
||||
}
|
||||
|
||||
private boolean canProcess() {
|
||||
|
||||
if(slots[4] == null || slots[4].getItem() != ModItems.chemistry_template)
|
||||
return false;
|
||||
|
||||
ChemRecipe recipe = ChemplantRecipes.indexMapping.get(slots[4].getItemDamage());
|
||||
|
||||
if(recipe == null)
|
||||
return false;
|
||||
|
||||
setupTanks(recipe);
|
||||
|
||||
if(!hasRequiredFluids(recipe))
|
||||
return false;
|
||||
|
||||
if(!hasSpaceForFluids(recipe))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void setupTanks(ChemRecipe recipe) {
|
||||
if(recipe.inputFluids.length > 0) tanks[0].setTankType(recipe.inputFluids[0].type);
|
||||
if(recipe.inputFluids.length > 1) tanks[1].setTankType(recipe.inputFluids[1].type);
|
||||
if(recipe.outputFluids.length > 0) tanks[2].setTankType(recipe.outputFluids[0].type);
|
||||
if(recipe.outputFluids.length > 1) tanks[3].setTankType(recipe.outputFluids[1].type);
|
||||
}
|
||||
|
||||
private boolean hasRequiredFluids(ChemRecipe recipe) {
|
||||
if(recipe.inputFluids.length > 0 && tanks[0].getFill() < recipe.inputFluids[0].fill) return false;
|
||||
if(recipe.inputFluids.length > 1 && tanks[1].getFill() < recipe.inputFluids[1].fill) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean hasSpaceForFluids(ChemRecipe recipe) {
|
||||
if(recipe.outputFluids.length > 0 && tanks[2].getFill() + recipe.outputFluids[0].fill > tanks[2].getMaxFill()) return false;
|
||||
if(recipe.outputFluids.length > 1 && tanks[3].getFill() + recipe.outputFluids[1].fill > tanks[3].getMaxFill()) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean hasRequiredItems(ChemRecipe recipe) {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void process() {
|
||||
|
||||
}
|
||||
}
|
||||
@ -314,7 +314,7 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
@ -325,25 +325,17 @@ public class TileEntityMachineCoal extends TileEntity implements ISidedInventory
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -263,32 +263,27 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return new ArrayList() {{ add(tank); }};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
return tank.getFill();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
return tank.getMaxFill();
|
||||
}
|
||||
|
||||
|
||||
@ -351,7 +351,7 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
|
||||
if(index == 0)
|
||||
coolant.setFill(fill);
|
||||
@ -360,7 +360,7 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
if(type == Fluids.COOLANT)
|
||||
coolant.setFill(fill);
|
||||
else if(type == Fluids.AMAT)
|
||||
@ -368,18 +368,13 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index == 0)
|
||||
coolant.setTankType(type);
|
||||
else if(index == 1)
|
||||
amat.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return Arrays.asList(new FluidTank[] {coolant, amat});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if(type == Fluids.COOLANT)
|
||||
@ -425,7 +420,7 @@ public class TileEntityMachineCyclotron extends TileEntityMachineBase implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
|
||||
if(type == Fluids.COOLANT)
|
||||
return coolant.getMaxFill();
|
||||
|
||||
@ -205,17 +205,17 @@ public class TileEntityMachineDiesel extends TileEntityMachineBase implements IE
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
return type == this.tank.getTankType() ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
@ -225,16 +225,8 @@ public class TileEntityMachineDiesel extends TileEntityMachineBase implements IE
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type == tank.getTankType())
|
||||
tank.setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -315,12 +315,12 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@ -354,7 +354,7 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
@ -364,19 +364,11 @@ public class TileEntityMachineGasCent extends TileEntityMachineBase implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
@Override
|
||||
|
||||
@ -520,7 +520,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -530,7 +530,7 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -548,23 +548,14 @@ public class TileEntityMachineGenerator extends TileEntity implements ISidedInve
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@ -211,12 +211,12 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
|
||||
if(type == Fluids.WATER)
|
||||
tanks[0].setFill(fill);
|
||||
@ -227,15 +227,10 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return Arrays.asList(tanks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
|
||||
@ -247,7 +242,7 @@ public class TileEntityMachineIGenerator extends TileEntityMachineBase implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
if(tanks[i].getTankType() == type)
|
||||
|
||||
@ -283,19 +283,19 @@ public class TileEntityMachineInserter extends TileEntity implements ISidedInven
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 3 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 3 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -317,7 +317,7 @@ public class TileEntityMachineInserter extends TileEntity implements ISidedInven
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -348,14 +348,4 @@ public class TileEntityMachineInserter extends TileEntity implements ISidedInven
|
||||
if(type.name().equals(tanks[2].getTankType().name()))
|
||||
list3.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
list.add(tanks[2]);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -170,7 +170,7 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -188,7 +188,7 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
|
||||
@ -196,25 +196,16 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
|
||||
@ -600,26 +600,21 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
if(type == Fluids.OIL)
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return new ArrayList() {{ add(tank); }};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if(type == Fluids.OIL)
|
||||
|
||||
@ -203,7 +203,7 @@ public class TileEntityMachinePlasmaHeater extends TileEntityMachineBase impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -215,7 +215,7 @@ public class TileEntityMachinePlasmaHeater extends TileEntityMachineBase impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -237,7 +237,7 @@ public class TileEntityMachinePlasmaHeater extends TileEntityMachineBase impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
|
||||
@ -246,7 +246,7 @@ public class TileEntityMachinePlasmaHeater extends TileEntityMachineBase impleme
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
|
||||
@ -254,16 +254,6 @@ public class TileEntityMachinePlasmaHeater extends TileEntityMachineBase impleme
|
||||
plasma.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
list.add(plasma);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
this.power = i;
|
||||
|
||||
@ -250,13 +250,13 @@ public class TileEntityMachineRadiolysis extends TileEntityMachineBase implement
|
||||
|
||||
/* Fluid Methods */
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 3 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
if(tank.getTankType() == type) {
|
||||
tank.setFill(fill);
|
||||
@ -265,15 +265,10 @@ public class TileEntityMachineRadiolysis extends TileEntityMachineBase implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
this.tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return Arrays.asList(this.tanks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
@ -285,7 +280,7 @@ public class TileEntityMachineRadiolysis extends TileEntityMachineBase implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(tanks[0].getTankType() == type) {
|
||||
return tanks[0].getMaxFill();
|
||||
}
|
||||
|
||||
@ -785,7 +785,7 @@ public class TileEntityMachineReactorLarge extends TileEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -795,7 +795,7 @@ public class TileEntityMachineReactorLarge extends TileEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -817,27 +817,17 @@ public class TileEntityMachineReactorLarge extends TileEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 3 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 3 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
list.add(tanks[2]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
return list;
|
||||
|
||||
@ -326,17 +326,17 @@ public class TileEntityMachineSeleniumEngine extends TileEntity implements ISide
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
return type == this.tank.getTankType() ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
@ -346,19 +346,11 @@ public class TileEntityMachineSeleniumEngine extends TileEntity implements ISide
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type == tank.getTankType())
|
||||
tank.setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(ForgeDirection dir) {
|
||||
return dir == ForgeDirection.DOWN;
|
||||
|
||||
@ -288,7 +288,7 @@ public class TileEntityMachineTurbine extends TileEntity implements ISidedInvent
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(i);
|
||||
else if(type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -306,7 +306,7 @@ public class TileEntityMachineTurbine extends TileEntity implements ISidedInvent
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
|
||||
@ -314,25 +314,16 @@ public class TileEntityMachineTurbine extends TileEntity implements ISidedInvent
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
|
||||
@ -497,17 +497,17 @@ public class TileEntityMachineTurbofan extends TileEntity implements ISidedInven
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
return type == this.tank.getTankType() ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
@ -517,7 +517,7 @@ public class TileEntityMachineTurbofan extends TileEntity implements ISidedInven
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type == tank.getTankType())
|
||||
tank.setFill(i);
|
||||
}
|
||||
@ -533,12 +533,4 @@ public class TileEntityMachineTurbofan extends TileEntity implements ISidedInven
|
||||
{
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -407,14 +407,14 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type == Fluids.SUPERHOTSTEAM) return steam.getMaxFill();
|
||||
if(type == Fluids.CARBONDIOXIDE) return carbonDioxide.getMaxFill();
|
||||
if(type == Fluids.WATER) return water.getMaxFill();
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type == Fluids.SUPERHOTSTEAM) steam.setFill(i);
|
||||
if(type == Fluids.CARBONDIOXIDE) carbonDioxide.setFill(i);
|
||||
if(type == Fluids.WATER) water.setFill(i);
|
||||
@ -427,7 +427,7 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
switch (index) {
|
||||
case 0: steam.setFill(fill);
|
||||
break;
|
||||
@ -439,7 +439,7 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF
|
||||
}
|
||||
}
|
||||
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
switch (index) {
|
||||
case 0: steam.setTankType(type);
|
||||
break;
|
||||
|
||||
@ -291,31 +291,22 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
|
||||
if(type == tank.getTankType())
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return new ArrayList() {
|
||||
{
|
||||
add(tank);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
|
||||
@ -326,7 +317,7 @@ public class TileEntitySILEX extends TileEntityMachineBase implements IFluidAcce
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
|
||||
if(type == tank.getTankType())
|
||||
return tank.getMaxFill();
|
||||
|
||||
@ -67,7 +67,7 @@ public class TileEntitySolarBoiler extends TileEntity implements IFluidAcceptor,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index == 0)
|
||||
water.setFill(fill);
|
||||
if(index == 1)
|
||||
@ -75,7 +75,7 @@ public class TileEntitySolarBoiler extends TileEntity implements IFluidAcceptor,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
if(type == Fluids.WATER)
|
||||
water.setFill(fill);
|
||||
if(type == Fluids.STEAM)
|
||||
@ -83,18 +83,13 @@ public class TileEntitySolarBoiler extends TileEntity implements IFluidAcceptor,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index == 0)
|
||||
water.setTankType(type);
|
||||
if(index == 1)
|
||||
steam.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return Arrays.asList(new FluidTank[] {water, steam});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if(type == Fluids.WATER)
|
||||
@ -122,7 +117,7 @@ public class TileEntitySolarBoiler extends TileEntity implements IFluidAcceptor,
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type == Fluids.WATER)
|
||||
return water.getMaxFill();
|
||||
if(type == Fluids.STEAM)
|
||||
|
||||
@ -357,7 +357,7 @@ public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements IS
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
return tanks[0].getMaxFill();
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -367,13 +367,13 @@ public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements IS
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
tanks[0].setFill(fill);
|
||||
else if (type.name().equals(tanks[1].getTankType().name()))
|
||||
@ -381,20 +381,11 @@ public class TileEntitySoyuzLauncher extends TileEntityMachineBase implements IS
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if (index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if (type.name().equals(tanks[0].getTankType().name()))
|
||||
|
||||
@ -259,7 +259,7 @@ public class TileEntityStorageDrum extends TileEntityMachineBase implements IFlu
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type == tanks[0].getTankType())
|
||||
tanks[0].setFill(i);
|
||||
else if(type == tanks[1].getTankType())
|
||||
@ -285,25 +285,16 @@ public class TileEntityStorageDrum extends TileEntityMachineBase implements IFlu
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 2 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
@ -701,12 +701,12 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@ -730,7 +730,7 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
tank.setFill(i);
|
||||
}
|
||||
|
||||
@ -743,12 +743,4 @@ public class TileEntityWatzCore extends TileEntity implements ISidedInventory, I
|
||||
public void clearFluidList(FluidType type) {
|
||||
list1.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,13 +111,13 @@ public class TileEntityMachineCatalyticCracker extends TileEntity implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 4 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
if(tank.getTankType() == type) {
|
||||
tank.setFill(fill);
|
||||
@ -126,15 +126,10 @@ public class TileEntityMachineCatalyticCracker extends TileEntity implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
this.tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return Arrays.asList(this.tanks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
@ -146,7 +141,7 @@ public class TileEntityMachineCatalyticCracker extends TileEntity implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type == tanks[0].getTankType())
|
||||
return tanks[0].getMaxFill();
|
||||
else if(type == tanks[1].getTankType())
|
||||
|
||||
@ -110,7 +110,7 @@ public class TileEntityMachineFrackingTower extends TileEntityOilDrillBase imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
return type == tanks[2].getTankType() ? tanks[2].getMaxFill() : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,13 +129,13 @@ public class TileEntityMachineFractionTower extends TileEntity implements IFluid
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 3 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
if(tank.getTankType() == type) {
|
||||
tank.setFill(fill);
|
||||
@ -144,15 +144,10 @@ public class TileEntityMachineFractionTower extends TileEntity implements IFluid
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
this.tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return Arrays.asList(this.tanks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
@ -164,7 +159,7 @@ public class TileEntityMachineFractionTower extends TileEntity implements IFluid
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type == tanks[0].getTankType())
|
||||
return tanks[0].getMaxFill();
|
||||
else
|
||||
|
||||
@ -270,17 +270,17 @@ public class TileEntityMachineGasFlare extends TileEntity implements ISidedInven
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
@ -290,16 +290,8 @@ public class TileEntityMachineGasFlare extends TileEntity implements ISidedInven
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -170,28 +170,21 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
if(type == tank.getTankType())
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> tanks = new ArrayList();
|
||||
tanks.add(tank);
|
||||
return tanks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
return type == tank.getTankType() ? tank.getFill() : 0;
|
||||
|
||||
@ -259,7 +259,7 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
if(type == tanks[i].getTankType()) {
|
||||
@ -286,7 +286,7 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type == tanks[0].getTankType())
|
||||
return tanks[0].getMaxFill();
|
||||
else
|
||||
@ -294,28 +294,16 @@ public class TileEntityMachineRefinery extends TileEntityMachineBase implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < 5 && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < 5 && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
list.add(tanks[2]);
|
||||
list.add(tanks[3]);
|
||||
list.add(tanks[4]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
@ -181,35 +181,28 @@ public class TileEntityMachineSolidifier extends TileEntityMachineBase implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
if(type == tank.getTankType())
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> tanks = new ArrayList();
|
||||
tanks.add(tank);
|
||||
return tanks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
return tank.getTankType() == type ? tank.getFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
return tank.getTankType() == type ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
|
||||
@ -275,7 +275,7 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
for(FluidTank tank : tanks) {
|
||||
if(type == tank.getTankType()) {
|
||||
tank.setFill(i);
|
||||
@ -298,26 +298,17 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index < tanks.length && tanks[index] != null)
|
||||
tanks[index].setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index < tanks.length && tanks[index] != null)
|
||||
tanks[index].setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tanks[0]);
|
||||
list.add(tanks[1]);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(long i) {
|
||||
this.power = i;
|
||||
|
||||
@ -117,7 +117,7 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
public boolean getTact() { return worldObj.getTotalWorldTime() % 2 == 0; }
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
|
||||
if(type == feed.getTankType())
|
||||
feed.setFill(i);
|
||||
@ -137,7 +137,7 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
|
||||
if(type == feed.getTankType())
|
||||
return feed.getMaxFill();
|
||||
@ -148,7 +148,7 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
|
||||
if(index == 0)
|
||||
feed.setFill(fill);
|
||||
@ -157,22 +157,13 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
|
||||
if(index == 0)
|
||||
feed.setTankType(type);
|
||||
else if(index == 1)
|
||||
steam.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(feed);
|
||||
list.add(steam);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidAcceptor> getFluidList(FluidType type) {
|
||||
|
||||
@ -100,33 +100,28 @@ public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidAc
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
if(type == tank.getTankType())
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return new ArrayList() {{ add(tank); }};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
return type == tank.getTankType() ? tank.getFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
return type == tank.getTankType() ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
|
||||
@ -63,25 +63,20 @@ public class TileEntityRBMKInlet extends TileEntity implements IFluidAcceptor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
if(index == 0) water.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
if(type == Fluids.WATER) water.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
if(index == 0) water.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return Arrays.asList(new FluidTank[] {water});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
if(type == Fluids.WATER) return water.getFill();
|
||||
@ -89,7 +84,7 @@ public class TileEntityRBMKInlet extends TileEntity implements IFluidAcceptor {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
if(type == Fluids.WATER) return water.getMaxFill();
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -181,31 +181,26 @@ public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implement
|
||||
public boolean getTact() { return worldObj.getTotalWorldTime() % 20 < 10; }
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
|
||||
if(index == 0)
|
||||
gas.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
|
||||
if(type == gas.getTankType())
|
||||
gas.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
|
||||
if(index == 0)
|
||||
gas.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return new ArrayList() {{ add(gas); }};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
|
||||
|
||||
@ -69,25 +69,20 @@ public class TileEntityRBMKOutlet extends TileEntity implements IFluidSource {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
steam.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int fill, FluidType type) {
|
||||
public void setFillForTransfer(int fill, FluidType type) {
|
||||
steam.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
steam.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
return Arrays.asList(new FluidTank[] {steam});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
return steam.getFill();
|
||||
|
||||
@ -122,17 +122,17 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
|
||||
if(mode == 2 || mode == 3)
|
||||
return 0;
|
||||
@ -171,7 +171,7 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type == tank.getTankType()) tank.setFill(i);
|
||||
}
|
||||
|
||||
@ -184,14 +184,6 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
public void clearFluidList(FluidType type) {
|
||||
this.list.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
@ -99,17 +99,17 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
|
||||
if(mode == 2 || mode == 3)
|
||||
return 0;
|
||||
@ -149,7 +149,7 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
@ -163,14 +163,6 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
public void clearFluidList(FluidType type) {
|
||||
this.list.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
@ -212,30 +212,22 @@ public class TileEntityMachinePuF6Tank extends TileEntity implements ISidedInven
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
|
||||
@ -214,30 +214,22 @@ public class TileEntityMachineUF6Tank extends TileEntity implements ISidedInvent
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFluidFill(FluidType type) {
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getFill() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
|
||||
@ -134,17 +134,17 @@ public class TileEntityTurretFritz extends TileEntityTurretBaseNT implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFillstate(int fill, int index) {
|
||||
public void setFillForSync(int fill, int index) {
|
||||
tank.setFill(fill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(FluidType type, int index) {
|
||||
public void setTypeForSync(FluidType type, int index) {
|
||||
tank.setTankType(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxFluidFill(FluidType type) {
|
||||
public int getMaxFillForReceive(FluidType type) {
|
||||
return type.name().equals(this.tank.getTankType().name()) ? tank.getMaxFill() : 0;
|
||||
}
|
||||
|
||||
@ -154,16 +154,8 @@ public class TileEntityTurretFritz extends TileEntityTurretBaseNT implements IFl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFluidFill(int i, FluidType type) {
|
||||
public void setFillForTransfer(int i, FluidType type) {
|
||||
if(type.name().equals(tank.getTankType().name()))
|
||||
tank.setFill(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTank> getTanks() {
|
||||
List<FluidTank> list = new ArrayList();
|
||||
list.add(tank);
|
||||
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@ -376,4 +376,28 @@ public class InventoryUtil {
|
||||
|
||||
return new ItemStack[0][0];
|
||||
}
|
||||
|
||||
public static boolean doesArrayHaveIngredients(ItemStack[] array, int start, int end, AStack[] ingredients) {
|
||||
ItemStack[] copy = ItemStackUtil.carefulCopyArrayTruncate(array, start, end);
|
||||
|
||||
AStack[] req = new AStack[ingredients.length];
|
||||
|
||||
for(int i = 0; i < req.length; i++) {
|
||||
req[i] = ingredients[i] == null ? null : ingredients[i].copy();
|
||||
}
|
||||
|
||||
for(AStack ingredient : req) {
|
||||
for(ItemStack input : copy) {
|
||||
if(ingredient.matchesRecipe(input, true)) {
|
||||
int size = Math.min(input.stackSize, ingredient.stacksize);
|
||||
|
||||
//TODO: yada yada yada
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,6 +14,56 @@ public class ItemStackUtil {
|
||||
else
|
||||
return stack.copy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs carefulCopy over the entire ItemStack array.
|
||||
* @param array
|
||||
* @return
|
||||
*/
|
||||
public static ItemStack[] carefulCopyArray(ItemStack[] array) {
|
||||
return carefulCopyArray(array, 0, array.length - 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Recreates the ItemStack array and only runs carefulCopy over the supplied range. All other fields remain null.
|
||||
* @param array
|
||||
* @param start
|
||||
* @param end
|
||||
* @return
|
||||
*/
|
||||
public static ItemStack[] carefulCopyArray(ItemStack[] array, int start, int end) {
|
||||
if(array == null)
|
||||
return null;
|
||||
|
||||
ItemStack[] copy = new ItemStack[array.length];
|
||||
|
||||
for(int i = start; i <= end; i++) {
|
||||
copy[i] = carefulCopy(array[i]);
|
||||
}
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new array that only contains the copied range.
|
||||
* @param array
|
||||
* @param start
|
||||
* @param end
|
||||
* @return
|
||||
*/
|
||||
public static ItemStack[] carefulCopyArrayTruncate(ItemStack[] array, int start, int end) {
|
||||
if(array == null)
|
||||
return null;
|
||||
|
||||
int length = end - start + 1;
|
||||
ItemStack[] copy = new ItemStack[length];
|
||||
|
||||
for(int i = 0; i < length; i++) {
|
||||
copy[i] = carefulCopy(array[start + i]);
|
||||
}
|
||||
|
||||
return copy;
|
||||
}
|
||||
|
||||
/**
|
||||
* UNSAFE! Will ignore all existing display tags and override them! In its current state, only fit for items we know don't have any display tags!
|
||||
|
||||
BIN
src/main/resources/assets/hbm/textures/items/parts_legendary.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/parts_legendary.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 500 B |
Loading…
x
Reference in New Issue
Block a user