本文整理汇总了Java中net.wurstclient.bot.WurstBot类的典型用法代码示例。如果您正苦于以下问题:Java WurstBot类的具体用法?Java WurstBot怎么用?Java WurstBot使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WurstBot类属于net.wurstclient.bot包,在下文中一共展示了WurstBot类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getProtocolVersion
import net.wurstclient.bot.WurstBot; //导入依赖的package包/类
public static int getProtocolVersion()
{
if(WurstClient.INSTANCE.options.mc112x_compatibility == 2)
return 340;
else if(WurstClient.INSTANCE.options.mc112x_compatibility == 1)
return 338;
NavigableMap<Integer, String> protocols = WMinecraft.PROTOCOLS;
// use default if using Wurst-Bot
if(WurstBot.isEnabled())
return protocols.lastKey();
ServerData server = lastServer.getServerData();
// use default if ping failed
if(!server.pinged || server.pingToServer < 0)
return protocols.lastKey();
// use default if server protocol is not supported
if(!protocols.containsKey(server.version))
return protocols.lastKey();
// use server protocol
return server.version;
}
示例2: createFrame
import net.wurstclient.bot.WurstBot; //导入依赖的package包/类
public static void createFrame(DefaultResourcePack mcDefaultResourcePack,
Logger logger) throws LWJGLException
{
// check if frame should be created
if(!isAutoMaximize() && !WurstBot.isEnabled())
return;
// create frame
frame = new JFrame("Minecraft " + WMinecraft.DISPLAY_VERSION);
// add LWJGL
Canvas canvas = new Canvas();
canvas.setBackground(new Color(16, 16, 16));
Display.setParent(canvas);
Minecraft mc = Minecraft.getMinecraft();
canvas.setSize(mc.displayWidth, mc.displayHeight);
frame.add(canvas);
// configure frame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setLocationRelativeTo(null);
// add icons
InputStream icon16 = null;
InputStream icon32 = null;
try
{
icon16 = mcDefaultResourcePack.getInputStreamAssets(
new ResourceLocation("icons/icon_16x16.png"));
icon32 = mcDefaultResourcePack.getInputStreamAssets(
new ResourceLocation("icons/icon_32x32.png"));
ArrayList<BufferedImage> icons = new ArrayList<>();
icons.add(ImageIO.read(icon16));
icons.add(ImageIO.read(icon32));
frame.setIconImages(icons);
}catch(Exception e)
{
logger.error("Couldn't set icon", e);
}finally
{
IOUtils.closeQuietly(icon16);
IOUtils.closeQuietly(icon32);
}
// show frame
if(!WurstBot.isEnabled())
frame.setVisible(true);
}
示例3: getProtocolVersion
import net.wurstclient.bot.WurstBot; //导入依赖的package包/类
public static int getProtocolVersion()
{
NavigableMap<Integer, String> protocols = WMinecraft.PROTOCOLS;
// use default if using Wurst-Bot
if(WurstBot.isEnabled())
return protocols.lastKey();
ServerData server = lastServer.getServerData();
// use default if ping failed
if(!server.pinged || server.pingToServer < 0)
return protocols.lastKey();
// use default if server protocol is not supported
if(!protocols.containsKey(server.version))
return protocols.lastKey();
// use server protocol
return server.version;
}
示例4: shouldTrack
import net.wurstclient.bot.WurstBot; //导入依赖的package包/类
private boolean shouldTrack()
{
return WurstClient.INSTANCE.options.google_analytics.enabled
&& !WurstBot.isEnabled();
}