-
Notifications
You must be signed in to change notification settings - Fork 1
/
globals.py
180 lines (122 loc) · 4.17 KB
/
globals.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
175
176
177
178
179
180
import os
import sys
# local directory
local = os.path.dirname(sys.argv[0])
# the blockhandler instance mainly used
blockhandler = None
# the main block interface. all blocks should include this
iblockclass = None
# reference to the BlockReference-class
blockreferenceclass = None
# generatehighmodel = None
# handler for all blocks. see Block.block
blockhandler = None
# super class for Blocks. see Block.block
blockclass = None
# class for IBlockInstances. see Block.block
blockinst = None
# handler for inventorys. see Inventory.inventory
inventoryhandler = None
# super class for inventorys. see Inventory.inventory
inventoryclass = None
# super class for inventorycollections. see Inventory.inventory
inventorycollection = None
# super class and object class for an inventory slot. see Inventory.inventory
inventoryslot = None
# handler for items. see Item.item
itemhandler = None
# super class for items. see Item.item
itemclass = None
# (not good) tickhandler. see TickHandler
tickhandler = None
# handler for biomes. see biomes.biome
biomehandler = None
# super class for biomes. see biomes.biome
biomeclass = None
# a handler for everything which is callen during runtime - only some direct-events are callen direct from pyglet
eventhandler = None
# (not good) multiblockhandler. see multiblock
multiblockhandler = None
# entity handler. see entity.entity
entityhandler = None
# super class for entitys. see entity.entity
entityclass = None
# handler for all you hear - out of the game. see soundhandler
soundhandler = None
# handler for everthing that can be definited and is not to big - like trees. see structur
structurhandler = None
# handler for everything you can make out of other things. like crafting an craftingtable
craftinghandler = None
# handler for everything you can trigger when you are entering something into chat. see command.Command
commandhandler = None
# super class for commands. see command.Command
commandclass = None
# handler for the selection of who you want to do with. see command.selector
selectorhandler = None
# handler for the diffrent looks of the window - may be callen states. see state.State
statehandler = None
# handler for the diffrent worlds. see Dimensions
dimensionhandler = None
# handler for the things that objects can have - some tags which they have like others. see notations
notationhandler = None
# handler for the ability to store things
storagehandler = None
# The active state of game
State = None
# super class for all Mods. see ModLoader
mod = None
# list of all loaded mods
MODS = []
# handler for all mods. see ModLoader
modloader = None
# the chat of the game. see chat
chat = None
# the active model of the whole world. see model
model = None
# the active window. see window
window = None
# ok, that's you. Don't ask what is stored there. Or if you want, look in player.py
player = None
# system for images
textureatlashandler = None
# system for what it look like
modelhandler = None
# system for what you give us to run with
argumenthandler = None
# system for scoreboards
scoreboardhandler = None
import random
# the seed of the world. is overwritten when loading an world
seed = random.randint(-1000, 1000) * 10
# outdated gen objects
# HighMAP = {}
# TemperaturMAP = {}
# BiomeMAP = {}
# NoiseMap = {} #chunk -> (x, z) -> positions
# a usefull system for blocks which should be setted step by step
BlockGenerateTasks = {} # position -> [<name>, optional:<data>]
GeneratedSectors = []
# game stage representing an stage
# 0: not-started
# 1: loading mods
# 2: generating world
# 3: game running
GAMESTAGE = 0
# language system. see language
class LANG:
active = None
with open(local + "/version.info") as f:
_data = f.read()
_line = None
for l in _data.split("\n"):
if not l.startswith(" ") and l != "" and not "fix" in l:
_line = l
VERSION_NAME = _line.split(" ")[1][:-1]
# format: [YEAR][WEEK][VERSION_PRE_FROM_LETTER]
LETTER_DICT = {}
for i, e in enumerate(list("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")):
LETTER_DICT[e] = i
def convertNameToId(name):
return int("20" + name[:2] + name[3:5] + str(LETTER_DICT[name[5]]))
VERSION_ID = convertNameToId(VERSION_NAME)
SPAWNPOINT = (0, 0, 0)