-
Notifications
You must be signed in to change notification settings - Fork 8
/
Custom Heads.py
72 lines (60 loc) · 2.25 KB
/
Custom Heads.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from pymclevel.nbt import TAG_String
displayName = "Custom Heads"
VERSION = "1.0.0"
UPDATE_URL = "http://podshot.github.io/update/Custom%20Heads.json"
safeheads = {
"Note Block": "C418",
"Old Radio": "uioz",
"Dark Wood": "bendablob2",
"Eye of Ender": "Edna_I",
"Chest": "MHF_Chest",
"Camera": "FHG_Cam",
"Jukebox": "stgiga",
"Puffer Fish": "luci999",
"Redstone Lamp": "AutoSoup",
"Crafting Table": "Russellgoo97",
"Podzol": "PhasePvP",
"BookShelf": "BowAimbot",
"Villager": "MHF_Villager",
"Monster Spawner": "GAMEZENMASTER",
"Cactus": "MHF_Cactus",
"Cake": "MHF_Cake",
"Melon": "MHF_Melon",
"Oak Log": "MHF_OakLog",
"Pumpkin": "MHF_Pumpkin",
"TNT Version 1": "MHF_TNT",
"TNT Version 2": "MHF_TNT2",
"Glowstone": "samstine11",
"Dispenser": "scemm",
"Leaves": "rsfx",
}
inputs = (
("Premade Heads", tuple(sorted(safeheads.keys()))),
("Custom Head:",("string","value=")),
("Override all existing custom heads", False),
("NOTE: The Custom Head option will overwrite the Premade Head Option", "label"),
)
def perform(level, box, options):
premadehead = safeheads[options["Premade Heads"]]
customhead = options["Custom Head:"]
override = options["Override all existing custom heads"]
empty = ""
for (chunk, slices, point) in level.getChunkSlices(box):
for te in chunk.TileEntities:
x = te["x"].value
y = te["y"].value
z = te["z"].value
if (x,y,z) in box:
if override:
if customhead != empty:
te["ExtraType"] = TAG_String(customhead)
if customhead == empty:
te["ExtraType"] = TAG_String(premadehead)
if not override:
if customhead != empty:
if te["ExtraType"].value == "":
te["ExtraType"] = TAG_String(customhead)
if customhead == empty:
if te["ExtraType"].value == "":
te["ExtraType"] = TAG_String(premadehead)
chunk.dirty = True