From e25558fc91f88b77c7359a2d9002c980538573c3 Mon Sep 17 00:00:00 2001 From: Sarah Date: Tue, 11 Aug 2015 13:49:06 +0200 Subject: [PATCH] Animation improvements. --- .../mineplex/core/bonuses/BonusManager.java | 4 +++ .../bonuses/animations/AnimationCarl.java | 31 ++++++++++--------- .../core/bonuses/gui/buttons/PollButton.java | 2 +- .../bonuses/gui/buttons/RankBonusButton.java | 2 +- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java index a719ba172..af93fc985 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/BonusManager.java @@ -50,6 +50,7 @@ import mineplex.serverdata.commands.ServerCommandManager; import org.jooq.SQLDialect; import org.jooq.impl.DSL; import org.bukkit.Bukkit; +import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Dropper; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; @@ -984,6 +985,9 @@ public class BonusManager extends MiniClientPlugin implements I if(!(entity instanceof Item)) continue; + if(((Item)entity).getItemStack().getType() == Material.MONSTER_EGG) + entity.remove(); + if(!((Item) entity).getItemStack().hasItemMeta()) continue; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/animations/AnimationCarl.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/animations/AnimationCarl.java index 0fc8fd838..160b2e14c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/animations/AnimationCarl.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/animations/AnimationCarl.java @@ -4,6 +4,7 @@ import java.util.Random; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilFirework; +import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ViewDist; @@ -46,39 +47,41 @@ public class AnimationCarl extends Animation { if(_type instanceof String) { - if(((String) _type).contentEquals("DAILY")) + if(((String) _type).contentEquals("DAILY") || ((String) _type).contentEquals("POLL")) { - for (int i = 1; i < 8; i++) + for (int i = 50; i < 60; i++) { Item gem = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 1.5, 0.5), ItemStackFactory.Instance.CreateStack(Material.EMERALD, (byte) 0, 1, " " + i)); Item coin = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 1.5, 0.5), ItemStackFactory.Instance.CreateStack(Material.DOUBLE_PLANT, (byte) 0, 1, " " + i)); Vector vel = new Vector(Math.sin(i * 9/5d), 0, Math.cos(i * 9/5d)); - UtilAction.velocity(gem, vel, Math.abs(Math.sin(i * 9/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i * 9/3000d))*0.6, 1, false); - UtilAction.velocity(coin, vel, Math.abs(Math.sin(i * 9/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i * 9/3000d))*0.6, 1, false); + UtilAction.velocity(gem, vel, Math.abs(Math.sin(i * 12/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i * 12/3000d))*0.6, 1, false); + UtilAction.velocity(coin, vel, Math.abs(Math.sin(UtilMath.r(i) * 30/3000d)), false, 0, 0.2 + Math.abs(Math.cos(UtilMath.r(i) * 30/3000d))*0.6, 1, false); coin.setTicksLived(1160); gem.setTicksLived(1160); } } if(((String) _type).contentEquals("RANK")) { - for (int i = 1; i < 8; i++) + for (int i = 50; i < 60; i++) { Item coin = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 1.5, 0.5), ItemStackFactory.Instance.CreateStack(Material.DOUBLE_PLANT, (byte) 0, 1, " " + i)); - Vector vel = new Vector(Math.sin(i * 7/5d), 0, Math.cos(i * 7/5d)); - UtilAction.velocity(coin, vel, Math.abs(Math.sin(i * 7/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i * 7/3000d))*0.6, 1, false); + Vector vel = new Vector(Math.sin(UtilMath.r(i) * 7/5d), 0, Math.cos(UtilMath.r(i) * 7/5d)); + UtilAction.velocity(coin, vel, Math.abs(Math.sin(UtilMath.r(i) * 7/3000d)), false, 0, 0.2 + Math.abs(Math.cos(UtilMath.r(i) * 7/3000d))*0.6, 1, false); coin.setTicksLived(1160); } } - if(!((String) _type).contentEquals("DAILY")&& !((String) _type).contentEquals("RANK")) + if(!((String) _type).contentEquals("DAILY")&& !((String) _type).contentEquals("RANK")&& !((String) _type).contentEquals("POLL")) { - for (int i = 1; i < 8; i++) + + Item paper = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 1.5, 0.5), ItemStackFactory.Instance.CreateStack(Material.PAPER, (byte) 0, 1, " " + 64)); + Vector vel = new Vector(Math.sin(64 * 8/5d), 0, Math.cos(64 * 8/5d)); + UtilAction.velocity(paper, vel, Math.abs(Math.sin(64 * 9/3000d)), false, 0, 0.2 + Math.abs(Math.cos(64 + 9/3000d))*0.6, 1, false); + paper.setTicksLived(1160); + for (int i = 50; i < 60; i++) { Item gem = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 1.5, 0.5), ItemStackFactory.Instance.CreateStack(Material.EMERALD, (byte) 0, 1, " " + i)); - Item paper = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 1.5, 0.5), ItemStackFactory.Instance.CreateStack(Material.PAPER, (byte) 0, 1, " " + i)); - Vector vel = new Vector(Math.sin(i * 8/5d), 0, Math.cos(i * 8/5d)); - UtilAction.velocity(gem, vel, Math.abs(Math.sin(i * 8/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i + 8/3000d))*0.6, 1, false); - UtilAction.velocity(paper, vel, Math.abs(Math.sin(i * 9/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i + 9/3000d))*0.6, 1, false); - paper.setTicksLived(1160); + Vector velo = new Vector(Math.sin(i * 8/5d), 0, Math.cos(i * 8/5d)); + UtilAction.velocity(gem, velo, Math.abs(Math.sin(i * 8/3000d)), false, 0, 0.2 + Math.abs(Math.cos(i + 8/3000d))*0.6, 1, false); gem.setTicksLived(1160); } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/PollButton.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/PollButton.java index 417a6b556..8124e6292 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/PollButton.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/PollButton.java @@ -194,7 +194,7 @@ public class PollButton extends SimpleGui implements GuiItem { getPlayer().playSound(getPlayer().getLocation(), Sound.NOTE_PLING, 1, 1.6f); new TimedMessageWindow(getPlugin(), getPlayer(), ItemStackFactory.Instance.CreateStack(Material.EMERALD_BLOCK, (byte) 0, 1, ChatColor.GREEN + "Your anwser:", wrap(getPoll().getAnswers()[num])), ChatColor.GREEN + "Moo", 6 * 9, 50, getMaster()).openInventory(); - _bonusManager.addPendingExplosion(getPlayer(), "VOTE"); + _bonusManager.addPendingExplosion(getPlayer(), "POLL"); getPlayer().closeInventory(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/RankBonusButton.java b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/RankBonusButton.java index fe3e20322..489b257fd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/RankBonusButton.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/bonuses/gui/buttons/RankBonusButton.java @@ -178,7 +178,7 @@ public class RankBonusButton implements GuiItem, Listener { } lore.add(" "); - lore.add(C.cYellow + "Rank:" + C.cWhite + _bonusManager.getClientManager().Get(_player).GetRank().Name); + lore.add(C.cYellow + "Rank: " + C.cWhite + _bonusManager.getClientManager().Get(_player).GetRank().Name); BonusAmount bonusAmount = _bonusManager.getRankBonusAmount(_player); bonusAmount.addLore(lore); }