Performance Commit --Too lazy to do the Altar recipe

This commit is contained in:
Arcaratus 2015-07-02 11:05:07 -04:00
parent 013367cffa
commit e5b795fddc
217 changed files with 840 additions and 1244 deletions

View file

@ -63,7 +63,6 @@ import cpw.mods.fml.common.registry.GameRegistry;
public class AlchemicalWizardryEventHooks
{
public static Map<String, Boolean> playerFlightBuff = new HashMap();
public static Map<String, Boolean> playerBoostStepHeight = new HashMap();
public static List<String> playersWith1Step = new ArrayList();
public static Map<Integer, List<CoordAndRange>> respawnMap = new HashMap();
@ -118,8 +117,7 @@ public class AlchemicalWizardryEventHooks
if(prevHp > 0)
{
double originalDamage = event.ammount;
double initialReagentHp = prevHp;
float recalculatedAmount = ArmorProperties.ApplyArmor(player, player.inventory.armorInventory, event.source, event.ammount);
if (recalculatedAmount <= 0) return;
recalculatedAmount = SpellHelper.applyPotionDamageCalculations(player, event.source, recalculatedAmount); //Recalculated damage
@ -241,7 +239,7 @@ public class AlchemicalWizardryEventHooks
reagentAmount -= drain;
hasReagentChanged = true;
health += addedAmount;
hasHealthChanged = true;
@ -378,7 +376,6 @@ public class AlchemicalWizardryEventHooks
if (event.entityLiving instanceof EntityCreeper)
{
GameRegistry d;
return;
}
@ -471,7 +468,7 @@ public class AlchemicalWizardryEventHooks
{
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionReciprocation).getAmplifier();
float damageRecieve = event.ammount / 2 * (i + 1);
((EntityLivingBase) entityAttacking).attackEntityFrom(DamageSource.generic, damageRecieve);
entityAttacking.attackEntityFrom(DamageSource.generic, damageRecieve);
}
}
@ -527,7 +524,7 @@ public class AlchemicalWizardryEventHooks
NewPacketHandler.INSTANCE.sendTo(NewPacketHandler.getLPPacket(SoulNetworkHandler.getCurrentEssence(ownerName), SoulNetworkHandler.getMaximumForOrbTier(SoulNetworkHandler.getCurrentMaxOrb(ownerName))), (EntityPlayerMP)entityLiving);
}
}
ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, ((EntityPlayer) event.entityLiving).capabilities, Float.valueOf(0.1f), new String[]{"walkSpeed", "g", "field_75097_g"});
ObfuscationReflectionHelper.setPrivateValue(PlayerCapabilities.class, ((EntityPlayer) event.entityLiving).capabilities, 0.1F, "walkSpeed", "g", "field_75097_g");
}
if (entityLiving instanceof EntityPlayer && entityLiving.worldObj.isRemote)
@ -557,7 +554,7 @@ public class AlchemicalWizardryEventHooks
{
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionDrowning).getAmplifier();
if (event.entityLiving.worldObj.getWorldTime() % ((int) (20 / (i + 1))) == 0)
if (event.entityLiving.worldObj.getWorldTime() % (20 / (i + 1)) == 0)
{
event.entityLiving.attackEntityFrom(DamageSource.drown, 2);
event.entityLiving.hurtResistantTime = Math.min(event.entityLiving.hurtResistantTime, 20 / (i + 1));
@ -569,7 +566,6 @@ public class AlchemicalWizardryEventHooks
if (event.entityLiving.isPotionActive(AlchemicalWizardry.customPotionBoost))
{
int i = event.entityLiving.getActivePotionEffect(AlchemicalWizardry.customPotionBoost).getAmplifier();
EntityLivingBase entity = event.entityLiving;
//if(!entity.isSneaking())
{
float percentIncrease = (i + 1) * 0.05f;
@ -600,7 +596,6 @@ public class AlchemicalWizardryEventHooks
AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5).expand(d0, d0, d0);
List list = event.entityLiving.worldObj.getEntitiesWithinAABB(Entity.class, axisalignedbb);
Iterator iterator = list.iterator();
EntityLivingBase livingEntity;
while (iterator.hasNext())
{
@ -826,14 +821,9 @@ public class AlchemicalWizardryEventHooks
{
if(entity instanceof IManaBurst) {
ItemStack lens = ((IManaBurst)entity).getSourceLens();
if(lens.getItemDamage()!=8 && lens.getItemDamage()!=11)
return false;
else
return true;
return !(lens.getItemDamage()!=8 && lens.getItemDamage()!=11);
}
else
return false;
}
}

View file

@ -17,13 +17,12 @@ public class AlchemicalWizardryFuelHandler implements IFuelHandler
@Override
public int getBurnTime(ItemStack fuel)
{
ItemStack itemStack = fuel;
if (itemStack == null)
if (fuel == null)
{
return 0;
}
Item fuelItem = itemStack.getItem();
Item fuelItem = fuel.getItem();
if (fuelItem.equals(ModItems.lavaCrystal))
{
@ -34,7 +33,7 @@ public class AlchemicalWizardryFuelHandler implements IFuelHandler
return 200;
} else
{
NBTTagCompound tag = itemStack.getTagCompound();
NBTTagCompound tag = fuel.getTagCompound();
if (tag == null)
{

View file

@ -27,9 +27,6 @@ import cpw.mods.fml.common.registry.GameRegistry;
public class CommonProxy
{
public static String ITEMS_PNG = "/WayofTime/alchemicalWizardry/items.png";
public static String BLOCK_PNG = "/WayofTime/alchemicalWizardry/block.png";
// Client stuff
public void registerRenderers()
{

View file

@ -2,5 +2,5 @@ package WayofTime.alchemicalWizardry.common;
public interface IBindingAgent
{
public abstract float getSuccessRateForPotionNumber(int potionEffects);
float getSuccessRateForPotionNumber(int potionEffects);
}

View file

@ -2,7 +2,7 @@ package WayofTime.alchemicalWizardry.common;
public interface ICatalyst
{
public abstract int getCatalystLevel();
int getCatalystLevel();
public abstract boolean isConcentration();
boolean isConcentration();
}

View file

@ -2,13 +2,13 @@ package WayofTime.alchemicalWizardry.common;
public interface IDemon
{
public abstract void setSummonedConditions();
void setSummonedConditions();
public boolean isAggro();
boolean isAggro();
public void setAggro(boolean aggro);
void setAggro(boolean aggro);
public boolean getDoesDropCrystal();
boolean getDoesDropCrystal();
public void setDropCrystal(boolean crystal);
void setDropCrystal(boolean crystal);
}

View file

@ -2,5 +2,5 @@ package WayofTime.alchemicalWizardry.common;
public interface IFillingAgent
{
public abstract int getFilledAmountForPotionNumber(int potionEffects);
int getFilledAmountForPotionNumber(int potionEffects);
}

View file

@ -114,8 +114,6 @@ public enum NewPacketHandler
TileEntity te = world.getTileEntity(msg.x, msg.y, msg.z);
if (te instanceof TEOrientable)
{
TEOrientable tile = (TEOrientable) te;
((TEOrientable) te).setInputDirection(ForgeDirection.getOrientation(msg.input));
((TEOrientable) te).setOutputDirection(ForgeDirection.getOrientation(msg.output));
}
@ -459,7 +457,7 @@ public enum NewPacketHandler
target.writeInt(msg.index);
switch(msg.index)
// switch(msg.index)
{
}
@ -472,7 +470,7 @@ public enum NewPacketHandler
System.out.println("Packet is recieved and being decoded");
switch(index)
// switch(index)
{
}

View file

@ -147,7 +147,7 @@ public class BlockAlchemicCalcinator extends BlockContainer
tileEntity.setInventorySlotContents(1, newItem);
}
} else if (playerItem == null)
} else
{
if (tileEntity.getStackInSlot(1) != null)
{

View file

@ -26,13 +26,11 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockAltar extends BlockContainer
{
@SideOnly(Side.CLIENT)
private static IIcon topIcon;
private IIcon topIcon;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon1;
private IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon bottomIcon;
private IIcon bottomIcon;
public BlockAltar()
{
@ -48,7 +46,6 @@ public class BlockAltar extends BlockContainer
public void registerBlockIcons(IIconRegister iconRegister)
{
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Top");
this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType1");
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2");
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Bottom");
}
@ -89,7 +86,7 @@ public class BlockAltar extends BlockContainer
int maxEssence = bloodOrb.getMaxEssence();
int currentEssence = bloodOrb.getCurrentEssence(stack);
int level = currentEssence * 15 / maxEssence;
return ((int) (Math.min(15, level))) % 16;
return Math.min(15, level) % 16;
}
}

View file

@ -51,7 +51,7 @@ public class BlockBloodLightSource extends Block
{
if (rand.nextInt(3) != 0)
{
float f = (float) 1.0F;
float f = 1.0F;
float f1 = f * 0.6F + 0.4F;
float f2 = f * f * 0.7F - 0.5F;
float f3 = f * f * 0.6F - 0.7F;

View file

@ -13,13 +13,11 @@ import net.minecraft.world.World;
public class BlockConduit extends BlockOrientable
{
@SideOnly(Side.CLIENT)
private static IIcon topIcon;
private IIcon topIcon;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon1;
private IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon bottomIcon;
private IIcon bottomIcon;
public BlockConduit()
{
@ -35,7 +33,6 @@ public class BlockConduit extends BlockOrientable
public void registerBlockIcons(IIconRegister iconRegister)
{
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Top");
this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType1");
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2");
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Bottom");
}

View file

@ -24,11 +24,11 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockCrucible extends BlockContainer
{
@SideOnly(Side.CLIENT)
private static IIcon topIcon;
private IIcon topIcon;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon;
private IIcon sideIcon;
@SideOnly(Side.CLIENT)
private static IIcon bottomIcon;
private IIcon bottomIcon;
public BlockCrucible()
{

View file

@ -17,7 +17,9 @@ import java.util.List;
public class BlockCrystal extends Block
{
//private Icon bloodRuneIcon;
@SideOnly(Side.CLIENT)
private IIcon fullIcon;
@SideOnly(Side.CLIENT)
private IIcon brickIcon;

View file

@ -17,8 +17,10 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockEnchantmentGlyph extends Block implements IEnchantmentGlyph
{
public IIcon enchantability;
public IIcon enchantmentLevel;
@SideOnly(Side.CLIENT)
private IIcon enchantability;
@SideOnly(Side.CLIENT)
private IIcon enchantmentLevel;
public BlockEnchantmentGlyph()
{

View file

@ -17,9 +17,12 @@ import net.minecraft.world.World;
public class BlockHomHeart extends BlockContainer
{
public IIcon bottomIcon;
public IIcon topIcon;
public IIcon sideIcon;
@SideOnly(Side.CLIENT)
private IIcon bottomIcon;
@SideOnly(Side.CLIENT)
private IIcon topIcon;
@SideOnly(Side.CLIENT)
private IIcon sideIcon;
public BlockHomHeart()
{

View file

@ -34,7 +34,6 @@ public class BlockOrientable extends BlockContainer
return false;
}
ForgeDirection sideClicked = ForgeDirection.getOrientation(side);
TileEntity tile = world.getTileEntity(x, y, z);
if (tile instanceof TEOrientable)

View file

@ -22,13 +22,11 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockPedestal extends BlockContainer
{
@SideOnly(Side.CLIENT)
private static IIcon topIcon;
private IIcon topIcon;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon1;
private IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon bottomIcon;
private IIcon bottomIcon;
public BlockPedestal()
{
@ -46,7 +44,6 @@ public class BlockPedestal extends BlockContainer
public void registerBlockIcons(IIconRegister iconRegister)
{
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:ArcanePedestal");
this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
}

View file

@ -22,13 +22,11 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockPlinth extends BlockContainer
{
@SideOnly(Side.CLIENT)
private static IIcon topIcon;
private IIcon topIcon;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon1;
private IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon bottomIcon;
private IIcon bottomIcon;
public BlockPlinth()
{
@ -46,7 +44,6 @@ public class BlockPlinth extends BlockContainer
public void registerBlockIcons(IIconRegister iconRegister)
{
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:ArcanePlinth");
this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
}

View file

@ -15,7 +15,7 @@ public class BlockSchematicSaver extends BlockContainer
super(Material.rock);
setHardness(2.0F);
setResistance(5.0F);
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
// setCreativeTab(AlchemicalWizardry.tabBloodMagic);
this.setBlockName("schematicSaver");
}

View file

@ -23,13 +23,11 @@ import java.util.Random;
public class BlockSocket extends BlockContainer
{
@SideOnly(Side.CLIENT)
private static IIcon topIcon;
private IIcon topIcon;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon1;
private IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon bottomIcon;
private IIcon bottomIcon;
public BlockSocket()
{
@ -46,7 +44,6 @@ public class BlockSocket extends BlockContainer
public void registerBlockIcons(IIconRegister iconRegister)
{
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodSocket");
}

View file

@ -12,7 +12,6 @@ import net.minecraft.world.World;
import java.util.List;
public class BlockSpellEnhancement extends BlockOrientable
{
public BlockSpellEnhancement()

View file

@ -12,7 +12,6 @@ import net.minecraft.world.World;
import java.util.List;
public class BlockSpellModifier extends BlockOrientable
{
public BlockSpellModifier()

View file

@ -17,9 +17,6 @@ import java.util.List;
public class BlockSpellParadigm extends BlockOrientable
{
public static final float minPos = (3f / 16f);
public static final float maxPos = (13f / 16f);
public BlockSpellParadigm()
{
super();

View file

@ -17,7 +17,8 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockStabilityGlyph extends Block implements IStabilityGlyph
{
public IIcon stability1;
@SideOnly(Side.CLIENT)
private IIcon stability1;
public BlockStabilityGlyph()
{

View file

@ -33,13 +33,11 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BlockTeleposer extends BlockContainer
{
@SideOnly(Side.CLIENT)
private static IIcon topIcon;
private IIcon topIcon;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon1;
private IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon bottomIcon;
private IIcon bottomIcon;
public BlockTeleposer()
{
@ -55,7 +53,6 @@ public class BlockTeleposer extends BlockContainer
public void registerBlockIcons(IIconRegister iconRegister)
{
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Top");
this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Side");
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Side");
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:Teleposer_Side");
}
@ -219,17 +216,15 @@ public class BlockTeleposer extends BlockContainer
worldF.setTileEntity(xf, yf, zf, tileToSet);
}
Block initialBlock = blockI;
if (initialBlock != null)
if (blockI != null)
{
TileEntity tileToSet = initialBlock.createTileEntity(worldI, metaI);
TileEntity tileToSet = blockI.createTileEntity(worldI, metaI);
worldI.setTileEntity(xi, yi, zi, tileToSet);
}
//TILES CLEARED
worldF.setBlock(xf, yf, zf, initialBlock, metaI, flag);
worldF.setBlock(xf, yf, zf, blockI, metaI, flag);
if (tileEntityI != null)
{
@ -292,6 +287,6 @@ public class BlockTeleposer extends BlockContainer
@Optional.Method(modid = "ForgeMultipart")
public static void sendDescriptorOfTile(World world, TileEntity tile)
{
MultipartHelper.sendDescPacket(world, (TileMultipart)tile);
MultipartHelper.sendDescPacket(world, tile);
}
}

View file

@ -25,13 +25,11 @@ import java.util.Random;
public class BlockWritingTable extends BlockContainer
{
@SideOnly(Side.CLIENT)
private static IIcon topIcon;
private IIcon topIcon;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon1;
private IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon sideIcon2;
@SideOnly(Side.CLIENT)
private static IIcon bottomIcon;
private IIcon bottomIcon;
public BlockWritingTable()
{
@ -47,7 +45,6 @@ public class BlockWritingTable extends BlockContainer
public void registerBlockIcons(IIconRegister iconRegister)
{
this.topIcon = iconRegister.registerIcon("AlchemicalWizardry:AlchemicChemistrySet");
this.sideIcon1 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType1");
this.sideIcon2 = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_SideType2");
this.bottomIcon = iconRegister.registerIcon("AlchemicalWizardry:BloodAltar_Bottom");
}

View file

@ -17,10 +17,15 @@ import java.util.List;
public class BloodRune extends Block
{
//private Icon bloodRuneIcon;
@SideOnly(Side.CLIENT)
private IIcon altarCapacityRuneIcon;
@SideOnly(Side.CLIENT)
private IIcon dislocationRuneIcon;
@SideOnly(Side.CLIENT)
private IIcon orbCapacityRuneIcon;
@SideOnly(Side.CLIENT)
private IIcon betterCapacityRuneIcon;
@SideOnly(Side.CLIENT)
private IIcon accelerationRuneIcon;
public BloodRune()

View file

@ -4,11 +4,11 @@ import net.minecraftforge.common.util.ForgeDirection;
public interface IOrientable
{
public ForgeDirection getInputDirection();
ForgeDirection getInputDirection();
public ForgeDirection getOutputDirection();
ForgeDirection getOutputDirection();
public void setInputDirection(ForgeDirection direction);
void setInputDirection(ForgeDirection direction);
public void setOutputDirection(ForgeDirection direction);
void setOutputDirection(ForgeDirection direction);
}

View file

@ -38,22 +38,12 @@ public class LifeEssenceBlock extends BlockFluidClassic
@Override
public boolean canDisplace(IBlockAccess world, int x, int y, int z)
{
if (world.getBlock(x, y, z).getMaterial().isLiquid())
{
return false;
}
return super.canDisplace(world, x, y, z);
return !world.getBlock(x, y, z).getMaterial().isLiquid() && super.canDisplace(world, x, y, z);
}
@Override
public boolean displaceIfPossible(World world, int x, int y, int z)
{
if (world.getBlock(x, y, z).getMaterial().isLiquid())
{
return false;
}
return super.displaceIfPossible(world, x, y, z);
return !world.getBlock(x, y, z).getMaterial().isLiquid() && super.displaceIfPossible(world, x, y, z);
}
}

View file

@ -45,7 +45,7 @@ public class MimicBlock extends BlockContainer
Block block = mimic.getBlock();
return block != null ? block.shouldSideBeRendered(world, x, y, z, side) : true;
return block == null || block.shouldSideBeRendered(world, x, y, z, side);
}
@SideOnly(Side.CLIENT)

View file

@ -17,19 +17,19 @@ import net.minecraft.world.World;
public class RitualStone extends Block implements IRitualStone
{
@SideOnly(Side.CLIENT)
private static IIcon blankIcon;
private IIcon blankIcon;
@SideOnly(Side.CLIENT)
private static IIcon waterStoneIcon;
private IIcon waterStoneIcon;
@SideOnly(Side.CLIENT)
private static IIcon fireStoneIcon;
private IIcon fireStoneIcon;
@SideOnly(Side.CLIENT)
private static IIcon earthStoneIcon;
private IIcon earthStoneIcon;
@SideOnly(Side.CLIENT)
private static IIcon airStoneIcon;
private IIcon airStoneIcon;
@SideOnly(Side.CLIENT)
private static IIcon duskStoneIcon;
private IIcon duskStoneIcon;
@SideOnly(Side.CLIENT)
private static IIcon dawnStoneIcon;
private IIcon dawnStoneIcon;
public RitualStone()
{

View file

@ -60,7 +60,7 @@ public class SpectralBlock extends BlockContainer
return false;
}
return block == this ? false : super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
return block != this && super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
}
@SideOnly(Side.CLIENT)

View file

@ -29,7 +29,7 @@ public class BookParser
@SideOnly(Side.CLIENT)
public static List<Entry> parseTextFile(String location)
{
File textFiles = new File("config/BloodMagic/bookDocs");
// File textFiles = new File("config/BloodMagic/bookDocs");
ArrayList<Entry> entryList = new ArrayList();
//if(textFiles.exists())
{
@ -138,7 +138,7 @@ public class BookParser
if(Minecraft.getMinecraft() != null && Minecraft.getMinecraft().fontRenderer != null)
{
List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strLine, 110);
if(list != null)
// if(list != null)
{
//System.out.println("Number of lines: " + list.size());
}
@ -150,7 +150,7 @@ public class BookParser
{
lastPageWasSpecial = true;
boolean changePage = false;
int length = word.length();
// int length = word.length();
word = word.replace('\t', ' ');
List list = Minecraft.getMinecraft().fontRenderer.listFormattedStringToWidth(strings[currentPage] + " " + word, 110);

View file

@ -119,11 +119,10 @@ public class BlockSet
{
int div = meta / 4;
int mod = meta % 4;
int[] northSet = new int[]{1 + div*4, 0 + div*4, 3 + div*4, 2 + div*4};
int[] eastSet = new int[]{2 + div*4, 3 + div*4, 1 + div*4, 0 + div*4};
int[] southSet = new int[]{0 + div*4, 1 + div*4, 2 + div*4, 3 + div*4};
int[] westSet = new int[]{3 + div*4, 2 + div*4, 0 + div*4, 1 + div*4};
int[] northSet = new int[]{1 + div*4, div*4, 3 + div*4, 2 + div*4}; //Second one: 0 +
int[] eastSet = new int[]{2 + div*4, 3 + div*4, 1 + div*4, div*4}; //Last one: 0 +
int[] southSet = new int[]{div*4, 1 + div*4, 2 + div*4, 3 + div*4}; //First one: 0 +
int[] westSet = new int[]{3 + div*4, 2 + div*4, div*4, 1 + div*4}; //Third one: 0 +
switch (mod)
{
@ -190,11 +189,10 @@ public class BlockSet
{
int div = meta / 4;
int mod = meta % 4;
int[] northSet = new int[]{0 + div*4, 2 + div*4, 3 + div*4, 1 + div*4};
int[] eastSet = new int[]{1 + div*4, 3 + div*4, 0 + div*4, 2 + div*4};
int[] southSet = new int[]{2 + div*4, 0 + div*4, 1 + div*4, 3 + div*4};
int[] westSet = new int[]{3 + div*4, 1 + div*4, 2 + div*4, 0 + div*4};
int[] northSet = new int[]{div * 4, 2 + div * 4, 3 + div * 4, 1 + div * 4}; //First one: 0 +
int[] eastSet = new int[]{1 + div*4, 3 + div*4, div*4, 2 + div*4}; //Third one: 0 +
int[] southSet = new int[]{2 + div*4, div*4, 1 + div*4, 3 + div*4}; //Second one: 0 +
int[] westSet = new int[]{3 + div*4, 1 + div*4, 2 + div*4, div*4}; //Last one: 0 +
switch (mod)
{
@ -215,10 +213,11 @@ public class BlockSet
{
int div = meta / 4;
int mod = meta % 4;
int[] northSet = new int[]{0 + div*4, 2 + div*4, 3 + div*4, 1 + div*4};
int[] eastSet = new int[]{1 + div*4, 3 + div*4, 0 + div*4, 2 + div*4};
int[] southSet = new int[]{2 + div*4, 0 + div*4, 1 + div*4, 3 + div*4};
int[] westSet = new int[]{3 + div*4, 1 + div*4, 2 + div*4, 0 + div*4};
int[] northSet = new int[]{div*4, 2 + div*4, 3 + div*4, 1 + div*4}; //First one: 0 +
int[] eastSet = new int[]{1 + div*4, 3 + div*4, div*4, 2 + div*4}; //Third one: 0 +
int[] southSet = new int[]{2 + div*4, div*4, 1 + div*4, 3 + div*4}; //Second one: 0 +
int[] westSet = new int[]{3 + div*4, 1 + div*4, 2 + div*4, div*4}; //Last one: 0 +
switch (mod)
@ -253,7 +252,7 @@ public class BlockSet
public Block getBlock()
{
return this.getBlockForString(blockid);
return getBlockForString(blockid);
}
public static String getPairedIdForBlock(Block block)
@ -369,6 +368,6 @@ public class BlockSet
public boolean isContained(Block block, int defaultMeta)
{
Block thisBlock = this.getBlock();
return thisBlock == null ? false : thisBlock.equals(block) && this.metadata[0] == defaultMeta;
return thisBlock != null && thisBlock.equals(block) && this.metadata[0] == defaultMeta;
}
}

View file

@ -129,7 +129,7 @@ public class BuildingSchematic
public void destroyAllInField(World world, int xCoord, int yCoord, int zCoord, ForgeDirection dir)
{
GridSpaceHolder grid = this.createGSH(); //GridSpaceHolder is not aware of the buildings - need to use the schematic
// GridSpaceHolder grid = this.createGSH(); //GridSpaceHolder is not aware of the buildings - need to use the schematic
List<Int3> positionList = getGriddedPositions(dir);

View file

@ -59,8 +59,8 @@ public class DemonBuilding
public Int3 getDoorSpace(ForgeDirection dir)
{
int x = 0;
int z = 0;
int x;
int z;
switch (dir)
{
case SOUTH:

View file

@ -13,9 +13,9 @@ import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal
public class DemonVillagePath
{
public int xi;
public int yi;
public int zi;
public int xPos;
public int yPos;
public int zPos;
public ForgeDirection dir;
public int length;
@ -25,37 +25,37 @@ public class DemonVillagePath
public DemonVillagePath(int xi, int yi, int zi, ForgeDirection dir, int length)
{
this.xi = xi;
this.yi = yi;
this.zi = zi;
this.xPos = xi;
this.yPos = yi;
this.zPos = zi;
this.dir = dir;
this.length = length;
}
public Int3AndBool constructFullPath(TEDemonPortal portal, World world, int clearance)
{
int xPos = this.xi;
int yPos = this.yi;
int zPos = this.zi;
int xi = this.xPos;
int yi = this.yPos;
int zi = this.zPos;
int rad = this.getRoadRadius();
int value = 0;
int finalYPos = this.constructPartialPath(portal, world, clearance, xPos - rad * dir.offsetX, yPos, zPos - rad * dir.offsetZ, dir, length + rad, false);
int finalYPos = this.constructPartialPath(portal, world, clearance, xi - rad * dir.offsetX, yi, zi - rad * dir.offsetZ, dir, length + rad, false);
for (int i = -rad; i <= rad; i++)
{
value = Math.max(this.constructPartialPath(portal, world, clearance, xPos - rad * dir.offsetX + i * dir.offsetZ, yPos, zPos - rad * dir.offsetZ + i * dir.offsetX, dir, length + 2 * rad, true), value);
value = Math.max(this.constructPartialPath(portal, world, clearance, xi - rad * dir.offsetX + i * dir.offsetZ, yi, zi - rad * dir.offsetZ + i * dir.offsetX, dir, length + 2 * rad, true), value);
if(TEDemonPortal.printDebug)
System.out.println("" + (length + 2 * rad) + ", " + value + "");
}
Int3 position = new Int3(xPos, finalYPos, zPos);
Int3 position = new Int3(xi, finalYPos, zi);
boolean bool = value >= length + 2 * rad;
return new Int3AndBool(position, bool);
}
public class Int3AndBool
{
public Int3 coords;
@ -68,7 +68,7 @@ public class DemonVillagePath
}
/**
*
*
* @param portal
* @param world
* @param clearance
@ -78,112 +78,108 @@ public class DemonVillagePath
* @param dir
* @param length
* @param doConstruct
* @return length if doConstruct, yPos if !doConstruct
* @return length if doConstruct, yi if !doConstruct
*/
public int constructPartialPath(TEDemonPortal portal, World world, int clearance, int xi, int yi, int zi, ForgeDirection dir, int length, boolean doConstruct)
{
int xPos = xi;
int yPos = yi;
int zPos = zi;
for (int i = 0; i < length; i++)
{
int xOffset = i * dir.offsetX;
int zOffset = i * dir.offsetZ;
boolean completed = false;
for (int yOffset = 0; yOffset <= clearance; yOffset++)
{
int sign = 1;
Block block1 = world.getBlock(xPos + xOffset, yPos + sign * yOffset, zPos + zOffset);
Block highBlock1 = world.getBlock(xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset);
Block block1 = world.getBlock(xi + xOffset, yi + sign * yOffset, zi + zOffset);
Block highBlock1 = world.getBlock(xi + xOffset, yi + sign * yOffset + 1, zi + zOffset);
if ((this.forceReplaceBlock(block1))||(!block1.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset, zPos + zOffset) && this.isBlockReplaceable(block1) ) && (this.forceCanTunnelUnder(highBlock1) || highBlock1.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset)))
if ((this.forceReplaceBlock(block1))||(!block1.isReplaceable(world, xi + xOffset, yi + sign * yOffset, zi + zOffset) && this.isBlockReplaceable(block1) ) && (this.forceCanTunnelUnder(highBlock1) || highBlock1.isReplaceable(world, xi + xOffset, yi + sign * yOffset + 1, zi + zOffset)))
{
if(doConstruct)
{
world.setBlock(xPos + xOffset, yPos + sign * yOffset, zPos + zOffset, portal.getRoadBlock(), portal.getRoadMeta(), 3);
world.setBlock(xi + xOffset, yi + sign * yOffset, zi + zOffset, portal.getRoadBlock(), portal.getRoadMeta(), 3);
}
yPos += sign * yOffset;
yi += sign * yOffset;
completed = true;
break;
} else if(canGoDown)
{
sign = -1;
Block block2 = world.getBlock(xPos + xOffset, yPos + sign * yOffset, zPos + zOffset);
Block highBlock2 = world.getBlock(xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset);
Block block2 = world.getBlock(xi + xOffset, yi + sign * yOffset, zi + zOffset);
Block highBlock2 = world.getBlock(xi + xOffset, yi + sign * yOffset + 1, zi + zOffset);
if ((this.forceReplaceBlock(block2))||(!block2.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset, zPos + zOffset) && this.isBlockReplaceable(block2)) && (this.forceCanTunnelUnder(highBlock2) || highBlock2.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset)))
if ((this.forceReplaceBlock(block2))||(!block2.isReplaceable(world, xi + xOffset, yi + sign * yOffset, zi + zOffset) && this.isBlockReplaceable(block2)) && (this.forceCanTunnelUnder(highBlock2) || highBlock2.isReplaceable(world, xi + xOffset, yi + sign * yOffset + 1, zi + zOffset)))
{
if(doConstruct)
{
world.setBlock(xPos + xOffset, yPos + sign * yOffset, zPos + zOffset, portal.getRoadBlock(), portal.getRoadMeta(), 3);
world.setBlock(xi + xOffset, yi + sign * yOffset, zi + zOffset, portal.getRoadBlock(), portal.getRoadMeta(), 3);
}
yPos += sign * yOffset;
yi += sign * yOffset;
completed = true;
break;
}
}
}
if(!completed)
{
boolean returnAmount = true;
if(createBridgeInAirIfObstructed)
{
Block block1 = world.getBlock(xPos + xOffset, yPos, zPos + zOffset);
if (block1.isReplaceable(world, xPos + xOffset, yPos, zPos + zOffset) || !this.isBlockReplaceable(block1) || !this.forceReplaceBlock(block1))
Block block1 = world.getBlock(xi + xOffset, yi, zi + zOffset);
if (block1.isReplaceable(world, xi + xOffset, yi, zi + zOffset) || !this.isBlockReplaceable(block1) || !this.forceReplaceBlock(block1))
{
returnAmount = false;
if(doConstruct)
{
world.setBlock(xPos + xOffset, yPos, zPos + zOffset, portal.getRoadBlock(), portal.getRoadMeta(), 3);
world.setBlock(xi + xOffset, yi, zi + zOffset, portal.getRoadBlock(), portal.getRoadMeta(), 3);
}
}else
{
returnAmount = true;
}
}else if(this.tunnelIfObstructed)
{
Block block1 = world.getBlock(xPos + xOffset, yPos, zPos + zOffset);
if (!block1.isReplaceable(world, xPos + xOffset, yPos, zPos + zOffset) || this.isBlockReplaceable(block1) || !this.forceReplaceBlock(block1))
}else if(tunnelIfObstructed)
{
Block block1 = world.getBlock(xi + xOffset, yi, zi + zOffset);
if (!block1.isReplaceable(world, xi + xOffset, yi, zi + zOffset) || this.isBlockReplaceable(block1) || !this.forceReplaceBlock(block1))
{
returnAmount = false;
if(doConstruct)
{
world.setBlock(xPos + xOffset, yPos, zPos + zOffset, portal.getRoadBlock(), portal.getRoadMeta(), 3);
world.setBlockToAir(xPos + xOffset, yPos + 1, zPos + zOffset);
world.setBlockToAir(xPos + xOffset, yPos + 2, zPos + zOffset);
world.setBlockToAir(xPos + xOffset, yPos + 3, zPos + zOffset);
world.setBlock(xi + xOffset, yi, zi + zOffset, portal.getRoadBlock(), portal.getRoadMeta(), 3);
world.setBlockToAir(xi + xOffset, yi + 1, zi + zOffset);
world.setBlockToAir(xi + xOffset, yi + 2, zi + zOffset);
world.setBlockToAir(xi + xOffset, yi + 3, zi + zOffset);
}
}else
{
returnAmount = true;
}
}
if(returnAmount)
{
return doConstruct ? i : yPos;
return doConstruct ? i : yi;
}
}
}
return doConstruct ? length : yPos;
return doConstruct ? length : yi;
}
public Int3 getFinalLocation(World world, int clearance)
{
int xPos = xi;
int yPos = yi;
int zPos = zi;
int xi = xPos;
int yi = yPos;
int zi = zPos;
for (int i = 0; i < length; i++)
{
@ -194,29 +190,29 @@ public class DemonVillagePath
{
int sign = 1;
Block block1 = world.getBlock(xPos + xOffset, yPos + sign * yOffset, zPos + zOffset);
Block highBlock1 = world.getBlock(xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset);
Block block1 = world.getBlock(xi + xOffset, yi + sign * yOffset, zi + zOffset);
Block highBlock1 = world.getBlock(xi + xOffset, yi + sign * yOffset + 1, zi + zOffset);
if ((this.forceReplaceBlock(block1))||(!block1.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset, zPos + zOffset) && this.isBlockReplaceable(block1) ) && (this.forceCanTunnelUnder(highBlock1) || highBlock1.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset)))
if ((this.forceReplaceBlock(block1))||(!block1.isReplaceable(world, xi + xOffset, yi + sign * yOffset, zi + zOffset) && this.isBlockReplaceable(block1) ) && (this.forceCanTunnelUnder(highBlock1) || highBlock1.isReplaceable(world, xi + xOffset, yi + sign * yOffset + 1, zi + zOffset)))
{
yPos += sign * yOffset;
yi += sign * yOffset;
break;
} else
{
sign = -1;
Block block2 = world.getBlock(xPos + xOffset, yPos + sign * yOffset, zPos + zOffset);
Block highBlock2 = world.getBlock(xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset);
Block block2 = world.getBlock(xi + xOffset, yi + sign * yOffset, zi + zOffset);
Block highBlock2 = world.getBlock(xi + xOffset, yi + sign * yOffset + 1, zi + zOffset);
if ((this.forceReplaceBlock(block2))||(!block2.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset, zPos + zOffset) && this.isBlockReplaceable(block2) ) && (this.forceCanTunnelUnder(highBlock2) || highBlock2.isReplaceable(world, xPos + xOffset, yPos + sign * yOffset + 1, zPos + zOffset)))
if ((this.forceReplaceBlock(block2))||(!block2.isReplaceable(world, xi + xOffset, yi + sign * yOffset, zi + zOffset) && this.isBlockReplaceable(block2) ) && (this.forceCanTunnelUnder(highBlock2) || highBlock2.isReplaceable(world, xi + xOffset, yi + sign * yOffset + 1, zi + zOffset)))
{
yPos += sign * yOffset;
yi += sign * yOffset;
break;
}
}
}
}
return new Int3(xPos, yPos, zPos);
return new Int3(xi, yi, zi);
}
public int getRoadRadius()
@ -226,31 +222,16 @@ public class DemonVillagePath
public boolean isBlockReplaceable(Block block)
{
if (block.getMaterial() == Material.leaves || block.getMaterial() == Material.vine || block instanceof IRoadWard)
{
return false;
}
return !block.equals(ModBlocks.blockDemonPortal);
return !(block.getMaterial() == Material.leaves || block.getMaterial() == Material.vine || block instanceof IRoadWard) &&!block.equals(ModBlocks.blockDemonPortal);
}
public boolean forceReplaceBlock(Block block)
{
if(block.getMaterial().isLiquid())
{
return true;
}else
{
return false;
}
return block.getMaterial().isLiquid();
}
public boolean forceCanTunnelUnder(Block block)
{
if(block instanceof BlockFlower || block == Blocks.double_plant)
{
return true;
}
return false;
return block instanceof BlockFlower || block == Blocks.double_plant;
}
}

View file

@ -47,7 +47,7 @@ public class GridSpace
public boolean isEmpty()
{
return type == this.EMPTY;
return type == EMPTY;
}
public static GridSpace getGridFromTag(NBTTagCompound tag)
@ -67,11 +67,11 @@ public class GridSpace
public boolean isRoadSegment()
{
return type == this.ROAD || type == this.CROSSROAD;
return type == ROAD || type == CROSSROAD;
}
public boolean isBuilding()
{
return type == this.HOUSE;
return type == HOUSE;
}
}

View file

@ -121,22 +121,18 @@ public class GridSpaceHolder
{
this.expandAreaInPosX();
this.setGridSpace(x, z, space);
return;
} else if (x < -negXRadius)
{
this.expandAreaInNegX();
this.setGridSpace(x, z, space);
return;
} else if (z > posZRadius)
{
this.expandAreaInPosZ();
this.setGridSpace(x, z, space);
return;
} else if (z < -negZRadius)
{
this.expandAreaInNegZ();
this.setGridSpace(x, z, space);
return;
} else
{
area[x + negXRadius][z + negZRadius] = space;
@ -162,8 +158,8 @@ public class GridSpaceHolder
if(TEDemonPortal.printDebug)
AlchemicalWizardry.logger.info("x: " + i + " z: " + j);
int xOff = 0;
int zOff = 0;
int xOff;
int zOff;
switch (dir)
{
@ -211,8 +207,8 @@ public class GridSpaceHolder
continue;
}
int xOff = 0;
int zOff = 0;
int xOff;
int zOff;
switch (dir)
{
@ -255,8 +251,8 @@ public class GridSpaceHolder
continue;
}
int xOff = 0;
int zOff = 0;
int xOff;
int zOff;
switch (dir)
{

View file

@ -10,8 +10,7 @@ import WayofTime.alchemicalWizardry.common.demonVillage.tileEntity.TEDemonPortal
public class EntityDemonAIHurtByTarget extends EntityAIHurtByTarget
{
boolean entityCallsForHelp;
private int revengeTimer;
public EntityDemonAIHurtByTarget(EntityCreature demon, boolean callsForHelp)
{
super(demon, callsForHelp);
@ -36,7 +35,6 @@ public class EntityDemonAIHurtByTarget extends EntityAIHurtByTarget
}
this.taskOwner.setAttackTarget(this.taskOwner.getAITarget());
this.revengeTimer = this.taskOwner.func_142015_aE();
if (this.entityCallsForHelp && this.taskOwner instanceof IHoardDemon)
{

View file

@ -4,5 +4,5 @@ import net.minecraft.entity.IRangedAttackMob;
public interface IOccasionalRangedAttackMob extends IRangedAttackMob
{
public boolean shouldUseRangedAttack();
boolean shouldUseRangedAttack();
}

View file

@ -93,10 +93,10 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -296,10 +296,10 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -319,7 +319,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -330,7 +330,7 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -344,9 +344,9 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -368,10 +368,10 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -479,9 +479,6 @@ public class EntityMinorDemonGrunt extends EntityDemon implements IOccasionalRan
{
return;
}
double xCoord;
double yCoord;
double zCoord;
HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 15, 600);
this.worldObj.spawnEntityInWorld(hol);
}

View file

@ -41,9 +41,6 @@ public class EntityMinorDemonGruntEarth extends EntityMinorDemonGrunt
{
return;
}
double xCoord;
double yCoord;
double zCoord;
ExplosionProjectile hol = new ExplosionProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 15, 600, false);
this.worldObj.spawnEntityInWorld(hol);
}

View file

@ -37,9 +37,6 @@ public class EntityMinorDemonGruntFire extends EntityMinorDemonGrunt
{
return;
}
double xCoord;
double yCoord;
double zCoord;
FireProjectile hol = new FireProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 15, 600);
this.worldObj.spawnEntityInWorld(hol);
}

View file

@ -38,9 +38,6 @@ public class EntityMinorDemonGruntGuardian extends EntityMinorDemonGrunt
{
return;
}
double xCoord;
double yCoord;
double zCoord;
HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 20, 600);
this.worldObj.spawnEntityInWorld(hol);
}

View file

@ -45,9 +45,6 @@ public class EntityMinorDemonGruntGuardianEarth extends EntityMinorDemonGruntGua
{
return;
}
double xCoord;
double yCoord;
double zCoord;
ExplosionProjectile hol = new ExplosionProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 20, 600, false);
this.worldObj.spawnEntityInWorld(hol);
}

View file

@ -41,9 +41,6 @@ public class EntityMinorDemonGruntGuardianFire extends EntityMinorDemonGruntGuar
{
return;
}
double xCoord;
double yCoord;
double zCoord;
FireProjectile hol = new FireProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 20, 600);
this.worldObj.spawnEntityInWorld(hol);
}

View file

@ -38,9 +38,6 @@ public class EntityMinorDemonGruntGuardianIce extends EntityMinorDemonGruntGuard
{
return;
}
double xCoord;
double yCoord;
double zCoord;
IceProjectile hol = new IceProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 20, 600);
this.worldObj.spawnEntityInWorld(hol);
}

View file

@ -55,9 +55,6 @@ public class EntityMinorDemonGruntGuardianWind extends EntityMinorDemonGruntGuar
{
return;
}
double xCoord;
double yCoord;
double zCoord;
WindGustProjectile hol = new WindGustProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 20, 600);
this.worldObj.spawnEntityInWorld(hol);
}

View file

@ -34,9 +34,6 @@ public class EntityMinorDemonGruntIce extends EntityMinorDemonGrunt
{
return;
}
double xCoord;
double yCoord;
double zCoord;
IceProjectile hol = new IceProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 15, 600);
this.worldObj.spawnEntityInWorld(hol);
}

View file

@ -51,9 +51,6 @@ public class EntityMinorDemonGruntWind extends EntityMinorDemonGrunt
{
return;
}
double xCoord;
double yCoord;
double zCoord;
WindGustProjectile hol = new WindGustProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 15, 600);
this.worldObj.spawnEntityInWorld(hol);
}

View file

@ -4,8 +4,8 @@ import WayofTime.alchemicalWizardry.api.Int3;
public interface IHoardDemon
{
public void setPortalLocation(Int3 position);
public Int3 getPortalLocation();
public boolean thrallDemon(Int3 location);
public boolean isSamePortal(IHoardDemon demon);
void setPortalLocation(Int3 position);
Int3 getPortalLocation();
boolean thrallDemon(Int3 location);
boolean isSamePortal(IHoardDemon demon);
}

View file

@ -5,7 +5,6 @@ import java.util.List;
import java.util.Random;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.WeightedRandomChestContent;
import net.minecraftforge.common.ChestGenHooks;
import WayofTime.alchemicalWizardry.ModItems;
@ -16,9 +15,6 @@ public class DemonVillageLootRegistry
public static void init()
{
ItemStack lifeShardStack = new ItemStack(ModItems.baseItems, 1, 28);
ItemStack soulShardStack = new ItemStack(ModItems.baseItems, 1, 29);
String[] tier1Strings = new String[]{ChestGenHooks.DUNGEON_CHEST, ChestGenHooks.PYRAMID_DESERT_CHEST};
for(String str : tier1Strings)
{

View file

@ -18,9 +18,7 @@ public class BlockDemonChest extends BlockChest implements IBlockPortalNode
public IInventory func_149951_m(World world, int x, int y, int z)
{
IInventory object = (IInventory)world.getTileEntity(x, y, z);
return object;
return (IInventory)world.getTileEntity(x, y, z);
}
@Override

View file

@ -2,5 +2,5 @@ package WayofTime.alchemicalWizardry.common.demonVillage.tileEntity;
public interface ITilePortalNode
{
public void setPortalLocation(TEDemonPortal teDemonPortal);
void setPortalLocation(TEDemonPortal teDemonPortal);
}

View file

@ -41,7 +41,7 @@ public class TEDemonChest extends TileEntityChest implements ITilePortalNode
@Override
public void checkForAdjacentChests()
{
return;
}
@Override

View file

@ -426,7 +426,7 @@ public class TEDemonPortal extends TileEntity
}
}
if(this.tier < this.tierCostList.length && this.demonHouseCooldown > this.tierCostList[this.tier])
if(this.tier < tierCostList.length && this.demonHouseCooldown > tierCostList[this.tier])
{
this.tier++;
@ -480,7 +480,7 @@ public class TEDemonPortal extends TileEntity
int x = i / length;
int z = i % length;
NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i);
NBTTagCompound tag = tagList.getCompoundTagAt(i);
GridSpace space = GridSpace.getGridFromTag(tag);
area[x][z] = space;
@ -519,8 +519,6 @@ public class TEDemonPortal extends TileEntity
{
for (int j = 0; j <= negZRadius + posZRadius; j++)
{
int index = i + (negZRadius + posZRadius + 1) * j;
GridSpace space = area[i][j];
NBTTagCompound nextTag;
@ -610,8 +608,6 @@ public class TEDemonPortal extends TileEntity
dir = ForgeDirection.NORTH;
}
int length = 5;
Int3 road = findRoadSpaceFromDirection(dir, (rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius)) + 1);
int x = road.xCoord;
@ -988,11 +984,6 @@ public class TEDemonPortal extends TileEntity
return 0;
}
if (convertStarter)
{
}
int initGridX = gridXi;
int initGridZ = gridZi;
int initY = yi;
@ -1139,22 +1130,18 @@ public class TEDemonPortal extends TileEntity
{
this.expandAreaInPosX();
this.setGridSpace(x, z, space);
return;
} else if (x < -negXRadius)
{
this.expandAreaInNegX();
this.setGridSpace(x, z, space);
return;
} else if (z > posZRadius)
{
this.expandAreaInPosZ();
this.setGridSpace(x, z, space);
return;
} else if (z < -negZRadius)
{
this.expandAreaInNegZ();
this.setGridSpace(x, z, space);
return;
} else
{
area[x + negXRadius][z + negZRadius] = space;
@ -1202,10 +1189,10 @@ public class TEDemonPortal extends TileEntity
int x = 0;
int z = 0;
GridSpace home = this.getGridSpace(x, z);
int yLevel = home.getYLevel();
// GridSpace home = this.getGridSpace(x, z);
// int yLevel = home.getYLevel();
GridSpaceHolder grid = this.createGSH();
// GridSpaceHolder grid = this.createGSH();
List<ForgeDirection> directions = new ArrayList();
@ -1249,9 +1236,8 @@ public class TEDemonPortal extends TileEntity
ForgeDirection chosenDirection = (ForgeDirection) schemMap.keySet().toArray()[new Random().nextInt(schemMap.keySet().size())];
DemonBuilding build = schemMap.get(chosenDirection).get(new Random().nextInt(schemMap.get(chosenDirection).size()));
Int3 portalSpace = build.getDoorSpace(chosenDirection);
// Int3 portalSpace = build.getDoorSpace(chosenDirection);
this.nextDemonPortalDirection = chosenDirection;
this.nextDemonPortalName = build.getName();
@ -1348,7 +1334,7 @@ public class TEDemonPortal extends TileEntity
dir = ForgeDirection.NORTH;
}
Int3 space = this.findRoadSpaceFromDirection(dir, 1 * (rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius)) + 1);
Int3 space = this.findRoadSpaceFromDirection(dir, (rand.nextInt(negXRadius + negZRadius + posXRadius + posZRadius)) + 1); // Second: 1 *
int x = space.xCoord;
int z = space.zCoord;

View file

@ -18,14 +18,11 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityBileDemon extends EntityDemon
{
private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false);
private static float maxTamedHealth = 100.0F;
private static float maxUntamedHealth = 200.0F;
private int attackTimer;
@ -59,10 +56,10 @@ public class EntityBileDemon extends EntityDemon
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
//this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D);
@ -97,14 +94,14 @@ public class EntityBileDemon extends EntityDemon
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
//this.dataWatcher.addObject(20, new Byte((byte) BlockColored.getBlockFromDye(1)));
}
@ -261,10 +258,10 @@ public class EntityBileDemon extends EntityDemon
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -284,7 +281,7 @@ public class EntityBileDemon extends EntityDemon
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -295,7 +292,7 @@ public class EntityBileDemon extends EntityDemon
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -309,9 +306,9 @@ public class EntityBileDemon extends EntityDemon
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -333,10 +330,10 @@ public class EntityBileDemon extends EntityDemon
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -379,10 +376,10 @@ public class EntityBileDemon extends EntityDemon
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -399,7 +396,7 @@ public class EntityBileDemon extends EntityDemon
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -414,10 +411,10 @@ public class EntityBileDemon extends EntityDemon
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}

View file

@ -20,7 +20,6 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
@ -67,10 +66,10 @@ public class EntityBoulderFist extends EntityDemon
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -103,14 +102,14 @@ public class EntityBoulderFist extends EntityDemon
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -247,10 +246,10 @@ public class EntityBoulderFist extends EntityDemon
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -270,7 +269,7 @@ public class EntityBoulderFist extends EntityDemon
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -281,7 +280,7 @@ public class EntityBoulderFist extends EntityDemon
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -295,9 +294,9 @@ public class EntityBoulderFist extends EntityDemon
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -319,10 +318,10 @@ public class EntityBoulderFist extends EntityDemon
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -366,10 +365,10 @@ public class EntityBoulderFist extends EntityDemon
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -386,7 +385,7 @@ public class EntityBoulderFist extends EntityDemon
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -401,10 +400,10 @@ public class EntityBoulderFist extends EntityDemon
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -461,9 +460,6 @@ public class EntityBoulderFist extends EntityDemon
*/
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
double xCoord;
double yCoord;
double zCoord;
HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 5, 600);
this.worldObj.spawnEntityInWorld(hol);
}
@ -475,7 +471,6 @@ public class EntityBoulderFist extends EntityDemon
{
this.tasks.removeTask(this.aiAttackOnCollide);
//this.tasks.removeTask(this.aiArrowAttack);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiAttackOnCollide);
}
}

View file

@ -20,7 +20,7 @@ public class EntityEarthElemental extends EntityElemental implements IMob
{
if (target instanceof EntityLivingBase)
{
((EntityLivingBase) target).attackEntityFrom(DamageSource.causeMobDamage(this), 10);
target.attackEntityFrom(DamageSource.causeMobDamage(this), 10);
((EntityLivingBase) target).addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 100, 4));
((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0));
}

View file

@ -135,15 +135,6 @@ public class EntityElemental extends EntityDemon
this.motionY *= (double) f2;
this.motionZ *= (double) f2;
}
double d0 = this.posX - this.prevPosX;
double d1 = this.posZ - this.prevPosZ;
float f4 = MathHelper.sqrt_double(d0 * d0 + d1 * d1) * 4.0F;
if (f4 > 1.0F)
{
f4 = 1.0F;
}
}
/**
@ -251,7 +242,7 @@ public class EntityElemental extends EntityDemon
if (this.attackCounter >= 10)
{
this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1008, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
this.worldObj.playAuxSFXAtEntity(null, 1008, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
this.inflictEffectOnEntity(this.targetedEntity);
this.attackCounter = -40;
}
@ -262,7 +253,7 @@ public class EntityElemental extends EntityDemon
}
} else
{
this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(this.motionX, this.motionZ)) * 180.0F / (float) Math.PI;
this.renderYawOffset = this.rotationYaw = -((float) Math.atan2(motionX, this.motionZ)) * 180.0F / (float) Math.PI;
if (this.attackCounter > 0)
{
@ -277,7 +268,7 @@ public class EntityElemental extends EntityDemon
if (b0 != b1)
{
this.dataWatcher.updateObject(25, Byte.valueOf(b1));
this.dataWatcher.updateObject(25, b1);
}
}
}
@ -342,10 +333,10 @@ public class EntityElemental extends EntityDemon
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -378,15 +369,15 @@ public class EntityElemental extends EntityDemon
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(25, Byte.valueOf((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
this.dataWatcher.addObject(25, 0);
}
/**
@ -503,10 +494,10 @@ public class EntityElemental extends EntityDemon
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -540,10 +531,10 @@ public class EntityElemental extends EntityDemon
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -551,10 +542,10 @@ public class EntityElemental extends EntityDemon
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -608,7 +599,6 @@ public class EntityElemental extends EntityDemon
public void setCombatTask()
{
this.tasks.removeTask(this.aiAttackOnCollide);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiAttackOnCollide);
}

View file

@ -17,7 +17,6 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
@ -65,10 +64,10 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -101,14 +100,14 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -245,10 +244,10 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -268,7 +267,7 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -293,9 +292,9 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -317,10 +316,10 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -365,10 +364,10 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -385,7 +384,7 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -400,10 +399,10 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -460,9 +459,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
*/
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
double xCoord;
double yCoord;
double zCoord;
HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 5, 600);
this.worldObj.spawnEntityInWorld(hol);
}
@ -474,7 +470,6 @@ public class EntityFallenAngel extends EntityDemon implements IRangedAttackMob
{
this.tasks.removeTask(this.aiAttackOnCollide);
this.tasks.removeTask(this.aiArrowAttack);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiArrowAttack);
}
}

View file

@ -19,7 +19,7 @@ public class EntityFireElemental extends EntityElemental implements IMob
{
if (target instanceof EntityLivingBase)
{
((EntityLivingBase) target).setFire(10);
target.setFire(10);
((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0));
}
}

View file

@ -20,7 +20,7 @@ public class EntityHolyElemental extends EntityElemental implements IMob
{
if (target instanceof EntityLivingBase)
{
((EntityLivingBase) target).attackEntityFrom(DamageSource.causeMobDamage(this), 15);
target.attackEntityFrom(DamageSource.causeMobDamage(this), 15);
((EntityLivingBase) target).addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 150, 0));
((EntityLivingBase) target).addPotionEffect(new PotionEffect(Potion.poison.id, 100, 1));
}

