ROCEndRegen 1.0

regenerate unused regions of you map

  1. fastlockel
    This plugin is designed for server owner with large world maps and who are using MySql database with grief preventions plugins.

    I share my contribution but if you do not understand how the plugin works : don't use it.

    Requirement : some of the following (or SQL knowledge to adapt queries) : if you have a lot of them the plugin will be much more reliable.

    # Preciousstones
    # worldguard
    # CoreProtect
    # LWC
    # QUICKSHOP
    # BungeeWarps
    # BungeeSpawns
    # BungeeHomes
    # JAILS 3
    # PlotMe

    Commands :
    rocend [ reload | regen | respawn | egg | purgeps | purgeregions <|simul|force>]

    *) rocend reload
    reload configuration file

    *) rocend respawn

    Must be used in the end
    Respawn the ender dragon.
    However to avoid XP Cheaters a cooldown is added in config file :
    # Timer (cooldown) for enderdragon respawn
    RespawnDelay: 30


    On my server I used it as a command bloc, check ip mc.rochefortlesmines.fr and go to the end to test.

    When the enderdragon dies, the xp is no longer dropped on the ground for the closest player.
    # share XP in kill ratio and best player get the egg
    ShareXP: true


    in the config file share the XP in prorata of damages to the enderdragon.
    The best player get the egg

    *) rocend egg
    Drop enderdragon egg
    Could be used with a command bloc.

    *) rocend purgeps
    Remove PreciousStones plugin claimss in mysql for players who have not connected since 120 days.
    Duration is set in config file :
    preciousstones:
    day-inactivity: 120


    *) rocend purgeregions
    accept optional arguments
    > rocend purgeregions simulate
    starts the command bu do NOT archive region files
    > rocend purgeregions
    with no args starts the command but stop in case of any error
    > rocend purgeregions force
    starts the command and archive whatever happens

    How is it working ???

    This is checking regions files from the specified worlds in the config file:

    regions:
    world:
    name:
    - 'world'
    purge: true
    archive: true


    Then move all regions files to the /archive directory when :

    - no lock is found on chests doors ... (using LWC)
    - no worldguard region is set
    - no precious stone or cuboid is found
    - no jail is found (Jail 3)
    - no shop is found
    - no bungee spaw is found
    - no bungee home is found
    - no bloc has move in conreprotect (I keeep 10 days)
    - no plotme area is found
    - no bungewarp is set to that location

    In case of ISSUE :
    move /archive directory content back to /region directory

    or more selective, check X Z coordinate of the issue
    and copy the region file back to region directory

    The region file name for x z can be found in game using F3
    or here
    https://dinnerbone.com/minecraft/tools/coordinates/

    PERMISSIONS:
    Code (Text):
     rocend.*:
        description: >
          Allow all commands.
        children:
          rocend.reload: true
          rocend.regen: true
          rocend.respawn: true
          rocend.purgeregions: true
          rocend.purgeps: true
      rocend.reload:
        description: >
          Reloads plugin.
        default: op
      rocend.regen:
        description: >
          Regen the end area .
        default: op
      rocend.respawn:
        description: >
          Respawn the enderdragon
        default: op
      rocend.purgeregions:
        description: >
          Archive unused Regions
        default: op
      rocend.purgeps:
        description: >
          Archive inactive PS infos
        default: op
     

    How to check ?


    I am using minecraft overviewer to check map before and after:
    for example : http://map.rochefortlesmines.fr

    You can also set POI on the map and ensure they are nor removed.

    SOURCE CODE:

    https://github.com/fastlockel/ROCEndRegen

    Please feeel free to aadappt or complete the queries from the config file.

    My example config file below

    Code (Text):
    # Timer  (cooldown) area regen
    RegenDelay: 30
    # Timer  (cooldown) for enderdragon respawn
    RespawnDelay: 30
    # share XP in kill ratio and best player get the egg
    ShareXP: true
    # Give Egg (false) or Drop egg (true)
    DropEgg: true
    mysql:
      use: true
      host: 'localhost'
      port: 3306
      database: 'minecraft'
      user: 'minecraft'
      password: 'MinePwd'
    preciousstones:
      day-inactivity: 120
      queries:
      # world=? first sin where clauses.
      - 'delete from pstone_cuboids where world=? and last_used < ? and owner in (select player_name from pstone_players where last_seen < ?)'
      - 'delete from pstone_fields where world=? and last_used < ? and owner in (select player_name from pstone_players where last_seen < ?)'
      - 'delete from pstone_snitches where world=? and date < ? and name in (select player_name from pstone_players where last_seen < ?)'
      - 'delete from pstone_unbreakables where world=? and owner in (select player_name from pstone_players where last_seen < ?)'
      - 'delete from pstone_storedblocks where world=? and player_name in (select player_name from pstone_players where last_seen < ?)'
      - 'delete from pstone_translocations where player_name in (select player_name from pstone_players where last_seen < ?)'
      - 'delete from pstone_players where last_seen < ?'
    regions:
      world:
        name:
        - 'world'
        purge: true
        archive: true
        # must return x and y
        query_points:
          # LWC
          - 'select x, z from lwc_protections where world=? order by x,z'
          # QUICKSHOP
          - 'select x, z from shops where world=? order by x,z'
          # BungeeWarps
          - 'select x, z from BungeeWarps where world=? order by x,z'
          # BungeeSpawns
          - 'select x, z from BungeeSpawns where world=? order by x,z'
          # BungeeHomes
          - 'select x, z from BungeeHomes where world=? order by x,z'
          # JAILS 3
          - 'select `tp.x` as x, `tp.z` as z from j3_cells order by x,z'
          # Preciousstones
          - 'select x, z from pstone_unbreakables where world=? order by x,z'
          - 'select x, z from pstone_storedblocks where world=? order by x,z'
          - 'select x, z from pstone_snitches where world=? order by x,z'
          - 'select x, z from pstone_grief_undo where world=? order by x,z'
          - 'select field_x as x, field_z as z from pstone_grief_undo where world=? order by x,z'
          - 'select x,z from pstone_fields where world=? order by x,z'
          # CoreProtect
          - 'select x, z from co_sign,co_world where co_sign.wid=co_world.id and co_world.world=? order by x,z'
          - 'select x, z from co_session,co_world where co_session.wid=co_world.id and co_world.world=? order by x,z'
          - 'select x, z from co_container,co_world where co_container.wid=co_world.id and co_world.world=? order by x,z'
          - 'select x, z from co_block,co_world where co_block.wid=co_world.id and co_world.world=? order by x,z'
        # must return minx,maxx and minzz, maxz
        query_areas:
          # worldguard
          - 'select min_x, min_z, max_x, max_z from region_cuboid,world where region_cuboid.world_id=world.id and world.name=? order by min_x, min_z'
          # Preciousstones
          - 'select (x-radius) as min_x, (x+radius) as max_x, (z-radius) as min_z, (z+radius) as max_z from pstone_fields where world=? order by min_x, min_z'
          - 'select minx as min_x, maxx as max_x, minz as min_z, maxz as max_z from pstone_cuboids where world=? order by min_x, min_z'
          # PlotMe
          - 'select bottomx as min_x, topx as max_x, bottomz as min_z, topz as max_z from plotmePlots where world=? order by min_x, min_z'
    Add extra control and Plugins :
    You can integrate ANY sql table to the protected area list :
    you just need to be able to extract a point (x z) or an area (min_x max_x, min_z, max_z) and add your query at the end of existing queries.

    You can safely modify and remove any of existing query if do not use this protection plugin.

    Create you own table with entries (x z) or an area (min_x max_x, min_z, max_z) if you wand to have custom protected areas (line -1000 1000 -1000 1000 for instance)
    RedGloomy likes this.

Recent Reviews

  1. kemal895
    kemal895
    5/5,
    Version: 1.0
    Nice plugin dude :)