Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
d938ec7
begin 1.21.5 port - bump dependency versions
CursedFlames Jun 1, 2025
12acd84
Simple renames/moves
CursedFlames Jun 1, 2025
45afd36
delete ConstructorSuper since mixin now natively supports it
CursedFlames Jun 2, 2025
2afdbc0
delete CubicTicketType
CursedFlames Jun 1, 2025
f95217a
update CloAccess and descendants
CursedFlames Jun 1, 2025
96c44cf
update CloTrackingView
CursedFlames Jun 1, 2025
e367e2a
TicketStorage (todo tests)
CursedFlames Jun 1, 2025
b71167f
ChunkTracker and descendants
CursedFlames Jun 1, 2025
f36407a
ChunkTaskDispatcher
CursedFlames Jun 1, 2025
edcc85d
StaticCache3D
CursedFlames Jun 1, 2025
37a23e1
CC stuff for world.level.chunk.status package
CursedFlames Jun 1, 2025
903f308
MixinBlockCollisions target specific constructor
CursedFlames Jun 1, 2025
b8371dc
CubeLevel equivalents for most ChunkLevel methods
CursedFlames Jun 1, 2025
4187f6f
ChunkGenerationTask
CursedFlames Jun 1, 2025
77f342b
remove old ChunkHolder code
CursedFlames Jun 1, 2025
8495059
GenerationChunkHolder, ChunkHolder
CursedFlames Jun 1, 2025
3801b8f
update MixinDistanceManager
CursedFlames Jun 1, 2025
9bce848
update MixinChunkMap
CursedFlames Jun 2, 2025
a9fd138
update ServerChunkCache
CursedFlames Jun 2, 2025
65877d1
update MixinClientChunkCache and ClientCubeCache
CursedFlames Jun 2, 2025
a0dacae
update MixinLevel and descendants
CursedFlames Jun 2, 2025
d0e956e
update MixinMinecraftServer
CursedFlames Jun 2, 2025
6d598a2
update MixinEntity TODO teleportation stuff
CursedFlames Jun 2, 2025
3da5d43
update MixinServerPlayer TODO teleportation stuff
CursedFlames Jun 2, 2025
69388f1
update packets
CursedFlames Jun 2, 2025
1929a1e
update RenderCubeRegion (TODO update tests)
CursedFlames Jun 2, 2025
08877a8
update RenderRegionCache
CursedFlames Jun 2, 2025
4336190
update MixinSectionRenderDispatcher$RenderSection
CursedFlames Jun 2, 2025
812f218
update MixinViewArea
CursedFlames Jun 2, 2025
c692ef8
update MixinLevelRenderer
CursedFlames Jun 2, 2025
e8fba15
SectionOcclusionGraph
CursedFlames Jun 2, 2025
e49709e
switch to ModDevGradle, allowing us to run tests using NeoForge
CursedFlames Jun 5, 2025
637d54e
move client mixins to correct package
CursedFlames Jun 5, 2025
02aa069
fix neoforge event constructor delegates
CursedFlames Jun 6, 2025
a777043
add neoforge.mods.toml for test sourceset
CursedFlames Jun 6, 2025
8d9eb37
temporary workaround for cc_core expecting old method names on LevelH…
CursedFlames Jun 6, 2025
c63fd21
remaining misc changes to load into a world again
CursedFlames Jun 6, 2025
9a5d279
remove temporary test mixins now that we run tests with NeoForge
CursedFlames Jun 7, 2025
a2d026b
temporarily disable cc_core tests since java complains about modules
CursedFlames Jun 7, 2025
95fc774
update test Misc class
CursedFlames Jun 7, 2025
6a038f7
tests: TicketStorage, DistanceManager
CursedFlames Jun 7, 2025
778ea95
make MixinChunkGenerationTask respect chunk/cube load order
CursedFlames Jun 7, 2025
6c3677f
update IntegrationTestCubicChunkMap
CursedFlames Jun 7, 2025
b8e8af9
update IntegrationTestServerCubeCache
CursedFlames Jun 7, 2025
58998f5
fix incorrect LevelCube setBlockState implementation
CursedFlames Jun 8, 2025
7428b7f
various updates to other existing tests
CursedFlames Jun 8, 2025
4c3bb0e
spotted a subtle memory leak while writing docs :)
CursedFlames Jun 9, 2025
2a373a6
add documentation
CursedFlames Jun 9, 2025
ae38f00
delete CloCollectorFuture as its optimization seems to no longer be n…
CursedFlames Jun 9, 2025
d839e52
misc cleanup before PR
CursedFlames Jun 9, 2025
8cc0e06
disable longRunTest for now, as MDG doesn't support multiple test tasks.
CursedFlames Jun 10, 2025
4d0682a
add CCCommonHooks
CursedFlames Jun 10, 2025
2128567
hack out clo unloading until save/load is implemented
CursedFlames Jun 10, 2025
288f1a4
Use folding regions for dasm+mixin sections
NotStirred Jun 11, 2025
d130ad8
Create DasmFailedToApply exception
NotStirred Jun 11, 2025
4ef417f
address PR review comments
CursedFlames Jun 12, 2025
f5710e1
fix broadcasting block changes to client
CursedFlames Jun 12, 2025
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
14 changes: 3 additions & 11 deletions .github/workflows/gradleBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
java-version: 17

- name: Build with Gradle
run: ./gradlew build -x test -x longRunTest
run: ./gradlew build -x test

- name: Tar post-build state
run: tar -cvzpf /tmp/post-build.tar.gz .
Expand All @@ -47,15 +47,7 @@ jobs:
uses: ./.github/workflows/testJob.yml
with:
name: 'test'
command: './gradlew check -x longRunTest'

call-longRunTest:
needs: build
uses: ./.github/workflows/testJob.yml
with:
name: 'longRunTest'
command: './gradlew check -x test'

command: './gradlew check'
call-cleanup:
needs: [ call-test, call-longRunTest ]
needs: [ call-test ]
uses: ./.github/workflows/cleanupJob.yml
13 changes: 3 additions & 10 deletions .github/workflows/gradleBuildPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
java-version: 17

- name: Build with Gradle
run: ./gradlew build -x test -x longRunTest
run: ./gradlew build -x test

- name: Tar post-build state
run: tar -cvzpf /tmp/post-build.tar.gz .
Expand All @@ -39,15 +39,8 @@ jobs:
uses: ./.github/workflows/testJob.yml
with:
name: 'test'
command: './gradlew check -x longRunTest'

call-longRunTest:
needs: build
uses: ./.github/workflows/testJob.yml
with:
name: 'longRunTest'
command: './gradlew check -x test'
command: './gradlew check'

