Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fr.kiwiofficiel.sumaria.common;
- import net.minecraft.world.gen.feature.WorldGenMinable;
- import net.minecraft.world.World;
- import net.minecraft.world.IBlockAccess;
- import net.minecraft.util.MathHelper;
- import net.minecraft.util.IIcon;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.Item;
- import net.minecraft.init.Items;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.client.renderer.texture.IIconRegister;
- import net.minecraft.client.Minecraft;
- import net.minecraft.block.material.Material;
- import net.minecraft.block.Block;
- import java.util.Random;
- import cpw.mods.fml.relauncher.SideOnly;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.common.registry.GameRegistry;
- import cpw.mods.fml.common.event.FMLServerStartingEvent;
- import cpw.mods.fml.common.event.FMLPreInitializationEvent;
- public class adamine_ore {
- public adamine_ore() {}
- public static final String MODID = "sumariamod";
- public static Blockadamine_ore block;
- public static Object instance;
- public int addFuel(ItemStack fuel) {
- return 0;
- }
- public void serverLoad(FMLServerStartingEvent event) {
- }
- public void preInit(FMLPreInitializationEvent event) {
- GameRegistry.registerBlock(block, "adamine_ore");
- }
- public void registerRenderers() {
- }
- public void load() {
- }
- static {
- block = (Blockadamine_ore) (new Blockadamine_ore().setHardness(6.0F).setResistance(15.0F).setLightLevel(0.0F)
- .setBlockName("adamine_ore").setLightOpacity(0).setStepSound(Block.soundTypeStone).setCreativeTab(sumariatabs.tab))
- .setBlockTextureName(MODID + ":adamine_ore");
- block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
- Block.blockRegistry.addObject(700, "adamine_ore", block);
- block.setHarvestLevel("pickaxe", 0);
- }
- public void generateSurface(World world, java.util.Random rand, int chunkX, int chunkZ) {
- for (int i = 0; i < 5; i++) {
- int randPosX = chunkX + rand.nextInt(16);
- int randPosY = rand.nextInt(12) + 0;
- int randPosZ = chunkZ + rand.nextInt(16);
- (new WorldGenMinable(adamine_ore.block, 4)).generate(world, rand, randPosX, randPosY, randPosZ);
- }
- }
- public void generateNether(World world, Random random, int chunkX, int chunkZ) {
- }
- static class Blockadamine_ore extends Block {
- int a1 = 0, a2 = 0, a3 = 0, a4 = 0, a5 = 0, a6 = 0;
- Random field_149942_b = new Random();
- IIcon gor = null, dol = null, st1 = null, st2 = null, st3 = null, st4 = null;
- boolean red = false;
- public Blockadamine_ore() {
- super(Material.rock);
- }
- public void onBlockAdded(World world, int i, int j, int k) {
- EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
- if (entity != null && world != null) {
- int le = MathHelper.floor_double((double) (entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
- world.setBlockMetadataWithNotify(i, j, k, le, 2);
- }
- world.scheduleBlockUpdate(i, j, k, this, this.tickRate(world));
- }
- public int isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
- return red ? 1 : 0;
- }
- @SideOnly(Side.CLIENT)
- @Override
- public IIcon getIcon(int i, int par2) {
- if (i == 0)
- return gor;
- else if (i == 1)
- return dol;
- else if (i == 2)
- return st1;
- else if (i == 3)
- return st2;
- else if (i == 4)
- return st4;
- else if (i == 5)
- return st3;
- else
- return gor;
- }
- @SideOnly(Side.CLIENT)
- @Override
- public void registerBlockIcons(IIconRegister reg) {
- this.gor = reg.registerIcon("adamine_ore");
- this.dol = reg.registerIcon("adamine_ore");
- this.st1 = reg.registerIcon("adamine_ore");
- this.st2 = reg.registerIcon("adamine_ore");
- this.st3 = reg.registerIcon("adamine_ore");
- this.st4 = reg.registerIcon("adamine_ore");
- }
- public int getRenderType() {
- return 0;
- }
- @Override
- public int tickRate(World world) {
- return 12;
- }
- public int quantityDropped(Random par1Random) {
- return 1;
- }
- public Item getItemDropped(int par1, Random par2Random, int par3) {
- return adamine.block;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement