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

@ -106,6 +106,7 @@ public class BloodMagicConfiguration
AlchemicalWizardry.wimpySettings = config.get("WimpySettings", "IDontLikeFun", false).getBoolean(false); AlchemicalWizardry.wimpySettings = config.get("WimpySettings", "IDontLikeFun", false).getBoolean(false);
AlchemicalWizardry.respawnWithDebuff = config.get("WimpySettings", "RespawnWithDebuff", true).getBoolean(); AlchemicalWizardry.respawnWithDebuff = config.get("WimpySettings", "RespawnWithDebuff", true).getBoolean();
AlchemicalWizardry.causeHungerWithRegen = config.get("WimpySettings", "causeHungerWithRegen", true).getBoolean(); AlchemicalWizardry.causeHungerWithRegen = config.get("WimpySettings", "causeHungerWithRegen", true).getBoolean();
AlchemicalWizardry.causeHungerChatMessage = config.get("WimpySettings", "causeHungerChatMessage", true).getBoolean();
// AlchemicalWizardry.lockdownAltar = config.get("WimpySettings", "LockdownAltarWithRegen", true).getBoolean(); // AlchemicalWizardry.lockdownAltar = config.get("WimpySettings", "LockdownAltarWithRegen", true).getBoolean();
AlchemicalWizardry.lockdownAltar = false; AlchemicalWizardry.lockdownAltar = false;

View file

@ -9,6 +9,7 @@ import WayofTime.alchemicalWizardry.common.block.BlockBloodLightSource;
import WayofTime.alchemicalWizardry.common.block.BlockConduit; import WayofTime.alchemicalWizardry.common.block.BlockConduit;
import WayofTime.alchemicalWizardry.common.block.BlockCrystal; import WayofTime.alchemicalWizardry.common.block.BlockCrystal;
import WayofTime.alchemicalWizardry.common.block.BlockDemonPortal; import WayofTime.alchemicalWizardry.common.block.BlockDemonPortal;
import WayofTime.alchemicalWizardry.common.block.BlockEnchantmentGlyph;
import WayofTime.alchemicalWizardry.common.block.BlockHomHeart; import WayofTime.alchemicalWizardry.common.block.BlockHomHeart;
import WayofTime.alchemicalWizardry.common.block.BlockMasterStone; import WayofTime.alchemicalWizardry.common.block.BlockMasterStone;
import WayofTime.alchemicalWizardry.common.block.BlockPedestal; import WayofTime.alchemicalWizardry.common.block.BlockPedestal;
@ -92,6 +93,8 @@ public class ModBlocks
public static Block blockDemonChest; public static Block blockDemonChest;
public static Block blockCrystal; public static Block blockCrystal;
public static Block blockMimic; public static Block blockMimic;
public static Block blockEnchantmentGlyph;
public static void init() public static void init()
{ {
@ -132,6 +135,7 @@ public class ModBlocks
blockMimic = new MimicBlock(); blockMimic = new MimicBlock();
blockLifeEssence = new LifeEssenceBlock(); blockLifeEssence = new LifeEssenceBlock();
blockEnchantmentGlyph = new BlockEnchantmentGlyph();
} }
public static void registerBlocksInPre() public static void registerBlocksInPre()
@ -175,6 +179,7 @@ public class ModBlocks
GameRegistry.registerBlock(ModBlocks.blockDemonChest, "blockDemonChest"); GameRegistry.registerBlock(ModBlocks.blockDemonChest, "blockDemonChest");
GameRegistry.registerBlock(ModBlocks.blockCrystal, ItemCrystalBlock.class, "blockCrystal"); GameRegistry.registerBlock(ModBlocks.blockCrystal, ItemCrystalBlock.class, "blockCrystal");
GameRegistry.registerBlock(ModBlocks.blockMimic, "blockMimic"); GameRegistry.registerBlock(ModBlocks.blockMimic, "blockMimic");
GameRegistry.registerBlock(ModBlocks.blockEnchantmentGlyph, "blockEnchantmentGlyph");
} }
public static void registerBlocksInInit() public static void registerBlocksInInit()

