Commitment
This commit is contained in:
parent
ef82b68a16
commit
d8f267b7e3
8 changed files with 353 additions and 190 deletions
|
@ -5,13 +5,10 @@ import java.util.HashMap;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.monster.EntityCreeper;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -25,7 +22,6 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.client.event.FOVUpdateEvent;
|
||||
import net.minecraftforge.event.AnvilUpdateEvent;
|
||||
import net.minecraftforge.event.entity.living.EnderTeleportEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
|
@ -185,7 +181,7 @@ public class AlchemicalWizardryEventHooks
|
|||
@SubscribeEvent
|
||||
public void onLivingJumpEvent(LivingJumpEvent event)
|
||||
{
|
||||
event.entityLiving.getEntityAttribute(SharedMonsterAttributes.maxHealth).removeModifier(new AttributeModifier(new UUID(493295, 1), "HealthModifier", 2, 0));
|
||||
// event.entityLiving.getEntityAttribute(SharedMonsterAttributes.maxHealth).removeModifier(new AttributeModifier(new UUID(493295, 1), "HealthModifier", 2, 0));
|
||||
//event.entityLiving.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(new AttributeModifier(new UUID(493295, 1), "HealthModifier", 2, 0));
|
||||
|
||||
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionBoost))
|
||||
|
@ -240,12 +236,12 @@ public class AlchemicalWizardryEventHooks
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onFOVUpdate(FOVUpdateEvent event)
|
||||
{
|
||||
event.setResult(Result.DENY);
|
||||
}
|
||||
|
||||
|
||||
// @SubscribeEvent
|
||||
// public void onFOVUpdate(FOVUpdateEvent event)
|
||||
// {
|
||||
// event.setResult(Result.DENY);
|
||||
// }
|
||||
// @SubscribeEvent
|
||||
// public void onPlayerTickEnd(PlayerTickEvent event)
|
||||
// {
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaArmour;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -30,11 +22,20 @@ import net.minecraftforge.common.util.Constants;
|
|||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IRunicArmor;
|
||||
import thaumcraft.api.nodes.IRevealer;
|
||||
|
||||
import java.util.List;
|
||||
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
|
||||
import WayofTime.alchemicalWizardry.ModItems;
|
||||
import WayofTime.alchemicalWizardry.api.alchemy.energy.IAlchemyGoggles;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.ArmourUpgrade;
|
||||
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.DivinationSigil;
|
||||
import WayofTime.alchemicalWizardry.common.renderer.model.ModelOmegaArmour;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@Optional.InterfaceList(value = {@Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft"), @Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"), @Interface(iface = "thaumcraft.api.IRunicArmor", modid = "Thaumcraft")})
|
||||
public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialArmor, IBindable, IRevealer, IGoggles, IRunicArmor
|
||||
public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialArmor, IBindable, IRevealer, IGoggles, IRunicArmor, ILPGauge
|
||||
{
|
||||
private static int invSize = 9;
|
||||
private static IIcon helmetIcon;
|
||||
|
@ -614,6 +615,8 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int blood = getMaxBloodShardLevel(itemStack);
|
||||
|
||||
for (ItemStack item : inv)
|
||||
{
|
||||
|
@ -621,11 +624,53 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
|
|||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (item.getItem() instanceof IGoggles)
|
||||
if (item.getItem() instanceof ArmourUpgrade && blood > 0)
|
||||
{
|
||||
return true;
|
||||
if (item.getItem() instanceof IGoggles)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if(((ArmourUpgrade)item.getItem()).isUpgrade())
|
||||
{
|
||||
blood--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canSeeLPBar(ItemStack itemStack)
|
||||
{
|
||||
ItemStack[] inv = getInternalInventory(itemStack);
|
||||
|
||||
if (inv == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int blood = getMaxBloodShardLevel(itemStack);
|
||||
|
||||
for (ItemStack item : inv)
|
||||
{
|
||||
if (item == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (item.getItem() instanceof ArmourUpgrade && blood > 0)
|
||||
{
|
||||
if (item.getItem() instanceof DivinationSigil)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if(((ArmourUpgrade)item.getItem()).isUpgrade())
|
||||
{
|
||||
blood--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package WayofTime.alchemicalWizardry.common.items;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface ILPGauge
|
||||
{
|
||||
public boolean canSeeLPBar(ItemStack itemStack);
|
||||
}
|
|
@ -41,6 +41,8 @@ import WayofTime.alchemicalWizardry.api.items.interfaces.IReagentManipulator;
|
|||
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
|
||||
import WayofTime.alchemicalWizardry.api.spell.APISpellHelper;
|
||||
import WayofTime.alchemicalWizardry.common.NewPacketHandler;
|
||||
import WayofTime.alchemicalWizardry.common.items.ILPGauge;
|
||||
import WayofTime.alchemicalWizardry.common.items.sigil.DivinationSigil;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
public class SpellHelper
|
||||
|
@ -95,6 +97,35 @@ public class SpellHelper
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean canPlayerSeeLPBar(EntityPlayer player)
|
||||
{
|
||||
if (player != null)
|
||||
{
|
||||
for(int i=0; i<4; i++)
|
||||
{
|
||||
ItemStack stack = player.getCurrentArmor(i);
|
||||
if (stack != null)
|
||||
{
|
||||
Item item = stack.getItem();
|
||||
if (item instanceof ILPGauge && ((ILPGauge) item).canSeeLPBar(stack))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ItemStack heldStack = player.getHeldItem();
|
||||
|
||||
if (heldStack != null && heldStack.getItem() instanceof DivinationSigil)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static List<Entity> getEntitiesInRange(World world, double posX, double posY, double posZ, double horizontalRadius, double verticalRadius)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue