Random stuffs

Updated commands
Added in a ritual hologram --Alex's code
Added a Total Stones tooltip to the ritual diviner
Gave the Alchemy Relay a null bounding box
Added localizations to the blocks that didn't have any
This commit is contained in:
Arcaratus 2015-04-18 19:49:09 -04:00
parent 003a65a51b
commit 31f552fe2d
87 changed files with 2513 additions and 682 deletions

View file

@ -1,17 +1,14 @@
package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLeavesBase;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemStack;
@ -21,9 +18,15 @@ import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.ItemType;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import java.util.ArrayList;
import java.util.List;
import com.google.common.collect.HashMultiset;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BoundAxe extends ItemAxe implements IBindable
{
@ -112,6 +115,11 @@ public class BoundAxe extends ItemAxe implements IBindable
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
return par1ItemStack;
}
if (par2World.isRemote)
{
return par1ItemStack;
}
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
@ -135,6 +143,8 @@ public class BoundAxe extends ItemAxe implements IBindable
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer);
int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer);
HashMultiset<ItemType> dropMultiset = HashMultiset.create();
for (int i = -5; i <= 5; i++)
{
for (int j = 0; j <= 10; j++)
@ -152,27 +162,18 @@ public class BoundAxe extends ItemAxe implements IBindable
{
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta))
{
ItemStack droppedItem = new ItemStack(block, 1, meta);
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, droppedItem));
}
dropMultiset.add(new ItemType(block, meta));
} else
{
ArrayList<ItemStack> itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl);
if (itemDropList != null)
{
for (ItemStack item : itemDropList)
{
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, item));
}
}
for (ItemStack stack : itemDropList)
dropMultiset.add(ItemType.fromStack(stack), stack.stackSize);
}
}
par2World.setBlockToAir(posX + i, posY + j, posZ + k);
}
}
@ -180,7 +181,8 @@ public class BoundAxe extends ItemAxe implements IBindable
}
}
BoundPickaxe.dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ);
return par1ItemStack;
}

View file

@ -1,10 +1,8 @@
package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.enchantment.EnchantmentHelper;
@ -20,9 +18,16 @@ import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.ItemType;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import java.util.ArrayList;
import java.util.List;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multiset;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BoundPickaxe extends ItemPickaxe implements IBindable
{
@ -114,6 +119,11 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
return par1ItemStack;
}
if (par2World.isRemote)
{
return par1ItemStack;
}
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
@ -124,11 +134,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
{
return par1ItemStack;
}
if (par2World.isRemote)
{
return par1ItemStack;
}
if(!EnergyItems.syphonBatteries(par1ItemStack, par3EntityPlayer, 10000))
{
@ -142,6 +147,8 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer);
int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer);
HashMultiset<ItemType> dropMultiset = HashMultiset.create();
for (int i = -5; i <= 5; i++)
{
for (int j = -5; j <= 5; j++)
@ -159,25 +166,15 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
{
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta))
{
ItemStack droppedItem = new ItemStack(block, 1, meta);
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, droppedItem));
}
dropMultiset.add(new ItemType(block, meta));
} else
{
ArrayList<ItemStack> itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl);
if (itemDropList != null)
{
for (ItemStack item : itemDropList)
{
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, item));
}
}
for (ItemStack stack : itemDropList)
dropMultiset.add(ItemType.fromStack(stack), stack.stackSize);
}
}
@ -187,9 +184,31 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
}
}
}
dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ);
return par1ItemStack;
}
public static void dropMultisetStacks(Multiset<ItemType> dropMultiset, World world, double x, double y, double z)
{
for (Multiset.Entry<ItemType> entry : dropMultiset.entrySet())
{
int count = entry.getCount();
ItemType type = entry.getElement();
int maxStackSize = type.item.getItemStackLimit(type.createStack(1));
//Drop in groups of maximum size
while (count >= maxStackSize)
{
world.spawnEntityInWorld(new EntityItem(world, x, y, z, type.createStack(maxStackSize)));
count -= maxStackSize;
}
//Drop remainder
if (count > 0)
world.spawnEntityInWorld(new EntityItem(world, x, y, z, type.createStack(count)));
}
}
@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)

