예제 #1
0
  @Override
  public boolean onBlockActivated(
      World world,
      int x,
      int y,
      int z,
      EntityPlayer player,
      int side,
      float hit_x,
      float hit_y,
      float hit_z) {
    if (!player.isSneaking()) return true;
    TileReagentPurifier te = (TileReagentPurifier) world.getTileEntity(x, y, z);

    ForgeDirection newOut = ForgeDirection.getOrientation(side);

    if (newOut != te.getOutputSide()) {
      te.setOwner(player.getGameProfile().getId());
      te.setOutputSide(newOut);
      world.markBlockForUpdate(x, y, z);
      te.markDirty();
      return true;
    }
    return true;
  }
예제 #2
0
  @Override
  @SideOnly(Side.CLIENT)
  public IIcon getIcon(IBlockAccess blockacc, int x, int y, int z, int side) {
    TileReagentPurifier ent = (TileReagentPurifier) blockacc.getTileEntity(x, y, z);
    ForgeDirection drawSide = ForgeDirection.getOrientation(side);
    ForgeDirection outputSide = ent.getOutputSide();
    ForgeDirection filterSide = ent.getFilterSide();

    if (drawSide == outputSide) return iconArray[1];
    if (drawSide == filterSide) return iconArray[2];
    return iconArray[0];
  }