r/SethBlingSuggestions • u/SkyTheRealNinja • Sep 29 '13
Improvement To Command Block Structure Spawner Filter
Instead of having a ton of command blocks everywhere, using command block minecarts would be a more compact solution to spawn stuff. Is it possible to upgrade your structure spawner filter so the spawners/destroyers look like this? The air-spawning/destroying command blocks would have to be separate.
1
u/snapy666 Sep 30 '13 edited Sep 30 '13
Hey sethbling, there are some things you can do better in Python:
Instead of
type(structureRegion) == types.NoneTypeyou should just do this: (it checks for identity, because there can only be one None)
structureRegion is NoneInstead of
ret = ret + ","you can just do
ret += ","Instead of
"setblock ~{0} ~{1} ~{2} air 0".format(dx, dy, dz)you can do this:
"setblock ~{} ~{} ~{} air 0".format(dx, dy, dz)Instead of
if type(tag) in LiteralTypes:
return tag.value
elif type(tag) == TAG_Compound:
return CompoundValue(tag)you can do this:
if isinstance(tag, LiteralTypes):
return tag.value
elif isinstance(tag, TAG_Compound):
return CompoundValue(tag)also note that constants should be written like this: LITERAL_TYPES. (http://www.python.org/dev/peps/pep-0008/)
1
u/PaintTheFuture Sep 30 '13
Correct me if I'm wrong, but isn't Seth's Structure Spawner Filter terribly non-futureproof because it uses numeric IDs which are soon to be made obsolete?
1
u/RedditCracked Sep 29 '13
I already did this, but I still need a filter! Here's the link if you are interested! http://www.youtube.com/watch?v=d_KdhZuL4Z4 Hope you like it! :)