View file

@ -1,13 +1,8 @@
package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import java.util.ArrayList;
import java.util.List;
import com.google.common.collect.Multimap;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.enchantment.EnchantmentHelper;
@ -15,7 +10,6 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack;
@ -25,9 +19,16 @@ import net.minecraft.util.StatCollector;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.common.ItemType;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import java.util.ArrayList;
import java.util.List;
import com.google.common.collect.HashMultiset;
import com.google.common.collect.Multimap;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BoundShovel extends ItemSpade implements IBindable
{
@ -118,6 +119,11 @@ public class BoundShovel extends ItemSpade implements IBindable
par1ItemStack.getTagCompound().setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % 200);
return par1ItemStack;
}
if (par2World.isRemote)
{
return par1ItemStack;
}
if (!getActivated(par1ItemStack) || SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
{
@ -141,6 +147,8 @@ public class BoundShovel extends ItemSpade implements IBindable
boolean silkTouch = EnchantmentHelper.getSilkTouchModifier(par3EntityPlayer);
int fortuneLvl = EnchantmentHelper.getFortuneModifier(par3EntityPlayer);
HashMultiset<ItemType> dropMultiset = HashMultiset.create();
for (int i = -5; i <= 5; i++)
{
for (int j = 0; j <= 10; j++)
@ -158,25 +166,15 @@ public class BoundShovel extends ItemSpade implements IBindable
{
if (silkTouch && block.canSilkHarvest(par2World, par3EntityPlayer, posX + i, posY + j, posZ + k, meta))
{
ItemStack droppedItem = new ItemStack(block, 1, meta);
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, droppedItem));
}
dropMultiset.add(new ItemType(block, meta));
} else
{
ArrayList<ItemStack> itemDropList = block.getDrops(par2World, posX + i, posY + j, posZ + k, meta, fortuneLvl);
if (itemDropList != null)
{
for (ItemStack item : itemDropList)
{
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(new EntityItem(par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ, item));
}
}
for (ItemStack stack : itemDropList)
dropMultiset.add(ItemType.fromStack(stack), stack.stackSize);
}
}
@ -186,6 +184,8 @@ public class BoundShovel extends ItemSpade implements IBindable
}
}
}
BoundPickaxe.dropMultisetStacks(dropMultiset, par2World, posX, posY + par3EntityPlayer.getEyeHeight(), posZ);
return par1ItemStack;
}

View file

@ -8,8 +8,6 @@ import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.boss.EntityDragon;
import net.minecraft.entity.boss.EntityWither;
import net.minecraft.entity.boss.IBossDisplayData;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.monster.EntitySlime;

View file

@ -0,0 +1,42 @@
package WayofTime.alchemicalWizardry.common.items;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemEnchantmentGlyphBlock extends ItemBlock
{
public ItemEnchantmentGlyphBlock(Block block)
{
super(block);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemstack)
{
String name = "";
switch (itemstack.getItemDamage())
{
case 0:
name = "enchantability";
break;
case 1:
name = "enchantmentLevel";
break;
default:
name = "broken";
}
return getUnlocalizedName() + "." + name;
}
@Override
public int getMetadata(int par1)
{
return par1;
}
}

View file

@ -21,7 +21,6 @@ import org.lwjgl.input.Keyboard;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.api.items.interfaces.IRitualDiviner;
import WayofTime.alchemicalWizardry.api.rituals.IRitualStone;
import WayofTime.alchemicalWizardry.api.rituals.RitualComponent;
@ -59,7 +58,11 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
if (this.getMaxRuneDisplacement(par1ItemStack) == 1)
{
par3List.add(StatCollector.translateToLocal("tooltip.ritualdiviner.canplace"));
} else
}else if (this.getMaxRuneDisplacement(par1ItemStack) >= 2)
{
par3List.add(StatCollector.translateToLocal("tooltip.ritualdiviner.canplacedawn"));
}else
{
par3List.add(StatCollector.translateToLocal("tooltip.ritualdiviner.cannotplace"));
}
@ -124,13 +127,16 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
}
}
par3List.add(StatCollector.translateToLocal("tooltip.ritualdiviner.blankstones") + " " + blankStones);
int totalStones = blankStones + airStones + waterStones + fireStones + earthStones + duskStones + dawnStones;
par3List.add(EnumChatFormatting.WHITE + StatCollector.translateToLocal("tooltip.ritualdiviner.blankstones") + " " + blankStones);
par3List.add(EnumChatFormatting.AQUA + StatCollector.translateToLocal("tooltip.ritualdiviner.airstones") + " " + airStones);
par3List.add(EnumChatFormatting.BLUE + StatCollector.translateToLocal("tooltip.ritualdiviner.waterstones") + " " + waterStones);
par3List.add(EnumChatFormatting.RED + StatCollector.translateToLocal("tooltip.ritualdiviner.firestones") + " " + fireStones);
par3List.add(EnumChatFormatting.DARK_GREEN + StatCollector.translateToLocal("tooltip.ritualdiviner.earthstones") + " " + earthStones);
par3List.add(EnumChatFormatting.BOLD + StatCollector.translateToLocal("tooltip.ritualdiviner.duskstones") + " " + duskStones);
par3List.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("tooltip.ritualdiviner.duskstones") + " " + duskStones);
par3List.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("tooltip.ritualdiviner.dawnstones") + " " + dawnStones);
par3List.add(EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal("tooltip.ritualdiviner.totalStones") + " " + totalStones);
}
}else
{
@ -358,10 +364,15 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
@SideOnly(Side.CLIENT)
public void getSubItems(Item id, CreativeTabs creativeTab, List list)
{
list.add(new ItemStack(ModItems.itemRitualDiviner));
ItemStack duskRitualDivinerStack = new ItemStack(ModItems.itemRitualDiviner);
((ItemRitualDiviner) duskRitualDivinerStack.getItem()).setMaxRuneDisplacement(duskRitualDivinerStack, 1);
list.add(new ItemStack(id));
ItemStack duskRitualDivinerStack = new ItemStack(id);
this.setMaxRuneDisplacement(duskRitualDivinerStack, 1);
list.add(duskRitualDivinerStack);
ItemStack dawnRitualDivinerStack = new ItemStack(id);
this.setMaxRuneDisplacement(dawnRitualDivinerStack, 2);
list.add(dawnRitualDivinerStack);
}
@Override

View file

@ -0,0 +1,38 @@
package WayofTime.alchemicalWizardry.common.items;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemStabilityGlyphBlock extends ItemBlock
{
public ItemStabilityGlyphBlock(Block block)
{
super(block);
setHasSubtypes(true);
}
@Override
public String getUnlocalizedName(ItemStack itemstack)
{
String name = "";
switch (itemstack.getItemDamage())
{
case 0:
name = "stability1";
break;
default:
name = "broken";
}
return getUnlocalizedName() + "." + name;
}
@Override
public int getMetadata(int par1)
{
return par1;
}
}

View file

@ -168,6 +168,21 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
return false;
}
public boolean isAffectedBySoulHarden()
{
return true;
}
public double getBaseArmourReduction()
{
return 0.9;
}
public double getArmourPenetrationReduction()
{
return 0.9;
}
@Override
public ArmorProperties getProperties(EntityLivingBase player, ItemStack armor, DamageSource source, double damage, int slot)
{
@ -188,7 +203,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
h = player.getActivePotionEffect(AlchemicalWizardry.customPotionSoulHarden).getAmplifier() + 1;
}
armourReduction = 1 - 0.1 * Math.pow(1.0/3.0, Math.max(0, h - f)) - 0.1 * Math.max(0, f-h);
armourReduction = isAffectedBySoulHarden() ? 1 - (1 - this.getBaseArmourReduction()) * Math.pow(1.0/3.0, Math.max(0, h - f)) - 0.1 * Math.max(0, f-h) : getBaseArmourReduction();
damageAmount *= (armourReduction);
@ -224,7 +239,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
{
if (source.isUnblockable())
{
return new ArmorProperties(-1, damageAmount * 0.9d, maxAbsorption);
return new ArmorProperties(-1, damageAmount * getArmourPenetrationReduction(), maxAbsorption);
}
return new ArmorProperties(-1, damageAmount, maxAbsorption);
@ -373,7 +388,14 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
this.setIsInvisible(itemStack, player.isPotionActive(Potion.invisibility.id));
if (itemStack.getItemDamage() > 0)
this.repairArmour(world, player, itemStack);
return;
}
public void repairArmour(World world, EntityPlayer player, ItemStack itemStack)
{
if (itemStack.getItemDamage() > 0)
{
EnergyItems.checkAndSetItemOwner(itemStack, player);
@ -385,8 +407,6 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
}
}
}
return;
}
public void tickInternalInventory(ItemStack par1ItemStack, World par2World, EntityPlayer par3Entity, int par4, boolean par5)

