General toying with the enchantments for the Omega armour, tweaked the ritual diviner's functionality, fixed teleposers not teleposing players in certain circumstances.

This commit is contained in:
WayofTime 2015-04-08 09:52:51 -04:00
parent bab6e576d2
commit ab0c49f8c7
35 changed files with 360 additions and 69 deletions

View file

@ -1507,6 +1507,7 @@ public class AlchemicalWizardry
{
StorageBlockCraftingManager.getInstance().addStorageBlockRecipes();
CompressionRegistry.registerHandler(new BaseCompressionHandler(new ItemStack(Items.glowstone_dust, 4, 0), new ItemStack(Blocks.glowstone), 64));
CompressionRegistry.registerHandler(new BaseCompressionHandler(new ItemStack(Items.snowball, 4, 0), new ItemStack(Blocks.snow), 8));
CompressionRegistry.registerHandler(new AdvancedCompressionHandler());
CompressionRegistry.registerItemThreshold(new ItemStack(Blocks.cobblestone), 64);

View file

@ -111,6 +111,7 @@ public class AlchemicalWizardryEventHooks
{
float recalculatedAmount = ArmorProperties.ApplyArmor(player, player.inventory.armorInventory, event.source, event.ammount);
if (recalculatedAmount <= 0) return;
recalculatedAmount = SpellHelper.applyPotionDamageCalculations(player, event.source, recalculatedAmount);
float ratio = recalculatedAmount / event.ammount;

View file

@ -17,7 +17,6 @@ import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.tileEntity.TEMimicBlock;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -29,7 +28,6 @@ public class MimicBlock extends BlockContainer
super(Material.water);
setHardness(2.0F);
setResistance(5.0F);
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
this.setBlockName("blockMimic");
// this.setBlockBounds(0, 0, 0, 0, 0, 0);
}

View file

@ -34,7 +34,7 @@ public class AdvancedCompressionHandler extends CompressionHandler
int threshold = CompressionRegistry.getItemThreshold(invStack);
int needed = i*i;
int neededLeft = iterateThroughInventory(invStack, threshold, inv, needed, false);
int neededLeft = iterateThroughInventory(invStack, threshold + invStack.getMaxStackSize() - needed, inv, needed, false);
if(neededLeft <= 0)
{
iterateThroughInventory(invStack, 0, inv, needed, true);

View file

@ -7,8 +7,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
public class CreativeDagger extends Item
{
@ -55,7 +55,7 @@ public class CreativeDagger extends Item
int posX = (int) Math.round(player.posX - 0.5f);
int posY = (int) player.posY;
int posZ = (int) Math.round(player.posZ - 0.5f);
TEAltar altarEntity = getAltar(world, posX, posY, posZ);
IBloodAltar altarEntity = getAltar(world, posX, posY, posZ);
if (altarEntity == null)
{
@ -66,7 +66,7 @@ public class CreativeDagger extends Item
altarEntity.startCycle();
}
public TEAltar getAltar(World world, int x, int y, int z)
public IBloodAltar getAltar(World world, int x, int y, int z)
{
TileEntity tileEntity = null;
@ -103,3 +103,4 @@ public class CreativeDagger extends Item
return null;
}
}

View file

@ -41,6 +41,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
setEnergyUsed(100);
this.setCreativeTab(AlchemicalWizardry.tabBloodMagic);
this.maxMetaData = 4;
this.hasSubtypes = true;
}
@Override
@ -87,6 +88,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
int fireStones = 0;
int earthStones = 0;
int duskStones = 0;
int dawnStones = 0;
for (RitualComponent rc : ritualList)
{
@ -115,6 +117,10 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
case RitualComponent.DUSK:
duskStones++;
break;
case RitualComponent.DAWN:
dawnStones++;
break;
}
}
@ -124,6 +130,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
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.GOLD + StatCollector.translateToLocal("tooltip.ritualdiviner.dawnstones") + " " + dawnStones);
}
}else
{
@ -283,16 +290,16 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
{
rotateRituals(player.worldObj, player, stack, false);
}
else
{
if (!player.worldObj.isRemote)
{
int direction = this.getDirection(stack) - 1;
if (direction == 0) direction = 4;
this.setDirection(stack, direction);
player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip.ritualdiviner.ritualtunedto") + " " + this.getNameForDirection(direction)));
}
}
// else
// {
// if (!player.worldObj.isRemote)
// {
// int direction = this.getDirection(stack) - 1;
// if (direction == 0) direction = 4;
// this.setDirection(stack, direction);
// player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("tooltip.ritualdiviner.ritualtunedto") + " " + this.getNameForDirection(direction)));
// }
// }
}
}
@ -338,23 +345,13 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
@Override
public int getMaxRuneDisplacement(ItemStack par1ItemStack) //0 indicates the starting 4 runes, 1 indicates it can use Dusk runes
{
if (par1ItemStack.getTagCompound() == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
return par1ItemStack.getTagCompound().getInteger("maxRuneDisplacement");
return par1ItemStack.getItemDamage();
}
@Override
public void setMaxRuneDisplacement(ItemStack par1ItemStack, int displacement)
{
if (par1ItemStack.getTagCompound() == null)
{
par1ItemStack.setTagCompound(new NBTTagCompound());
}
par1ItemStack.getTagCompound().setInteger("maxRuneDisplacement", displacement);
par1ItemStack.setItemDamage(displacement);
}
@Override

View file

@ -100,7 +100,7 @@ public abstract class OmegaArmour extends BoundArmour
player.inventory.armorInventory[3-this.armorType] = stack;
}
public ItemStack getSubstituteStack(ItemStack boundStack, int stability, int affinity, Random rand)
public ItemStack getSubstituteStack(ItemStack boundStack, int stability, int affinity, int enchantability, Random rand)
{
ItemStack omegaStack = new ItemStack(this);
if(boundStack != null && boundStack.hasTagCompound())
@ -110,13 +110,17 @@ public abstract class OmegaArmour extends BoundArmour
}
this.setContainedArmourStack(omegaStack, boundStack);
SoulNetworkHandler.checkAndSetItemOwner(omegaStack, SoulNetworkHandler.getOwnerName(boundStack));
this.setItemEnchantability(omegaStack, 50);
this.setItemEnchantability(omegaStack, 70);
List enchantList = new ArrayList();
for(int i=0; i<10; i++)
for(int i=0; i<100; i++)
{
enchantList.addAll(EnchantmentHelper.buildEnchantmentList(rand, omegaStack, 30));
List lst = EnchantmentHelper.buildEnchantmentList(rand, omegaStack, 30);
if(lst != null)
{
enchantList.addAll(lst);
}
}
Map<Enchantment, Map<Integer, Integer>> map = new HashMap();

