Cleanup
Renders for Runes Creative crystal renders Formatting Lang additions Some attempted (not successful) fixes for SoulNetwork
This commit is contained in:
parent
ac588d0b15
commit
ac5402df6b
36 changed files with 400 additions and 220 deletions
|
@ -1,102 +1,73 @@
|
|||
package WayofTime.bloodmagic.block;
|
||||
|
||||
import WayofTime.bloodmagic.registry.ModBlocks;
|
||||
import WayofTime.bloodmagic.BloodMagic;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.block.state.BlockState;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockPos;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockBloodRune extends Block
|
||||
{
|
||||
public static final String[] names = { "speed", "efficiency", "sacrifice", "self_sacrifice", "displacement", "capacity", "orb_capacity", "better_capacity", "acceleration" };
|
||||
public static final PropertyInteger INTEGER = PropertyInteger.create("rune", 0, 5);
|
||||
public class BlockBloodRune extends Block {
|
||||
|
||||
public BlockBloodRune()
|
||||
{
|
||||
public static final String[] names = { "blank", "speed", "efficiency", "sacrifice", "selfSacrifice", "displacement", "capacity", "augCapacity", "orb", "acceleration" };
|
||||
public static final PropertyInteger META = PropertyInteger.create("META", 0, names.length - 1);
|
||||
|
||||
public BlockBloodRune() {
|
||||
super(Material.iron);
|
||||
this.setDefaultState(this.blockState.getBaseState().withProperty(INTEGER, 0));
|
||||
|
||||
setUnlocalizedName(BloodMagic.MODID + ".rune.");
|
||||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
setStepSound(soundTypeStone);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
}
|
||||
|
||||
public int getRuneEffect(int metaData)
|
||||
{
|
||||
switch (metaData)
|
||||
{
|
||||
case 0:
|
||||
return 0;
|
||||
|
||||
case 1: //Altar Capacity rune
|
||||
return 5;
|
||||
|
||||
case 2: //Filling/emptying rune
|
||||
return 6;
|
||||
|
||||
case 3: //Orb Capacity rune
|
||||
return 7;
|
||||
|
||||
case 4: //Better Capacity rune
|
||||
return 8;
|
||||
|
||||
case 5: //Acceleration rune
|
||||
return 9;
|
||||
}
|
||||
|
||||
return 0;
|
||||
public int getRuneEffect(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState()
|
||||
{
|
||||
return new BlockState(this, INTEGER);
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
return this.getDefaultState().withProperty(META, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getDefaultState().withProperty(INTEGER, meta);
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return (Integer) state.getValue(META);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state)
|
||||
{
|
||||
return ((Integer)state.getValue(INTEGER)).intValue();
|
||||
public int damageDropped(IBlockState state) {
|
||||
return getMetaFromState(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState createBlockState() {
|
||||
return new BlockState(this, META);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return new ItemStack(this, 1, this.getMetaFromState(world.getBlockState(pos)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
/**
|
||||
* returns a list of items with the same ID, but different meta (eg: dye returns 16 items)
|
||||
*/
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List)
|
||||
{
|
||||
if (this.equals(ModBlocks.blood_rune))
|
||||
{
|
||||
par3List.add(new ItemStack(par1, 1, 0));
|
||||
par3List.add(new ItemStack(par1, 1, 1));
|
||||
par3List.add(new ItemStack(par1, 1, 2));
|
||||
par3List.add(new ItemStack(par1, 1, 3));
|
||||
par3List.add(new ItemStack(par1, 1, 4));
|
||||
par3List.add(new ItemStack(par1, 1, 5));
|
||||
}
|
||||
else
|
||||
{
|
||||
super.getSubBlocks(par1, par2CreativeTabs, par3List);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState blockState)
|
||||
{
|
||||
return blockState.getBlock().damageDropped(blockState);
|
||||
@SuppressWarnings("unchecked")
|
||||
public void getSubBlocks(Item item, CreativeTabs creativeTabs, List list) {
|
||||
for (int i = 0; i < names.length; i++)
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ public class BlockRitualController extends BlockContainer {
|
|||
setCreativeTab(BloodMagic.tabBloodMagic);
|
||||
setStepSound(soundTypeStone);
|
||||
setHardness(2.0F);
|
||||
setResistance(5.0F);
|
||||
setHarvestLevel("pickaxe", 2);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue