本文整理汇总了Java中cpw.mods.fml.common.gameevent.TickEvent.Type类的典型用法代码示例。如果您正苦于以下问题:Java Type类的具体用法?Java Type怎么用?Java Type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Type类属于cpw.mods.fml.common.gameevent.TickEvent包,在下文中一共展示了Type类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: RenderTickEvent
import cpw.mods.fml.common.gameevent.TickEvent.Type; //导入依赖的package包/类
@SubscribeEvent
public void RenderTickEvent(RenderTickEvent event) {
if ((event.type == Type.RENDER || event.type == Type.CLIENT) && event.phase == Phase.END) {
Minecraft mc = Minecraft.getMinecraft();
if (!ticked && mc.ingameGUI != null) {
mc.ingameGUI = new GuiAdvancedHUD(mc);
ticked = true;
}
if (firstload && mc != null) {
if (!SaveController.loadConfig("config")) {
HUDRegistry.checkForResize();
HUDRegistry.resetAllDefaults();
SaveController.saveConfig("config");
}
firstload = false;
}
// TODO Add notification on main menu when an update for advancedhud is available :)
// if (mc.currentScreen instanceof GuiMainMenu) {
// int mouseX = Mouse.getX() * mc.currentScreen.width / mc.displayWidth;
// int mouseY = mc.currentScreen.height - Mouse.getY() * mc.currentScreen.height / mc.displayHeight - 1;
// RenderAssist.drawCircle(mouseX, mouseY, 3, 24, 0xFFFFFFFF);
// RenderAssist.drawRect(1, 1, 70, 11, 0x608f3eff);
// mc.currentScreen.drawString(mc.fontRenderer, "AdvancedHUD!", 2, 2, 0x48dce9);
// }
}
}
开发者ID:maxpowa,项目名称:AdvancedHUD,代码行数:27,代码来源:TickHandler.java
示例2: canExecute
import cpw.mods.fml.common.gameevent.TickEvent.Type; //导入依赖的package包/类
@Override
public boolean canExecute(Event event) {
if (event instanceof TickEvent && ((TickEvent) event).side == Side.CLIENT && ((TickEvent) event).type == Type.PLAYER && ((TickEvent) event).phase == Phase.END) {
return ((PlayerTickEvent) event).player.worldObj.provider.dimensionId == this.dimension && ((PlayerTickEvent) event).player.getUniqueID().equals(this.playerUUID);
}
return false;
}
开发者ID:Shirkit,项目名称:CountCraft,代码行数:9,代码来源:TaskFindSameBlocksNearby.java
示例3: tick
import cpw.mods.fml.common.gameevent.TickEvent.Type; //导入依赖的package包/类
@SubscribeEvent
public void tick(TickEvent event)
{
if(event.phase == Phase.START && (event.type == Type.CLIENT || event.type == Type.SERVER))
{
for (int i = 0; i < maxPacketsPerTick; i++) {
PacketRequest request = null;
if(packetrequest.size() > 0)
request = packetrequest.get(0);
if(request != null)
{
boolean issended = false;
if(request.toServer && event.side == Side.CLIENT)
{
PacketHandler.sendPacketToServer(request.packet);
issended = true;
}else if(!request.toServer && event.side == Side.SERVER){
if(request.player == null)
PacketHandler.sendPacketToAllPlayers(request.packet);
else
PacketHandler.sendPacketToPlayer(request.packet, (EntityPlayerMP) request.player);
issended = true;
}
if(packetrequest.size() > 0 && issended)
packetrequest.remove(0);
}
}
}
}
开发者ID:CreativeMD,项目名称:CraftingManager,代码行数:31,代码来源:EventHandler.java
示例4: keyUp
import cpw.mods.fml.common.gameevent.TickEvent.Type; //导入依赖的package包/类
@Override
public void keyUp(Type types, KeyBinding kb, boolean tickEnd)
{
}
开发者ID:4Space,项目名称:4Space-5,代码行数:5,代码来源:KeyHandlerClient.java
示例5: keyDown
import cpw.mods.fml.common.gameevent.TickEvent.Type; //导入依赖的package包/类
public abstract void keyDown(Type types, KeyBinding kb, boolean tickEnd, boolean isRepeat);
开发者ID:4Space,项目名称:4Space-5,代码行数:2,代码来源:KeyHandler.java
示例6: keyUp
import cpw.mods.fml.common.gameevent.TickEvent.Type; //导入依赖的package包/类
public abstract void keyUp(Type types, KeyBinding kb, boolean tickEnd);
开发者ID:4Space,项目名称:4Space-5,代码行数:2,代码来源:KeyHandler.java
注:本文中的cpw.mods.fml.common.gameevent.TickEvent.Type类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论