Moved to RebornCore
This commit is contained in:
parent
50a830a101
commit
8abf6e5282
313 changed files with 3987 additions and 16508 deletions
|
@ -5,11 +5,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import reborncore.common.misc.Functions;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Functions;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
public class TileAesu extends TilePowerAcceptor implements IWrenchable {
|
||||
|
||||
|
|
|
@ -9,14 +9,13 @@ import net.minecraft.init.Blocks;
|
|||
import net.minecraft.init.Items;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.recipe.IBaseRecipeType;
|
||||
import techreborn.api.recipe.RecipeHandler;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Reference;
|
||||
import techreborn.util.Inventory;
|
||||
import techreborn.util.ItemUtils;
|
||||
|
||||
public class TileAlloyFurnace extends TileMachineBase implements IWrenchable, IInventory {
|
||||
|
||||
|
@ -47,56 +46,44 @@ public class TileAlloyFurnace extends TileMachineBase implements IWrenchable, II
|
|||
boolean flag = this.burnTime > 0;
|
||||
boolean flag1 = false;
|
||||
|
||||
if (this.burnTime > 0)
|
||||
{
|
||||
if (this.burnTime > 0) {
|
||||
--this.burnTime;
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
if (this.burnTime != 0 || getStackInSlot(input1) != null && getStackInSlot(fuel) != null)
|
||||
{
|
||||
if (this.burnTime == 0 && this.canSmelt())
|
||||
{
|
||||
if (!this.worldObj.isRemote) {
|
||||
if (this.burnTime != 0 || getStackInSlot(input1) != null && getStackInSlot(fuel) != null) {
|
||||
if (this.burnTime == 0 && this.canSmelt()) {
|
||||
this.currentItemBurnTime = this.burnTime = getItemBurnTime(getStackInSlot(fuel));
|
||||
|
||||
if (this.burnTime > 0)
|
||||
{
|
||||
if (this.burnTime > 0) {
|
||||
flag1 = true;
|
||||
|
||||
if (this.getStackInSlot(fuel) != null)
|
||||
{
|
||||
if (this.getStackInSlot(fuel) != null) {
|
||||
decrStackSize(fuel, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.isBurning() && this.canSmelt())
|
||||
{
|
||||
if (this.isBurning() && this.canSmelt()) {
|
||||
++this.cookTime;
|
||||
|
||||
if (this.cookTime == 200)
|
||||
{
|
||||
if (this.cookTime == 200) {
|
||||
this.cookTime = 0;
|
||||
this.smeltItem();
|
||||
flag1 = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
this.cookTime = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (flag != this.burnTime > 0)
|
||||
{
|
||||
if (flag != this.burnTime > 0) {
|
||||
flag1 = true;
|
||||
//TODO sync on/off
|
||||
}
|
||||
}
|
||||
|
||||
if (flag1)
|
||||
{
|
||||
if (flag1) {
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
|
@ -119,17 +106,13 @@ public class TileAlloyFurnace extends TileMachineBase implements IWrenchable, II
|
|||
return true;
|
||||
}
|
||||
|
||||
private boolean canSmelt()
|
||||
{
|
||||
if (this.getStackInSlot(input1) == null || this.getStackInSlot(input2) == null)
|
||||
{
|
||||
private boolean canSmelt() {
|
||||
if (this.getStackInSlot(input1) == null || this.getStackInSlot(input2) == null) {
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
ItemStack itemstack = null;
|
||||
for(IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)){
|
||||
if(hasAllInputs(recipeType)){
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) {
|
||||
if (hasAllInputs(recipeType)) {
|
||||
itemstack = recipeType.getOutput(0);
|
||||
break;
|
||||
}
|
||||
|
@ -146,37 +129,32 @@ public class TileAlloyFurnace extends TileMachineBase implements IWrenchable, II
|
|||
/**
|
||||
* Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack
|
||||
*/
|
||||
public void smeltItem()
|
||||
{
|
||||
if (this.canSmelt())
|
||||
{
|
||||
public void smeltItem() {
|
||||
if (this.canSmelt()) {
|
||||
ItemStack itemstack = null;
|
||||
for(IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)){
|
||||
for(ItemStack input : recipeType.getInputs()){
|
||||
if(ItemUtils.isItemEqual(input, getStackInSlot(input1), true, true, true) || ItemUtils.isItemEqual(input, getStackInSlot(input2), true, true, true)){
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) {
|
||||
for (ItemStack input : recipeType.getInputs()) {
|
||||
if (ItemUtils.isItemEqual(input, getStackInSlot(input1), true, true, true) || ItemUtils.isItemEqual(input, getStackInSlot(input2), true, true, true)) {
|
||||
itemstack = recipeType.getOutput(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(itemstack != null){
|
||||
if (itemstack != null) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getStackInSlot(output) == null)
|
||||
{
|
||||
if (this.getStackInSlot(output) == null) {
|
||||
setInventorySlotContents(output, itemstack.copy());
|
||||
}
|
||||
else if (this.getStackInSlot(output).getItem() == itemstack.getItem())
|
||||
{
|
||||
} else if (this.getStackInSlot(output).getItem() == itemstack.getItem()) {
|
||||
decrStackSize(output, -itemstack.stackSize);
|
||||
}
|
||||
|
||||
for(IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)){
|
||||
for(ItemStack input : recipeType.getInputs()){
|
||||
if(ItemUtils.isItemEqual(input, getStackInSlot(input1), true, true, true)){
|
||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(Reference.alloySmelteRecipe)) {
|
||||
for (ItemStack input : recipeType.getInputs()) {
|
||||
if (ItemUtils.isItemEqual(input, getStackInSlot(input1), true, true, true)) {
|
||||
this.decrStackSize(input1, input.stackSize);
|
||||
} else if(ItemUtils.isItemEqual(input, getStackInSlot(input2), true, true, true)){
|
||||
} else if (ItemUtils.isItemEqual(input, getStackInSlot(input2), true, true, true)) {
|
||||
this.decrStackSize(input2, input.stackSize);
|
||||
}
|
||||
}
|
||||
|
@ -191,65 +169,52 @@ public class TileAlloyFurnace extends TileMachineBase implements IWrenchable, II
|
|||
/**
|
||||
* Furnace isBurning
|
||||
*/
|
||||
public boolean isBurning()
|
||||
{
|
||||
public boolean isBurning() {
|
||||
return this.burnTime > 0;
|
||||
}
|
||||
|
||||
public int getBurnTimeRemainingScaled(int scale)
|
||||
{
|
||||
if (this.currentItemBurnTime == 0)
|
||||
{
|
||||
public int getBurnTimeRemainingScaled(int scale) {
|
||||
if (this.currentItemBurnTime == 0) {
|
||||
this.currentItemBurnTime = 200;
|
||||
}
|
||||
|
||||
return this.burnTime * scale / this.currentItemBurnTime;
|
||||
}
|
||||
|
||||
public int getCookProgressScaled(int scale)
|
||||
{
|
||||
public int getCookProgressScaled(int scale) {
|
||||
return this.cookTime * scale / 200;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
|
||||
* fuel
|
||||
*/
|
||||
public static int getItemBurnTime(ItemStack stack)
|
||||
{
|
||||
if (stack == null)
|
||||
{
|
||||
public static int getItemBurnTime(ItemStack stack) {
|
||||
if (stack == null) {
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
Item item = stack.getItem();
|
||||
|
||||
if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air)
|
||||
{
|
||||
if (item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {
|
||||
Block block = Block.getBlockFromItem(item);
|
||||
|
||||
if (block == Blocks.wooden_slab)
|
||||
{
|
||||
if (block == Blocks.wooden_slab) {
|
||||
return 150;
|
||||
}
|
||||
|
||||
if (block.getMaterial() == Material.wood)
|
||||
{
|
||||
if (block.getMaterial() == Material.wood) {
|
||||
return 300;
|
||||
}
|
||||
|
||||
if (block == Blocks.coal_block)
|
||||
{
|
||||
if (block == Blocks.coal_block) {
|
||||
return 16000;
|
||||
}
|
||||
}
|
||||
|
||||
if (item instanceof ItemTool && ((ItemTool)item).getToolMaterialName().equals("WOOD")) return 200;
|
||||
if (item instanceof ItemSword && ((ItemSword)item).getToolMaterialName().equals("WOOD")) return 200;
|
||||
if (item instanceof ItemHoe && ((ItemHoe)item).getToolMaterialName().equals("WOOD")) return 200;
|
||||
if (item instanceof ItemTool && ((ItemTool) item).getToolMaterialName().equals("WOOD")) return 200;
|
||||
if (item instanceof ItemSword && ((ItemSword) item).getToolMaterialName().equals("WOOD")) return 200;
|
||||
if (item instanceof ItemHoe && ((ItemHoe) item).getToolMaterialName().equals("WOOD")) return 200;
|
||||
if (item == Items.stick) return 100;
|
||||
if (item == Items.coal) return 1600;
|
||||
if (item == Items.lava_bucket) return 20000;
|
||||
|
|
|
@ -8,12 +8,12 @@ import net.minecraft.inventory.ISidedInventory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.recipe.RecipeCrafter;
|
||||
import techreborn.api.upgrade.UpgradeHandler;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Reference;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
public class TileAlloySmelter extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
|
||||
|
||||
|
|
|
@ -8,11 +8,11 @@ import net.minecraft.inventory.ISidedInventory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.recipe.RecipeCrafter;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Reference;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
public class TileAssemblingMachine extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package techreborn.tiles;
|
||||
|
||||
import erogenousbeef.coreTR.multiblock.IMultiblockPart;
|
||||
import ic2.api.energy.tile.IEnergyTile;
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -13,15 +12,16 @@ import net.minecraft.network.Packet;
|
|||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import reborncore.common.misc.Location;
|
||||
import reborncore.common.multiblock.IMultiblockPart;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.recipe.RecipeCrafter;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Location;
|
||||
import techreborn.lib.Reference;
|
||||
import techreborn.multiblocks.MultiBlockCasing;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable, IInventory, IEnergyTile, ISidedInventory {
|
||||
|
||||
|
@ -90,12 +90,12 @@ public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable,
|
|||
Location location = new Location(xCoord, yCoord, zCoord, direction);
|
||||
location.modifyPositionFromSide(direction, 1);
|
||||
int heat = 0;
|
||||
if(worldObj.getBlock(location.getX(), location.getY() - 1, location.getZ()) == tileEntity.getBlockType()){
|
||||
if (worldObj.getBlock(location.getX(), location.getY() - 1, location.getZ()) == tileEntity.getBlockType()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (IMultiblockPart part : casing.connectedParts) {
|
||||
heat += BlockMachineCasing.getHeatFromMeta(part.getWorldObj().getBlockMetadata(part.getWorldLocation().x, part.getWorldLocation().y, part.getWorldLocation().z));
|
||||
heat += BlockMachineCasing.getHeatFromMeta(part.getWorldObj().getBlockMetadata(part.getWorldLocation().x, part.getWorldLocation().y, part.getWorldLocation().z));
|
||||
}
|
||||
|
||||
if (worldObj.getBlock(location.getX(), location.getY(), location.getZ()).getUnlocalizedName().equals("tile.lava") && worldObj.getBlock(location.getX(), location.getY() + 1, location.getZ()).getUnlocalizedName().equals("tile.lava")) {
|
||||
|
|
|
@ -8,13 +8,13 @@ import net.minecraft.inventory.ISidedInventory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import techreborn.api.IListInfoProvider;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.recipe.RecipeCrafter;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Reference;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@ import net.minecraft.inventory.ISidedInventory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.power.IEnergyInterfaceItem;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
public class TileChargeBench extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
||||
|
||||
|
@ -29,7 +29,7 @@ public class TileChargeBench extends TilePowerAcceptor implements IWrenchable, I
|
|||
|
||||
for (int i = 0; i < 6; i++)
|
||||
if (inventory.getStackInSlot(i) != null) {
|
||||
if(inventory.getStackInSlot(i).getItem() instanceof IEnergyInterfaceItem){
|
||||
if (inventory.getStackInSlot(i).getItem() instanceof IEnergyInterfaceItem) {
|
||||
ItemStack stack = inventory.getStackInSlot(i);
|
||||
double MaxCharge = ((IEnergyInterfaceItem) stack.getItem()).getMaxPower(stack);
|
||||
double amount = ((IEnergyInterfaceItem) stack.getItem()).getMaxTransfer(stack);
|
||||
|
|
|
@ -8,11 +8,11 @@ import net.minecraft.inventory.ISidedInventory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.recipe.RecipeCrafter;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Reference;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
public class TileChemicalReactor extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@ import net.minecraft.entity.player.EntityPlayer;
|
|||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
public class TileChunkLoader extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory {
|
||||
|
||||
|
|
|
@ -11,13 +11,13 @@ import net.minecraft.network.Packet;
|
|||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import techreborn.api.fuel.FluidPowerManager;
|
||||
import reborncore.api.fuel.FluidPowerManager;
|
||||
import reborncore.common.util.FluidUtils;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.FluidUtils;
|
||||
import techreborn.util.Inventory;
|
||||
import techreborn.util.Tank;
|
||||
|
||||
public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchable,
|
||||
IFluidHandler, IInventory, IEnergyTile {
|
||||
|
@ -136,27 +136,27 @@ public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchabl
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote) {
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
FluidUtils.fillContainers(this, inventory, 0, 1, tank.getFluidType());
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
|
||||
inventory.setInventorySlotContents(2, new ItemStack(tank
|
||||
.getFluidType().getBlock()));
|
||||
syncWithAll();
|
||||
} else if (tank.getFluidType() == null && getStackInSlot(2) != null) {
|
||||
setInventorySlotContents(2, null);
|
||||
syncWithAll();
|
||||
}
|
||||
if (!worldObj.isRemote) {
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
FluidUtils.fillContainers(this, inventory, 0, 1, tank.getFluidType());
|
||||
if (tank.getFluidType() != null && getStackInSlot(2) == null) {
|
||||
inventory.setInventorySlotContents(2, new ItemStack(tank
|
||||
.getFluidType().getBlock()));
|
||||
syncWithAll();
|
||||
} else if (tank.getFluidType() == null && getStackInSlot(2) != null) {
|
||||
setInventorySlotContents(2, null);
|
||||
syncWithAll();
|
||||
}
|
||||
|
||||
if (!tank.isEmpty()) {
|
||||
double powerIn = FluidPowerManager.fluidPowerValues.get(tank.getFluidType());
|
||||
if(getFreeSpace() >= powerIn){
|
||||
addEnergy(powerIn, false);
|
||||
tank.drain(1, true);
|
||||
if (!tank.isEmpty()) {
|
||||
double powerIn = FluidPowerManager.fluidPowerValues.get(tank.getFluidType());
|
||||
if (getFreeSpace() >= powerIn) {
|
||||
addEnergy(powerIn, false);
|
||||
tank.drain(1, true);
|
||||
System.out.println(getEnergy() + ":" + tank.getFluidAmount());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -8,10 +8,10 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import techreborn.api.IListInfoProvider;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.util.Inventory;
|
||||
import techreborn.util.ItemUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
|
@ -7,10 +7,10 @@ import net.minecraft.inventory.IInventory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
public class TileDragonEggSiphoner extends TilePowerAcceptor implements IWrenchable, IInventory {
|
||||
|
||||
|
|
|
@ -10,12 +10,12 @@ import net.minecraft.network.Packet;
|
|||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import reborncore.common.util.FluidUtils;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.FluidUtils;
|
||||
import techreborn.util.Inventory;
|
||||
import techreborn.util.Tank;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
|
@ -10,16 +10,16 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import reborncore.common.misc.Location;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.api.recipe.RecipeCrafter;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModFluids;
|
||||
import techreborn.lib.Location;
|
||||
import techreborn.lib.Reference;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
import techreborn.util.Tank;
|
||||
|
||||
public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IFluidHandler, IInventory, ISidedInventory {
|
||||
|
||||
|
|
|
@ -9,13 +9,13 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import reborncore.common.misc.Location;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.recipe.RecipeCrafter;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Location;
|
||||
import techreborn.lib.Reference;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
|
||||
|
||||
|
|
|
@ -8,11 +8,11 @@ import net.minecraft.inventory.ISidedInventory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.api.recipe.RecipeCrafter;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Reference;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
public class TileIndustrialElectrolyzer extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
|
||||
|
||||
|
|
|
@ -10,16 +10,16 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import techreborn.api.IListInfoProvider;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.common.misc.Location;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.api.recipe.RecipeCrafter;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModFluids;
|
||||
import techreborn.lib.Location;
|
||||
import techreborn.lib.Reference;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
import techreborn.util.Tank;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -127,7 +127,7 @@ public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrencha
|
|||
@Override
|
||||
public void addInfo(List<String> info, boolean isRealTile) {
|
||||
super.addInfo(info, isRealTile);
|
||||
if(isRealTile){
|
||||
if (isRealTile) {
|
||||
info.add("Power Stored " + getEnergy() + " EU");
|
||||
if (crafter.currentRecipe != null) {
|
||||
info.add("Power Usage " + crafter.currentRecipe.euPerTick() + " EU/t");
|
||||
|
|
|
@ -5,7 +5,7 @@ import net.minecraft.network.NetworkManager;
|
|||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import techreborn.packets.PacketHandler;
|
||||
import reborncore.common.packets.PacketHandler;
|
||||
|
||||
public abstract class TileMachineBase extends TileEntity {
|
||||
|
||||
|
@ -47,11 +47,11 @@ public abstract class TileMachineBase extends TileEntity {
|
|||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
if(tagCompound.hasKey("meta") && !tagCompound.hasKey("rotation")){
|
||||
rotation = tagCompound.getInteger("meta");
|
||||
} else {
|
||||
rotation = tagCompound.getInteger("rotation");
|
||||
}
|
||||
if (tagCompound.hasKey("meta") && !tagCompound.hasKey("rotation")) {
|
||||
rotation = tagCompound.getInteger("meta");
|
||||
} else {
|
||||
rotation = tagCompound.getInteger("rotation");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package techreborn.tiles;
|
||||
|
||||
import erogenousbeef.coreTR.multiblock.MultiblockControllerBase;
|
||||
import erogenousbeef.coreTR.multiblock.MultiblockValidationException;
|
||||
import erogenousbeef.coreTR.multiblock.rectangular.RectangularMultiblockTileEntityBase;
|
||||
import reborncore.common.multiblock.MultiblockControllerBase;
|
||||
import reborncore.common.multiblock.MultiblockValidationException;
|
||||
import reborncore.common.multiblock.rectangular.RectangularMultiblockTileEntityBase;
|
||||
import techreborn.multiblocks.MultiBlockCasing;
|
||||
|
||||
public class TileMachineCasing extends RectangularMultiblockTileEntityBase {
|
||||
|
|
|
@ -10,11 +10,11 @@ import net.minecraft.inventory.ISidedInventory;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.init.ModItems;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
import techreborn.util.ItemUtils;
|
||||
|
||||
public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@ import net.minecraft.network.NetworkManager;
|
|||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
|
||||
import techreborn.api.IListInfoProvider;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.util.Inventory;
|
||||
import techreborn.util.ItemUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -232,34 +232,33 @@ public class TileQuantumChest extends TileMachineBase implements IInventory,
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack getStoredItemType() {
|
||||
return this.storedItem;
|
||||
}
|
||||
@Override
|
||||
public ItemStack getStoredItemType() {
|
||||
return this.storedItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStoredItemCount(int amount) {
|
||||
this.storedItem.stackSize = 0;
|
||||
this.storedItem.stackSize += (amount);
|
||||
this.markDirty();
|
||||
}
|
||||
@Override
|
||||
public void setStoredItemCount(int amount) {
|
||||
this.storedItem.stackSize = 0;
|
||||
this.storedItem.stackSize += (amount);
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStoredItemType(ItemStack type, int amount) {
|
||||
this.storedItem = type;
|
||||
this.storedItem.stackSize = amount;
|
||||
this.markDirty();
|
||||
}
|
||||
@Override
|
||||
public void setStoredItemType(ItemStack type, int amount) {
|
||||
this.storedItem = type;
|
||||
this.storedItem.stackSize = amount;
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxStoredCount() {
|
||||
return this.storage;
|
||||
}
|
||||
@Override
|
||||
public int getMaxStoredCount() {
|
||||
return this.storage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInfo(List<String> info, boolean isRealTile) {
|
||||
if(isRealTile){
|
||||
if (isRealTile) {
|
||||
int size = 0;
|
||||
String name = "of nothing";
|
||||
if (storedItem != null) {
|
||||
|
|
|
@ -13,11 +13,11 @@ import net.minecraftforge.fluids.Fluid;
|
|||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
import techreborn.api.IListInfoProvider;
|
||||
import reborncore.api.IListInfoProvider;
|
||||
import reborncore.common.util.FluidUtils;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.util.FluidUtils;
|
||||
import techreborn.util.Inventory;
|
||||
import techreborn.util.Tank;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -219,7 +219,7 @@ public class TileQuantumTank extends TileMachineBase implements IFluidHandler,
|
|||
|
||||
@Override
|
||||
public void addInfo(List<String> info, boolean isRealTile) {
|
||||
if(isRealTile){
|
||||
if (isRealTile) {
|
||||
if (tank.getFluid() != null) {
|
||||
info.add(tank.getFluidAmount() + " of "
|
||||
+ tank.getFluidType().getName());
|
||||
|
|
|
@ -9,11 +9,11 @@ import net.minecraft.inventory.InventoryCrafting;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.ItemUtils;
|
||||
import techreborn.api.RollingMachineRecipe;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
import techreborn.util.ItemUtils;
|
||||
|
||||
//TODO add tick and power bars.
|
||||
public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory {
|
||||
|
|
|
@ -10,18 +10,18 @@ import net.minecraft.network.Packet;
|
|||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import reborncore.common.util.FluidUtils;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.FluidUtils;
|
||||
import techreborn.util.Inventory;
|
||||
import techreborn.util.Tank;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class TileSemifluidGenerator extends TilePowerAcceptor implements IWrenchable,
|
||||
IFluidHandler, IInventory{
|
||||
IFluidHandler, IInventory {
|
||||
|
||||
public Tank tank = new Tank("TileSemifluidGenerator",
|
||||
FluidContainerRegistry.BUCKET_VOLUME * 10, this);
|
||||
|
|
|
@ -12,12 +12,12 @@ import net.minecraft.network.Packet;
|
|||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.*;
|
||||
import reborncore.common.util.FluidUtils;
|
||||
import reborncore.common.util.Inventory;
|
||||
import reborncore.common.util.Tank;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.FluidUtils;
|
||||
import techreborn.util.Inventory;
|
||||
import techreborn.util.Tank;
|
||||
|
||||
public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchable,
|
||||
IFluidHandler, IInventory, IEnergyTile {
|
||||
|
@ -137,9 +137,9 @@ public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchab
|
|||
@Override
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!worldObj.isRemote){
|
||||
if (!worldObj.isRemote) {
|
||||
FluidUtils.drainContainers(this, inventory, 0, 1);
|
||||
for(ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS){
|
||||
for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (worldObj.getBlock(xCoord + direction.offsetX, yCoord + direction.offsetY, zCoord + direction.offsetZ) == Blocks.lava) {
|
||||
addEnergy(1);
|
||||
}
|
||||
|
|
|
@ -119,7 +119,7 @@ public class IDSUManager {
|
|||
}
|
||||
|
||||
public IDSUValueSaveData getSaves(String udid) {
|
||||
if(udid == null){
|
||||
if (udid == null) {
|
||||
return null;
|
||||
}
|
||||
if (idsuValues.containsKey(udid)) {
|
||||
|
|
|
@ -5,9 +5,9 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import reborncore.common.misc.Functions;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.Functions;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
|
||||
public class TileIDSU extends TilePowerAcceptor {
|
||||
|
@ -16,7 +16,7 @@ public class TileIDSU extends TilePowerAcceptor {
|
|||
|
||||
@Override
|
||||
public double getEnergy() {
|
||||
if(ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
|
||||
if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
|
||||
return 0.0;
|
||||
}
|
||||
return IDSUManager.INSTANCE.getSaveDataForWorld(worldObj, ownerUdid).storedPower;
|
||||
|
@ -24,7 +24,7 @@ public class TileIDSU extends TilePowerAcceptor {
|
|||
|
||||
@Override
|
||||
public void setEnergy(double energy) {
|
||||
if(ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
|
||||
if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
|
||||
return;
|
||||
}
|
||||
IDSUManager.INSTANCE.getSaveDataForWorld(worldObj, ownerUdid).storedPower = energy;
|
||||
|
@ -99,7 +99,7 @@ public class TileIDSU extends TilePowerAcceptor {
|
|||
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
if(ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
|
||||
if (ownerUdid == null && StringUtils.isBlank(ownerUdid) || StringUtils.isEmpty(ownerUdid)) {
|
||||
return;
|
||||
}
|
||||
nbttagcompound.setString("ownerUdid", this.ownerUdid);
|
||||
|
|
|
@ -2,10 +2,10 @@ package techreborn.tiles.lesu;
|
|||
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import reborncore.common.misc.Functions;
|
||||
import reborncore.common.util.Inventory;
|
||||
import techreborn.config.ConfigTechReborn;
|
||||
import techreborn.lib.Functions;
|
||||
import techreborn.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.util.Inventory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue