Skip to content

Instantly share code, notes, and snippets.

@Podshot
Last active September 6, 2016 14:01
Show Gist options
  • Save Podshot/a3a8d71be2eaf65c2c728be817f1f8ef to your computer and use it in GitHub Desktop.
Save Podshot/a3a8d71be2eaf65c2c728be817f1f8ef to your computer and use it in GitHub Desktop.
import filter_utils # Special import that is dynamically generated before the filter is loaded
print filter_utils.Available_Attributes() # Currently prints ['editor', 'materials']
print filter_utils.editor # Replaces the injected global 'editor' variable, points to a LevelEditor instance, old injected way still works
try:
inputs = (
("Block", filter_utils.materials["minecraft:stone[variant=granite]"]), # Gives the level's materials, instead of haveing to import alphaMaterials or pocketMaterials from pymclevel.materials
("Using new inputs", "label"),
)
except ImportError, AttributeError:
inputs = (
("Block", alphaMaterials["minecraft:stone[variant=granite]"]),
("Test", False),
("Test 2", 1),
("Using old inputs", "label"),
)
def perform(level, box, options):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment