Example #1
0
 @Override
 public boolean init() {
   final ParseLogHandler log = SkriptLogger.startParseLogHandler();
   try {
     boolean hasValue = false;
     for (final Class<? extends Event> e : ScriptLoader.getCurrentEvents()) {
       if (getters.containsKey(e)) {
         hasValue = true;
         continue;
       }
       final SerializableGetter<? extends T, ?> getter =
           EventValues.getEventValueGetter(e, c, getTime());
       if (getter != null) {
         getters.put(e, getter);
         hasValue = true;
       }
     }
     if (!hasValue) {
       log.printError(
           "There's no "
               + Classes.getSuperClassInfo(c).getName()
               + " in "
               + Utils.a(ScriptLoader.currentEventName)
               + " event");
       return false;
     }
     log.printLog();
     return true;
   } finally {
     log.stop();
   }
 }
Example #2
0
 @Override
 public Class<?>[] acceptChange(final ChangeMode mode) {
   if (changer == null)
     changer = (SerializableChanger<? super T>) Classes.getSuperClassInfo(c).getChanger();
   return changer == null ? null : changer.acceptChange(mode);
 }
Example #3
0
 @Override
 public String toString(final Event e, final boolean debug) {
   if (!debug || e == null) return "event-" + Classes.getSuperClassInfo(c).getName();
   return Classes.getDebugMessage(getValue(e));
 }