Added the Dawn Scribing Tool + Dawn Ritual Stone

Fixed the ISidedInventory nature of the chemistry set
Added the Omega Reaction Chamber for initiating the Omega state
Experimented with enchantments
This commit is contained in:
WayofTime 2015-04-04 16:35:42 -04:00
parent 60ae47c499
commit ab8d25db76
23 changed files with 554 additions and 57 deletions

View file

@ -0,0 +1,20 @@
package WayofTime.alchemicalWizardry.common.items;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
public class DawnScribeTool extends ScribeTool
{
public DawnScribeTool()
{
super(6);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DawnScribeTool");
}
}

View file

@ -725,10 +725,29 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
return 1.0f;
}
public int getItemEnchantability()
public int getItemEnchantability(ItemStack stack)
{
NBTTagCompound tag = stack.getTagCompound();
if (tag != null)
{
return tag.getInteger("enchantability");
}
return Integer.MIN_VALUE;
}
public void setItemEnchantability(ItemStack stack, int enchantability)
{
NBTTagCompound tag = stack.getTagCompound();
if (tag == null)
{
stack.setTagCompound(new NBTTagCompound());
tag = stack.getTagCompound();
}
tag.setInteger("enchantability", enchantability);
}
public boolean getIsInvisible(ItemStack armourStack)
{

View file

@ -1,6 +1,17 @@
package WayofTime.alchemicalWizardry.common.items.armour;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentData;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
@ -89,7 +100,7 @@ public abstract class OmegaArmour extends BoundArmour
player.inventory.armorInventory[3-this.armorType] = stack;
}
public ItemStack getSubstituteStack(ItemStack boundStack)
public ItemStack getSubstituteStack(ItemStack boundStack, int stability, int affinity, Random rand)
{
ItemStack omegaStack = new ItemStack(this);
if(boundStack != null && boundStack.hasTagCompound())
@ -99,6 +110,107 @@ public abstract class OmegaArmour extends BoundArmour
}
this.setContainedArmourStack(omegaStack, boundStack);
SoulNetworkHandler.checkAndSetItemOwner(omegaStack, SoulNetworkHandler.getOwnerName(boundStack));
this.setItemEnchantability(omegaStack, 50);
List enchantList = new ArrayList();
for(int i=0; i<10; i++)
{
enchantList.addAll(EnchantmentHelper.buildEnchantmentList(rand, omegaStack, 30));
}
Map<Enchantment, Map<Integer, Integer>> map = new HashMap();
for(Object obj : enchantList)
{
EnchantmentData enchantmentdata = (EnchantmentData)obj;
if(!map.containsKey(enchantmentdata.enchantmentobj))
{
map.put(enchantmentdata.enchantmentobj, new HashMap());
}
Map<Integer, Integer> numMap = map.get(enchantmentdata.enchantmentobj);
if(numMap.containsKey(enchantmentdata.enchantmentLevel))
{
numMap.put(enchantmentdata.enchantmentLevel, numMap.get(enchantmentdata.enchantmentLevel)+1);
}else
{
numMap.put(enchantmentdata.enchantmentLevel, 1);
}
}
List newEnchantList = new ArrayList();
for(Entry<Enchantment, Map<Integer, Integer>> entry : map.entrySet()) //Assume enchant # 0 is level 1 enchant
{
Enchantment ench = entry.getKey();
Map<Integer, Integer> numMap = entry.getValue();
if(numMap.isEmpty())
{
continue;
}
int[] enchantValues = new int[1];
for(Entry<Integer, Integer> entry1 : numMap.entrySet())
{
int enchantLevel = entry1.getKey();
int number = entry1.getValue();
if(enchantLevel >= enchantValues.length)
{
int[] newEnchantValues = new int[enchantLevel+1];
for(int i=0; i< enchantValues.length; i++)
{
newEnchantValues[i] = enchantValues[i];
}
enchantValues = newEnchantValues;
}
enchantValues[enchantLevel] += number;
}
int size = enchantValues.length;
int i = 0;
while(i<size)
{
int number = enchantValues[i];
if(number >= 2 && i+1 >= size)
{
int[] newEnchantValues = new int[i+2];
for(int z=0; z< enchantValues.length; z++)
{
newEnchantValues[z] = enchantValues[z];
}
enchantValues = newEnchantValues;
enchantValues[i+1] += number/2;
size = enchantValues.length;
}
i++;
}
newEnchantList.add(new EnchantmentData(ench, enchantValues.length-1));
}
Iterator iterator = newEnchantList.iterator();
while (iterator.hasNext())
{
EnchantmentData enchantmentdata = (EnchantmentData)iterator.next();
{
omegaStack.addEnchantment(enchantmentdata.enchantmentobj, enchantmentdata.enchantmentLevel);
}
}
for(int i=0; i<1; i++)
{
// omegaStack = EnchantmentHelper.addRandomEnchantment(new Random(), omegaStack, 30);
}
return omegaStack;
}

View file

@ -1,17 +1,9 @@
package WayofTime.alchemicalWizardry.common.items.armour;
import java.util.UUID;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.Entity;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.item.ItemStack;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaFire;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -20,7 +12,7 @@ public class OmegaArmourFire extends OmegaArmour
public OmegaArmourFire(int armorType)
{
super(armorType);
this.storeYLevel = true;
// this.storeYLevel = true;
}
@Override
@ -43,16 +35,15 @@ public class OmegaArmourFire extends OmegaArmour
return new ModelOmegaFire(0.5f, false, false, true, false);
}
@Override
public Multimap getAttributeModifiers(ItemStack stack)
{
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));
return map;
}
// @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;
// }
public float getDefaultHealthBoost()
{
@ -70,8 +61,8 @@ 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 getHealthBoostModifierForLevel(int yLevel)
// {
// return (float)Math.sqrt(((float)yLevel)/64f) * 1.5f - 1;
// }
}

View file

@ -116,11 +116,14 @@ public class SigilOfHolding extends EnergyItems
return false;
}
itemUsed.getItem().onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
boolean bool = itemUsed.getItem().onItemUse(par1ItemStack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
saveInternalInventory(par1ItemStack, inv);
return bool;
}
return true;
return false;
}
@Override

View file

@ -83,6 +83,8 @@ public class WaterSigil extends ItemBucket implements ArmourUpgrade
{
return par1ItemStack;
}
System.out.println("Being called");
float f = 1.0F;
double d0 = par3EntityPlayer.prevPosX + (par3EntityPlayer.posX - par3EntityPlayer.prevPosX) * (double) f;