Compare commits

...
6 Commits
Author SHA1 Message Date
Cubicake f4f4e64670 Prepare for release 2026-01-09 18:57:34 +01:00
Cubicake aaee14e4f2 Return air if chunk snapshot null 2026-01-05 17:57:24 +01:00
Cubicake 791ab79f54 Revert "IntelliJ is having another fit?"
This reverts commit af3b5f166d.
2025-12-23 22:40:05 +10:30
Cubicake af3b5f166d IntelliJ is having another fit? 2025-12-23 22:35:31 +10:30
Cubicake bb4d7eebca Potential perf improvement, pending testing 2025-12-15 16:24:42 +10:30
Cubicake 886e2e28a4 Minor changes 2025-12-04 16:42:07 +10:30
4 changed files with 16 additions and 9 deletions

No files matched your search

+2 -2
View File
@@ -4,7 +4,7 @@ plugins {
}
group = 'games.cubi'
version = '1.6.4'
version = '1.6.5'
repositories {
mavenCentral()
@@ -31,7 +31,7 @@ tasks {
// Configure the Minecraft version for our task.
// This is the only required configuration besides applying the plugin.
// Your plugin's jar (or shadowJar if present) will be used automatically.
minecraftVersion("1.20.6")
minecraftVersion("1.21.11")
}
}
@@ -76,10 +76,10 @@ public class Engine {
// ----- PHASE 1: SYNC GATHER -----
if (!syncRecheck.isEmpty()) {
Logger.warning(syncRecheck.size() + " chunks failed to snapshot asynchronously, rechecking them now.");
Logger.warning(syncRecheck.size() + " chunks failed to snapshot asynchronously, rechecking them now. This message may also have been triggered if a player teleported into unloaded chunks, in which case it's safe to ignore.");
for (Chunk c : syncRecheck) {
if (c.isLoaded()) {
plugin.getChunkSnapshotManager().snapshotChunk(c);
plugin.getChunkSnapshotManager().snapshotChunkSync(c);
syncRecheck.remove(c);
Logger.info("Successfully rechecked chunk " + c.getX() + ", " + c.getZ() + " in world " + c.getWorld().getName());
}
@@ -248,7 +248,7 @@ public class Engine {
BlockState data = block.getState();
if (data instanceof TileState tileData) {
p.sendBlockChange(location, block.getBlockData());
p.sendBlockUpdate(location, tileData);
//p.sendBlockUpdate(location, tileData);
}
else {
//Logger.warning("Tried to show tile entity at " + location + " to "+p.getName()+" but it was not a TileState! Block type: " + block.getType()+". Removing from the list of tile entities.");
@@ -77,6 +77,13 @@ public class ChunkSnapshotManager {
removeChunkSnapshot(c);
}
public void snapshotChunkSync(Chunk c) {
if ((dataMap.get(key(c)).lastRefresh + 100) < System.currentTimeMillis() - cfg.snapshotRefreshInterval * 1000L) {
return;
}
dataMap.put(key(c), takeSnapshot(c, System.currentTimeMillis()));
}
public void snapshotChunk(Chunk c) {
//if (cfg.debugMode) {
//Logger.info("ChunkSnapshotManager: Taking snapshot of chunk " + c.getWorld().getName() + ":" + c.getX() + ":" + c.getZ());
@@ -173,10 +180,10 @@ public class ChunkSnapshotManager {
Chunk chunk = loc.getChunk();
ChunkData d = dataMap.get(key(chunk));
if (d == null) {
Chunk c = loc.getChunk();
Logger.error("ChunkSnapshotManager: No snapshot for " + c+ " If this error persists, please report this on our discord (discord.cubi.games)");
//Chunk c = loc.getChunk();
//Logger.error("ChunkSnapshotManager: No snapshot for " + c+ " If this error persists, please report this on our discord (discord.cubi.games)");
Engine.syncRecheck.add(chunk);
return loc.getBlock().getType();
return Material.AIR;
}
double yLevel = loc.getY();
if (yLevel < d.minHeight || yLevel > d.maxHeight) {
@@ -30,7 +30,7 @@ public class UpdateChecker {
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
final String url = "https://api.modrinth.com/v2/project/bCjNZu0C/version";
final String url = "https://api.modrinth.com/v2/project/bCjNZu0C/version?version_type=release";
try (final InputStreamReader reader = new InputStreamReader(new URL(url).openConnection().getInputStream())) {
final JsonArray array = new JsonArray();
array.add(new BufferedReader(reader).readLine());