View file

@ -20,6 +20,7 @@ import WayofTime.alchemicalWizardry.common.items.BoundShovel;
import WayofTime.alchemicalWizardry.common.items.CheatyItem; import WayofTime.alchemicalWizardry.common.items.CheatyItem;
import WayofTime.alchemicalWizardry.common.items.CreativeDagger; import WayofTime.alchemicalWizardry.common.items.CreativeDagger;
import WayofTime.alchemicalWizardry.common.items.DaggerOfSacrifice; import WayofTime.alchemicalWizardry.common.items.DaggerOfSacrifice;
import WayofTime.alchemicalWizardry.common.items.DawnScribeTool;
import WayofTime.alchemicalWizardry.common.items.DemonPlacer; import WayofTime.alchemicalWizardry.common.items.DemonPlacer;
import WayofTime.alchemicalWizardry.common.items.DemonicTelepositionFocus; import WayofTime.alchemicalWizardry.common.items.DemonicTelepositionFocus;
import WayofTime.alchemicalWizardry.common.items.DuskScribeTool; import WayofTime.alchemicalWizardry.common.items.DuskScribeTool;
@ -124,6 +125,7 @@ public class ModItems
public static Item fireScribeTool; public static Item fireScribeTool;
public static Item earthScribeTool; public static Item earthScribeTool;
public static Item airScribeTool; public static Item airScribeTool;
public static Item dawnScribeTool;
public static Item activationCrystal; public static Item activationCrystal;
public static Item boundPickaxe; public static Item boundPickaxe;
public static Item boundAxe; public static Item boundAxe;
@ -337,6 +339,8 @@ public class ModItems
itemDestinationClearer = new ItemDestinationClearer().setUnlocalizedName("destinationClearer"); itemDestinationClearer = new ItemDestinationClearer().setUnlocalizedName("destinationClearer");
itemBloodMagicBook = new ItemBMBook().setUnlocalizedName("bmBook"); itemBloodMagicBook = new ItemBMBook().setUnlocalizedName("bmBook");
dawnScribeTool = new DawnScribeTool().setUnlocalizedName("dawnScribeTool");
itemBloodPack = new ItemBloodLetterPack().setUnlocalizedName("itemBloodPack"); itemBloodPack = new ItemBloodLetterPack().setUnlocalizedName("itemBloodPack");
itemHarvestSigil = new ItemHarvestSigil().setUnlocalizedName("itemHarvestSigil"); itemHarvestSigil = new ItemHarvestSigil().setUnlocalizedName("itemHarvestSigil");
itemCompressionSigil = new ItemPackRatSigil().setUnlocalizedName("itemCompressionSigil"); itemCompressionSigil = new ItemPackRatSigil().setUnlocalizedName("itemCompressionSigil");
@ -470,6 +474,8 @@ public class ModItems
GameRegistry.registerItem(ModItems.baseItems, "bloodMagicBaseItems"); GameRegistry.registerItem(ModItems.baseItems, "bloodMagicBaseItems");
GameRegistry.registerItem(ModItems.baseAlchemyItems, "bloodMagicBaseAlchemyItems"); GameRegistry.registerItem(ModItems.baseAlchemyItems, "bloodMagicBaseAlchemyItems");
GameRegistry.registerItem(ModItems.dawnScribeTool, "dawnScribeTool");
GameRegistry.registerItem(ModItems.itemBloodPack, "itemBloodPack"); GameRegistry.registerItem(ModItems.itemBloodPack, "itemBloodPack");
GameRegistry.registerItem(ModItems.itemHarvestSigil, "itemHarvestSigil"); GameRegistry.registerItem(ModItems.itemHarvestSigil, "itemHarvestSigil");
GameRegistry.registerItem(ModItems.itemCompressionSigil, "itemCompressionSigil"); GameRegistry.registerItem(ModItems.itemCompressionSigil, "itemCompressionSigil");

