コード例 #1
0
  @Override
  protected void actionPerformed(GuiButton b) {
    super.actionPerformed(b);

    if (b.id == 0) {
      mode = 0;
      render.reset();
      this.initGui();
    } else if (b.id == 1) {
      mode = 1;
      this.initGui();
    } else if (b.id == 2) {
      render.incrementStepY();
      this.initGui();
    } else if (b.id == 3) {
      render.decrementStepY();
      this.initGui();
    } else if (b.id == 4) {
      mode = 2;
      this.initGui();
    }
  }
コード例 #2
0
  @Override
  public void initGui() {
    super.initGui();
    render.resetRotation();
    int j = (width - xSize) / 2;
    int k = (height - ySize) / 2;

    buttonList.add(new CustomSoundGuiButton(0, j + 185, k - 2, 20, 20, "3D", this));
    buttonList.add(new CustomSoundGuiButton(1, j + 205, k - 2, 20, 20, "2D", this));
    buttonList.add(
        new CustomSoundGuiButton(4, mode == 1 ? j + 125 : j + 165, k - 2, 20, 20, "N#", this));

    if (mode == 1) {
      buttonList.add(new CustomSoundGuiButton(2, j + 165, k - 2, 20, 20, "+", this));
      buttonList.add(new CustomSoundGuiButton(3, j + 145, k - 2, 20, 20, "-", this));
    }
  }
コード例 #3
0
  private void draw3d(int j, int k, float ptick) {
    if (Mouse.isButtonDown(0) && tick > 2) {
      render.rotate(0.25 * Mouse.getDY(), 0.25 * Mouse.getDX(), 0);
    } else if (Mouse.isButtonDown(1)) {
      render.resetRotation();
    }

    if (Keyboard.isKeyDown(Keyboard.KEY_A)) {
      render.rotate(0, 0.75, 0);
    } else if (Keyboard.isKeyDown(Keyboard.KEY_D)) {
      render.rotate(0, -0.75, 0);
    } else if (Keyboard.isKeyDown(Keyboard.KEY_W)) {
      render.rotate(-0.75, 0, 0);
    } else if (Keyboard.isKeyDown(Keyboard.KEY_S)) {
      render.rotate(0.75, 0, 0);
    }

    render.draw3D(j, k, ptick);
  }
コード例 #4
0
  public GuiStructure(EntityPlayer ep, ChromaResearch r) {
    super(ep, r, 256, 220, false);

    array = page.getStructure().getStructureForDisplay();
    if (page.name().toLowerCase().contains("casting")) {
      array.setBlock(
          array.getMidX(),
          array.getMinY() + 1,
          array.getMidZ(),
          ChromaTiles.TABLE.getBlock(),
          ChromaTiles.TABLE.getBlockMetadata());
    }
    if (page == ChromaResearch.TREE) {
      array.setBlock(
          array.getMinX() + 1,
          array.getMinY() + 12,
          array.getMinZ() + 2,
          ChromaTiles.POWERTREE.getBlock(),
          ChromaTiles.POWERTREE.getBlockMetadata());
    }
    if (page == ChromaResearch.INFUSION) {
      array.setBlock(
          array.getMidX(),
          array.getMinY() + 2,
          array.getMidZ(),
          ChromaTiles.INFUSER.getBlock(),
          ChromaTiles.INFUSER.getBlockMetadata());
    }
    if (page == ChromaResearch.MINIPYLON) {
      array.setBlock(
          array.getMidX(),
          array.getMinY() + 6,
          array.getMidZ(),
          ChromaTiles.PERSONAL.getBlock(),
          ChromaTiles.PERSONAL.getBlockMetadata());
    }
    if (page == ChromaResearch.PYLON) {
      array.setBlock(
          array.getMidX(),
          array.getMinY() + 9,
          array.getMidZ(),
          ChromaTiles.PYLON.getBlock(),
          ChromaTiles.PYLON.getBlockMetadata());
    }
    if (page == ChromaResearch.CLOAKTOWER) {
      array.setBlock(
          array.getMidX(),
          array.getMinY() + 5,
          array.getMidZ(),
          ChromaTiles.CLOAKING.getBlock(),
          ChromaTiles.CLOAKING.getBlockMetadata());
    }
    render = new StructureRenderer(array);
    if (page == ChromaResearch.PYLON) {
      render.addOverride(
          array.getMidX(),
          array.getMinY() + 9,
          array.getMidZ(),
          ChromaTiles.PYLON.getCraftedProduct());
    } else if (page == ChromaResearch.MINIPYLON) {
      render.addOverride(
          array.getMidX(),
          array.getMinY() + 6,
          array.getMidZ(),
          ChromaTiles.PERSONAL.getCraftedProduct());
    } else if (page == ChromaResearch.CLOAKTOWER) {
      render.addOverride(
          array.getMidX(),
          array.getMinY() + 5,
          array.getMidZ(),
          ChromaTiles.CLOAKING.getCraftedProduct());
    } else if (page == ChromaResearch.TREE) {
      render.addOverride(
          array.getMinX() + 1,
          array.getMinY() + 12,
          array.getMinZ() + 2,
          ChromaTiles.POWERTREE.getCraftedProduct());
      render.addBlockHook(ChromaTiles.POWERTREE.getBlock(), new LumenTreeHook()); // Unused
    } else if (page == ChromaResearch.PORTALSTRUCT) {
      render.addBlockHook(Blocks.bedrock, new EnderCrystalHook());

      render.addEntityRender(-5, -1, -9, createCrystalRender());
      render.addEntityRender(-9, -1, -5, createCrystalRender());
      render.addEntityRender(5, -1, -9, createCrystalRender());
      render.addEntityRender(9, -1, -5, createCrystalRender());
      render.addEntityRender(-5, -1, 9, createCrystalRender());
      render.addEntityRender(-9, -1, 5, createCrystalRender());
      render.addEntityRender(5, -1, 9, createCrystalRender());
      render.addEntityRender(9, -1, 5, createCrystalRender());
    }
    render.addBlockHook(ChromaBlocks.RUNE.getBlockInstance(), new RuneRenderHook());
    render.addRenderHook(ChromaTiles.PYLON.getCraftedProduct(), new PylonRenderHook());
  }
コード例 #5
0
 private void drawSlice(int j, int k) {
   render.drawSlice(j, k);
 }