Paste #16964: Edit of P#16955 - Edit of P#16952 - Chunk Remover

Date: 2015/06/25 20:37:10 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


RunTasks: 
    type: world 
    debug: false 
    events: 
    on server start: 
        - run ChunkOverload 
RemoveExcessChunks: 
    type: task 
    debug: false 
    script: 
        - define chunks <w@DeepOceans.loaded_chunks> 
        - foreach <def[chunks]> {
            - if <def[value].cuboid.center.distance[<player.location>]> > 64 {
                - if <def[value].entities.filter[entity_type.contains[player]]> {
                    - if !<def[value].is_loaded> {
                      - adjust <def[value]> load
                      - queue clear
                      } else {
                      - adjust <def[value]> unload
                    }
                }
            }
        } 

        - wait 30s 
        - run ChunkOverload