importer block
This commit is contained in:
28
src/main/java/storagecraft/block/BlockImporter.java
Normal file
28
src/main/java/storagecraft/block/BlockImporter.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package storagecraft.block;
|
||||
|
||||
import net.minecraft.block.ITileEntityProvider;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import storagecraft.SC;
|
||||
import storagecraft.tile.TileImporter;
|
||||
|
||||
public class BlockImporter extends BlockSC implements ITileEntityProvider {
|
||||
public BlockImporter() {
|
||||
super("importer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileImporter();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if (!world.isRemote) {
|
||||
player.openGui(SC.INSTANCE, SC.GUI.IMPORTER, world, x, y, z);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import storagecraft.SC;
|
||||
import storagecraft.tile.TileSC;
|
||||
import storagecraft.util.InventoryUtil;
|
||||
import storagecraft.util.InventoryUtils;
|
||||
|
||||
public class BlockSC extends Block {
|
||||
private String name;
|
||||
@@ -46,7 +46,7 @@ public class BlockSC extends Block {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
if (tile instanceof IInventory) {
|
||||
InventoryUtil.dropInventory(world, (IInventory) tile, x, y, z, 0);
|
||||
InventoryUtils.dropInventory(world, (IInventory) tile, x, y, z);
|
||||
}
|
||||
|
||||
super.onBlockPreDestroy(world, x, y, z, meta);
|
||||
|
||||
Reference in New Issue
Block a user