View file

@ -63,10 +63,10 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -99,14 +99,14 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -263,10 +263,10 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -286,7 +286,7 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -297,7 +297,7 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -311,9 +311,9 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -327,7 +327,7 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
if (!this.worldObj.isRemote)
@ -335,10 +335,10 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -382,10 +382,10 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -402,7 +402,7 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -417,10 +417,10 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -476,9 +476,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
*/
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
double xCoord;
double yCoord;
double zCoord;
IceProjectile hol = new IceProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 3, 600);
this.worldObj.spawnEntityInWorld(hol);
}
@ -490,7 +487,6 @@ public class EntityIceDemon extends EntityDemon implements IRangedAttackMob
{
this.tasks.removeTask(this.aiAttackOnCollide);
this.tasks.removeTask(this.aiArrowAttack);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiArrowAttack);
}
}

View file

@ -19,18 +19,14 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
public class EntityLowerGuardian extends EntityDemon
{
private EntityAIAttackOnCollide aiAttackOnCollide = new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.2D, false);
private static float maxTamedHealth = 50.0F;
private static float maxUntamedHealth = 30.0F;
private int attackTimer;
private boolean isAggro;
public EntityLowerGuardian(World par1World)
{
@ -63,10 +59,10 @@ public class EntityLowerGuardian extends EntityDemon
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -99,14 +95,14 @@ public class EntityLowerGuardian extends EntityDemon
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -137,7 +133,6 @@ public class EntityLowerGuardian extends EntityDemon
this.setAngry(par1NBTTagCompound.getBoolean("Angry"));
attackTimer = par1NBTTagCompound.getByte("attackTimer");
isAggro = par1NBTTagCompound.getBoolean("isAggro");
}
/**
@ -264,10 +259,10 @@ public class EntityLowerGuardian extends EntityDemon
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -287,7 +282,7 @@ public class EntityLowerGuardian extends EntityDemon
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -298,7 +293,7 @@ public class EntityLowerGuardian extends EntityDemon
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -312,9 +307,9 @@ public class EntityLowerGuardian extends EntityDemon
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -328,7 +323,7 @@ public class EntityLowerGuardian extends EntityDemon
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
if (!this.worldObj.isRemote)
@ -336,10 +331,10 @@ public class EntityLowerGuardian extends EntityDemon
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -383,10 +378,10 @@ public class EntityLowerGuardian extends EntityDemon
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -403,7 +398,7 @@ public class EntityLowerGuardian extends EntityDemon
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -418,10 +413,10 @@ public class EntityLowerGuardian extends EntityDemon
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}

View file

@ -20,7 +20,6 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
@ -66,10 +65,10 @@ public class EntityShade extends EntityDemon
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -102,14 +101,14 @@ public class EntityShade extends EntityDemon
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -246,10 +245,10 @@ public class EntityShade extends EntityDemon
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -269,7 +268,7 @@ public class EntityShade extends EntityDemon
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -280,7 +279,7 @@ public class EntityShade extends EntityDemon
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -294,9 +293,9 @@ public class EntityShade extends EntityDemon
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -318,10 +317,10 @@ public class EntityShade extends EntityDemon
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -365,10 +364,10 @@ public class EntityShade extends EntityDemon
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -385,7 +384,7 @@ public class EntityShade extends EntityDemon
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -400,10 +399,10 @@ public class EntityShade extends EntityDemon
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -459,9 +458,6 @@ public class EntityShade extends EntityDemon
*/
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
double xCoord;
double yCoord;
double zCoord;
HolyProjectile hol = new HolyProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 5, 600);
this.worldObj.spawnEntityInWorld(hol);
}
@ -473,7 +469,6 @@ public class EntityShade extends EntityDemon
{
this.tasks.removeTask(this.aiAttackOnCollide);
//this.tasks.removeTask(this.aiArrowAttack);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiAttackOnCollide);
}
}

