started equations
This commit is contained in:
parent
6a446e1b18
commit
b8dc55d194
|
@ -464,6 +464,13 @@ class YTDServerFactory(ServerFactory):
|
|||
player.buff_type.pack_varint(1), # Player entry count
|
||||
player.buff_type.pack_uuid(removed.uuid)) # Player UUID
|
||||
|
||||
@staticmethod
|
||||
def func(cx, cy, cz, xi, yi, zi):
|
||||
x = cx * 16 + xi
|
||||
y = cy * 16 + yi
|
||||
z = cz * 16 + zi
|
||||
return x*x/20 + y*y/10 <= z*z/30
|
||||
|
||||
def generate(self, x, z):
|
||||
# array[y][z][x]
|
||||
array = lambda x, y, z: (y * 16 * 16) + (z * 16) + x
|
||||
|
@ -471,13 +478,9 @@ class YTDServerFactory(ServerFactory):
|
|||
sections = []
|
||||
for _ in range(CHUNKS_TALL):
|
||||
sections.append(BlockArray.empty(REGISTRY))
|
||||
for sec in sections:
|
||||
for y, sec in enumerate(sections):
|
||||
for i, xi, yi, zi in chunk_range():
|
||||
if xi == yi and yi == zi:
|
||||
sec[i] = BLOCK_SURFACE
|
||||
elif xi == (yi+1)%16 and (yi+1)%16 == zi:
|
||||
sec[i] = BLOCK_SUBSURFACE
|
||||
elif xi == (yi+2)%16 and (yi+2)%16 == zi:
|
||||
if self.func(x,y%3,z,xi,yi,zi):
|
||||
sec[i] = BLOCK_UNDERGROUND
|
||||
height_map = NBT.TagRoot({'':NBT.TagCompound({'MOTION_BLOCKING':NBT.TagLongArray(PackedArray.empty_height())})})
|
||||
return sections, height_map
|
||||
|
|
Loading…
Reference in New Issue