View file

@ -12,6 +12,7 @@ public class RitualComponent
public static final int EARTH = 3; public static final int EARTH = 3;
public static final int AIR = 4; public static final int AIR = 4;
public static final int DUSK = 5; public static final int DUSK = 5;
public static final int DAWN = 6;
public RitualComponent(int x, int y, int z, int stoneType) public RitualComponent(int x, int y, int z, int stoneType)
{ {

View file

@ -0,0 +1,41 @@
package WayofTime.alchemicalWizardry.common.block;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.omega.IEnchantmentGlyph;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph
{
public BlockEnchantmentGlyph()
{
super(Material.iron);
setHardness(2.0F);
setResistance(5.0F);
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
this.setBlockName("enchantmentGlypg");
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister)
{
this.blockIcon = iconRegister.registerIcon("AlchemicalWizardry:LargeBloodStoneBrick");
}
@Override
public int getSubtractedStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount)
{
return faceCount * 20;
}
@Override
public int getEnchantability(World world, int x, int y, int z, int meta)
{
return 1;
}
}

View file

@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.block;
import WayofTime.alchemicalWizardry.AlchemicalWizardry; import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.items.EnergyItems; import WayofTime.alchemicalWizardry.common.items.EnergyItems;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -36,6 +37,10 @@ public class ImperfectRitualStone extends Block
@Override @Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOff, float yOff, float zOff) public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float xOff, float yOff, float zOff)
{ {
if(SpellHelper.isFakePlayer(player))
{
return false;
}
{ {
Block block = world.getBlock(x, y + 1, z); Block block = world.getBlock(x, y + 1, z);

View file

@ -28,6 +28,8 @@ public class RitualStone extends Block implements IRitualStone
private static IIcon airStoneIcon; private static IIcon airStoneIcon;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
private static IIcon duskStoneIcon; private static IIcon duskStoneIcon;
@SideOnly(Side.CLIENT)
private static IIcon dawnStoneIcon;
public RitualStone() public RitualStone()
{ {
@ -48,6 +50,7 @@ public class RitualStone extends Block implements IRitualStone
this.earthStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:EarthRitualStone"); this.earthStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:EarthRitualStone");
this.airStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:AirRitualStone"); this.airStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:AirRitualStone");
this.duskStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:DuskRitualStone"); this.duskStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:DuskRitualStone");
this.dawnStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:LightRitualStone");
} }
@Override @Override
@ -114,6 +117,9 @@ public class RitualStone extends Block implements IRitualStone
case 5: case 5:
return duskStoneIcon; return duskStoneIcon;
case 6:
return dawnStoneIcon;
default: default:
return blankIcon; return blankIcon;
} }

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,11 +725,30 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
return 1.0f; 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; 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) public boolean getIsInvisible(ItemStack armourStack)
{ {
NBTTagCompound tag = armourStack.getTagCompound(); NBTTagCompound tag = armourStack.getTagCompound();

View file

@ -1,6 +1,17 @@
package WayofTime.alchemicalWizardry.common.items.armour; 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.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.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@ -89,7 +100,7 @@ public abstract class OmegaArmour extends BoundArmour
player.inventory.armorInventory[3-this.armorType] = stack; 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); ItemStack omegaStack = new ItemStack(this);
if(boundStack != null && boundStack.hasTagCompound()) if(boundStack != null && boundStack.hasTagCompound())
@ -99,6 +110,107 @@ public abstract class OmegaArmour extends BoundArmour
} }
this.setContainedArmourStack(omegaStack, boundStack); this.setContainedArmourStack(omegaStack, boundStack);
SoulNetworkHandler.checkAndSetItemOwner(omegaStack, SoulNetworkHandler.getOwnerName(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; return omegaStack;
} }

View file

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

View file

@ -116,11 +116,14 @@ public class SigilOfHolding extends EnergyItems
return false; 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); saveInternalInventory(par1ItemStack, inv);
return bool;
} }
return true; return false;
} }
@Override @Override

