Change logger format and accelerate empty mapblock init
- Map: Do not create and store name/id mappings for each one of the 4096 air nodes set when initiating an empty mapblock - Logger: Use `module` rather than `name` for the format
This commit is contained in:
parent
98fcc450be
commit
85e133c0dc
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
__pycache__/
|
||||
*.sqlite
|
||||
*.mts
|
||||
env/
|
||||
|
@ -10,7 +10,7 @@ import logging
|
||||
def init_logging(debug=False):
|
||||
logger = logging.getLogger()
|
||||
|
||||
formatter = logging.Formatter("%(asctime)s %(name)s:%(funcName)-25s:%(lineno)-4s %(levelname)-8s %(message)s")
|
||||
formatter = logging.Formatter("%(asctime)s %(module)s:%(funcName)-25s:%(lineno)-4s %(levelname)-8s %(message)s")
|
||||
|
||||
strhandler = logging.StreamHandler()
|
||||
strhandler.setLevel(logging.DEBUG)
|
||||
|
@ -62,8 +62,9 @@ class MapBlock:
|
||||
|
||||
for x in range(4096):
|
||||
self.set_node(x, Node("air"))
|
||||
self.name_id_mappings = self.create_name_id_mappings()
|
||||
self.num_name_id_mappings = len(self.name_id_mappings)
|
||||
|
||||
self.name_id_mappings = self.create_name_id_mappings()
|
||||
self.num_name_id_mappings = len(self.name_id_mappings)
|
||||
|
||||
def create_name_id_mappings(self):
|
||||
names = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user