diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-06-05 01:53:14 +0100 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-06-05 01:53:14 +0100 |
| commit | a6a3bfa6f313adba5afe6eb4a0da049a8d641cfc (patch) | |
| tree | 56da97ba430232a7d0da51a3b8b9f444d96325c7 /src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java | |
| parent | 40487f07fa5ef31fde99713c0b842d34a0ba3622 (diff) | |
Stuff!
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java')
| -rw-r--r-- | src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java | 146 |
1 files changed, 73 insertions, 73 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java b/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java index 1c26558..b675954 100644 --- a/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java +++ b/src/main/java/darkknight/jewelrycraft/curses/CurseRabbitsPaw.java @@ -1,73 +1,73 @@ -/** - * - */ -package darkknight.jewelrycraft.curses; - -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; -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; - -public class CurseRabbitsPaw extends Curse -{ - public CurseRabbitsPaw(String name, int txtID, String pack) - { - super(name, txtID, pack); - } - - @Override - public void entityDropItems(EntityPlayer player, Entity target, ArrayList<EntityItem> drops) - { - for(EntityItem item: drops){ - ItemStack drop = item.getEntityItem().copy(); - 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 String getDescription() - { - return StatCollector.translateToLocal("curse." + Variables.MODID + ".rabbitspaw.description"); - } - - @Override - public boolean canCurseBeActivated(World world) - { - return ConfigHandler.CURSE_RABBIT_PAW; - } -} +/**
+ *
+ */
+package darkknight.jewelrycraft.curses;
+
+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;
+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;
+
+public class CurseRabbitsPaw extends Curse
+{
+ public CurseRabbitsPaw(String name, int txtID, String pack)
+ {
+ super(name, txtID, pack);
+ }
+
+ @Override
+ public void entityDropItems(EntityPlayer player, Entity target, ArrayList<EntityItem> drops)
+ {
+ for(EntityItem item: drops){
+ ItemStack drop = item.getEntityItem().copy();
+ 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 String getDescription()
+ {
+ return StatCollector.translateToLocal("curse." + Variables.MODID + ".rabbitspaw.description");
+ }
+
+ @Override
+ public boolean canCurseBeActivated(World world)
+ {
+ return ConfigHandler.CURSE_RABBIT_PAW;
+ }
+}
|
