fix server
This commit is contained in:
parent
3a6df05fb7
commit
8e007763bf
5 changed files with 34 additions and 28 deletions
21
server/src/world.py
Normal file
21
server/src/world.py
Normal file
|
@ -0,0 +1,21 @@
|
|||
from player import Player
|
||||
from block import Block
|
||||
|
||||
def getPlayers():
|
||||
global WORLD
|
||||
for b in WORLD:
|
||||
if type(b) == Player:
|
||||
yield b
|
||||
|
||||
def getPlayer(name):
|
||||
global WORLD
|
||||
for b in WORLD:
|
||||
if type(b) == Player:
|
||||
if b.name == name:
|
||||
return b
|
||||
|
||||
WORLD = [
|
||||
Block(-1, -1, "normal", "#555", True),
|
||||
Block(0, -1, "spawn", "#2ad", True),
|
||||
Block(1, -1, "normal", "#555", True)
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue