From d0c752723298995af4acef999131b825906e0849 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sat, 13 May 2017 22:51:43 +0200 Subject: [PATCH] Fix duplicate treasures in mineshaft chests --- mods/MAPGEN/tsm_railcorridors/gameconfig.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mods/MAPGEN/tsm_railcorridors/gameconfig.lua b/mods/MAPGEN/tsm_railcorridors/gameconfig.lua index 994635088..5f57bd05d 100644 --- a/mods/MAPGEN/tsm_railcorridors/gameconfig.lua +++ b/mods/MAPGEN/tsm_railcorridors/gameconfig.lua @@ -30,12 +30,9 @@ end -- MineClone 2's treasure function. Gets all treasures for a single chest. -- Based on information from Minecraft Wiki. function tsm_railcorridors.get_treasures(pr) - local r1 = pr:next(1,71) - local r2 = pr:next(1,83) - local r3 = pr:next(1,50) - local items = {} -- First roll + local r1 = pr:next(1,71) if r1 <= 30 then table.insert(items, "mobs:nametag") elseif r1 <= 50 then @@ -55,6 +52,7 @@ function tsm_railcorridors.get_treasures(pr) -- Second roll local r2stacks = pr:next(2,4) for i=1, r2stacks do + local r2 = pr:next(1,83) if r2 <= 15 then table.insert(items, "mcl_farming:bread "..pr:next(1,3)) elseif r2 <= 25 then @@ -80,6 +78,7 @@ function tsm_railcorridors.get_treasures(pr) -- Third roll for i=1, 3 do + local r3 = pr:next(1,50) if r3 <= 20 then table.insert(items, "mcl_minecarts:rail "..pr:next(4,8)) elseif r3 <= 35 then