当前位置: 首页>>代码示例>>Java>>正文


Java Minecraft.getSystemTime方法代码示例

本文整理汇总了Java中net.minecraft.client.Minecraft.getSystemTime方法的典型用法代码示例。如果您正苦于以下问题:Java Minecraft.getSystemTime方法的具体用法?Java Minecraft.getSystemTime怎么用?Java Minecraft.getSystemTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.Minecraft的用法示例。


在下文中一共展示了Minecraft.getSystemTime方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: drawEntry

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public void drawEntry(int slotIndex, int x, int y, int listWidth, int slotHeight, int mouseX, int mouseY, boolean isSelected)
{
    int i = y + slotHeight / 2 - this.mc.fontRendererObj.FONT_HEIGHT / 2;
    this.mc.fontRendererObj.drawString(I18n.format("lanServer.scanning", new Object[0]), this.mc.currentScreen.width / 2 - this.mc.fontRendererObj.getStringWidth(I18n.format("lanServer.scanning", new Object[0])) / 2, i, 16777215);
    String s;

    switch ((int)(Minecraft.getSystemTime() / 300L % 4L))
    {
        case 0:
        default:
            s = "O o o";
            break;

        case 1:
        case 3:
            s = "o O o";
            break;

        case 2:
            s = "o o O";
    }

    this.mc.fontRendererObj.drawString(s, this.mc.currentScreen.width / 2 - this.mc.fontRendererObj.getStringWidth(s) / 2, i + this.mc.fontRendererObj.FONT_HEIGHT, 8421504);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:25,代码来源:ServerListEntryLanScan.java

示例2: onMouseScroll

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public void onMouseScroll(int p_175259_1_)
{
    int i;

    for (i = this.menu.getSelectedSlot() + p_175259_1_; i >= 0 && i <= 8 && (this.menu.getItem(i) == SpectatorMenu.EMPTY_SLOT || !this.menu.getItem(i).isEnabled()); i += p_175259_1_)
    {
        ;
    }

    if (i >= 0 && i <= 8)
    {
        this.menu.selectSlot(i);
        this.lastSelectionTime = Minecraft.getSystemTime();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:16,代码来源:GuiSpectator.java

示例3: mousePressed

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
/**
 * Returns true if the mouse has been pressed on this control.
 */
public boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_)
{
    this.field_148292_c.selectServer(slotIndex);

    if (Minecraft.getSystemTime() - this.field_148290_d < 250L)
    {
        this.field_148292_c.connectToSelected();
    }

    this.field_148290_d = Minecraft.getSystemTime();
    return false;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:16,代码来源:ServerListEntryLanDetected.java

示例4: keyTyped

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
/**
 * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of
 * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
 */
protected void keyTyped(char typedChar, int keyCode) throws IOException
{
    if (this.buttonId != null)
    {
        if (keyCode == 1)
        {
            this.options.setOptionKeyBinding(this.buttonId, 0);
        }
        else if (keyCode != 0)
        {
            this.options.setOptionKeyBinding(this.buttonId, keyCode);
        }
        else if (typedChar > 0)
        {
            this.options.setOptionKeyBinding(this.buttonId, typedChar + 256);
        }

        this.buttonId = null;
        this.time = Minecraft.getSystemTime();
        KeyBinding.resetKeyBindingArrayAndHash();
    }
    else
    {
        super.keyTyped(typedChar, keyCode);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:31,代码来源:GuiControls.java

示例5: mousePressed

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
/**
 * Returns true if the mouse has been pressed on this control.
 */
public boolean mousePressed(int slotIndex, int p_148278_2_, int p_148278_3_, int p_148278_4_, int p_148278_5_, int p_148278_6_)
{
    if (p_148278_5_ <= 32)
    {
        if (p_148278_5_ < 32 && p_148278_5_ > 16 && this.func_178013_b())
        {
            this.field_148303_c.selectServer(slotIndex);
            this.field_148303_c.connectToSelected();
            return true;
        }

        if (p_148278_5_ < 16 && p_148278_6_ < 16 && this.field_148303_c.func_175392_a(this, slotIndex))
        {
            this.field_148303_c.func_175391_a(this, slotIndex, GuiScreen.isShiftKeyDown());
            return true;
        }

        if (p_148278_5_ < 16 && p_148278_6_ > 16 && this.field_148303_c.func_175394_b(this, slotIndex))
        {
            this.field_148303_c.func_175393_b(this, slotIndex, GuiScreen.isShiftKeyDown());
            return true;
        }
    }

    this.field_148303_c.selectServer(slotIndex);

    if (Minecraft.getSystemTime() - this.field_148298_f < 250L)
    {
        this.field_148303_c.connectToSelected();
    }

    this.field_148298_f = Minecraft.getSystemTime();
    return false;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:38,代码来源:ServerListEntryNormal.java

示例6: updatePlayerList

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
/**
 * Called by GuiIngame to update the information stored in the playerlist, does not actually render the list,
 * however.
 */
public void updatePlayerList(boolean willBeRendered)
{
    if (willBeRendered && !this.isBeingRendered)
    {
        this.lastTimeOpened = Minecraft.getSystemTime();
    }

    this.isBeingRendered = willBeRendered;
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:14,代码来源:GuiPlayerTabOverlay.java

示例7: renderEffect

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
private void renderEffect(IBakedModel model)
{
    GlStateManager.depthMask(false);
    GlStateManager.depthFunc(514);
    GlStateManager.disableLighting();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_COLOR, GlStateManager.DestFactor.ONE);
    this.textureManager.bindTexture(RES_ITEM_GLINT);
    GlStateManager.matrixMode(5890);
    GlStateManager.pushMatrix();
    GlStateManager.scale(8.0F, 8.0F, 8.0F);
    float f = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F / 8.0F;
    GlStateManager.translate(f, 0.0F, 0.0F);
    GlStateManager.rotate(-50.0F, 0.0F, 0.0F, 1.0F);
    this.renderModel(model, -8372020);
    GlStateManager.popMatrix();
    GlStateManager.pushMatrix();
    GlStateManager.scale(8.0F, 8.0F, 8.0F);
    float f1 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F / 8.0F;
    GlStateManager.translate(-f1, 0.0F, 0.0F);
    GlStateManager.rotate(10.0F, 0.0F, 0.0F, 1.0F);
    this.renderModel(model, -8372020);
    GlStateManager.popMatrix();
    GlStateManager.matrixMode(5888);
    GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
    GlStateManager.enableLighting();
    GlStateManager.depthFunc(515);
    GlStateManager.depthMask(true);
    this.textureManager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:RenderItem.java

示例8: onMouseInputEvent

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
@SubscribeEvent
public void onMouseInputEvent(InputEvent e) {
    if (Minecraft.getMinecraft().gameSettings.keyBindPickBlock.isKeyDown() && Minecraft.getSystemTime() - lastPickBlock > PICK_BLOCK_DELAY) {
        lastPickBlock = Minecraft.getSystemTime();

        RSAddons.INSTANCE.network.sendToServer(new MessagePickBlock());
    }
}
 
开发者ID:raoulvdberge,项目名称:refinedstorageaddons,代码行数:9,代码来源:ProxyClient.java

示例9: mousePressed

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
/**
 * Called when the mouse is clicked within this entry. Returning true means that something within this entry was
 * clicked and the list should not be dragged.
 */
public boolean mousePressed(int slotIndex, int mouseX, int mouseY, int mouseEvent, int relativeX, int relativeY)
{
    this.screen.selectServer(slotIndex);

    if (Minecraft.getSystemTime() - this.lastClickTime < 250L)
    {
        this.screen.connectToSelected();
    }

    this.lastClickTime = Minecraft.getSystemTime();
    return false;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:17,代码来源:ServerListEntryLanDetected.java

示例10: updateLastSeen

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
/**
 * Updates the time this LanServer was last seen.
 */
public void updateLastSeen()
{
    this.timeLastSeen = Minecraft.getSystemTime();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:LanServerInfo.java

示例11: updateTimer

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
/**
 * Updates all fields of the Timer using the current time
 */
public void updateTimer()
{
    long i = Minecraft.getSystemTime();
    long j = i - this.lastSyncSysClock;
    long k = System.nanoTime() / 1000000L;
    double d0 = (double)k / 1000.0D;

    if (j <= 1000L && j >= 0L)
    {
        this.counter += j;

        if (this.counter > 1000L)
        {
            long l = k - this.lastSyncHRClock;
            double d1 = (double)this.counter / (double)l;
            this.timeSyncAdjustment += (d1 - this.timeSyncAdjustment) * 0.20000000298023224D;
            this.lastSyncHRClock = k;
            this.counter = 0L;
        }

        if (this.counter < 0L)
        {
            this.lastSyncHRClock = k;
        }
    }
    else
    {
        this.lastHRTime = d0;
    }

    this.lastSyncSysClock = i;
    double d2 = (d0 - this.lastHRTime) * this.timeSyncAdjustment;
    this.lastHRTime = d0;
    d2 = MathHelper.clamp_double(d2, 0.0D, 1.0D);
    this.elapsedPartialTicks = (float)((double)this.elapsedPartialTicks + d2 * (double)this.timerSpeed * (double)this.ticksPerSecond);
    this.elapsedTicks = (int)this.elapsedPartialTicks;
    this.elapsedPartialTicks -= (float)this.elapsedTicks;

    if (this.elapsedTicks > 10)
    {
        this.elapsedTicks = 10;
    }

    this.renderPartialTicks = this.elapsedPartialTicks;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:49,代码来源:Timer.java

示例12: Timer

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public Timer(float p_i1018_1_)
{
    this.ticksPerSecond = p_i1018_1_;
    this.lastSyncSysClock = Minecraft.getSystemTime();
    this.lastSyncHRClock = System.nanoTime() / 1000000L;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:7,代码来源:Timer.java

示例13: getHotbarAlpha

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
private float getHotbarAlpha()
{
    long i = this.lastSelectionTime - Minecraft.getSystemTime() + 5000L;
    return MathHelper.clamp((float)i / 2000.0F, 0.0F, 1.0F);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:GuiSpectator.java

示例14: updateAchievementWindow

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
public void updateAchievementWindow()
{
    if (this.theAchievement != null && this.notificationTime != 0L && Minecraft.getMinecraft().thePlayer != null)
    {
        double d0 = (double)(Minecraft.getSystemTime() - this.notificationTime) / 3000.0D;

        if (this.permanentNotification)
        {
            if (d0 > 0.5D)
            {
                d0 = 0.5D;
            }
        }
        else if (d0 < 0.0D || d0 > 1.0D)
        {
            this.notificationTime = 0L;
            return;
        }

        this.updateAchievementWindowScale();
        GlStateManager.disableDepth();
        GlStateManager.depthMask(false);
        double d1 = d0 * 2.0D;

        if (d1 > 1.0D)
        {
            d1 = 2.0D - d1;
        }

        d1 = d1 * 4.0D;
        d1 = 1.0D - d1;

        if (d1 < 0.0D)
        {
            d1 = 0.0D;
        }

        d1 = d1 * d1;
        d1 = d1 * d1;
        int i = this.width - 160;
        int j = 0 - (int)(d1 * 36.0D);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.enableTexture2D();
        this.mc.getTextureManager().bindTexture(ACHIEVEMENT_BG);
        GlStateManager.disableLighting();
        this.drawTexturedModalRect(i, j, 96, 202, 160, 32);

        if (this.permanentNotification)
        {
            this.mc.fontRendererObj.drawSplitString(this.achievementDescription, i + 30, j + 7, 120, -1);
        }
        else
        {
            this.mc.fontRendererObj.drawString(this.achievementTitle, i + 30, j + 7, -256);
            this.mc.fontRendererObj.drawString(this.achievementDescription, i + 30, j + 18, -1);
        }

        RenderHelper.enableGUIStandardItemLighting();
        GlStateManager.disableLighting();
        GlStateManager.enableRescaleNormal();
        GlStateManager.enableColorMaterial();
        GlStateManager.enableLighting();
        this.renderItem.renderItemAndEffectIntoGUI(this.theAchievement.theItemStack, i + 8, j + 8);
        GlStateManager.disableLighting();
        GlStateManager.depthMask(true);
        GlStateManager.enableDepth();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:69,代码来源:GuiAchievement.java

示例15: mouseClickMove

import net.minecraft.client.Minecraft; //导入方法依赖的package包/类
/**
 * Called when a mouse button is pressed and the mouse is moved around. Parameters are : mouseX, mouseY,
 * lastButtonClicked & timeSinceMouseClick.
 */
protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick)
{
    Slot slot = this.getSlotAtPosition(mouseX, mouseY);
    ItemStack itemstack = this.mc.player.inventory.getItemStack();

    if (this.clickedSlot != null && this.mc.gameSettings.touchscreen)
    {
        if (clickedMouseButton == 0 || clickedMouseButton == 1)
        {
            if (this.draggedStack.func_190926_b())
            {
                if (slot != this.clickedSlot && !this.clickedSlot.getStack().func_190926_b())
                {
                    this.draggedStack = this.clickedSlot.getStack().copy();
                }
            }
            else if (this.draggedStack.func_190916_E() > 1 && slot != null && Container.canAddItemToSlot(slot, this.draggedStack, false))
            {
                long i = Minecraft.getSystemTime();

                if (this.currentDragTargetSlot == slot)
                {
                    if (i - this.dragItemDropDelay > 500L)
                    {
                        this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, ClickType.PICKUP);
                        this.handleMouseClick(slot, slot.slotNumber, 1, ClickType.PICKUP);
                        this.handleMouseClick(this.clickedSlot, this.clickedSlot.slotNumber, 0, ClickType.PICKUP);
                        this.dragItemDropDelay = i + 750L;
                        this.draggedStack.func_190918_g(1);
                    }
                }
                else
                {
                    this.currentDragTargetSlot = slot;
                    this.dragItemDropDelay = i;
                }
            }
        }
    }
    else if (this.dragSplitting && slot != null && !itemstack.func_190926_b() && (itemstack.func_190916_E() > this.dragSplittingSlots.size() || this.dragSplittingLimit == 2) && Container.canAddItemToSlot(slot, itemstack, true) && slot.isItemValid(itemstack) && this.inventorySlots.canDragIntoSlot(slot))
    {
        this.dragSplittingSlots.add(slot);
        this.updateDragSplitting();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:50,代码来源:GuiContainer.java


注:本文中的net.minecraft.client.Minecraft.getSystemTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。