View file

@ -17,7 +17,6 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
@ -63,10 +62,10 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -99,14 +98,14 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -242,10 +241,10 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -265,7 +264,7 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -276,7 +275,7 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -290,9 +289,9 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -314,10 +313,10 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -361,10 +360,10 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -381,7 +380,7 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -396,10 +395,10 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -455,9 +454,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
*/
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
double xCoord;
double yCoord;
double zCoord;
MudProjectile hol = new MudProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 3, 600, false);
this.worldObj.spawnEntityInWorld(hol);
}
@ -469,7 +465,6 @@ public class EntitySmallEarthGolem extends EntityDemon implements IRangedAttackM
{
this.tasks.removeTask(this.aiAttackOnCollide);
this.tasks.removeTask(this.aiArrowAttack);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiArrowAttack);
}
}

View file

@ -17,7 +17,6 @@ import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.util.DamageSource;
import net.minecraft.world.World;
@ -65,10 +64,10 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
//My guess is that this will alter the max health
if (this.isTamed())
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
//this.func_110148_a(SharedMonsterAttributes.field_111267_a).func_111128_a(10.0D);
@ -103,14 +102,14 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
*/
protected void updateAITick()
{
this.dataWatcher.updateObject(18, Float.valueOf(this.getHealth()));
this.dataWatcher.updateObject(18, this.getHealth());
}
protected void entityInit()
{
super.entityInit();
this.dataWatcher.addObject(18, new Float(this.getHealth()));
this.dataWatcher.addObject(19, new Byte((byte) 0));
this.dataWatcher.addObject(18, this.getHealth());
this.dataWatcher.addObject(19, 0);
}
/**
@ -246,10 +245,10 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
if (par1)
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxTamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxTamedHealth);
} else
{
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(this.maxUntamedHealth);
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(maxUntamedHealth);
}
}
@ -269,7 +268,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
{
ItemFood itemfood = (ItemFood) itemstack.getItem();
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < this.maxTamedHealth)
if (itemfood.isWolfsFavoriteMeat() && this.dataWatcher.getWatchableObjectFloat(18) < maxTamedHealth)
{
if (!par1EntityPlayer.capabilities.isCreativeMode)
{
@ -280,7 +279,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
return true;
@ -294,9 +293,9 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
{
this.aiSit.setSitting(!this.isSitting());
this.isJumping = false;
this.setPathToEntity((PathEntity) null);
this.setTarget((Entity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setTarget(null);
this.setAttackTarget(null);
}
this.sendSittingMessageToPlayer(par1EntityPlayer, !this.isSitting());
@ -310,7 +309,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
if (itemstack.stackSize <= 0)
{
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, (ItemStack) null);
par1EntityPlayer.inventory.setInventorySlotContents(par1EntityPlayer.inventory.currentItem, null);
}
if (!this.worldObj.isRemote)
@ -318,10 +317,10 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
if (this.rand.nextInt(1) == 0)
{
this.setTamed(true);
this.setPathToEntity((PathEntity) null);
this.setAttackTarget((EntityLivingBase) null);
this.setPathToEntity(null);
this.setAttackTarget(null);
this.aiSit.setSitting(true);
this.setHealth(this.maxTamedHealth);
this.setHealth(maxTamedHealth);
this.func_152115_b(par1EntityPlayer.getUniqueID().toString());
this.playTameEffect(true);
this.worldObj.setEntityState(this, (byte) 7);
@ -365,10 +364,10 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
if (par1)
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 | 2)));
this.dataWatcher.updateObject(16, b0 | 2);
} else
{
this.dataWatcher.updateObject(16, Byte.valueOf((byte) (b0 & -3)));
this.dataWatcher.updateObject(16, b0 & -3);
}
}
@ -385,7 +384,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
*/
public void setCollarColor(int par1)
{
this.dataWatcher.updateObject(20, Byte.valueOf((byte) (par1 & 15)));
this.dataWatcher.updateObject(20, par1 & 15);
}
/**
@ -400,10 +399,10 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
{
if (par1)
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 1));
this.dataWatcher.updateObject(19, 1);
} else
{
this.dataWatcher.updateObject(19, Byte.valueOf((byte) 0));
this.dataWatcher.updateObject(19, 0);
}
}
@ -459,10 +458,7 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
*/
public void attackEntityWithRangedAttack(EntityLivingBase par1EntityLivingBase, float par2)
{
double xCoord;
double yCoord;
double zCoord;
this.worldObj.playAuxSFXAtEntity((EntityPlayer) null, 1009, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
this.worldObj.playAuxSFXAtEntity(null, 1009, (int) this.posX, (int) this.posY, (int) this.posZ, 0);
FireProjectile hol = new FireProjectile(worldObj, this, par1EntityLivingBase, 1.8f, 0f, 20, 600);
this.worldObj.spawnEntityInWorld(hol);
}
@ -474,7 +470,6 @@ public class EntityWingedFireDemon extends EntityDemon implements IRangedAttackM
{
this.tasks.removeTask(this.aiAttackOnCollide);
this.tasks.removeTask(this.aiArrowAttack);
ItemStack itemstack = this.getHeldItem();
this.tasks.addTask(4, this.aiArrowAttack);
}
}

View file

@ -17,8 +17,10 @@ import java.util.List;
public class ArmourInhibitor extends EnergyItems
{
private static IIcon activeIcon;
private static IIcon passiveIcon;
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int tickDelay = 200;
public ArmourInhibitor()
@ -110,10 +112,6 @@ public class ArmourInhibitor extends EnergyItems
{
par1ItemStack.setItemDamage(1);
tag.setInteger("worldTimeDelay", (int) (par2World.getWorldTime() - 1) % tickDelay);
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
}
} else
{
par1ItemStack.setItemDamage(par1ItemStack.getMaxDamage());
@ -139,14 +137,12 @@ public class ArmourInhibitor extends EnergyItems
if (par1ItemStack.getTagCompound().getBoolean("isActive"))
{
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay") && par3Entity instanceof EntityPlayer)
if (par2World.getWorldTime() % tickDelay == par1ItemStack.getTagCompound().getInteger("worldTimeDelay"))
{
}
//TODO Do stuff
par3EntityPlayer.addPotionEffect(new PotionEffect(AlchemicalWizardry.customPotionInhibit.id, 2, 0));
}
return;
}
}

View file

@ -33,7 +33,6 @@ public class BloodShard extends Item implements ArmourUpgrade
if (this.equals(ModItems.demonBloodShard))
{
this.itemIcon = iconRegister.registerIcon("AlchemicalWizardry:DemonBloodShard");
return;
}
}

