summaryrefslogtreecommitdiff
path: root/ihl/worldgen/ores/DebugScannerBlock.java
diff options
context:
space:
mode:
Diffstat (limited to 'ihl/worldgen/ores/DebugScannerBlock.java')
-rw-r--r--ihl/worldgen/ores/DebugScannerBlock.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/ihl/worldgen/ores/DebugScannerBlock.java b/ihl/worldgen/ores/DebugScannerBlock.java
new file mode 100644
index 0000000..a934f60
--- /dev/null
+++ b/ihl/worldgen/ores/DebugScannerBlock.java
@@ -0,0 +1,46 @@
+package ihl.worldgen.ores;
+
+import ihl.IHLCreativeTab;
+import net.minecraft.block.Block;
+import net.minecraft.block.ITileEntityProvider;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+
+public class DebugScannerBlock extends Block implements ITileEntityProvider{
+
+ public DebugScannerBlock(Material material)
+ {
+ super(material);
+ this.setCreativeTab(IHLCreativeTab.tab);
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int var2) {
+ return new DebugScannerTileEntity();
+ }
+
+ @Override
+ public boolean hasTileEntity(int metadata)
+ {
+ return true;
+ }
+
+ @Override
+ public boolean onBlockActivated(World world,int x,int y,int z,EntityPlayer entityPlayer,int i,float pos_x,float pos_y,float pos_z){
+ TileEntity te = world.getTileEntity(x,y,z);
+ if(te instanceof DebugScannerTileEntity)
+ {
+ DebugScannerTileEntity bte = (DebugScannerTileEntity)te;
+ if (bte == null || entityPlayer.isSneaking()) {
+ return false;
+ }
+ else
+ {
+ return bte.getGui(entityPlayer);
+ }
+ }
+ return false;
+ }
+}