Moved power system to RC and spawn trees in groups
This commit is contained in:
parent
891d2cce32
commit
71c2bfee7f
115 changed files with 296 additions and 1630 deletions
|
@ -109,7 +109,7 @@ dependencies {
|
||||||
compile "com.github.azanor:baubles:1.1.2.0:deobf@jar"
|
compile "com.github.azanor:baubles:1.1.2.0:deobf@jar"
|
||||||
compile name: "CraftTweaker", version: "1.8.8-3.0.0", classifier: "Dev"
|
compile name: "CraftTweaker", version: "1.8.8-3.0.0", classifier: "Dev"
|
||||||
// shade 'IC2-Classic-API-STANDALONE:IC2-Classic-API-STANDALONE:1.1.0.19-5:api'
|
// shade 'IC2-Classic-API-STANDALONE:IC2-Classic-API-STANDALONE:1.1.0.19-5:api'
|
||||||
deobfCompile 'RebornCore:RebornCore-1.8.9:1.4.3.+:universal'
|
deobfCompile 'RebornCore:RebornCore-1.8.9:1.4.4.+:universal'
|
||||||
deobfCompile "mezz.jei:jei_1.8.9:2.27.+"
|
deobfCompile "mezz.jei:jei_1.8.9:2.27.+"
|
||||||
|
|
||||||
testCompile 'junit:junit:4.12'
|
testCompile 'junit:junit:4.12'
|
||||||
|
|
|
@ -107,7 +107,7 @@ public class Core {
|
||||||
}
|
}
|
||||||
// WorldGen
|
// WorldGen
|
||||||
GameRegistry.registerWorldGenerator(new TROreGen(), 0);
|
GameRegistry.registerWorldGenerator(new TROreGen(), 0);
|
||||||
GameRegistry.registerWorldGenerator(new TreeGenerator(), 1);
|
GameRegistry.registerWorldGenerator(new TreeGenerator(), 2);
|
||||||
// DungeonLoot.init();
|
// DungeonLoot.init();
|
||||||
// Register Gui Handler
|
// Register Gui Handler
|
||||||
NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler());
|
NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler());
|
||||||
|
|
|
@ -1,77 +0,0 @@
|
||||||
package techreborn.api.power;
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
public interface IEnergyInterfaceItem extends IEnergyItemInfo{
|
|
||||||
/**
|
|
||||||
* @return Amount of energy in the tile
|
|
||||||
*
|
|
||||||
* @param stack The {@link ItemStack} that contains the power
|
|
||||||
*/
|
|
||||||
public double getEnergy(ItemStack stack);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the energy in the tile
|
|
||||||
*
|
|
||||||
* @param energy the amount of energy to set.
|
|
||||||
* @param stack The {@link ItemStack} that contains the power
|
|
||||||
*/
|
|
||||||
public void setEnergy(double energy, ItemStack stack);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param energy amount of energy to add to the tile
|
|
||||||
* @param stack The {@link ItemStack} that contains the power
|
|
||||||
* @return will return true if can fit all
|
|
||||||
*/
|
|
||||||
public boolean canAddEnergy(double energy, ItemStack stack);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Will try add add the full amount of energy.
|
|
||||||
*
|
|
||||||
* @param energy amount to add
|
|
||||||
* @param stack The {@link ItemStack} that contains the power
|
|
||||||
* @return The amount of energy that was added.
|
|
||||||
*/
|
|
||||||
public double addEnergy(double energy, ItemStack stack);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Will try add add the full amount of energy, if simulate is true it wont add the energy
|
|
||||||
*
|
|
||||||
* @param energy amount to add
|
|
||||||
* @param stack The {@link ItemStack} that contains the power
|
|
||||||
* @return The amount of energy that was added.
|
|
||||||
*/
|
|
||||||
public double addEnergy(double energy, boolean simulate, ItemStack stack);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if it can use the full amount of energy
|
|
||||||
*
|
|
||||||
* @param energy amount of energy to use from the tile.
|
|
||||||
* @param stack The {@link ItemStack} that contains the power
|
|
||||||
* @return if all the energy can be used.
|
|
||||||
*/
|
|
||||||
public boolean canUseEnergy(double energy, ItemStack stack);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Will try and use the full amount of energy
|
|
||||||
*
|
|
||||||
* @param energy energy to use
|
|
||||||
* @param stack The {@link ItemStack} that contains the power
|
|
||||||
* @return the amount of energy used
|
|
||||||
*/
|
|
||||||
public double useEnergy(double energy, ItemStack stack);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Will try and use the full amount of energy, if simulate is true it wont add the energy
|
|
||||||
*
|
|
||||||
* @param energy energy to use
|
|
||||||
* @param simulate if true it will not use the item, it will only simulate it.
|
|
||||||
* @param stack The {@link ItemStack} that contains the power
|
|
||||||
* @return the amount of energy used
|
|
||||||
*/
|
|
||||||
public double useEnergy(double energy, boolean simulate, ItemStack stack);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,101 +0,0 @@
|
||||||
package techreborn.api.power;
|
|
||||||
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
|
|
||||||
public interface IEnergyInterfaceTile {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Amount of energy in the tile
|
|
||||||
*/
|
|
||||||
public double getEnergy();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the energy in the tile
|
|
||||||
*
|
|
||||||
* @param energy the amount of energy to set.
|
|
||||||
*/
|
|
||||||
public void setEnergy(double energy);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the max stored energy in the tile
|
|
||||||
*
|
|
||||||
* @return The max energy
|
|
||||||
*/
|
|
||||||
public double getMaxPower();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param energy amount of energy to add to the tile
|
|
||||||
* @return will return true if can fit all
|
|
||||||
*/
|
|
||||||
public boolean canAddEnergy(double energy);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Will try add add the full amount of energy.
|
|
||||||
*
|
|
||||||
* @param energy amount to add
|
|
||||||
* @return The amount of energy that was added.
|
|
||||||
*/
|
|
||||||
public double addEnergy(double energy);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Will try add add the full amount of energy, if simulate is true it wont add the energy
|
|
||||||
*
|
|
||||||
* @param energy amount to add
|
|
||||||
* @param simulate set to true to simulate not perform the action.
|
|
||||||
* @return The amount of energy that was added.
|
|
||||||
*/
|
|
||||||
public double addEnergy(double energy, boolean simulate);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if it can use the full amount of energy
|
|
||||||
*
|
|
||||||
* @param energy amount of energy to use from the tile.
|
|
||||||
* @return if all the energy can be used.
|
|
||||||
*/
|
|
||||||
public boolean canUseEnergy(double energy);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Will try and use the full amount of energy
|
|
||||||
*
|
|
||||||
* @param energy energy to use
|
|
||||||
* @return the amount of energy used
|
|
||||||
*/
|
|
||||||
public double useEnergy(double energy);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Will try and use the full amount of energy, if simulate is true it wont add the energy
|
|
||||||
*
|
|
||||||
* @param energy energy to use
|
|
||||||
* @param simulate set to true to simulate not perform the action.
|
|
||||||
* @return the amount of energy used
|
|
||||||
*/
|
|
||||||
public double useEnergy(double energy, boolean simulate);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param direction The direction to insert energy into
|
|
||||||
* @return if the tile can accept energy from the direction
|
|
||||||
*/
|
|
||||||
public boolean canAcceptEnergy(EnumFacing direction);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param direction The direction to provide energy from
|
|
||||||
* @return true if the tile can provide energy to that direction
|
|
||||||
*/
|
|
||||||
public boolean canProvideEnergy(EnumFacing direction);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the max output, set to -1 if you don't want the tile to provide energy
|
|
||||||
*
|
|
||||||
* @return the max amount of energy outputted per tick.
|
|
||||||
*/
|
|
||||||
public double getMaxOutput();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return -1 if you don't want to accept power ever.
|
|
||||||
*
|
|
||||||
* @return The max amount of energy that can be added to the tile in one tick.
|
|
||||||
*/
|
|
||||||
public double getMaxInput();
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,43 +0,0 @@
|
||||||
package techreborn.api.power;
|
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
public interface IEnergyItemInfo {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the max stored energy in the item
|
|
||||||
*
|
|
||||||
* @param stack The {@link ItemStack} that contains the power
|
|
||||||
* @return The max energy
|
|
||||||
*/
|
|
||||||
double getMaxPower(ItemStack stack);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Can the item accept energy.
|
|
||||||
* @param stack The {@link ItemStack} that contains the power
|
|
||||||
* @return if it can accept energy
|
|
||||||
*/
|
|
||||||
boolean canAcceptEnergy(ItemStack stack);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Can the item recieve energy
|
|
||||||
* @param stack The {@link ItemStack} that contains the power
|
|
||||||
* @return if it can provide energy
|
|
||||||
*/
|
|
||||||
boolean canProvideEnergy(ItemStack stack);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param stack The {@link ItemStack} that contains the power
|
|
||||||
* @return Max amout of energy that can be transfured in one tick.
|
|
||||||
*/
|
|
||||||
double getMaxTransfer(ItemStack stack);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param stack The {@link ItemStack} that contains the power
|
|
||||||
* @return The ic2 teir that the stack should be.
|
|
||||||
*/
|
|
||||||
int getStackTeir(ItemStack stack);
|
|
||||||
}
|
|
|
@ -4,9 +4,9 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import reborncore.common.util.Inventory;
|
import reborncore.common.util.Inventory;
|
||||||
import reborncore.common.util.ItemUtils;
|
import reborncore.common.util.ItemUtils;
|
||||||
import techreborn.api.power.IEnergyInterfaceTile;
|
import reborncore.api.power.IEnergyInterfaceTile;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.tiles.TileMachineBase;
|
import reborncore.common.tile.TileMachineBase;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
|
|
@ -4,16 +4,20 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileChunkLoader;
|
import techreborn.tiles.TileChunkLoader;
|
||||||
|
|
||||||
public class BlockChunkLoader extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockChunkLoader extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockChunkLoader(Material material) {
|
public BlockChunkLoader(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.chunkloader");
|
setUnlocalizedName("techreborn.chunkloader");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,15 +3,19 @@ package techreborn.blocks;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
|
||||||
public class BlockComputerCube extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockComputerCube extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockComputerCube(Material material) {
|
public BlockComputerCube(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.computercube");
|
setUnlocalizedName("techreborn.computercube");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,15 +4,19 @@ import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileDigitalChest;
|
import techreborn.tiles.TileDigitalChest;
|
||||||
|
|
||||||
public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockDigitalChest extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
public BlockDigitalChest() {
|
public BlockDigitalChest() {
|
||||||
super(Material.rock);
|
super();
|
||||||
setUnlocalizedName("techreborn.digitalChest");
|
setUnlocalizedName("techreborn.digitalChest");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,14 +1,18 @@
|
||||||
package techreborn.blocks;
|
package techreborn.blocks;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
|
||||||
|
|
||||||
public class BlockElectricCraftingTable extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockElectricCraftingTable extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockElectricCraftingTable(Material material) {
|
public BlockElectricCraftingTable(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.electriccraftingtable");
|
setUnlocalizedName("techreborn.electriccraftingtable");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/";
|
private final String prefix = "techreborn:blocks/machine/";
|
||||||
|
|
|
@ -3,13 +3,16 @@ package techreborn.blocks;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
|
||||||
public class BlockFusionCoil extends BlockMachineBase {
|
public class BlockFusionCoil extends BlockMachineBase {
|
||||||
|
|
||||||
|
|
||||||
public BlockFusionCoil(Material material) {
|
public BlockFusionCoil(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.fusioncoil");
|
setUnlocalizedName("techreborn.fusioncoil");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,11 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
||||||
|
|
||||||
public class BlockFusionControlComputer extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockFusionControlComputer extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
@ -14,8 +17,9 @@ public class BlockFusionControlComputer extends BlockMachineBase implements IAdv
|
||||||
|
|
||||||
|
|
||||||
public BlockFusionControlComputer(Material material) {
|
public BlockFusionControlComputer(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.fusioncontrolcomputer");
|
setUnlocalizedName("techreborn.fusioncontrolcomputer");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,12 +3,15 @@ package techreborn.blocks;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
|
||||||
public class BlockHighlyAdvancedMachine extends BlockMachineBase {
|
public class BlockHighlyAdvancedMachine extends BlockMachineBase {
|
||||||
|
|
||||||
public BlockHighlyAdvancedMachine(Material material) {
|
public BlockHighlyAdvancedMachine(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.highlyAdvancedMachine");
|
setUnlocalizedName("techreborn.highlyAdvancedMachine");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/";
|
private final String prefix = "techreborn:blocks/machine/";
|
||||||
|
|
|
@ -1,422 +0,0 @@
|
||||||
package techreborn.blocks;
|
|
||||||
|
|
||||||
import me.modmuss50.jsonDestroyer.api.ITexturedBlock;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.BlockDynamicLiquid;
|
|
||||||
import net.minecraft.block.BlockStaticLiquid;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.block.properties.PropertyBool;
|
|
||||||
import net.minecraft.block.properties.PropertyDirection;
|
|
||||||
import net.minecraft.block.state.BlockState;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.entity.EnumCreatureType;
|
|
||||||
import net.minecraft.entity.item.EntityItem;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemBlock;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.util.BlockPos;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import net.minecraft.world.IBlockAccess;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraftforge.fluids.*;
|
|
||||||
import reborncore.common.BaseTileBlock;
|
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
|
||||||
import techreborn.init.ModBlocks;
|
|
||||||
import techreborn.tiles.TileMachineBase;
|
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
public abstract class BlockMachineBase extends BaseTileBlock implements ITexturedBlock {
|
|
||||||
|
|
||||||
public static PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
|
|
||||||
public static PropertyBool ACTIVE = PropertyBool.create("active");
|
|
||||||
|
|
||||||
public BlockMachineBase(Material material) {
|
|
||||||
super(Material.rock);
|
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
|
||||||
setHardness(2f);
|
|
||||||
setStepSound(soundTypeMetal);
|
|
||||||
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, false));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected BlockState createBlockState() {
|
|
||||||
|
|
||||||
FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL);
|
|
||||||
ACTIVE = PropertyBool.create("active");
|
|
||||||
return new BlockState(this, FACING, ACTIVE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
|
||||||
return new TileMachineBase();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public void onBlockAdded(World world, int x, int y, int z) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) {
|
|
||||||
super.onBlockAdded(worldIn, pos, state);
|
|
||||||
onBlockAdded(worldIn, pos.getX(), pos.getY(), pos.getZ());
|
|
||||||
this.setDefaultFacing(worldIn, pos, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setDefaultFacing(World worldIn, BlockPos pos, IBlockState state)
|
|
||||||
{
|
|
||||||
if (!worldIn.isRemote)
|
|
||||||
{
|
|
||||||
Block block = worldIn.getBlockState(pos.north()).getBlock();
|
|
||||||
Block block1 = worldIn.getBlockState(pos.south()).getBlock();
|
|
||||||
Block block2 = worldIn.getBlockState(pos.west()).getBlock();
|
|
||||||
Block block3 = worldIn.getBlockState(pos.east()).getBlock();
|
|
||||||
EnumFacing enumfacing = (EnumFacing)state.getValue(FACING);
|
|
||||||
|
|
||||||
if (enumfacing == EnumFacing.NORTH && block.isFullBlock() && !block1.isFullBlock())
|
|
||||||
{
|
|
||||||
enumfacing = EnumFacing.SOUTH;
|
|
||||||
}
|
|
||||||
else if (enumfacing == EnumFacing.SOUTH && block1.isFullBlock() && !block.isFullBlock())
|
|
||||||
{
|
|
||||||
enumfacing = EnumFacing.NORTH;
|
|
||||||
}
|
|
||||||
else if (enumfacing == EnumFacing.WEST && block2.isFullBlock() && !block3.isFullBlock())
|
|
||||||
{
|
|
||||||
enumfacing = EnumFacing.EAST;
|
|
||||||
}
|
|
||||||
else if (enumfacing == EnumFacing.EAST && block3.isFullBlock() && !block2.isFullBlock())
|
|
||||||
{
|
|
||||||
enumfacing = EnumFacing.WEST;
|
|
||||||
}
|
|
||||||
|
|
||||||
worldIn.setBlockState(pos, state.withProperty(FACING, enumfacing), 2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public void onBlockPlacedBy(World world, int x, int y, int z,
|
|
||||||
EntityLivingBase player, ItemStack itemstack) {
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
|
|
||||||
super.onBlockPlacedBy(worldIn, pos, state, placer, stack);
|
|
||||||
onBlockPlacedBy(worldIn, pos.getX(), pos.getY(), pos.getZ(), placer, stack);
|
|
||||||
setFacing(placer.getHorizontalFacing().getOpposite(), worldIn, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean canCreatureSpawn(EnumCreatureType type, World world, int x,
|
|
||||||
int y, int z) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void breakBlock(World worldIn, BlockPos pos, IBlockState state) {
|
|
||||||
super.breakBlock(worldIn, pos, state);
|
|
||||||
breakBlock(worldIn, pos.getX(), pos.getY(), pos.getZ(), state.getBlock(), 0);
|
|
||||||
dropInventory(worldIn, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void dropInventory(World world, BlockPos pos) {
|
|
||||||
TileEntity tileEntity = world.getTileEntity(pos);
|
|
||||||
|
|
||||||
if (!(tileEntity instanceof IInventory)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IInventory inventory = (IInventory) tileEntity;
|
|
||||||
|
|
||||||
for (int i = 0; i < inventory.getSizeInventory(); i++) {
|
|
||||||
ItemStack itemStack = inventory.getStackInSlot(i);
|
|
||||||
|
|
||||||
if (itemStack != null && itemStack.stackSize > 0) {
|
|
||||||
if (itemStack.getItem() instanceof ItemBlock) {
|
|
||||||
if (((ItemBlock) itemStack.getItem()).block instanceof BlockFluidBase || ((ItemBlock) itemStack.getItem()).block instanceof BlockStaticLiquid || ((ItemBlock) itemStack.getItem()).block instanceof BlockDynamicLiquid) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Random rand = new Random();
|
|
||||||
|
|
||||||
float dX = rand.nextFloat() * 0.8F + 0.1F;
|
|
||||||
float dY = rand.nextFloat() * 0.8F + 0.1F;
|
|
||||||
float dZ = rand.nextFloat() * 0.8F + 0.1F;
|
|
||||||
|
|
||||||
EntityItem entityItem = new EntityItem(world, pos.getX() + dX, pos.getY() + dY, pos.getZ() + dZ, itemStack.copy());
|
|
||||||
|
|
||||||
if (itemStack.hasTagCompound()) {
|
|
||||||
entityItem.getEntityItem().setTagCompound((NBTTagCompound) itemStack.getTagCompound().copy());
|
|
||||||
}
|
|
||||||
|
|
||||||
float factor = 0.05F;
|
|
||||||
entityItem.motionX = rand.nextGaussian() * factor;
|
|
||||||
entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
|
|
||||||
entityItem.motionZ = rand.nextGaussian() * factor;
|
|
||||||
world.spawnEntityInWorld(entityItem);
|
|
||||||
itemStack.stackSize = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
|
||||||
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
|
|
||||||
// if (Loader.isModLoaded("IC2")) {
|
|
||||||
// ItemStack stack = IC2Items.getItem(isAdvanced() ? "advancedMachine" : "machine").copy();
|
|
||||||
// stack.stackSize = 1;
|
|
||||||
// items.add(stack);
|
|
||||||
// } //TODO ic2
|
|
||||||
items.add(isAdvanced() ? new ItemStack(Item.getItemFromBlock(ModBlocks.MachineCasing), 1, 2) : new ItemStack(Item.getItemFromBlock(ModBlocks.MachineCasing), 1, 0));
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isAdvanced() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean rotateBlock(World world, BlockPos pos, EnumFacing axis) {
|
|
||||||
if (axis == null) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
TileEntity tile = world.getTileEntity(pos);
|
|
||||||
if (tile != null && tile instanceof TileMachineBase) {
|
|
||||||
TileMachineBase machineBase = (TileMachineBase) tile;
|
|
||||||
//TODO fix
|
|
||||||
// world.setBlockState(pos, world.getBlockState(pos).withProperty(FACING, EnumFacing.getFront(world.getBlockState(pos).getValue(FACING)).getOpposite()));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) {
|
|
||||||
if(fillBlockWithFluid(worldIn, pos, playerIn)){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if(onBlockActivated(worldIn, pos.getX(), pos.getY(), pos.getZ(), playerIn, side.getIndex(), hitX, hitY, hitZ)){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean fillBlockWithFluid(World world, BlockPos pos, EntityPlayer entityplayer) {
|
|
||||||
ItemStack current = entityplayer.inventory.getCurrentItem();
|
|
||||||
|
|
||||||
if (current != null) {
|
|
||||||
TileEntity tile = world.getTileEntity(pos);
|
|
||||||
|
|
||||||
if (tile instanceof IFluidHandler) {
|
|
||||||
IFluidHandler tank = (IFluidHandler) tile;
|
|
||||||
// Handle FluidContainerRegistry
|
|
||||||
if (FluidContainerRegistry.isContainer(current)) {
|
|
||||||
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(current);
|
|
||||||
// Handle filled containers
|
|
||||||
if (liquid != null) {
|
|
||||||
int qty = tank.fill(null, liquid, true);
|
|
||||||
|
|
||||||
if (qty != 0 && !entityplayer.capabilities.isCreativeMode) {
|
|
||||||
if (current.stackSize > 1) {
|
|
||||||
if (!entityplayer.inventory.addItemStackToInventory(FluidContainerRegistry.drainFluidContainer(current))) {
|
|
||||||
entityplayer.dropPlayerItemWithRandomChoice(FluidContainerRegistry.drainFluidContainer(current), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, consumeItem(current));
|
|
||||||
} else {
|
|
||||||
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, FluidContainerRegistry.drainFluidContainer(current));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// Handle empty containers
|
|
||||||
} else {
|
|
||||||
FluidStack available = tank.getTankInfo(null)[0].fluid;
|
|
||||||
|
|
||||||
if (available != null) {
|
|
||||||
ItemStack filled = FluidContainerRegistry.fillFluidContainer(available, current);
|
|
||||||
|
|
||||||
liquid = FluidContainerRegistry.getFluidForFilledItem(filled);
|
|
||||||
|
|
||||||
if (liquid != null) {
|
|
||||||
if (!entityplayer.capabilities.isCreativeMode) {
|
|
||||||
if (current.stackSize > 1) {
|
|
||||||
if (!entityplayer.inventory.addItemStackToInventory(filled)) {
|
|
||||||
return false;
|
|
||||||
} else {
|
|
||||||
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, consumeItem(current));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, consumeItem(current));
|
|
||||||
entityplayer.inventory.setInventorySlotContents(entityplayer.inventory.currentItem, filled);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tank.drain(null, liquid.amount, true);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (current.getItem() instanceof IFluidContainerItem) {
|
|
||||||
if (current.stackSize != 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!world.isRemote) {
|
|
||||||
IFluidContainerItem container = (IFluidContainerItem) current.getItem();
|
|
||||||
FluidStack liquid = container.getFluid(current);
|
|
||||||
FluidStack tankLiquid = tank.getTankInfo(null)[0].fluid;
|
|
||||||
boolean mustDrain = liquid == null || liquid.amount == 0;
|
|
||||||
boolean mustFill = tankLiquid == null || tankLiquid.amount == 0;
|
|
||||||
if (mustDrain && mustFill) {
|
|
||||||
// Both are empty, do nothing
|
|
||||||
} else if (mustDrain || !entityplayer.isSneaking()) {
|
|
||||||
liquid = tank.drain(null, 1000, false);
|
|
||||||
int qtyToFill = container.fill(current, liquid, true);
|
|
||||||
tank.drain(null, qtyToFill, true);
|
|
||||||
} else if (mustFill || entityplayer.isSneaking()) {
|
|
||||||
if (liquid.amount > 0) {
|
|
||||||
int qty = tank.fill(null, liquid, false);
|
|
||||||
tank.fill(null, container.drain(current, qty, true), true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static ItemStack consumeItem(ItemStack stack) {
|
|
||||||
if (stack.stackSize == 1) {
|
|
||||||
if (stack.getItem().hasContainerItem(stack)) {
|
|
||||||
return stack.getItem().getContainerItem(stack);
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
stack.splitStack(1);
|
|
||||||
|
|
||||||
return stack;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
|
|
||||||
if(this instanceof IRotationTexture){
|
|
||||||
IRotationTexture rotationTexture = (IRotationTexture) this;
|
|
||||||
if(getFacing(blockState) == facing){
|
|
||||||
return isActive(blockState) ? rotationTexture.getFrontOn() : rotationTexture.getFrontOff();
|
|
||||||
}
|
|
||||||
if(facing == EnumFacing.UP){
|
|
||||||
return rotationTexture.getTop();
|
|
||||||
}
|
|
||||||
if(facing == EnumFacing.DOWN){
|
|
||||||
return rotationTexture.getBottom();
|
|
||||||
}
|
|
||||||
return rotationTexture.getSide();
|
|
||||||
}
|
|
||||||
if(this instanceof IAdvancedRotationTexture){
|
|
||||||
IAdvancedRotationTexture advancedRotationTexture = (IAdvancedRotationTexture) this;
|
|
||||||
if(getFacing(blockState) == facing){
|
|
||||||
return advancedRotationTexture.getFront(isActive(blockState));
|
|
||||||
}
|
|
||||||
if(facing == EnumFacing.UP){
|
|
||||||
return advancedRotationTexture.getTop(isActive(blockState));
|
|
||||||
}
|
|
||||||
if(facing == EnumFacing.DOWN){
|
|
||||||
return advancedRotationTexture.getBottom(isActive(blockState));
|
|
||||||
}
|
|
||||||
return advancedRotationTexture.getSide(isActive(blockState));
|
|
||||||
}
|
|
||||||
return "techreborn:blocks/machine/machine_side";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMetaFromState(IBlockState state) {
|
|
||||||
int facingInt = getSideFromEnum(state.getValue(FACING));
|
|
||||||
int activeInt = state.getValue(ACTIVE) ? 0 : 3;
|
|
||||||
return facingInt + activeInt;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public IBlockState getStateFromMeta(int meta) {
|
|
||||||
boolean active = false;
|
|
||||||
int facingInt = meta;
|
|
||||||
if(facingInt > 3){
|
|
||||||
active = true;
|
|
||||||
facingInt = facingInt - 3;
|
|
||||||
}
|
|
||||||
EnumFacing facing = getSideFromint(facingInt);
|
|
||||||
return this.getDefaultState().withProperty(FACING, facing).withProperty(ACTIVE, active);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isActive(IBlockState state){
|
|
||||||
return state.getValue(ACTIVE);
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnumFacing getFacing(IBlockState state){
|
|
||||||
return state.getValue(FACING);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFacing(EnumFacing facing, World world, BlockPos pos){
|
|
||||||
world.setBlockState(pos, world.getBlockState(pos).withProperty(FACING, facing));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setActive(Boolean active, World world, BlockPos pos){
|
|
||||||
world.setBlockState(pos, world.getBlockState(pos).withProperty(ACTIVE, active));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int amountOfStates() {
|
|
||||||
return 8; //0-3 off nsew, 4-8 on nsew
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnumFacing getSideFromint(int i){
|
|
||||||
if(i == 0){
|
|
||||||
return EnumFacing.NORTH;
|
|
||||||
} else if(i == 1){
|
|
||||||
return EnumFacing.SOUTH;
|
|
||||||
}else if(i == 2){
|
|
||||||
return EnumFacing.EAST;
|
|
||||||
}else if(i == 3){
|
|
||||||
return EnumFacing.WEST;
|
|
||||||
}
|
|
||||||
return EnumFacing.NORTH;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSideFromEnum(EnumFacing facing){
|
|
||||||
if(facing == EnumFacing.NORTH){
|
|
||||||
return 0;
|
|
||||||
} else if(facing == EnumFacing.SOUTH){
|
|
||||||
return 1;
|
|
||||||
}else if(facing == EnumFacing.EAST){
|
|
||||||
return 2;
|
|
||||||
}else if(facing == EnumFacing.WEST){
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,16 +1,14 @@
|
||||||
package techreborn.blocks;
|
package techreborn.blocks;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.BlockContainer;
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
@ -19,7 +17,7 @@ import techreborn.tiles.TileQuantumChest;
|
||||||
public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockQuantumChest extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
public BlockQuantumChest() {
|
public BlockQuantumChest() {
|
||||||
super(Material.rock);
|
super();
|
||||||
setUnlocalizedName("techreborn.quantumChest");
|
setUnlocalizedName("techreborn.quantumChest");
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
setHardness(2.0F);
|
setHardness(2.0F);
|
||||||
|
|
|
@ -5,17 +5,21 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileQuantumTank;
|
import techreborn.tiles.TileQuantumTank;
|
||||||
|
|
||||||
public class BlockQuantumTank extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockQuantumTank extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockQuantumTank() {
|
public BlockQuantumTank() {
|
||||||
super(Material.rock);
|
super();
|
||||||
setUnlocalizedName("techreborn.quantumTank");
|
setUnlocalizedName("techreborn.quantumTank");
|
||||||
setHardness(2.0F);
|
setHardness(2.0F);
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -126,7 +126,7 @@ public class BlockRubberLog extends Block implements ITexturedBlock {
|
||||||
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
|
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) {
|
||||||
super.updateTick(worldIn, pos, state, rand);
|
super.updateTick(worldIn, pos, state, rand);
|
||||||
if(!state.getValue(HAS_SAP)){
|
if(!state.getValue(HAS_SAP)){
|
||||||
if(rand.nextInt(100) == 0){
|
if(rand.nextInt(50) == 0){
|
||||||
EnumFacing facing = EnumFacing.getHorizontal(rand.nextInt(3));
|
EnumFacing facing = EnumFacing.getHorizontal(rand.nextInt(3));
|
||||||
if(worldIn.getBlockState(pos.down()).getBlock() == this && worldIn.getBlockState(pos.up()).getBlock() == this && worldIn.isAirBlock(pos.offset(facing))){
|
if(worldIn.getBlockState(pos.down()).getBlock() == this && worldIn.getBlockState(pos.up()).getBlock() == this && worldIn.isAirBlock(pos.offset(facing))){
|
||||||
worldIn.setBlockState(pos, state.withProperty(HAS_SAP, true).withProperty(SAP_SIDE, facing));
|
worldIn.setBlockState(pos, state.withProperty(HAS_SAP, true).withProperty(SAP_SIDE, facing));
|
||||||
|
|
|
@ -1,13 +1,17 @@
|
||||||
package techreborn.blocks;
|
package techreborn.blocks;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
|
||||||
public class BlockSupercondensator extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockSupercondensator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockSupercondensator(Material material) {
|
public BlockSupercondensator(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.supercondensator");
|
setUnlocalizedName("techreborn.supercondensator");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/";
|
private final String prefix = "techreborn:blocks/machine/";
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
package techreborn.blocks;
|
|
||||||
|
|
||||||
|
|
||||||
public interface IAdvancedRotationTexture {
|
|
||||||
|
|
||||||
String getFront(boolean isActive);
|
|
||||||
|
|
||||||
String getSide(boolean isActive);
|
|
||||||
|
|
||||||
String getTop(boolean isActive);
|
|
||||||
|
|
||||||
String getBottom(boolean isActive);
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
package techreborn.blocks;
|
|
||||||
|
|
||||||
public interface IRotationTexture {
|
|
||||||
|
|
||||||
String getFrontOff();
|
|
||||||
|
|
||||||
String getFrontOn();
|
|
||||||
|
|
||||||
String getSide();
|
|
||||||
|
|
||||||
String getTop();
|
|
||||||
|
|
||||||
String getBottom();
|
|
||||||
}
|
|
|
@ -6,17 +6,19 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.generator.TileDieselGenerator;
|
import techreborn.tiles.generator.TileDieselGenerator;
|
||||||
|
|
||||||
public class BlockDieselGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockDieselGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockDieselGenerator(Material material) {
|
public BlockDieselGenerator(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.dieselgenerator");
|
setUnlocalizedName("techreborn.dieselgenerator");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,9 @@ package techreborn.blocks.generator;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.generator.TileDragonEggSiphoner;
|
import techreborn.tiles.generator.TileDragonEggSiphoner;
|
||||||
|
|
||||||
public class BlockDragonEggSiphoner extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockDragonEggSiphoner extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
@ -12,8 +13,9 @@ public class BlockDragonEggSiphoner extends BlockMachineBase implements IAdvance
|
||||||
|
|
||||||
|
|
||||||
public BlockDragonEggSiphoner(Material material) {
|
public BlockDragonEggSiphoner(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.dragoneggsiphoner");
|
setUnlocalizedName("techreborn.dragoneggsiphoner");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,17 +6,19 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.generator.TileGasTurbine;
|
import techreborn.tiles.generator.TileGasTurbine;
|
||||||
|
|
||||||
public class BlockGasTurbine extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockGasTurbine extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockGasTurbine(Material material) {
|
public BlockGasTurbine(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.gasTurbine");
|
setUnlocalizedName("techreborn.gasTurbine");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,20 +3,20 @@ package techreborn.blocks.generator;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
import techreborn.tiles.generator.TileDieselGenerator;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.generator.TileGenerator;
|
import techreborn.tiles.generator.TileGenerator;
|
||||||
|
|
||||||
public class BlockGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
public BlockGenerator() {
|
public BlockGenerator() {
|
||||||
super(Material.iron);
|
super();
|
||||||
setUnlocalizedName("techreborn.generator");
|
setUnlocalizedName("techreborn.generator");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,16 +3,18 @@ package techreborn.blocks.generator;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.generator.TileHeatGenerator;
|
import techreborn.tiles.generator.TileHeatGenerator;
|
||||||
|
|
||||||
public class BlockHeatGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockHeatGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockHeatGenerator(Material material) {
|
public BlockHeatGenerator(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.heatgenerator");
|
setUnlocalizedName("techreborn.heatgenerator");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,17 @@
|
||||||
package techreborn.blocks.generator;
|
package techreborn.blocks.generator;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
|
||||||
public class BlockLightningRod extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockLightningRod extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockLightningRod(Material material) {
|
public BlockLightningRod(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.lightningrod");
|
setUnlocalizedName("techreborn.lightningrod");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/";
|
private final String prefix = "techreborn:blocks/machine/";
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
package techreborn.blocks.generator;
|
package techreborn.blocks.generator;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
|
||||||
public class BlockMagicEnergyAbsorber extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockMagicEnergyAbsorber extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
public BlockMagicEnergyAbsorber(Material material) {
|
public BlockMagicEnergyAbsorber(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.magicenergyabsorber");
|
setUnlocalizedName("techreborn.magicenergyabsorber");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
package techreborn.blocks.generator;
|
package techreborn.blocks.generator;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
|
||||||
public class BlockMagicEnergyConverter extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockMagicEnergyConverter extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
public BlockMagicEnergyConverter(Material material) {
|
public BlockMagicEnergyConverter(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.magicenergyconverter");
|
setUnlocalizedName("techreborn.magicenergyconverter");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,16 +1,18 @@
|
||||||
package techreborn.blocks.generator;
|
package techreborn.blocks.generator;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
|
||||||
public class BlockPlasmaGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockPlasmaGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public BlockPlasmaGenerator(Material material) {
|
public BlockPlasmaGenerator(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.plasmagenerator");
|
setUnlocalizedName("techreborn.plasmagenerator");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/";
|
private final String prefix = "techreborn:blocks/machine/";
|
||||||
|
|
|
@ -6,9 +6,10 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.generator.TileSemifluidGenerator;
|
import techreborn.tiles.generator.TileSemifluidGenerator;
|
||||||
|
|
||||||
public class BlockSemiFluidGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockSemiFluidGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
@ -16,8 +17,9 @@ public class BlockSemiFluidGenerator extends BlockMachineBase implements IAdvanc
|
||||||
|
|
||||||
|
|
||||||
public BlockSemiFluidGenerator(Material material) {
|
public BlockSemiFluidGenerator(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.semifluidgenerator");
|
setUnlocalizedName("techreborn.semifluidgenerator");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -6,9 +6,10 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileThermalGenerator;
|
import techreborn.tiles.TileThermalGenerator;
|
||||||
|
|
||||||
public class BlockThermalGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockThermalGenerator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
@ -16,8 +17,9 @@ public class BlockThermalGenerator extends BlockMachineBase implements IAdvanced
|
||||||
|
|
||||||
|
|
||||||
public BlockThermalGenerator() {
|
public BlockThermalGenerator() {
|
||||||
super(Material.rock);
|
super();
|
||||||
setUnlocalizedName("techreborn.thermalGenerator");
|
setUnlocalizedName("techreborn.thermalGenerator");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,17 +5,19 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileAlloyFurnace;
|
import techreborn.tiles.TileAlloyFurnace;
|
||||||
|
|
||||||
public class BlockAlloyFurnace extends BlockMachineBase implements IRotationTexture {
|
public class BlockAlloyFurnace extends BlockMachineBase implements IRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockAlloyFurnace(Material material) {
|
public BlockAlloyFurnace(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.alloyfurnace");
|
setUnlocalizedName("techreborn.alloyfurnace");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,17 +5,19 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileAlloySmelter;
|
import techreborn.tiles.TileAlloySmelter;
|
||||||
|
|
||||||
public class BlockAlloySmelter extends BlockMachineBase implements IRotationTexture {
|
public class BlockAlloySmelter extends BlockMachineBase implements IRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockAlloySmelter(Material material) {
|
public BlockAlloySmelter(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.alloysmelter");
|
setUnlocalizedName("techreborn.alloysmelter");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,17 +5,19 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileAssemblingMachine;
|
import techreborn.tiles.TileAssemblingMachine;
|
||||||
|
|
||||||
public class BlockAssemblingMachine extends BlockMachineBase implements IRotationTexture {
|
public class BlockAssemblingMachine extends BlockMachineBase implements IRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockAssemblingMachine(Material material) {
|
public BlockAssemblingMachine(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.assemblingmachine");
|
setUnlocalizedName("techreborn.assemblingmachine");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,17 +5,19 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileBlastFurnace;
|
import techreborn.tiles.TileBlastFurnace;
|
||||||
|
|
||||||
public class BlockBlastFurnace extends BlockMachineBase implements IRotationTexture {
|
public class BlockBlastFurnace extends BlockMachineBase implements IRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockBlastFurnace(Material material) {
|
public BlockBlastFurnace(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.blastfurnace");
|
setUnlocalizedName("techreborn.blastfurnace");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,9 +5,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileCentrifuge;
|
import techreborn.tiles.TileCentrifuge;
|
||||||
|
|
||||||
public class BlockCentrifuge extends BlockMachineBase implements IRotationTexture {
|
public class BlockCentrifuge extends BlockMachineBase implements IRotationTexture {
|
||||||
|
@ -15,8 +16,9 @@ public class BlockCentrifuge extends BlockMachineBase implements IRotationTextur
|
||||||
|
|
||||||
|
|
||||||
public BlockCentrifuge() {
|
public BlockCentrifuge() {
|
||||||
super(Material.rock);
|
super();
|
||||||
setUnlocalizedName("techreborn.centrifuge");
|
setUnlocalizedName("techreborn.centrifuge");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,17 +5,19 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileChargeBench;
|
import techreborn.tiles.TileChargeBench;
|
||||||
|
|
||||||
public class BlockChargeBench extends BlockMachineBase implements IRotationTexture {
|
public class BlockChargeBench extends BlockMachineBase implements IRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockChargeBench(Material material) {
|
public BlockChargeBench(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.chargebench");
|
setUnlocalizedName("techreborn.chargebench");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,9 +5,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileChemicalReactor;
|
import techreborn.tiles.TileChemicalReactor;
|
||||||
|
|
||||||
public class BlockChemicalReactor extends BlockMachineBase implements IRotationTexture {
|
public class BlockChemicalReactor extends BlockMachineBase implements IRotationTexture {
|
||||||
|
@ -15,8 +16,9 @@ public class BlockChemicalReactor extends BlockMachineBase implements IRotationT
|
||||||
|
|
||||||
|
|
||||||
public BlockChemicalReactor(Material material) {
|
public BlockChemicalReactor(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.chemicalreactor");
|
setUnlocalizedName("techreborn.chemicalreactor");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
package techreborn.blocks.machine;
|
package techreborn.blocks.machine;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
|
|
||||||
public class BlockDistillationTower extends BlockMachineBase implements IRotationTexture {
|
public class BlockDistillationTower extends BlockMachineBase implements IRotationTexture {
|
||||||
|
|
||||||
public BlockDistillationTower(Material material) {
|
public BlockDistillationTower(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.distillationtower");
|
setUnlocalizedName("techreborn.distillationtower");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String prefix = "techreborn:blocks/machine/";
|
private final String prefix = "techreborn:blocks/machine/";
|
||||||
|
|
|
@ -5,17 +5,19 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileImplosionCompressor;
|
import techreborn.tiles.TileImplosionCompressor;
|
||||||
|
|
||||||
public class BlockImplosionCompressor extends BlockMachineBase implements IRotationTexture {
|
public class BlockImplosionCompressor extends BlockMachineBase implements IRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockImplosionCompressor(Material material) {
|
public BlockImplosionCompressor(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.implosioncompressor");
|
setUnlocalizedName("techreborn.implosioncompressor");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,17 +5,19 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileIndustrialElectrolyzer;
|
import techreborn.tiles.TileIndustrialElectrolyzer;
|
||||||
|
|
||||||
public class BlockIndustrialElectrolyzer extends BlockMachineBase implements IRotationTexture {
|
public class BlockIndustrialElectrolyzer extends BlockMachineBase implements IRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockIndustrialElectrolyzer(Material material) {
|
public BlockIndustrialElectrolyzer(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.industrialelectrolyzer");
|
setUnlocalizedName("techreborn.industrialelectrolyzer");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -6,17 +6,19 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileIndustrialGrinder;
|
import techreborn.tiles.TileIndustrialGrinder;
|
||||||
|
|
||||||
public class BlockIndustrialGrinder extends BlockMachineBase implements IRotationTexture {
|
public class BlockIndustrialGrinder extends BlockMachineBase implements IRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockIndustrialGrinder(Material material) {
|
public BlockIndustrialGrinder(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.industrialgrinder");
|
setUnlocalizedName("techreborn.industrialgrinder");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -6,16 +6,18 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileIndustrialSawmill;
|
import techreborn.tiles.TileIndustrialSawmill;
|
||||||
|
|
||||||
public class BlockIndustrialSawmill extends BlockMachineBase implements IRotationTexture {
|
public class BlockIndustrialSawmill extends BlockMachineBase implements IRotationTexture {
|
||||||
|
|
||||||
public BlockIndustrialSawmill(Material material) {
|
public BlockIndustrialSawmill(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.industrialsawmill");
|
setUnlocalizedName("techreborn.industrialsawmill");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,17 +5,19 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileMatterFabricator;
|
import techreborn.tiles.TileMatterFabricator;
|
||||||
|
|
||||||
public class BlockMatterFabricator extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockMatterFabricator extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockMatterFabricator(Material material) {
|
public BlockMatterFabricator(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.matterfabricator");
|
setUnlocalizedName("techreborn.matterfabricator");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,9 +5,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileRollingMachine;
|
import techreborn.tiles.TileRollingMachine;
|
||||||
|
|
||||||
public class BlockRollingMachine extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockRollingMachine extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
@ -15,8 +16,9 @@ public class BlockRollingMachine extends BlockMachineBase implements IAdvancedRo
|
||||||
|
|
||||||
|
|
||||||
public BlockRollingMachine(Material material) {
|
public BlockRollingMachine(Material material) {
|
||||||
super(material.rock);
|
super();
|
||||||
setUnlocalizedName("techreborn.rollingmachine");
|
setUnlocalizedName("techreborn.rollingmachine");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -6,17 +6,19 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileVacuumFreezer;
|
import techreborn.tiles.TileVacuumFreezer;
|
||||||
|
|
||||||
public class BlockVacuumFreezer extends BlockMachineBase implements IAdvancedRotationTexture{
|
public class BlockVacuumFreezer extends BlockMachineBase implements IAdvancedRotationTexture{
|
||||||
|
|
||||||
|
|
||||||
public BlockVacuumFreezer(Material material) {
|
public BlockVacuumFreezer(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.vacuumfreezer");
|
setUnlocalizedName("techreborn.vacuumfreezer");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.TileAesu;
|
import techreborn.tiles.TileAesu;
|
||||||
|
|
||||||
public class BlockAesu extends BlockMachineBase implements IRotationTexture {
|
public class BlockAesu extends BlockMachineBase implements IRotationTexture {
|
||||||
|
@ -15,8 +16,9 @@ public class BlockAesu extends BlockMachineBase implements IRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockAesu(Material material) {
|
public BlockAesu(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.aesu");
|
setUnlocalizedName("techreborn.aesu");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -8,17 +8,19 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.idsu.TileIDSU;
|
import techreborn.tiles.idsu.TileIDSU;
|
||||||
|
|
||||||
public class BlockIDSU extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockIDSU extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockIDSU(Material material) {
|
public BlockIDSU(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.idsu");
|
setUnlocalizedName("techreborn.idsu");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,17 +5,19 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.lesu.TileLesu;
|
import techreborn.tiles.lesu.TileLesu;
|
||||||
|
|
||||||
public class BlockLesu extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockLesu extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
|
|
||||||
public BlockLesu(Material material) {
|
public BlockLesu(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.lesu");
|
setUnlocalizedName("techreborn.lesu");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,15 +8,17 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.IBlockAccess;
|
import net.minecraft.world.IBlockAccess;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IAdvancedRotationTexture;
|
import reborncore.common.blocks.IAdvancedRotationTexture;
|
||||||
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.lesu.TileLesuStorage;
|
import techreborn.tiles.lesu.TileLesuStorage;
|
||||||
|
|
||||||
public class BlockLesuStorage extends BlockMachineBase implements IAdvancedRotationTexture {
|
public class BlockLesuStorage extends BlockMachineBase implements IAdvancedRotationTexture {
|
||||||
|
|
||||||
public BlockLesuStorage(Material material) {
|
public BlockLesuStorage(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.lesustorage");
|
setUnlocalizedName("techreborn.lesustorage");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,21 +3,20 @@ package techreborn.blocks.teir1;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
import techreborn.tiles.TileIndustrialGrinder;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.teir1.TileCompressor;
|
import techreborn.tiles.teir1.TileCompressor;
|
||||||
import techreborn.tiles.teir1.TileGrinder;
|
|
||||||
|
|
||||||
public class BlockCompressor extends BlockMachineBase implements IRotationTexture{
|
public class BlockCompressor extends BlockMachineBase implements IRotationTexture{
|
||||||
|
|
||||||
public BlockCompressor(Material material) {
|
public BlockCompressor(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.compressor");
|
setUnlocalizedName("techreborn.compressor");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,21 +3,20 @@ package techreborn.blocks.teir1;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
import techreborn.tiles.TileIndustrialGrinder;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.teir1.TileElectricFurnace;
|
import techreborn.tiles.teir1.TileElectricFurnace;
|
||||||
import techreborn.tiles.teir1.TileGrinder;
|
|
||||||
|
|
||||||
public class BlockElectricFurnace extends BlockMachineBase implements IRotationTexture{
|
public class BlockElectricFurnace extends BlockMachineBase implements IRotationTexture{
|
||||||
|
|
||||||
public BlockElectricFurnace(Material material) {
|
public BlockElectricFurnace(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.electricfurnace");
|
setUnlocalizedName("techreborn.electricfurnace");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,21 +3,20 @@ package techreborn.blocks.teir1;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
import techreborn.tiles.TileIndustrialGrinder;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.teir1.TileExtractor;
|
import techreborn.tiles.teir1.TileExtractor;
|
||||||
import techreborn.tiles.teir1.TileGrinder;
|
|
||||||
|
|
||||||
public class BlockExtractor extends BlockMachineBase implements IRotationTexture{
|
public class BlockExtractor extends BlockMachineBase implements IRotationTexture{
|
||||||
|
|
||||||
public BlockExtractor(Material material) {
|
public BlockExtractor(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.extractor");
|
setUnlocalizedName("techreborn.extractor");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -3,20 +3,20 @@ package techreborn.blocks.teir1;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.blocks.IRotationTexture;
|
import reborncore.common.blocks.IRotationTexture;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
import techreborn.tiles.TileIndustrialGrinder;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.tiles.teir1.TileGrinder;
|
import techreborn.tiles.teir1.TileGrinder;
|
||||||
|
|
||||||
public class BlockGrinder extends BlockMachineBase implements IRotationTexture{
|
public class BlockGrinder extends BlockMachineBase implements IRotationTexture{
|
||||||
|
|
||||||
public BlockGrinder(Material material) {
|
public BlockGrinder(Material material) {
|
||||||
super(material);
|
super();
|
||||||
setUnlocalizedName("techreborn.grinder");
|
setUnlocalizedName("techreborn.grinder");
|
||||||
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -11,7 +11,7 @@ import org.lwjgl.input.Keyboard;
|
||||||
import reborncore.api.IListInfoProvider;
|
import reborncore.api.IListInfoProvider;
|
||||||
import reborncore.common.util.Color;
|
import reborncore.common.util.Color;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.api.power.IEnergyInterfaceItem;
|
import reborncore.api.power.IEnergyInterfaceItem;
|
||||||
|
|
||||||
public class StackToolTipEvent {
|
public class StackToolTipEvent {
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import reborncore.common.util.Color;
|
import reborncore.common.util.Color;
|
||||||
import techreborn.api.power.IEnergyInterfaceItem;
|
import reborncore.api.power.IEnergyInterfaceItem;
|
||||||
import techreborn.client.keybindings.KeyBindings;
|
import techreborn.client.keybindings.KeyBindings;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package techreborn.compat.waila;
|
||||||
import net.minecraftforge.fml.common.event.*;
|
import net.minecraftforge.fml.common.event.*;
|
||||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||||
import techreborn.compat.ICompatModule;
|
import techreborn.compat.ICompatModule;
|
||||||
import techreborn.tiles.TileMachineBase;
|
import reborncore.common.tile.TileMachineBase;
|
||||||
|
|
||||||
public class CompatModuleWaila implements ICompatModule {
|
public class CompatModuleWaila implements ICompatModule {
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import reborncore.api.IListInfoProvider;
|
import reborncore.api.IListInfoProvider;
|
||||||
import techreborn.tiles.TileMachineBase;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -75,12 +75,9 @@ public class ConfigTechReborn {
|
||||||
public static int extraOutputPerLesuBlock;
|
public static int extraOutputPerLesuBlock;
|
||||||
public static int baseLesuOutput;
|
public static int baseLesuOutput;
|
||||||
public static int lesuStoragePerBlock;
|
public static int lesuStoragePerBlock;
|
||||||
public static int euPerRF;
|
|
||||||
public static int farmEu;
|
public static int farmEu;
|
||||||
public static int aesuMaxOutput;
|
public static int aesuMaxOutput;
|
||||||
public static int aesuMaxStorage;
|
public static int aesuMaxStorage;
|
||||||
public static boolean enableRF;
|
|
||||||
public static boolean enableEU;
|
|
||||||
// Charge
|
// Charge
|
||||||
public static int AdvancedDrillCharge;
|
public static int AdvancedDrillCharge;
|
||||||
public static int LapotronPackCharge;
|
public static int LapotronPackCharge;
|
||||||
|
@ -329,13 +326,6 @@ public class ConfigTechReborn {
|
||||||
aesuMaxStorage = config.get(CATEGORY_POWER, "AESU Max Storage", 30, "Set the max Storage for the AESU")
|
aesuMaxStorage = config.get(CATEGORY_POWER, "AESU Max Storage", 30, "Set the max Storage for the AESU")
|
||||||
.getInt();
|
.getInt();
|
||||||
|
|
||||||
enableRF = config
|
|
||||||
.get(CATEGORY_POWER, "Allow RF", !Loader.isModLoaded("IC2"), "Allow machines to be powered with RF")
|
|
||||||
.getBoolean();
|
|
||||||
|
|
||||||
enableEU = config
|
|
||||||
.get(CATEGORY_POWER, "Allow EU", Loader.isModLoaded("IC2"), "Allow machines to be powered with EU")
|
|
||||||
.getBoolean();
|
|
||||||
|
|
||||||
// Charge
|
// Charge
|
||||||
AdvancedDrillCharge = config
|
AdvancedDrillCharge = config
|
||||||
|
@ -381,8 +371,6 @@ public class ConfigTechReborn {
|
||||||
|
|
||||||
extraOutputPerLesuBlock = config.get(CATEGORY_POWER, "Extra output on Storage Blocks", 8, "").getInt();
|
extraOutputPerLesuBlock = config.get(CATEGORY_POWER, "Extra output on Storage Blocks", 8, "").getInt();
|
||||||
|
|
||||||
euPerRF = config.get(CATEGORY_POWER, "EU - RF ratio", 4, "The Amount of RF to output from EU").getInt();
|
|
||||||
|
|
||||||
farmEu = config.get(CATEGORY_POWER, "farmeu", 32, "").getInt();
|
farmEu = config.get(CATEGORY_POWER, "farmeu", 32, "").getInt();
|
||||||
|
|
||||||
// Teir
|
// Teir
|
||||||
|
|
|
@ -6,6 +6,7 @@ import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
import reborncore.common.tile.TileMachineBase;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.blocks.*;
|
import techreborn.blocks.*;
|
||||||
import techreborn.blocks.generator.*;
|
import techreborn.blocks.generator.*;
|
||||||
|
|
|
@ -7,6 +7,7 @@ import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import reborncore.common.util.BucketHandler;
|
import reborncore.common.util.BucketHandler;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.events.OreUnifier;
|
import techreborn.events.OreUnifier;
|
||||||
|
@ -14,7 +15,7 @@ import techreborn.items.*;
|
||||||
import techreborn.items.armor.ItemLapotronPack;
|
import techreborn.items.armor.ItemLapotronPack;
|
||||||
import techreborn.items.armor.ItemLithiumBatpack;
|
import techreborn.items.armor.ItemLithiumBatpack;
|
||||||
import techreborn.items.tools.*;
|
import techreborn.items.tools.*;
|
||||||
import techreborn.powerSystem.PoweredItem;
|
import reborncore.common.powerSystem.PoweredItem;
|
||||||
|
|
||||||
public class ModItems {
|
public class ModItems {
|
||||||
|
|
||||||
|
@ -279,6 +280,9 @@ public class ModItems {
|
||||||
Core.logHelper.info("TechReborns Items Loaded");
|
Core.logHelper.info("TechReborns Items Loaded");
|
||||||
|
|
||||||
registerOreDict();
|
registerOreDict();
|
||||||
|
|
||||||
|
BlockMachineBase.advancedMachineStack = new ItemStack(Item.getItemFromBlock(ModBlocks.MachineCasing), 1, 2);
|
||||||
|
BlockMachineBase.machineStack = new ItemStack(Item.getItemFromBlock(ModBlocks.MachineCasing), 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void registerOreDict() {
|
public static void registerOreDict() {
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
package techreborn.items;
|
package techreborn.items;
|
||||||
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import techreborn.api.power.IEnergyItemInfo;
|
import reborncore.api.power.IEnergyItemInfo;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@ import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import techreborn.api.power.IEnergyItemInfo;
|
import reborncore.api.power.IEnergyItemInfo;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.powerSystem.PoweredItem;
|
import reborncore.common.powerSystem.PoweredItem;
|
||||||
|
|
||||||
public class ItemLithiumBattery extends ItemTextureBase implements IEnergyItemInfo {
|
public class ItemLithiumBattery extends ItemTextureBase implements IEnergyItemInfo {
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
package techreborn.items;
|
package techreborn.items;
|
||||||
|
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Mark on 19/02/2016.
|
* Created by Mark on 19/02/2016.
|
||||||
*/
|
*/
|
||||||
public class ItemMissingRecipe extends ItemTR {
|
public class ItemMissingRecipe extends Item {
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,9 +7,9 @@ import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import techreborn.api.power.IEnergyItemInfo;
|
import reborncore.api.power.IEnergyItemInfo;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.powerSystem.PoweredItem;
|
import reborncore.common.powerSystem.PoweredItem;
|
||||||
|
|
||||||
public class ItemReBattery extends ItemTextureBase implements IEnergyItemInfo {
|
public class ItemReBattery extends ItemTextureBase implements IEnergyItemInfo {
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,10 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import reborncore.RebornCore;
|
import reborncore.RebornCore;
|
||||||
import techreborn.api.power.IEnergyItemInfo;
|
import reborncore.api.power.IEnergyItemInfo;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.powerSystem.PoweredItem;
|
import reborncore.common.powerSystem.PoweredItem;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,10 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import reborncore.RebornCore;
|
import reborncore.RebornCore;
|
||||||
import techreborn.api.power.IEnergyItemInfo;
|
import reborncore.api.power.IEnergyItemInfo;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.powerSystem.PoweredItem;
|
import reborncore.common.powerSystem.PoweredItem;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -17,10 +17,10 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import reborncore.RebornCore;
|
import reborncore.RebornCore;
|
||||||
import reborncore.common.util.TorchHelper;
|
import reborncore.common.util.TorchHelper;
|
||||||
import techreborn.api.power.IEnergyItemInfo;
|
import reborncore.api.power.IEnergyItemInfo;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.powerSystem.PoweredItem;
|
import reborncore.common.powerSystem.PoweredItem;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,11 @@ import net.minecraft.potion.Potion;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import techreborn.api.power.IEnergyItemInfo;
|
import reborncore.api.power.IEnergyItemInfo;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.items.ItemTextureBase;
|
import techreborn.items.ItemTextureBase;
|
||||||
import techreborn.powerSystem.PoweredItem;
|
import reborncore.common.powerSystem.PoweredItem;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -18,10 +18,10 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import reborncore.RebornCore;
|
import reborncore.RebornCore;
|
||||||
import reborncore.common.util.TorchHelper;
|
import reborncore.common.util.TorchHelper;
|
||||||
import techreborn.api.power.IEnergyItemInfo;
|
import reborncore.api.power.IEnergyItemInfo;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.powerSystem.PoweredItem;
|
import reborncore.common.powerSystem.PoweredItem;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -14,10 +14,10 @@ import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import reborncore.RebornCore;
|
import reborncore.RebornCore;
|
||||||
import reborncore.common.util.Color;
|
import reborncore.common.util.Color;
|
||||||
import techreborn.api.power.IEnergyItemInfo;
|
import reborncore.api.power.IEnergyItemInfo;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.powerSystem.PoweredItem;
|
import reborncore.common.powerSystem.PoweredItem;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
package techreborn.powerSystem;
|
|
||||||
|
|
||||||
import techreborn.config.ConfigTechReborn;
|
|
||||||
|
|
||||||
public class PowerSystem {
|
|
||||||
|
|
||||||
public static boolean RFPOWENET = ConfigTechReborn.enableRF;
|
|
||||||
|
|
||||||
public static boolean EUPOWENET = ConfigTechReborn.enableEU;
|
|
||||||
}
|
|
|
@ -1,64 +0,0 @@
|
||||||
package techreborn.powerSystem;
|
|
||||||
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import reborncore.jtraits.MixinFactory;
|
|
||||||
import techreborn.api.power.IEnergyInterfaceItem;
|
|
||||||
import techreborn.powerSystem.traits.BasePowerTrait;
|
|
||||||
import techreborn.powerSystem.traits.EUItemPowerTrait;
|
|
||||||
import techreborn.powerSystem.traits.RFItemPowerTrait;
|
|
||||||
|
|
||||||
|
|
||||||
public abstract class PoweredItem {
|
|
||||||
|
|
||||||
public static Item createItem(Class itemClass) throws IllegalAccessException, InstantiationException {
|
|
||||||
return (Item) MixinFactory.mixin(itemClass,BasePowerTrait.class, RFItemPowerTrait.class, EUItemPowerTrait.class).newInstance();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean canUseEnergy(double energy, ItemStack stack){
|
|
||||||
if(stack.getItem() instanceof IEnergyInterfaceItem){
|
|
||||||
return ((IEnergyInterfaceItem) stack.getItem()).canUseEnergy(energy, stack);
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static double useEnergy(double energy, ItemStack stack){
|
|
||||||
if(stack.getItem() instanceof IEnergyInterfaceItem){
|
|
||||||
return ((IEnergyInterfaceItem) stack.getItem()).useEnergy(energy, stack);
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setEnergy(double energy, ItemStack stack){
|
|
||||||
if(stack.getItem() instanceof IEnergyInterfaceItem){
|
|
||||||
((IEnergyInterfaceItem) stack.getItem()).setEnergy(energy, stack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static double getEnergy(ItemStack stack){
|
|
||||||
if(stack.getItem() instanceof IEnergyInterfaceItem){
|
|
||||||
return ((IEnergyInterfaceItem) stack.getItem()).getEnergy(stack);
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static double addEnergy(double energy, ItemStack stack){
|
|
||||||
if(stack.getItem() instanceof IEnergyInterfaceItem){
|
|
||||||
return ((IEnergyInterfaceItem) stack.getItem()).addEnergy(energy, stack);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static double getMaxPower(ItemStack stack){
|
|
||||||
if(stack.getItem() instanceof IEnergyInterfaceItem){
|
|
||||||
return ((IEnergyInterfaceItem) stack.getItem()).getMaxPower(stack);
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,65 +0,0 @@
|
||||||
package techreborn.powerSystem;
|
|
||||||
|
|
||||||
import cofh.api.energy.IEnergyConnection;
|
|
||||||
import cofh.api.energy.IEnergyHandler;
|
|
||||||
import cofh.api.energy.IEnergyProvider;
|
|
||||||
import cofh.api.energy.IEnergyReceiver;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.util.BlockPos;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import techreborn.api.power.IEnergyInterfaceTile;
|
|
||||||
import techreborn.tiles.TileMachineBase;
|
|
||||||
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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, IEnergyInterfaceTile {
|
|
||||||
|
|
||||||
|
|
||||||
Random random = new Random();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateEntity() {
|
|
||||||
super.updateEntity();
|
|
||||||
if (worldObj.isRemote) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
sendPower();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void sendPower() {
|
|
||||||
if (!PowerSystem.RFPOWENET) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (EnumFacing direction : EnumFacing.values()) {
|
|
||||||
int extracted = getEnergyStored(direction);
|
|
||||||
|
|
||||||
TileEntity tile = worldObj.getTileEntity(new BlockPos(getPos().getX() + direction.getFrontOffsetX(), getPos().getY() + direction.getFrontOffsetY(), getPos().getZ() + direction.getFrontOffsetZ()));
|
|
||||||
if (isPoweredTile(tile, direction)) {
|
|
||||||
if (canProvideEnergy(direction)) {
|
|
||||||
if (tile instanceof IEnergyReceiver) {
|
|
||||||
IEnergyReceiver handler = (IEnergyReceiver) tile;
|
|
||||||
int neededRF = handler.receiveEnergy(
|
|
||||||
direction.getOpposite(),
|
|
||||||
extracted, false);
|
|
||||||
|
|
||||||
extractEnergy(direction.getOpposite(), neededRF, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPoweredTile(TileEntity tile, EnumFacing side) {
|
|
||||||
if (tile == null) {
|
|
||||||
return false;
|
|
||||||
} else if (tile instanceof IEnergyHandler || tile instanceof IEnergyReceiver) {
|
|
||||||
return ((IEnergyConnection) tile).canConnectEnergy(side.getOpposite());
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,334 +0,0 @@
|
||||||
package techreborn.powerSystem;
|
|
||||||
|
|
||||||
import cofh.api.energy.IEnergyProvider;
|
|
||||||
import cofh.api.energy.IEnergyReceiver;
|
|
||||||
import com.mojang.realmsclient.gui.ChatFormatting;
|
|
||||||
import ic2.api.energy.event.EnergyTileUnloadEvent;
|
|
||||||
import ic2.api.energy.tile.IEnergySink;
|
|
||||||
import ic2.api.energy.tile.IEnergySource;
|
|
||||||
import ic2.api.energy.tile.IEnergySourceInfo;
|
|
||||||
import ic2.api.energy.tile.IEnergyTile;
|
|
||||||
import ic2.api.info.Info;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
import net.minecraft.util.EnumFacing;
|
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
|
||||||
import net.minecraftforge.fml.common.Optional;
|
|
||||||
import reborncore.api.IListInfoProvider;
|
|
||||||
import techreborn.api.power.IEnergyInterfaceTile;
|
|
||||||
import techreborn.config.ConfigTechReborn;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
@Optional.InterfaceList(value = {
|
|
||||||
@Optional.Interface(iface = "ic2.api.energy.tile.IEnergyTile", modid = "IC2"),
|
|
||||||
@Optional.Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "IC2"),
|
|
||||||
@Optional.Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "IC2")
|
|
||||||
})
|
|
||||||
public abstract class TilePowerAcceptor extends RFProviderTile implements
|
|
||||||
IEnergyReceiver, IEnergyProvider, //Cofh
|
|
||||||
IEnergyInterfaceTile, IListInfoProvider, //TechReborn
|
|
||||||
IEnergyTile, IEnergySink, IEnergySource, //Ic2
|
|
||||||
IEnergySourceInfo //IC2 Classic //TODO ic2
|
|
||||||
{
|
|
||||||
public int tier;
|
|
||||||
private double energy;
|
|
||||||
|
|
||||||
public TilePowerAcceptor(int tier) {
|
|
||||||
this.tier = tier;
|
|
||||||
}
|
|
||||||
|
|
||||||
//IC2
|
|
||||||
|
|
||||||
protected boolean addedToEnet;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void updateEntity() {
|
|
||||||
super.updateEntity();
|
|
||||||
// onLoaded();
|
|
||||||
}
|
|
||||||
|
|
||||||
// public void onLoaded() {
|
|
||||||
// if (PowerSystem.EUPOWENET && !addedToEnet &&
|
|
||||||
// !FMLCommonHandler.instance().getEffectiveSide().isClient() &&
|
|
||||||
// Info.isIc2Available()) {
|
|
||||||
// MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
|
|
||||||
//
|
|
||||||
// addedToEnet = true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void invalidate() {
|
|
||||||
super.invalidate();
|
|
||||||
onChunkUnload();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onChunkUnload() {
|
|
||||||
super.onChunkUnload();
|
|
||||||
if (PowerSystem.EUPOWENET) {
|
|
||||||
if (addedToEnet &&
|
|
||||||
Info.isIc2Available()) {
|
|
||||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
|
|
||||||
|
|
||||||
addedToEnet = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getDemandedEnergy() {
|
|
||||||
if (!PowerSystem.EUPOWENET)
|
|
||||||
return 0;
|
|
||||||
return Math.min(getMaxPower() - getEnergy(), getMaxInput());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getSinkTier() {
|
|
||||||
return tier;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double injectEnergy(EnumFacing directionFrom, double amount, double voltage) {
|
|
||||||
setEnergy(getEnergy() + amount);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean acceptsEnergyFrom(TileEntity emitter, EnumFacing direction) {
|
|
||||||
if (!PowerSystem.EUPOWENET)
|
|
||||||
return false;
|
|
||||||
return canAcceptEnergy(direction);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean emitsEnergyTo(TileEntity receiver, EnumFacing direction) {
|
|
||||||
if (!PowerSystem.EUPOWENET)
|
|
||||||
return false;
|
|
||||||
return canProvideEnergy(direction);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getOfferedEnergy() {
|
|
||||||
if (!PowerSystem.EUPOWENET)
|
|
||||||
return 0;
|
|
||||||
return Math.min(getEnergy(), getMaxOutput());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void drawEnergy(double amount) {
|
|
||||||
useEnergy((int) amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getSourceTier() {
|
|
||||||
return tier;
|
|
||||||
}
|
|
||||||
//END IC2
|
|
||||||
|
|
||||||
//COFH
|
|
||||||
@Override
|
|
||||||
public boolean canConnectEnergy(EnumFacing from) {
|
|
||||||
if (!PowerSystem.RFPOWENET)
|
|
||||||
return false;
|
|
||||||
return canAcceptEnergy(from) || canProvideEnergy(from);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate) {
|
|
||||||
if (!PowerSystem.RFPOWENET)
|
|
||||||
return 0;
|
|
||||||
if (!canAcceptEnergy(from)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
maxReceive *= ConfigTechReborn.euPerRF;
|
|
||||||
int energyReceived = Math.min(getMaxEnergyStored(null) - getEnergyStored(null), Math.min((int) this.getMaxInput() * ConfigTechReborn.euPerRF, maxReceive));
|
|
||||||
|
|
||||||
if (!simulate) {
|
|
||||||
setEnergy(getEnergy() + energyReceived);
|
|
||||||
}
|
|
||||||
return energyReceived / ConfigTechReborn.euPerRF;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getEnergyStored(EnumFacing from) {
|
|
||||||
if (!PowerSystem.RFPOWENET)
|
|
||||||
return 0;
|
|
||||||
return ((int) getEnergy() / ConfigTechReborn.euPerRF);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMaxEnergyStored(EnumFacing from) {
|
|
||||||
if (!PowerSystem.RFPOWENET)
|
|
||||||
return 0;
|
|
||||||
return ((int) getMaxPower() / ConfigTechReborn.euPerRF);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int extractEnergy(EnumFacing from, int maxExtract, boolean simulate) {
|
|
||||||
if (!PowerSystem.RFPOWENET)
|
|
||||||
return 0;
|
|
||||||
if (!canProvideEnergy(from)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
maxExtract *= ConfigTechReborn.euPerRF;
|
|
||||||
int energyExtracted = Math.min(getEnergyStored(null), Math.min(maxExtract, maxExtract));
|
|
||||||
|
|
||||||
if (!simulate) {
|
|
||||||
setEnergy(energy - energyExtracted);
|
|
||||||
}
|
|
||||||
return energyExtracted / ConfigTechReborn.euPerRF;
|
|
||||||
}
|
|
||||||
//END COFH
|
|
||||||
|
|
||||||
//TechReborn
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getEnergy() {
|
|
||||||
return energy;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setEnergy(double energy) {
|
|
||||||
this.energy = energy;
|
|
||||||
|
|
||||||
if (this.getEnergy() > getMaxPower()) {
|
|
||||||
this.setEnergy(getMaxPower());
|
|
||||||
} else if (this.energy < 0) {
|
|
||||||
this.setEnergy(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double addEnergy(double energy) {
|
|
||||||
return addEnergy(energy, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double addEnergy(double energy, boolean simulate) {
|
|
||||||
double energyReceived = Math.min(getMaxPower() - energy, Math.min(this.getMaxPower(), energy));
|
|
||||||
|
|
||||||
if (!simulate) {
|
|
||||||
setEnergy(getEnergy() + energyReceived);
|
|
||||||
}
|
|
||||||
return energyReceived;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canUseEnergy(double input) {
|
|
||||||
return input <= energy;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double useEnergy(double energy) {
|
|
||||||
return useEnergy(energy, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double useEnergy(double extract, boolean simulate) {
|
|
||||||
if (!simulate) {
|
|
||||||
setEnergy(energy - extract);
|
|
||||||
}
|
|
||||||
return extract;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canAddEnergy(double energy) {
|
|
||||||
return this.energy + energy <= getMaxPower();
|
|
||||||
}
|
|
||||||
//TechReborn END
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void readFromNBT(NBTTagCompound tag) {
|
|
||||||
super.readFromNBT(tag);
|
|
||||||
NBTTagCompound data = tag.getCompoundTag("TilePowerAcceptor");
|
|
||||||
energy = data.getDouble("energy");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void writeToNBT(NBTTagCompound tag) {
|
|
||||||
super.writeToNBT(tag);
|
|
||||||
NBTTagCompound data = new NBTTagCompound();
|
|
||||||
data.setDouble("energy", energy);
|
|
||||||
tag.setTag("TilePowerAcceptor", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void readFromNBTWithoutCoords(NBTTagCompound tag) {
|
|
||||||
NBTTagCompound data = tag.getCompoundTag("TilePowerAcceptor");
|
|
||||||
energy = data.getDouble("energy");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void writeToNBTWithoutCoords(NBTTagCompound tag) {
|
|
||||||
NBTTagCompound data = new NBTTagCompound();
|
|
||||||
data.setDouble("energy", energy);
|
|
||||||
tag.setTag("TilePowerAcceptor", data);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addInfo(List<String> info, boolean isRealTile) {
|
|
||||||
info.add(ChatFormatting.LIGHT_PURPLE + "Energy buffer Size " + ChatFormatting.GREEN + getEUString(getMaxPower()));
|
|
||||||
if (getMaxInput() != 0) {
|
|
||||||
info.add(ChatFormatting.LIGHT_PURPLE + "Max Input " + ChatFormatting.GREEN + getEUString(getMaxInput()));
|
|
||||||
}
|
|
||||||
if (getMaxOutput() != 0) {
|
|
||||||
info.add(ChatFormatting.LIGHT_PURPLE + "Max Output " + ChatFormatting.GREEN + getEUString(getMaxOutput()));
|
|
||||||
}
|
|
||||||
// if(isRealTile){ //TODO sync to client
|
|
||||||
// info.add(ChatFormatting.LIGHT_PURPLE + "Stored energy " + ChatFormatting.GREEN + getEUString(energy));
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
private String getEUString(double euValue) {
|
|
||||||
if (euValue >= 1000000) {
|
|
||||||
double tenX = Math.round(euValue / 100000);
|
|
||||||
return Double.toString(tenX / 10.0).concat(" m EU");
|
|
||||||
} else if (euValue >= 1000) {
|
|
||||||
double tenX = Math.round(euValue / 100);
|
|
||||||
return Double.toString(tenX / 10.0).concat(" k EU");
|
|
||||||
} else {
|
|
||||||
return Double.toString(Math.floor(euValue)).concat(" EU");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getFreeSpace() {
|
|
||||||
return getMaxPower() - energy;
|
|
||||||
}
|
|
||||||
|
|
||||||
//IC2 Classic
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMaxEnergyAmount() {
|
|
||||||
return (int) getMaxOutput();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void charge(int slot)
|
|
||||||
{
|
|
||||||
//TODO rewrite to use built in power system
|
|
||||||
// if(getStackInSlot(slot) != null)
|
|
||||||
// {
|
|
||||||
// if(getStackInSlot(slot).getItem() instanceof IElectricItem)
|
|
||||||
// {
|
|
||||||
// if(getEnergy() != getMaxPower())
|
|
||||||
// {
|
|
||||||
// ItemStack stack = inventory.getStackInSlot(slot);
|
|
||||||
// double MaxCharge = ((IElectricItem) stack.getItem()).getMaxCharge(stack);
|
|
||||||
// double CurrentCharge = ElectricItem.manager.getCharge(stack);
|
|
||||||
// if (CurrentCharge != 0)
|
|
||||||
// {
|
|
||||||
// ElectricItem.manager.discharge(stack, 5, 4, false, false, false);
|
|
||||||
// addEnergy(5);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getEnergyScaled(int scale) {
|
|
||||||
return (int) ((energy * scale / getMaxPower()));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,85 +0,0 @@
|
||||||
package techreborn.powerSystem.traits;
|
|
||||||
|
|
||||||
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import reborncore.jtraits.JTrait;
|
|
||||||
import techreborn.api.power.IEnergyInterfaceItem;
|
|
||||||
|
|
||||||
public abstract class BasePowerTrait extends JTrait<Item> implements IEnergyInterfaceItem {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getEnergy(ItemStack stack) {
|
|
||||||
NBTTagCompound tagCompound = getOrCreateNbtData(stack);
|
|
||||||
if (tagCompound.hasKey("charge")) {
|
|
||||||
return tagCompound.getDouble("charge");
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setEnergy(double energy, ItemStack stack) {
|
|
||||||
NBTTagCompound tagCompound = getOrCreateNbtData(stack);
|
|
||||||
tagCompound.setDouble("charge", energy);
|
|
||||||
|
|
||||||
if (this.getEnergy(stack) > getMaxPower(stack)) {
|
|
||||||
this.setEnergy(getMaxPower(stack), stack);
|
|
||||||
} else if (this.getEnergy(stack) < 0) {
|
|
||||||
this.setEnergy(0, stack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double addEnergy(double energy, ItemStack stack) {
|
|
||||||
return addEnergy(energy, false, stack);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double addEnergy(double energy, boolean simulate, ItemStack stack) {
|
|
||||||
double energyReceived = Math.min(getMaxPower(stack) - energy, Math.min(this.getMaxPower(stack), energy));
|
|
||||||
|
|
||||||
if (!simulate) {
|
|
||||||
setEnergy(energy + energyReceived, stack);
|
|
||||||
}
|
|
||||||
return energyReceived;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canUseEnergy(double input, ItemStack stack) {
|
|
||||||
return input <= getEnergy(stack);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double useEnergy(double energy, ItemStack stack) {
|
|
||||||
return useEnergy(energy, false, stack);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double useEnergy(double extract, boolean simulate, ItemStack stack) {
|
|
||||||
double energyExtracted = Math.min(extract, Math.min(this.getMaxTransfer(stack), extract));
|
|
||||||
|
|
||||||
if (!simulate) {
|
|
||||||
setEnergy(getEnergy(stack) - energyExtracted, stack);
|
|
||||||
}
|
|
||||||
return energyExtracted;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canAddEnergy(double energy, ItemStack stack) {
|
|
||||||
return this.getEnergy(stack) + energy <= getMaxPower(stack);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public NBTTagCompound getOrCreateNbtData(ItemStack itemStack) {
|
|
||||||
NBTTagCompound tagCompound = itemStack.getTagCompound();
|
|
||||||
if (tagCompound == null) {
|
|
||||||
tagCompound = new NBTTagCompound();
|
|
||||||
itemStack.setTagCompound(tagCompound);
|
|
||||||
}
|
|
||||||
|
|
||||||
return tagCompound;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,42 +0,0 @@
|
||||||
package techreborn.powerSystem.traits;
|
|
||||||
|
|
||||||
|
|
||||||
import ic2.api.item.IElectricItem;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import reborncore.jtraits.JTrait;
|
|
||||||
import techreborn.api.power.IEnergyInterfaceItem;
|
|
||||||
|
|
||||||
|
|
||||||
public class EUItemPowerTrait extends JTrait<IEnergyInterfaceItem> implements IElectricItem {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean canProvideEnergy(ItemStack itemStack) {
|
|
||||||
return _self.canAcceptEnergy(itemStack);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getChargedItem(ItemStack itemStack) {
|
|
||||||
return (Item) _self;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Item getEmptyItem(ItemStack itemStack) {
|
|
||||||
return (Item) _self;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getMaxCharge(ItemStack itemStack) {
|
|
||||||
return _self.getMaxPower(itemStack);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getTier(ItemStack itemStack) {
|
|
||||||
return _self.getStackTeir(itemStack);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public double getTransferLimit(ItemStack itemStack) {
|
|
||||||
return _self.getMaxTransfer(itemStack);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,58 +0,0 @@
|
||||||
package techreborn.powerSystem.traits;
|
|
||||||
|
|
||||||
import cofh.api.energy.IEnergyContainerItem;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import reborncore.jtraits.JTrait;
|
|
||||||
import techreborn.api.power.IEnergyInterfaceItem;
|
|
||||||
import techreborn.config.ConfigTechReborn;
|
|
||||||
import techreborn.powerSystem.PowerSystem;
|
|
||||||
|
|
||||||
|
|
||||||
public class RFItemPowerTrait extends JTrait<IEnergyInterfaceItem> implements IEnergyContainerItem {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
|
||||||
if (!PowerSystem.RFPOWENET)
|
|
||||||
return 0;
|
|
||||||
if (!_self.canAcceptEnergy(container)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
maxReceive *= ConfigTechReborn.euPerRF;
|
|
||||||
int energyReceived = Math.min(getMaxEnergyStored(container) - getEnergyStored(container), Math.min((int) _self.getMaxTransfer(container) * ConfigTechReborn.euPerRF, maxReceive));
|
|
||||||
|
|
||||||
if (!simulate) {
|
|
||||||
_self.setEnergy(_self.getEnergy(container) + energyReceived, container);
|
|
||||||
}
|
|
||||||
return energyReceived / ConfigTechReborn.euPerRF;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) {
|
|
||||||
if (!PowerSystem.RFPOWENET)
|
|
||||||
return 0;
|
|
||||||
if (!_self.canAcceptEnergy(container)) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
maxExtract *= ConfigTechReborn.euPerRF;
|
|
||||||
int energyExtracted = Math.min(getEnergyStored(container), Math.min(maxExtract, maxExtract));
|
|
||||||
|
|
||||||
if (!simulate) {
|
|
||||||
_self.setEnergy(_self.getEnergy(container) - energyExtracted, container);
|
|
||||||
}
|
|
||||||
return energyExtracted / ConfigTechReborn.euPerRF;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getEnergyStored(ItemStack container) {
|
|
||||||
if (!PowerSystem.RFPOWENET)
|
|
||||||
return 0;
|
|
||||||
return ((int) _self.getEnergy(container) / ConfigTechReborn.euPerRF);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMaxEnergyStored(ItemStack container) {
|
|
||||||
if (!PowerSystem.RFPOWENET)
|
|
||||||
return 0;
|
|
||||||
return ((int) _self.getMaxPower(container) / ConfigTechReborn.euPerRF);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,11 +5,10 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import reborncore.common.misc.Functions;
|
|
||||||
import reborncore.common.util.Inventory;
|
import reborncore.common.util.Inventory;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileAesu extends TilePowerAcceptor implements IWrenchable {
|
public class TileAesu extends TilePowerAcceptor implements IWrenchable {
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.IChatComponent;
|
||||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||||
|
import reborncore.common.tile.TileMachineBase;
|
||||||
import reborncore.common.util.Inventory;
|
import reborncore.common.util.Inventory;
|
||||||
import reborncore.common.util.ItemUtils;
|
import reborncore.common.util.ItemUtils;
|
||||||
import techreborn.api.recipe.IBaseRecipeType;
|
import techreborn.api.recipe.IBaseRecipeType;
|
||||||
|
|
|
@ -13,7 +13,7 @@ import techreborn.api.recipe.RecipeCrafter;
|
||||||
import techreborn.api.upgrade.UpgradeHandler;
|
import techreborn.api.upgrade.UpgradeHandler;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.lib.Reference;
|
import techreborn.lib.Reference;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileAlloySmelter extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
public class TileAlloySmelter extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import reborncore.common.util.Inventory;
|
||||||
import techreborn.api.recipe.RecipeCrafter;
|
import techreborn.api.recipe.RecipeCrafter;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.lib.Reference;
|
import techreborn.lib.Reference;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileAssemblingMachine extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
public class TileAssemblingMachine extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package techreborn.tiles;
|
package techreborn.tiles;
|
||||||
|
|
||||||
import ic2.api.tile.IWrenchable;
|
import ic2.api.tile.IWrenchable;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.inventory.ISidedInventory;
|
import net.minecraft.inventory.ISidedInventory;
|
||||||
|
@ -14,7 +13,6 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.BlockPos;
|
import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.IChatComponent;
|
||||||
import reborncore.common.BaseTileBlock;
|
|
||||||
import reborncore.common.misc.Location;
|
import reborncore.common.misc.Location;
|
||||||
import reborncore.common.multiblock.IMultiblockPart;
|
import reborncore.common.multiblock.IMultiblockPart;
|
||||||
import reborncore.common.util.Inventory;
|
import reborncore.common.util.Inventory;
|
||||||
|
@ -24,7 +22,7 @@ import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.lib.Reference;
|
import techreborn.lib.Reference;
|
||||||
import techreborn.multiblocks.MultiBlockCasing;
|
import techreborn.multiblocks.MultiBlockCasing;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import techreborn.api.recipe.RecipeCrafter;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.lib.Reference;
|
import techreborn.lib.Reference;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
|
@ -9,9 +9,9 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.IChatComponent;
|
||||||
import reborncore.common.util.Inventory;
|
import reborncore.common.util.Inventory;
|
||||||
import techreborn.api.power.IEnergyInterfaceItem;
|
import reborncore.api.power.IEnergyInterfaceItem;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileChargeBench extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
public class TileChargeBench extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import reborncore.common.util.Inventory;
|
||||||
import techreborn.api.recipe.RecipeCrafter;
|
import techreborn.api.recipe.RecipeCrafter;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.lib.Reference;
|
import techreborn.lib.Reference;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileChemicalReactor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
public class TileChemicalReactor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.IChatComponent;
|
||||||
import reborncore.common.util.Inventory;
|
import reborncore.common.util.Inventory;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileChunkLoader extends TilePowerAcceptor implements IWrenchable, IInventory {
|
public class TileChunkLoader extends TilePowerAcceptor implements IWrenchable, IInventory {
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.IChatComponent;
|
||||||
import reborncore.api.IListInfoProvider;
|
import reborncore.api.IListInfoProvider;
|
||||||
|
import reborncore.common.tile.TileMachineBase;
|
||||||
import reborncore.common.util.Inventory;
|
import reborncore.common.util.Inventory;
|
||||||
import reborncore.common.util.ItemUtils;
|
import reborncore.common.util.ItemUtils;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
|
|
|
@ -16,7 +16,7 @@ import techreborn.api.recipe.RecipeCrafter;
|
||||||
import techreborn.blocks.BlockMachineCasing;
|
import techreborn.blocks.BlockMachineCasing;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.lib.Reference;
|
import techreborn.lib.Reference;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import reborncore.common.util.Inventory;
|
||||||
import techreborn.api.recipe.RecipeCrafter;
|
import techreborn.api.recipe.RecipeCrafter;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.lib.Reference;
|
import techreborn.lib.Reference;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileIndustrialElectrolyzer extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
public class TileIndustrialElectrolyzer extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
||||||
|
|
||||||
|
|
|
@ -11,17 +11,15 @@ import net.minecraft.util.BlockPos;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.IChatComponent;
|
||||||
import net.minecraftforge.fluids.*;
|
import net.minecraftforge.fluids.*;
|
||||||
import reborncore.common.misc.Location;
|
|
||||||
import reborncore.common.util.FluidUtils;
|
import reborncore.common.util.FluidUtils;
|
||||||
import reborncore.common.util.Inventory;
|
import reborncore.common.util.Inventory;
|
||||||
import reborncore.common.util.Tank;
|
import reborncore.common.util.Tank;
|
||||||
import techreborn.api.recipe.RecipeCrafter;
|
import techreborn.api.recipe.RecipeCrafter;
|
||||||
import techreborn.blocks.BlockMachineCasing;
|
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.init.ModFluids;
|
import techreborn.init.ModFluids;
|
||||||
import techreborn.lib.Reference;
|
import techreborn.lib.Reference;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileIndustrialGrinder extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory, ISidedInventory {
|
public class TileIndustrialGrinder extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory, ISidedInventory {
|
||||||
public static final int TANK_CAPACITY = 16000;
|
public static final int TANK_CAPACITY = 16000;
|
||||||
|
|
|
@ -21,7 +21,7 @@ import techreborn.blocks.BlockMachineCasing;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.init.ModFluids;
|
import techreborn.init.ModFluids;
|
||||||
import techreborn.lib.Reference;
|
import techreborn.lib.Reference;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory, ISidedInventory, IListInfoProvider {
|
public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory, ISidedInventory, IListInfoProvider {
|
||||||
public static final int TANK_CAPACITY = 16000;
|
public static final int TANK_CAPACITY = 16000;
|
||||||
|
|
|
@ -1,82 +0,0 @@
|
||||||
package techreborn.tiles;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.state.IBlockState;
|
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.network.NetworkManager;
|
|
||||||
import net.minecraft.network.Packet;
|
|
||||||
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.ITickable;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
import reborncore.common.packets.PacketHandler;
|
|
||||||
import techreborn.blocks.BlockMachineBase;
|
|
||||||
|
|
||||||
public class TileMachineBase extends TileEntity implements ITickable {
|
|
||||||
|
|
||||||
public void syncWithAll() {
|
|
||||||
if (!worldObj.isRemote) {
|
|
||||||
PacketHandler.sendPacketToAllPlayers(getDescriptionPacket(),
|
|
||||||
worldObj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Packet getDescriptionPacket() {
|
|
||||||
NBTTagCompound nbtTag = new NBTTagCompound();
|
|
||||||
writeToNBT(nbtTag);
|
|
||||||
return new S35PacketUpdateTileEntity(this.getPos(), 1, nbtTag);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet) {
|
|
||||||
worldObj.markBlockRangeForRenderUpdate(getPos().getX(), getPos().getY(), getPos().getZ(), getPos().getX(),
|
|
||||||
getPos().getY(), getPos().getZ());
|
|
||||||
readFromNBT(packet.getNbtCompound());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void update() {
|
|
||||||
updateEntity();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public void updateEntity() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFacingInt() {
|
|
||||||
Block block = worldObj.getBlockState(pos).getBlock();
|
|
||||||
if(block instanceof BlockMachineBase){
|
|
||||||
return ((BlockMachineBase) block).getFacing(worldObj.getBlockState(pos)).getIndex();
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public EnumFacing getFacingEnum() {
|
|
||||||
Block block = worldObj.getBlockState(pos).getBlock();
|
|
||||||
if(block instanceof BlockMachineBase){
|
|
||||||
return ((BlockMachineBase) block).getFacing(worldObj.getBlockState(pos));
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void setFacing(EnumFacing enumFacing) {
|
|
||||||
Block block = worldObj.getBlockState(pos).getBlock();
|
|
||||||
if(block instanceof BlockMachineBase){
|
|
||||||
((BlockMachineBase) block).setFacing(enumFacing, worldObj, pos);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//This stops the tile from getting cleared when the state is updated(rotation and on/off)
|
|
||||||
@Override
|
|
||||||
public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate) {
|
|
||||||
if(oldState.getBlock() != newSate.getBlock()){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -13,7 +13,7 @@ import reborncore.common.util.Inventory;
|
||||||
import reborncore.common.util.ItemUtils;
|
import reborncore.common.util.ItemUtils;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.init.ModItems;
|
import techreborn.init.ModItems;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,8 @@ package techreborn.tiles;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
import techreborn.blocks.BlockMachineBase;
|
import reborncore.common.blocks.BlockMachineBase;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import net.minecraft.util.EnumFacing;
|
||||||
import net.minecraft.util.IChatComponent;
|
import net.minecraft.util.IChatComponent;
|
||||||
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
|
import powercrystals.minefactoryreloaded.api.IDeepStorageUnit;
|
||||||
import reborncore.api.IListInfoProvider;
|
import reborncore.api.IListInfoProvider;
|
||||||
|
import reborncore.common.tile.TileMachineBase;
|
||||||
import reborncore.common.util.Inventory;
|
import reborncore.common.util.Inventory;
|
||||||
import reborncore.common.util.ItemUtils;
|
import reborncore.common.util.ItemUtils;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
|
|
|
@ -15,6 +15,7 @@ import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.FluidTankInfo;
|
import net.minecraftforge.fluids.FluidTankInfo;
|
||||||
import net.minecraftforge.fluids.IFluidHandler;
|
import net.minecraftforge.fluids.IFluidHandler;
|
||||||
import reborncore.api.IListInfoProvider;
|
import reborncore.api.IListInfoProvider;
|
||||||
|
import reborncore.common.tile.TileMachineBase;
|
||||||
import reborncore.common.util.FluidUtils;
|
import reborncore.common.util.FluidUtils;
|
||||||
import reborncore.common.util.Inventory;
|
import reborncore.common.util.Inventory;
|
||||||
import reborncore.common.util.Tank;
|
import reborncore.common.util.Tank;
|
||||||
|
|
|
@ -13,7 +13,7 @@ import reborncore.common.util.Inventory;
|
||||||
import reborncore.common.util.ItemUtils;
|
import reborncore.common.util.ItemUtils;
|
||||||
import techreborn.api.RollingMachineRecipe;
|
import techreborn.api.RollingMachineRecipe;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
//TODO add tick and power bars.
|
//TODO add tick and power bars.
|
||||||
public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable, IInventory {
|
public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable, IInventory {
|
||||||
|
|
|
@ -18,7 +18,7 @@ import reborncore.common.util.Inventory;
|
||||||
import reborncore.common.util.Tank;
|
import reborncore.common.util.Tank;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchable,
|
public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchable,
|
||||||
IFluidHandler, IInventory {
|
IFluidHandler, IInventory {
|
||||||
|
|
|
@ -14,7 +14,7 @@ import techreborn.api.recipe.RecipeCrafter;
|
||||||
import techreborn.blocks.BlockMachineCasing;
|
import techreborn.blocks.BlockMachineCasing;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.lib.Reference;
|
import techreborn.lib.Reference;
|
||||||
import techreborn.powerSystem.TilePowerAcceptor;
|
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||||
|
|
||||||
public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable, IInventory {
|
public class TileVacuumFreezer extends TilePowerAcceptor implements IWrenchable, IInventory {
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue