From 566c29a80968d8053a6696ae2d0c294c26034468 Mon Sep 17 00:00:00 2001 From: Vincent Lee Date: Tue, 24 Dec 2019 14:59:54 -0600 Subject: [PATCH] Update gog page, partially fix lexicon page --- web/module/gardenofglass.php | 5 ++-- web/module/lexicon.php | 52 ++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/web/module/gardenofglass.php b/web/module/gardenofglass.php index ee1fcb344..1f21b9c5a 100644 --- a/web/module/gardenofglass.php +++ b/web/module/gardenofglass.php @@ -6,8 +6,9 @@ Garden of Glass is a botania addon. Having installed will allow you to create a skyblock type world.
Aside from allowing you to have a skyblock world, a few items and blocks are added, as well as some recipes in botania tweaked to fit the skyblock.
The goal of this addon is to allow for every single item in the game to be acquired properly in a skyblock evironment.
-The GardenOfGlass.jar file required to play this mode is simply an empty mod, used to signal to the base Botania mod to enable the GoG features.
-This jar doesn't need to be updated, only the base Botania one does. In order for Garden of Glass to work, you need at least Botania r1.7-199.

+The jar file required to play this mode is a mod, but contains no code and behaves similarly to a glorified datapack.
+It contains the recipe changes to the base game, and signals to the base Botania mod to enable other GoG features.
+In order for Garden of Glass to work, you need at least Botania r1.7-199.

Garden of Glass for Server Owners

Download Garden of Glass
diff --git a/web/module/lexicon.php b/web/module/lexicon.php index c8f065886..adde923a8 100644 --- a/web/module/lexicon.php +++ b/web/module/lexicon.php @@ -12,32 +12,32 @@ 0) { - $current_entry = $entry_match[1]; - if($opened_div) - echo(''); - - echo("
$entry_match[2]
"); - $opened_div = true; - } - - if(sizeof($page_match) > 0) { - $page = preg_replace('/&(.)((?:[^&])+)(?:(?:&(?:0|r))|$)/', "$2", $page_match[1]) . '
'; - $no_control = preg_replace('/&./', '', $page_match[1]); - if(strlen($no_control) > 50) - echo($page); + foreach($json as $key => $value) { + $entry_match = match_entry($key); + $page_match = match_page($key, $current_entry); + + if(sizeof($entry_match) > 0) { + $current_entry = $entry_match[1]; + if($opened_div) + echo('
'); + + echo("
$value
"); + echo("\n"); + $opened_div = true; + } + + if(sizeof($page_match) > 0) { + $page = preg_replace('/&(.)((?:[^&])+)(?:(?:&(?:0|r))|$)/', "$2", $value) . '
'; + $no_control = preg_replace('/&./', '', $value); + if(strlen($no_control) > 50) { + echo($page); + echo("\n"); } } } @@ -50,11 +50,11 @@ return $matches; } - function match_entry($line) { - return match('botania\.entry\.(\w+)=(.+)', $line); + function match_entry($key) { + return match('botania\.entry\.(\w+)', $key); } - function match_page($line, $entry_name) { - return match("botania\.page\.$entry_name\d+=(.+)", $line); + function match_page($key, $entry_name) { + return match("botania\.page\.$entry_name\d+", $key); } ?> \ No newline at end of file