This commit is contained in:
Modmuss50 2015-11-23 20:34:05 +00:00
parent fe9d41ac76
commit bce444a4ff
17 changed files with 59 additions and 76 deletions

View file

@ -22,7 +22,6 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.*;
import net.minecraftforge.fml.common.Loader;
import techreborn.client.TechRebornCreativeTab;
import techreborn.init.ModBlocks;
import techreborn.tiles.TileMachineBase;

View file

@ -10,7 +10,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import techreborn.Core;
import techreborn.client.GuiHandler;

View file

@ -6,10 +6,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.Core;
import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;

View file

@ -147,8 +147,8 @@ public class TileAlloySmelter extends TilePowerAcceptor implements IWrenchable,
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2} : new int[]{0, 1, 2};
public int[] getSlotsForFace(EnumFacing side) {
return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2};
}
@Override

View file

@ -132,8 +132,8 @@ public class TileAssemblingMachine extends TilePowerAcceptor implements IWrencha
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2} : new int[]{0, 1, 2};
public int[] getSlotsForFace(EnumFacing side) {
return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2};
}
@Override

View file

@ -12,6 +12,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IChatComponent;
import reborncore.common.misc.Location;
import reborncore.common.multiblock.IMultiblockPart;
import reborncore.common.util.Inventory;
@ -95,7 +96,8 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable,
}
for (IMultiblockPart part : casing.connectedParts) {
heat += BlockMachineCasing.getHeatFromMeta(part.getWorld().getBlockMetadata(part.getWorldLocation().x, part.getWorldLocation().y, part.getWorldLocation().z));
// heat += BlockMachineCasing.getHeatFromMeta(part.getWorld().getBlockMetadata(part.getWorldLocation().x, part.getWorldLocation().y, part.getWorldLocation().z));
//TODO meta fix
}
if (worldObj.getBlockState(new BlockPos(location.getX(), location.getY(), location.getZ())).getBlock().getUnlocalizedName().equals("tile.lava") && worldObj.getBlockState(new BlockPos(location.getX(), location.getY() + 1, location.getZ())).getBlock().getUnlocalizedName().equals("tile.lava")) {
@ -213,8 +215,8 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable,
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3} : new int[]{0, 1, 2, 3};
public int[] getSlotsForFace(EnumFacing side) {
return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3} : new int[]{0, 1, 2, 3};
}
@Override
@ -260,4 +262,19 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable,
public double getMaxInput() {
return 128;
}
@Override
public String getCommandSenderName() {
return inventory.getCommandSenderName();
}
@Override
public boolean hasCustomName() {
return inventory.hasCustomName();
}
@Override
public IChatComponent getDisplayName() {
return inventory.getDisplayName();
}
}

View file

@ -140,16 +140,6 @@ public class TileCentrifuge extends TilePowerAcceptor implements IWrenchable, II
return inventory.isUseableByPlayer(player);
}
@Override
public void openInventory() {
inventory.openInventory();
}
@Override
public void closeInventory() {
inventory.closeInventory();
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
return inventory.isItemValidForSlot(slot, stack);
@ -157,8 +147,8 @@ public class TileCentrifuge extends TilePowerAcceptor implements IWrenchable, II
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(EnumFacing side) {
return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5};
public int[] getSlotsForFace(EnumFacing side) {
return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5};
}
@Override

View file

@ -133,8 +133,8 @@ public class TileChargeBench extends TilePowerAcceptor implements IWrenchable, I
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5};
public int[] getSlotsForFace(EnumFacing side) {
return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5};
}
@Override

View file

@ -124,16 +124,6 @@ public class TileChemicalReactor extends TilePowerAcceptor implements IWrenchabl
return inventory.isUseableByPlayer(player);
}
@Override
public void openInventory() {
inventory.openInventory();
}
@Override
public void closeInventory() {
inventory.closeInventory();
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
return inventory.isItemValidForSlot(slot, stack);
@ -141,8 +131,8 @@ public class TileChemicalReactor extends TilePowerAcceptor implements IWrenchabl
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2} : new int[]{0, 1, 2};
public int[] getSlotsForFace(EnumFacing side) {
return side == EnumFacing.DOWN ? new int[]{0, 1, 2} : new int[]{0, 1, 2};
}
@Override

View file

@ -6,6 +6,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.IChatComponent;
import reborncore.common.util.Inventory;
@ -15,7 +16,7 @@ import techreborn.powerSystem.TilePowerAcceptor;
public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrenchable, IInventory {
public Inventory inventory = new Inventory(3, "TileAlloySmelter", 64);
public Inventory inventory = new Inventory(3, "TileAlloySmelter", 64, this);
public static final int euTick = ConfigTechReborn.DragoneggsiphonerOutput;
public TileDragonEggSiphoner() {
@ -27,7 +28,7 @@ public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrencha
super.updateEntity();
if (!worldObj.isRemote) {
if (worldObj.getBlock(getPos().getX(), getPos().getY() + 1, getPos().getZ()) == Blocks.dragon_egg) {
if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() + 1, getPos().getZ())).getBlock() == Blocks.dragon_egg) {
addEnergy(euTick);
}
}