View file

@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.items.armour;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@ -23,6 +24,8 @@ import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -36,6 +39,10 @@ public abstract class OmegaArmour extends BoundArmour
protected boolean storeYLevel = false;
protected boolean storeSeesSky = false;
protected List<Enchantment> illegalEnchantmentList = new LinkedList();
public float reagentDrainPerDamage = 0.1f;
public OmegaArmour(int armorType)
{
super(armorType);
@ -56,31 +63,52 @@ public abstract class OmegaArmour extends BoundArmour
this.reagent = reagent;
}
@Override
public boolean isAffectedBySoulHarden()
{
return false;
}
@Override
public double getBaseArmourReduction()
{
return 0.9;
}
@Override
public double getArmourPenetrationReduction()
{
return 0.5;
}
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack)
{
super.onArmorTick(world, player, itemStack);
if(this.storeBiomeID())
if(world.getWorldTime() % 50 == 0)
{
int xCoord = (int) Math.floor(player.posX);
int zCoord = (int) Math.floor(player.posZ);
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
if(biome != null)
if(this.storeBiomeID())
{
this.setBiomeIDStored(itemStack, biome.biomeID);
int xCoord = (int) Math.floor(player.posX);
int zCoord = (int) Math.floor(player.posZ);
BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord);
if(biome != null)
{
this.setBiomeIDStored(itemStack, biome.biomeID);
}
}
if(this.storeDimensionID())
{
this.setDimensionIDStored(itemStack, world.provider.dimensionId);
}
if(this.storeYLevel())
{
this.setYLevelStored(itemStack, (int) Math.floor(player.posY));
}
}
if(this.storeDimensionID())
{
this.setDimensionIDStored(itemStack, world.provider.dimensionId);
}
if(this.storeYLevel())
{
this.setYLevelStored(itemStack, (int) Math.floor(player.posY));
}
if(this.armorType == 1)
@ -94,13 +122,34 @@ public abstract class OmegaArmour extends BoundArmour
}
}
@Override
public void repairArmour(World world, EntityPlayer player, ItemStack itemStack)
{
if (itemStack.getItemDamage() > 0)
{
if (!player.capabilities.isCreativeMode)
{
if(EnergyItems.syphonBatteries(itemStack, player, itemStack.getItemDamage() * 75))
{
Reagent reagent = APISpellHelper.getPlayerReagentType(player);
float reagentAmount = APISpellHelper.getPlayerCurrentReagentAmount(player);
reagentAmount -= itemStack.getItemDamage() * reagentDrainPerDamage;
APISpellHelper.setPlayerCurrentReagentAmount(player, Math.max(0, reagentAmount));
itemStack.setItemDamage(0);
}
}
}
}
public void revertArmour(EntityPlayer player, ItemStack itemStack)
{
ItemStack stack = this.getContainedArmourStack(itemStack);
player.inventory.armorInventory[3-this.armorType] = stack;
}
public ItemStack getSubstituteStack(ItemStack boundStack, int stability, int affinity, int enchantability, Random rand)
public ItemStack getSubstituteStack(ItemStack boundStack, int stability, int affinity, int enchantability, int enchantmentLevel, Random rand)
{
ItemStack omegaStack = new ItemStack(this);
if(boundStack != null && boundStack.hasTagCompound())
@ -110,13 +159,18 @@ public abstract class OmegaArmour extends BoundArmour
}
this.setContainedArmourStack(omegaStack, boundStack);
SoulNetworkHandler.checkAndSetItemOwner(omegaStack, SoulNetworkHandler.getOwnerName(boundStack));
this.setItemEnchantability(omegaStack, 70);
this.setItemEnchantability(omegaStack, Math.min(enchantability, 70));
EnchantmentHelper.setEnchantments(new HashMap(), omegaStack);
List enchantList = new ArrayList();
for(int i=0; i<100; i++)
int adjustedEnchantLevel = Math.min(enchantmentLevel, 30);
int additionalPasses = enchantmentLevel - adjustedEnchantLevel;
for(int i=0; i<1+additionalPasses; i++)
{
List lst = EnchantmentHelper.buildEnchantmentList(rand, omegaStack, 30);
List lst = EnchantmentHelper.buildEnchantmentList(rand, omegaStack, adjustedEnchantLevel);
if(lst != null)
{
enchantList.addAll(lst);
@ -144,9 +198,17 @@ public abstract class OmegaArmour extends BoundArmour
}
}
for(Enchantment ench : this.illegalEnchantmentList)
{
if(map.containsKey(ench))
{
map.remove(ench);
}
}
List newEnchantList = new ArrayList();
for(Entry<Enchantment, Map<Integer, Integer>> entry : map.entrySet()) //Assume enchant # 0 is level 1 enchant
for(Entry<Enchantment, Map<Integer, Integer>> entry : map.entrySet())
{
Enchantment ench = entry.getKey();
Map<Integer, Integer> numMap = entry.getValue();

View file

@ -28,6 +28,7 @@ public class OmegaArmourEarth extends OmegaArmour
public OmegaArmourEarth(int armorType)
{
super(armorType);
this.storeYLevel = true;
}
@Override
@ -89,10 +90,14 @@ public class OmegaArmourEarth extends OmegaArmour
}
@Override
public Multimap getItemAttributeModifiers()
public Multimap getAttributeModifiers(ItemStack stack)
{
Multimap map = HashMultimap.create();
map.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(179618 /** Random number **/, armorType), "Armor modifier" + armorType, getKnockbackResist(), 0));
int yLevel = this.getYLevelStored(stack);
map.put(SharedMonsterAttributes.knockbackResistance.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(179618 /** Random number **/, armorType), "Knockback modifier" + armorType, getKnockbackResist(), 0));
map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(80532 /** Random number **/, armorType), "Health modifier" + armorType, getDefaultArmourBoost()*getHealthBoostModifierForLevel(yLevel), 1));
map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85112 /** Random number **/, armorType), "Damage modifier" + armorType, getDefaultArmourBoost()*getDamageModifierForLevel(yLevel), 2));
return map;
}
@ -100,4 +105,30 @@ public class OmegaArmourEarth extends OmegaArmour
{
return 0.25f;
}
public float getDefaultArmourBoost()
{
switch(this.armorType)
{
case 0:
return 2.5f;
case 1:
return 4;
case 2:
return 3.5f;
case 3:
return 2;
}
return 0.25f;
}
public float getHealthBoostModifierForLevel(int yLevel)
{
return 0.05f * (yLevel <= 50 ? 1.5f : yLevel >= 100 ? -0.5f : 0.5f);
}
public float getDamageModifierForLevel(int yLevel)
{
return 0.03f * (yLevel <= 50 ? 1.5f : yLevel >= 100 ? -0.5f : 0.5f);
}
}