View file

@ -32,8 +32,10 @@ public class BoundAxe extends ItemAxe implements IBindable
{
public float efficiencyOnProperMaterial = 12.0F;
public float damageVsEntity;
private static IIcon activeIcon;
private static IIcon passiveIcon;
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int energyUsed;
public BoundAxe()
@ -212,7 +214,6 @@ public class BoundAxe extends ItemAxe implements IBindable
}
par1ItemStack.setItemDamage(0);
return;
}
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
@ -260,19 +261,11 @@ public class BoundAxe extends ItemAxe implements IBindable
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
{
if (!getActivated(par1ItemStack))
{
return false;
}
return true;
return getActivated(par1ItemStack);
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, Block par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)
{
if ((double) par3.getBlockHardness(par2World, par4, par5, par6) != 0.0D)
{
}
return true;
}

View file

@ -31,11 +31,12 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BoundPickaxe extends ItemPickaxe implements IBindable
{
public float efficiencyOnProperMaterial = 12.0F;
public float damageVsEntity;
private static IIcon activeIcon;
private static IIcon passiveIcon;
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int energyUsed;
@ -237,7 +238,6 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
}
par1ItemStack.setItemDamage(0);
return;
}
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
@ -285,11 +285,7 @@ public class BoundPickaxe extends ItemPickaxe implements IBindable
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
{
if (!getActivated(par1ItemStack))
{
return false;
}
return true;
return getActivated(par1ItemStack);
}
@Override

