Refactored mod helper handling to use an interface and automatically grab all of them after registration.

Added placeholder effect allele so if any 'oddness' happens when mods are added/removed or compat switched on/off bees won't lose their effects or crash the world.
Removed classes no longer used (BlockPlanks, BlockSlab). cya cya cya
Added alleles for Blitz & Basalz spawning in anticipation of the relevant bees.
This commit is contained in:
MysteriousAges committed 2015-09-26 02:23:02 -07:00
1 parent 8d65e675d1
commit 4d2ea94b76
22 files changed
+359 -557

No files matched your search

@@ -1,69 +0,0 @@
package magicbees.block;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.block.types.PlankType;
import magicbees.main.CommonProxy;
import magicbees.main.Config;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
public class BlockPlanks extends Block
{
@SideOnly(Side.CLIENT)
private IIcon[] IIcons;
public BlockPlanks()
{
super(Material.wood);
this.setHardness(2.5f);
this.setResistance(6.0f);
this.setCreativeTab(CreativeTabs.tabBlock);
if (Config.areMagicPlanksFlammable)
{
Blocks.fire.setFireInfo(this, 5, 20);
}
}
@Override
public int damageDropped(int meta)
{
return meta;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List itemsList)
{
for (PlankType type : PlankType.values())
{
itemsList.add(new ItemStack(this, 1, type.ordinal()));
}
}
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(int side, int meta)
{
return this.IIcons[Math.max(0, Math.min(meta & 7, IIcons.length - 1))];
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister par1IIconRegister)
{
this.IIcons = new IIcon[PlankType.values().length];
for (PlankType t : PlankType.values())
{
this.IIcons[t.ordinal()] = par1IIconRegister.registerIcon(CommonProxy.DOMAIN + ":" + t.name);
}
}
}
@@ -1,105 +0,0 @@
package magicbees.block;
import java.util.List;
import java.util.Random;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import magicbees.block.types.PlankType;
import magicbees.main.CommonProxy;
import magicbees.main.Config;
import net.minecraft.block.Block;
import net.minecraft.block.BlockSlab;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class BlockWoodSlab extends BlockSlab
{
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public BlockWoodSlab(boolean doubleSlab)
{
super(doubleSlab, Material.wood);
this.setHardness(2.5f);
this.setResistance(6.0f);
this.setBlockName("tb.slab.wood");
this.setCreativeTab(CreativeTabs.tabBlock);
this.setLightOpacity(doubleSlab ? 255 : 0);
if (Config.areMagicPlanksFlammable)
{
Blocks.fire.setFireInfo(this, 5, 20);
}
}
@Override
public Item getItemDropped(int id, Random rand, int par3)
{
return Item.getItemFromBlock(Config.slabWoodHalf);
}
protected ItemStack createStackedBlock(int meta)
{
return new ItemStack(Config.planksWood, 1, meta & 7);
}
@Override
public String func_150002_b(int meta)
{
return this.getUnlocalizedName() + "." + PlankType.getType(meta).name;
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks(Item item, CreativeTabs tab, List itemsList)
{
for (PlankType type : PlankType.values())
{
itemsList.add(new ItemStack(this, 1, type.ordinal()));
}
}
@SideOnly(Side.CLIENT)
@Override
public IIcon getIcon(int side, int meta)
{
return this.icons[Math.max(0, Math.min(meta & 7, icons.length - 1))];
}
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister par1IconRegister)
{
this.icons = new IIcon[PlankType.values().length];
for (PlankType t : PlankType.values())
{
this.icons[t.ordinal()] = par1IconRegister.registerIcon(CommonProxy.DOMAIN + ":" + t.name);
}
}
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z)
{
Block block = world.getBlock(x, y, z);
if (block.isAir(world, x, y, z))
{
return null;
}
Item item = Item.getItemFromBlock(block);
if (item == null)
{
return null;
}
return new ItemStack(item, 1, getDamageValue(world, x, y, z) & 7);
}
}