View file

@ -1,10 +1,19 @@
package WayofTime.alchemicalWizardry.common.items.armour;
import java.util.UUID;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.biome.BiomeGenBase;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaFire;
import cpw.mods.fml.relauncher.Side;
@ -20,7 +29,8 @@ public class OmegaArmourFire extends OmegaArmour
public OmegaArmourFire(int armorType)
{
super(armorType);
// this.storeYLevel = true;
this.storeBiomeID = true;
this.illegalEnchantmentList.add(Enchantment.fireProtection);
}
@Override
@ -81,17 +91,21 @@ public class OmegaArmourFire extends OmegaArmour
return this.itemIcon;
}
// @Override
// public Multimap getAttributeModifiers(ItemStack stack)
// {
// Multimap map = HashMultimap.create();
//
//// map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85212 /** Random number **/, armorType), "Armor modifier" + armorType, getDefaultHealthBoost()*getHealthBoostModifierForLevel(yLevel), 0));
//
// return map;
// }
@Override
public Multimap getAttributeModifiers(ItemStack stack)
{
Multimap map = HashMultimap.create();
int biomeID = this.getBiomeIDStored(stack);
BiomeGenBase biome = BiomeGenBase.getBiome(biomeID);
if(biome != null)
{
map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(895132 /** Random number **/, armorType), "Health modifier" + armorType, getDefaultArmourBoost()*getHealthBoostModifierForBiome(biome), 1));
map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(196312 /** Random number **/, armorType), "Damage modifier" + armorType, getDefaultArmourBoost()*getDamageModifierForBiome(biome), 1));
}
return map;
}
public float getDefaultHealthBoost()
public float getDefaultArmourBoost()
{
switch(this.armorType)
{
@ -107,8 +121,47 @@ public class OmegaArmourFire extends OmegaArmour
return 0.25f;
}
// public float getHealthBoostModifierForLevel(int yLevel)
// {
// return (float)Math.sqrt(((float)yLevel)/64f) * 1.5f - 1;
// }
public float getHealthBoostModifierForBiome(BiomeGenBase biome)
{
float modifier = 0.05f;
if(biome.isEqualTo(BiomeGenBase.hell))
{
return modifier * 2.0f;
}
if(biome.isEqualTo(BiomeGenBase.ocean))
{
return modifier * -0.5f;
}
if(biome.temperature >= 1)
{
return modifier * 1.5f;
}
return modifier * 0.5f;
}
public float getDamageModifierForBiome(BiomeGenBase biome)
{
float modifier = 0.03f;
if(biome.isEqualTo(BiomeGenBase.hell))
{
return modifier * 2.0f;
}
if(biome.isEqualTo(BiomeGenBase.ocean))
{
return modifier * -0.5f;
}
if(biome.temperature >= 1)
{
return modifier * 1.5f;
}
return modifier * 0.5f;
}
}

