Skip to content

Commit 1377eb3

Browse files
committed
Hotfix
Replaced <string>.split(<regex>) (which doesn't work as intended) with re.split(<regex>, <string>)
1 parent 4ca8539 commit 1377eb3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Structure-spawner-generator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
import inspect
1313

14+
import re
15+
1416
import mcplatform
1517
from pymclevel import materials
1618
from pymclevel.nbt import TAG_Compound, TAG_String, TAG_Int, TAG_List, TAG_Byte_Array, TAG_Short_Array, TAG_Int_Array, TAG_Byte, TAG_Short, TAG_Long, TAG_Float, TAG_Double
@@ -54,12 +56,12 @@ def perform(level, box, options):
5456
include_logadmincommands_command = options["Include \"gamerule logAdminCommands false\" command"]
5557
add_initialization_commands = options["Add initialization commands"]
5658
add_finalization_commands = options["Add finalization commands"]
57-
block_names_to_enqueue = options["Blocks to enqueue"].split("\\s*,\\s*")
59+
block_names_to_enqueue = re.split("\\s*,\\s*", options["Blocks to enqueue"])
5860
blocks_to_enqueue = []
5961
for block_id in xrange(0, len(materials.block_map) - 1):
6062
if materials.block_map[block_id] in block_names_to_enqueue:
6163
blocks_to_enqueue.append(block_id)
62-
nbt_tags_to_ignore = options["NBT tags to ignore"].split("\\s*,\\s*") + ["x", "y", "z"]
64+
nbt_tags_to_ignore = re.split("\\s*,\\s*", options["NBT tags to ignore"]) + ["x", "y", "z"]
6365
ignore_maximum_command_block_command_length = options["Ignore maximum Command Block command length"]
6466
add_credits = True
6567

0 commit comments

Comments
 (0)