Package mekanism.common

Examples of mekanism.common.IRedstoneControl


  public void preMouseClicked(int xAxis, int yAxis, int button) {}

  @Override
  public void mouseClicked(int xAxis, int yAxis, int button)
  {
    IRedstoneControl control = (IRedstoneControl)tileEntity;

    if(button == 0)
    {
      if(xAxis >= -21 && xAxis <= -3 && yAxis >= 10 && yAxis <= 28)
      {
View Full Code Here


    {
      return true;
    }

    World world = tileEntity.getWorldObj();
    IRedstoneControl control = (IRedstoneControl)tileEntity;

    if(control.getControlType() == RedstoneControl.DISABLED)
    {
      return true;
    }
    else if(control.getControlType() == RedstoneControl.HIGH)
    {
      return control.isPowered();
    }
    else if(control.getControlType() == RedstoneControl.LOW)
    {
      return !control.isPowered();
    }

    return false;
  }
View Full Code Here

  {
    mc.renderEngine.bindTexture(RESOURCE);

    guiObj.drawTexturedRect(guiWidth + 176, guiHeight + 138, 0, 0, 26, 26);

    IRedstoneControl control = (IRedstoneControl)tileEntity;
    int renderX = 26 + (18*control.getControlType().ordinal());

    if(xAxis >= 179 && xAxis <= 197 && yAxis >= 142 && yAxis <= 160)
    {
      guiObj.drawTexturedRect(guiWidth + 179, guiHeight + 142, renderX, 0, 18, 18);
    }
View Full Code Here

  @Override
  public void renderForeground(int xAxis, int yAxis)
  {
    mc.renderEngine.bindTexture(RESOURCE);

    IRedstoneControl control = (IRedstoneControl)tileEntity;

    if(xAxis >= 179 && xAxis <= 197 && yAxis >= 142 && yAxis <= 160)
    {
      displayTooltip(control.getControlType().getDisplay(), xAxis, yAxis);
    }

    mc.renderEngine.bindTexture(defaultLocation);
  }
View Full Code Here

  public void preMouseClicked(int xAxis, int yAxis, int button) {}

  @Override
  public void mouseClicked(int xAxis, int yAxis, int button)
  {
    IRedstoneControl control = (IRedstoneControl)tileEntity;

    if(button == 0)
    {
      if(xAxis >= 179 && xAxis <= 197 && yAxis >= 142 && yAxis <= 160)
      {
        RedstoneControl current = control.getControlType();
        int ordinalToSet = current.ordinal() < (RedstoneControl.values().length-1) ? current.ordinal()+1 : 0;

        SoundHandler.playSound("gui.button.press");
        Mekanism.packetHandler.sendToServer(new RedstoneControlMessage(Coord4D.get(tileEntity), RedstoneControl.values()[ordinalToSet]));
      }
View Full Code Here

      ((ISustainedData)tileEntity).writeSustainedData(itemStack);
    }

    if(tileEntity instanceof IRedstoneControl)
    {
      IRedstoneControl control = (IRedstoneControl)tileEntity;
      itemStack.stackTagCompound.setInteger("controlType", control.getControlType().ordinal());
    }

    if(tileEntity instanceof TileEntityElectricBlock)
    {
      IEnergizedItem energizedItem = (IEnergizedItem)itemStack.getItem();
View Full Code Here

TOP

Related Classes of mekanism.common.IRedstoneControl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.