From e4b3f32e42b6e8b9c94c2335a2c77e5abdc5e758 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 20 Sep 2021 22:04:13 +0200 Subject: [PATCH] Add default 'FF' event Signed-off-by: yoyosource --- .../bausystem/features/script/CustomScriptListener.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScriptListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScriptListener.java index eb6e0e52..92221f21 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScriptListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/script/CustomScriptListener.java @@ -91,11 +91,13 @@ public class CustomScriptListener implements Listener { YAPIONObject yapionObject; if (s == null) { yapionObject = new YAPIONObject(); + yapionObject.getYAPIONMapOrSetDefault("events", new YAPIONMap()).add("FF", new YAPIONArray().add("#!EVENT FF\ngui")); } else { yapionObject = YAPIONParser.parse(s); if (yapionObject.containsKey("")) { yapionObject.add("commands", yapionObject.getMap("")); yapionObject.remove(""); + yapionObject.getYAPIONMapOrSetDefault("events", new YAPIONMap()).add("FF", new YAPIONArray().add("#!EVENT FF\ngui")); } }