Added energy orb stuff
This commit is contained in:
parent
d62e0d07ab
commit
0c5beb60b9
16 changed files with 256 additions and 18 deletions
|
|
@ -15,32 +15,34 @@ import net.minecraftforge.common.MinecraftForge;
|
|||
|
||||
public class BlockHandler {
|
||||
|
||||
public static Block OreImbuedStone;
|
||||
public static Block oreImbuedStone;
|
||||
public static Block bush;
|
||||
public static Block lightCube;
|
||||
|
||||
public static void init() {
|
||||
|
||||
OreImbuedStone = new BlockImbuedStone(BlockIds.ORE_STONE_1).setUnlocalizedName(Strings.IMBUED_STONE_NAME);
|
||||
oreImbuedStone = new BlockImbuedStone(BlockIds.ORE_STONE_1).setUnlocalizedName(Strings.IMBUED_STONE_NAME);
|
||||
bush = new BlockBush(BlockIds.BUSH).setUnlocalizedName(Strings.BUSH_NAME);
|
||||
lightCube = new BlockLightCube(BlockIds.LIGHT_CUBE).setUnlocalizedName(Strings.LIGHT_CUBE_NAME);
|
||||
|
||||
registerBlocks();
|
||||
setBlockHarvestLevels();
|
||||
}
|
||||
|
||||
private static void registerBlocks() {
|
||||
GameRegistry.registerBlock(OreImbuedStone, ItemBlockImbuedStone.class, Strings.IMBUED_STONE_NAME);
|
||||
GameRegistry.registerBlock(oreImbuedStone, ItemBlockImbuedStone.class, Strings.IMBUED_STONE_NAME);
|
||||
GameRegistry.registerBlock(bush, ItemBlockBush.class, Strings.BUSH_NAME);
|
||||
GameRegistry.registerBlock(lightCube, Strings.LIGHT_CUBE_NAME);
|
||||
|
||||
GameRegistry.registerWorldGenerator(new WorldGenBushes());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenStones());
|
||||
|
||||
}
|
||||
|
||||
private static void setBlockHarvestLevels() {
|
||||
MinecraftForge.setBlockHarvestLevel(OreImbuedStone, 0, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(OreImbuedStone, 1, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(OreImbuedStone, 2, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(OreImbuedStone, 3, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(OreImbuedStone, 4, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(oreImbuedStone, 0, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(oreImbuedStone, 1, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(oreImbuedStone, 2, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(oreImbuedStone, 3, "pickaxe", 2);
|
||||
MinecraftForge.setBlockHarvestLevel(oreImbuedStone, 4, "pickaxe", 2);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
62
common/MysticWorld/Blocks/BlockLightCube.java
Normal file
62
common/MysticWorld/Blocks/BlockLightCube.java
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
package MysticWorld.Blocks;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import MysticWorld.MysticWorld;
|
||||
import MysticWorld.Items.ItemHandler$1;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockLightCube extends Block {
|
||||
|
||||
public BlockLightCube(int id) {
|
||||
super(id, Material.circuits);
|
||||
setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
||||
setLightValue(1.0F);
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random par2Random, int par3)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void randomDisplayTick(World world, int x, int y, int z, Random random)
|
||||
{
|
||||
MysticWorld.proxy.lightCubeFX(world, (double)x + random.nextDouble(), (double)y + 0.75D, (double)z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
||||
MysticWorld.proxy.lightCubeFX(world, (double)x + random.nextDouble(), (double)y + 0.75D, (double)z + random.nextDouble(), 0.0D, 0.0D, 0.0D, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister iconRegister)
|
||||
{
|
||||
this.blockIcon = iconRegister.registerIcon("MysticTextures" + ":" + "lightCube");
|
||||
}
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@ public class ItemBlockImbuedStone extends ItemBlock {
|
|||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int par1)
|
||||
{
|
||||
return BlockHandler.OreImbuedStone.getIcon(2, par1);
|
||||
return BlockHandler.oreImbuedStone.getIcon(2, par1);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue