Worked on Soul Forge GUI and container. GUI texture is VERY WIP and the slot locations as well as the progress par will change. Don't work on it >:3
This commit is contained in:
parent
8b024e1703
commit
fec2236114
8 changed files with 232 additions and 6 deletions
|
@ -1,11 +1,20 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.InventoryHelper;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.tile.TileSoulForge;
|
||||
import WayofTime.bloodmagic.tile.TileTeleposer;
|
||||
|
||||
public class BlockSoulForge extends Block
|
||||
public class BlockSoulForge extends BlockContainer
|
||||
{
|
||||
public BlockSoulForge()
|
||||
{
|
||||
|
@ -15,7 +24,7 @@ public class BlockSoulForge extends Block
|
|||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setStepSound(soundTypeMetal);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
setHarvestLevel("pickaxe", 1);
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
}
|
||||
|
||||
|
@ -42,4 +51,32 @@ public class BlockSoulForge extends Block
|
|||
{
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (world.getTileEntity(pos) instanceof TileSoulForge)
|
||||
{
|
||||
player.openGui(BloodMagic.instance, Constants.Gui.SOUL_FORGE_GUI, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World worldIn, BlockPos pos, IBlockState state)
|
||||
{
|
||||
if (worldIn.getTileEntity(pos) != null && worldIn.getTileEntity(pos) instanceof TileTeleposer)
|
||||
{
|
||||
InventoryHelper.dropInventoryItems(worldIn, pos, (TileTeleposer) worldIn.getTileEntity(pos));
|
||||
}
|
||||
|
||||
super.breakBlock(worldIn, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World worldIn, int meta)
|
||||
{
|
||||
return new TileSoulForge();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue