Animation improvements.

This commit is contained in:
Sarah 2015-08-11 13:49:06 +02:00
parent 2d7d7f6dde
commit e25558fc91
4 changed files with 23 additions and 16 deletions

View File

@ -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<BonusClientData> implements I
if(!(entity instanceof Item))
continue;
if(((Item)entity).getItemStack().getType() == Material.MONSTER_EGG)
entity.remove();
if(!((Item) entity).getItemStack().hasItemMeta())
continue;

View File

@ -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);
}
}

View File

@ -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();
}

View File

@ -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);
}