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



New paste | Download | Show/Hide line no. | Copy text to clipboard
  1. import java.util.ArrayList;
  2. import java.util.HashMap;
  3.  
  4. public class MCExtendedManagers$TerrainManager {
  5.  
  6.    private static int currentIndex = 0;
  7.    private static HashMap pathToIdMap = new HashMap();
  8.    private static ArrayList terrains = new ArrayList();
  9.  
  10.  
  11.    public static int getTerrain(int terrainNum) {
  12.       return MCExtendedManagers.mc.p.b((String)terrains.get(terrainNum));
  13.    }
  14.  
  15.    public static String getTerrainName(int terrainNum) {
  16.       return (String)terrains.get(terrainNum);
  17.    }
  18.  
  19.    public static int getTerrainNumBasedOnPath(String terrainPath) {
  20.       return ((Integer)pathToIdMap.get(terrainPath)).intValue();
  21.    }
  22.  
  23.    public static int registerTerrain(String path) {
  24.       terrains.add(currentIndex, path);
  25.       pathToIdMap.put(path, Integer.valueOf(currentIndex));
  26.       return currentIndex++;
  27.    }
  28.  
  29.    public static int getTotal() {
  30.       return terrains.size();
  31.    }
  32.  
  33.    static {
  34.       registerTerrain("/terrain.png");
  35.    }
  36. }



  • Recent Pastes