View file

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

View file

@ -0,0 +1,9 @@
package WayofTime.alchemicalWizardry.common.omega;
import net.minecraft.world.World;
public interface IEnchantmentGlyph
{
public int getSubtractedStabilityForFaceCount(World world, int x, int y, int z, int meta, int faceCount);
public int getEnchantability(World world, int x, int y, int z, int meta);
}

View file

@ -1,5 +1,7 @@
package WayofTime.alchemicalWizardry.common.omega; package WayofTime.alchemicalWizardry.common.omega;
import java.util.Random;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -36,7 +38,7 @@ public class OmegaParadigm
this.config = new ReagentRegenConfiguration(20, 10, 1); this.config = new ReagentRegenConfiguration(20, 10, 1);
} }
public void convertPlayerArmour(EntityPlayer player) public boolean convertPlayerArmour(EntityPlayer player, int x, int y, int z, int stability, int affinity)
{ {
ItemStack[] armours = player.inventory.armorInventory; ItemStack[] armours = player.inventory.armorInventory;
@ -47,16 +49,22 @@ public class OmegaParadigm
if(helmetStack != null && helmetStack.getItem() == ModItems.boundHelmet && chestStack != null && chestStack.getItem() == ModItems.boundPlate && leggingsStack != null && leggingsStack.getItem() == ModItems.boundLeggings && bootsStack != null && bootsStack.getItem() == ModItems.boundBoots) if(helmetStack != null && helmetStack.getItem() == ModItems.boundHelmet && chestStack != null && chestStack.getItem() == ModItems.boundPlate && leggingsStack != null && leggingsStack.getItem() == ModItems.boundLeggings && bootsStack != null && bootsStack.getItem() == ModItems.boundBoots)
{ {
ItemStack omegaHelmetStack = helmet.getSubstituteStack(helmetStack); long worldSeed = player.worldObj.getSeed();
ItemStack omegaChestStack = chestPiece.getSubstituteStack(chestStack); Random rand = new Random(worldSeed + stability * (affinity + 7) * 94 + 84321*x - 17423*y + 76*z);
ItemStack omegaLeggingsStack = leggings.getSubstituteStack(leggingsStack); ItemStack omegaHelmetStack = helmet.getSubstituteStack(helmetStack, stability, affinity, rand);
ItemStack omegaBootsStack = boots.getSubstituteStack(bootsStack); ItemStack omegaChestStack = chestPiece.getSubstituteStack(chestStack, stability, affinity, rand);
ItemStack omegaLeggingsStack = leggings.getSubstituteStack(leggingsStack, stability, affinity, rand);
ItemStack omegaBootsStack = boots.getSubstituteStack(bootsStack, stability, affinity, rand);
armours[3] = omegaHelmetStack; armours[3] = omegaHelmetStack;
armours[2] = omegaChestStack; armours[2] = omegaChestStack;
armours[1] = omegaLeggingsStack; armours[1] = omegaLeggingsStack;
armours[0] = omegaBootsStack; armours[0] = omegaBootsStack;
return true;
} }
return false;
} }
public ReagentRegenConfiguration getRegenConfig(EntityPlayer player) public ReagentRegenConfiguration getRegenConfig(EntityPlayer player)

View file

@ -16,15 +16,9 @@ public class OmegaParadigmFire extends OmegaParadigm
@Override @Override
public float getCostPerTickOfUse(EntityPlayer player) public float getCostPerTickOfUse(EntityPlayer player)
{
if(player.isAirBorne)
{
return 0.5f;
}else
{ {
return 1; return 1;
} }
}
@Override @Override
public void onUpdate(World world, EntityPlayer player, ItemStack stack) public void onUpdate(World world, EntityPlayer player, ItemStack stack)

View file

@ -0,0 +1,225 @@
package WayofTime.alchemicalWizardry.common.omega;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.ModBlocks;
public class OmegaStructureHandler
{
public static final OmegaStructureParameters emptyParam = new OmegaStructureParameters(0, 0);
public static boolean isStructureIntact(World world, int x, int y, int z)
{
return true;
}
public static OmegaStructureParameters getStructureStabilityFactor(World world, int x, int y, int z, int expLim)
{
int range = expLim;
int[][][] boolList = new int[range * 2 + 1][range * 2 + 1][range * 2 + 1]; //0 indicates unchecked, 1 indicates checked and is air, -1 indicates checked to be right next to air blocks in question but is NOT air
for (int i = 0; i < 2 * range + 1; i++)
{
for (int j = 0; j < 2 * range + 1; j++)
{
for (int k = 0; k < 2 * range + 1; k++)
{
boolList[i][j][k] = 0;
}
}
}
boolList[range][range][range] = 1;
boolean isReady = false;
while (!isReady)
{
isReady = true;
for (int i = 0; i < 2 * range + 1; i++)
{
for (int j = 0; j < 2 * range + 1; j++)
{
for (int k = 0; k < 2 * range + 1; k++)
{
if (boolList[i][j][k] == 1)
{
if (i - 1 >= 0 && !(boolList[i - 1][j][k] == 1 || boolList[i - 1][j][k] == -1))
{
Block block = world.getBlock(x - range + i - 1, y - range + j, z - range + k);
if (world.isAirBlock(x - range + i - 1, y - range + j, z - range + k) || block == ModBlocks.blockSpectralContainer)
{
if(i - 1 == 0) //One of the found air blocks is at the range boundary, and thus the container is incomplete
{
return emptyParam;
}
boolList[i - 1][j][k] = 1;
isReady = false;
}else
{
boolList[i - 1][j][k] = -1;
}
}
if (j - 1 >= 0 && !(boolList[i][j - 1][k] == 1 || boolList[i][j - 1][k] == -1))
{
Block block = world.getBlock(x - range + i, y - range + j - 1, z - range + k);
if (world.isAirBlock(x - range + i, y - range + j - 1, z - range + k) || block == ModBlocks.blockSpectralContainer)
{
if(j - 1 == 0)
{
return emptyParam;
}
boolList[i][j - 1][k] = 1;
isReady = false;
}else
{
boolList[i][j - 1][k] = -1;
}
}
if (k - 1 >= 0 && !(boolList[i][j][k - 1] == 1 || boolList[i][j][k - 1] == -1))
{
Block block = world.getBlock(x - range + i, y - range + j, z - range + k - 1);
if (world.isAirBlock(x - range + i, y - range + j, z - range + k - 1) || block == ModBlocks.blockSpectralContainer)
{
if(k - 1 == 0)
{
return emptyParam;
}
boolList[i][j][k - 1] = 1;
isReady = false;
}else
{
boolList[i][j][k - 1] = -1;
}
}
if (i + 1 <= 2 * range && !(boolList[i + 1][j][k] == 1 || boolList[i + 1][j][k] == -1))
{
Block block = world.getBlock(x - range + i + 1, y - range + j, z - range + k);
if (world.isAirBlock(x - range + i + 1, y - range + j, z - range + k) || block == ModBlocks.blockSpectralContainer)
{
if(i + 1 == range * 2)
{
return emptyParam;
}
boolList[i + 1][j][k] = 1;
isReady = false;
}else
{
boolList[i + 1][j][k] = -1;
}
}
if (j + 1 <= 2 * range && !(boolList[i][j + 1][k] == 1 || boolList[i][j + 1][k] == -1))
{
Block block = world.getBlock(x - range + i, y - range + j + 1, z - range + k);
if (world.isAirBlock(x - range + i, y - range + j + 1, z - range + k) || block == ModBlocks.blockSpectralContainer)
{
if(j + 1 == range * 2)
{
return emptyParam;
}
boolList[i][j + 1][k] = 1;
isReady = false;
}else
{
boolList[i][j + 1][k] = -1;
}
}
if (k + 1 <= 2 * range && !(boolList[i][j][k + 1] == 1 || boolList[i][j][k + 1] == -1))
{
Block block = world.getBlock(x - range + i, y - range + j, z - range + k + 1);
if (world.isAirBlock(x - range + i, y - range + j, z - range + k + 1) || block == ModBlocks.blockSpectralContainer)
{
if(k + 1 == range * 2)
{
return emptyParam;
}
boolList[i][j][k + 1] = 1;
isReady = false;
}else
{
boolList[i][j][k + 1] = -1;
}
}
}
}
}
}
}
int tally = 0;
int enchantability = 0;
for (int i = 0; i < 2 * range + 1; i++)
{
for (int j = 0; j < 2 * range + 1; j++)
{
for (int k = 0; k < 2 * range + 1; k++)
{
if (boolList[i][j][k] != -1)
{
continue;
}
int indTally = 0;
if (i - 1 >= 0 && boolList[i - 1][j][k] == 1)
{
indTally++;
}
if (j - 1 >= 0 && boolList[i][j - 1][k] == 1)
{
indTally++;
}
if (k - 1 >= 0 && boolList[i][j][k - 1] == 1)
{
indTally++;
}
if (i + 1 <= 2 * range && boolList[i + 1][j][k] == 1)
{
indTally++;
}
if (j + 1 <= 2 * range && boolList[i][j + 1][k] == 1)
{
indTally++;
}
if (k + 1 <= 2 * range && boolList[i][j][k + 1] == 1)
{
indTally++;
}
Block block = world.getBlock(x - range + i, y - range + j, z - range + k);
int meta = 0;
if(block instanceof IEnchantmentGlyph)
{
tally -= ((IEnchantmentGlyph)block).getSubtractedStabilityForFaceCount(world, x-range+i, y-range+j, z-range+k, meta, indTally);
enchantability += ((IEnchantmentGlyph)block).getEnchantability(world, x-range+i, y-range+j, z-range+k, meta);
}else
{
tally += indTally;
}
// Block block = world.getBlock(x + i - range, y + j - range, z + k - range);
//
// if (block == ModBlocks.blockSpectralContainer)
// {
// world.setBlockToAir(x + i - range, y + j - range, z + k - range);
// }
}
}
}
return new OmegaStructureParameters(tally, enchantability);
}
}

