net.minecraft.client.Minecraft.getSystemTime()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(11.7k)|赞(0)|评价(0)|浏览(144)

本文整理了Java中net.minecraft.client.Minecraft.getSystemTime()方法的一些代码示例,展示了Minecraft.getSystemTime()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Minecraft.getSystemTime()方法的具体详情如下:
包路径:net.minecraft.client.Minecraft
类名称:Minecraft
方法名:getSystemTime

Minecraft.getSystemTime介绍

暂无

代码示例

代码示例来源:origin: Funwayguy/BetterQuesting

public float getTime()
  {
    return (Minecraft.getSystemTime() - startTime)/1000F;
  }
}

代码示例来源:origin: Funwayguy/BetterQuesting

@Override
public Float readValue()
{
  return (float)(Minecraft.getSystemTime()%30000L / 30000D * 360D);
}

代码示例来源:origin: TeamWizardry/Wizardry

@Override
  public long read() {
    return Minecraft.getSystemTime();
  }
})

代码示例来源:origin: Funwayguy/BetterQuesting

public QuestNotice(String mainTxt, String subTxt, ItemStack icon, String sound)
{
  this.startTime = Minecraft.getSystemTime();
  this.mainTxt = mainTxt;
  this.subTxt = subTxt;
  this.icon = icon;
  this.sound = sound;
}

代码示例来源:origin: Funwayguy/BetterQuesting

@Override
public EnumQuestState getState(UUID uuid)
{
  if(qState != null)
  {
    return qState;
  }
  
  int state = (int)(Minecraft.getSystemTime()/1000)%4;
  
  switch(state)
  {
    case 0:
      return EnumQuestState.LOCKED;
    case 1:
      return EnumQuestState.UNLOCKED;
    case 2:
      return EnumQuestState.UNCLAIMED;
    case 3:
      return EnumQuestState.COMPLETED;
  }
  
  return EnumQuestState.COMPLETED;
}

代码示例来源:origin: SquidDev-CC/plethora

@SideOnly(Side.CLIENT)
  private KeyDown(int key, char character) {
    this.key = key;
    this.character = character;
    this.lastTime = Minecraft.getSystemTime();
  }
}

代码示例来源:origin: SleepyTrousers/EnderCore

@Override
public @Nonnull ItemStack getStack() {
 final NonNullList<ItemStack> stacks2 = stacks;
 if (stacks2 != null && Minecraft.getSystemTime() - lastSwitch > 1000L) {
  lastSwitch = Minecraft.getSystemTime();
  if (++idx >= stacks2.size()) {
   idx = 0;
   Collections.shuffle(stacks2);
  }
  stack = stacks2.get(idx);
 }
 return stack;
}

代码示例来源:origin: Vazkii/Botania