View file

@ -97,12 +97,13 @@ public class OmegaArmourWater extends OmegaArmour
BiomeGenBase biome = BiomeGenBase.getBiome(biomeID);
if(biome != null)
{
map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85312 /** Random number **/, armorType), "Armor modifier" + armorType, getDefaultHealthBoost()*getHealthBoostModifierForBiome(biome), 0));
map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85312 /** Random number **/, armorType), "Health modifier" + armorType, getDefaultArmourBoost()*getHealthBoostModifierForBiome(biome), 2));
map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85432 /** Random number **/, armorType), "Damage modifier" + armorType, getDefaultArmourBoost()*getDamageModifierForBiome(biome), 2));
}
return map;
}
public float getDefaultHealthBoost()
public float getDefaultArmourBoost()
{
switch(this.armorType)
{
@ -120,21 +121,44 @@ public class OmegaArmourWater extends OmegaArmour
public float getHealthBoostModifierForBiome(BiomeGenBase biome)
{
float modifier = 0.05f;
if(biome.isEqualTo(BiomeGenBase.hell))
{
return -0.5f;
return modifier * -0.5f;
}
if(biome.isEqualTo(BiomeGenBase.ocean))
if(biome.isEqualTo(BiomeGenBase.ocean) || biome.isEqualTo(BiomeGenBase.river))
{
return 2.0f;
return modifier * 2.0f;
}
if(biome.isHighHumidity())
{
return 1.5f;
return modifier * 1.5f;
}
return 0.5f;
return modifier * 0.5f;
}
public float getDamageModifierForBiome(BiomeGenBase biome)
{
float modifier = 0.03f;
if(biome.isEqualTo(BiomeGenBase.hell))
{
return modifier * -0.5f;
}
if(biome.isEqualTo(BiomeGenBase.ocean) || biome.isEqualTo(BiomeGenBase.river))
{
return modifier * 2.0f;
}
if(biome.isHighHumidity())
{
return modifier * 1.5f;
}
return modifier * 0.5f;
}
}

View file

@ -94,13 +94,13 @@ public class OmegaArmourWind extends OmegaArmour
{
Multimap map = HashMultimap.create();
int yLevel = this.getYLevelStored(stack);
map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85212 /** Random number **/, armorType), "Armor modifier" + armorType, getDefaultHealthBoost()*getHealthBoostModifierForLevel(yLevel), 0));
map.put(SharedMonsterAttributes.maxHealth.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(85212 /** Random number **/, armorType), "Health modifier" + armorType, getDefaultArmourBoost()*getHealthBoostModifierForLevel(yLevel), 1));
map.put(SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(), new AttributeModifier(new UUID(86212 /** Random number **/, armorType), "Damage modifier" + armorType, getDefaultArmourBoost()*getDamageModifierForLevel(yLevel), 2));
return map;
}
public float getDefaultHealthBoost()
public float getDefaultArmourBoost()
{
switch(this.armorType)
{
@ -118,6 +118,11 @@ public class OmegaArmourWind extends OmegaArmour
public float getHealthBoostModifierForLevel(int yLevel)
{
return (float)Math.sqrt(((float)yLevel)/64f) * 1.5f - 1;
return 0.05f * ((((float)yLevel)/64f) * 1.5f - 1);
}
public float getDamageModifierForLevel(int yLevel)
{
return 0.02f * ((((float)yLevel)/64f) * 1.5f - 1);
}
}

View file

@ -213,7 +213,7 @@ public class ItemTankSegmenter extends Item implements IReagentManipulator
numberAssigned = 0;
}
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.tanksegmenter.nowhas") + " " + numberAssigned + " " + "message.tanksegmenter.tankssetto" + " " + reagent.name));
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.tanksegmenter.nowhas") + " " + numberAssigned + " " + StatCollector.translateToLocal("message.tanksegmenter.tankssetto") + " " + reagent.name));
reagentHandler.setTanksTunedToReagent(reagent, numberAssigned);
}

View file

@ -49,7 +49,6 @@ public class ItemBloodLightSigil extends EnergyItems implements IHolding
@Override
public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
{
System.out.println("Being called");
if(!EnergyItems.checkAndSetItemOwner(par1ItemStack, par2EntityPlayer) || !EnergyItems.syphonBatteries(par1ItemStack, par2EntityPlayer, getEnergyUsed()))
{
return true;
@ -96,7 +95,7 @@ public class ItemBloodLightSigil extends EnergyItems implements IHolding
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
{
return par1ItemStack;
}

View file

@ -56,7 +56,7 @@ public class SigilOfTheFastMiner extends EnergyItems implements ArmourUpgrade
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SigilOfTheFastMiner");
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:MiningSigil_deactivated");
this.activeIcon = iconRegister.registerIcon("AlchemicalWizardry:MiningSigil_activated");
this.passiveIcon = iconRegister.registerIcon("AlchemicalWizardry:MiningSigil_deactivated");
}