Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
f81f5d82d6
@ -5,6 +5,8 @@ import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import mineplex.core.MiniClientPlugin;
|
||||
@ -311,6 +313,8 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
if (event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
_animation.itemClean();
|
||||
|
||||
if(_canVote)
|
||||
return;
|
||||
|
||||
@ -338,7 +342,6 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
creeper.getWorld().playSound(creeper.getLocation(), Sound.EXPLODE, 2f, 1f);
|
||||
_animation.setType(_pendingExplosions.get(0));
|
||||
_animation.setPlayer(_pendingExplosionsPlayers.get(0));
|
||||
_animation.setTime(System.currentTimeMillis());
|
||||
_animation.setRunning(true);
|
||||
}
|
||||
|
||||
@ -1019,29 +1022,7 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
return _pollManager;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void ItemDecay(UpdateEvent event)
|
||||
{
|
||||
if(event.getType() != UpdateType.TICK)
|
||||
return;
|
||||
|
||||
for(Entity entity : _carlNpc.getEntity().getNearbyEntities(3, -0.5, 3))
|
||||
{
|
||||
if(!(entity instanceof Item))
|
||||
continue;
|
||||
|
||||
if(((Item)entity).getItemStack().getType() == Material.MONSTER_EGG && ((Item)entity).getItemStack().hasItemMeta() && !((Item)entity).getItemStack().getItemMeta().getDisplayName().startsWith("Hidden"))
|
||||
entity.remove();
|
||||
|
||||
if(!((Item) entity).getItemStack().hasItemMeta())
|
||||
continue;
|
||||
|
||||
if(!((Item) entity).getItemStack().getItemMeta().getDisplayName().startsWith(" "))
|
||||
continue;
|
||||
|
||||
entity.remove();
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void Join(final PlayerJoinEvent event)
|
||||
@ -1075,11 +1056,14 @@ public class BonusManager extends MiniClientPlugin<BonusClientData> implements I
|
||||
if(_pollManager.hasPoll(player) || canVote(player) || (canRank(player) && _clientManager.hasRank(player, Rank.ULTRA) && isPastAugust()) || canDaily(player))
|
||||
{
|
||||
if(_showCarl.containsKey(player.getName()))
|
||||
{
|
||||
if(_plugin.getConfig().getString("serverstatus.group").equalsIgnoreCase("Lobby"))
|
||||
UtilPlayer.message(player, C.cDGreen + C.Bold + "Carl the Creeper>" + C.cGreen + " Hey " + player.getName().replace("s", "sss") + "! I have sssome amazing rewardsss for you! Come sssee me!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String getVoteLink()
|
||||
{
|
||||
|
@ -1,5 +1,7 @@
|
||||
package mineplex.core.bonuses.animations;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Random;
|
||||
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
@ -13,6 +15,8 @@ import mineplex.core.reward.Reward;
|
||||
import mineplex.core.reward.RewardData;
|
||||
import mineplex.core.reward.RewardRarity;
|
||||
import mineplex.core.treasure.animation.Animation;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import org.bukkit.Color;
|
||||
import org.bukkit.Location;
|
||||
@ -23,19 +27,19 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Item;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.util.Vector;
|
||||
|
||||
public class AnimationCarl extends Animation
|
||||
{
|
||||
|
||||
private boolean _isDone;
|
||||
private Block _creeper;
|
||||
private long _startTime;
|
||||
private Object _type;
|
||||
private Player _player;
|
||||
private Random _random = new Random();
|
||||
|
||||
private HashSet<Item> _items = new HashSet<Item>();
|
||||
|
||||
public AnimationCarl(Entity creeper)
|
||||
{
|
||||
@ -53,11 +57,13 @@ public class AnimationCarl extends Animation
|
||||
{
|
||||
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));
|
||||
_items.add(gem);
|
||||
_items.add(coin);
|
||||
|
||||
Vector vel = new Vector(Math.sin(i * 9/5d), 0, Math.cos(i * 9/5d));
|
||||
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"))
|
||||
@ -65,24 +71,30 @@ public class AnimationCarl extends Animation
|
||||
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));
|
||||
_items.add(coin);
|
||||
|
||||
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")&& !((String) _type).contentEquals("POLL"))
|
||||
{
|
||||
|
||||
Item paper = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 1.5, 0.5), ItemStackFactory.Instance.CreateStack(Material.PAPER, (byte) 0, 1, " " + 64));
|
||||
_items.add(paper);
|
||||
|
||||
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));
|
||||
_items.add(gem);
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
finish();
|
||||
@ -94,12 +106,11 @@ public class AnimationCarl extends Animation
|
||||
RewardData rewardData = ((Reward)_type).getFakeRewardData(_player);
|
||||
ItemStack itemStack = rewardData.getDisplayItem();
|
||||
Item item = _creeper.getWorld().dropItem(_creeper.getLocation().add(0.5, 1.7, 0.5), itemStack);
|
||||
_items.add(item);
|
||||
|
||||
Vector vel = new Vector(_player.getLocation().getX() - _creeper.getLocation().getX(), 0, _player.getLocation().getZ() - _creeper.getLocation().getZ());
|
||||
|
||||
UtilAction.velocity(item, vel, 0.1, false, 0, 0.2 + 1*0.4, 1, false);
|
||||
|
||||
item.setTicksLived(1160);
|
||||
}
|
||||
|
||||
if(((Reward)_type).getRarity() == RewardRarity.RARE)
|
||||
@ -137,11 +148,6 @@ public class AnimationCarl extends Animation
|
||||
_isDone = b;
|
||||
}
|
||||
|
||||
public void setTime(long time)
|
||||
{
|
||||
_startTime = time;
|
||||
}
|
||||
|
||||
public void setType(Object type)
|
||||
{
|
||||
_type = type;
|
||||
@ -265,4 +271,20 @@ public class AnimationCarl extends Animation
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void itemClean()
|
||||
{
|
||||
Iterator<Item> itemIterator = _items.iterator();
|
||||
|
||||
while (itemIterator.hasNext())
|
||||
{
|
||||
Item item = itemIterator.next();
|
||||
|
||||
if (item.isOnGround() || !item.isValid() || item.getTicksLived() > 60)
|
||||
{
|
||||
item.remove();
|
||||
itemIterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -425,13 +425,13 @@ public class SoccerManager extends MiniPlugin
|
||||
{
|
||||
if (_active.size() >= 8)
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Football", "You must be wearing Red/Blue Team Outfit."));
|
||||
UtilPlayer.message(player, F.main("Football", "Type " + F.elem("/team red") + " or " + F.elem("/team blue") + "!"));
|
||||
UtilPlayer.message(player, F.main("Soccer", "You must be wearing Red/Blue Team Outfit."));
|
||||
UtilPlayer.message(player, F.main("Soccer", "Type " + F.elem("/team red") + " or " + F.elem("/team blue") + "!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
UtilPlayer.message(player, F.main("Football", "You must be wearing Red/Blue Team Outfit."));
|
||||
UtilPlayer.message(player, F.main("Football", "Type " + F.elem("/team red") + " or " + F.elem("/team blue") + "!"));
|
||||
UtilPlayer.message(player, F.main("Soccer", "You must be wearing Red/Blue Team Outfit."));
|
||||
UtilPlayer.message(player, F.main("Soccer", "Type " + F.elem("/team red") + " or " + F.elem("/team blue") + "!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -447,11 +447,11 @@ public class SoccerManager extends MiniPlugin
|
||||
_active.add(player);
|
||||
|
||||
if (color == null)
|
||||
UtilPlayer.message(player, F.main("Parkour", "You have entered " + F.elem("Football Mode") + "."));
|
||||
UtilPlayer.message(player, F.main("Parkour", "You have entered " + F.elem("Soccer Mode") + "."));
|
||||
else if (color == Color.RED)
|
||||
UtilPlayer.message(player, F.main("Parkour", "You have joined " + F.elem(C.cRed + "Red Football Team") + "."));
|
||||
UtilPlayer.message(player, F.main("Parkour", "You have joined " + F.elem(C.cRed + "Red Soccer Team") + "."));
|
||||
else if (color == Color.AQUA)
|
||||
UtilPlayer.message(player, F.main("Parkour", "You have joined " + F.elem(C.cAqua + "Blue Football Team") + "."));
|
||||
UtilPlayer.message(player, F.main("Parkour", "You have joined " + F.elem(C.cAqua + "Blue Soccer Team") + "."));
|
||||
|
||||
ArrayList<String> outfit = new ArrayList<String>();
|
||||
outfit.add("Team Helmet");
|
||||
@ -466,7 +466,7 @@ public class SoccerManager extends MiniPlugin
|
||||
else
|
||||
{
|
||||
_active.remove(player);
|
||||
UtilPlayer.message(player, F.main("Parkour", "You have exited " + F.elem("Football Mode") + "."));
|
||||
UtilPlayer.message(player, F.main("Parkour", "You have exited " + F.elem("Soccer Mode") + "."));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -118,8 +118,8 @@ public class PartyTutorial extends Tutorial
|
||||
));
|
||||
|
||||
_phases.add(new TutorialPhase(
|
||||
manager.GetSpawn().add(0, -2, 0),
|
||||
manager.GetSpawn().add(0, -2.1, 5),
|
||||
manager.GetSpawn().add(0, 0, 0),
|
||||
manager.GetSpawn().add(0, 0.1, 5),
|
||||
"End",
|
||||
new String[]
|
||||
{
|
||||
|
@ -132,8 +132,8 @@ public class WelcomeTutorial extends Tutorial
|
||||
|
||||
//END
|
||||
_phases.add(new TutorialPhase(
|
||||
manager.GetSpawn().add(0, -2, 0),
|
||||
manager.GetSpawn().add(0, -2.1, 5),
|
||||
manager.GetSpawn().add(0, 0, 0),
|
||||
manager.GetSpawn().add(0, 0.1, 5),
|
||||
"End",
|
||||
new String[]
|
||||
{
|
||||
|
@ -4,6 +4,7 @@ import java.io.File;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.omg.CORBA._PolicyStub;
|
||||
|
||||
import net.minecraft.server.v1_7_R4.BiomeBase;
|
||||
import net.minecraft.server.v1_7_R4.MinecraftServer;
|
||||
@ -37,6 +38,7 @@ import mineplex.core.mount.MountManager;
|
||||
import mineplex.core.npc.NpcManager;
|
||||
import mineplex.core.packethandler.PacketHandler;
|
||||
import mineplex.core.pet.PetManager;
|
||||
import mineplex.core.poll.PollManager;
|
||||
import mineplex.core.portal.Portal;
|
||||
import mineplex.core.preferences.PreferencesManager;
|
||||
import mineplex.core.projectile.ProjectileManager;
|
||||
@ -112,7 +114,8 @@ public class Arcade extends JavaPlugin
|
||||
|
||||
DisguiseManager disguiseManager = new DisguiseManager(this, packetHandler);
|
||||
|
||||
_damageManager = new DamageManager(this, new CombatManager(this), new NpcManager(this, creature), disguiseManager, null);
|
||||
NpcManager npcmanager = new NpcManager(this, creature);
|
||||
_damageManager = new DamageManager(this, new CombatManager(this), npcmanager, disguiseManager, null);
|
||||
|
||||
Punish punish = new Punish(this, webServerAddress, _clientManager);
|
||||
AntiHack.Initialize(this, punish, portal, preferenceManager, _clientManager);
|
||||
@ -139,7 +142,8 @@ public class Arcade extends JavaPlugin
|
||||
cosmeticManager.setInterfaceSlot(7);
|
||||
|
||||
//Arcade Manager
|
||||
_gameManager = new ArcadeManager(this, serverStatusManager, ReadServerConfig(), _clientManager, _donationManager, _damageManager, statsManager, achievementManager, disguiseManager, creature, teleport, new Blood(this), chat, portal, preferenceManager, inventoryManager, packetHandler, cosmeticManager, projectileManager, petManager, hologramManager, webServerAddress);
|
||||
PollManager pollManager = new PollManager(this, _clientManager, _donationManager);
|
||||
_gameManager = new ArcadeManager(this, serverStatusManager, ReadServerConfig(), _clientManager, _donationManager, _damageManager, statsManager, achievementManager, disguiseManager, creature, teleport, new Blood(this), chat, portal, preferenceManager, inventoryManager, packetHandler, cosmeticManager, projectileManager, petManager, hologramManager, webServerAddress, pollManager, npcmanager);
|
||||
|
||||
new MemoryFix(this);
|
||||
new CustomTagFix(this, packetHandler);
|
||||
|
@ -42,6 +42,7 @@ import mineplex.core.account.CoreClientManager;
|
||||
import mineplex.core.achievement.AchievementManager;
|
||||
import mineplex.core.blockrestore.BlockRestore;
|
||||
import mineplex.core.blood.Blood;
|
||||
import mineplex.core.bonuses.BonusManager;
|
||||
import mineplex.core.chat.Chat;
|
||||
import mineplex.core.common.Rank;
|
||||
import mineplex.core.common.jsonchat.ClickEvent;
|
||||
@ -67,6 +68,7 @@ import mineplex.core.inventory.InventoryManager;
|
||||
import mineplex.core.itemstack.ItemStackFactory;
|
||||
import mineplex.core.movement.Movement;
|
||||
import mineplex.core.notifier.NotificationManager;
|
||||
import mineplex.core.npc.NpcManager;
|
||||
import mineplex.core.packethandler.IPacketHandler;
|
||||
import mineplex.core.packethandler.PacketHandler;
|
||||
import mineplex.core.packethandler.PacketInfo;
|
||||
@ -74,6 +76,7 @@ import mineplex.core.packethandler.PacketPlayResourcePackStatus;
|
||||
import mineplex.core.packethandler.PacketPlayResourcePackStatus.EnumResourcePackStatus;
|
||||
import mineplex.core.party.PartyManager;
|
||||
import mineplex.core.pet.PetManager;
|
||||
import mineplex.core.poll.PollManager;
|
||||
import mineplex.core.portal.Portal;
|
||||
import mineplex.core.preferences.PreferencesManager;
|
||||
import mineplex.core.projectile.ProjectileManager;
|
||||
@ -209,7 +212,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
CoreClientManager clientManager, DonationManager donationManager, DamageManager damageManager,
|
||||
StatsManager statsManager, AchievementManager achievementManager, DisguiseManager disguiseManager, Creature creature, Teleport teleport, Blood blood, Chat chat,
|
||||
Portal portal, PreferencesManager preferences, InventoryManager inventoryManager, PacketHandler packetHandler,
|
||||
CosmeticManager cosmeticManager, ProjectileManager projectileManager, PetManager petManager, HologramManager hologramManager, String webAddress)
|
||||
CosmeticManager cosmeticManager, ProjectileManager projectileManager, PetManager petManager, HologramManager hologramManager, String webAddress, PollManager pollManager, NpcManager npcManager)
|
||||
{
|
||||
super("Game Manager", plugin);
|
||||
|
||||
@ -293,6 +296,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
||||
|
||||
new NotificationManager(getPlugin(), clientManager);
|
||||
|
||||
new BonusManager(plugin, clientManager, donationManager, pollManager , npcManager, hologramManager, statsManager, _inventoryManager, petManager);
|
||||
|
||||
//Champions Modules
|
||||
_energy = new Energy(plugin);
|
||||
|
||||
|
@ -3,6 +3,7 @@ package nautilus.game.arcade.managers;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
import mineplex.core.bonuses.event.CarlSpinnerEvent;
|
||||
import mineplex.core.common.util.C;
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilFirework;
|
||||
@ -692,4 +693,18 @@ public class GameManager implements Listener
|
||||
{
|
||||
event.GetGame().EndCheck();
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void carlSpinnerCancel(CarlSpinnerEvent event)
|
||||
{
|
||||
Game game = Manager.GetGame();
|
||||
if (game == null) return;
|
||||
|
||||
if (game.GetCountdown() > 0 || game.GetState() != GameState.Recruit)
|
||||
{
|
||||
UtilPlayer.message(event.getPlayer(), F.main("Carl", "You can't use my spinner at the moment!"));
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user