This commit is contained in:
Modmuss50 2015-11-16 11:17:36 +00:00
parent 25b5715ab8
commit 19d269b1de
24 changed files with 38 additions and 34 deletions

View file

@ -204,10 +204,10 @@ public class BlockMachineBase extends BlockContainer {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ) {
if(super.onBlockActivated(world, x, y, z, entityplayer, side, hitX, hitY, hitZ)){
if(fillBlockWithFluid(world, x, y, z, entityplayer, side, hitX, hitY, hitZ)){
return true;
}
return fillBlockWithFluid(world, x, y, z, entityplayer, side, hitX, hitY, hitZ);
return super.onBlockActivated(world, x, y, z, entityplayer, side, hitX, hitY, hitZ);
}
public boolean fillBlockWithFluid(World world, int x, int y, int z, EntityPlayer entityplayer, int side, float hitX, float hitY, float hitZ) {

View file

@ -32,6 +32,9 @@ public class BlockQuantumTank extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.quantumTankID, world, x, y, z);
return true;

View file

@ -46,6 +46,9 @@ public class BlockDieselGenerator extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.dieselGeneratorID, world, x, y,
z);

View file

@ -37,6 +37,9 @@ public class BlockGasTurbine extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.gasTurbineID, world, x, y,
z);

View file

@ -37,6 +37,9 @@ public class BlockSemiFluidGenerator extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.semifluidGeneratorID, world, x, y,
z);

View file

@ -37,6 +37,9 @@ public class BlockThermalGenerator extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.thermalGeneratorID, world, x, y,
z);

View file

@ -44,6 +44,9 @@ public class BlockGrinder extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.grinderID, world, x, y,
z);

View file

