proper block updating

This commit is contained in:
gnembon committed 2019-07-10 13:07:54 -03:00
1 parent a62d4d73af
commit 6871ac027c
2 files changed
+12 -18

No files matched your search

@@ -38,7 +38,6 @@ public class CarpetScriptServer
public boolean stopAll;
Set<String> holyMoly;
public CarpetEventServer events;
private Set<Pair<ServerWorld,ChunkPos>> modifiedChunks = new HashSet<>();
public static List<ModuleInterface> bundledModuleData = new ArrayList<ModuleInterface>(){{
add(new CameraPathModule());
@@ -332,23 +331,8 @@ public class CarpetScriptServer
return true;
}
void markChunkForUpdate(ServerWorld world, BlockPos pos)
{
modifiedChunks.add(Pair.of(world, new ChunkPos(pos)));
}
public void tick()
{
for (Pair<ServerWorld,ChunkPos> tuple : modifiedChunks)
{
//ChunkDataS2CPacket
ServerWorld world = tuple.getLeft();
ChunkPos chpos = tuple.getRight();
Chunk chunk = world.getChunk(chpos.x, chpos.z);
//.....
}
modifiedChunks.clear();
events.tick();
}
}