GlStateManager.scale(0.5F, 0.5F, 1.0F);
float f2 = (float)(j + 1);
GlStateManager.translate(17.0F / f2, (2.0F + f2 / 1.5F) * ((float)Minecraft.getSystemTime() % 800000.0F / 800000.0F), 0.0F);
GlStateManager.rotate((f2 * f2 * 4321.0F + f2 * 9.0F) * 2.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.scale(4.5F - f2 / 4.0F, 4.5F - f2 / 4.0F, 1.0F);
Color color = Color.getHSBColor(Minecraft.getSystemTime() / 20F % 360 / 360F, 1F, 1F);
f3 = color.getRed() / 255F;
f4 = color.getGreen() / 255F;

代码示例来源:origin: gegy1000/Terrarium

private boolean handleSlotClick(int localY, int clickedSlot, boolean scroll) {
  if (clickedSlot < this.getSize() && this.mouseX >= this.left && this.mouseX <= this.right && clickedSlot >= 0 && localY >= 0) {
    boolean doubleClicked = scroll && clickedSlot == this.selectedElement && Minecraft.getSystemTime() - this.lastClicked < 250L;
    this.elementClicked(clickedSlot, doubleClicked, this.mouseX, this.mouseY);
    this.selectedElement = clickedSlot;
    if (scroll) {
      this.lastClicked = Minecraft.getSystemTime();
    }
  } else if (this.mouseX >= this.left && this.mouseX <= this.right && localY < 0) {
    this.clickedHeader(this.mouseX - this.left, this.mouseY - this.top + (int) this.amountScrolled - 4);
    return false;
  }
  return true;
}

代码示例来源:origin: Lunatrius/Schematica

@Override
protected void elementClicked(final int slotIndex, final boolean isDoubleClick, final int mouseX, final int mouseY) {
  final boolean ignore = Minecraft.getSystemTime() - this.lastClick < 500;
  this.lastClick = Minecraft.getSystemTime();
  if (ignore) {
    return;
  }
  final GuiSchematicEntry schematic = this.guiSchematicLoad.schematicFiles.get(slotIndex);
  if (schematic.isDirectory()) {
    this.guiSchematicLoad.changeDirectory(schematic.getName());
    this.selectedIndex = -1;
  } else {
    this.selectedIndex = slotIndex;
  }
}

代码示例来源:origin: SleepyTrousers/EnderCore

public boolean mouseClicked(int mX, int mY, int button) {
 if (button == 0) {
  if (getScrollMax() > 0 && thumbArea.contains(mX, mY)) {
   int thumbPos = getThumbPosition();
   pressedUp = mY < thumbPos;
   pressedDown = mY >= thumbPos + EnderWidget.VSCROLL_THUMB_OFF.height;
   pressedThumb = !pressedUp && !pressedDown;
  } else {
   pressedUp = btnUp.contains(mX, mY);
   pressedDown = btnDown.contains(mX, mY);
   pressedThumb = false;
  }
  scrollDir = (pressedDown ? 1 : 0) - (pressedUp ? 1 : 0);
  if (scrollDir != 0) {
   timeNextScroll = Minecraft.getSystemTime() + 200;
   scrollBy(scrollDir);
  }
 }
 return isDragActive();
}

代码示例来源:origin: SquidDev-CC/plethora

@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onClientTick(TickEvent.ClientTickEvent event) {
  if (event.phase != TickEvent.Phase.END) return;
  for (int i = keysDown.size() - 1; i >= 0; --i) {
    KeyDown down = keysDown.get(i);
    if (Keyboard.isKeyDown(down.key)) {
      // Emulate repeat presses. We simply fire a repeat event every 1/10th of a second
      // This is far from ideal, but is "good enough" for most practical uses
      long time = Minecraft.getSystemTime();
      if (down.lastTime <= time - 100) {
        down.lastTime = time;
        keyPresses.add(new KeyPress(down.key, true, down.character));
      }
    } else {
      keysDown.remove(i);
      keysUp.add(down.key);
    }
  }
  if (keyPresses.size() > 0 || keysUp.size() > 0) {
    Plethora.network.sendToServer(new KeyMessage(keyPresses, keysUp));
    keyPresses.clear();
    keysUp.clear();
  }
}

代码示例来源:origin: SleepyTrousers/EnderIO

private boolean updateCamera(int vpx, int vpy, int vpw, int vph) {
 if (vpw <= 0 || vph <= 0) {
  return false;
 }
 camera.setViewport(vpx, vpy, vpw, vph);
 camera.setProjectionMatrixAsPerspective(30, 0.05, 50, vpw, vph);
 eye.set(0, 0, distance);
 pitchRot.makeRotationX(Math.toRadians(pitch));
 yawRot.makeRotationY(Math.toRadians(Minecraft.getSystemTime() / 16));
 pitchRot.transform(eye);
 yawRot.transform(eye);
 camera.setViewMatrixAsLookAt(eye, RenderUtil.ZERO_V, RenderUtil.UP_V);
 return camera.isValid();
}

代码示例来源:origin: SquidDev-CC/plethora

@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onInputEvent(InputEvent.KeyInputEvent event) {
  if (!listen) {
    // If we're not listening then clear the lookup of keys which are down and exit.
    keysDown.clear();
    return;
  }
  if (Keyboard.getEventKeyState()) {
    char ch = Keyboard.getEventCharacter();
    int key = Keyboard.getEventKey();
    boolean repeat = Keyboard.isRepeatEvent();
    ch = ch >= 32 && ch <= 126 || ch >= 160 && ch <= 255 ? ch : '\0';
    if (key > 0 || ch != '\0') {
      keyPresses.add(new KeyPress(key, repeat, ch));
      boolean found = false;
      for (KeyDown down : keysDown) {
        if (down.key == key) {
          down.lastTime = Minecraft.getSystemTime();
          found = true;
          break;
        }
      }
      if (!found) keysDown.add(new KeyDown(key, ch));
    }
  }
}

代码示例来源:origin: Ellpeck/ActuallyAdditions

@Override
  public void render(TileEntityDisplayStand tile, double x, double y, double z, float par5, int par6, float f){
    if(!(tile instanceof TileEntityDisplayStand)){
      return;
    }

    ItemStack stack = ((TileEntityDisplayStand)tile).inv.getStackInSlot(0);
    if(StackUtil.isValid(stack)){
      GlStateManager.pushMatrix();
      GlStateManager.translate((float)x+0.5F, (float)y+1F, (float)z+0.5F);

      double boop = Minecraft.getSystemTime()/800D;
      GlStateManager.translate(0D, Math.sin(boop%(2*Math.PI))*0.065, 0D);
      GlStateManager.rotate((float)(((boop*40D)%360)), 0, 1, 0);

      float scale = stack.getItem() instanceof ItemBlock ? 0.85F : 0.65F;
      GlStateManager.scale(scale, scale, scale);
      try{
        AssetUtil.renderItemInWorld(stack);
      }
      catch(Exception e){
        ActuallyAdditions.LOGGER.error("Something went wrong trying to render an item in a display stand! The item is "+stack.getItem().getRegistryName()+"!", e);
      }

      GlStateManager.popMatrix();
    }
  }
}

代码示例来源:origin: Ellpeck/ActuallyAdditions

@Override
  public void doRender(EntityWorm entity, double x, double y, double z, float entityYaw, float partialTicks){
    GlStateManager.pushMatrix();
    bindEntityTexture(entity);
    GlStateManager.translate(x, y+0.7F, z);
    double boop = Minecraft.getSystemTime()/70D;
    GlStateManager.rotate(-(float)((boop%360)), 0, 1, 0);
    GlStateManager.translate(0, 0, 0.4);

    stack.setStackDisplayName(entity.getName());
    AssetUtil.renderItemInWorld(stack);

    GlStateManager.popMatrix();
  }
}

代码示例来源:origin: Ellpeck/ActuallyAdditions

@Override
public void renderParticle(BufferBuilder buffer, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ){
  GlStateManager.pushMatrix();
  RenderHelper.enableStandardItemLighting();
  GlStateManager.translate(this.posX-TileEntityRendererDispatcher.staticPlayerX, this.posY-TileEntityRendererDispatcher.staticPlayerY, this.posZ-TileEntityRendererDispatcher.staticPlayerZ);
  GlStateManager.scale(0.3F, 0.3F, 0.3F);
  double boop = Minecraft.getSystemTime()/600D;
  GlStateManager.rotate((float)((boop*40D)%360), 0, 1, 0);
  GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
  GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_CONSTANT_COLOR, GlStateManager.SourceFactor.ONE.factor, GlStateManager.DestFactor.ZERO.factor);
  float ageRatio = (float)this.particleAge/(float)this.particleMaxAge;
  float color = this.motionY < 0 ? 1F-ageRatio : ageRatio;
  GL14.glBlendColor(color, color, color, color);
  AssetUtil.renderItemWithoutScrewingWithColors(this.stack);
  RenderHelper.disableStandardItemLighting();
  GlStateManager.popMatrix();
}

代码示例来源:origin: Ellpeck/ActuallyAdditions

public void render(){
  if(StackUtil.isValid(this.theThingToRender)){
    boolean isBlock = this.theThingToRender.getItem() instanceof ItemBlock;
    GlStateManager.pushMatrix();
    if(isBlock){
      GlStateManager.translate(0D, -0.1875D, 0D);
    }
    GlStateManager.rotate(180F, 1.0F, 0.0F, 1.0F);
    float size = isBlock ? 0.5F : 0.4F;
    GlStateManager.scale(size, size, size);
    //Make the floaty stuff look nice using sine waves \o/ -xdjackiexd
    //Peck edit: What do you mean by "nice" you jackass? >_>
    double boop = Minecraft.getSystemTime()/1000D;
    GlStateManager.translate(0D, Math.sin(boop%(2*Math.PI))*0.25, 0D);
    GlStateManager.rotate((float)(((boop*40D)%360)), 0, 1, 0);
    GlStateManager.disableLighting();
    GlStateManager.pushMatrix();
    if(!isBlock){
      GlStateManager.translate(0D, 0.5D, 0D);
    }
    GlStateManager.rotate(180F, 1F, 0F, 0F);
    AssetUtil.renderItemInWorld(this.theThingToRender);
    GlStateManager.popMatrix();
    GlStateManager.enableLighting();
    GlStateManager.popMatrix();
  }
}

代码示例来源:origin: mezz/JustEnoughItems

protected void renderEffect(IBakedModel model) {
  Minecraft minecraft = Minecraft.getMinecraft();
  TextureManager textureManager = minecraft.getTextureManager();
  RenderItem renderItem = minecraft.getRenderItem();
  GlStateManager.depthMask(false);
  GlStateManager.depthFunc(514);
  GlStateManager.blendFunc(768, 1);
  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);
  renderItem.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);
  renderItem.renderModel(model, -8372020);
  GlStateManager.popMatrix();
  GlStateManager.matrixMode(5888);
  GlStateManager.blendFunc(770, 771);
  GlStateManager.depthFunc(515);
  GlStateManager.depthMask(true);
  textureManager.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
}

代码示例来源:origin: TeamWizardry/Wizardry

private static void renderEffect(IBakedModel model) {
  GlStateManager.depthMask(false);
  GlStateManager.depthFunc(514);
  GlStateManager.disableLighting();
  GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_COLOR, GlStateManager.DestFactor.ONE);
  Minecraft.getMinecraft().getTextureManager().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);
  renderModel(model, -8372020, ItemStack.EMPTY);
  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);
  renderModel(model, -8372020, ItemStack.EMPTY);
  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);
  Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
}

相关文章