Exemplo n.º 1
0
 public void registerEntity(
     Class<? extends Entity> cls,
     String name,
     Enum id,
     int updateFrequency,
     boolean sendVelocityUpdates) {
   registerEntity(cls, name, id.ordinal(), updateFrequency, sendVelocityUpdates);
 }
 public JSONObject describeClass(Class<?> clazz) throws Exception {
   JSONObject desc = new JSONObject();
   desc.put("name", clazz.getName());
   if (clazz.isEnum()) {
     @SuppressWarnings("unchecked")
     Class<Enum<?>> enumClass = (Class<Enum<?>>) clazz;
     ArrayList<String> enumNames = Lists.newArrayList();
     for (Enum<?> e : enumClass.getEnumConstants()) {
       enumNames.add(e.name());
     }
     desc.put("enum", enumNames);
   }
   UI_TYPE ui_type = UI_TYPE.getEnumFor(clazz);
   if (ui_type != null) {
     desc.put("uiType", ui_type.getName());
   }
   desc.put("properties", getClassProperties(clazz, 0));
   return desc;
 }
Exemplo n.º 3
0
 public void openGui(EntityPlayer player, Enum id, World world, int x, int y, int z) {
   openGui(player, id.ordinal(), world, x, y, z);
 }
Exemplo n.º 4
0
 public void addContainer(Enum id, Class<? extends Container> cls) {
   addContainer(id.ordinal(), cls);
 }
Exemplo n.º 5
0
 public void registerEntity(Class<? extends Entity> cls, String name, Enum id) {
   registerEntity(cls, name, id.ordinal());
 }