View file

@ -35,8 +35,10 @@ public class BoundShovel extends ItemSpade implements IBindable
public float efficiencyOnProperMaterial = 12.0F;
public float damageVsEntity;
private static IIcon activeIcon;
private static IIcon passiveIcon;
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int energyUsed;
@ -216,7 +218,6 @@ public class BoundShovel extends ItemSpade implements IBindable
}
par1ItemStack.setItemDamage(0);
return;
}
public void setActivated(ItemStack par1ItemStack, boolean newActivated)
@ -264,11 +265,7 @@ public class BoundShovel extends ItemSpade implements IBindable
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLivingBase par2EntityLivingBase, EntityLivingBase par3EntityLivingBase)
{
if (!getActivated(par1ItemStack))
{
return false;
}
return true;
return getActivated(par1ItemStack);
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, World par2World, int par3, int par4, int par5, int par6, EntityLivingBase par7EntityLivingBase)

View file

@ -3,6 +3,7 @@ package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.items.interfaces.IBindable;
import WayofTime.alchemicalWizardry.api.soulNetwork.LifeEssenceNetwork;
import WayofTime.alchemicalWizardry.api.soulNetwork.SoulNetworkHandler;
import WayofTime.alchemicalWizardry.common.spell.complex.effect.SpellHelper;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -24,7 +25,6 @@ public class CheatyItem extends Item implements IBindable
public CheatyItem()
{
super();
DamageSource damageSource = DamageSource.generic;
setMaxStackSize(1);
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
}
@ -81,10 +81,10 @@ public class CheatyItem extends Item implements IBindable
if (par3EntityPlayer.isSneaking())
{
EnergyItems.setCurrentEssence(itemTag.getString("ownerName"), 0);
SoulNetworkHandler.setCurrentEssence(itemTag.getString("ownerName"), 0);
} else
{
EnergyItems.addEssenceToMaximum(itemTag.getString("ownerName"), 1000000, Integer.MAX_VALUE);
SoulNetworkHandler.addCurrentEssenceToMaximum(itemTag.getString("ownerName"), 1000000, Integer.MAX_VALUE);
}
return par1ItemStack;
}
@ -112,7 +112,7 @@ public class CheatyItem extends Item implements IBindable
double posY = player.posY;
double posZ = player.posZ;
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
float f = (float) 1.0F;
float f = 1.0F;
float f1 = f * 0.6F + 0.4F;
float f2 = f * f * 0.7F - 0.5F;
float f3 = f * f * 0.6F - 0.7F;
@ -144,7 +144,7 @@ public class CheatyItem extends Item implements IBindable
}
@Override
public boolean hasContainerItem()
public boolean hasContainerItem(ItemStack itemStack)
{
return true;
}

