Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Usage: initField("invasionsCaveChancePercent");
- public void initField(String name) {
- try {
- Object obj = getField(name);
- if (obj instanceof String) {
- obj = preInitConfig.get(Configuration.CATEGORY_GENERAL, name, (String)obj).getString();
- } else if (obj instanceof Integer) {
- obj = preInitConfig.get(Configuration.CATEGORY_GENERAL, name, (Integer)obj).getInt((Integer)obj);
- } else if (obj instanceof Boolean) {
- obj = preInitConfig.get(Configuration.CATEGORY_GENERAL, name, (Boolean)obj).getBoolean((Boolean)obj);
- } else {
- dbg("unhandled datatype, update initField");
- }
- c_CoroAIUtil.setPrivateValue(HostileWorlds.class, this, name, obj);
- } catch (Exception ex) { ex.printStackTrace(); }
- }
- private Object getField(String name) {
- try { return c_CoroAIUtil.getPrivateValue(HostileWorlds.class, this, name);
- } catch (Exception ex) { ex.printStackTrace(); }
- return null;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement