Skip to content

Commit 3b95faf

Browse files
committed
Update gradle workflow version
1 parent b6d43be commit 3b95faf

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Setup Gradle
2020
uses: gradle/actions/setup-gradle@v3
2121
with:
22-
gradle-version: 8.6
22+
gradle-version: 8.10
2323
- name: Build TASmod with Gradle
2424
run: gradle build
2525
- name: Upload Test Report

.github/workflows/buildandupload.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Setup Gradle
2121
uses: gradle/actions/setup-gradle@v3
2222
with:
23-
gradle-version: 8.6
23+
gradle-version: 8.10
2424
- name: Build TASmod with Gradle
2525
run: gradle build
2626
- name: Upload artifact

src/main/java/com/minecrafttas/tasmod/savestates/storage/NextTickListEntryStorage.java

+12
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@
2929
import net.minecraft.world.NextTickListEntry;
3030
import net.minecraft.world.WorldServer;
3131

32+
/**
33+
* <p>Extends the savestate storage to store {@link NextTickListEntry NextTickListEntries} from the {@link WorldServer}.
34+
* <p>TickListEntries are timed blocks like pressure plates,<br>
35+
* which schedule their update time, when they are pressed.<br>
36+
* The timer that is used is the world time.
37+
* <p>As we can "rewind" the world time with savestates,<br>
38+
* we also have to update the scheduledTime to account for that
39+
* @author Scribble
40+
*/
3241
public class NextTickListEntryStorage extends AbstractExtendStorage {
3342

3443
private Path file = Paths.get("ticklistEntries.json");
@@ -40,6 +49,7 @@ public void onServerSavestate(MinecraftServer server, int index, Path target, Pa
4049

4150
Path path = current.resolve(SavestateHandlerServer.storageDir).resolve(file);
4251

52+
// Ticklistentries can be in every dimension, so this array stores them one by one. Also supports modded dimensions
4353
JsonArray dimensionJson = new JsonArray();
4454
for (WorldServer world : worlds) {
4555
WorldServerDuck worldserverDuck = (WorldServerDuck) world;
@@ -89,10 +99,12 @@ public void onServerLoadstate(MinecraftServer server, int index, Path target, Pa
8999
for (JsonElement jsonTickListEntries : dimensionJson) {
90100
JsonArray jsonTickListEntriesArray = jsonTickListEntries.getAsJsonArray();
91101
WorldServer world = worlds[i];
102+
92103
WorldServerDuck worldserverDuck = (WorldServerDuck) world;
93104
Set<NextTickListEntry> tickListEntries = worldserverDuck.getTickListEntriesHashSet();
94105
TreeSet<NextTickListEntry> tickListTreeSet = worldserverDuck.getTickListEntriesTreeSet();
95106

107+
// Clear all existing tickListEntries
96108
tickListEntries.clear();
97109
tickListTreeSet.clear();
98110

0 commit comments

Comments
 (0)