View file

@ -0,0 +1,13 @@
package WayofTime.alchemicalWizardry.common.omega;
public class OmegaStructureParameters
{
public final int stability;
public final int enchantability;
public OmegaStructureParameters(int stability, int enchantability)
{
this.stability = stability;
this.enchantability = enchantability;
}
}

View file

@ -6,6 +6,7 @@ import java.util.List;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.world.World; import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.api.Int3;
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent; import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry; import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone; import WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone;
@ -16,6 +17,8 @@ import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
import WayofTime.alchemicalWizardry.common.NewPacketHandler; import WayofTime.alchemicalWizardry.common.NewPacketHandler;
import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm; import WayofTime.alchemicalWizardry.common.omega.OmegaParadigm;
import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry; import WayofTime.alchemicalWizardry.common.omega.OmegaRegistry;
import WayofTime.alchemicalWizardry.common.omega.OmegaStructureHandler;
import WayofTime.alchemicalWizardry.common.omega.OmegaStructureParameters;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper; import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
public class RitualEffectOmegaTest extends RitualEffect public class RitualEffectOmegaTest extends RitualEffect
@ -31,23 +34,30 @@ public class RitualEffectOmegaTest extends RitualEffect
int x = ritualStone.getXCoord(); int x = ritualStone.getXCoord();
int y = ritualStone.getYCoord(); int y = ritualStone.getYCoord();
int z = ritualStone.getZCoord(); int z = ritualStone.getZCoord();
//
// if (world.getWorldTime() % 200 != 0)
// {
// return;
// }
double range = 2; if (world.getWorldTime() % 200 != 0)
{
return;
}
List<EntityPlayer> playerList = SpellHelper.getPlayersInRange(world, x + 0.5, y + 0.5, z + 0.5, range, range); OmegaStructureParameters param = OmegaStructureHandler.getStructureStabilityFactor(world, x, y, z, 5);
int stab = param.stability;
System.out.println("Stability: " + stab);
double range = 0.5;
List<EntityPlayer> playerList = SpellHelper.getPlayersInRange(world, x + 0.5, y + 1.5, z + 0.5, range, range);
for(EntityPlayer player : playerList) for(EntityPlayer player : playerList)
{ {
Reagent reagent = ReagentRegistry.aetherReagent; Reagent reagent = ReagentRegistry.incendiumReagent;
int affinity = 0;
OmegaParadigm waterParadigm = OmegaRegistry.getParadigmForReagent(reagent); OmegaParadigm waterParadigm = OmegaRegistry.getParadigmForReagent(reagent);
waterParadigm.convertPlayerArmour(player); if(waterParadigm != null && waterParadigm.convertPlayerArmour(player, x, y, z, stab, affinity))
{
APISpellHelper.setPlayerCurrentReagentAmount(player, tickDuration); APISpellHelper.setPlayerCurrentReagentAmount(player, tickDuration);
APISpellHelper.setPlayerMaxReagentAmount(player, tickDuration); APISpellHelper.setPlayerMaxReagentAmount(player, tickDuration);
APISpellHelper.setPlayerReagentType(player, reagent); APISpellHelper.setPlayerReagentType(player, reagent);
@ -55,6 +65,7 @@ public class RitualEffectOmegaTest extends RitualEffect
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getReagentBarPacket(reagent, APISpellHelper.getPlayerCurrentReagentAmount(player), APISpellHelper.getPlayerMaxReagentAmount(player)), (EntityPlayerMP)player); NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getReagentBarPacket(reagent, APISpellHelper.getPlayerCurrentReagentAmount(player), APISpellHelper.getPlayerMaxReagentAmount(player)), (EntityPlayerMP)player);
} }
} }
}
@Override @Override
public int getCostPerRefresh() public int getCostPerRefresh()
@ -84,4 +95,21 @@ public class RitualEffectOmegaTest extends RitualEffect
animalGrowthRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.AIR)); animalGrowthRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.AIR));
return animalGrowthRitual; return animalGrowthRitual;
} }
public Int3 getJarLocation(int i)
{
switch(i)
{
case 0:
return new Int3(-3,1,0);
case 1:
return new Int3(3,1,0);
case 2:
return new Int3(0,1,-3);
case 3:
return new Int3(0,1,3);
default:
return new Int3(0,0,0);
}
}
} }

