Updated for 1.7.2
This commit is contained in:
parent
cc178e1a3b
commit
29228e18fe
105 changed files with 1939 additions and 2690 deletions
|
|
@ -7,25 +7,30 @@ import mysticores.MysticOres;
|
|||
import mysticores.items.Items;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockBase extends Block {
|
||||
Icon[] textures;
|
||||
IIcon[] textures;
|
||||
|
||||
public BlockBase(int ID) {
|
||||
super(ID, Material.rock);
|
||||
setCreativeTab(MysticOres.MysticOresTab);
|
||||
public BlockBase() {
|
||||
super(Material.rock);
|
||||
setCreativeTab(MysticOres.MysticOresTab);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
setHarvestLevel("pickaxe", 3, 0);
|
||||
setHarvestLevel("pickaxe", 3, 2);
|
||||
setHarvestLevel("pickaxe", 1, 6);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -74,7 +79,7 @@ public class BlockBase extends Block {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIcon(int side, int meta) {
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return textures[meta];
|
||||
}
|
||||
|
||||
|
|
@ -95,14 +100,14 @@ public class BlockBase extends Block {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(int i, CreativeTabs tab, List list) {
|
||||
for (int meta = 0; meta < ItemBase.BLOCK_NAMES.length; meta++) {
|
||||
public void getSubBlocks(Item i, CreativeTabs tab, List list) {
|
||||
for (int meta = 0; meta < BlockHandler.BLOCK_NAMES.size(); meta++) {
|
||||
list.add(new ItemStack(i, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int par1, Random random, int par3) {
|
||||
public Item getItemDropped(int par1, Random random, int par3) {
|
||||
switch (par1) {
|
||||
case 1:
|
||||
case 2:
|
||||
|
|
@ -111,7 +116,7 @@ public class BlockBase extends Block {
|
|||
case 7:
|
||||
case 11:
|
||||
case 12:
|
||||
return Items.Resource.itemID;
|
||||
return Items.Resource;
|
||||
case 8:
|
||||
return BlackSoulstoneDrops(par1, random, par3);
|
||||
case 9:
|
||||
|
|
@ -119,17 +124,12 @@ public class BlockBase extends Block {
|
|||
case 10:
|
||||
return RedSoulstoneDrops(par1, random, par3);
|
||||
default:
|
||||
return blockID;
|
||||
return super.getItemDropped(par1, random, par3);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idPicked(World world, int x, int y, int z) {
|
||||
return this.blockID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side) {
|
||||
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta == 12)
|
||||
return false;
|
||||
|
|
@ -138,9 +138,9 @@ public class BlockBase extends Block {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
public boolean isOpaqueCube(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(int meta, int fortune, Random random) {
|
||||
|
|
@ -164,79 +164,73 @@ public class BlockBase extends Block {
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister register) {
|
||||
textures = new Icon[16];
|
||||
for (int i = 0; i < ItemBase.BLOCK_NAMES.length; i++) {
|
||||
textures[i] = register.registerIcon("mysticores:" + ItemBase.BLOCK_NAMES[i]);
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
textures = new IIcon[16];
|
||||
for (int i = 0; i < BlockHandler.BLOCK_NAMES.size(); i++) {
|
||||
textures[i] = register.registerIcon("mysticores:" + BlockHandler.BLOCK_NAMES.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
public boolean renderAsNormalBlock(){
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int par) {
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
int blockID = world.getBlockId(x, y, z);
|
||||
if (meta == 12 && blockID == this.blockID)
|
||||
Block blockID = world.getBlock(x, y, z);
|
||||
if (meta == 12 && blockID == this)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canSilkHarvest() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static int BlackSoulstoneDrops(int par1, Random random, int par3) {
|
||||
public static Item BlackSoulstoneDrops(int par1, Random random, int par3) {
|
||||
int rand = random.nextInt(2);
|
||||
switch (rand) {
|
||||
case 0:
|
||||
return Item.coal.itemID;
|
||||
return net.minecraft.init.Items.coal;
|
||||
case 1:
|
||||
return Item.gunpowder.itemID;
|
||||
return net.minecraft.init.Items.gunpowder;
|
||||
default:
|
||||
return Item.sugar.itemID;
|
||||
return net.minecraft.init.Items.sugar;
|
||||
}
|
||||
}
|
||||
|
||||
public static int BlueSoulstoneDrops(int par1, Random random, int par3) {
|
||||
public static Item BlueSoulstoneDrops(int par1, Random random, int par3) {
|
||||
int rand = random.nextInt(5);
|
||||
switch (rand) {
|
||||
case 0:
|
||||
return Item.diamond.itemID;
|
||||
return net.minecraft.init.Items.diamond;
|
||||
case 1:
|
||||
return Block.obsidian.blockID;
|
||||
return Item.getItemFromBlock(Blocks.obsidian);
|
||||
case 2:
|
||||
return Item.gunpowder.itemID;
|
||||
return net.minecraft.init.Items.gunpowder;
|
||||
case 3:
|
||||
return Item.glowstone.itemID;
|
||||
return net.minecraft.init.Items.glowstone_dust;
|
||||
case 4:
|
||||
return Item.blazeRod.itemID;
|
||||
return net.minecraft.init.Items.blaze_rod;
|
||||
case 5:
|
||||
return Item.emerald.itemID;
|
||||
default:
|
||||
return Item.emerald.itemID;
|
||||
return net.minecraft.init.Items.emerald;
|
||||
}
|
||||
}
|
||||
|
||||
public static int RedSoulstoneDrops(int par1, Random random, int par3) {
|
||||
public static Item RedSoulstoneDrops(int par1, Random random, int par3) {
|
||||
int rand = random.nextInt(4);
|
||||
switch (rand) {
|
||||
case 0:
|
||||
return Item.glowstone.itemID;
|
||||
return net.minecraft.init.Items.glowstone_dust;
|
||||
case 1:
|
||||
return Item.gunpowder.itemID;
|
||||
return net.minecraft.init.Items.gunpowder;
|
||||
case 2:
|
||||
return Item.redstone.itemID;
|
||||
return net.minecraft.init.Items.redstone;
|
||||
case 3:
|
||||
return Block.obsidian.blockID;
|
||||
return Item.getItemFromBlock(Blocks.obsidian);
|
||||
default:
|
||||
return Item.blazePowder.itemID;
|
||||
return net.minecraft.init.Items.blaze_powder;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue