You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by se...@apache.org on 2021/04/27 07:46:36 UTC
[incubator-nlpcraft] 01/01: Merge branch 'master' into NLPCRAFT-305
This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-305
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
commit cae976ab11728f4ad809d18257dec04c43b6f612
Merge: b6031d4 4e7131a
Author: Sergey Kamov <sk...@gmail.com>
AuthorDate: Tue Apr 27 10:46:12 2021 +0300
Merge branch 'master' into NLPCRAFT-305
# Conflicts:
# nlpcraft-examples/minecraft-mod/build.gradle
# nlpcraft-examples/minecraft-mod/src/main/java/org/apache/nplcraft/example/minecraft/NCMinecraftExampleMod.java
# nlpcraft-examples/minecraft/src/test/kotlin/org/apache/nlpcraft/example/minecraft/NCMinecraftModelSpec.kt
README.md | 8 +-
nlpcraft-examples/minecraft-mod/build.gradle | 4 +-
...CExampleMod.java => NCMinecraftExampleMod.java} | 91 ++++++++++++++--------
...ameFilesDump.java => NCMinecraftFilesDump.java} | 11 ++-
.../minecraft/src/main/resources/minecraft.yaml | 18 ++---
.../example/minecraft/NCMinecraftModelSpec.kt | 4 +-
.../nlpcraft/common/config/NCConfigurable.scala | 59 +++++++-------
.../org/apache/nlpcraft/common/util/NCUtils.scala | 26 +++++++
.../org/apache/nlpcraft/probe/NCProbeBoot.scala | 13 ++--
.../org/apache/nlpcraft/server/NCServer.scala | 10 +--
10 files changed, 149 insertions(+), 95 deletions(-)
diff --cc nlpcraft-examples/minecraft-mod/src/main/java/org/apache/nplcraft/example/minecraft/NCMinecraftExampleMod.java
index 90c9c9f,f95e2f1..2b26ee6
--- a/nlpcraft-examples/minecraft-mod/src/main/java/org/apache/nplcraft/example/minecraft/NCMinecraftExampleMod.java
+++ b/nlpcraft-examples/minecraft-mod/src/main/java/org/apache/nplcraft/example/minecraft/NCMinecraftExampleMod.java
@@@ -42,22 -42,17 +42,20 @@@ import java.util.HashSet
import java.util.Set;
/**
- * Minecraft MOD. It contains simple REST client, which forward user request to server, and replaces initial request by server answers.
- * Note that it requires started NLPCraft server ad probe with loaded `nlpcraft.minecraft.ex` model.
+ * Minecraft example mod for the Minecraft Forge server.
*/
@Mod("nlpcraft_mod")
+ public class NCMinecraftExampleMod {
+public class NCExampleMod {
+ // Initial configuration values for communication with NLPCraft server.
+ // These values can be overridden by 'nlpcraft-settings.json' file values.
private static final String DFLT_EMAIL = "admin@admin.com";
- private static final String DFLT_PSWD = "admin";
+ private static final String DFLT_PWD = "admin";
private static final String DFLT_HOST = "0.0.0.0";
private static final int DFLT_PORT = 8081;
- private static final Logger LOGGER = LogManager.getLogger();
+ // Model ID which should be loaded in probe.
private static final String MODEL_ID = "nlpcraft.minecraft.ex";
-
- private static final Logger LOGGER = LogManager.getLogger();
private static final Gson GSON = new Gson();
private final Set<String> convCmds = new HashSet<>();
@@@ -86,11 -89,17 +92,17 @@@
private String resBody;
}
+ /**
+ * JSON bean for REST call.
+ */
private static class NCSignIn {
private String email;
- private String pwd;
+ private String passwd;
}
+ /**
+ * JSON bean for REST call.
+ */
private static class NCSignResponse {
private String acsTok;
}
diff --cc nlpcraft-examples/minecraft-mod/src/main/java/org/apache/nplcraft/example/minecraft/utils/NCMinecraftFilesDump.java
index 59d6d7e,4098ae9..a56ed2f
--- a/nlpcraft-examples/minecraft-mod/src/main/java/org/apache/nplcraft/example/minecraft/utils/NCMinecraftFilesDump.java
+++ b/nlpcraft-examples/minecraft-mod/src/main/java/org/apache/nplcraft/example/minecraft/utils/NCMinecraftFilesDump.java
@@@ -26,9 -26,9 +26,9 @@@ import net.minecraft.util.registry.Regi
import net.minecraftforge.registries.ForgeRegistryEntry;
/**
- * Utility for getting data from minecraft.
+ * Utility for getting data from minecraft. These values are used for preparing synonyms for user defined elements.
*/
- public class GameFilesDump {
+ public class NCMinecraftFilesDump {
private final static Gson GSON = new Gson();
private static class Dump {