From 01c8701b68986ccfa83e902515716838d6829311 Mon Sep 17 00:00:00 2001 From: Onyx Date: Tue, 1 Dec 2015 20:55:30 +0000 Subject: - Fixed all of the bugs mentioned on github - Added new config options - Rabbits paw now increases the chance of spawning hearts, rather than itself spawning some - Hearts now have a much lower chance to spawn by default - You can no longer increase your health past 20 hearts (aka double the default health) - The guide now also shows the total number of pages on each tab - A new luck stat has been added to the Curse API - Cleaned up the code a bit (removed unused methods, imports etc) - The displayer's info now has a purple solid color background; the text also has a much closer shadow and now shrinks in height as well as in width when too big - I have modified the potion list to use Mithion's code, credits have been given --- .../darkknight/jewelrycraft/curses/CurseBlind.java | 1 - .../jewelrycraft/curses/CurseDeathsTouch.java | 12 --------- .../darkknight/jewelrycraft/curses/CurseGreed.java | 2 -- .../jewelrycraft/curses/CurseHumbleBundle.java | 8 +++--- .../jewelrycraft/curses/CurseInfamy.java | 28 ++++++++------------- .../darkknight/jewelrycraft/curses/CurseList.java | 1 - .../jewelrycraft/curses/CurseMidasTouch.java | 20 +++++++-------- .../jewelrycraft/curses/CursePentagram.java | 2 -- .../jewelrycraft/curses/CurseRabbitsPaw.java | 29 +++++----------------- .../jewelrycraft/curses/CurseVampireHunger.java | 6 ++--- 10 files changed, 32 insertions(+), 77 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 47a7667..800718c 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java @@ -1,7 +1,6 @@ package darkknight.jewelrycraft.curses; import java.util.Random; - import darkknight.jewelrycraft.api.Curse; import darkknight.jewelrycraft.config.ConfigHandler; import darkknight.jewelrycraft.util.Variables; diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseDeathsTouch.java b/src/main/java/darkknight/jewelrycraft/curses/CurseDeathsTouch.java index 3e4da7f..92e2dfa 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseDeathsTouch.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseDeathsTouch.java @@ -1,22 +1,10 @@ package darkknight.jewelrycraft.curses; -import darkknight.jewelrycraft.JewelrycraftMod; import darkknight.jewelrycraft.api.Curse; import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.network.PacketSendClientPlayerInfo; -import darkknight.jewelrycraft.network.PacketSendServerPlayersInfo; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; import darkknight.jewelrycraft.util.Variables; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.monster.EntityMob; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; import net.minecraft.util.StatCollector; import net.minecraft.world.World; diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java b/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java index 9a1901b..5e535b8 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java @@ -4,8 +4,6 @@ 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; diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java b/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java index 8f3272a..3d0f582 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseHumbleBundle.java @@ -4,19 +4,17 @@ package darkknight.jewelrycraft.curses; import java.util.ArrayList; - +import darkknight.jewelrycraft.api.Curse; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.util.Variables; 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 diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java b/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java index 600548f..4f91244 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java @@ -1,26 +1,9 @@ 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; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.SharedMonsterAttributes; -import net.minecraft.entity.monster.EntityMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import net.minecraftforge.client.event.RenderPlayerEvent; -import net.minecraftforge.event.entity.living.LivingAttackEvent; import darkknight.jewelrycraft.JewelrycraftMod; import darkknight.jewelrycraft.api.Curse; import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.damage.DamageSourceList; import darkknight.jewelrycraft.entities.EntityHalfHeart; import darkknight.jewelrycraft.entities.EntityHeart; import darkknight.jewelrycraft.entities.renders.RenderHelper; @@ -30,6 +13,17 @@ import darkknight.jewelrycraft.network.PacketSendServerPlayersInfo; import darkknight.jewelrycraft.util.JewelrycraftUtil; import darkknight.jewelrycraft.util.PlayerUtils; import darkknight.jewelrycraft.util.Variables; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.SharedMonsterAttributes; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraftforge.client.event.RenderPlayerEvent; +import net.minecraftforge.event.entity.living.LivingAttackEvent; public class CurseInfamy extends Curse { diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseList.java b/src/main/java/darkknight/jewelrycraft/curses/CurseList.java index ae86a15..4a33f67 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseList.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseList.java @@ -2,7 +2,6 @@ package darkknight.jewelrycraft.curses; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import darkknight.jewelrycraft.api.Curse; -import darkknight.jewelrycraft.config.ConfigHandler; import darkknight.jewelrycraft.util.Variables; public class CurseList { diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java b/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java index 035d6b6..86d9622 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseMidasTouch.java @@ -1,13 +1,20 @@ package darkknight.jewelrycraft.curses; import java.util.Random; - +import darkknight.jewelrycraft.api.Curse; +import darkknight.jewelrycraft.block.BlockList; +import darkknight.jewelrycraft.config.ConfigHandler; +import darkknight.jewelrycraft.entities.EntityHalfHeart; +import darkknight.jewelrycraft.entities.EntityHeart; +import darkknight.jewelrycraft.item.ItemList; +import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; +import darkknight.jewelrycraft.util.JewelryNBT; +import darkknight.jewelrycraft.util.Variables; import net.minecraft.block.Block; import net.minecraft.block.BlockCompressed; import net.minecraft.block.BlockPressurePlate; import net.minecraft.block.BlockPressurePlateWeighted; import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -24,15 +31,6 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; import net.minecraftforge.event.entity.living.LivingAttackEvent; -import darkknight.jewelrycraft.api.Curse; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.tileentity.TileEntityMidasTouch; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.Variables; public class CurseMidasTouch extends Curse { diff --git a/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java b/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java index 1ac9361..c15e25a 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CursePentagram.java @@ -1,7 +1,6 @@ package darkknight.jewelrycraft.curses; import org.lwjgl.opengl.GL11; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import darkknight.jewelrycraft.achievements.AchievementsList; @@ -13,7 +12,6 @@ import darkknight.jewelrycraft.util.Variables; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureManager; -import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java b/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java index 32ea0fb..831f5c5 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java @@ -7,9 +7,6 @@ import java.util.ArrayList; import darkknight.jewelrycraft.api.Curse; import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.entities.EntityHalfHeart; -import darkknight.jewelrycraft.entities.EntityHeart; -import darkknight.jewelrycraft.util.JewelrycraftUtil; import darkknight.jewelrycraft.util.Variables; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -17,7 +14,6 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityXPOrb; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; import net.minecraft.world.World; @@ -33,34 +29,21 @@ public class CurseRabbitsPaw extends Curse { for(EntityItem item: drops){ ItemStack drop = item.getEntityItem().copy(); - drop.stackSize = this.rand.nextInt(4); + drop.stackSize = this.rand.nextInt(4); if (drop.stackSize > 0) target.entityDropItem(drop, 0.5F); } } public void entityDeathAction(World world, EntityLivingBase target, EntityPlayer player) { - String[] types = {"Red", "Blue", "White", "Black"}; - String type = types[rand.nextInt(4)]; - if (rand.nextInt(3) == 0 && target.getCreatureAttribute() != JewelrycraftUtil.HEART){ - if (type == "White"){ - EntityHeart h = new EntityHalfHeart(world); - h.setType(type); - h.setLocationAndAngles(target.posX, target.posY, target.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - world.spawnEntityInWorld(h); - }else{ - for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(target.getMaxHealth() / 20)); i++){ - EntityHeart[] hearts = {new EntityHeart(world), new EntityHalfHeart(world)}; - EntityHeart h = hearts[rand.nextInt(2)]; - h.setType(type); - h.setLocationAndAngles(target.posX, target.posY, target.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F); - world.spawnEntityInWorld(h); - } - } - } if (rand.nextInt(3) == 0) world.spawnEntityInWorld(new EntityXPOrb(world, target.posX, target.posY, target.posZ, 1 + rand.nextInt(40))); } + public int luck() + { + return 10; + } + public String getDescription() { return StatCollector.translateToLocal("curse." + Variables.MODID + ".rabbitspaw.description"); diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java b/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java index e2d278e..b00552e 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseVampireHunger.java @@ -3,14 +3,14 @@ */ 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.MathHelper; 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 -- cgit v1.2.3