View file

@ -3,10 +3,13 @@ package WayofTime.alchemicalWizardry.common.items.armour;
import java.util.UUID;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
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 WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaEarth;
import com.google.common.collect.HashMultimap;
@ -17,6 +20,11 @@ import cpw.mods.fml.relauncher.SideOnly;
public class OmegaArmourEarth extends OmegaArmour
{
private static IIcon helmetIcon;
private static IIcon plateIcon;
private static IIcon leggingsIcon;
private static IIcon bootsIcon;
public OmegaArmourEarth(int armorType)
{
super(armorType);
@ -42,6 +50,44 @@ public class OmegaArmourEarth extends OmegaArmour
return new ModelOmegaEarth(0.5f, false, false, true, false);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_earth");
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_earth");
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_earth");
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_earth");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (this.equals(ModItems.boundHelmetEarth))
{
return this.helmetIcon;
}
if (this.equals(ModItems.boundPlateEarth))
{
return this.plateIcon;
}
if (this.equals(ModItems.boundLeggingsEarth))
{
return this.leggingsIcon;
}
if (this.equals(ModItems.boundBootsEarth))
{
return this.bootsIcon;
}
return this.itemIcon;
}
@Override
public Multimap getItemAttributeModifiers()
{

View file

@ -1,14 +1,22 @@
package WayofTime.alchemicalWizardry.common.items.armour;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaFire;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class OmegaArmourFire extends OmegaArmour
{
private static IIcon helmetIcon;
private static IIcon plateIcon;
private static IIcon leggingsIcon;
private static IIcon bootsIcon;
public OmegaArmourFire(int armorType)
{
super(armorType);
@ -35,6 +43,44 @@ public class OmegaArmourFire extends OmegaArmour
return new ModelOmegaFire(0.5f, false, false, true, false);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_fire");
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_fire");
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_fire");
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_fire");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (this.equals(ModItems.boundHelmetFire))
{
return this.helmetIcon;
}
if (this.equals(ModItems.boundPlateFire))
{
return this.plateIcon;
}
if (this.equals(ModItems.boundLeggingsFire))
{
return this.leggingsIcon;
}
if (this.equals(ModItems.boundBootsFire))
{
return this.bootsIcon;
}
return this.itemIcon;
}
// @Override
// public Multimap getAttributeModifiers(ItemStack stack)
// {

View file

@ -8,15 +8,23 @@ import com.google.common.collect.Multimap;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
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.ModelOmegaWater;
public class OmegaArmourWater extends OmegaArmour
{
private static IIcon helmetIcon;
private static IIcon plateIcon;
private static IIcon leggingsIcon;
private static IIcon bootsIcon;
public OmegaArmourWater(int armorType)
{
super(armorType);
@ -43,6 +51,44 @@ public class OmegaArmourWater extends OmegaArmour
return new ModelOmegaWater(0.5f, false, false, true, false);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_water");
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_water");
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_water");
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_water");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (this.equals(ModItems.boundHelmetWater))
{
return this.helmetIcon;
}
if (this.equals(ModItems.boundPlateWater))
{
return this.plateIcon;
}
if (this.equals(ModItems.boundLeggingsWater))
{
return this.leggingsIcon;
}
if (this.equals(ModItems.boundBootsWater))
{
return this.bootsIcon;
}
return this.itemIcon;
}
@Override
public Multimap getAttributeModifiers(ItemStack stack)
{

View file

@ -3,10 +3,13 @@ package WayofTime.alchemicalWizardry.common.items.armour;
import java.util.UUID;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
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 WayofTime.alchemicalWizardry.ModItems;
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaWind;
import com.google.common.collect.HashMultimap;
@ -17,6 +20,11 @@ import cpw.mods.fml.relauncher.SideOnly;
public class OmegaArmourWind extends OmegaArmour
{
private static IIcon helmetIcon;
private static IIcon plateIcon;
private static IIcon leggingsIcon;
private static IIcon bootsIcon;
public OmegaArmourWind(int armorType)
{
super(armorType);
@ -43,6 +51,44 @@ public class OmegaArmourWind extends OmegaArmour
return new ModelOmegaWind(0.5f, false, false, true, false);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:SheathedItem");
this.helmetIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaHelmet_wind");
this.plateIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaPlate_wind");
this.leggingsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaLeggings_wind");
this.bootsIcon = iconRegister.registerIcon("AlchemicalWizardry:OmegaBoots_wind");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIconFromDamage(int par1)
{
if (this.equals(ModItems.boundHelmetWind))
{
return this.helmetIcon;
}
if (this.equals(ModItems.boundPlateWind))
{
return this.plateIcon;
}
if (this.equals(ModItems.boundLeggingsWind))
{
return this.leggingsIcon;
}
if (this.equals(ModItems.boundBootsWind))
{
return this.bootsIcon;
}
return this.itemIcon;
}
@Override
public Multimap getAttributeModifiers(ItemStack stack)
{

View file

@ -38,7 +38,7 @@ public class OmegaParadigm
this.config = new ReagentRegenConfiguration(20, 10, 1);
}
public boolean convertPlayerArmour(EntityPlayer player, int x, int y, int z, int stability, int affinity)
public boolean convertPlayerArmour(EntityPlayer player, int x, int y, int z, int stability, int affinity, int enchantability)
{
ItemStack[] armours = player.inventory.armorInventory;
@ -50,11 +50,11 @@ 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)
{
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);
Random rand = new Random(worldSeed + stability * (affinity + 7) * 94 + 84321*x - 17423*y + 76*z - 1623451*enchantability);
ItemStack omegaHelmetStack = helmet.getSubstituteStack(helmetStack, stability, affinity, enchantability, rand);
ItemStack omegaChestStack = chestPiece.getSubstituteStack(chestStack, stability, affinity, enchantability, rand);
ItemStack omegaLeggingsStack = leggings.getSubstituteStack(leggingsStack, stability, affinity, enchantability, rand);
ItemStack omegaBootsStack = boots.getSubstituteStack(bootsStack, stability, affinity, enchantability, rand);
armours[3] = omegaHelmetStack;
armours[2] = omegaChestStack;

View file

@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.omega;
import net.minecraft.block.Block;
import net.minecraft.world.World;
import WayofTime.alchemicalWizardry.ModBlocks;
import WayofTime.alchemicalWizardry.api.Int3;
public class OmegaStructureHandler
{
@ -13,9 +14,9 @@ public class OmegaStructureHandler
return true;
}
public static OmegaStructureParameters getStructureStabilityFactor(World world, int x, int y, int z, int expLim)
public static OmegaStructureParameters getStructureStabilityFactor(World world, int x, int y, int z, int expLim, Int3 offset)
{
int range = 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
@ -30,7 +31,7 @@ public class OmegaStructureHandler
}
}
boolList[range][range][range] = 1;
boolList[range + offset.xCoord][range + offset.yCoord][range + offset.zCoord] = 1;
boolean isReady = false;
while (!isReady)
@ -208,13 +209,6 @@ public class OmegaStructureHandler
{
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);
// }
}
}
}
@ -222,4 +216,9 @@ public class OmegaStructureHandler
return new OmegaStructureParameters(tally, enchantability);
}
public static OmegaStructureParameters getStructureStabilityFactor(World world, int x, int y, int z, int expLim)
{
return getStructureStabilityFactor(world, x, y, z, expLim, new Int3(0, 0, 0));
}
}

View file

@ -43,21 +43,8 @@ public class RitualEffectItemRouting extends RitualEffect
return;
}
int xBufOffset = 0;
int yBufOffset = 1;
int zBufOffset = 0;
// TileEntity bufferTile = world.getTileEntity(x + xBufOffset, y + yBufOffset, z + zBufOffset);
//
// if(!(bufferTile instanceof IInventory))
// {
// return;
// }
Map<Int3, IInventory> tileMap = new HashMap();
// IInventory bufferInventory = (IInventory)bufferTile;
List<IInventory> outputList = new ArrayList();
for(int i=0; i<4; i++) //Check output foci chests, return if none available
{

View file

@ -54,7 +54,7 @@ public class RitualEffectOmegaStalling extends RitualEffect
OmegaParadigm parad = OmegaRegistry.getParadigmForReagent(reagent);
if(parad != null)
{
parad.setOmegaStalling(player, 30);
parad.setOmegaStalling(player, 100);
SoulNetworkHandler.syphonFromNetwork(owner, getCostPerRefresh());
}
}

