本文整理汇总了Java中net.dmulloy2.handlers.LogHandler.globalDebug方法的典型用法代码示例。如果您正苦于以下问题:Java LogHandler.globalDebug方法的具体用法?Java LogHandler.globalDebug怎么用?Java LogHandler.globalDebug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.dmulloy2.handlers.LogHandler
的用法示例。
在下文中一共展示了LogHandler.globalDebug方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendMessage
import net.dmulloy2.handlers.LogHandler; //导入方法依赖的package包/类
@Override
public boolean sendMessage(Player player, ChatPosition position, BaseComponent... message)
{
try
{
Object component = serialize.invoke(null, ComponentSerializer.toString(message));
Object packet = packetConstructor.newInstance(component, position.getValue());
Method getHandle = player.getClass().getMethod("getHandle");
Object entityPlayer = getHandle.invoke(player);
Object playerConnection = connectionField.get(entityPlayer);
sendPacket.invoke(playerConnection, packet);
return true;
}
catch (Throwable ex)
{
LogHandler.globalDebug(Util.getUsefulStack(ex, "sending chat packet to {0}", player.getName()));
return false;
}
}
示例2: getMinecraftClass
import net.dmulloy2.handlers.LogHandler; //导入方法依赖的package包/类
private static Class<?> getMinecraftClass(String name)
{
initialize();
try
{
return Class.forName(NMS + name);
}
catch (Throwable ex)
{
LogHandler.globalDebug("Could not find Minecraft class {0}", NMS + name);
return null;
}
}
示例3: sendMessage
import net.dmulloy2.handlers.LogHandler; //导入方法依赖的package包/类
@Override
public boolean sendMessage(Player player, ChatPosition position, BaseComponent... message)
{
try
{
PacketContainer packet = manager.createPacket(PacketType.Play.Server.CHAT);
// Write our message to the packet
WrappedChatComponent component = WrappedChatComponent.fromJson(ComponentSerializer.toString(message));
packet.getChatComponents().write(0, component);
// Nullify Spigot's components
packet.getModifier().write(1, null);
// Write the position
packet.getBytes().write(0, position != null ? position.getValue() : 1);
// Send the packet
manager.sendServerPacket(player, packet);
return true;
}
catch (Throwable ex)
{
LogHandler.globalDebug(Util.getUsefulStack(ex, "sending chat packet to {0}", player.getName()));
return false;
}
}