38 lines
1.0 KiB
Java
38 lines
1.0 KiB
Java
package storagecraft.block;
|
|
|
|
import net.minecraft.block.state.IBlockState;
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
import net.minecraft.item.ItemStack;
|
|
import net.minecraft.tileentity.TileEntity;
|
|
import net.minecraft.util.EnumFacing;
|
|
import net.minecraft.util.EnumHand;
|
|
import net.minecraft.world.World;
|
|
import storagecraft.StorageCraft;
|
|
import storagecraft.StorageCraftGUI;
|
|
import storagecraft.tile.TileExternalStorage;
|
|
|
|
public class BlockExternalStorage extends BlockMachine
|
|
{
|
|
public BlockExternalStorage()
|
|
{
|
|
super("external_storage");
|
|
}
|
|
|
|
@Override
|
|
public TileEntity createTileEntity(World world, IBlockState state)
|
|
{
|
|
return new TileExternalStorage();
|
|
}
|
|
|
|
@Override
|
|
public boolean onBlockActivated(World world, net.minecraft.util.math.BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
|
{
|
|
if (!world.isRemote)
|
|
{
|
|
player.openGui(StorageCraft.INSTANCE, StorageCraftGUI.STORAGE, world, pos.getX(), pos.getY(), pos.getZ());
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|