예제 #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;
 }
예제 #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);
 }
예제 #4
0
 public void addContainer(Enum id, Class<? extends Container> cls) {
   addContainer(id.ordinal(), cls);
 }
예제 #5
0
 public void registerEntity(Class<? extends Entity> cls, String name, Enum id) {
   registerEntity(cls, name, id.ordinal());
 }