View file

@ -628,7 +628,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration); PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration);
if (regenEffect != null && regenEffect.getAmplifier() > 0) if (regenEffect != null && regenEffect.getAmplifier() > 0)
{ {
if(AlchemicalWizardry.causeHungerChatMessage && player.getActivePotionEffect(Potion.hunger) == null) if(AlchemicalWizardry.causeHungerChatMessage && !player.isPotionActive(Potion.hunger.id))
{ {
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.altar.hunger"))); player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.altar.hunger")));
} }

View file

@ -189,7 +189,15 @@ public class TEWritingTable extends TileEntity implements IInventory, ISidedInve
@Override @Override
public boolean isItemValidForSlot(int i, ItemStack itemstack) public boolean isItemValidForSlot(int i, ItemStack itemstack)
{ {
return false; switch(i)
{
case 0:
if(itemstack != null)
{
return itemstack.getItem() instanceof IBloodOrb;
}
}
return i != 6;
} }
@Override @Override
@ -903,6 +911,6 @@ public class TEWritingTable extends TileEntity implements IInventory, ISidedInve
@Override @Override
public boolean canExtractItem(int slot, ItemStack stack, int side) public boolean canExtractItem(int slot, ItemStack stack, int side)
{ {
return true; return slot == 6;
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB