All da commentz

This commit is contained in:
WayofTime 2014-09-14 18:21:45 -04:00
parent 2b749000b6
commit 5983ff4130
44 changed files with 1851 additions and 426 deletions

View file

@ -2,10 +2,12 @@ package WayofTime.alchemicalWizardry.common.items;
import java.util.List;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
@ -25,6 +27,7 @@ import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles;
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaArmour;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.common.Optional.Interface;
import cpw.mods.fml.relauncher.Side;
@ -38,6 +41,8 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialAr
private static IIcon plateIcon;
private static IIcon leggingsIcon;
private static IIcon bootsIcon;
private static final boolean tryComplexRendering = false;
public BoundArmour(int armorType)
{
@ -46,6 +51,75 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialAr
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
}
ModelBiped model1 = null;
ModelBiped model2 = null;
ModelBiped model = null;
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot)
{
if(tryComplexRendering)
{
int type = ((ItemArmor)itemStack.getItem()).armorType;
if(this.model1 == null)
{
this.model1 = new ModelOmegaArmour(1.0f, true, true, false, true);
}
if(this.model2 == null)
{
this.model2 = new ModelOmegaArmour(0.5f, false, false, true, false);
}
if(type == 1 || type == 3 || type == 0)
{
this.model = model1;
}else
{
this.model = model2;
}
if(this.model != null)
{
this.model.bipedHead.showModel = (type == 0);
this.model.bipedHeadwear.showModel = (type == 0);
this.model.bipedBody.showModel = ((type == 1) || (type == 2));
this.model.bipedLeftArm.showModel = (type == 1);
this.model.bipedRightArm.showModel = (type == 1);
this.model.bipedLeftLeg.showModel = (type == 2 || type == 3);
this.model.bipedRightLeg.showModel = (type == 2 || type == 3);
this.model.isSneak = entityLiving.isSneaking();
this.model.isRiding = entityLiving.isRiding();
this.model.isChild = entityLiving.isChild();
this.model.aimedBow = false;
this.model.heldItemRight = (entityLiving.getHeldItem() != null ? 1 : 0);
if ((entityLiving instanceof EntityPlayer))
{
if (((EntityPlayer)entityLiving).getItemInUseDuration() > 0)
{
EnumAction enumaction = ((EntityPlayer)entityLiving).getItemInUse().getItemUseAction();
if (enumaction == EnumAction.block)
{
this.model.heldItemRight = 3;
} else if (enumaction == EnumAction.bow)
{
this.model.aimedBow = true;
}
}
}
}
return model;
}else
{
return super.getArmorModel(entityLiving, itemStack, armorSlot);
}
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
@ -227,6 +301,10 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles,ISpecialAr
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
if(this.tryComplexRendering)
{
return "alchemicalwizardry:models/armor/BloodArmour_WIP.png";
}
//TODO Make the armour invisible when the player has Invisibility on.
if (entity instanceof EntityLivingBase)
{

View file

@ -130,7 +130,7 @@ public class BoundAxe extends ItemAxe implements IBindable
return par1ItemStack;
}
if (!getActivated(par1ItemStack))
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}

View file

@ -127,7 +127,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
return par1ItemStack;
}
if (!getActivated(par1ItemStack))
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}

View file

@ -131,7 +131,7 @@ public class BoundShovel extends ItemSpade implements IBindable
return par1ItemStack;
}
if (!getActivated(par1ItemStack))
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
return par1ItemStack;
}

View file

