From 46186569d5cb462f90e59a37dc17a9fad51cfa4a Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Wed, 1 Jul 2015 16:11:31 +0100 Subject: Added a curse tab, added a config to enable/disable extra jewelry info, plus more! --- .../darkknight/jewelrycraft/curses/CurseBlind.java | 7 + .../jewelrycraft/curses/CurseFlamingSoul.java | 72 ++++---- .../darkknight/jewelrycraft/curses/CurseGreed.java | 86 +++++----- .../jewelrycraft/curses/CurseHumbleBundle.java | 141 ++++++++-------- .../jewelrycraft/curses/CurseInfamy.java | 7 + .../jewelrycraft/curses/CurseMidasTouch.java | 7 + .../jewelrycraft/curses/CursePentagram.java | 185 ++++++++++++--------- .../jewelrycraft/curses/CurseRabbitsPaw.java | 7 + .../jewelrycraft/curses/CurseRottenHeart.java | 76 +++++---- .../jewelrycraft/curses/CurseVampireHunger.java | 86 +++++----- 10 files changed, 381 insertions(+), 293 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 932e23b..f7ab76f 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java @@ -1,6 +1,7 @@ package darkknight.jewelrycraft.curses; import java.util.Random; + import darkknight.jewelrycraft.api.Curse; import darkknight.jewelrycraft.config.ConfigHandler; import darkknight.jewelrycraft.util.Variables; @@ -39,4 +40,10 @@ public class CurseBlind extends Curse { return 7; } + + @Override + public String getDisplayName() + { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".blind"); + } } diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java b/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java index ed7cd2d..4a559b6 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java @@ -1,33 +1,39 @@ -package darkknight.jewelrycraft.curses; - -import darkknight.jewelrycraft.api.Curse; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.util.Variables; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -public class CurseFlamingSoul extends Curse -{ - public CurseFlamingSoul(String name, int txtID, String pack) - { - super(name, txtID, pack); - } - - public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) - { - player.setFire(5); - } - - public String getDescription() - { - return StatCollector.translateToLocal("curse." + Variables.MODID + ".flamingsoul.description"); - } - - @Override - public boolean canCurseBeActivated(World world) - { - return ConfigHandler.CURSE_FLAMING_SOUL; - } -} +package darkknight.jewelrycraft.curses; + +import darkknight.jewelrycraft.api.Curse; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.util.Variables; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class CurseFlamingSoul extends Curse +{ + public CurseFlamingSoul(String name, int txtID, String pack) + { + super(name, txtID, pack); + } + + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + player.setFire(5); + } + + public String getDescription() + { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".flamingsoul.description"); + } + + @Override + public boolean canCurseBeActivated(World world) + { + return ConfigHandler.CURSE_FLAMING_SOUL; + } + + @Override + public String getDisplayName() + { + 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 be5dd83..37a774a 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java @@ -1,40 +1,46 @@ -package darkknight.jewelrycraft.curses; - -import darkknight.jewelrycraft.api.Curse; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.util.Variables; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -public class CurseGreed extends Curse -{ - public CurseGreed(String name, int txtID, String pack) - { - super(name, txtID, pack); - } - - @Override - public void action(World world, EntityPlayer player) - { - } - - @Override - public boolean itemToss() - { - return true; - } - - public String getDescription() - { - return StatCollector.translateToLocal("curse." + Variables.MODID + ".greed.description"); - } - - @Override - public boolean canCurseBeActivated(World world) - { - return ConfigHandler.CURSE_GREED; - } -} +package darkknight.jewelrycraft.curses; + +import darkknight.jewelrycraft.api.Curse; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.util.Variables; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class CurseGreed extends Curse +{ + public CurseGreed(String name, int txtID, String pack) + { + super(name, txtID, pack); + } + + @Override + public void action(World world, EntityPlayer player) + { + } + + @Override + public boolean itemToss() + { + return true; + } + + public String getDescription() + { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".greed.description"); + } + + @Override + public boolean canCurseBeActivated(World world) + { + return ConfigHandler.CURSE_GREED; + } + + @Override + public String getDisplayName() + { + 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 c65d9b7..855277c 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java @@ -1,67 +1,74 @@ -/** - * - */ -package darkknight.jewelrycraft.curses; - -import java.util.ArrayList; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import net.minecraftforge.event.world.BlockEvent; -import darkknight.jewelrycraft.api.Curse; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.util.Variables; - -/** - * @author Sorin - * - */ -public class CurseHumbleBundle extends Curse -{ - protected CurseHumbleBundle(String name, int txtID, String texturepack) - { - super(name, txtID, texturepack); - } - - @Override - public void entityDropItems(EntityPlayer player, Entity target, ArrayList drops) - { - for(EntityItem item: drops){ - ItemStack drop = item.getEntityItem().copy(); - target.entityDropItem(drop, 0.5F); - } - } - - 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); - } - } - - 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; - world.spawnEntityInWorld(entityitem); - } - - public String getDescription() - { - return StatCollector.translateToLocal("curse." + Variables.MODID + ".humblebundle.description"); - } - - @Override - public boolean canCurseBeActivated(World world) - { - return ConfigHandler.CURSE_HUMBLE_BUNDLE; - } -} +/** + * + */ +package darkknight.jewelrycraft.curses; + +import java.util.ArrayList; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.event.world.BlockEvent; +import darkknight.jewelrycraft.api.Curse; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.util.Variables; + +/** + * @author Sorin + * + */ +public class CurseHumbleBundle extends Curse +{ + protected CurseHumbleBundle(String name, int txtID, String texturepack) + { + super(name, txtID, texturepack); + } + + @Override + public void entityDropItems(EntityPlayer player, Entity target, ArrayList drops) + { + for(EntityItem item: drops){ + ItemStack drop = item.getEntityItem().copy(); + target.entityDropItem(drop, 0.5F); + } + } + + 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); + } + } + + 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; + world.spawnEntityInWorld(entityitem); + } + + public String getDescription() + { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".humblebundle.description"); + } + + @Override + public String getDisplayName() + { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".humblebundle"); + } + + @Override + public boolean canCurseBeActivated(World world) + { + return ConfigHandler.CURSE_HUMBLE_BUNDLE; + } +} diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java b/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java index c30ca8a..138f322 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java @@ -1,6 +1,7 @@ package darkknight.jewelrycraft.curses; import org.lwjgl.opengl.GL11; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -70,6 +71,12 @@ public class CurseInfamy extends Curse { return StatCollector.translateToLocal("curse." + Variables.MODID + ".infamy.description"); } + + @Override + public String getDisplayName() + { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".infamy"); + } @Override public boolean canCurseBeActivated(World world) diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java b/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java index 198a0e0..8133b75 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java @@ -1,6 +1,7 @@ package darkknight.jewelrycraft.curses; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.BlockCompressed; import net.minecraft.block.BlockPressurePlate; @@ -96,6 +97,12 @@ public class CurseMidasTouch extends Curse { return StatCollector.translateToLocal("curse." + Variables.MODID + ".midastouch.description"); } + + @Override + public String getDisplayName() + { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".midastouch"); + } @Override public boolean canCurseBeActivated(World world) diff --git a/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java b/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java index f59e92e..60608fb 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java @@ -15,7 +15,9 @@ import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.client.event.RenderHandEvent; import net.minecraftforge.client.event.RenderPlayerEvent; + import org.lwjgl.opengl.GL11; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import darkknight.jewelrycraft.api.Curse; @@ -23,82 +25,109 @@ import darkknight.jewelrycraft.config.ConfigHandler; import darkknight.jewelrycraft.damage.DamageSourceList; import darkknight.jewelrycraft.util.Variables; -public class CursePentagram extends Curse -{ - float rot = 0F; - - public CursePentagram(String name, int txtID, String pack) - { - super(name, txtID, pack); - } - - @Override - public void action(World world, EntityPlayer player) - { - // FMLInterModComms.sendMessage(modId, key, value); - // GameRegistry.findItem("Botania", "flower"); - // FMLInterModComms.fetchRuntimeMessages(forMod) - if (!world.isRemote){ - 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 && rand.nextInt(40) == 0){ - ((EntityLivingBase)entity).attackEntityFrom(DamageSourceList.shadows, 2f); - if (player.shouldHeal()) player.heal(2F); - else player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() + 2f); - } - } - } - } - - @Override - public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) - {} - - @Override - public void playerRender(EntityPlayer player, RenderPlayerEvent.Specials.Post event) - {} - - @SideOnly (Side.CLIENT) - public void playerHandRender(EntityPlayer player, RenderHandEvent 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.bindTexture(PENTAGRAM_TEXTURE); - GL11.glRotatef(rot, 0F, 1F, 0F); - 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; - if (rot > 360F) rot = 0F; - float f = 0.00390625F; - float f1 = 0.00390625F; - int x = 0; - int y = 0; - int u = 32 * 7; - int v = 0; - 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), (double)((float)(v + 0) * f1)); - tessellator.draw(); - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); - } - - public String getDescription() - { - return StatCollector.translateToLocal("curse." + Variables.MODID + ".pentagram.description"); - } - - @Override - public boolean canCurseBeActivated(World world) - { - return ConfigHandler.CURSE_PENTAGRAM; - } +public class CursePentagram extends Curse { + float rot = 0F; + + public CursePentagram(String name, int txtID, String pack) { + super(name, txtID, pack); + } + + @Override + public void action(World world, EntityPlayer player) { + if (!world.isRemote) { + 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 && rand.nextInt(40) == 0) { + ((EntityLivingBase) entity).attackEntityFrom(DamageSourceList.shadows, 2f); + if (player.shouldHeal()) player.heal(2F); + else player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() + 2f); + } + } + } + } + + @Override + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) { + } + + @Override + 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.bindTexture(PENTAGRAM_TEXTURE); + GL11.glRotatef(rot, 0F, 1F, 0F); + 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; + if (rot > 360F) rot = 0F; + float f = 0.00390625F; + float f1 = 0.00390625F; + int x = 0; + int y = 0; + int u = 32 * 7; + int v = 0; + 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), (double) ((float) (v + 0) * f1)); + tessellator.draw(); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + + @SideOnly(Side.CLIENT) + public void playerHandRender(EntityPlayer player, RenderHandEvent event) { + if (mc.gameSettings.thirdPersonView == 0) { + 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.bindTexture(PENTAGRAM_TEXTURE); + GL11.glRotatef(rot, 0F, 1F, 0F); + 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; + if (rot > 360F) rot = 0F; + float f = 0.00390625F; + float f1 = 0.00390625F; + int x = 0; + int y = 0; + int u = 32 * 7; + int v = 0; + 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), (double) ((float) (v + 0) * f1)); + tessellator.draw(); + GL11.glDisable(GL11.GL_BLEND); + GL11.glPopMatrix(); + } + } + + public String getDescription() { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".pentagram.description"); + } + + @Override + public String getDisplayName() { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".pentagram"); + } + + @Override + public boolean canCurseBeActivated(World world) { + return ConfigHandler.CURSE_PENTAGRAM; + } } diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java b/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java index b675954..ed4d294 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java @@ -4,6 +4,7 @@ package darkknight.jewelrycraft.curses; import java.util.ArrayList; + import darkknight.jewelrycraft.api.Curse; import darkknight.jewelrycraft.config.ConfigHandler; import darkknight.jewelrycraft.entities.EntityHalfHeart; @@ -64,6 +65,12 @@ public class CurseRabbitsPaw extends Curse { return StatCollector.translateToLocal("curse." + Variables.MODID + ".rabbitspaw.description"); } + + @Override + public String getDisplayName() + { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".rabbitspaw"); + } @Override public boolean canCurseBeActivated(World world) diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java b/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java index afc05b0..5cb47cd 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java @@ -1,35 +1,41 @@ -package darkknight.jewelrycraft.curses; - -import darkknight.jewelrycraft.api.Curse; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.util.Variables; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -public class CurseRottenHeart extends Curse -{ - public CurseRottenHeart(String name, int txtID, String pack) - { - super(name, txtID, pack); - } - - @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)); - } - - public String getDescription() - { - return StatCollector.translateToLocal("curse." + Variables.MODID + ".rottenheart.description"); - } - - @Override - public boolean canCurseBeActivated(World world) - { - return world.getWorldInfo().isHardcoreModeEnabled() ? false : ConfigHandler.CURSE_ROTTEN_HEART; - } -} +package darkknight.jewelrycraft.curses; + +import darkknight.jewelrycraft.api.Curse; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.util.Variables; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + +public class CurseRottenHeart extends Curse +{ + public CurseRottenHeart(String name, int txtID, String pack) + { + super(name, txtID, pack); + } + + @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)); + } + + public String getDescription() + { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".rottenheart.description"); + } + + @Override + public String getDisplayName() + { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".rottenheart"); + } + + @Override + public boolean canCurseBeActivated(World world) + { + return world.getWorldInfo().isHardcoreModeEnabled() ? false : ConfigHandler.CURSE_ROTTEN_HEART; + } +} diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java b/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java index 3c63641..c486e5d 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java @@ -1,40 +1,46 @@ -/** - * - */ -package darkknight.jewelrycraft.curses; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import darkknight.jewelrycraft.api.Curse; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.util.Variables; - -/** - * @author Sorin - * - */ -public class CurseVampireHunger extends Curse -{ - protected CurseVampireHunger(String name, int txtID, String texturepack) - { - super(name, txtID, texturepack); - } - - public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) - { - if(player.shouldHeal() && rand.nextInt(5) == 0) player.heal(1F); - } - - public String getDescription() - { - return StatCollector.translateToLocal("curse." + Variables.MODID + ".vampirehunger.description"); - } - - @Override - public boolean canCurseBeActivated(World world) - { - return ConfigHandler.CURSE_VAMPIRE_HUNGER; - } -} +/** + * + */ +package darkknight.jewelrycraft.curses; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import darkknight.jewelrycraft.api.Curse; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.util.Variables; + +/** + * @author Sorin + * + */ +public class CurseVampireHunger extends Curse +{ + protected CurseVampireHunger(String name, int txtID, String texturepack) + { + super(name, txtID, texturepack); + } + + public void attackedByPlayerAction(World world, EntityPlayer player, Entity target) + { + if(player.shouldHeal() && rand.nextInt(5) == 0) player.heal(1F); + } + + public String getDescription() + { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".vampirehunger.description"); + } + + @Override + public String getDisplayName() + { + return StatCollector.translateToLocal("curse." + Variables.MODID + ".vampirehunger"); + } + + @Override + public boolean canCurseBeActivated(World world) + { + return ConfigHandler.CURSE_VAMPIRE_HUNGER; + } +} -- cgit v1.2.3