コード例 #1
0
  /** Render this TileEntity at a given set of coordinates */
  public void renderTileEntityAt(
      TileEntity par1TileEntity, double par2, double par4, double par6, float par8) {
    TileEntitySpecialRenderer tileentityspecialrenderer =
        getSpecialRendererForEntity(par1TileEntity);

    if (tileentityspecialrenderer != null) {
      tileentityspecialrenderer.renderTileEntityAt(par1TileEntity, par2, par4, par6, par8);
    }
  }
コード例 #2
0
  /**
   * Sets the world used by all TileEntitySpecialRender instances and notifies them of this change.
   */
  public void setWorld(World par1World) {
    worldObj = par1World;
    Iterator iterator = specialRendererMap.values().iterator();

    do {
      if (!iterator.hasNext()) {
        break;
      }

      TileEntitySpecialRenderer tileentityspecialrenderer =
          (TileEntitySpecialRenderer) iterator.next();

      if (tileentityspecialrenderer != null) {
        tileentityspecialrenderer.onWorldChange(par1World);
      }
    } while (true);
  }
コード例 #3
0
  private TileEntityRenderer() {
    specialRendererMap = new HashMap();
    specialRendererMap.put(net.minecraft.src.TileEntitySign.class, new TileEntitySignRenderer());
    specialRendererMap.put(
        net.minecraft.src.TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
    specialRendererMap.put(
        net.minecraft.src.TileEntityPiston.class, new TileEntityRendererPiston());
    specialRendererMap.put(net.minecraft.src.TileEntityChest.class, new TileEntityChestRenderer());
    specialRendererMap.put(
        net.minecraft.src.TileEntityEnderChest.class, new TileEntityEnderChestRenderer());
    specialRendererMap.put(
        net.minecraft.src.TileEntityEnchantmentTable.class, new RenderEnchantmentTable());
    specialRendererMap.put(net.minecraft.src.TileEntityEndPortal.class, new RenderEndPortal());
    TileEntitySpecialRenderer tileentityspecialrenderer;

    for (Iterator iterator = specialRendererMap.values().iterator();
        iterator.hasNext();
        tileentityspecialrenderer.setTileEntityRenderer(this)) {
      tileentityspecialrenderer = (TileEntitySpecialRenderer) iterator.next();
    }
  }