-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathFireworkGenerator.py
More file actions
59 lines (59 loc) · 2.4 KB
/
FireworkGenerator.py
File metadata and controls
59 lines (59 loc) · 2.4 KB
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
from tkinter import Tk
def askCopyClip(nbt):
if input('COPY TEXT TO CLIPBOARD? (Y\\N) >').lower() != 'n':
r = Tk()
r.withdraw()
r.clipboard_clear()
r.clipboard_append(nbt)
r.update()
r.destroy()
explosions = []
flightDur = input('ENTER FLIGHT DURATION (DEFAULT: 1) >')
try:
int(flightDur)
except:
print ('INCORRECT FLIGHT DURATION. SETTING TO 1')
flightDur = '1'
print ('PRESS CTRL+C ONCE YOU HAVE FINISHED INPUTTING THE EXPLOSIONS')
while True:
try:
twinkle = input('DOES CURRENT EXPLOSION HAVE TWINKLE? (Y\\N) >')
if twinkle.lower() != 'y':
twinkle = '0'
else:
twinkle = '1'
trail = input('DOES CURRENT EXPLOSION HAVE TRAIL? (Y\\N) >')
if trail.lower() != 'y':
trail = '0'
else:
trail = '1'
#colors = []#'BCC458'#input('ENTER FIREWORK COLOR (YOU CAN GET THE DECIMAL COLORS FROM https://www.mathsisfun.com/hexadecimal-decimal-colors.html) >')
#print ('PRESS CTRL+C WHEN YOU ARE DONE INPUTTING THE DYE COLORS. THE DYE VALUES CAN BE FOUND AT https://minecraft.gamepedia.com/Dye#Item_data , IN THE "DEC" COLUMN UNDERNEATH THE "DATA" COLUMN')
#while True:
# try:
# color = input('ENTER DYE VALUE >')
# try:
# int(color)
# colors.append(color)
# except:
# print ('INCORRECT COLOR')
# except KeyboardInterrupt:
# break
#colorNBT = str(colors)
#colorNBT = colorNBT.replace(' ', '').replace('\'', '')
#print (colors)
#print (colorNBT)
print ('DUE TO A LIMIT IN NBT DATA EDITING, ADDING CUSTOM COLORS ISN\'T POSSIBLE. SORRY FOR ANY INCONVINIENCE.')
print ('FIREWORK TYPES:\n- 0 : SMALL BALL\n- 1 : LARGE BALL\n- 2 : STAR SHAPED\n- 3 : CREEPER SHAPED\n- 4 : BURST')
type_ = input('SELECT A FIREWORK TYPE >')
explosion = '{FireworkFade:,FireworkFlicker:'+twinkle+'b,FireworkTrail:'+trail+'b,FireworkType:'+type_+'b}'
explosions.append(explosion)
except KeyboardInterrupt:
break
nbt = '{Fireworks:{Explosions:['
for i in explosions:
nbt = nbt + i + ','
nbt = nbt + '],Flight:'+flightDur+'b}}'
print ('USE [.nbt write] WHILE HOLDING A FIREWORK ROCKET TO APPLY EFFECTS')
print (nbt)
askCopyClip(nbt)