View file

@ -270,8 +270,8 @@ public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IFlui
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5};
public int[] getSlotsForFace(EnumFacing side) {
return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5};
}
@Override

View file

@ -4,6 +4,7 @@ import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
@ -22,15 +23,15 @@ public class TileHeatGenerator extends TilePowerAcceptor implements IWrenchable
super.updateEntity();
if (!worldObj.isRemote) {
if (worldObj.getBlock(getPos().getX() + 1, getPos().getY(), getPos().getZ()) == Blocks.lava) {
if (worldObj.getBlockState(new BlockPos(getPos().getX() + 1, getPos().getY(), getPos().getZ())).getBlock() == Blocks.lava) {
addEnergy(euTick);
} else if (worldObj.getBlock(getPos().getX(), getPos().getY(), getPos().getZ() + 1) == Blocks.lava) {
} else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() + 1)).getBlock() == Blocks.lava) {
addEnergy(euTick);
} else if (worldObj.getBlock(getPos().getX(), getPos().getY(), getPos().getZ() - 1) == Blocks.lava) {
} else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY(), getPos().getZ() - 1)).getBlock() == Blocks.lava) {
addEnergy(euTick);
} else if (worldObj.getBlock(getPos().getX() - 1, getPos().getY(), getPos().getZ()) == Blocks.lava) {
} else if (worldObj.getBlockState(new BlockPos(getPos().getX() - 1, getPos().getY(), getPos().getZ())).getBlock() == Blocks.lava) {
addEnergy(euTick);
} else if (worldObj.getBlock(getPos().getX(), getPos().getY() - 1, getPos().getZ()) == Blocks.lava) {
} else if (worldObj.getBlockState(new BlockPos(getPos().getX(), getPos().getY() - 1, getPos().getZ())).getBlock() == Blocks.lava) {
addEnergy(euTick);
}

View file

@ -207,8 +207,8 @@ public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenc
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3} : new int[]{0, 1, 2, 3};
public int[] getSlotsForFace(EnumFacing side) {
return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3} : new int[]{0, 1, 2, 3};
}
@Override

View file

@ -182,16 +182,6 @@ public class TileIndustrialElectrolyzer extends TilePowerAcceptor implements IWr
return inventory.isUseableByPlayer(player);
}
@Override
public void openInventory() {
inventory.openInventory();
}
@Override
public void closeInventory() {
inventory.closeInventory();
}
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {
return inventory.isItemValidForSlot(slot, stack);
@ -199,8 +189,8 @@ public class TileIndustrialElectrolyzer extends TilePowerAcceptor implements IWr
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5};
public int[] getSlotsForFace(EnumFacing side) {
return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5} : new int[]{0, 1, 2, 3, 4, 5};
}
@Override

View file

@ -260,8 +260,8 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4} : new int[]{0, 1, 2, 3, 4};
public int[] getSlotsForFace(EnumFacing side) {
return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4} : new int[]{0, 1, 2, 3, 4};
}
@Override

View file

@ -1,7 +1,6 @@
package techreborn.tiles;
import ic2.api.recipe.RecipeOutput;
import ic2.api.recipe.Recipes;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@ -165,8 +164,8 @@ public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchab
// ISidedInventory
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return side == EnumFacing.DOWN.ordinal() ? new int[]{0, 1, 2, 3, 4, 5, 6} : new int[]{0, 1, 2, 3, 4, 5, 6};
public int[] getSlotsForFace(EnumFacing side) {
return side == EnumFacing.DOWN ? new int[]{0, 1, 2, 3, 4, 5, 6} : new int[]{0, 1, 2, 3, 4, 5, 6};
}
@Override
@ -252,18 +251,19 @@ public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchab
}
}
//TODO ic2
public int getValue(ItemStack itemStack) {
int value = getValue(Recipes.matterAmplifier.getOutputFor(itemStack, false));
return value;
}
private static Integer getValue(RecipeOutput output) {
if (output != null && output.metadata != null) {
return output.metadata.getInteger("amplification");
}
// int value = getValue(Recipes.matterAmplifier.getOutputFor(itemStack, false));
return 0;
}
// private static Integer getValue(RecipeOutput output) {
// if (output != null && output.metadata != null) {
// return output.metadata.getInteger("amplification");
// }
// return 0;
// }
@Override
public double getMaxPower() {
return 100000000;

View file

@ -5,7 +5,6 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import org.apache.commons.lang3.StringUtils;
import reborncore.common.misc.Functions;
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
import techreborn.powerSystem.TilePowerAcceptor;