Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ For a detailed description of the plugin, please visit [coreprotect.net](https:/
| CoreProtect Discord: | [discord.gg/b4DZ4jy](https://discord.gg/b4DZ4jy) |
| CoreProtect Patreon: | [patreon.com/coreprotect](https://www.patreon.com/coreprotect) |
| CoreProtect Documentation: | [docs.coreprotect.net](https://docs.coreprotect.net) |
| Downloads for MC 1.14 - 1.20: | [coreprotect.net/latest](https://coreprotect.net/latest/) |
| Downloads for MC 1.14 - 1.21: | [coreprotect.net/latest](https://coreprotect.net/latest/) |
| Downloads for MC 1.8 - 1.12: | [coreprotect.net/legacy](https://coreprotect.net/legacy/) |

bStats
Expand All @@ -49,7 +49,7 @@ Maven
<dependency>
<groupId>net.coreprotect</groupId>
<artifactId>coreprotect</artifactId>
<version>22.4</version>
<version>23.0</version>
<scope>provided</scope>
</dependency>
```
Expand Down
40 changes: 38 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.coreprotect</groupId>
<artifactId>CoreProtect</artifactId>
<version>22.4</version>
<version>23.0</version>
<properties>
<project.branch></project.branch>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -73,7 +73,7 @@
<excludes>
<exclude>**/*.java</exclude>
<exclude>**/*.c</exclude>
<exclude>META-INF/maven/**</exclude>
<exclude>META-INF/maven/**/pom.properties</exclude>
<exclude>META-INF/services/**</exclude>
</excludes>
</filter>
Expand Down Expand Up @@ -115,6 +115,42 @@
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>maven-install</id>
<activation>
<property>
<name>env.BUILD_ID</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>install-validation</id>
<phase>install</phase>
<configuration>
<target>
<delete>
<fileset dir="${project.build.directory}">
<include name="${project.build.finalName}-shaded.jar"/>
</fileset>
</delete>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
<repository>
<id>spigot-repo</id>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/net/coreprotect/command/CommandHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void run() {
Chat.sendMessage(user, Color.DARK_AQUA + Phrase.build(Phrase.UPDATE_NOTICE, Color.WHITE, "CoreProtect CE v" + latestVersion));
Chat.sendMessage(user, Color.DARK_AQUA + Phrase.build(Phrase.LINK_DOWNLOAD, Color.WHITE, "www.coreprotect.net/download/"));
}
else {
else if (!VersionUtils.isCommunityEdition()) {
Chat.sendMessage(user, Color.DARK_AQUA + Phrase.build(Phrase.UPDATE_NOTICE, Color.WHITE, "CoreProtect v" + latestEdgeVersion));
Chat.sendMessage(user, Color.DARK_AQUA + Phrase.build(Phrase.LINK_DOWNLOAD, Color.WHITE, "www.coreprotect.net/latest/"));
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/net/coreprotect/config/ConfigHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public class ConfigHandler extends Queue {
public static final String EDITION_BRANCH = Util.getBranch();
public static final String EDITION_NAME = Util.getPluginName();
public static final String JAVA_VERSION = "11.0";
public static final String SPIGOT_VERSION = "1.15";
public static final String MINECRAFT_VERSION = "1.16";
public static final String LATEST_VERSION = "1.21.8";
public static String path = "plugins/CoreProtect/";
public static String sqlite = "database.db";
public static String host = "127.0.0.1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,65 +54,7 @@

public class RollbackBlockHandler extends Queue {

/**
* Handle block-related rollback operations
*
* @param block
* The block to modify
* @param row
* Block data from the database (used only for specific operations)
* @param rollbackType
* The type of rollback (0=rollback, 1=restore)
* @param clearInventories
* Whether to clear container inventories
* @param chunkChanges
* Map of block changes to apply
* @param countBlock
* Whether to count this block in stats
* @param oldTypeMaterial
* The previous material type
* @param pendingChangeType
* The pending change material type
* @param pendingChangeData
* The pending change block data
* @param finalUserString
* The username for this rollback
* @param rawBlockData
* The raw block data
* @param changeType
* The current block type
* @param changeBlockData
* The current block data
* @param meta
* Block metadata
* @param blockData
* The processed block data
* @param rowUser
* The username associated with this block change
* @param rowType
* The material type for this block change
* @param rowX
* The X coordinate
* @param rowY
* The Y coordinate
* @param rowZ
* The Z coordinate
* @param rowTypeRaw
* The raw type value
* @param rowData
* The data value
* @param rowAction
* The action value
* @param rowWorldId
* The world ID
* @param blockDataString
* The block data as a string
* @return Updated count status
*/
public static boolean processBlockChange(Block block, Object[] row, int rollbackType, boolean clearInventories, Map<Block, BlockData> chunkChanges, boolean countBlock, Material oldTypeMaterial, Material pendingChangeType, BlockData pendingChangeData, String finalUserString, BlockData rawBlockData, Material changeType, BlockData changeBlockData, ArrayList<Object> meta, BlockData blockData, String rowUser, Material rowType, int rowX, int rowY, int rowZ, int rowTypeRaw, int rowData, int rowAction, int rowWorldId, String blockDataString) {

boolean changeBlock = true;
World bukkitWorld = block.getWorld();
public static boolean processBlockChange(World bukkitWorld, Block block, Object[] row, int rollbackType, boolean clearInventories, Map<Block, BlockData> chunkChanges, boolean countBlock, Material oldTypeMaterial, Material pendingChangeType, BlockData pendingChangeData, String finalUserString, BlockData rawBlockData, Material changeType, boolean changeBlock, BlockData changeBlockData, ArrayList<Object> meta, BlockData blockData, String rowUser, Material rowType, int rowX, int rowY, int rowZ, int rowTypeRaw, int rowData, int rowAction, int rowWorldId, String blockDataString) {
int unixtimestamp = (int) (System.currentTimeMillis() / 1000L);

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ public static boolean processChunk(int finalChunkX, int finalChunkZ, long chunkK

// Process blocks
for (Object[] row : data) {
int unixtimestamp = (int) (System.currentTimeMillis() / 1000L);
int[] rollbackHashData = ConfigHandler.rollbackHash.get(finalUserString);
int itemCount = rollbackHashData[0];
int blockCount = rollbackHashData[1];
Expand Down Expand Up @@ -234,7 +233,7 @@ else if ((pendingChangeType != Material.AIR) && (pendingChangeType != Material.C
}
}

if (countBlock && RollbackBlockHandler.processBlockChange(block, row, rollbackType, clearInventories, chunkChanges, countBlock, oldTypeMaterial, pendingChangeType, pendingChangeData, finalUserString, rawBlockData, changeType, changeBlockData, meta != null ? new ArrayList<>(meta) : null, blockData, rowUser, rowType, rowX, rowY, rowZ, rowTypeRaw, rowData, rowAction, rowWorldId, BlockUtils.byteDataToString((byte[]) row[13], rowTypeRaw))) {
if (RollbackBlockHandler.processBlockChange(bukkitWorld, block, row, rollbackType, clearInventories, chunkChanges, countBlock, oldTypeMaterial, pendingChangeType, pendingChangeData, finalUserString, rawBlockData, changeType, changeBlock, changeBlockData, meta != null ? new ArrayList<>(meta) : null, blockData, rowUser, rowType, rowX, rowY, rowZ, rowTypeRaw, rowData, rowAction, rowWorldId, BlockUtils.byteDataToString((byte[]) row[13], rowTypeRaw)) && countBlock) {
blockCount++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public static boolean performVersionChecks() {
return false;
}

if (VersionUtils.newVersion(ConfigHandler.LATEST_VERSION, bukkitVersion[0] + "." + bukkitVersion[1]) && VersionUtils.isBranch("master")) {
Chat.console(Phrase.build(Phrase.VERSION_INCOMPATIBLE, "Minecraft", bukkitVersion[0] + "." + bukkitVersion[1]));
if (VersionUtils.newVersion(ConfigHandler.LATEST_VERSION, bukkitVersion[0] + "." + bukkitVersion[1] + (bukkitVersion.length > 2 ? "." + bukkitVersion[2] : "")) && VersionUtils.isCommunityEdition()) {
Chat.console(Phrase.build(Phrase.VERSION_INCOMPATIBLE, "Minecraft", bukkitVersion[0] + "." + bukkitVersion[1] + (bukkitVersion.length > 2 ? "." + bukkitVersion[2] : "")));
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: CoreProtect
main: net.coreprotect.CoreProtect
version: ${project.version}
branch: master
api-version: 1.13
branch: ${project.branch}
api-version: 1.16
folia-supported: true
website: http://coreprotect.net
author: Intelli
Expand Down
Loading