call-cleanup:
needs: [ call-test, call-longRunTest ]
needs: [ call-test ]
uses: ./.github/workflows/cleanupJob.yml
247 changes: 134 additions & 113 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.154'
id 'net.neoforged.moddev' version '2.0.90'
id("io.github.opencubicchunks.javaheaders").version("1.2.8")
id("io.github.opencubicchunks.gradle.mcGitVersion")
id("io.github.opencubicchunks.gradle.mixingen")
Expand Down Expand Up @@ -71,7 +71,7 @@ mixinGen {
filePattern = "cubicchunks.mixins.%s.json"
defaultRefmap = "CubicChunks-refmap.json"
defaultPackagePrefix = "io.github.opencubicchunks.cubicchunks.mixin"
defaultCompatibilityLevel = "JAVA_17"
defaultCompatibilityLevel = "JAVA_21"
defaultMinVersion = "0.8"

config(sourceSets.main, "core") {
Expand Down Expand Up @@ -145,73 +145,98 @@ base {
archivesName = mod_id
}

// Mojang ships Java 17 to end users in 1.18+, so your mod should target Java 17.
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
java.toolchain.languageVersion = JavaLanguageVersion.of(21)

minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')
neoForge {
version = project.neo_version
parchment {
mappingsVersion = project.parchment_mappings_version
minecraftVersion = project.parchment_minecraft_version
}
validateAccessTransformers = true

runs {
def args = [
"-XX:+IgnoreUnrecognizedVMOptions",
"-XX:+UnlockExperimentalVMOptions",
"-XX:+AllowEnhancedClassRedefinition",
"-XX:-OmitStackTraceInFastThrow",
"-XX:+UseG1GC",
"-XX:G1NewSizePercent=20",
"-XX:G1ReservePercent=20",
"-XX:MaxGCPauseMillis=50",
"-XX:G1HeapRegionSize=32M",
"-Dmixin.debug.verbose=true",
"-Dmixin.debug.export=true",
"-Dmixin.checks.interfaces=true",
"-Dcubicchunks.debug=false",
"-Dcubicchunks.debug.loadorder=false",
"-Dcubicchunks.debug.window=false",
"-Dcubicchunks.debug.statusrenderer=false",
"-Dcubicchunks.debug.heightmaprenderer=false",
"-Dcubicchunks.debug.heightmaprenderer.server=false",
"-Dcubicchunks.debug.heightmaprenderer.render_lightmap=false",
"-Dcubicchunks.debug.heightmaprenderer.radius=2",
"-Dcubicchunks.debug.heightmapverification=false",
"-Dcubicchunks.debug.heightmapverification.frequency=1",
"-Dcubicchunks.debug.biomes=false",
"-ea"
]
// applies to all the run configs below
configureEach {
jvmArguments = args
// systemProperty 'forge.logging.markers', 'REGISTRIES'
systemProperty 'forge.logging.console.level', 'debug'
}

configurations {
libraries {}
implementation.extendsFrom libraries
extraTests
}
client {
client()
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}

runs {
def args = [
"-XX:+IgnoreUnrecognizedVMOptions",
"-XX:+UnlockExperimentalVMOptions",
"-XX:+AllowEnhancedClassRedefinition",
"-XX:-OmitStackTraceInFastThrow",
"-XX:+UseG1GC",
"-XX:G1NewSizePercent=20",
"-XX:G1ReservePercent=20",
"-XX:MaxGCPauseMillis=50",
"-XX:G1HeapRegionSize=32M",
"-Dmixin.debug.verbose=true",
"-Dmixin.debug.export=true",
"-Dmixin.checks.interfaces=true",
"-Dcubicchunks.debug=false",
"-Dcubicchunks.debug.loadorder=false",
"-Dcubicchunks.debug.window=false",
"-Dcubicchunks.debug.statusrenderer=false",
"-Dcubicchunks.debug.heightmaprenderer=false",
"-Dcubicchunks.debug.heightmaprenderer.server=false",
"-Dcubicchunks.debug.heightmaprenderer.render_lightmap=false",
"-Dcubicchunks.debug.heightmaprenderer.radius=2",
"-Dcubicchunks.debug.heightmapverification=false",
"-Dcubicchunks.debug.heightmapverification.frequency=1",
"-Dcubicchunks.debug.biomes=false",
"-ea"
]
// applies to all the run configs below
configureEach {
jvmArguments args
// systemProperty 'forge.logging.markers', 'REGISTRIES'
systemProperty 'forge.logging.console.level', 'debug'
modSource project.sourceSets.forge
dependencies {
runtime project.configurations.libraries
server {
server()
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
programArgument '--nogui'
}
}

client {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}
gameTestServer {
type = "gameTestServer"
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
}

server {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
programArgument '--nogui'
clientData {
clientData()
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
}
}

gameTestServer {
systemProperty 'forge.enabledGameTestNamespaces', project.mod_id
mods {
"${mod_id}" {
// FIXME should be forge but things don't inherit properly currently
sourceSet(sourceSets.main)
}
}

data {
programArguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
unitTest {
// Enable JUnit support in the moddev plugin
enable()
// Configure which mod is being tested.
// This allows NeoForge to load the test/ classes and resources as belonging to the mod.
testedMod = mods.cubicchunks // <mod name> must match the name in the mods { } block.
// Configure which mods are loaded in the test environment, if the default (all declared mods) is not appropriate.
// This must contain testedMod, and can include other mods as well.
// loadedMods = [mods.<mod name >, mods.<mod name 2>]
}
}

configurations {
libraries {}
implementation.extendsFrom libraries
additionalRuntimeClasspath.extendsFrom libraries
extraTests
}

// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }

Expand All @@ -226,8 +251,6 @@ repositories {
}

dependencies {
implementation "net.neoforged:neoforge:${neo_version}"

implementation(project(":CubicChunksCore")) {
attributes {
attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.class, LibraryElements.JAR))
Expand All @@ -244,8 +267,6 @@ dependencies {
libraries("io.github.opencubicchunks:regionlib:0.63.0-SNAPSHOT")
libraries("org.spongepowered:noise:2.0.0-SNAPSHOT")

// NeoForge does not yet support JUnit tests, so we use fabric loader for this instead.
testImplementation("net.fabricmc:fabric-loader-junit:0.15.3") // required for bootstrapping in unit tests
testImplementation("org.assertj:assertj-core:3.25.1")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.0")
Expand All @@ -254,6 +275,8 @@ dependencies {

testImplementation("org.hamcrest:hamcrest-junit:2.0.0.0")
testImplementation("org.hamcrest:hamcrest:2.2")

testImplementation "net.neoforged:testframework:${neo_version}" // Needed for EphemeralTestServerProvider
}

tasks.withType(ProcessResources).configureEach {
Expand All @@ -266,18 +289,15 @@ tasks.withType(ProcessResources).configureEach {
]
inputs.properties replaceProperties

filesMatching(['META-INF/mods.toml']) {
filesMatching(['META-INF/neoforge.mods.toml']) {
expand replaceProperties + [project: project]
}
}

// Force various tasks to run on intellij refresh
project.tasks.matching {
// Using idePostSync instead of ideaSyncTask as it was removed
it.name == "idePostSync"
}.forEach {
it.dependsOn("CubicChunksCore:assemble")
it.dependsOn(genAll)
neoForge {
ideSyncTask project("CubicChunksCore").getTasksByName("assemble", false)[0]
ideSyncTask genAll
}
// Ensure we always genAll on any run
processResources.dependsOn(genAll, "CubicChunksCore:assemble")
Expand All @@ -286,20 +306,21 @@ processResources.dependsOn(genAll, "CubicChunksCore:assemble")
compileJava.dependsOn("CubicChunksCore:assemble")

// unzipping subproject (CubicChunksCore) tests
tasks.register('unzipTests', Copy) {
outputs.upToDateWhen {
false
}
dependsOn(configurations.named("extraTests"))
from(configurations.named("extraTests"))
doFirst {
//noinspection ConfigurationAvoidance, we actually do want to resolve here
var testsFile = configurations["extraTests"].resolve().iterator().next()
from(zipTree(testsFile))
exclude(testsFile.name)
}
into(sourceSets.test.output.classesDirs.asPath)
}
// TODO disabled until we figure out how to fix java modules complaining
//tasks.register('unzipTests', Copy) {
// outputs.upToDateWhen {
// false
// }
// dependsOn(configurations.named("extraTests"))
// from(configurations.named("extraTests"))
// doFirst {
// //noinspection ConfigurationAvoidance, we actually do want to resolve here
// var testsFile = configurations["extraTests"].resolve().iterator().next()
// from(zipTree(testsFile))
// exclude(testsFile.name)
// }
// into(sourceSets.test.output.classesDirs.asPath)
//}

tasks.withType(Test).configureEach {
// gradle docs suggest processors/2 which actually runs fractionally faster than just processors
Expand All @@ -309,11 +330,9 @@ tasks.withType(Test).configureEach {

test {
minHeapSize = "512M"
// TODO IntegrationTestServerCubeCache.testAddCubicRegionTicket currently requires ~4GB of memory;
// we should reduce maxHeapSize to a more reasonable value once chunkloading memory usage is further optimized
maxHeapSize = "6G"
maxHeapSize = "2048M"

dependsOn(project.tasks.named("unzipTests"))
// dependsOn(project.tasks.named("unzipTests"))
useJUnitPlatform {
excludeTags "longRunTest"
}
Expand All @@ -330,34 +349,36 @@ test {
exclude "**/mixin*"
}

def longRunTest = tasks.register("longRunTest", Test) {
minHeapSize = "512M"
maxHeapSize = "2048M"
systemProperty("junit.jupiter.testclass.order.default", "org.junit.jupiter.api.ClassOrderer.OrderAnnotation")

useJUnitPlatform {
includeTags "longRunTest"
}

// Show test results.
testLogging {
events("started", "passed", "skipped", "failed")
showStandardStreams = true
exceptionFormat = TestExceptionFormat.FULL
minGranularity = 3
}

jvmArgs("-ea", "-Dmixin.debug.verbose=true", "-Dmixin.debug.export=true", "-Dmixin.checks.interfaces=true")
exclude "**/mixin*"

group = "Verification"
mustRunAfter project.tasks.named("unzipTests")
shouldRunAfter project.tasks.named("test")
}

tasks.named("check") {
dependsOn longRunTest
}
// TODO longRunTest is disabled for now because MDG doesn't support multiple test tasks
// we don't currently need it anyway, as all tests currently complete reasonably quickly.
//def longRunTest = tasks.register("longRunTest", Test) {
// minHeapSize = "512M"
// maxHeapSize = "2048M"
// systemProperty("junit.jupiter.testclass.order.default", "org.junit.jupiter.api.ClassOrderer.OrderAnnotation")
//
// useJUnitPlatform {
// includeTags "longRunTest"
// }
//
// // Show test results.
// testLogging {
// events("started", "passed", "skipped", "failed")
// showStandardStreams = true
// exceptionFormat = TestExceptionFormat.FULL
// minGranularity = 3
// }
//
// jvmArgs("-ea", "-Dmixin.debug.verbose=true", "-Dmixin.debug.export=true", "-Dmixin.checks.interfaces=true")
// exclude "**/mixin*"
//
// group = "Verification"
//// mustRunAfter project.tasks.named("unzipTests")
// shouldRunAfter project.tasks.named("test")
//}
//
//tasks.named("check") {
// dependsOn longRunTest
//}

publishing {
publications {
Expand Down
Loading