View file

@ -1,10 +1,15 @@
package WayofTime.alchemicalWizardry.common.items;
import WayofTime.alchemicalWizardry.api.event.SacrificeKnifeUsedEvent;
import WayofTime.alchemicalWizardry.api.sacrifice.PlayerSacrificeHandler;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.FakePlayer;
import WayofTime.alchemicalWizardry.AlchemicalWizardry;
import WayofTime.alchemicalWizardry.api.tile.IBloodAltar;
@ -21,33 +26,59 @@ public class CreativeDagger extends Item
setFull3D();
}
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
{
if (par3EntityPlayer instanceof FakePlayer)
if (this.canUseForSacrifice(stack))
{
return par1ItemStack;
player.setItemInUse(stack, this.getMaxItemUseDuration(stack));
return stack;
}
double posX = par3EntityPlayer.posX;
double posY = par3EntityPlayer.posY;
double posZ = par3EntityPlayer.posZ;
par2World.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (par2World.rand.nextFloat() - par2World.rand.nextFloat()) * 0.8F);
float f = (float) 1.0F;
if (!player.capabilities.isCreativeMode)
{
SacrificeKnifeUsedEvent evt = new SacrificeKnifeUsedEvent(player, true, true, 2);
if(MinecraftForge.EVENT_BUS.post(evt))
{
return stack;
}
if(evt.shouldDrainHealth)
{
player.setHealth(player.getHealth() - 2);
}
if(!evt.shouldFillAltar)
{
return stack;
}
}
if (player instanceof FakePlayer)
{
return stack;
}
double posX = player.posX;
double posY = player.posY;
double posZ = player.posZ;
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
float f = 1.0F;
float f1 = f * 0.6F + 0.4F;
float f2 = f * f * 0.7F - 0.5F;
float f3 = f * f * 0.6F - 0.7F;
for (int l = 0; l < 8; ++l)
{
par2World.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
world.spawnParticle("reddust", posX + Math.random() - Math.random(), posY + Math.random() - Math.random(), posZ + Math.random() - Math.random(), f1, f2, f3);
}
if (!par2World.isRemote && SpellHelper.isFakePlayer(par2World, par3EntityPlayer))
if (!world.isRemote && SpellHelper.isFakePlayer(world, player))
{
return par1ItemStack;
return stack;
}
findAndFillAltar(par2World, par3EntityPlayer, Integer.MAX_VALUE);
return par1ItemStack;
findAndFillAltar(world, player, Integer.MAX_VALUE);
return stack;
}
public void findAndFillAltar(World world, EntityPlayer player, int amount)
@ -68,7 +99,7 @@ public class CreativeDagger extends Item
public IBloodAltar getAltar(World world, int x, int y, int z)
{
TileEntity tileEntity = null;
TileEntity tileEntity;
for (int i = -2; i <= 2; i++)
{
@ -78,29 +109,47 @@ public class CreativeDagger extends Item
{
tileEntity = world.getTileEntity(i + x, k + y, j + z);
if ((tileEntity instanceof IBloodAltar))
if(tileEntity instanceof IBloodAltar)
{
return (IBloodAltar) tileEntity;
return (IBloodAltar)tileEntity;
}
}
if ((tileEntity instanceof IBloodAltar))
{
return (IBloodAltar) tileEntity;
}
}
if ((tileEntity instanceof IBloodAltar))
{
return (IBloodAltar) tileEntity;
}
}
if ((tileEntity instanceof IBloodAltar))
{
return (IBloodAltar) tileEntity;
}
return null;
}
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5)
{
if(!world.isRemote && entity instanceof EntityPlayer)
{
this.setUseForSacrifice(stack, this.isPlayerPreparedForSacrifice(world, (EntityPlayer)entity));
}
}
public boolean isPlayerPreparedForSacrifice(World world, EntityPlayer player)
{
return !world.isRemote && (PlayerSacrificeHandler.getPlayerIncense(player) > 0);
}
public boolean canUseForSacrifice(ItemStack stack)
{
NBTTagCompound tag = stack.getTagCompound();
return tag != null && tag.getBoolean("sacrifice");
}
public void setUseForSacrifice(ItemStack stack, boolean sacrifice)
{
NBTTagCompound tag = stack.getTagCompound();
if(tag == null)
{
tag = new NBTTagCompound();
stack.setTagCompound(tag);
}
tag.setBoolean("sacrifice", sacrifice);
}
}

View file

@ -33,8 +33,6 @@ import cpw.mods.fml.relauncher.SideOnly;
public class DaggerOfSacrifice extends EnergyItems
{
private float weaponDamage;
public DaggerOfSacrifice()
{
super();
@ -43,7 +41,6 @@ public class DaggerOfSacrifice extends EnergyItems
setEnergyUsed(100);
setFull3D();
setMaxDamage(100);
weaponDamage = 1.0F;
}
@Override
@ -183,7 +180,7 @@ public class DaggerOfSacrifice extends EnergyItems
public IBloodAltar getAltar(World world, int x, int y, int z)
{
TileEntity tileEntity = null;
TileEntity tileEntity;
for (int i = -2; i <= 2; i++)
{
@ -198,22 +195,7 @@ public class DaggerOfSacrifice extends EnergyItems
return (IBloodAltar) tileEntity;
}
}
if ((tileEntity instanceof IBloodAltar))
{
return (IBloodAltar) tileEntity;
}
}
if ((tileEntity instanceof IBloodAltar))
{
return (IBloodAltar) tileEntity;
}
}
if ((tileEntity instanceof IBloodAltar))
{
return (IBloodAltar) tileEntity;
}
return null;

View file

@ -35,11 +35,6 @@ public class DemonPlacer extends Item
this.maxStackSize = 1;
}
public String getItemDisplayName(ItemStack par1ItemStack)
{
return "Demon Crystal";
}
@SideOnly(Side.CLIENT)
public int getColorFromItemStack(ItemStack par1ItemStack, int par2)
{

View file

@ -15,7 +15,6 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.DamageSource;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
@ -29,7 +28,6 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
public EnergyBattery(int damage)
{
super();
DamageSource damageSource = DamageSource.generic;
setMaxStackSize(1);
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
maxEssence = damage;
@ -120,7 +118,7 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
double posY = player.posY;
double posZ = player.posZ;
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
float f = (float) 1.0F;
float f = 1.0F;
float f1 = f * 0.6F + 0.4F;
float f2 = f * f * 0.7F - 0.5F;
float f3 = f * f * 0.6F - 0.7F;
@ -179,12 +177,13 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
}
@Override
public boolean hasContainerItem()
public boolean hasContainerItem(ItemStack itemStack)
{
return true;
}
//@SideOnly(Side.SERVER)
@Deprecated
public int getCurrentEssence(ItemStack par1ItemStack)
{
if (par1ItemStack == null)
@ -209,8 +208,7 @@ public class EnergyBattery extends Item implements ArmourUpgrade, IBindable, IBl
worldSave.setItemData(owner, data);
}
int currentEssence = data.currentEssence;
return (currentEssence);
return data.currentEssence;
}
@Override

View file

@ -18,10 +18,11 @@ import java.util.List;
public class EnergyBazooka extends EnergyItems
{
private static IIcon activeIcon;
private static IIcon passiveIcon;
private static int damage;
private static final int maxDelay = 150;
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int damage;
public EnergyBazooka()
{
@ -65,6 +66,8 @@ public class EnergyBazooka extends EnergyItems
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
final int maxDelay = 150;
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
{
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
@ -84,7 +87,7 @@ public class EnergyBazooka extends EnergyItems
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if(!this.syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed()))
if(!syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed()))
{
return par1ItemStack;
}
@ -141,7 +144,6 @@ public class EnergyBazooka extends EnergyItems
}
par1ItemStack.setItemDamage(0);
return;
}
@Override

View file

@ -17,10 +17,11 @@ import java.util.List;
public class EnergyBlast extends EnergyItems
{
private static IIcon activeIcon;
private static IIcon passiveIcon;
private static int damage;
private static final int maxDelay = 15;
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int damage;
public EnergyBlast()
{
@ -65,6 +66,8 @@ public class EnergyBlast extends EnergyItems
@Override
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
final int maxDelay = 15;
if (!EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer) || par3EntityPlayer.isSneaking())
{
this.setActivated(par1ItemStack, !getActivated(par1ItemStack));
@ -84,7 +87,7 @@ public class EnergyBlast extends EnergyItems
if (!par3EntityPlayer.capabilities.isCreativeMode)
{
if(!this.syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed()))
if(!syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed()))
{
return par1ItemStack;
}
@ -133,7 +136,6 @@ public class EnergyBlast extends EnergyItems
}
par1ItemStack.setItemDamage(0);
return;
}
@Override

View file

@ -41,7 +41,7 @@ public class EnergyItems extends Item implements IBindable
double posY = player.posY;
double posZ = player.posZ;
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
float f = (float) 1.0F;
float f = 1.0F;
float f1 = f * 0.6F + 0.4F;
float f2 = f * f * 0.7F - 0.5F;
float f3 = f * f * 0.6F - 0.7F;
@ -186,8 +186,7 @@ public class EnergyItems extends Item implements IBindable
//Global static methods
public static boolean checkAndSetItemOwner(ItemStack item, EntityPlayer player)
{
if (SpellHelper.isFakePlayer(player)) return false;
return SoulNetworkHandler.checkAndSetItemPlayer(item, player);
return !SpellHelper.isFakePlayer(player) && SoulNetworkHandler.checkAndSetItemPlayer(item, player);
}
public static void setItemOwner(ItemStack item, String ownerName)
@ -223,6 +222,7 @@ public class EnergyItems extends Item implements IBindable
return item.getTagCompound().getString("ownerName");
}
@Deprecated
public static void drainPlayerNetwork(EntityPlayer player, int damageToBeDone)
{
String ownerName = SpellHelper.getUsername(player);
@ -251,6 +251,7 @@ public class EnergyItems extends Item implements IBindable
}
}
@Deprecated
public static int getCurrentEssence(String ownerName)
{
if (MinecraftServer.getServer() == null)
@ -270,6 +271,7 @@ public class EnergyItems extends Item implements IBindable
return data.currentEssence;
}
@Deprecated
public static void setCurrentEssence(String ownerName, int amount)
{
if (MinecraftServer.getServer() == null)
@ -290,6 +292,7 @@ public class EnergyItems extends Item implements IBindable
data.markDirty();
}
@Deprecated
public static void addEssenceToMaximum(String ownerName, int amount, int maximum)
{
if (MinecraftServer.getServer() == null)

View file

@ -25,9 +25,10 @@ import cpw.mods.fml.relauncher.SideOnly;
public class EnergySword extends ItemSword
{
private NBTTagCompound data;
private static IIcon activeIcon;
private static IIcon passiveIcon;
@SideOnly(Side.CLIENT)
private IIcon activeIcon;
@SideOnly(Side.CLIENT)
private IIcon passiveIcon;
private int energyUsed;
public EnergySword()
@ -168,7 +169,6 @@ public class EnergySword extends ItemSword
}
par1ItemStack.setItemDamage(0);
return;
}
public void setActivated(ItemStack par1ItemStack, boolean newActivated)

View file

@ -23,12 +23,13 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAltarManipulator
{
private static IIcon plateIcon;
@SideOnly(Side.CLIENT)
private IIcon plateIcon;
public static int conversionRate = 100; //LP / half heart
public static float activationPoint = 0.5f;
public static int tickRate = 20;
public static int maxStored = 10000;
public int conversionRate = 100; //LP / half heart
public float activationPoint = 0.5f;
public int tickRate = 20;
public int maxStored = 10000;
public ItemBloodLetterPack()
{
@ -50,8 +51,6 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
if (!(par1ItemStack.getTagCompound() == null))
{
NBTTagCompound itemTag = par1ItemStack.getTagCompound();
par3List.add(StatCollector.translateToLocal("tooltip.lp.storedlp") + " " + this.getStoredLP(par1ItemStack));
}
}
@ -164,7 +163,7 @@ public class ItemBloodLetterPack extends ItemArmor implements ArmourUpgrade, IAl
@Override
public void onArmourUpdate(World world, EntityPlayer player, ItemStack thisItemStack)
{
return;
}
@Override

View file

@ -5,7 +5,6 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemBloodRuneBlock extends ItemBlock
{
public ItemBloodRuneBlock(Block block)
{
@ -15,9 +14,8 @@ public class ItemBloodRuneBlock extends ItemBlock
}
public String getUnlocalizedName(ItemStack itemstack)
{
String name = "";
String name;
switch (itemstack.getItemDamage())
{

View file

@ -5,7 +5,6 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemCrystalBlock extends ItemBlock
{
public ItemCrystalBlock(Block par1)
{
@ -15,9 +14,8 @@ public class ItemCrystalBlock extends ItemBlock
}
public String getUnlocalizedName(ItemStack itemstack)
{
String name = "";
String name;
switch (itemstack.getItemDamage())
{

View file

@ -13,7 +13,6 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.DamageSource;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import net.minecraftforge.common.util.FakePlayer;
@ -25,7 +24,6 @@ public class ItemDiabloKey extends EnergyItems
public ItemDiabloKey()
{
super();
DamageSource damageSource = DamageSource.generic;
setMaxStackSize(1);
setCreativeTab(AlchemicalWizardry.tabBloodMagic);
this.setEnergyUsed(1000);

View file

@ -15,7 +15,7 @@ public class ItemEnchantmentGlyphBlock extends ItemBlock
@Override
public String getUnlocalizedName(ItemStack itemstack)
{
String name = "";
String name;
switch (itemstack.getItemDamage())
{

View file

@ -28,10 +28,6 @@ public class ItemIncense extends Item implements IIncense
@SideOnly(Side.CLIENT)
private IIcon[] icons;
public static int minValue;
public static int maxValue;
public static int itemDuration;
public ItemIncense()
{
super();
@ -194,7 +190,7 @@ public class ItemIncense extends Item implements IIncense
public final float greenColour;
public final float blueColour;
private EnumIncense(int minValue, int maxValue, float tickRate, int dur, float red, float green, float blue)
EnumIncense(int minValue, int maxValue, float tickRate, int dur, float red, float green, float blue)
{
this.minValue = minValue;
this.maxValue = maxValue;

View file

@ -274,7 +274,7 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
}
} else
{
world.playAuxSFX(0000, x, y + 1, z, 0);
world.playAuxSFX(0, x, y + 1, z, 0);
return true;
}
}
@ -406,7 +406,6 @@ public class ItemRitualDiviner extends EnergyItems implements IRitualDiviner
public void rotateRituals(World world, EntityPlayer player, ItemStack stack, boolean next)
{
this.voidStoredLocation(stack);
int maxRitualID = Rituals.getNumberOfRituals();
String currentRitualID = this.getCurrentRitual(stack);
this.setCurrentRitual(stack, next? Rituals.getNextRitualKey(currentRitualID):Rituals.getPreviousRitualKey(currentRitualID));

View file

@ -5,7 +5,6 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemSpellEffectBlock extends ItemBlock
{
public ItemSpellEffectBlock(Block par1)
{
@ -14,9 +13,8 @@ public class ItemSpellEffectBlock extends ItemBlock
}
public String getUnlocalizedName(ItemStack itemstack)
{
String name = "";
String name;
switch (itemstack.getItemDamage())
{

View file

@ -5,7 +5,6 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemSpellEnhancementBlock extends ItemBlock
{
public ItemSpellEnhancementBlock(Block par1)
{
@ -15,9 +14,8 @@ public class ItemSpellEnhancementBlock extends ItemBlock
}
public String getUnlocalizedName(ItemStack itemstack)
{
String name = "";
String name;
switch (itemstack.getItemDamage())
{

View file

@ -5,7 +5,6 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemSpellModifierBlock extends ItemBlock
{
public ItemSpellModifierBlock(Block par1)
{
@ -15,9 +14,8 @@ public class ItemSpellModifierBlock extends ItemBlock
}
public String getUnlocalizedName(ItemStack itemstack)
{
String name = "";
String name;
switch (itemstack.getItemDamage())
{

View file

@ -5,7 +5,6 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemSpellParadigmBlock extends ItemBlock
{
public ItemSpellParadigmBlock(Block par1)
{
@ -15,9 +14,8 @@ public class ItemSpellParadigmBlock extends ItemBlock
@Override
public String getUnlocalizedName(ItemStack itemstack)
{
String name = "";
String name;
switch (itemstack.getItemDamage())
{

View file

@ -15,7 +15,7 @@ public class ItemStabilityGlyphBlock extends ItemBlock
@Override
public String getUnlocalizedName(ItemStack itemstack)
{
String name = "";
String name;
switch (itemstack.getItemDamage())
{

View file

@ -56,10 +56,7 @@ public class LavaCrystal extends EnergyItems
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if (EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer))
{
int damage = this.getDamage(par1ItemStack);
}
EnergyItems.checkAndSetItemOwner(par1ItemStack, par3EntityPlayer);
return par1ItemStack;
}

View file

@ -35,7 +35,7 @@ public class OrbOfTesting extends EnergyItems
return par1ItemStack;
}
if (this.syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed()))
if (syphonBatteries(par1ItemStack, par3EntityPlayer, this.getEnergyUsed()))
{
par3EntityPlayer.heal(1);
}

View file

@ -125,7 +125,7 @@ public class SacrificialDagger extends Item
double posY = player.posY;
double posZ = player.posZ;
world.playSoundEffect((double) ((float) posX + 0.5F), (double) ((float) posY + 0.5F), (double) ((float) posZ + 0.5F), "random.fizz", 0.5F, 2.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.8F);
float f = (float) 1.0F;
float f = 1.0F;
float f1 = f * 0.6F + 0.4F;
float f2 = f * f * 0.7F - 0.5F;
float f3 = f * f * 0.6F - 0.7F;
@ -174,7 +174,7 @@ public class SacrificialDagger extends Item
public IBloodAltar getAltar(World world, int x, int y, int z)
{
TileEntity tileEntity = null;
TileEntity tileEntity;
for (int i = -2; i <= 2; i++)
{
@ -222,12 +222,8 @@ public class SacrificialDagger extends Item
public boolean canUseForSacrifice(ItemStack stack)
{
NBTTagCompound tag = stack.getTagCompound();
if(tag == null)
{
return false;
}
return tag.getBoolean("sacrifice");
return tag != null && tag.getBoolean("sacrifice");
}
public void setUseForSacrifice(ItemStack stack, boolean sacrifice)
@ -246,6 +242,6 @@ public class SacrificialDagger extends Item
@SideOnly(Side.CLIENT)
public boolean hasEffect(ItemStack stack, int pass)
{
return this.canUseForSacrifice(stack) ? true : super.hasEffect(stack, pass);
return this.canUseForSacrifice(stack) || super.hasEffect(stack, pass);
}
}

View file

@ -41,10 +41,14 @@ import cpw.mods.fml.relauncher.SideOnly;
public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialArmor, IBindable, IRevealer, IGoggles, IRunicArmor, ILPGauge
{
private static int invSize = 9;
private static IIcon helmetIcon;
private static IIcon plateIcon;
private static IIcon leggingsIcon;
private static IIcon bootsIcon;
@SideOnly(Side.CLIENT)
private IIcon helmetIcon;
@SideOnly(Side.CLIENT)
private IIcon plateIcon;
@SideOnly(Side.CLIENT)
private IIcon leggingsIcon;
@SideOnly(Side.CLIENT)
private IIcon bootsIcon;
public static boolean tryComplexRendering = true;
@ -251,22 +255,22 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
@Override
public int getArmorDisplay(EntityPlayer player, ItemStack armor, int slot)
{
if (armor.equals(ModItems.boundHelmet))
if (armor.getItem() == ModItems.boundHelmet)
{
return 3;
}
if (armor.equals(ModItems.boundPlate))
if (armor.getItem() == ModItems.boundPlate)
{
return 8;
}
if (armor.equals(ModItems.boundLeggings))
if (armor.getItem() == ModItems.boundLeggings)
{
return 6;
}
if (armor.equals(ModItems.boundBoots))
if (armor.getItem() == ModItems.boundBoots)
{
return 3;
}
@ -322,7 +326,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
if (this.tryComplexRendering)
if (tryComplexRendering)
{
return "alchemicalwizardry:models/armor/BloodArmour_WIP.png";
}
@ -372,15 +376,6 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
itemStack.setTagCompound(new NBTTagCompound());
}
int maxBloodLevel = getMaxBloodShardLevel(itemStack);
ItemStack[] inv = getInternalInventory(itemStack);
if (inv != null)
{
int iSize = 0;
int iBlood = 0;
}
if (!player.isPotionActive(AlchemicalWizardry.customPotionInhibit))
{
tickInternalInventory(itemStack, world, player, 0, false);
@ -389,8 +384,6 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
this.setIsInvisible(itemStack, player.isPotionActive(Potion.invisibility.id));
this.repairArmour(world, player, itemStack);
return;
}
public void repairArmour(World world, EntityPlayer player, ItemStack itemStack)
@ -491,7 +484,6 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
return false;
}
Item item = addedItemStack.getItem();
int candidateSlot = -1;
for (int i = invSize - 1; i >= 0; i--)
@ -540,7 +532,7 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
for (int i = 0; i < tagList.tagCount(); i++)
{
NBTTagCompound tag = (NBTTagCompound) tagList.getCompoundTagAt(i);
NBTTagCompound tag = tagList.getCompoundTagAt(i);
int slot = tag.getByte("Slot");
if (slot >= 0 && slot < invSize)
@ -565,8 +557,6 @@ public class BoundArmour extends ItemArmor implements IAlchemyGoggles, ISpecialA
for (int i = 0; i < invSize; i++)
{
ItemStack stack = inventory[i];
if (inventory[i] != null)
{
NBTTagCompound tag = new NBTTagCompound();

Some files were not shown because too many files have changed in this diff Show more