EventCommands.java 806 B

123456789101112131415161718
  1. package me.km.snuviscript.commands;
  2. import java.util.UUID;
  3. import me.hammerle.snuviscript.code.ScriptManager;
  4. import me.km.events.CustomEventCaller;
  5. import me.km.events.PlayerMoveData;
  6. import me.km.utils.Location;
  7. public class EventCommands {
  8. public static void registerFunctions(ScriptManager sm, CustomEventCaller cec) {
  9. sm.registerFunction("event.addmovedata", (sc, in) -> {
  10. UUID uuid = in.length >= 5 ? CommandUtils.getUUID(in[4].get(sc)) : null;
  11. PlayerMoveData pmd = new PlayerMoveData(sc, (Location) in[0].get(sc), (Location) in[1].get(sc), in[2].getInt(sc), in[3].getInt(sc), uuid);
  12. return (double) cec.registerMoveData(pmd);
  13. });
  14. sm.registerConsumer("event.removemovedata", (sc, in) -> cec.removeMoveData(in[0].getInt(sc)));
  15. }
  16. }