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:
parent
60ae47c499
commit
ab8d25db76
|
@ -106,6 +106,7 @@ public class BloodMagicConfiguration
|
|||
AlchemicalWizardry.wimpySettings = config.get("WimpySettings", "IDontLikeFun", false).getBoolean(false);
|
||||
AlchemicalWizardry.respawnWithDebuff = config.get("WimpySettings", "RespawnWithDebuff", 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 = false;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import WayofTime.alchemicalWizardry.common.block.BlockBloodLightSource;
|
|||
import WayofTime.alchemicalWizardry.common.block.BlockConduit;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockCrystal;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockDemonPortal;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockEnchantmentGlyph;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockHomHeart;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockMasterStone;
|
||||
import WayofTime.alchemicalWizardry.common.block.BlockPedestal;
|
||||
|
@ -92,6 +93,8 @@ public class ModBlocks
|
|||
public static Block blockDemonChest;
|
||||
public static Block blockCrystal;
|
||||
public static Block blockMimic;
|
||||
public static Block blockEnchantmentGlyph;
|
||||
|
||||
|
||||
public static void init()
|
||||
{
|
||||
|
@ -132,6 +135,7 @@ public class ModBlocks
|
|||
blockMimic = new MimicBlock();
|
||||
|
||||
blockLifeEssence = new LifeEssenceBlock();
|
||||
blockEnchantmentGlyph = new BlockEnchantmentGlyph();
|
||||
}
|
||||
|
||||
public static void registerBlocksInPre()
|
||||
|
@ -175,6 +179,7 @@ public class ModBlocks
|
|||
GameRegistry.registerBlock(ModBlocks.blockDemonChest, "blockDemonChest");
|
||||
GameRegistry.registerBlock(ModBlocks.blockCrystal, ItemCrystalBlock.class, "blockCrystal");
|
||||
GameRegistry.registerBlock(ModBlocks.blockMimic, "blockMimic");
|
||||
GameRegistry.registerBlock(ModBlocks.blockEnchantmentGlyph, "blockEnchantmentGlyph");
|
||||
}
|
||||
|
||||
public static void registerBlocksInInit()
|
||||
|
|
|
@ -20,6 +20,7 @@ import WayofTime.alchemicalWizardry.common.items.BoundShovel;
|
|||
import WayofTime.alchemicalWizardry.common.items.CheatyItem;
|
||||
import WayofTime.alchemicalWizardry.common.items.CreativeDagger;
|
||||
import WayofTime.alchemicalWizardry.common.items.DaggerOfSacrifice;
|
||||
import WayofTime.alchemicalWizardry.common.items.DawnScribeTool;
|
||||
import WayofTime.alchemicalWizardry.common.items.DemonPlacer;
|
||||
import WayofTime.alchemicalWizardry.common.items.DemonicTelepositionFocus;
|
||||
import WayofTime.alchemicalWizardry.common.items.DuskScribeTool;
|
||||
|
@ -124,6 +125,7 @@ public class ModItems
|
|||
public static Item fireScribeTool;
|
||||
public static Item earthScribeTool;
|
||||
public static Item airScribeTool;
|
||||
public static Item dawnScribeTool;
|
||||
public static Item activationCrystal;
|
||||
public static Item boundPickaxe;
|
||||
public static Item boundAxe;
|
||||
|
@ -337,6 +339,8 @@ public class ModItems
|
|||
itemDestinationClearer = new ItemDestinationClearer().setUnlocalizedName("destinationClearer");
|
||||
itemBloodMagicBook = new ItemBMBook().setUnlocalizedName("bmBook");
|
||||
|
||||
dawnScribeTool = new DawnScribeTool().setUnlocalizedName("dawnScribeTool");
|
||||
|
||||
itemBloodPack = new ItemBloodLetterPack().setUnlocalizedName("itemBloodPack");
|
||||
itemHarvestSigil = new ItemHarvestSigil().setUnlocalizedName("itemHarvestSigil");
|
||||
itemCompressionSigil = new ItemPackRatSigil().setUnlocalizedName("itemCompressionSigil");
|
||||
|
@ -470,6 +474,8 @@ public class ModItems
|
|||
GameRegistry.registerItem(ModItems.baseItems, "bloodMagicBaseItems");
|
||||
GameRegistry.registerItem(ModItems.baseAlchemyItems, "bloodMagicBaseAlchemyItems");
|
||||
|
||||
GameRegistry.registerItem(ModItems.dawnScribeTool, "dawnScribeTool");
|
||||
|
||||
GameRegistry.registerItem(ModItems.itemBloodPack, "itemBloodPack");
|
||||
GameRegistry.registerItem(ModItems.itemHarvestSigil, "itemHarvestSigil");
|
||||
GameRegistry.registerItem(ModItems.itemCompressionSigil, "itemCompressionSigil");
|
||||
|
|
|
@ -12,6 +12,7 @@ public class RitualComponent
|
|||
public static final int EARTH = 3;
|
||||
public static final int AIR = 4;
|
||||
public static final int DUSK = 5;
|
||||
public static final int DAWN = 6;
|
||||
|
||||
public RitualComponent(int x, int y, int z, int stoneType)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ package WayofTime.alchemicalWizardry.common.block;
|
|||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
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.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -36,6 +37,10 @@ public class ImperfectRitualStone extends Block
|
|||
@Override
|
||||
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);
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ public class RitualStone extends Block implements IRitualStone
|
|||
private static IIcon airStoneIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static IIcon duskStoneIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private static IIcon dawnStoneIcon;
|
||||
|
||||
public RitualStone()
|
||||
{
|
||||
|
@ -48,6 +50,7 @@ public class RitualStone extends Block implements IRitualStone
|
|||
this.earthStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:EarthRitualStone");
|
||||
this.airStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:AirRitualStone");
|
||||
this.duskStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:DuskRitualStone");
|
||||
this.dawnStoneIcon = iconRegister.registerIcon("AlchemicalWizardry:LightRitualStone");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -113,6 +116,9 @@ public class RitualStone extends Block implements IRitualStone
|
|||
|
||||
case 5:
|
||||
return duskStoneIcon;
|
||||
|
||||
case 6:
|
||||
return dawnStoneIcon;
|
||||
|
||||
default:
|
||||
return blankIcon;
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.omega;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -36,7 +38,7 @@ public class OmegaParadigm
|
|||
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;
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
ItemStack omegaHelmetStack = helmet.getSubstituteStack(helmetStack);
|
||||
ItemStack omegaChestStack = chestPiece.getSubstituteStack(chestStack);
|
||||
ItemStack omegaLeggingsStack = leggings.getSubstituteStack(leggingsStack);
|
||||
ItemStack omegaBootsStack = boots.getSubstituteStack(bootsStack);
|
||||
long worldSeed = player.worldObj.getSeed();
|
||||
Random rand = new Random(worldSeed + stability * (affinity + 7) * 94 + 84321*x - 17423*y + 76*z);
|
||||
ItemStack omegaHelmetStack = helmet.getSubstituteStack(helmetStack, stability, affinity, rand);
|
||||
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[2] = omegaChestStack;
|
||||
armours[1] = omegaLeggingsStack;
|
||||
armours[0] = omegaBootsStack;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public ReagentRegenConfiguration getRegenConfig(EntityPlayer player)
|
||||
|
|
|
@ -17,13 +17,7 @@ public class OmegaParadigmFire extends OmegaParadigm
|
|||
@Override
|
||||
public float getCostPerTickOfUse(EntityPlayer player)
|
||||
{
|
||||
if(player.isAirBorne)
|
||||
{
|
||||
return 0.5f;
|
||||
}else
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -6,6 +6,7 @@ import java.util.List;
|
|||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.world.World;
|
||||
import WayofTime.alchemicalWizardry.api.Int3;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.Reagent;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentRegistry;
|
||||
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.omega.OmegaParadigm;
|
||||
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;
|
||||
|
||||
public class RitualEffectOmegaTest extends RitualEffect
|
||||
|
@ -31,28 +34,36 @@ public class RitualEffectOmegaTest extends RitualEffect
|
|||
int x = ritualStone.getXCoord();
|
||||
int y = ritualStone.getYCoord();
|
||||
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)
|
||||
{
|
||||
Reagent reagent = ReagentRegistry.aetherReagent;
|
||||
Reagent reagent = ReagentRegistry.incendiumReagent;
|
||||
|
||||
int affinity = 0;
|
||||
|
||||
OmegaParadigm waterParadigm = OmegaRegistry.getParadigmForReagent(reagent);
|
||||
waterParadigm.convertPlayerArmour(player);
|
||||
|
||||
APISpellHelper.setPlayerCurrentReagentAmount(player, tickDuration);
|
||||
APISpellHelper.setPlayerMaxReagentAmount(player, tickDuration);
|
||||
APISpellHelper.setPlayerReagentType(player, reagent);
|
||||
APISpellHelper.setCurrentAdditionalMaxHP(player, waterParadigm.getMaxAdditionalHealth());
|
||||
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getReagentBarPacket(reagent, APISpellHelper.getPlayerCurrentReagentAmount(player), APISpellHelper.getPlayerMaxReagentAmount(player)), (EntityPlayerMP)player);
|
||||
if(waterParadigm != null && waterParadigm.convertPlayerArmour(player, x, y, z, stab, affinity))
|
||||
{
|
||||
APISpellHelper.setPlayerCurrentReagentAmount(player, tickDuration);
|
||||
APISpellHelper.setPlayerMaxReagentAmount(player, tickDuration);
|
||||
APISpellHelper.setPlayerReagentType(player, reagent);
|
||||
APISpellHelper.setCurrentAdditionalMaxHP(player, waterParadigm.getMaxAdditionalHealth());
|
||||
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getReagentBarPacket(reagent, APISpellHelper.getPlayerCurrentReagentAmount(player), APISpellHelper.getPlayerMaxReagentAmount(player)), (EntityPlayerMP)player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,4 +95,21 @@ public class RitualEffectOmegaTest extends RitualEffect
|
|||
animalGrowthRitual.add(new RitualComponent(-2, 0, -1, RitualComponent.AIR));
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -628,7 +628,7 @@ public class TEAltar extends TileEntity implements IInventory, IFluidTank, IFlui
|
|||
PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration);
|
||||
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")));
|
||||
}
|
||||
|
|
|
@ -189,7 +189,15 @@ public class TEWritingTable extends TileEntity implements IInventory, ISidedInve
|
|||
@Override
|
||||
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
|
||||
|
@ -903,6 +911,6 @@ public class TEWritingTable extends TileEntity implements IInventory, ISidedInve
|
|||
@Override
|
||||
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 |
Loading…
Reference in a new issue