Fixed lesu issue, temp remove rf output
This commit is contained in:
parent
10846270c5
commit
ab384b661a
6 changed files with 55 additions and 28 deletions
|
@ -41,14 +41,13 @@ public class BlockLesu extends BlockMachineBase {
|
|||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata)
|
||||
{
|
||||
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
if(side == metadata)
|
||||
return this.iconFront;
|
||||
return metadata == 0 && side == 3 ? this.iconFront
|
||||
: side == 1 ? this.iconTop :
|
||||
side == 0 ? this.iconBottom: (side == 0 ? this.iconTop
|
||||
: (side == metadata ? this.iconFront : this.blockIcon));
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
package techreborn.compat.nei.recipes;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import ic2.core.util.DrawUtil;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.IIcon;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.api.recipe.machines.BlastFurnaceRecipe;
|
||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
||||
import techreborn.client.gui.GuiBlastFurnace;
|
||||
import techreborn.util.ItemUtils;
|
||||
|
||||
|
@ -60,4 +67,17 @@ public class BlastFurnaceRecipeHandler extends GenericRecipeHander implements IN
|
|||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(55, 20, 25, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
super.drawBackground(recipeIndex);
|
||||
CachedRecipe recipe = arecipes.get(recipeIndex);
|
||||
if (recipe instanceof CachedGenericRecipe) {
|
||||
if (((CachedGenericRecipe) recipe).recipie instanceof BlastFurnaceRecipe) {
|
||||
BlastFurnaceRecipe blastFurnaceRecipeHandler = (BlastFurnaceRecipe) ((CachedGenericRecipe) recipe).recipie;
|
||||
GuiDraw.drawString("Requires " + blastFurnaceRecipeHandler.neededHeat + " heat", 14, 135, -1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,21 +6,23 @@ import cofh.api.energy.IEnergyProvider;
|
|||
import cofh.api.energy.IEnergyReceiver;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import techreborn.api.power.IEnergyInterfaceTile;
|
||||
import techreborn.lib.Functions;
|
||||
import techreborn.tiles.TileMachineBase;
|
||||
|
||||
/**
|
||||
* This is done in a different class so the updateEntity can be striped for ic2 and this one will still get called.
|
||||
*/
|
||||
public abstract class RFProviderTile extends TileMachineBase implements IEnergyReceiver, IEnergyProvider {
|
||||
public abstract class RFProviderTile extends TileMachineBase implements IEnergyReceiver, IEnergyProvider, IEnergyInterfaceTile {
|
||||
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
sendPower();
|
||||
//sendPower();
|
||||
}
|
||||
|
||||
public void sendPower() {//TODO tick this every tick
|
||||
public void sendPower() {//TODO fix this
|
||||
if (!PowerSystem.RFPOWENET) {
|
||||
return;
|
||||
}
|
||||
|
@ -29,6 +31,8 @@ public abstract class RFProviderTile extends TileMachineBase implements IEnergyR
|
|||
|
||||
TileEntity tile = worldObj.getTileEntity(xCoord + direction.offsetX, yCoord + direction.offsetY, zCoord + direction.offsetZ);
|
||||
if (isPoweredTile(tile, direction)) {
|
||||
System.out.println(canProvideEnergy(direction));
|
||||
if(canProvideEnergy(direction)){
|
||||
if (tile instanceof IEnergyHandler) {
|
||||
IEnergyHandler handler = (IEnergyHandler) tile;
|
||||
int neededRF = handler.receiveEnergy(
|
||||
|
@ -45,6 +49,8 @@ public abstract class RFProviderTile extends TileMachineBase implements IEnergyR
|
|||
extractEnergy(direction.getOpposite(), neededRF, false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ public class LesuNetwork {
|
|||
}
|
||||
|
||||
private void rebuild(){
|
||||
master = null;
|
||||
for(TileLesuStorage lesuStorage : storages){
|
||||
lesuStorage.findAndJoinNetwork(lesuStorage.getWorldObj(), lesuStorage.xCoord, lesuStorage.yCoord, lesuStorage.zCoord);
|
||||
}
|
||||
|
@ -33,6 +34,9 @@ public class LesuNetwork {
|
|||
for(TileLesuStorage lesuStorage : tileLesuStorages){
|
||||
lesuStorage.setNetwork(this);
|
||||
}
|
||||
if(network.master != null && this.master == null){
|
||||
this.master = network.master;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,9 +49,4 @@ public class LesuNetwork {
|
|||
storages.clear();
|
||||
}
|
||||
|
||||
|
||||
public void printInfo(){
|
||||
System.out.println(storages.size());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package techreborn.tiles.lesu;
|
|||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.lib.Functions;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
|
@ -91,7 +92,7 @@ public class TileLesu extends TilePowerAcceptor {//TODO wrench
|
|||
|
||||
@Override
|
||||
public boolean canProvideEnergy(ForgeDirection direction) {
|
||||
return direction.ordinal() == blockMetadata;
|
||||
return Functions.getIntDirFromDirection(direction) == blockMetadata;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -14,7 +14,9 @@ public class TileLesuStorage extends TileMachineBase {
|
|||
if(network == null){
|
||||
findAndJoinNetwork(worldObj, xCoord, yCoord, zCoord);
|
||||
} else {
|
||||
//network.printInfo();
|
||||
if(network.master != null && network.master.getWorldObj().getTileEntity(network.master.xCoord, network.master.yCoord, network.master.zCoord) != network.master){
|
||||
network.master = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue