The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Manager
By Guest on 11th October 2018 01:56:21 AM | Syntax: JAVA | Views: 1



New paste | Download | Show/Hide line no. | Copy text to clipboard
  1. import net.minecraft.client.Minecraft;
  2. import java.util.ArrayList;
  3. import java.util.HashMap;
  4. import java.io.BufferedInputStream;
  5. import java.io.File;
  6. import java.io.FileInputStream;
  7. import java.io.InputStream;
  8.  
  9. public class MCExtendedManagers {
  10.  
  11.    public static final Minecraft mc = ModLoader.getMinecraftInstance();
  12.  
  13.    private static int currentIndex = 0;
  14.    private static HashMap pathToIdMap = new HashMap();
  15.    private static ArrayList terrains = new ArrayList();
  16.  
  17.  
  18.    public static int getTerrain(int terrainNum) {
  19.       return MCExtendedManagers.mc.p.b((String)terrains.get(terrainNum));
  20.    }
  21.  
  22.    public static String getTerrainName(int terrainNum) {
  23.       return (String)terrains.get(terrainNum);
  24.    }
  25.  
  26.    public static int getTerrainNumBasedOnPath(String terrainPath) {
  27.       return ((Integer)pathToIdMap.get(terrainPath)).intValue();
  28.    }
  29.  
  30.    public static int registerTerrain(String path) {
  31.       terrains.add(currentIndex, path);
  32.       pathToIdMap.put(path, Integer.valueOf(currentIndex));
  33.       return currentIndex++;
  34.    }
  35.  
  36.    public static int getTotal() {
  37.       return terrains.size();
  38.    }
  39.  
  40.    static {
  41.       registerTerrain("/terrain.png");
  42.    }
  43.  
  44.    private static HashMap registeredOutsideTextures = new HashMap();
  45.  
  46.  
  47.    public static InputStream getOutsideTexture(String s) {
  48.       try {
  49.          return registeredOutsideTextures.get(s) != null?new BufferedInputStream(new FileInputStream((File)registeredOutsideTextures.get(s))):null;
  50.       } catch (Exception var2) {
  51.          throw new RuntimeException(var2);
  52.       }
  53.    }
  54.  
  55.    public static void registerOutsideTexture(String s, File image) {
  56.       registeredOutsideTextures.put(s, image);
  57.    }
  58.  
  59.    private static ArrayList items = new ArrayList();
  60.  
  61.  
  62.    public static String getItemName(int itemNum) {
  63.       return (String)items.get(itemNum);
  64.    }
  65.  
  66.    public static int getItem(int itemNum) {
  67.       return MCExtendedManagers.mc.p.b((String)items.get(itemNum));
  68.    }
  69.  
  70.    public static int getItemNumBasedonPath(String path) {
  71.       return ((Integer)pathToIdMap.get(path)).intValue();
  72.    }
  73.  
  74.    public static int registerItem(String path) {
  75.       items.add(currentIndex, path);
  76.       pathToIdMap.put(path, Integer.valueOf(currentIndex));
  77.       return currentIndex++;
  78.    }
  79.  
  80.    public static int getTotal() {
  81.       return items.size();
  82.    }
  83.  
  84.    static {
  85.       registerItem("/gui/items.png");
  86.    }
  87.  
  88. }



  • Recent Pastes
  • MCExtended
    6 days 16 hours 54 mins 3 secs ago
  • Forge
    6 days 16 hours 54 mins 26 secs ago
  • Cv
    1 week 9 hours 49 mins and 46 secs ago
  • Managers
    1 week 10 hours 4 mins and 13 secs ago
  • Manager
    1 week 10 hours 26 mins and 16 secs ago