本文整理汇总了Java中net.minecraftforge.fml.common.gameevent.TickEvent.ClientTickEvent方法的典型用法代码示例。如果您正苦于以下问题:Java TickEvent.ClientTickEvent方法的具体用法?Java TickEvent.ClientTickEvent怎么用?Java TickEvent.ClientTickEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.fml.common.gameevent.TickEvent
的用法示例。
在下文中一共展示了TickEvent.ClientTickEvent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tickEnd
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void tickEnd(TickEvent.ClientTickEvent event) {
if (event.phase == TickEvent.Phase.END) {
if (Minecraft.getMinecraft().player == null) {
for (IUpgradeRenderHandler handler : UpgradeRenderHandlerList.instance().upgradeRenderers) {
handler.reset();
}
}
TICKS++;
ModuleRegulatorTube.hasTicked = false;
ModuleRegulatorTube.inverted = false;
ModuleRegulatorTube.inLine = true;
for (int i = 0; i < updatedObjects.size(); i++) {
INeedTickUpdate updatedObject = updatedObjects.get(i).get();
if (updatedObject != null) {
updatedObject.update();
} else {
updatedObjects.remove(i);
i--;
}
}
}
}
示例2: onClientTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event)
{
if(event.phase == TickEvent.Phase.END)
{
Minecraft mc = Minecraft.getMinecraft();
if(!mc.isGamePaused())
{
Iterator<Track> ite = tracksPlaying.iterator();
while(ite.hasNext())
{
Track track = ite.next();
if(!track.update())
{
ite.remove();
continue;
}
}
}
}
}
示例3: onClientTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
//check if the player is really riding a entity
if (MC.player != null && MC.player.getRidingEntity() != null) {
ForgeHaxHooks.isNoClampingActivated = noClamp.getAsBoolean();
ForgeHaxHooks.isNoBoatGravityActivated = noGravity.getAsBoolean();
ForgeHaxHooks.isBoatSetYawActivated = setYaw.getAsBoolean();
if (MC.gameSettings.keyBindJump.isKeyDown()) {
//trick the riding entity to think its onground
MC.player.getRidingEntity().onGround = false;
//teleport up
MC.player.getRidingEntity().motionY = MC.gameSettings.keyBindSprint.isKeyDown() ? 5 : 1.5;
} else {
MC.player.getRidingEntity().motionY = MC.gameSettings.keyBindSprint.isKeyDown() ? -1.0 : -speedY.getAsDouble();
}
/*if ((MC.player.posY <= maintainY.getAsDouble()-5D) && (MC.player.posY > maintainY.getAsDouble()-10D) && maintainY.getAsDouble() != 0D)
MC.player.getRidingEntity().setPositionAndUpdate(MC.player.posX, maintainY.getAsDouble(), MC.player.posZ );*/
setMoveSpeedEntity(speed.getAsDouble());
}
}
示例4: onClientTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent ev)
{
if (this.missionIsRunning)
{
// Use the client tick to fire messages to the server to request up-to-date stats.
// We can then use those stats to fire back to the agent in writeObservationsToJSON.
ObservationRequestMessage message = createObservationRequestMessage();
// To make sure only the intended listener receives this message, set the id now:
message.id = System.identityHashCode(this);
MalmoMod.network.sendToServer(message);
}
}
示例5: onClientTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public static void onClientTick(TickEvent.ClientTickEvent event)
{
if (Minecraft.getMinecraft().world != null && Minecraft.getMinecraft().world.provider != null && Minecraft.getMinecraft().world.provider.getDimension() == 0)
{
if (SettingsClient.instance.enableCustomRain || SettingsClient.instance.enableCustomRain)
{
if (!(Minecraft.getMinecraft().world.provider.getSkyRenderer() instanceof WorldSkyRenderer))
{
if (SettingsClient.instance.enableCustomSky)
{
Minecraft.getMinecraft().world.provider.setSkyRenderer(WorldSkyRenderer.getInstance());
}
if (SettingsClient.instance.enableCustomRain)
{
Minecraft.getMinecraft().world.provider.setWeatherRenderer(WorldWeatherRenderer.getInstance());
}
}
}
}
if (Minecraft.getMinecraft().world != null && event.phase == TickEvent.Phase.START)
{
ExPMisc.defaultParticleEngineImpl.tick();
}
}
示例6: clientTicks
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void clientTicks(TickEvent.ClientTickEvent event) {
if (event.phase != TickEvent.Phase.START) return;
i++;
if (watchDog != null) {
// Pat Lagssie
watchDog.ticks++;
} else if (i == 40) {
watchDog = new LagssieWatchDog("LAG-CLIENT", Thread.currentThread(), Lagssie.intervalClient);
watchDog.start();
}
}
示例7: onWorldTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onWorldTick(TickEvent.ClientTickEvent event)
{
Minecraft mc = Minecraft.getMinecraft();
if(event.phase == TickEvent.Phase.END && mc.world != null)
{
if(firing > 0)
{
firing--;
}
}
}
示例8: tickEvent
import net.minecraftforge.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.isKeyDown()) || 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.
}
}
示例9: clientTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public static void clientTick(final TickEvent.ClientTickEvent event)
{
if (event.phase != TickEvent.Phase.END) return;
boolean currentState = OPEN_ARMOR_STAND_GUI.isKeyDown();
if (currentState != previousState)
{
VillagerInventoryMod.NETWORK.sendToServer(new EntityFlagMessage(Minecraft.getMinecraft().player, 2, currentState));
previousState = currentState;
}
}
示例10: onClientTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@Override
public void onClientTick(TickEvent.ClientTickEvent ev)
{
// Check to see whether anything has caused us to abort - if so, go to the abort state.
if (inAbortState())
episodeHasCompleted(ClientState.MISSION_ABORTED);
// We need to make sure that both the client and server have paused,
// otherwise we are still susceptible to the "Holder Lookups" hang.
// Since the server sets its pause state in response to the client's pause state,
// and it only performs this check once, at the top of its tick method,
// to be sure that the server has had time to set the flag correctly we need to make sure
// that at least one server tick method has *started* since the flag was set.
// We can't do this by catching the onServerTick events, since we don't receive them when the game is paused.
// The following code makes use of the fact that the server both locks and empties the server's futureQueue,
// every time through the server tick method.
// This locking means that if the client - which needs to wait on the lock -
// tries to add an event to the queue in response to an event on the queue being executed,
// the newly added event will have to happen in a subsequent tick.
if (Minecraft.getMinecraft().isGamePaused() && ev != null && ev.phase == Phase.END && this.clientTickCount == this.serverTickCount && this.clientTickCount <= 2)
{
this.clientTickCount++; // Increment our count, and wait for the server to catch up.
Minecraft.getMinecraft().getIntegratedServer().addScheduledTask(new Runnable()
{
public void run()
{
// Increment the server count.
PauseOldServerEpisode.this.serverTickCount++;
}
});
}
if (this.serverTickCount > 2)
episodeHasCompleted(ClientState.CLOSING_OLD_SERVER);
}
示例11: onTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.HIGHEST)
public void onTick(TickEvent.ClientTickEvent event){
if (event.side == Side.CLIENT && event.phase == TickEvent.Phase.START){
ClientProxy.particleRenderer.updateParticles();
}
}
示例12: renderTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public static void renderTick(TickEvent.ClientTickEvent event)
{
if(gui != null && Minecraft.getMinecraft().world != null)
{
gui.update();
}
}
示例13: clientTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.LOWEST)
public void clientTick(TickEvent.ClientTickEvent e) {
Replace();
}
示例14: onClientTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event) {
MinecraftForge.EVENT_BUS.unregister(this);
Minecraft.getMinecraft().displayGuiScreen(this);
}
示例15: onClientTick
import net.minecraftforge.fml.common.gameevent.TickEvent; //导入方法依赖的package包/类
@SubscribeEvent
public void onClientTick(TickEvent.ClientTickEvent event)
{
if(event.phase == TickEvent.Phase.END)
{
Minecraft mc = Minecraft.getMinecraft();
if(mc.world != null)
{
if(!clickedPos.equals(BlockPos.ORIGIN))
{
TileEntity te = mc.world.getTileEntity(clickedPos);
if(te instanceof TileEntityGlassBase && ((TileEntityGlassBase)te).active && mc.playerController.getIsHittingBlock())
{
TileEntityGlassBase base = (TileEntityGlassBase)te;
if(base.fadeoutTime < TileEntityGlassBase.FADEOUT_TIME - TileEntityGlassBase.PROPAGATE_TIME)
{
base.fadeoutTime = TileEntityGlassBase.FADEOUT_TIME;
base.fadePropagate = TileEntityGlassBase.PROPAGATE_TIME;
base.fadeDistance = 2;
base.fadePropagate();
}
}
else
{
clickedPos = BlockPos.ORIGIN;
}
}
Iterator<Map.Entry<String, Integer>> ite = terminalPlacementCreationTimeout.entrySet().iterator();
while(ite.hasNext())
{
Map.Entry<String, Integer> e = ite.next();
e.setValue(e.getValue() - 1);
if(e.getValue() < 0)
{
ite.remove();
}
}
}
}
}