@ -56,7 +56,7 @@ public class DaggerOfSacrifice extends EnergyItems
@Override
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
{
if (par3EntityLivingBase == null || par2EntityLivingBase == null || par3EntityLivingBase.worldObj.isRemote || !(par3EntityLivingBase.getClass().equals(EntityPlayerMP.class)))
if (par3EntityLivingBase == null || par2EntityLivingBase == null || par3EntityLivingBase.worldObj.isRemote || (par3EntityLivingBase instanceof EntityPlayer && SpellHelper.isFakePlayer(par3EntityLivingBase.worldObj, (EntityPlayer) par3EntityLivingBase)))
{
return false;
}

View file

@ -10,9 +10,8 @@ import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.common.PacketHandler;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.common.tileEntity.TEAltar;
public class EnergyItems extends Item implements IBindable
{
@ -224,7 +223,7 @@ public class EnergyItems extends Item implements IBindable
if (item.stackTagCompound.getString("ownerName").equals(""))
{
item.stackTagCompound.setString("ownerName", SpellHelper.getUsername(player));
item.stackTagCompound.setString("ownerName", SoulNetworkHandler.getUsername(player));
}
initializePlayer(player);

View file

@ -0,0 +1,101 @@
package WayofTime.alchemicalWizardry.common.items;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.world.World;
import net.minecraftforge.common.util.Constants;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentContainer;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack;
public class ItemBlockCrystalBelljar extends ItemBlock
{
public ItemBlockCrystalBelljar(Block par1)
{
super(par1);
// this.setUnlocalizedName("itemSpellEnhancementBlock");
// setCreativeTab(AlchemicalWizardry.tabBloodMagic);
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setMaxStackSize(16);
}
public int getMetadata(int par1)
{
return par1;
}
public ReagentContainer[] getReagentContainers(ItemStack stack)
{
if(stack != null && stack.hasTagCompound())
{
NBTTagCompound tag = stack.getTagCompound();
NBTTagList tagList = tag.getTagList("reagentTanks", Constants.NBT.TAG_COMPOUND);
int size = tagList.tagCount();
ReagentContainer[] tanks = new ReagentContainer[size];
for(int i=0; i<size; i++)
{
NBTTagCompound savedTag = tagList.getCompoundTagAt(i);
tanks[i] = ReagentContainer.readFromNBT(savedTag);
}
return tanks;
}
return null;
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
{
ReagentContainer[] tanks = this.getReagentContainers(stack);
if(tanks == null)
{
list.add("Empty");
}else
{
list.add("Current Contents:");
for(int i=0; i<tanks.length; i++)
{
if(tanks[i] == null || tanks[i].getReagent() == null || tanks[i].getReagent().reagent == null)
{
list.add("- Empty");
}else
{
ReagentStack reagentStack = tanks[i].getReagent();
list.add("- " + reagentStack.reagent.name + ": " + reagentStack.amount + "/" + tanks[i].getCapacity()/1000 + "k AR");
}
}
}
}
@Override
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata)
{
System.out.println("I am calling placeBlockAt");
if(stack.getTagCompound() == null)
{
System.out.println("I have no NBT.");
}
if (!world.setBlock(x, y, z, field_150939_a, metadata, 3))
{
return false;
}
if (world.getBlock(x, y, z) == field_150939_a)
{
field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack);
field_150939_a.onPostBlockPlaced(world, x, y, z, metadata);
}
return true;
}
}

View file

@ -196,35 +196,21 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
Reagent pastReagent = this.getReagent(itemStack);
boolean goForNext = false;
boolean hasFound = false;
for(Reagent reagent : reagentList)
if(reagentList.size() <= 0)
{
if(goForNext)
{
goForNext = false;
this.setReagentWithNotification(itemStack, reagent, player);
}
if(reagent == pastReagent)
{
goForNext = true;
hasFound = true;
}
return itemStack;
}
if(hasFound)
int reagentLocation = -1;
reagentLocation = reagentList.indexOf(pastReagent);
if(reagentLocation == -1 || reagentLocation+1 >= reagentList.size())
{
if(goForNext)
{
this.setReagentWithNotification(itemStack, reagentList.get(0), player);
}
this.setReagentWithNotification(itemStack, reagentList.get(0), player);
}else
{
if(reagentList.size() >= 1)
{
this.setReagentWithNotification(itemStack, reagentList.get(0), player);
}
this.setReagentWithNotification(itemStack, reagentList.get(reagentLocation + 1), player);
}
}
}else
@ -234,6 +220,11 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
Int3 coords = this.getCoordinates(itemStack);
int dimension = this.getDimension(itemStack);
if(coords == null)
{
return itemStack;
}
if(dimension != world.provider.dimensionId || Math.abs(coords.xCoord - x) > maxDistance || Math.abs(coords.yCoord - y) > maxDistance || Math.abs(coords.zCoord - z) > maxDistance)
{
player.addChatComponentMessage(new ChatComponentText("Linked container is either too far or is in a different dimension."));
@ -249,6 +240,11 @@ public class ItemAttunedCrystal extends Item implements IReagentManipulator
Reagent reagent = this.getReagent(itemStack);
if(reagent == null)
{
return itemStack;
}
TEReagentConduit pastRelay = (TEReagentConduit)pastTile;
if(player.isSneaking())

View file

@ -94,6 +94,8 @@ public class DivinationSigil extends Item implements ArmourUpgrade, IReagentMani
if(!(tile instanceof IReagentHandler))
{
par3EntityPlayer.addChatMessage(new ChatComponentText("Current Essence: " + EnergyItems.getCurrentEssence(ownerName) + "LP"));
return par1ItemStack;
}

View file

@ -10,12 +10,13 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.api.items.interfaces.IHolding;
import WayofTime.alchemicalWizardry.common.entity.projectile.EntityBloodLightProjectile;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemBloodLightSigil extends EnergyItems
public class ItemBloodLightSigil extends EnergyItems implements IHolding
{
private int tickDelay = 100;