@ -41,6 +41,9 @@ public class BlockIndustrialSawmill extends BlockMachineBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(fillBlockWithFluid(world, x, y, z, player, side, hitX, hitY, hitZ)){
return true;
}
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.sawMillID, world, x, y,
z);

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.tile.IWrenchable;
@ -11,14 +10,13 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection;
import reborncore.common.util.Inventory;
import techreborn.api.power.IEnergyInterfaceItem;
import techreborn.api.recipe.RecipeCrafter;
import techreborn.api.upgrade.UpgradeHandler;
import techreborn.init.ModBlocks;
import techreborn.lib.Reference;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileAlloySmelter extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
public class TileAlloySmelter extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
public int tickTime;
public Inventory inventory = new Inventory(8, "TileAlloySmelter", 64);

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.tile.IWrenchable;
@ -16,7 +15,7 @@ import techreborn.init.ModBlocks;
import techreborn.lib.Reference;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileAssemblingMachine extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
public class TileAssemblingMachine extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
public int tickTime;
public Inventory inventory = new Inventory(8, "TileAssemblingMachine", 64);

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@ -23,7 +22,7 @@ import techreborn.lib.Reference;
import techreborn.multiblocks.MultiBlockCasing;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable, IInventory, IEnergyTile, ISidedInventory {
public class TileBlastFurnace extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
public int tickTime;
public Inventory inventory = new Inventory(4, "TileBlastFurnace", 64);

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.tile.IWrenchable;
@ -20,7 +19,7 @@ import techreborn.powerSystem.TilePowerAcceptor;
import java.util.List;
public class TileCentrifuge extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory, ISidedInventory, IListInfoProvider {
public class TileCentrifuge extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory, IListInfoProvider {
public int tickTime;
public Inventory inventory = new Inventory(11, "TileCentrifuge", 64);

View file

@ -12,7 +12,6 @@ import net.minecraftforge.common.util.ForgeDirection;
import reborncore.common.util.Inventory;
import techreborn.api.power.IEnergyInterfaceItem;
import techreborn.init.ModBlocks;
import techreborn.powerSystem.PoweredItem;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileChargeBench extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.tile.IWrenchable;
@ -16,7 +15,7 @@ import techreborn.init.ModBlocks;
import techreborn.lib.Reference;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileChemicalReactor extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
public class TileChemicalReactor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
public int tickTime;
public Inventory inventory = new Inventory(8, "TileChemicalReactor", 64);

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@ -10,7 +9,7 @@ import reborncore.common.util.Inventory;
import techreborn.init.ModBlocks;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileChunkLoader extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory {
public class TileChunkLoader extends TilePowerAcceptor implements IWrenchable, IInventory {
public Inventory inventory = new Inventory(1, "TileChunkLoader", 64);

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@ -20,7 +19,7 @@ import techreborn.init.ModBlocks;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileDieselGenerator extends TilePowerAcceptor implements IWrenchable,
IFluidHandler, IInventory, IEnergyTile {
IFluidHandler, IInventory {
public Tank tank = new Tank("TileDieselGenerator",
FluidContainerRegistry.BUCKET_VOLUME * 10, this);

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@ -22,7 +21,7 @@ import techreborn.init.ModFluids;
import techreborn.lib.Reference;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IFluidHandler, IInventory, ISidedInventory {
public class TileGrinder extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory, ISidedInventory {
public int tickTime;
public Inventory inventory = new Inventory(6, "TileGrinder", 64);

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@ -10,7 +9,7 @@ import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileHeatGenerator extends TilePowerAcceptor implements IWrenchable, IEnergyTile {
public class TileHeatGenerator extends TilePowerAcceptor implements IWrenchable {
public static final int euTick = ConfigTechReborn.heatGeneratorOutput;

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@ -17,7 +16,7 @@ import techreborn.init.ModBlocks;
import techreborn.lib.Reference;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
public class TileImplosionCompressor extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
public int tickTime;
public Inventory inventory = new Inventory(4, "TileImplosionCompressor", 64);

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.tile.IWrenchable;
@ -16,7 +15,7 @@ import techreborn.init.ModBlocks;
import techreborn.lib.Reference;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileIndustrialElectrolyzer extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
public class TileIndustrialElectrolyzer extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
public int tickTime;
public Inventory inventory = new Inventory(8, "TileIndustrialElectrolyzer", 64);

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@ -22,7 +21,7 @@ import techreborn.init.ModFluids;
import techreborn.lib.Reference;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IFluidHandler, IInventory, ISidedInventory, IListInfoProvider {
public class TileIndustrialSawmill extends TilePowerAcceptor implements IWrenchable, IFluidHandler, IInventory, ISidedInventory, IListInfoProvider {
public int tickTime;
public Inventory inventory = new Inventory(5, "TileIndustrialSawmill", 64);

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.recipe.RecipeOutput;
import ic2.api.recipe.Recipes;
import ic2.api.tile.IWrenchable;
@ -16,7 +15,7 @@ import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory, ISidedInventory {
public class TileMatterFabricator extends TilePowerAcceptor implements IWrenchable, IInventory, ISidedInventory {
public static int fabricationRate = 2666656;
public int tickTime;

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import ic2.api.tile.IWrenchable;
@ -18,7 +17,7 @@ import techreborn.init.ModBlocks;
import techreborn.powerSystem.TilePowerAcceptor;
//TODO add tick and power bars.
public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable, IEnergyTile, IInventory {
public class TileRollingMachine extends TilePowerAcceptor implements IWrenchable, IInventory {
public Inventory inventory = new Inventory(3, "TileRollingMachine", 64);
public final InventoryCrafting craftMatrix = new InventoryCrafting(

View file

@ -1,6 +1,5 @@
package techreborn.tiles;
import ic2.api.energy.tile.IEnergyTile;
import ic2.api.tile.IWrenchable;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
@ -20,7 +19,7 @@ import techreborn.init.ModBlocks;
import techreborn.powerSystem.TilePowerAcceptor;
public class TileThermalGenerator extends TilePowerAcceptor implements IWrenchable,
IFluidHandler, IInventory, IEnergyTile {
IFluidHandler, IInventory {
public Tank tank = new Tank("TileThermalGenerator",
FluidContainerRegistry.BUCKET_VOLUME * 10, this);