HUb minekart rider disguise....
This commit is contained in:
parent
c0198b1b1f
commit
e3fa648fc9
@ -70,7 +70,7 @@ public class NpcManager extends MiniPlugin
|
||||
{
|
||||
UpdateNpcLocations();
|
||||
}
|
||||
}, 0L, 20L);
|
||||
}, 0L, 5L);
|
||||
|
||||
_plugin.getServer().getScheduler().scheduleSyncDelayedTask(_plugin, new Runnable()
|
||||
{
|
||||
|
@ -52,11 +52,10 @@ public class Hub extends JavaPlugin implements INautilusPlugin
|
||||
new PetManager(this, clientManager, donationManager, creature, GetWebServerAddress());
|
||||
|
||||
//Main Modules
|
||||
new HubManager(this, clientManager, donationManager);
|
||||
new HubManager(this, clientManager, donationManager, new DisguiseManager(this, new PacketHandler(this)));
|
||||
new Stacker(this);
|
||||
new ServerManager(this, clientManager, donationManager, new Portal(this));
|
||||
new MemoryFix(this);
|
||||
new DisguiseManager(this, new PacketHandler(this));
|
||||
new Teleport(this, clientManager, new Spawn(this));
|
||||
|
||||
//Updates
|
||||
|
@ -31,6 +31,7 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerToggleFlightEvent;
|
||||
import org.bukkit.event.world.ChunkLoadEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.scoreboard.DisplaySlot;
|
||||
import org.bukkit.scoreboard.Objective;
|
||||
@ -48,6 +49,8 @@ import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.common.util.UtilServer;
|
||||
import mineplex.core.common.util.UtilWorld;
|
||||
import mineplex.core.disguise.DisguiseManager;
|
||||
import mineplex.core.disguise.disguises.DisguisePlayer;
|
||||
import mineplex.core.donation.DonationManager;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
@ -56,6 +59,7 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
{
|
||||
private CoreClientManager _clientManager;
|
||||
private DonationManager _donationManager;
|
||||
private DisguiseManager _disguiseManager;
|
||||
|
||||
private Location _spawn;
|
||||
private int _scoreboardTick = 0;
|
||||
@ -64,13 +68,14 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
|
||||
private HashSet<LivingEntity> _mobs = new HashSet<LivingEntity>();
|
||||
|
||||
public HubManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager)
|
||||
public HubManager(JavaPlugin plugin, CoreClientManager clientManager, DonationManager donationManager, DisguiseManager disguiseManager)
|
||||
{
|
||||
super("Hub Manager", plugin);
|
||||
|
||||
_clientManager = clientManager;
|
||||
_donationManager = donationManager;
|
||||
|
||||
_disguiseManager = disguiseManager;
|
||||
|
||||
_spawn = new Location(UtilWorld.getWorld("world"), 0.5, 74, 0.5);
|
||||
|
||||
new TextCreator(this);
|
||||
@ -82,6 +87,21 @@ public class HubManager extends MiniClientPlugin<HubClient>
|
||||
event.setRespawnLocation(GetSpawn());
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void OnChunkLoad(ChunkLoadEvent event)
|
||||
{
|
||||
for (Entity entity : event.getChunk().getEntities())
|
||||
{
|
||||
if (entity instanceof LivingEntity)
|
||||
{
|
||||
if (((LivingEntity)entity).isCustomNameVisible() && ((LivingEntity)entity).getCustomName() != null && ((LivingEntity)entity).getCustomName().equalsIgnoreCase("minekartrider"))
|
||||
{
|
||||
_disguiseManager.Disguise(new DisguisePlayer(entity, "Play " + ChatColor.YELLOW + "MineKart"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void PlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user