RollbackCore [1.4.7-1.20.3+] icon

RollbackCore [1.4.7-1.20.3+] -----

Aggressively rollback arenas without lag! Easy integration! Scalable!



RollbackCore is a rollback plugin designed to aggressively rollback arenas of any size! It can also be used to paste things depending on how you use it. It can be integrated into any bukkit/spigot plugin using the API.

I also added some command support, allowing you to backup regions without code! You can even integrate it with this SG plugin (see below).

Features:
  • Works across 1.4.7 - 1.20.3+ (the 1.12.2 and older format will automatically update to 1.13+'s format. Sorry, no 1.13 -> 1.12 converter exists at the moment)
  • Progressive, splits operation to prevent hanging the server.
  • Configurable time spent on operations per tick to minimize lag and maximize operation rate.
  • Compression built in to save hard drive space.
  • Highly optimized.
  • Version independent due to only using Java Libraries and Spigot APIs (So it won't break when the next version of Minecraft comes out)
  • Stores sign text, skull head owners (1.13+), and command block commands (1.13+).
  • New WatchDogRegion [BETA] for greater scalability!
  • New WholeWorldRollback [EXPERIMENTAL] for greater scalability!
Commands and permissions and Configuration:
Please see the wiki: https://bitbucket.org/lizardfreak321/rollbackcore/wiki/Home

Integration with Wazup92's SurvivalGames plugin:
The tutorial I made explains everything:


BlockData Updates:
RollbackCore allows the server admin to specify BlockData update in case RollbackCore is out of date, but Minecraft changes a block.
An example of a BlockData update is Minecraft signs. In 1.13, a sign's blockdata was "minecraft:sign". In 1.14, the blockdata was changed to "minecraft: oak_sign"
Here is the update file in the Jar file that specifies the current updates as of 1.20.3:
Code (YAML):

1-20-3
:
  1-20-2
:
    - from
: "\\bgrass\\b"
      to
: "short_grass"
1-20-2
:
  1-20-1
: [ ]
1-20-1
:
  1-20
: [ ]
1-20
:
  1-19-4
: [ ]
1-19-4
:
  1-19-3
: [ ]
1-19-3
:
  1-19-2
: [ ]
1-19-2
:
  1-19-1
: [ ]
1-19-1
:
  1-19
: [ ]
1-19
:
  1-18-2
: [ ]
1-18-2
:
  1-18-1
: [ ]
1-18-1
:
  1-18
: [ ]
1-18
:
  1-17-1
: [ ]
1-17-1
:
  1-17
: [ ]
1-17
:
  1-16-5
:
  - from
: "grass_path"
    to
: "dirt_path"
1-16-5
:
  1-16-4
: [ ]
1-16-4
:
  1-16-3
: [ ]
1-16-3
:
  1-16-2
: [ ]
1-16-2
:
  1-16-1
: [ ]
1-16-1
:
  1-16
: [ ]
1-16
:
  1-15-2
: [ ]
1-15-2
:
  1-15-1
: [ ]
1-15-1
:
  1-15
: [ ]
1-15
:
  1-14-4
: [ ]
1-14-4
:
  1-14-3
: [ ]
1-14-3
:
  1-14-2
: [ ]
1-14-2
:
  1-14-1
: [ ]
1-14-1
:
  1-14
: [ ]
1-14
:
  1-13-2
:
  - from
: "\\bsign(.*)"
    to
: "oak_sign$1"
  - from
: "\\bwall_sign(.*)"
    to
: "oak_wall_sign$1"
1-13-2
:
  1-13-1
: [ ]
1-13-1
:
  1-13
: [ ]
 
The versions on the left side are the "to" version, and the versions nested inside of them are the "from" version.
For an update to work, there must be a full path from the 'from' version to the 'to' version. An update will work even if it is incorrect, so in the event that the conversion failed, use the backup file (with the dat_old file extension) by renaming the file extension to .dat, fix the conversion, then try again. Backups are recommended to prevent data loss.

Empty updates just have a pair of square brackets [] to specify that there are no changes.

Now, regarding the actual replacements.
The \\b at the beginning of sign means that it starts with "sign". This prevents it from updating "oak_sign" to "oak_oak_sign".
The (.+) captures the rest of the blockdata, because the full blockdata of a sign has a section in square brackets [] that specifies the direction.
The $1 references the capture to put it in the replacement.
The replacement uses regular expressions, so please be aware that regex can make a replacement behave differently than a standard replacement.
The config uses YAML, which is very picky. Please learn how to use yaml before attempting to use this.

To do custom updates, use (or create if it isn't there already) a root configuration section called "custom-mappings:" within the config file, and use the same format as used above.

API documentation:
https://www.shadowxcraft.net/javadocs/rollbackcore/
A simple and easy API that any developer can use!
For additional information about which class should be used where, please see the wiki https://bitbucket.org/lizardfreak321/rollbackcore/wiki/Home


Maven Repository:
RollbackCore is available on the JitPack repository.

https://jitpack.io/#null321-jared/rollbackcore/
Code (Text):
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>
<dependency>
    <groupId>com.github.null321-jared</groupId>
    <artifactId>rollbackcore</artifactId>
    <version>replace-with-newest-version</version>
</dependency>
https://jitpack.io/#null321-jared/rollbackcore-legacy/

Use the version relevant to your plugin, but the API is mostly compatible.


Java code example:

Import the RollbackCore classes at the top of your class:
Code (Text):
import net.shadowxcraft.rollbackcore.*;
If that is not working, you likely have not added RollbackCore to your java project. In eclipse, right click on the project, click properties, then "Java Build Path", then "Libraries", then "Add External JARs...". Locate your copy of rollbackcore, click on it, click open, and then click apply.

Let's say you have all of these instance variables in your class:
Code (Java):
Location min ; // The minimum location of the region that needs to be saved
Location max ; // The maximum location of the region that needs to be saved
Plugin yourPlugin ; // The instance of your java plugin. This is the class that extends JavaPlugin.
String arenaName ; // The name of the arena, for example.
String prefix ; // The prefix of the rollbackcore messages.
And the following parameters in your current method:
Code (Text):
(CommandSender sender) // The person to send the status messages to. Use null for nobody.
You can then call copy like this:
Code (Java):
new Copy (min, max, yourPlugin. getDataFolder ( ) + "/arenas/" + arenaName. toLowerCase ( ),
   sender, prefix ). run ( ) ;
Which would save the region into a folder inside of your plugin folder called "arenas".
Here is my KitPVP arenas folder using this code:
upload_2018-11-11_9-7-21.png

You can then call paste like this:
Code (Java):
new Paste (min, yourPlugin. getDataFolder ( ) + "/arenas/" + arenaName. toLowerCase ( ),
   sender, true /*Clear entities*/, false /*Don't ignore air*/, prefix )
   . run ( ) ;
Here is what it looks like when you set sender to your player:
upload_2018-11-11_9-11-46.png
Or if I replace the entire arena with air: upload_2018-11-11_9-13-45.png

Skript:
Skript support enables you to listen for RollbackCore events.
RollbackCore supports Skript 2.6.4 on the legacy version, and 2.7.2 on the latest version.

Skript events:
%event-string% is the string of the EndStatus enum.
%event-location% is the location of the min x, y, and z of the region.

Code (Text):
on rollbackcore copy end:
    broadcast "Copy ended! Status: %event-string%, Location: %event-location%"
 
on rollbackcore paste end:
    broadcast "Paste ended! Status: %event-string%, Location: %event-location%"
 
on rollbackcore entityclear end:
    broadcast "Entity Clear ended! Status: %event-string%, Location: %event-location%"
 
on rollbackcore wdimport end:
    broadcast "WDImport ended! Status: %event-string%, Location: %event-location%"

on rollbackcore wdrollback end:
    broadcast "WDRollback ended! Status: %event-string%, Location: %event-location%"

Open source:

This plugin is open source under the LGPL license.
The current source is here: https://github.com/null321-jared/rollbackcore
The legacy source is here: https://github.com/null321-jared/rollbackcore-legacy

Soft dependencies:
There are no required dependencies, the plugin works fine by itself, but some of the commands require worldedit. When using the API, there is no need for worldedit.

Worldedit's Bukkit page is here:
https://dev.bukkit.org/projects/worldedit

The other soft dependency is Skript. No features depend on Skript.
Metrics:
This plugin utilizes bStats to collect anonymous statistics. You can disable this in the bStats config.

Other info:
Limitations: It does not currently store block entity data for any block except signs (for their text), head owners, and command block commands. If this limitation is problematic for you, leave a message in the thread and I will try to add what you need!

WatchDogRollback [BETA] sometimes misses block changes due to it using listeners to log block changes. Keep backups using a copy if region preservation is import or if block changes will not trigger the Spigot API (Like Worldedit or plugins directly changing the blocks)

WholeWorldRollback [EXPERIMENTAL] appears to need you to manually save the world before you back it up.

Minecraft updates: This plugin shouldn't break when there are minecraft updates, but in the case that it does, I will update it to support it. This plugin also keeps track of the version, so I can make a converter.

Tested and works perfectly on Java 8 (and Java 7, too, before 1.13), and on Bukkit/Spigot 1.4.7 - 1.16.4. Keep in mind that the older the version of CraftBukkit, the less robust it is, therefore it does not work as well. Make sure you are using the correct jar for your server version!

If you have any suggestions or issues, leave them in the discussion thread or in the issue tracker!
Issue tracker for 1.13+: https://github.com/null321-jared/rollbackcore/issues
Issue tracker for 1.12.2-: https://github.com/null321-jared/rollbackcore-legacy/issues


Test server:
- shadowxcraft.net /server hg (On game start it rolls the arena back)
- shadowxcraft.net /server kitpvpretro (BuildUHC and QuickHG)

If you like the plugin, I would appreciate a rating :) I have put a lot of time into this plugin!
Donations are also appreciated! I do not make money from this plugin or my server.

NOTE: I DO NOT GET EMAIL NOTIFICATIONS FOR REVIEWS. Ask questions in the discussion. I'll respond there same or next day.
Resource Information
Author:
----------
Total Downloads: 8,667
First Release: Feb 15, 2016
Last Update: Dec 6, 2023
Category: ---------------
All-Time Rating:
24 ratings
Find more info at www.shadowxcraft.net...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings