From 20bef6e26d948698398bd16aeab8c9e6b89110e4 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Thu, 22 Aug 2019 20:01:40 -0400 Subject: Format/import cleanup --- .../darkknight/jewelrycraft/curses/CurseBlind.java | 17 +- .../jewelrycraft/curses/CurseDeathsTouch.java | 15 +- .../jewelrycraft/curses/CurseDoubleDown.java | 19 +- .../jewelrycraft/curses/CurseFlamingSoul.java | 10 +- .../darkknight/jewelrycraft/curses/CurseGreed.java | 6 +- .../jewelrycraft/curses/CurseHumbleBundle.java | 28 +-- .../curses/CurseIncredibleDevotion.java | 20 +-- .../jewelrycraft/curses/CurseInfamy.java | 58 ++----- .../darkknight/jewelrycraft/curses/CurseList.java | 104 ++++------- .../jewelrycraft/curses/CurseMidasTouch.java | 193 ++++++--------------- .../jewelrycraft/curses/CurseMoneyEqualsPower.java | 67 +++---- .../jewelrycraft/curses/CursePentagram.java | 186 ++++++-------------- .../jewelrycraft/curses/CurseRabbitsPaw.java | 19 +- .../jewelrycraft/curses/CurseRottenHeart.java | 14 +- .../jewelrycraft/curses/CurseSacredOath.java | 10 +- .../jewelrycraft/curses/CurseScionOfHell.java | 20 +-- .../jewelrycraft/curses/CurseVampireHunger.java | 24 +-- 17 files changed, 235 insertions(+), 575 deletions(-) (limited to 'src/main/java/darkknight/jewelrycraft/curses') diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java b/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java index adaf528..04a9ce0 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java @@ -18,17 +18,14 @@ public class CurseBlind extends Curse { @Override public void action(World world, EntityPlayer player) { - if (!player.isPotionActive(Potion.blindness) || player - .getActivePotionEffect(Potion.blindness) - .getDuration() < 30) - player.addPotionEffect(new PotionEffect( - Potion.blindness.id, 60)); + if (!player.isPotionActive(Potion.blindness) + || player.getActivePotionEffect(Potion.blindness).getDuration() < 30) + player.addPotionEffect(new PotionEffect(Potion.blindness.id, 60)); } @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".blind.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".blind.description"); } @Override @@ -46,14 +43,12 @@ public class CurseBlind extends Curse { } @Override - public int weight(World world, EntityPlayer player, - Random random) { + public int weight(World world, EntityPlayer player, Random random) { return 7; } @Override public String getDisplayName() { - return StatCollector.translateToLocal( - "curse." + Variables.MODID + ".blind"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".blind"); } } diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseDeathsTouch.java b/src/main/java/darkknight/jewelrycraft/curses/CurseDeathsTouch.java index 6281db1..2541759 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseDeathsTouch.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseDeathsTouch.java @@ -16,12 +16,10 @@ public class CurseDeathsTouch extends Curse { } @Override - public boolean attackedByPlayerActionCancelable( - LivingAttackEvent event, World world, - EntityPlayer player, Entity target) { + public boolean attackedByPlayerActionCancelable(LivingAttackEvent event, World world, EntityPlayer player, + Entity target) { if (!world.isRemote) { - target.attackEntityFrom(DamageSource.wither, - event.ammount); + target.attackEntityFrom(DamageSource.wither, event.ammount); } return true; @@ -29,15 +27,12 @@ public class CurseDeathsTouch extends Curse { @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID - + ".deathsTouch.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".deathsTouch.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".deathsTouch"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".deathsTouch"); } @Override diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseDoubleDown.java b/src/main/java/darkknight/jewelrycraft/curses/CurseDoubleDown.java index 202d8bf..b39f1c9 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseDoubleDown.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseDoubleDown.java @@ -16,25 +16,21 @@ public class CurseDoubleDown extends Curse { } @Override - public void attackedAction(World world, EntityPlayer player, - LivingAttackEvent event, Entity attacker) { + public void attackedAction(World world, EntityPlayer player, LivingAttackEvent event, Entity attacker) { if (event.source.damageType.equals("doubleDown")) { return; // Don't stack double down } - player.attackEntityFrom(DamageSourceList.doubleDown, - event.ammount); + player.attackEntityFrom(DamageSourceList.doubleDown, event.ammount); } @Override - public void attackedByPlayerAction(LivingAttackEvent event, - World world, EntityPlayer player, Entity target) { + public void attackedByPlayerAction(LivingAttackEvent event, World world, EntityPlayer player, Entity target) { if (event.source.damageType.equals("doubleDown")) { return; // Don't stack double down } - target.attackEntityFrom(DamageSourceList.doubleDown, - event.ammount); + target.attackEntityFrom(DamageSourceList.doubleDown, event.ammount); } @Override @@ -44,15 +40,12 @@ public class CurseDoubleDown extends Curse { @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID - + ".doubledown.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".doubledown.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".doubledown"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".doubledown"); } @Override diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java b/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java index 9811eb8..f06bfa6 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java @@ -13,16 +13,13 @@ public class CurseFlamingSoul extends Curse { super(name, txtID, pack); } - public void attackedByPlayerAction(World world, - EntityPlayer player, Entity target) { + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) { player.setFire(5); } @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID - + ".flamingsoul.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".flamingsoul.description"); } @Override @@ -32,7 +29,6 @@ public class CurseFlamingSoul extends Curse { @Override public String getDisplayName() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".flamingsoul"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".flamingsoul"); } } diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java b/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java index 4ea7ba3..48ff321 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java @@ -24,8 +24,7 @@ public class CurseGreed extends Curse { @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".greed.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".greed.description"); } @Override @@ -35,7 +34,6 @@ public class CurseGreed extends Curse { @Override public String getDisplayName() { - return StatCollector.translateToLocal( - "curse." + Variables.MODID + ".greed"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".greed"); } } diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java b/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java index 76487a6..41219f2 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java @@ -22,14 +22,12 @@ import net.minecraftforge.event.world.BlockEvent; * */ public class CurseHumbleBundle extends Curse { - protected CurseHumbleBundle(String name, int txtID, - String texturepack) { + protected CurseHumbleBundle(String name, int txtID, String texturepack) { super(name, txtID, texturepack); } @Override - public void entityDropItems(EntityPlayer player, Entity target, - ArrayList drops) { + public void entityDropItems(EntityPlayer player, Entity target, ArrayList drops) { for (EntityItem item : drops) { ItemStack drop = item.getEntityItem().copy(); target.entityDropItem(drop, 0.5F); @@ -37,22 +35,17 @@ public class CurseHumbleBundle extends Curse { } @Override - public void onBlockItemsDrop(EntityPlayer player, - BlockEvent.HarvestDropsEvent event) { + public void onBlockItemsDrop(EntityPlayer player, BlockEvent.HarvestDropsEvent event) { for (ItemStack item : event.drops) { ItemStack drop = item.copy(); - if (drop.getItem() != Item - .getItemFromBlock(event.block)) - dropItem(event.world, event.x, event.y, - event.z, drop); + if (drop.getItem() != Item.getItemFromBlock(event.block)) + dropItem(event.world, event.x, event.y, event.z, drop); } } - public void dropItem(World world, double x, double y, double z, - ItemStack stack) { - EntityItem entityitem = new EntityItem(world, x + 0.5D, - y + 0.5D, z + 0.5D, stack); + public void dropItem(World world, double x, double y, double z, ItemStack stack) { + EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack); entityitem.motionX = 0; entityitem.motionZ = 0; entityitem.motionY = 0.11000000298023224D; @@ -61,15 +54,12 @@ public class CurseHumbleBundle extends Curse { @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID - + ".humblebundle.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".humblebundle.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".humblebundle"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".humblebundle"); } @Override diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseIncredibleDevotion.java b/src/main/java/darkknight/jewelrycraft/curses/CurseIncredibleDevotion.java index da88c50..3f16ccf 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseIncredibleDevotion.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseIncredibleDevotion.java @@ -9,33 +9,25 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; public class CurseIncredibleDevotion extends Curse { - protected CurseIncredibleDevotion(String name, int txtID, - String texturepack) { + protected CurseIncredibleDevotion(String name, int txtID, String texturepack) { super(name, txtID, texturepack); } @Override - public void entityDeathAction(World world, EntityLivingBase target, - EntityPlayer player) { + public void entityDeathAction(World world, EntityLivingBase target, EntityPlayer player) { if (rand.nextInt(10) == 0) { - world.createExplosion(target, target.posX, - target.posY, target.posZ, - target.getMaxHealth() / (10.0f * (1 - / ConfigHandler.DEVOTION_FACTOR)), - true); + world.createExplosion(target, target.posX, target.posY, target.posZ, + target.getMaxHealth() / (10.0f * (1 / ConfigHandler.DEVOTION_FACTOR)), true); } } @Override public String getDisplayName() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".incredibledevotion"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".incredibledevotion"); } @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID - + ".incredibledevotion.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".incredibledevotion.description"); } } diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java b/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java index 720ea6f..a24c92c 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java @@ -32,64 +32,40 @@ public class CurseInfamy extends Curse { } @Override - public void attackedByPlayerAction(LivingAttackEvent event, - World world, EntityPlayer player, Entity target) { - if (rand.nextInt(5) == 0 && !world.isRemote - && !(target instanceof EntityMob) - && target instanceof EntityLiving - && !(target instanceof EntityHeart) - && !(target instanceof EntityHalfHeart) + public void attackedByPlayerAction(LivingAttackEvent event, World world, EntityPlayer player, Entity target) { + if (rand.nextInt(5) == 0 && !world.isRemote && !(target instanceof EntityMob) && target instanceof EntityLiving + && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && target.canAttackWithItem()) { - NBTTagCompound playerInfo = PlayerUtils - .getModPlayerPersistTag(player, - Variables.MODID); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - playerInfo.setFloat("BlackHeart", - playerInfo.getFloat("BlackHeart") - + 1.0F); + playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F); if (player.getMaxHealth() >= 3F) { - player.getEntityAttribute( - SharedMonsterAttributes.maxHealth) - .setBaseValue(player - .getMaxHealth() - - 1.0F); - - player.setHealth( - player.getHealth() - 1.0F); + player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F); + + player.setHealth(player.getHealth() - 1.0F); } JewelrycraftUtil.addCursePoints(player, 10); - JewelrycraftMod.netWrapper.sendToAll( - new PacketSendServerPlayersInfo()); + JewelrycraftMod.netWrapper.sendToAll(new PacketSendServerPlayersInfo()); - JewelrycraftMod.netWrapper.sendTo( - new PacketSendClientPlayerInfo( - playerInfo), - (EntityPlayerMP) player); + JewelrycraftMod.netWrapper.sendTo(new PacketSendClientPlayerInfo(playerInfo), (EntityPlayerMP) player); } } @Override - public void playerRender(EntityPlayer player, - RenderPlayerEvent.Specials.Post event) { + public void playerRender(EntityPlayer player, RenderPlayerEvent.Specials.Post event) { MaskRender mask = new MaskRender(); float yaw = player.prevRotationYawHead - + (player.rotationYawHead - - player.prevRotationYawHead) - * event.partialRenderTick; + + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick; float yawOffset = player.prevRenderYawOffset - + (player.renderYawOffset - - player.prevRenderYawOffset) - * event.partialRenderTick; + + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick; float pitch = player.prevRotationPitch - + (player.rotationPitch - - player.prevRotationPitch) - * event.partialRenderTick; + + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick; GL11.glPushMatrix(); GL11.glColor4f(1, 1, 1, 1); GL11.glRotatef(yawOffset, 0, -1, 0); @@ -105,14 +81,12 @@ public class CurseInfamy extends Curse { @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".infamy.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".infamy.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal( - "curse." + Variables.MODID + ".infamy"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".infamy"); } @Override diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseList.java b/src/main/java/darkknight/jewelrycraft/curses/CurseList.java index 2c11364..249528a 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseList.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseList.java @@ -5,93 +5,61 @@ import darkknight.jewelrycraft.api.Curse; import darkknight.jewelrycraft.util.Variables; public class CurseList { - private static final String CURSE_TEXPACK = Variables.MODID - + "_curses_0"; - - public static Curse rotten; - public static Curse flaming; - public static Curse blind; - public static Curse greed; - public static Curse incredibleDevotion; - - public static Curse infamy; - public static Curse midasTouch; - public static Curse rabbitsPaw; - public static Curse pentagram; - public static Curse vampireHunger; - public static Curse humbleBundle; - public static Curse deathsTouch; - public static Curse scionOfHell; - public static Curse moneyEqualsPower; - public static Curse doubleDown; - public static Curse sacredOath; + private static final String CURSE_TEXPACK = Variables.MODID + "_curses_0"; + + public static Curse rotten; + public static Curse flaming; + public static Curse blind; + public static Curse greed; + public static Curse incredibleDevotion; + + public static Curse infamy; + public static Curse midasTouch; + public static Curse rabbitsPaw; + public static Curse pentagram; + public static Curse vampireHunger; + public static Curse humbleBundle; + public static Curse deathsTouch; + public static Curse scionOfHell; + public static Curse moneyEqualsPower; + public static Curse doubleDown; + public static Curse sacredOath; // Not yet implemented // None at the moment :) public static void preInit(FMLPreInitializationEvent e) { - rotten = new CurseRottenHeart( - Variables.MODNAME + ":" + "Rotten Heart", - 0, CURSE_TEXPACK); + rotten = new CurseRottenHeart(Variables.MODNAME + ":" + "Rotten Heart", 0, CURSE_TEXPACK); - flaming = new CurseFlamingSoul( - Variables.MODNAME + ":" + "Flaming Soul", - 1, CURSE_TEXPACK); + flaming = new CurseFlamingSoul(Variables.MODNAME + ":" + "Flaming Soul", 1, CURSE_TEXPACK); - greed = new CurseGreed(Variables.MODNAME + ":" + "Greed", - 2, CURSE_TEXPACK); + greed = new CurseGreed(Variables.MODNAME + ":" + "Greed", 2, CURSE_TEXPACK); - blind = new CurseBlind(Variables.MODNAME + ":" + "Blind", - 3, CURSE_TEXPACK); + blind = new CurseBlind(Variables.MODNAME + ":" + "Blind", 3, CURSE_TEXPACK); - infamy = new CurseInfamy( - Variables.MODNAME + ":" + "Infamy", 4, - CURSE_TEXPACK); + infamy = new CurseInfamy(Variables.MODNAME + ":" + "Infamy", 4, CURSE_TEXPACK); - midasTouch = new CurseMidasTouch( - Variables.MODNAME + ":" + "Midas Touch", 5, - CURSE_TEXPACK); + midasTouch = new CurseMidasTouch(Variables.MODNAME + ":" + "Midas Touch", 5, CURSE_TEXPACK); - rabbitsPaw = new CurseRabbitsPaw( - Variables.MODNAME + ":" + "Rabbit's Paw", - 6, CURSE_TEXPACK); + rabbitsPaw = new CurseRabbitsPaw(Variables.MODNAME + ":" + "Rabbit's Paw", 6, CURSE_TEXPACK); - pentagram = new CursePentagram( - Variables.MODNAME + ":" + "Pentagram", 7, - CURSE_TEXPACK); + pentagram = new CursePentagram(Variables.MODNAME + ":" + "Pentagram", 7, CURSE_TEXPACK); - vampireHunger = new CurseVampireHunger( - Variables.MODNAME + ":" + "Vampire Hunger", - 8, CURSE_TEXPACK); + vampireHunger = new CurseVampireHunger(Variables.MODNAME + ":" + "Vampire Hunger", 8, CURSE_TEXPACK); - humbleBundle = new CurseHumbleBundle( - Variables.MODNAME + ":" + "Humble Bundle", - 9, CURSE_TEXPACK); + humbleBundle = new CurseHumbleBundle(Variables.MODNAME + ":" + "Humble Bundle", 9, CURSE_TEXPACK); - deathsTouch = new CurseDeathsTouch( - Variables.MODNAME + ":" + "Deaths Touch", - 10, CURSE_TEXPACK); + deathsTouch = new CurseDeathsTouch(Variables.MODNAME + ":" + "Deaths Touch", 10, CURSE_TEXPACK); - scionOfHell = new CurseScionOfHell( - Variables.MODNAME + ":" + "Scion of Hell", - 11, CURSE_TEXPACK); + scionOfHell = new CurseScionOfHell(Variables.MODNAME + ":" + "Scion of Hell", 11, CURSE_TEXPACK); - moneyEqualsPower = new CurseMoneyEqualsPower( - Variables.MODNAME + ":" - + "Money Equals Power", - 12, CURSE_TEXPACK); + moneyEqualsPower = new CurseMoneyEqualsPower(Variables.MODNAME + ":" + "Money Equals Power", 12, CURSE_TEXPACK); - doubleDown = new CurseDoubleDown( - Variables.MODNAME + ":" + "Double Down", - 19, CURSE_TEXPACK); + doubleDown = new CurseDoubleDown(Variables.MODNAME + ":" + "Double Down", 19, CURSE_TEXPACK); - incredibleDevotion = new CurseIncredibleDevotion( - Variables.MODNAME + ":" - + "Incredible Devotion", - 20, CURSE_TEXPACK); + incredibleDevotion = new CurseIncredibleDevotion(Variables.MODNAME + ":" + "Incredible Devotion", 20, + CURSE_TEXPACK); - sacredOath = new CurseSacredOath( - Variables.MODNAME + ":" + "Sacred Oath", - 21, CURSE_TEXPACK); + sacredOath = new CurseSacredOath(Variables.MODNAME + ":" + "Sacred Oath", 21, CURSE_TEXPACK); } } diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java b/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java index d576803..875f5c1 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java @@ -20,14 +20,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemArmor; -import net.minecraft.item.ItemAxe; -import net.minecraft.item.ItemHoe; -import net.minecraft.item.ItemPickaxe; -import net.minecraft.item.ItemSpade; -import net.minecraft.item.ItemStack; -import net.minecraft.item.ItemSword; +import net.minecraft.item.*; import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; @@ -39,32 +32,17 @@ public class CurseMidasTouch extends Curse { } @Override - public void attackedByPlayerAction(LivingAttackEvent event, - World world, EntityPlayer player, Entity target) { - if (!world.isRemote && target instanceof EntityLivingBase - && !(target instanceof EntityHeart) - && !(target instanceof EntityHalfHeart) - && player.inventory - .getCurrentItem() == null) { - world.setBlock(MathHelper - .floor_double(target.posX), - MathHelper.floor_double( - target.posY), - MathHelper.floor_double( - target.posZ), - BlockList.midasTouchBlock, 0, 2); + public void attackedByPlayerAction(LivingAttackEvent event, World world, EntityPlayer player, Entity target) { + if (!world.isRemote && target instanceof EntityLivingBase && !(target instanceof EntityHeart) + && !(target instanceof EntityHalfHeart) && player.inventory.getCurrentItem() == null) { + world.setBlock(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), + MathHelper.floor_double(target.posZ), BlockList.midasTouchBlock, 0, 2); TileEntityMidasTouch midasTouchVictim = new TileEntityMidasTouch(); midasTouchVictim.setEntity(target); - world.setTileEntity( - MathHelper.floor_double( - target.posX), - MathHelper.floor_double( - target.posY), - MathHelper.floor_double( - target.posZ), - midasTouchVictim); + world.setTileEntity(MathHelper.floor_double(target.posX), MathHelper.floor_double(target.posY), + MathHelper.floor_double(target.posZ), midasTouchVictim); target.setDead(); } @@ -74,15 +52,11 @@ public class CurseMidasTouch extends Curse { public void action(World world, EntityPlayer player) { ItemStack curItem = player.inventory.getCurrentItem(); - if (curItem != null - && curItem.getItem() != ItemList.goldObj - && !isGoldenObject(curItem.getItem())) { + if (curItem != null && curItem.getItem() != ItemList.goldObj && !isGoldenObject(curItem.getItem())) { int index = player.inventory.currentItem; ItemStack item = curItem; - ItemStack result = new ItemStack(ItemList.goldObj, - item.stackSize, - item.getItemDamage()); + ItemStack result = new ItemStack(ItemList.goldObj, item.stackSize, item.getItemDamage()); JewelryNBT.addItem(result, item); @@ -90,135 +64,67 @@ public class CurseMidasTouch extends Curse { result = changeItem(curItem); } - player.inventory.setInventorySlotContents(index, - result); + player.inventory.setInventorySlotContents(index, result); } } public ItemStack changeItem(ItemStack currItem) { if (currItem.getItem() instanceof ItemSword) { - return new ItemStack(Items.golden_sword, - currItem.stackSize, - currItem.getItemDamage()); + return new ItemStack(Items.golden_sword, currItem.stackSize, currItem.getItemDamage()); } else if (currItem.getItem() instanceof ItemSpade) { - return new ItemStack(Items.golden_shovel, - currItem.stackSize, - currItem.getItemDamage()); + return new ItemStack(Items.golden_shovel, currItem.stackSize, currItem.getItemDamage()); } else if (currItem.getItem() instanceof ItemPickaxe) { - return new ItemStack(Items.golden_pickaxe, - currItem.stackSize, - currItem.getItemDamage()); + return new ItemStack(Items.golden_pickaxe, currItem.stackSize, currItem.getItemDamage()); } else if (currItem.getItem() instanceof ItemAxe) { - return new ItemStack(Items.golden_axe, - currItem.stackSize, - currItem.getItemDamage()); + return new ItemStack(Items.golden_axe, currItem.stackSize, currItem.getItemDamage()); } else if (currItem.getItem() instanceof ItemHoe) { - return new ItemStack(Items.golden_hoe, - currItem.stackSize, - currItem.getItemDamage()); - } else if (currItem.getItem() instanceof ItemArmor - && ((ItemArmor) currItem - .getItem()).armorType == 0) { - return new ItemStack(Items.golden_helmet, - currItem.stackSize, - currItem.getItemDamage()); - } else if (currItem.getItem() instanceof ItemArmor - && ((ItemArmor) currItem - .getItem()).armorType == 1) { - return new ItemStack(Items.golden_chestplate, - currItem.stackSize, - currItem.getItemDamage()); - } else if (currItem.getItem() instanceof ItemArmor - && ((ItemArmor) currItem - .getItem()).armorType == 2) { - return new ItemStack(Items.golden_leggings, - currItem.stackSize, - currItem.getItemDamage()); - } else if (currItem.getItem() instanceof ItemArmor - && ((ItemArmor) currItem - .getItem()).armorType == 3) { - return new ItemStack(Items.golden_boots, - currItem.stackSize, - currItem.getItemDamage()); - } else if (currItem.getItem().getUnlocalizedName() - .toLowerCase().contains("horsearmor")) { - return new ItemStack(Items.golden_horse_armor, - currItem.stackSize, 0); - } else if (currItem.getItem().getUnlocalizedName() - .toLowerCase().contains("nugget") - || currItem.getItem() - .getItemStackDisplayName( - currItem) - .toLowerCase() - .contains(" nugget") - || currItem.getItem() - .getItemStackDisplayName( - currItem) - .toLowerCase() - .contains("nugget ")) { - return new ItemStack(Items.gold_nugget, - currItem.stackSize, 0); - } else if (currItem.getItem().getUnlocalizedName() - .toLowerCase().contains("ingot") - || currItem.getItem() - .getItemStackDisplayName( - currItem) - .toLowerCase() - .contains(" ingot") - || currItem.getItem() - .getItemStackDisplayName( - currItem) - .toLowerCase() - .contains("ingot ")) { - return new ItemStack(Items.gold_ingot, - currItem.stackSize, 0); - } else if (Block.getBlockFromItem(currItem - .getItem()) instanceof BlockPressurePlate - || Block.getBlockFromItem(currItem - .getItem()) instanceof BlockPressurePlateWeighted) { - return new ItemStack( - Blocks.light_weighted_pressure_plate, - currItem.stackSize, 0); - } else if (Block.getBlockFromItem(currItem - .getItem()) instanceof BlockCompressed) { - return new ItemStack(Blocks.gold_block, - currItem.stackSize, 0); + return new ItemStack(Items.golden_hoe, currItem.stackSize, currItem.getItemDamage()); + } else if (currItem.getItem() instanceof ItemArmor && ((ItemArmor) currItem.getItem()).armorType == 0) { + return new ItemStack(Items.golden_helmet, currItem.stackSize, currItem.getItemDamage()); + } else if (currItem.getItem() instanceof ItemArmor && ((ItemArmor) currItem.getItem()).armorType == 1) { + return new ItemStack(Items.golden_chestplate, currItem.stackSize, currItem.getItemDamage()); + } else if (currItem.getItem() instanceof ItemArmor && ((ItemArmor) currItem.getItem()).armorType == 2) { + return new ItemStack(Items.golden_leggings, currItem.stackSize, currItem.getItemDamage()); + } else if (currItem.getItem() instanceof ItemArmor && ((ItemArmor) currItem.getItem()).armorType == 3) { + return new ItemStack(Items.golden_boots, currItem.stackSize, currItem.getItemDamage()); + } else if (currItem.getItem().getUnlocalizedName().toLowerCase().contains("horsearmor")) { + return new ItemStack(Items.golden_horse_armor, currItem.stackSize, 0); + } else if (currItem.getItem().getUnlocalizedName().toLowerCase().contains("nugget") + || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" nugget") + || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("nugget ")) { + return new ItemStack(Items.gold_nugget, currItem.stackSize, 0); + } else if (currItem.getItem().getUnlocalizedName().toLowerCase().contains("ingot") + || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains(" ingot") + || currItem.getItem().getItemStackDisplayName(currItem).toLowerCase().contains("ingot ")) { + return new ItemStack(Items.gold_ingot, currItem.stackSize, 0); + } else if (Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlate + || Block.getBlockFromItem(currItem.getItem()) instanceof BlockPressurePlateWeighted) { + return new ItemStack(Blocks.light_weighted_pressure_plate, currItem.stackSize, 0); + } else if (Block.getBlockFromItem(currItem.getItem()) instanceof BlockCompressed) { + return new ItemStack(Blocks.gold_block, currItem.stackSize, 0); } return null; } public boolean isGoldenObject(Item item) { - return item.equals(Items.gold_ingot) - || item.equals(Items.gold_nugget) - || item.equals(Items.golden_helmet) - || item.equals(Items.golden_chestplate) - || item.equals(Items.golden_leggings) - || item.equals(Items.golden_boots) - || item.equals(Items.golden_sword) - || item.equals(Items.golden_shovel) - || item.equals(Items.golden_pickaxe) - || item.equals(Items.golden_axe) - || item.equals(Items.golden_apple) - || item.equals(Items.golden_hoe) - || item.equals(Items.golden_horse_armor) - || Block.getBlockFromItem(item) - .equals(Blocks.gold_block) - || Block.getBlockFromItem(item).equals( - Blocks.light_weighted_pressure_plate); + return item.equals(Items.gold_ingot) || item.equals(Items.gold_nugget) || item.equals(Items.golden_helmet) + || item.equals(Items.golden_chestplate) || item.equals(Items.golden_leggings) + || item.equals(Items.golden_boots) || item.equals(Items.golden_sword) + || item.equals(Items.golden_shovel) || item.equals(Items.golden_pickaxe) + || item.equals(Items.golden_axe) || item.equals(Items.golden_apple) || item.equals(Items.golden_hoe) + || item.equals(Items.golden_horse_armor) || Block.getBlockFromItem(item).equals(Blocks.gold_block) + || Block.getBlockFromItem(item).equals(Blocks.light_weighted_pressure_plate); } @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID - + ".midastouch.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".midastouch.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".midastouch"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".midastouch"); } @Override @@ -236,8 +142,7 @@ public class CurseMidasTouch extends Curse { } @Override - public int weight(World world, EntityPlayer player, - Random random) { + public int weight(World world, EntityPlayer player, Random random) { return 2; } } diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseMoneyEqualsPower.java b/src/main/java/darkknight/jewelrycraft/curses/CurseMoneyEqualsPower.java index 741a857..c93bbe9 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseMoneyEqualsPower.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseMoneyEqualsPower.java @@ -15,20 +15,17 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; public class CurseMoneyEqualsPower extends Curse { - public CurseMoneyEqualsPower(String name, int txtID, - String texturepack) { + public CurseMoneyEqualsPower(String name, int txtID, String texturepack) { super(name, txtID, texturepack); } @Override - public void entityDropItems(EntityPlayer player, Entity target, - ArrayList drops) { + public void entityDropItems(EntityPlayer player, Entity target, ArrayList drops) { int dropsTaken = 0; for (EntityItem item : drops) { if (rand.nextBoolean()) { - int stackSize = item - .getEntityItem().stackSize; + int stackSize = item.getEntityItem().stackSize; int takenItems = rand.nextInt(stackSize); item.getEntityItem().stackSize -= takenItems; @@ -42,48 +39,27 @@ public class CurseMoneyEqualsPower extends Curse { if (dropsTaken > 0) { if (dropsTaken > 3) { - player.addPotionEffect(new PotionEffect( - Potion.digSpeed.id, - dropsTaken * 30, 1)); - player.addPotionEffect(new PotionEffect( - Potion.moveSpeed.id, - dropsTaken * 30, 1)); - - player.addChatComponentMessage( - new ChatComponentText( - StatCollector.translateToLocal( - EnumChatFormatting.RED - + "curse.jewlrycraft2.moneyEqualsPower.bless1"))); + player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, dropsTaken * 30, 1)); + player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, dropsTaken * 30, 1)); + + player.addChatComponentMessage(new ChatComponentText(StatCollector + .translateToLocal(EnumChatFormatting.RED + "curse.jewlrycraft2.moneyEqualsPower.bless1"))); } if (dropsTaken > 6) { - player.addPotionEffect(new PotionEffect( - Potion.resistance.id, - dropsTaken * 20, 1)); - player.addPotionEffect(new PotionEffect( - Potion.damageBoost.id, - dropsTaken * 20, 1)); - - player.addChatComponentMessage( - new ChatComponentText( - StatCollector.translateToLocal( - EnumChatFormatting.RED - + "curse.jewlrycraft2.moneyEqualsPower.bless2"))); + player.addPotionEffect(new PotionEffect(Potion.resistance.id, dropsTaken * 20, 1)); + player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, dropsTaken * 20, 1)); + + player.addChatComponentMessage(new ChatComponentText(StatCollector + .translateToLocal(EnumChatFormatting.RED + "curse.jewlrycraft2.moneyEqualsPower.bless2"))); } if (dropsTaken > 9) { - player.addPotionEffect(new PotionEffect( - Potion.regeneration.id, - dropsTaken * 10, 1)); - player.addPotionEffect(new PotionEffect( - Potion.heal.id, - dropsTaken * 10, 1)); - - player.addChatComponentMessage( - new ChatComponentText( - StatCollector.translateToLocal( - EnumChatFormatting.RED - + "curse.jewlrycraft2.moneyEqualsPower.bless3"))); + player.addPotionEffect(new PotionEffect(Potion.regeneration.id, dropsTaken * 10, 1)); + player.addPotionEffect(new PotionEffect(Potion.heal.id, dropsTaken * 10, 1)); + + player.addChatComponentMessage(new ChatComponentText(StatCollector + .translateToLocal(EnumChatFormatting.RED + "curse.jewlrycraft2.moneyEqualsPower.bless3"))); } } } @@ -95,14 +71,11 @@ public class CurseMoneyEqualsPower extends Curse { @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID - + ".moneyEqualsPower.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".moneyEqualsPower.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".moneyEqualsPower"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".moneyEqualsPower"); } } diff --git a/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java b/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java index bf40d55..659cca8 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java @@ -17,11 +17,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; +import net.minecraft.util.*; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderHandEvent; import net.minecraftforge.client.event.RenderPlayerEvent; @@ -37,92 +33,48 @@ public class CursePentagram extends Curse { public void action(World world, EntityPlayer player) { super.action(world, player); if (!world.isRemote) { - NBTTagCompound playerInfo = PlayerUtils - .getModPlayerPersistTag(player, - Variables.MODID); + NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID); - for (Object entity : world - .getEntitiesWithinAABBExcludingEntity( - player, - AxisAlignedBB.getBoundingBox( - player.boundingBox.minX - - 0.5F, - player.boundingBox.minY, - player.boundingBox.minZ - - 0.5F, - player.boundingBox.maxX - + 0.5F, - player.boundingBox.maxY, - player.boundingBox.maxZ - + 0.5F))) { + for (Object entity : world.getEntitiesWithinAABBExcludingEntity(player, + AxisAlignedBB.getBoundingBox(player.boundingBox.minX - 0.5F, player.boundingBox.minY, + player.boundingBox.minZ - 0.5F, player.boundingBox.maxX + 0.5F, player.boundingBox.maxY, + player.boundingBox.maxZ + 0.5F))) { if (entity instanceof EntityLivingBase) { - NBTTagCompound target = ((EntityLivingBase) entity) - .getEntityData(); + NBTTagCompound target = ((EntityLivingBase) entity).getEntityData(); - int maxHealthStolen = JewelrycraftUtil - .isAchievementUnlocked( - player, - AchievementsList.pentagram) - ? 3 - : 2; + int maxHealthStolen = JewelrycraftUtil.isAchievementUnlocked(player, AchievementsList.pentagram) ? 3 + : 2; - boolean canStealHealth = target - .getInteger("stolenHealth") < maxHealthStolen; + boolean canStealHealth = target.getInteger("stolenHealth") < maxHealthStolen; - if (canStealHealth && rand.nextInt( - 40) == 0) { - ((EntityLivingBase) entity) - .getEntityAttribute( - SharedMonsterAttributes.maxHealth) - .setBaseValue(((EntityLivingBase) entity) - .getMaxHealth() - - 2f); + if (canStealHealth && rand.nextInt(40) == 0) { + ((EntityLivingBase) entity).getEntityAttribute(SharedMonsterAttributes.maxHealth) + .setBaseValue(((EntityLivingBase) entity).getMaxHealth() - 2f); - target.setInteger( - "stolenHealth", - target.hasKey("stolenHealth") - ? target.getInteger( - "stolenHealth") - + 1 - : 1); + target.setInteger("stolenHealth", + target.hasKey("stolenHealth") ? target.getInteger("stolenHealth") + 1 : 1); - playerInfo.setInteger( - "heartsStolen", - playerInfo.hasKey( - "heartsStolen") ? playerInfo.getInteger("heartsStolen") + 1 : 1); + playerInfo.setInteger("heartsStolen", + playerInfo.hasKey("heartsStolen") ? playerInfo.getInteger("heartsStolen") + 1 : 1); if (player.shouldHeal()) { player.heal(2F); } else { - player.getEntityAttribute( - SharedMonsterAttributes.maxHealth) - .setBaseValue(player - .getMaxHealth() - + 2f); + player.getEntityAttribute(SharedMonsterAttributes.maxHealth) + .setBaseValue(player.getMaxHealth() + 2f); } } } } - if (!playerInfo.getBoolean( - AchievementsList.pentagram.statId)) { - if (ticksActive > 24000 && playerInfo - .getInteger("heartsStolen") <= 0) - player.addStat(AchievementsList.pentagram, - 1); + if (!playerInfo.getBoolean(AchievementsList.pentagram.statId)) { + if (ticksActive > 24000 && playerInfo.getInteger("heartsStolen") <= 0) + player.addStat(AchievementsList.pentagram, 1); else { - player.addChatComponentMessage( - new ChatComponentText( - EnumChatFormatting.RED - + StatCollector.translateToLocal( - "challenge.failed") - + " " - + EnumChatFormatting.GOLD - + StatCollector.translateToLocal( - AchievementsList.pentagram.statId))); - playerInfo.setBoolean( - AchievementsList.pentagram.statId, - true); + player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + + StatCollector.translateToLocal("challenge.failed") + " " + EnumChatFormatting.GOLD + + StatCollector.translateToLocal(AchievementsList.pentagram.statId))); + playerInfo.setBoolean(AchievementsList.pentagram.statId, true); } } } @@ -130,24 +82,17 @@ public class CursePentagram extends Curse { @SuppressWarnings("cast") @Override - public void playerRender(EntityPlayer player, - RenderPlayerEvent.Specials.Post event) { - ResourceLocation PENTAGRAM_TEXTURE = new ResourceLocation( - Variables.MODID, - "textures/gui/" + getTexturePack() - + ".png"); + public void playerRender(EntityPlayer player, RenderPlayerEvent.Specials.Post event) { + ResourceLocation PENTAGRAM_TEXTURE = new ResourceLocation(Variables.MODID, + "textures/gui/" + getTexturePack() + ".png"); GL11.glPushMatrix(); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_SRC_COLOR); Tessellator tessellator = Tessellator.instance; - TextureManager texturemanager = Minecraft.getMinecraft() - .getTextureManager(); + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); texturemanager.bindTexture(PENTAGRAM_TEXTURE); GL11.glRotatef(rot, 0F, 1F, 0F); - GL11.glTranslatef(-0.8F, - (player.isSneaking() ? 0.1625F : 0F) - + 1.5F, - -0.8F); + GL11.glTranslatef(-0.8F, (player.isSneaking() ? 0.1625F : 0F) + 1.5F, -0.8F); GL11.glRotatef(90F, 1F, 0F, 0F); GL11.glScalef(0.05F, 0.05F, 0.05F); rot += 3F; @@ -162,21 +107,13 @@ public class CursePentagram extends Curse { int width = 32; int height = 32; tessellator.startDrawingQuads(); - tessellator.addVertexWithUV((double) (x + 0), - (double) (y + height), (double) 0, - (double) ((float) (u + 0) * f), + tessellator.addVertexWithUV((double) (x + 0), (double) (y + height), (double) 0, (double) ((float) (u + 0) * f), (double) ((float) (v + height) * f1)); - tessellator.addVertexWithUV((double) (x + width), - (double) (y + height), (double) 0, - (double) ((float) (u + width) * f), - (double) ((float) (v + height) * f1)); - tessellator.addVertexWithUV((double) (x + width), - (double) (y + 0), (double) 0, - (double) ((float) (u + width) * f), - (double) ((float) (v + 0) * f1)); - tessellator.addVertexWithUV((double) (x + 0), - (double) (y + 0), (double) 0, - (double) ((float) (u + 0) * f), + tessellator.addVertexWithUV((double) (x + width), (double) (y + height), (double) 0, + (double) ((float) (u + width) * f), (double) ((float) (v + height) * f1)); + tessellator.addVertexWithUV((double) (x + width), (double) (y + 0), (double) 0, + (double) ((float) (u + width) * f), (double) ((float) (v + 0) * f1)); + tessellator.addVertexWithUV((double) (x + 0), (double) (y + 0), (double) 0, (double) ((float) (u + 0) * f), (double) ((float) (v + 0) * f1)); tessellator.draw(); GL11.glDisable(GL11.GL_BLEND); @@ -186,26 +123,18 @@ public class CursePentagram extends Curse { @SuppressWarnings("cast") @Override @SideOnly(Side.CLIENT) - public void playerHandRender(EntityPlayer player, - RenderHandEvent event) { + public void playerHandRender(EntityPlayer player, RenderHandEvent event) { if (Minecraft.getMinecraft().gameSettings.thirdPersonView == 0) { - ResourceLocation PENTAGRAM_TEXTURE = new ResourceLocation( - Variables.MODID, - "textures/gui/" + getTexturePack() - + ".png"); + ResourceLocation PENTAGRAM_TEXTURE = new ResourceLocation(Variables.MODID, + "textures/gui/" + getTexturePack() + ".png"); GL11.glPushMatrix(); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_SRC_COLOR); Tessellator tessellator = Tessellator.instance; - TextureManager texturemanager = Minecraft - .getMinecraft() - .getTextureManager(); + TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); texturemanager.bindTexture(PENTAGRAM_TEXTURE); GL11.glRotatef(rot, 0F, 1F, 0F); - GL11.glTranslatef(-0.8F, - (player.isSneaking() ? 0.1625F - : 0F) - 1.6F, - -0.8F); + GL11.glTranslatef(-0.8F, (player.isSneaking() ? 0.1625F : 0F) - 1.6F, -0.8F); GL11.glRotatef(90F, 1F, 0F, 0F); GL11.glScalef(0.05F, 0.05F, 0.05F); rot += 3F; @@ -220,23 +149,13 @@ public class CursePentagram extends Curse { int width = 32; int height = 32; tessellator.startDrawingQuads(); - tessellator.addVertexWithUV((double) (x + 0), - (double) (y + height), (double) 0, - (double) ((float) (u + 0) * f), - (double) ((float) (v + height) - * f1)); - tessellator.addVertexWithUV((double) (x + width), - (double) (y + height), (double) 0, - (double) ((float) (u + width) * f), - (double) ((float) (v + height) - * f1)); - tessellator.addVertexWithUV((double) (x + width), - (double) (y + 0), (double) 0, - (double) ((float) (u + width) * f), - (double) ((float) (v + 0) * f1)); - tessellator.addVertexWithUV((double) (x + 0), - (double) (y + 0), (double) 0, - (double) ((float) (u + 0) * f), + tessellator.addVertexWithUV((double) (x + 0), (double) (y + height), (double) 0, + (double) ((float) (u + 0) * f), (double) ((float) (v + height) * f1)); + tessellator.addVertexWithUV((double) (x + width), (double) (y + height), (double) 0, + (double) ((float) (u + width) * f), (double) ((float) (v + height) * f1)); + tessellator.addVertexWithUV((double) (x + width), (double) (y + 0), (double) 0, + (double) ((float) (u + width) * f), (double) ((float) (v + 0) * f1)); + tessellator.addVertexWithUV((double) (x + 0), (double) (y + 0), (double) 0, (double) ((float) (u + 0) * f), (double) ((float) (v + 0) * f1)); tessellator.draw(); GL11.glDisable(GL11.GL_BLEND); @@ -246,15 +165,12 @@ public class CursePentagram extends Curse { @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID - + ".pentagram.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".pentagram.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal( - "curse." + Variables.MODID + ".pentagram"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".pentagram"); } @Override diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java b/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java index da61cd7..5517361 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java @@ -23,8 +23,7 @@ public class CurseRabbitsPaw extends Curse { } @Override - public void entityDropItems(EntityPlayer player, Entity target, - ArrayList drops) { + public void entityDropItems(EntityPlayer player, Entity target, ArrayList drops) { for (EntityItem item : drops) { ItemStack drop = item.getEntityItem().copy(); @@ -36,13 +35,10 @@ public class CurseRabbitsPaw extends Curse { } @Override - public void entityDeathAction(World world, EntityLivingBase target, - EntityPlayer player) { + public void entityDeathAction(World world, EntityLivingBase target, EntityPlayer player) { if (rand.nextInt(3) == 0) - world.spawnEntityInWorld(new EntityXPOrb(world, - target.posX, target.posY, - target.posZ, - 1 + rand.nextInt(40))); + world.spawnEntityInWorld( + new EntityXPOrb(world, target.posX, target.posY, target.posZ, 1 + rand.nextInt(40))); } @Override @@ -52,15 +48,12 @@ public class CurseRabbitsPaw extends Curse { @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID - + ".rabbitspaw.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".rabbitspaw.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".rabbitspaw"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".rabbitspaw"); } @Override diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java b/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java index 78d10bc..c2e3fdf 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java @@ -16,24 +16,18 @@ public class CurseRottenHeart extends Curse { @Override public void action(World world, EntityPlayer player) { - if (!player.isPotionActive(Potion.poison) || player - .getActivePotionEffect(Potion.poison) - .getDuration() < 30) - player.addPotionEffect(new PotionEffect( - Potion.poison.id, 80)); + if (!player.isPotionActive(Potion.poison) || player.getActivePotionEffect(Potion.poison).getDuration() < 30) + player.addPotionEffect(new PotionEffect(Potion.poison.id, 80)); } @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID - + ".rottenheart.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".rottenheart.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".rottenheart"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".rottenheart"); } @Override diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseSacredOath.java b/src/main/java/darkknight/jewelrycraft/curses/CurseSacredOath.java index 2465b89..ce8ad60 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseSacredOath.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseSacredOath.java @@ -5,22 +5,18 @@ import darkknight.jewelrycraft.util.Variables; import net.minecraft.util.StatCollector; public class CurseSacredOath extends Curse { - public CurseSacredOath(String name, int txtID, - String texturepack) { + public CurseSacredOath(String name, int txtID, String texturepack) { super(name, txtID, texturepack); } @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID - + ".sacredoath.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".sacredoath.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".sacredoath"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".sacredoath"); } // TODO implement sacred oath to do something diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseScionOfHell.java b/src/main/java/darkknight/jewelrycraft/curses/CurseScionOfHell.java index 2264017..1c5b63e 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseScionOfHell.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseScionOfHell.java @@ -10,22 +10,17 @@ import net.minecraft.world.World; import net.minecraftforge.event.entity.living.LivingHealEvent; public class CurseScionOfHell extends Curse { - public CurseScionOfHell(String name, int txtID, - String texturepack) { + public CurseScionOfHell(String name, int txtID, String texturepack) { super(name, txtID, texturepack); } @Override - public void entityDeathAction(World world, EntityLivingBase target, - EntityPlayer player) { - player.setHealth(Math.max(player.getMaxHealth(), - player.getHealth() + target.getMaxHealth() - / 5.0f)); + public void entityDeathAction(World world, EntityLivingBase target, EntityPlayer player) { + player.setHealth(Math.max(player.getMaxHealth(), player.getHealth() + target.getMaxHealth() / 5.0f)); } @Override - public void playerHealAction(World world, EntityPlayer player, - LivingHealEvent event) { + public void playerHealAction(World world, EntityPlayer player, LivingHealEvent event) { event.amount = 0; } @@ -36,14 +31,11 @@ public class CurseScionOfHell extends Curse { @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID - + ".scionofhell.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".scionofhell.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".scionofhell"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".scionofhell"); } } diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java b/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java index 9b8c1f3..7d53f2a 100755 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java @@ -17,41 +17,31 @@ import net.minecraft.world.World; * */ public class CurseVampireHunger extends Curse { - protected CurseVampireHunger(String name, int txtID, - String texturepack) { + protected CurseVampireHunger(String name, int txtID, String texturepack) { super(name, txtID, texturepack); } - public void attackedByPlayerAction(World world, - EntityPlayer player, Entity target) { + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) { if (player.shouldHeal() && rand.nextBoolean()) player.heal(1F); } @Override public void action(World world, EntityPlayer player) { - if (!player.capabilities.isCreativeMode - && world.isDaytime() && !world.isRaining() - && world.canBlockSeeTheSky(MathHelper - .floor_double(player.posX), - MathHelper.floor_double( - player.posY + 1F), - MathHelper.floor_double( - player.posZ))) + if (!player.capabilities.isCreativeMode && world.isDaytime() && !world.isRaining() + && world.canBlockSeeTheSky(MathHelper.floor_double(player.posX), + MathHelper.floor_double(player.posY + 1F), MathHelper.floor_double(player.posZ))) player.setFire(8); } @Override public String getDescription() { - return StatCollector.translateToLocal("curse." - + Variables.MODID - + ".vampirehunger.description"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".vampirehunger.description"); } @Override public String getDisplayName() { - return StatCollector.translateToLocal("curse." - + Variables.MODID + ".vampirehunger"); + return StatCollector.translateToLocal("curse." + Variables.MODID + ".vampirehunger"); } @Override -- cgit v1.2.3