Added batBox, gui to come later
This commit is contained in:
parent
ec67e9650d
commit
5480a5c3e5
3 changed files with 145 additions and 4 deletions
src/main/java/techreborn
57
src/main/java/techreborn/blocks/storage/BlockBatBox.java
Normal file
57
src/main/java/techreborn/blocks/storage/BlockBatBox.java
Normal file
|
@ -0,0 +1,57 @@
|
|||
package techreborn.blocks.storage;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import reborncore.common.blocks.BlockMachineBase;
|
||||
import reborncore.common.blocks.IRotationTexture;
|
||||
import techreborn.Core;
|
||||
import techreborn.client.GuiHandler;
|
||||
import techreborn.client.TechRebornCreativeTab;
|
||||
import techreborn.tiles.storage.TileBatBox;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 14/03/2016.
|
||||
*/
|
||||
public class BlockBatBox extends BlockMachineBase implements IRotationTexture {
|
||||
|
||||
public BlockBatBox() {
|
||||
super();
|
||||
setUnlocalizedName("techreborn.batBox");
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
|
||||
return new TileBatBox();
|
||||
}
|
||||
|
||||
private final String prefix = "techreborn:blocks/machine/storage/";
|
||||
|
||||
@Override
|
||||
public String getFrontOff() {
|
||||
return prefix + "batbox_front";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFrontOn() {
|
||||
return prefix + "batbox_front";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSide() {
|
||||
return prefix + "batbox_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTop() {
|
||||
return prefix + "batbox_side";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBottom() {
|
||||
return prefix + "batbox_side";
|
||||
}
|
||||
|
||||
}
|
|
@ -27,10 +27,7 @@ import techreborn.blocks.generator.BlockWindMill;
|
|||
import techreborn.blocks.iron_machines.BlockAlloyFurnace;
|
||||
import techreborn.blocks.iron_machines.BlockIronFurnace;
|
||||
import techreborn.blocks.machine.*;
|
||||
import techreborn.blocks.storage.BlockAESU;
|
||||
import techreborn.blocks.storage.BlockIDSU;
|
||||
import techreborn.blocks.storage.BlockLESU;
|
||||
import techreborn.blocks.storage.BlockLESUStorage;
|
||||
import techreborn.blocks.storage.*;
|
||||
import techreborn.blocks.tier1.*;
|
||||
import techreborn.itemblocks.ItemBlockAesu;
|
||||
import techreborn.itemblocks.ItemBlockDigitalChest;
|
||||
|
@ -80,6 +77,7 @@ import techreborn.tiles.generator.TileWindMill;
|
|||
import techreborn.tiles.idsu.TileIDSU;
|
||||
import techreborn.tiles.lesu.TileLesu;
|
||||
import techreborn.tiles.lesu.TileLesuStorage;
|
||||
import techreborn.tiles.storage.TileBatBox;
|
||||
import techreborn.tiles.teir1.TileCompressor;
|
||||
import techreborn.tiles.teir1.TileElectricFurnace;
|
||||
import techreborn.tiles.teir1.TileExtractor;
|
||||
|
@ -138,6 +136,7 @@ public class ModBlocks {
|
|||
public static Block waterMill;
|
||||
public static Block windMill;
|
||||
public static Block recycler;
|
||||
public static Block batBox;
|
||||
|
||||
public static BlockOre ore;
|
||||
public static BlockOre2 ore2;
|
||||
|
@ -380,6 +379,10 @@ public class ModBlocks {
|
|||
recycler = new BlockRecycler(Material.iron);
|
||||
GameRegistry.registerBlock(recycler, "recycler");
|
||||
GameRegistry.registerTileEntity(TileRecycler.class, "TileRecyclerTR");
|
||||
|
||||
batBox = new BlockBatBox();
|
||||
GameRegistry.registerBlock(batBox, "batBox");
|
||||
GameRegistry.registerTileEntity(TileBatBox.class, "TileBatBox");
|
||||
|
||||
ironFurnace = new BlockIronFurnace();
|
||||
GameRegistry.registerBlock(ironFurnace, "ironfurnace");
|
||||
|
|
81
src/main/java/techreborn/tiles/storage/TileBatBox.java
Normal file
81
src/main/java/techreborn/tiles/storage/TileBatBox.java
Normal file
|
@ -0,0 +1,81 @@
|
|||
package techreborn.tiles.storage;
|
||||
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 14/03/2016.
|
||||
*/
|
||||
public class TileBatBox extends TilePowerAcceptor implements IWrenchable {
|
||||
|
||||
public TileBatBox() {
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, EnumFacing side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing getFacing() {
|
||||
return getFacingEnum();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wrenchCanRemove(EntityPlayer entityPlayer) {
|
||||
if (entityPlayer.isSneaking()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getWrenchDropRate() {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer) {
|
||||
return new ItemStack(ModBlocks.batBox);
|
||||
}
|
||||
|
||||
public boolean isComplete() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxPower() {
|
||||
return 40000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAcceptEnergy(EnumFacing direction) {
|
||||
return getFacingEnum() != direction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideEnergy(EnumFacing direction) {
|
||||
return getFacingEnum() == direction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxOutput() {
|
||||
return 32;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxInput() {
|
||||
return 32;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPowerTier getTier() {
|
||||
return EnumPowerTier.LOW;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue