TechReborn/src/main/java/techreborn/blocks/BlockChunkLoader.java

33 lines
988 B
Java
Raw Normal View History

package techreborn.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import techreborn.Core;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileChunkLoader;
public class BlockChunkLoader extends BlockMachineBase {
public BlockChunkLoader(Material material) {
super(material);
2015-11-23 20:19:18 +01:00
setUnlocalizedName("techreborn.chunkloader");
}
@Override
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
return new TileChunkLoader();
}
2015-05-03 23:27:19 +02:00
@Override
public boolean onBlockActivated(World world, int x, int y, int z,
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if (!player.isSneaking())
player.openGui(Core.INSTANCE, GuiHandler.chunkloaderID, world, x, y,
z);
return true;
}
}