View file

@ -40,8 +40,9 @@ public class RitualEffectOmegaTest extends RitualEffect
return;
}
OmegaStructureParameters param = OmegaStructureHandler.getStructureStabilityFactor(world, x, y, z, 5);
OmegaStructureParameters param = OmegaStructureHandler.getStructureStabilityFactor(world, x, y, z, 5, new Int3(0,1,0));
int stab = param.stability;
int enchantability = param.enchantability;
System.out.println("Stability: " + stab);
@ -51,12 +52,12 @@ public class RitualEffectOmegaTest extends RitualEffect
for(EntityPlayer player : playerList)
{
Reagent reagent = ReagentRegistry.incendiumReagent;
Reagent reagent = ReagentRegistry.aetherReagent;
int affinity = 0;
OmegaParadigm waterParadigm = OmegaRegistry.getParadigmForReagent(reagent);
if(waterParadigm != null && waterParadigm.convertPlayerArmour(player, x, y, z, stab, affinity))
if(waterParadigm != null && waterParadigm.convertPlayerArmour(player, x, y, z, stab, affinity, enchantability))
{
APISpellHelper.setPlayerCurrentReagentAmount(player, tickDuration);
APISpellHelper.setPlayerMaxReagentAmount(player, tickDuration);

View file

@ -8,10 +8,13 @@ import java.util.regex.Pattern;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLiquid;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentProtection;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.Blocks;
@ -22,14 +25,17 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.FurnaceRecipes;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.play.server.S06PacketUpdateHealth;
import net.minecraft.network.play.server.S07PacketRespawn;
import net.minecraft.network.play.server.S1DPacketEntityEffect;
import net.minecraft.network.play.server.S1FPacketSetExperience;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.management.ServerConfigurationManager;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.DamageSource;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
@ -800,4 +806,99 @@ public class SpellHelper
{
return stack.isItemEqual(compressedStack) && (stack.getTagCompound() == null ? compressedStack.getTagCompound() == null : stack.getTagCompound().equals(compressedStack.getTagCompound()));
}
/*
* Ripped from EntityLivingBase, since it decided to be a scrub and make the method protected.
*/
public static float applyPotionDamageCalculations(EntityLivingBase entity, DamageSource p_70672_1_, float p_70672_2_)
{
if (p_70672_1_.isDamageAbsolute())
{
return p_70672_2_;
}
else
{
if (entity instanceof EntityZombie)
{
//par2 = par2; // Forge: Noop Warning
}
int i;
int j;
float f1;
if (entity.isPotionActive(Potion.resistance) && p_70672_1_ != DamageSource.outOfWorld)
{
i = (entity.getActivePotionEffect(Potion.resistance).getAmplifier() + 1) * 5;
j = 25 - i;
f1 = p_70672_2_ * (float)j;
p_70672_2_ = f1 / 25.0F;
}
if (p_70672_2_ <= 0.0F)
{
return 0.0F;
}
else
{
return applySpecialProtection(entity, p_70672_1_, p_70672_2_);
}
}
}
public static double protCoeff = 0.875;
public static double scalCoeff = 0.8;
public static float applySpecialProtection(EntityLivingBase entity, DamageSource source, float damage)
{
ItemStack[] armour = entity.getLastActiveItems();
if(armour == null)
{
return damage;
}
int total = 0;
for(int i = 0; i < armour.length; i++)
{
ItemStack stack = armour[i];
if(stack != null)
{
NBTTagList nbttaglist = stack.getEnchantmentTagList();
if(nbttaglist != null)
{
for(int j = 0; j < nbttaglist.tagCount(); ++j)
{
short short1 = nbttaglist.getCompoundTagAt(i).getShort("id");
short short2 = nbttaglist.getCompoundTagAt(i).getShort("lvl");
if (Enchantment.enchantmentsList[short1] != null)
{
Enchantment ench = Enchantment.enchantmentsList[short1];
if(ench instanceof EnchantmentProtection)
{
total += ench.calcModifierDamage(short2, source);
}
}
}
}
}
}
if(total > 0)
{
total = (total + 1 >> + 1) + rand.nextInt(total + 1 >> + 1);
if(total <= 20)
{
return damage * (25 - total) / 25;
}else
{
float factor = (float)(0.8 + 0.2 * (1 - Math.pow(protCoeff, Math.pow((total - 20), scalCoeff))));
return damage * (1 - factor);
}
}
return damage;
}
}

View file

@ -188,7 +188,6 @@ public class TETeleposer extends TileEntity implements IInventory
public void updateEntity()
{
super.updateEntity();
EntityPlayer d;
if (worldObj.isRemote)
{
@ -217,7 +216,7 @@ public class TETeleposer extends TileEntity implements IInventory
{
//Prime the teleportation
int d0 = focusLevel - 1;
AxisAlignedBB axisalignedbb1 = AxisAlignedBB.getBoundingBox((double) this.xCoord, (double) this.yCoord + d0 + 1, (double) this.zCoord, (double) (this.xCoord + 1), (double) (this.yCoord + 2 + d0), (double) (this.zCoord + 1)).expand(d0, d0, d0);
AxisAlignedBB axisalignedbb1 = AxisAlignedBB.getBoundingBox((double) this.xCoord-0.5, (double) this.yCoord + d0 + 0.5, (double) this.zCoord-0.5, (double) (this.xCoord + 0.5), (double) (this.yCoord + 1.5 + d0), (double) (this.zCoord + 0.5)).expand(d0, d0, d0);
axisalignedbb1.maxY = Math.min((double) this.worldObj.getHeight(), this.yCoord + 2 + d0 + d0);
List list1 = this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb1);
Iterator iterator1 = list1.iterator();
@ -229,7 +228,7 @@ public class TETeleposer extends TileEntity implements IInventory
entityCount++;
}
AxisAlignedBB axisalignedbb2 = AxisAlignedBB.getBoundingBox(xf, yf + d0 + 1, zf, xf + 1, yf + 2 + d0, zf).expand(d0, d0, d0);
AxisAlignedBB axisalignedbb2 = AxisAlignedBB.getBoundingBox(xf-0.5, yf + d0 + 0.5, zf-0.5, xf + 0.5, yf + 1.5 + d0, zf+0.5).expand(d0, d0, d0);
List list2 = worldF.getEntitiesWithinAABB(EntityLivingBase.class, axisalignedbb2);
Iterator iterator2 = list2.iterator();
EntityLivingBase entityplayer2;

View file

@ -208,6 +208,23 @@ item.outputRoutingFocus.modItem.name=Output Routing Focus (ModItem)
item.outputRoutingFocus.ignMeta.name=Output Routing Focus (Ignore Meta)
item.outputRoutingFocus.matchNBT.name=Output Routing Focus (MatchNBT)
item.outputRoutingFocus.global.name=Output Routing Focus (Global)
item.dawnScribeTool.name=Elemental Inscription Tool: Dawn
item.boundHelmetEarth.name=Earth Omega Helmet
item.boundPlateEarth.name=Earth Omega Plate
item.boundLeggingsEarth.name=Earth Omega Leggings
item.boundBootsEarth.name=Earth Omega Boots
item.boundHelmetWind.name=Wind Omega Helmet
item.boundPlateWind.name=Wind Omega Plate
item.boundLeggingsWind.name=Wind Omega Leggings
item.boundBootsWind.name=Wind Omega Boots
item.boundHelmetFire.name=Fire Omega Helmet
item.boundPlateFire.name=Fire Omega Plate
item.boundLeggingsFire.name=Fire Omega Leggings
item.boundBootsFire.name=Fire Omega Boots
item.boundHelmetWater.name=Water Omega Helmet
item.boundPlateWater.name=Water Omega Plate
item.boundLeggingsWater.name=Water Omega Leggings
item.boundBootsWater.name=Water Omega Boots
#Creative Tab
itemGroup.tabBloodMagic=Blood Magic
@ -350,6 +367,7 @@ tooltip.ritualdiviner.firestones=Fire Stones:
tooltip.ritualdiviner.moreinfo=Press shift for extended information
tooltip.ritualdiviner.ritualtunedto=Ritual tuned to face:
tooltip.ritualdiviner.waterstones=Water Stones:
tooltip.ritualdiviner.dawnstones=Dawn Stones:
tooltip.sacrificialdagger.desc1=A slight draining feeling tickles your fingers
tooltip.sacrificialdagger.desc2=Just a prick of the
tooltip.sacrificialdagger.desc3=finger will suffice...

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B