-
Notifications
You must be signed in to change notification settings - Fork 8
/
Clear Items.py
57 lines (50 loc) · 1.81 KB
/
Clear Items.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
from pymclevel.nbt import TAG_List
displayName = "Clear Items"
VERSION = "1.0.0"
UPDATE_URL = "http://podshot.github.io/update/Clear%20Items.json"
inputs = (
("Chest", True),
("Brewing Stand", True),
("Furnace", True),
("Hopper", True),
("Dispenser", True),
("Dropper", True),
("Version: 1.0","label"),
)
def perform(level, box, options):
chest = options["Chest"]
brewing = options["Brewing Stand"]
furnace = options["Furnace"]
hoppers = options["Hopper"]
dispenser = options["Dispenser"]
dropper = options["Dropper"]
for (chunk, slices, point) in level.getChunkSlices(box):
for t in chunk.TileEntities:
x = t["x"].value
y = t["y"].value
z = t["z"].value
if (x,y,z) in box:
if t["id"].value == "Chest" and chest:
del t["Items"]
t["Items"] = TAG_List()
chunk.dirty = True
if t["id"].value == "Furnace" and furnace:
del t["Items"]
t["Items"] = TAG_List()
chunk.dirty = True
if t['id'].value == "Dropper" and dropper:
del t["Items"]
t["Items"] = TAG_List()
chunk.dirty = True
if t['id'].value == "Trap" and dispenser:
del t["Items"]
t["Items"] = TAG_List()
chunk.dirty = True
if t['id'].value == "Cauldron" and brewing:
del t["Items"]
t["Items"] = TAG_List()
chunk.dirty = True
if t['id'].value == "Hopper" and hoppers:
del t["Items"]
t["Items"] = TAG_List()
chunk.dirty = True