From aa967ae3589553bdc6dc757555c43b6815492aff Mon Sep 17 00:00:00 2001 From: Ruben Taelman Date: Sat, 20 Jan 2018 18:18:53 +0100 Subject: [PATCH] Add Integrated Dynamics infobook sections --- .../cyclops/integratedrest/IntegratedRest.java | 8 ++++++++ .../assets/integratedrest/info/rest_info.xml | 16 ++++++++++++++++ .../assets/integratedrest/lang/en_us.lang | 16 +++++++++++++++- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/assets/integratedrest/info/rest_info.xml diff --git a/src/main/java/org/cyclops/integratedrest/IntegratedRest.java b/src/main/java/org/cyclops/integratedrest/IntegratedRest.java index 46354eed..2b311e6f 100644 --- a/src/main/java/org/cyclops/integratedrest/IntegratedRest.java +++ b/src/main/java/org/cyclops/integratedrest/IntegratedRest.java @@ -15,12 +15,14 @@ import org.cyclops.cyclopscore.config.ConfigHandler; import org.cyclops.cyclopscore.config.extendedconfig.BlockItemConfigReference; import org.cyclops.cyclopscore.helper.MinecraftHelpers; +import org.cyclops.cyclopscore.infobook.IInfoBookRegistry; import org.cyclops.cyclopscore.init.ItemCreativeTab; import org.cyclops.cyclopscore.init.ModBaseVersionable; import org.cyclops.cyclopscore.init.RecipeHandler; import org.cyclops.cyclopscore.proxy.ICommonProxy; import org.cyclops.integrateddynamics.IntegratedDynamics; import org.cyclops.integrateddynamics.api.item.IVariableFacadeHandlerRegistry; +import org.cyclops.integrateddynamics.infobook.OnTheDynamicsOfIntegrationBook; import org.cyclops.integratedrest.api.http.request.IRequestHandlerRegistry; import org.cyclops.integratedrest.api.json.IValueTypeJsonHandlerRegistry; import org.cyclops.integratedrest.block.BlockHttpConfig; @@ -114,6 +116,12 @@ public void init(FMLInitializationEvent event) { @Override public void postInit(FMLPostInitializationEvent event) { super.postInit(event); + + // Initialize info book + IntegratedDynamics._instance.getRegistryManager().getRegistry(IInfoBookRegistry.class) + .registerSection( + OnTheDynamicsOfIntegrationBook.getInstance(), "info_book.integrateddynamics.manual", + "/assets/" + Reference.MOD_ID + "/info/rest_info.xml"); } /** diff --git a/src/main/resources/assets/integratedrest/info/rest_info.xml b/src/main/resources/assets/integratedrest/info/rest_info.xml new file mode 100644 index 00000000..a523f212 --- /dev/null +++ b/src/main/resources/assets/integratedrest/info/rest_info.xml @@ -0,0 +1,16 @@ + +
+
+ info_book.integratedrest.introduction.text1 + info_book.integratedrest.introduction.text2 + info_book.integratedrest.introduction.text3 +
+ +
+ integratedrest:http + info_book.integratedrest.http.text1 + info_book.integratedrest.http.text2 + info_book.integratedrest.http.text3 + integratedrest:http +
+
\ No newline at end of file diff --git a/src/main/resources/assets/integratedrest/lang/en_us.lang b/src/main/resources/assets/integratedrest/lang/en_us.lang index 77b05787..61c24f70 100644 --- a/src/main/resources/assets/integratedrest/lang/en_us.lang +++ b/src/main/resources/assets/integratedrest/lang/en_us.lang @@ -9,4 +9,18 @@ tile.blocks.integratedrest.http.info=Read values that have been provided by exte http.integratedrest.tooltip.delay_id=§e§oHTTP Proxy ID: §r§o%s http.integratedrest.error.http_not_in_network=HTTP Proxy with id %s could not be found within the current network. http.integratedrest.error.http_invalid=HTTP Proxy with id %s is not exposing a valid variable. -http.integratedrest.error.http_invalid_type=HTTP Proxy with id %s is expected to expose a variable with type %s while %s is found. \ No newline at end of file +http.integratedrest.error.http_invalid_type=HTTP Proxy with id %s is expected to expose a variable with type %s while %s is found. + +# ------ On the Dynamics of Integration contents ------ + +info_book.integratedrest.section.main=REST + +info_book.integratedrest.introduction=Introduction +info_book.integratedrest.introduction.text1=&lIntegrated REST&r is a mod allows you to read from and write to your &lIntegrated Dynamics&r networks via a REST API. +info_book.integratedrest.introduction.text2=This makes it possible to read the status of your networks and worlds via Web-protocols, and interact with them by POST-ing values to HTTP Proxy blocks in your world. +info_book.integratedrest.introduction.text3=Check the server console to see where your server is running and see what kind of information you can find. (Default is &lhttp://localhost:3000/&r) + +info_book.integratedrest.http=HTTP Proxy +info_book.integratedrest.http.text1=The HTTP Proxy has an internal value state that can be updated via HTTP POST requests. +info_book.integratedrest.http.text2=A certain value type must be selected in the HTTP Proxy, and only requests of that type will be accepted. +info_book.integratedrest.http.text3=More information can be found on the GitHub wiki