use of com.laytonsmith.abstraction.bukkit.entities.BukkitMCPlayer in project CommandHelper by EngineHub.
the class CommandHelperInterpreterListener method onPlayerChat.
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerChat(final AsyncPlayerChatEvent event) {
if (interpreterMode.contains(event.getPlayer().getName())) {
final MCPlayer p = new BukkitMCPlayer(event.getPlayer());
event.setCancelled(true);
StaticLayer.SetFutureRunnable(null, 0, new Runnable() {
@Override
public void run() {
textLine(p, event.getMessage());
}
});
}
}
use of com.laytonsmith.abstraction.bukkit.entities.BukkitMCPlayer in project CommandHelper by EngineHub.
the class BukkitMCPluginMeta method sendIncomingMessage0.
@Override
protected void sendIncomingMessage0(MCPlayer player, String channel, byte[] message) {
Player p = ((BukkitMCPlayer) player)._Player();
Bukkit.getMessenger().dispatchIncomingMessage(p, channel, message);
}
use of com.laytonsmith.abstraction.bukkit.entities.BukkitMCPlayer in project CommandHelper by EngineHub.
the class BukkitMCServer method getOnlinePlayers.
@Override
public Collection<MCPlayer> getOnlinePlayers() {
Collection<? extends Player> players = s.getOnlinePlayers();
Set<MCPlayer> mcpa = new HashSet<>();
for (Player p : players) {
mcpa.add(new BukkitMCPlayer(p));
}
return mcpa;
}
use of com.laytonsmith.abstraction.bukkit.entities.BukkitMCPlayer in project CommandHelper by EngineHub.
the class RandomTests method testCastFromBukkitMCPlayerToBukkitMCCommandSender.
@Test
public void testCastFromBukkitMCPlayerToBukkitMCCommandSender() throws Exception {
Player p = mock(Player.class);
BukkitMCCommandSender c = new BukkitMCCommandSender(new BukkitMCPlayer(p));
}
use of com.laytonsmith.abstraction.bukkit.entities.BukkitMCPlayer in project CommandHelper by EngineHub.
the class CommandHelperInterpreterListener method onPlayerCommandPreprocess.
@EventHandler(priority = EventPriority.LOWEST)
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
if (event.isCancelled()) {
return;
}
if (interpreterMode.contains(event.getPlayer().getName())) {
MCPlayer p = new BukkitMCPlayer(event.getPlayer());
textLine(p, event.getMessage());
event.setCancelled(true);
}
}
Aggregations