This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/bravo/packets.py b/bravo/packets.py | |
index 400f09b..43d04e5 100644 | |
--- a/bravo/packets.py | |
+++ b/bravo/packets.py | |
@@ -73,6 +73,9 @@ metadata = Struct("metadata", | |
), | |
Const(UBInt8("terminator"), 0x7f), | |
) | |
+from construct import StringAdapter, RepeatUntil, Field | |
+metadata = StringAdapter(RepeatUntil(lambda obj, ctx: obj == "\x7f", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/bravo/chunk.py b/bravo/chunk.py | |
index 1b53573..6d6d519 100644 | |
--- a/bravo/chunk.py | |
+++ b/bravo/chunk.py | |
@@ -198,7 +198,8 @@ class Chunk(object): | |
while glow: | |
for coords in spread: | |
- if coords[2] > max_height: | |
+ if lightmap[coords] <= glow: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import time | |
from bravo.chunk import Chunk | |
from bravo.plugins.generators import simplex, caves | |
def average(l): | |
return sum(l) / len(l) | |
def stddev(l): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from ampoule import child, util | |
from twisted.protocols import amp | |
class Test(amp.Command): | |
response = [("blocks", amp.String())] | |
class MyChild(child.AMPChild): | |
@Test.responder | |
def test(self): | |
return {"blocks": '\x00'*4073} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Block(object): | |
""" | |
Block IDs this class is responsible for. | |
""" | |
slots = tuple() | |
def build(self, factory, player, x, y, z, face): | |
""" | |
Called when a player places a block of this type. |
NewerOlder