Fixed part crash and got the blast furnace to work!
This commit is contained in:
parent
92cccee9e9
commit
ff866d9352
2 changed files with 17 additions and 8 deletions
|
@ -1,5 +1,7 @@
|
||||||
package techreborn.init;
|
package techreborn.init;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Mod;
|
||||||
|
import techreborn.partSystem.IPartProvider;
|
||||||
import techreborn.partSystem.ModPartRegistry;
|
import techreborn.partSystem.ModPartRegistry;
|
||||||
import techreborn.partSystem.block.WorldProvider;
|
import techreborn.partSystem.block.WorldProvider;
|
||||||
import techreborn.partSystem.parts.CablePart;
|
import techreborn.partSystem.parts.CablePart;
|
||||||
|
@ -16,5 +18,10 @@ public class ModParts {
|
||||||
ModPartRegistry.addProvider("techreborn.partSystem.fmp.FMPFactory",
|
ModPartRegistry.addProvider("techreborn.partSystem.fmp.FMPFactory",
|
||||||
"ForgeMultipart");
|
"ForgeMultipart");
|
||||||
ModPartRegistry.addAllPartsToSystems();
|
ModPartRegistry.addAllPartsToSystems();
|
||||||
|
for(IPartProvider provider : ModPartRegistry.providers){
|
||||||
|
if(provider.modID().equals("qmunitylib")){
|
||||||
|
ModPartRegistry.masterProvider = provider;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ import techreborn.lib.Location;
|
||||||
import techreborn.util.Inventory;
|
import techreborn.util.Inventory;
|
||||||
import techreborn.util.ItemUtils;
|
import techreborn.util.ItemUtils;
|
||||||
|
|
||||||
public class TileBlastFurnace extends TileMachineBase implements IWrenchable, IInventory {
|
public class TileBlastFurnace extends TileMachineBase implements IWrenchable, IInventory{
|
||||||
|
|
||||||
public int tickTime;
|
public int tickTime;
|
||||||
public BasicSink energy;
|
public BasicSink energy;
|
||||||
|
@ -30,7 +30,7 @@ public class TileBlastFurnace extends TileMachineBase implements IWrenchable, II
|
||||||
|
|
||||||
public TileBlastFurnace() {
|
public TileBlastFurnace() {
|
||||||
//TODO configs
|
//TODO configs
|
||||||
energy = new BasicSink(this, ConfigTechReborn.CentrifugeCharge,
|
energy = new BasicSink(this, 1000,
|
||||||
ConfigTechReborn.CentrifugeTier);
|
ConfigTechReborn.CentrifugeTier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,17 +83,19 @@ public class TileBlastFurnace extends TileMachineBase implements IWrenchable, II
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void update() {
|
@Override
|
||||||
|
public void updateEntity(){
|
||||||
super.updateEntity();
|
super.updateEntity();
|
||||||
|
energy.updateEntity();
|
||||||
if (getStackInSlot(0) != null && getStackInSlot(1) != null) {
|
if (getStackInSlot(0) != null && getStackInSlot(1) != null) {
|
||||||
if (recipe == null) {
|
if (recipe == null) {
|
||||||
for (BlastFurnaceRecipe furnaceRecipe : TechRebornAPI.blastFurnaceRecipes) {
|
for (BlastFurnaceRecipe furnaceRecipe : TechRebornAPI.blastFurnaceRecipes) {
|
||||||
if (ItemUtils.isItemEqual(getStackInSlot(0), furnaceRecipe.getInput1(), true, true) && ItemUtils.isItemEqual(getStackInSlot(0), furnaceRecipe.getInput2(), true, true)) {
|
if (ItemUtils.isItemEqual(getStackInSlot(0), furnaceRecipe.getInput1(), true, true) && ItemUtils.isItemEqual(getStackInSlot(1), furnaceRecipe.getInput2(), true, true)) {
|
||||||
recipe = furnaceRecipe;
|
recipe = furnaceRecipe;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!ItemUtils.isItemEqual(getStackInSlot(0), recipe.getInput1(), true, true) || !ItemUtils.isItemEqual(getStackInSlot(0), recipe.getInput2(), true, true)) {
|
if (!ItemUtils.isItemEqual(getStackInSlot(0), recipe.getInput1(), true, true) || !ItemUtils.isItemEqual(getStackInSlot(1), recipe.getInput2(), true, true)) {
|
||||||
recipe = null;
|
recipe = null;
|
||||||
tickTime = 0;
|
tickTime = 0;
|
||||||
return;
|
return;
|
||||||
|
@ -105,14 +107,14 @@ public class TileBlastFurnace extends TileMachineBase implements IWrenchable, II
|
||||||
setInventorySlotContents(3, recipe.getOutput2());
|
setInventorySlotContents(3, recipe.getOutput2());
|
||||||
tickTime = 0;
|
tickTime = 0;
|
||||||
recipe = null;
|
recipe = null;
|
||||||
}
|
} else
|
||||||
//When both are the same as the recipe
|
//When both are the same as the recipe
|
||||||
if (ItemUtils.isItemEqual(getStackInSlot(2), recipe.getOutput1(), true, true) && ItemUtils.isItemEqual(getStackInSlot(3), recipe.getOutput2(), true, true) && !areBothOutputsFull()) {
|
if (ItemUtils.isItemEqual(getStackInSlot(2), recipe.getOutput1(), true, true) && ItemUtils.isItemEqual(getStackInSlot(3), recipe.getOutput2(), true, true) && !areBothOutputsFull()) {
|
||||||
decrStackSize(2, -recipe.getOutput1().stackSize);
|
decrStackSize(2, -recipe.getOutput1().stackSize);
|
||||||
decrStackSize(3, -recipe.getOutput2().stackSize);
|
decrStackSize(3, -recipe.getOutput2().stackSize);
|
||||||
tickTime = 0;
|
tickTime = 0;
|
||||||
recipe = null;
|
recipe = null;
|
||||||
}
|
} else
|
||||||
//When slot one has stuff and slot 2 is empty
|
//When slot one has stuff and slot 2 is empty
|
||||||
if (ItemUtils.isItemEqual(getStackInSlot(2), recipe.getOutput1(), true, true) && getStackInSlot(3) == null) {
|
if (ItemUtils.isItemEqual(getStackInSlot(2), recipe.getOutput1(), true, true) && getStackInSlot(3) == null) {
|
||||||
//Stops if the first slot if full
|
//Stops if the first slot if full
|
||||||
|
@ -127,7 +129,7 @@ public class TileBlastFurnace extends TileMachineBase implements IWrenchable, II
|
||||||
setInventorySlotContents(3, recipe.getOutput2());
|
setInventorySlotContents(3, recipe.getOutput2());
|
||||||
tickTime = 0;
|
tickTime = 0;
|
||||||
recipe = null;
|
recipe = null;
|
||||||
}
|
} else
|
||||||
//When slot 2 has stuff and slot 1 is empty
|
//When slot 2 has stuff and slot 1 is empty
|
||||||
if (ItemUtils.isItemEqual(getStackInSlot(3), recipe.getInput2(), true, true) && getStackInSlot(2) == null) {
|
if (ItemUtils.isItemEqual(getStackInSlot(3), recipe.getInput2(), true, true) && getStackInSlot(2) == null) {
|
||||||
if (recipe.getOutput2() != null
|
if (recipe.getOutput2() != null
|
||||||
|
|
Loading…
Reference in a new issue