-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
174 lines (142 loc) · 21.6 KB
/
main.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
import io
import pathlib
import os
from os.path import exists
from PIL import Image, ImageOps
class STT:
SKINS_DIR = "skins"
TOTEMS_DIR = "totems"
PACK_MC_META = "pack.mcmeta"
ASSETS_DIR = "assets"
MINECRAFT_DIR = "minecraft"
OPTIFINE_DIR = "optifine"
CIT_DIR = "cit"
TOTEM_OF_UNDYING_DIR = "totem_of_undying"
def __init__(self):
os.makedirs(self.SKINS_DIR, exist_ok=True)
os.makedirs(os.path.join(self.TOTEMS_DIR, self.ASSETS_DIR, self.MINECRAFT_DIR, self.OPTIFINE_DIR,
self.CIT_DIR, self.TOTEM_OF_UNDYING_DIR), exist_ok=True)
# My skin, just for test
if not exists("skins\\UnFamousSoul.png"):
image = Image.open(io.BytesIO(bytearray(bytearray(b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00@\x00\x00\x00@\x08\x03\x00\x00\x00\x9d\xb7\x81\xec\x00\x00\x00\x01sRGB\x00\xae\xce\x1c\xe9\x00\x00\x00\x04gAMA\x00\x00\xb1\x8f\x0b\xfca\x05\x00\x00\x00\xffPLTE\xc4\xc6\xca\xce\xcf\xd4\xd6\xd8\xdc\xff\xc4\x82\xff\xcc\x91\xff\xcf\x99\xff\xd3\xa1\xff\xd6\xa8\xde\xdf\xe4\xe5\xe7\xeb\xec\xed\xf1\xf2\xf3\xf7\xf8\xf9\xfc\xff\xda\xaf\xff\xc8\x8a\xad\xad\xad\xad%\x1c\xff\xc1z\xcf\xc8\xc8\xceLQ\xceLR\xd0\xc8\xc9\xc6\x9ep\xc0\x9bs\xfc\xd3\xa6\xb5\x95r\xbf\x9br\xfd\xd1\x9f\xfc\xd7\xac\xfd\xd4\xa6\x0f\x0f\x11\x13\x10\x13\x15\x15\x15\x00\x02\x03\x01\x03\x04\x00\x00\x01\x02\x04\x05\x00\x00\x00\x05\x07\t\x00\x01\x02\xfa\xd3\xc3\xf8\xc2\xac\x11\x0e\x11\x12\x11\x13\x14\x14\x14\x14\x15\x15\x0f\x0e\x10\x11\x10\x12\x12\x10\x13\x15\x15\x14\x14\x15\x14\x11\x12\x12\x11\x11\x12\n\n\n\x13\x11\x13\x0e\x0e\x0e\x03\x06\x07\x0b\x0b\n\x10\x0e\x11\x01\x00\x01\x11\x0f\x11\x0f\x10\x10\xe7\xe7\xe6\x0b\n\x0b\x0b\n\n\x00\x01\x01\xec\xec\xec\x01\x00\x00\x01\x01\x00\n\x0b\x0b\n\n\x0b\xf3\xf3\xf3\n\x0b\n\x00\x01\x00\xf1\xf1\xf1\xfb\xfb\xfb\x15\x14\x15\xff\xff\xff\x14\x14\x15\x15\x14\x14D\x1b\x00\xb9\xa6\x00\xc8\xad\x00\x0f\x0e\x11\x00\x00\x00\xe8\xab\xc3\xb7\x00\x00\x00UtRNS\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x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7\xbaZ\xc6\x9e\xf4Y1\x01\x13\xa47\t\xec\xa7\xeb\x85r\x04)\xc8\x83\xc9z\x81BP\xe7\x97\x8e3\x9d\xe7\xccx.\x01\x90\xd4\x0b\xd5\t\xb2\xf5B\xf5\x102\xf5Be\x82L\xbd\x90u\x99\xd5\x12h\x82\x89S\xac20Q/\x14\x12\xe0\xe3\x8e/;n\x05|\xdb\x07c\x81~\xa6^\xc8\x84\x90\x1d\xcfx0S/\x94"\x18\xa7\x04\xd9z!\xae\x07\x18Sur\x14E\xd1?V\x14\xd0oJ+9\xab\x00\x00\x00\x00IEND\xaeB`\x82'))))
image.save("skins\\UnFamousSoul.png")
if not exists("totems\\pack.png"):
image = Image.open(io.BytesIO(bytearray(b'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\xfa\x00\x00\x00\xfa\x08\x06\x00\x00\x00\x88\xecZ=\x00\x00\x00\tpHYs\x00\x00\x0b\x13\x00\x00\x0b\x13\x01\x00\x9a\x9c\x18\x00\x00\x0e\xbaIDATx\x9c\xed\x9dIh\x15[\x10\x86\xdf*\xf0\xa2q\x88\xe3\xef\x0c\x0e\xa8\x08N\xb8q!\x0e\xb8rc\\\x88(\x8aBV.\\\x88\x08\x82\x13\x8a\xb8\x15\x11Ep\x06q\xdc(\x89(\xe2\xb0\xd3\x85\xb8QQP\x1c\x11Qp\xa1\xb8\x10\xa7~T\xc3\xb9\xdc\\c4\xcf$\xe7t\xd7\xd7P\xdc\xf6\xe6\xde\xbem\xd5\xffU\xd59=\xfd#)\xc3\xf0\x01\x1aP\xa9}\xf0O\xec\x1d\xc0\xf0\x01\x1a\x10\xa0#\x02\x12\x01\x1a\x10\x15\x1d\x11\x90\x08\xd0\x80h\xdd\x11\x01\x89@\xf8\x801:" \x11\xc8\x81\x0f\x98\x8cK \x08\x18>\x10\xa0#\x02\x12\x01\x1a\x10\x15\x1d\x11\x90\x08\xd0\x80h\xdd\x11\x01\x89@\xee}\xc0\x18\x1d\x11\xb8\x87@\x0e4\x00\xe8\t\x04\x01\xc3\x07\x02tD@"@\x03\xa2\xa2#\x02\x12\x01\x1a\x10\xad;" \x11\xc8\xbd\x0f\x18\xa3#\x02\xf7\x10\xc8\x81\x06\x00=\x81 `\xf8@\x80\x8e\x08H\x04h@TtD@"@\x03\xa2uG\x04$\x02\xb9\xf7\x01ctD\xe0\x1e\x029\xd0\x00\xa0\'\x10\x04\x0c\x1f\x08\xd0\x11\x01\x89\x00\r\x88\x8a\x8e\x08H\x04h@\xb4\xee\x88\x80D \xf7>`\x8c\x8e\x08\xdcC \x07\x1a\x00\xf4\x04\x82\x80\xe1\x03\x01:" \x11\xa0\x01Q\xd1\x11\x01\x89\x00\r\x88\xd6\x1d\x11\x90\x08\xe4\xde\x07\x8c\xd1\x11\x81{\x08\xe4@\x03\x80\x9e@\x100| @G\x04$\x024 *:" \x11\xa0\x01\xd1\xba#\x02\x12\x81\xdc\xfb\x801:"p\x0f\x81\x1ch\x00\xd0\x13\x08\x02\x86\x0f\x04\xe8\x88\x80D\x80\x06DEG\x04$\x024 ZwD@"\x90{\x1f0FG\x04\xee!\x90\x03\r\x00z\x02A\xc0\xf0\x81\x00\x1d\x11\x90\x08\xd0\x80\xa8\xe8\x88\x80D\x80\x06D\xeb\x8e\x08H\x04r\xef\x03\xc6\xe8\x88\xc0=\x04r\xa0\x01@O \x08\x18>\x10\xa0#\x02\x12\x01\x1a\x10\x15\x1d\x11\x90\x08\xd0\x80h\xdd\x11\x01\x89@\xee}\xc0\x18\x1d\x11\xb8\x87@\x0e4\x00\xe8\t\x04\x01\xc3\x07\x02tD@"@\x03\xa2\xa2#\x02\x12\x01\x1a\x10\xad;" \x11\xc8\xbd\x0f\x18\xa3#\x02\xf7\x10\xc8\x81\x06\x00=\x81 `\xf8@\x80\x8e\x08H\x04h@TtD@"@\x03\xa2uG\x04$\x02\xb9\xf7\x01ctD\xe0\x1e\x029\xd0\x00\xa0\'\x10\x04\x0c\x1f\x08\xd0\x11\x01\x89\x00\r\x88\x8a\x8e\x08H\x04h@\xb4\xee\x88\x80D \xf7>`\x8c\x8e\x08\xdcC \x07\x1a\x00\xf4\x04\x82\x80\xe1\x03\x01:" \x11\xa0\x01Q\xd1\x11\x01\x89\x00\r\x88\xd6\x1d\x11\x90\x08\xe4\xde\x07\x8c\xd1\x11\x81{\x08\xe4@\x03\x80\x9e@\x100| @G\x04$\x024 *:" \x11\xa0\x01\xd1\xba#\x02\x12\x81\xdc\xfb\x801:"p\x0f\x81\x1ch\x00\xd0\x13\x08\x02\x86\x0f\x04\xe8\x88\x80D\x80\x06DEG\x04$\x024 ZwD@"\x90{\x1f0FG\x04\xee!\x90\x03\r\x00z\x02A\xc0\xf0\x81\x00\x1d\x11t\x95\x08\x86\x0e\x1d\xda\xee:\xa6\xd2\xfb\x80\x8a\xee\xc8\x00]\xd1c\x00\xe8\t8\xa3\xec\x06\xe8\x8a\x1e\x03@O\xc0\x19e\xb6a\xc3\x86e\xfd\xfb\xf7\xcf\xe6\xcd\x9b\x97\xcd\x9f??_\xb7\xf7b\xef\x17\xa6\x1e\xf1\x01\xad\xbb\x93J>b\xc4\x88\xac\xae\xae.\xdb\xb1cG\xb6s\xe7\xce|\xdd\xde\x8b\xbdo\x98\x00\x1d\x11t\x9d\x08\x86\x0f\x1f\x9e\xd5\xd7\xd7g---\xd9\xe5\xcb\x97\xb3^\xbdz\xe5\xef\xe1c\xb9\xf0\x01\x15\xdd\x89\r\x192$o\xd5\x9f?\x7f\x9e\xbd~\xfd:\xaf\xe6\xf6^\xec\xfd\xc2\x04\xe8\x88\xa0k\xda\xf60>\x9f;wn\xf6\xed\xdb\xb7\xec\xc7\x8f\x1f\xd9\xc2\x85\x0b\xb3~\xfd\xfa\xe5U\x9dCm*\xbd\xd6\xa8\xe8\x0e\xcc\xaa\xf7\xbf\xff\xfe\x9bm\xdc\xb81\x0b\xcb\x96-[\xf2\xf7\x18\xa7+z|\x00=\x01\x07\x95\xc1\xac\xa2\xf7\xed\xdb7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6=\xb4\xed\xf6\x9e\xfd\x8d\xb6]\xd1\xe3\x04\xe8\t8\xa9\x0c\x93r\x87\x0f\x1f\xae\xb4\xec\xa1m\xb7\xf7\x98\x84S\xf4\x18\x01z\x02\x0e*\xba\x85Sb\xedb\x95\xda\x8an\xef\x85S^c\xef\'\xa6n\xf5\x01\xb3\xee\x0eDf\x17\xaaL\x9c8\xb1r\x13I[l\xdd\xde\xe3"\x16\xb90@w`v\xb6\x9b\xdd\xc5\xb5\xb5\xb5\xb5\x02\xba\xad\xdb{\x9c\t\xa7\xe8\xf1\x01\xf4\x04\x1cT\x06\x0bw\x9f\xd9\xb4iS\x05t[\x0fw\x91\x89\xbd\x7f\x98\xba\xdd\x07Tt\'Ow\xb1\xea=\x7f\xfe\xfc\xca\x18\xdd\xd6CE\xe7\xc6\x8f\x8a\x1e\'@O\xc0Ie0;\x84f3\xf0/_\xbe\xcc\xcd\xd69\xac\xa6\xe8q\x01\xf4\x04\x9cS&3\xb0\xed2T\x1b\x9b\x9b\xd9:g\xc3)z\\\x00=\x01\xe7\x94\xc5\xc25\xeauuu\xd9\xf6\xed\xdbs\xb3u\xae=W\xf4\xd8\x00z\x02\xce)\x93\xd9X\xbc\xb1\xb11\x9b3gNn\xb6\xce\x8c\xbb\xa2\xc7\x05\xd0\x13pN\x99,L\xb8\xd9k\xf5z\xec\xfd\xc2\xd4#>`\xd6\xdd\x91\xd8\xaa\xc1\x06r\xb92@O \x08\x80\x1e\xdf7*\xb9\x01z\x02A\xc0\xf0\x81\x00\x1d\x11\x90\x08\xd0\x80\xa8\xe8\x88\x80D\x80\x06D\xeb\x8e\x08H\x04r\xef\x03\xc6\xe8\x88\xc0=\x04r\xa0\x01@O \x08\x18>\x10\xa0#\x02\x12\x01\x1a\x10\x15\x1d\x11\x90\x08\xd0\x80h\xdd\x11\x01\x89@\xee}\xc0\x18\x1d\x11\xb8\x87@\x0e4\x00\xe8\t\x04\x01\xc3\x07\x02tD@"@\x03\xa2\xa2#\x02\x12\x01\x1a\x10\xad;" \x11\xc8\xbd\x0f\x18\xa3#\x02\xf7\x10\xc8\x81\x06\x00=\x81 `\xf8@\x80\x8e\x08H\x04h@TtD@"@\x03\xa2uG\x04$\x02\xb9\xf7\x01ctD\xe0\x1e\x029\xd0\x00\xa0\'\x10\x04\x0c\x1f\x08\xd0\x11\x01\x89\x00\r\x88\x8a\x8e\x08H\x04h@\xb4\xee\x88\x80D \xf7>`\x8c\x8e\x08\xdcC \x07\x1a\x00\xf4\x04\x82\x80\xe1\x03\x01:" \x11\xa0\x01Q\xd1\x11\x01\x89\x00\r\x88\xd6\x1d\x11\x90\x08\xe4\xde\x07\x8c\xd1\x11\x81{\x08\xe4@\x03\x80\x9e@\x100| @G\x04$\x024 *:" \x11\xa0\x01\xd1\xba#\x02\x12\x81\xdc\xfb\x801:"p\x0f\x81\x1ch\x00\xd0\x13\x08\x02\x86\x0f\x04\xe8\x88\x80D\x80\x06DEG\x04$\x024 ZwD@"\x90{\x1f0FG\x04\xee!\x90\x03\r\x00z\x02A\xc0\xf0\x81\x00\x1d\x11\x90\x08\xd0\x80\xa8\xe8\x88\x80D\x80\x06D\xeb\x8e\x08H\x04r\xef\x03\xc6\xe8\x88\xc0=\x04r\xa0\x01@O \x08\x18>\x10\xa0#\x02\x12\x01\x1a\x10\x15\x1d\x11\x90\x08\xd0\x80h\xdd\x11\x01\x89@\xee}\xc0\x18\x1d\x11\xb8\x87@\x0e4\x00\xe8\t\x04\x01\xc3\x07\x02tD@"@\x03\xa2\xa2#\x02\x12\x01\x1a\x10\xad;" \x11\xc8\xbd\x0f\x18\xa3#\x02\xf7\x10\xc8\x81\x06\x00=\x81 `\xf8@\x80\x8e\x08H\x04h@TtD@"@\x03\xa2uG\x04$\x02\xb9\xf7\x01ctD\xe0\x1e\x029\xd0\x00\xa0\'\x10\x04\x0c\x1f\x00:" \x11\xa0\x81\x8c\x8a\x8e\x08H\x04h \xa3uG\x04$\x02\xe1\x03\xc6\xe8\x88\x80D\xa0\xf2\xfb\x00\xd0\x13\x08\x02\x86\x0f\x04\xe8\x88\x80D\x80\x06DEG\x04$\x024 ZwD@"\x90{\x1f0FG\x04\xee!\x90\x03\r\x00z\x02A\xc0\xf0\x81\x00\x1d\x11\x90\x08\xd0\x80\xa8\xe8\x88\x80D\x80\x06D\xeb\x8e\x08H\x04r\xef\x03\xc6\xe8\x88\xc0=\x04r\xa0\x01@O \x08\x18>\x10\xa0#\x02\x12\x01\x1a\x10\x15\x1d\x11\x90\x08\xd0\x80h\xdd\x11\x01\x89@\xee}\xc0\x18\x1d\x11\xb8\x87@\x0e4\x00\xe8\t\x04\x01\xc3\x07\x02tD@"@\x03\xfaK\x1f\xfc\x07\x1b\xc4\xd0\xa7\xfd\x93p\xb8\x00\x00\x00\x00IEND\xaeB`\x82')))
image.save("totems\\pack.png")
self.directory = pathlib.Path(self.SKINS_DIR)
pack_mcmeta_path = os.path.join(self.TOTEMS_DIR, self.PACK_MC_META)
if not os.path.exists(pack_mcmeta_path):
with open(pack_mcmeta_path, "w+") as prop_file:
prop_file.write('{"pack":{"pack_format":9,"description":"§fTotem pack'
'\n§fMade with: §cSTT§f!\n§fBy: §cUnFamousSoul"}}')
def run(self):
for item in self.directory.iterdir():
if item.is_file():
self.make_totem(item)
@staticmethod
def head(skin, uol):
head = Image.new("RGBA", (8, 8))
head.paste(skin.crop((9, 8, 15, 9)), (1, 0))
head.paste(skin.crop((8, 9, 16, 16)), (0, 1))
if uol:
l21 = skin.crop((40, 8, 48, 9))
l22 = skin.crop((40, 9, 48, 16))
head.paste(l21, (0, 0), l21)
head.paste(l22, (0, 1), l22)
return head
@staticmethod
def body(skin, uol):
body = Image.new("RGBA", (8, 4))
body.paste(skin.crop((20, 21, 28, 22)), (0, 0))
body.paste(skin.crop((20, 23, 28, 24)), (0, 1))
body.paste(skin.crop((20, 29, 28, 30)), (0, 2))
body.paste(skin.crop((20, 31, 28, 32)), (0, 3))
if uol:
l21 = skin.crop((20, 37, 28, 38))
l22 = skin.crop((20, 39, 28, 40))
l23 = skin.crop((20, 45, 28, 46))
l24 = skin.crop((20, 47, 28, 48))
body.paste(l21, (0, 0), l21)
body.paste(l22, (0, 1), l22)
body.paste(l23, (0, 2), l23)
body.paste(l24, (0, 3), l24)
return body
@staticmethod
def legs(skin, uol):
legs = Image.new("RGBA", (6, 3))
legs.paste(skin.crop((4, 20, 5, 22)), (0, 0))
legs.paste(skin.crop((6, 20, 8, 22)), (1, 0))
legs.paste(skin.crop((20, 52, 22, 54)), (3, 0))
legs.paste(skin.crop((23, 52, 24, 54)), (5, 0))
legs.paste(skin.crop((4, 31, 5, 32)), (1, 2))
legs.paste(skin.crop((7, 31, 8, 32)), (2, 2))
legs.paste(skin.crop((20, 63, 21, 64)), (3, 2))
legs.paste(skin.crop((23, 63, 24, 64)), (4, 2))
if uol:
l21 = skin.crop((4, 36, 5, 38))
l22 = skin.crop((6, 36, 8, 38))
l23 = skin.crop((4, 52, 6, 54))
l24 = skin.crop((7, 52, 8, 54))
legs.paste(l21, (0, 0), l21)
legs.paste(l22, (1, 0), l22)
legs.paste(l23, (3, 0), l23)
legs.paste(l24, (5, 0), l24)
l25 = skin.crop((4, 47, 5, 48))
l26 = skin.crop((7, 47, 8, 48))
l27 = skin.crop((4, 63, 5, 64))
l28 = skin.crop((7, 63, 8, 64))
legs.paste(l25, (1, 2), l25)
legs.paste(l26, (2, 2), l26)
legs.paste(l27, (3, 2), l27)
legs.paste(l28, (4, 2), l28)
return legs
@staticmethod
def arms(skin, uol):
arms = Image.new("RGBA", (14, 3))
arms.paste(skin.crop((37, 52, 40, 54)).rotate(90, expand=True), (11, 0))
arms.paste(skin.crop((44, 20, 47, 22)).rotate(-90, expand=True), (1, 0))
arms.paste(skin.crop((39, 63, 40, 64)), (13, 0))
arms.paste(skin.crop((36, 63, 37, 64)), (13, 1))
arms.paste(skin.crop((44, 31, 45, 32)), (0, 0))
arms.paste(skin.crop((47, 31, 48, 32)), (0, 1))
if uol:
l21 = skin.crop((53, 52, 56, 54)).rotate(90, expand=True)
l22 = skin.crop((44, 36, 47, 38)).rotate(-90, expand=True)
l23 = skin.crop((55, 63, 56, 64))
l24 = skin.crop((52, 63, 53, 64))
l25 = skin.crop((44, 47, 45, 48))
l26 = skin.crop((47, 47, 48, 48))
arms.paste(l21, (11, 0), l21)
arms.paste(l22, (1, 0), l22)
arms.paste(l23, (13, 0), l23)
arms.paste(l24, (13, 1), l24)
arms.paste(l25, (0, 0), l25)
arms.paste(l26, (0, 1), l26)
return arms
def make_totem(self, user, uol=True):
if not user.parts[-1].endswith(".png"):
user = user.with_suffix(".png")
nickname = user.stem.lower()
canvas = Image.new("RGBA", (16, 16))
skin = Image.open(user).convert("RGBA")
torso = self.body(skin, uol)
head = self.head(skin, uol)
legs = self.legs(skin, uol)
arms = self.arms(skin, uol)
canvas.paste(arms, (1, 8))
canvas.paste(legs, (5, 13))
if skin.size[1] == 32:
canvas.paste(ImageOps.mirror(canvas.crop((0, 0, 8, 16))), (8, 0))
canvas.paste(torso, (4, 9))
canvas.paste(head, (4, 1))
filename = f"{nickname}.png"
filepath = os.path.join(self.TOTEMS_DIR, self.ASSETS_DIR, self.MINECRAFT_DIR, self.OPTIFINE_DIR,
self.CIT_DIR, self.TOTEM_OF_UNDYING_DIR, filename)
canvas.save(filepath)
prop_file_content = 'type=item\nmatchItems=totem_of_undying\ntexture={N}.png\nnbt.display.Name=ipattern:{N}'
with open(os.path.join(self.TOTEMS_DIR, self.ASSETS_DIR, self.MINECRAFT_DIR, self.OPTIFINE_DIR,
self.CIT_DIR, self.TOTEM_OF_UNDYING_DIR, f"{nickname}.properties"), "w+") as prop_file:
prop_file.write(prop_file_content.format(N=nickname))
if __name__ == "__main__":
stt = STT()
stt.run()