Massive rework of configs, items and blocks.

I redone where the items/blocsks are stored and how the configs are
handled to clean up it and give space. You can change the config line to
AWWayofTime if you want to keep the compatibility with old configs. Now
you reference the blocks from the ModBlocks and Items from the ModItems.
This commit is contained in:
Fenn 2014-01-17 21:05:38 +00:00
parent 8601e9faff
commit e3644f2d2b
304 changed files with 3941 additions and 5108 deletions

View file

@ -1,8 +1,9 @@
package WayofTime.alchemicalWizardry.common.items;
import java.util.ArrayList;
import java.util.List;
import WayofTime.alchemicalWizardry.common.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.IBindable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLeavesBase;
import net.minecraft.client.renderer.texture.IconRegister;
@ -18,19 +19,21 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import WayofTime.alchemicalWizardry.common.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.IBindable;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BoundAxe extends ItemAxe implements IBindable
{
/** Array of blocks the tool has extra effect against. */
public static final Block[] blocksEffectiveAgainst = new Block[] {Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.pumpkin, Block.pumpkinLantern};
import java.util.ArrayList;
import java.util.List;
public class BoundAxe extends ItemAxe implements IBindable {
/**
* Array of blocks the tool has extra effect against.
*/
public static final Block[] blocksEffectiveAgainst = new Block[]{Block.planks, Block.bookShelf, Block.wood, Block.chest, Block.stoneDoubleSlab, Block.stoneSingleSlab, Block.pumpkin, Block.pumpkinLantern};
public float efficiencyOnProperMaterial = 12.0F;
/** Damage versus entities. */
/**
* Damage versus entities.
*/
public float damageVsEntity;
private static Icon activeIcon;
@ -69,8 +72,7 @@ public class BoundAxe extends ItemAxe implements IBindable
if (par1ItemStack.stackTagCompound.getBoolean("isActive"))
{
par3List.add("Activated");
}
else
} else
{
par3List.add("Deactivated");
}
@ -104,8 +106,7 @@ public class BoundAxe extends ItemAxe implements IBindable
if (tag.getBoolean("isActive"))
{
return this.activeIcon;
}
else
} else
{
return this.passiveIcon;
}
@ -119,7 +120,7 @@ public class BoundAxe extends ItemAxe implements IBindable
if (par3EntityPlayer.isSneaking())
{
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int)(par2World.getWorldTime() - 1) % 200);
par1ItemStack.stackTagCompound.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
return par1ItemStack;
}
@ -133,9 +134,9 @@ public class BoundAxe extends ItemAxe implements IBindable
return par1ItemStack;
}
int posX = (int)par3EntityPlayer.posX;
int posY = (int)par3EntityPlayer.posY;
int posZ = (int)par3EntityPlayer.posZ;
int posX = (int) par3EntityPlayer.posX;
int posY = (int) par3EntityPlayer.posY;
int posZ = (int) par3EntityPlayer.posZ;
boolean silkTouch = false;
int so = Enchantment.silkTouch.effectId;
int fortune = Enchantment.fortune.effectId;
@ -146,9 +147,9 @@ public class BoundAxe extends ItemAxe implements IBindable
{
for (int i = 0; i < enchants.tagCount(); i++)
{
if (enchants.tagAt(i)instanceof NBTTagCompound)
if (enchants.tagAt(i) instanceof NBTTagCompound)
{
NBTTagCompound nbt = (NBTTagCompound)enchants.tagAt(i);
NBTTagCompound nbt = (NBTTagCompound) enchants.tagAt(i);
int id = nbt.getShort("id");
if (id == so)
@ -188,8 +189,7 @@ public class BoundAxe extends ItemAxe implements IBindable
{
par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, droppedItem));
}
}
else
} else
{
ArrayList<ItemStack> itemDropList = block.getBlockDropped(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl);
@ -224,7 +224,7 @@ public class BoundAxe extends ItemAxe implements IBindable
return;
}
EntityPlayer par3EntityPlayer = (EntityPlayer)par3Entity;
EntityPlayer par3EntityPlayer = (EntityPlayer) par3Entity;
if (par1ItemStack.stackTagCompound == null)
{
@ -303,7 +303,7 @@ public class BoundAxe extends ItemAxe implements IBindable
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
{
if ((double)Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D)
if ((double) Block.blocksList[par3].getBlockHardness(par2World, par4, par5, par6) != 0.0D)
{
//par1ItemStack.damageItem(1, par7EntityLivingBase);
}
@ -338,7 +338,9 @@ public class BoundAxe extends ItemAxe implements IBindable
// return true;
// }
/** FORGE: Overridden to allow custom tool effectiveness */
/**
* FORGE: Overridden to allow custom tool effectiveness
*/
@Override
public float getStrVsBlock(ItemStack stack, Block block, int meta)
{