本文整理匯總了Java中cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java TickEvent.ClientTickEvent方法的具體用法?Java TickEvent.ClientTickEvent怎麽用?Java TickEvent.ClientTickEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cpw.mods.fml.common.gameevent.TickEvent
的用法示例。
在下文中一共展示了TickEvent.ClientTickEvent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onClientTick
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
if (Minecraft.getMinecraft().theWorld == null && !nowPlaying.isEmpty()) {
stop();
return;
}
boolean currentState = false;
if (Minecraft.getMinecraft().isGamePaused()) {
currentState = true;
}
if (currentState && !gamePause) {
pause();
gamePause = true;
} else if (!currentState && gamePause) {
resume();
gamePause = false;
}
}
示例2: onClientTickEvent
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
@SuppressWarnings("unused")
public void onClientTickEvent(TickEvent.ClientTickEvent clientTickEvent)
{
if(clientTickEvent.phase != TickEvent.Phase.END) return;
if ((++tickCount % 100) == 0)
{
// stuff to do once every second
MCInformation.gatherInformation();
}
if (tickCount == Integer.MAX_VALUE || tickCount < 0) tickCount = 0;
SoundHandler.soundTick();
MCInformation.gatherTick();
//other stuff
}
示例3: clientTick
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void clientTick(TickEvent.ClientTickEvent event) {
if (event.phase == TickEvent.Phase.START) {
brightness += brightnessStep;
if (brightness >= brightnessMaximum)
brightnessStep = -0.01F;
else if (brightness <= brightnessMinimum)
brightnessStep = 0.01F;
scaler += brightnessStep;
if (scaler >= 1F)
brightnessStep = -0.01F;
else if (scaler <= 0F)
brightnessStep = 0.01F;
}
}
示例4: onClientTick
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
@SideOnly(CLIENT)
public void onClientTick(TickEvent.ClientTickEvent event) {
if (event.phase == TickEvent.Phase.END && Minecraft.getMinecraft().thePlayer != null) {
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if (this.needsUpdate) {
if (!this.version.isEmpty() && this.doneTelling) {
player.addChatComponentMessage(new ChatComponentText(String.format(translate("message.lomlib.updateMessage"), this.modname, this.downloadURL)));
player.addChatComponentMessage(new ChatComponentText(translate("message.lomlib.updateChangeLog")));
for (String change : changeList)
player.addChatComponentMessage(new ChatComponentText("- " + change));
if (!Loader.isModLoaded("VersionChecker")) {
player.addChatComponentMessage(new ChatComponentText(String.format(translate("message.lomlib.updateDownloadP1"), this.modid)));
player.addChatComponentMessage(new ChatComponentText(translate("message.lomlib.updateDownloadP2")));
}
this.doneTelling = true;
}
}
}
}
示例5: onTick
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onTick(TickEvent.ClientTickEvent event) {
if (event.phase == TickEvent.Phase.START) {
if (!zoomComplete) {
zoomTimer++;
}
boolean prevZoom = zoom;
zoom = mc.theWorld != null && mc.thePlayer != null && mc.objectMouseOver != null && mc.objectMouseOver.typeOfHit == MovingObjectType.BLOCK && mc.theWorld.getBlock(mc.objectMouseOver.blockX, mc.objectMouseOver.blockY, mc.objectMouseOver.blockZ) instanceof BlockPumpkin && mc.thePlayer.getHeldItem() != null && mc.thePlayer.getHeldItem().getItem() == Items.shears;
if (zoom != prevZoom) {
if (zoom && zoomComplete) {
defaultSens = mc.gameSettings.mouseSensitivity;
}
zoomComplete = false;
if (zoomTimer > 0) {
zoomTimer = 10 - zoomTimer;
}
}
}
}
示例6: clientTick
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void clientTick(TickEvent.ClientTickEvent clientTickEvent) {
if (clientTickEvent.phase == TickEvent.Phase.END) {
boolean isSpacePressed = Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed();
boolean isFirePressed = fireBinding.getIsKeyPressed();
boolean isCtrlPressed = accelerationBinding.getIsKeyPressed();
if (lastSpace != isSpacePressed || lastCtrl != isCtrlPressed
|| lastFire != isFirePressed) {
lastSpace = isSpacePressed;
lastCtrl = isCtrlPressed;
lastFire = isFirePressed;
//EAPacketHandler_old.sendKeyUpdatePacket(isCtrlPressed,
// isSpacePressed, isFirePressed);
PacketKeyUpdate.issue(isCtrlPressed, isSpacePressed, isFirePressed);
}
TickUtil.CLIENT_TICKER++;
}
}
示例7: tickEvent
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void tickEvent(TickEvent.ClientTickEvent event)
{
if (!Config.getInstance().isSivIntegration())
return;
guiServerInfo.doTick();
if (!((Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) || Keyboard.isKeyDown(Keyboard.KEY_RCONTROL)) && Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getIsKeyPressed()) || Minecraft.getMinecraft().isIntegratedServerRunning() || !guiServerInfo.getIsPlayerOpped())
{
return;
}
try
{
if (ticks == 0)
{
ticks = 40;
//Update
if (CreeperHost.instance.getQueryGetter() != null)
{
CreeperHost.instance.getQueryGetter().run();
}
}
ticks--;
}
catch (Throwable t)
{
// Catch _ALL_ errors. We should _NEVER_ crash.
}
}
示例8: client
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void client(final TickEvent.ClientTickEvent server) {
synchronized (ThreadSafeExecution.clientCallable) {
for (final IDelayCallable iDelayCallable : ThreadSafeExecution.clientCallable) {
try {
iDelayCallable.call();
}
catch (Exception e) {
new RuntimeException("Network code failed on Client: " + e.toString(), e).printStackTrace();
}
}
ThreadSafeExecution.clientCallable.clear();
}
}
示例9: clientTick
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void clientTick(TickEvent.ClientTickEvent event)
{
World world = Minecraft.getMinecraft().theWorld;
if (worldMap.containsKey(world))
if (event.phase == TickEvent.Phase.START)
preTick(world);
else
postTick(world);
}
示例10: tickEvent
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void tickEvent(TickEvent.ClientTickEvent event) {
if(event.phase == Phase.END)
return;
Minecraft mc = Minecraft.getMinecraft();
if(mc.theWorld != null) {
loadWorld(mc.theWorld, false);
if (!NEIClientConfig.isEnabled())
return;
KeyManager.tickKeyStates();
NEIController.updateUnlimitedItems(mc.thePlayer.inventory);
if (mc.currentScreen == null)
NEIController.processCreativeCycling(mc.thePlayer.inventory);
updateMagnetMode(mc.theWorld, mc.thePlayer);
}
GuiScreen gui = mc.currentScreen;
if (gui != lastGui) {
if (gui instanceof GuiMainMenu)
lastworld = null;
else if (gui instanceof GuiSelectWorld)
NEIClientConfig.reloadSaves();
}
lastGui = gui;
}
示例11: clientTick
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void clientTick(TickEvent.ClientTickEvent event) {
if(event.phase == Phase.END) {
CCUpdateChecker.tick();
renderTime++;
}
}
示例12: onTick
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {
if (event.phase == TickEvent.Phase.END && ClientTickHandler.shouldRenderReload) {
Minecraft.getMinecraft().renderGlobal.loadRenderers();
ClientTickHandler.shouldRenderReload = false;
}
}
示例13: clientTick
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void clientTick(TickEvent.ClientTickEvent tickEvent){
SparksSystem.updateAll();
if(Config.registerDecorativeCable){
Minecraft minecraft = Minecraft.getMinecraft();
if(minecraft.thePlayer != null){
ItemStack itemStack = Minecraft.getMinecraft().thePlayer.getCurrentEquippedItem();
EntityPlayer player = minecraft.thePlayer;
if(itemStack != null){
if(itemStack.getItem() == ot.item.Items.wrench && !detectWrench){
CommonProxy.isWrench = !CommonProxy.isWrench;
detectWrench = true;
CommonProxy.isWrench = true;
Blocks.cableDecor.setLightOpacity(0);
minecraft.renderGlobal.markBlockForRenderUpdate((int)player.posX, (int)player.posY, (int)player.posZ);
}else if(itemStack.getItem() != ot.item.Items.wrench){
CommonProxy.isWrench = false;
detectWrench = false;
Blocks.cableDecor.setLightOpacity(255);
minecraft.renderGlobal.markBlockForRenderUpdate((int)player.posX, (int)player.posY, (int)player.posZ);
}
}else if(detectWrench && CommonProxy.isWrench){
CommonProxy.isWrench = false;
detectWrench = false;
Blocks.cableDecor.setLightOpacity(255);
minecraft.renderGlobal.markBlockForRenderUpdate((int)player.posX, (int)player.posY, (int)player.posZ);
}
}
}
}
示例14: onClientTick
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
Minecraft mc = Minecraft.getMinecraft();
// If no client world we're not playing. Abort.
if (mc.theWorld == null) return;
// We don't want to tick twice per tick loop. Just once. We chose to tick at the start of the tick loop.
if (event.phase != TickEvent.Phase.START) return;
// Every now and then we want to check to see if there are frame buffers we could free
if (++this.tickcounter % 200 == 0) ProxyWorldManager.detectFreedWorldViews();
// Handle whenever the client world has changed since we last looked
if (mc.theWorld != previousWorld) {
// We need to handle the removal of the old world. Particularly, the player will still be visible in it.
// We may consider replacing the old client world with a new proxy world.
if (previousWorld != null) previousWorld.removeAllEntities(); //TODO: This is hardly an ideal solution (It also doesn't seem to work well)
previousWorld = mc.theWorld; // At this point we can safely assert that the client world has changed
// We let our local world manager know that the client world changed.
ProxyWorldManager.handleWorldChange(mc.theWorld);
}
// Tick loop for our own worlds.
WorldClient worldBackup = mc.theWorld;
for (WorldClient proxyworld : ProxyWorldManager.getProxyworlds()) {
if (proxyworld.lastLightningBolt > 0) --proxyworld.lastLightningBolt;
if (worldBackup == proxyworld) continue; // This prevents us from double ticking the client world.
try {
mc.theWorld = proxyworld;
//TODO: relays for views (renderGlobal and effectRenderer) (See ProxyWorld.makeFireworks ln23)
proxyworld.tick();
} catch (Exception e) {
LoggerUtils.error("Client Proxy Dim had error while ticking: %s", e.getLocalizedMessage());
e.printStackTrace(printstream);
}
}
mc.theWorld = worldBackup;
}
示例15: onTickEvent
import cpw.mods.fml.common.gameevent.TickEvent; //導入方法依賴的package包/類
@SubscribeEvent
public void onTickEvent(TickEvent.ClientTickEvent event) {
if (this.pendingRefreshTicks > 0) {
this.pendingRefreshTicks--;
if (this.pendingRefreshTicks == 0 && Minecraft.getMinecraft().inGameHasFocus) {
this.sendPermissionQueries();
return;
}
}
for (Map.Entry<String, ServerPermissions> modPermissions : this.serverPermissions.entrySet()) {
if (!modPermissions.getValue().isValid()) {
modPermissions.getValue().notifyRefreshPending();
this.sendPermissionQuery(this.registeredClientMods.get(modPermissions.getKey()));
}
}
if (Minecraft.getMinecraft().inGameHasFocus) {
this.menuTicks = 0;
} else {
this.menuTicks++;
}
if (this.menuTicks == 200) {
this.clearServerPermissions();
}
}