Skip to content

Commit fc77fed

Browse files
committed
Update to MC 1.21.10
1 parent df68aa6 commit fc77fed

File tree

11 files changed

+174
-217
lines changed

11 files changed

+174
-217
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ keystore.jks
2727
secrets.properties
2828
build_number.properties
2929
changelog.txt
30+
31+
.cache
32+
config

build.gradle

Lines changed: 51 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
2-
id 'net.neoforged.gradle.userdev' version '7.0.185'
3-
id 'net.darkhax.curseforgegradle' version '1.1.26'
2+
id 'net.neoforged.moddev' version '2.0.119'
3+
id 'net.darkhax.curseforgegradle' version '1.1.28'
44
id 'com.github.kt3k.coveralls' version '2.12.0'
55
id 'com.diffplug.spotless' version '6.25.0'
66
id 'com.github.johnrengelman.shadow' version '8.1.1'
@@ -14,7 +14,6 @@ apply plugin: 'jacoco'
1414

1515
import net.darkhax.curseforgegradle.Constants
1616
import net.darkhax.curseforgegradle.TaskPublishCurseForge
17-
import net.neoforged.gradle.common.tasks.PotentiallySignJar
1817

1918
// Determine build number
2019
String build_number = "DEV" // this will be referenced as simply build_number from now on.
@@ -95,6 +94,7 @@ configurations {
9594

9695
test {
9796
testLogging {
97+
events org.gradle.api.tasks.testing.logging.TestLogEvent.STANDARD_OUT
9898
exceptionFormat = 'full'
9999
}
100100
}
@@ -113,7 +113,13 @@ repositories {
113113
}
114114

115115
dependencies {
116-
implementation "net.neoforged:neoforge:${project.neoforge_version}"
116+
testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1'
117+
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.7.1'
118+
testImplementation 'org.junit.platform:junit-platform-suite-api:1.14.1'
119+
testImplementation 'org.hamcrest:hamcrest:2.1'
120+
testImplementation "org.mockito:mockito-core:2.+"
121+
testRuntimeOnly 'org.junit.platform:junit-platform-suite-engine'
122+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
117123

118124
// Add something like 'cyclopscore_version_local=0.1.0-DEV' to your secrets.properties if you want to use a custom local CyclopsCore version.
119125
if(secrets.cyclopscore_version_local) {
@@ -150,46 +156,55 @@ dependencies {
150156
exclude group: 'com.ibm.icu', module: 'icu4j'
151157
}
152158
shadow "org.graalvm.js:js:${project.graal_version}"
153-
154-
testImplementation "junit:junit:4.12"
155-
testImplementation "org.mockito:mockito-core:1.+"
156-
testRuntimeOnly "org.junit.vintage:junit-vintage-engine:5.8.2"
157159
}
158160

159-
subsystems {
160-
parchment {
161-
minecraftVersion = "${project.parchment_minecraft_version}"
162-
mappingsVersion = "${project.parchment_version}"
163-
}
161+
test {
162+
useJUnitPlatform()
164163
}
165164

166-
runs {
167-
configureEach {
168-
systemProperty 'forge.logging.markers', 'REGISTRIES'
169-
systemProperty 'forge.logging.console.level', 'debug'
170-
systemProperty 'forge.logging.console.level', 'debug'
171-
modSource project.sourceSets.main
165+
neoForge {
166+
version = "${neoforge_version}"
172167

173-
dependencies {
174-
runtime project.configurations.modLib
175-
}
168+
parchment {
169+
mappingsVersion = "${parchment_version}"
170+
minecraftVersion = "${parchment_minecraft_version}"
176171
}
177-
178-
client {
179-
systemProperty 'neoforge.enabledGameTestNamespaces', "cyclopscore,${mod_id}"
172+
173+
// Automatically enable neoforge AccessTransformers if the file exists
174+
def at = file('src/main/resources/META-INF/accesstransformer.cfg')
175+
if (at.exists()) {
176+
accessTransformers = [ at.absolutePath ]
180177
}
181178

182-
server {
183-
systemProperty 'neoforge.enabledGameTestNamespaces', "cyclopscore,${mod_id}"
184-
argument '--nogui'
179+
validateAccessTransformers = true
180+
181+
runs {
182+
client {
183+
client()
184+
}
185+
server {
186+
server()
187+
programArgument '--nogui'
188+
}
189+
gameTestServer {
190+
type = "gameTestServer"
191+
}
192+
configureEach {
193+
systemProperty 'forge.logging.markers', 'REGISTRIES'
194+
logLevel = org.slf4j.event.Level.DEBUG
195+
systemProperty 'neoforge.enabledGameTestNamespaces', "cyclopscore,${mod_id}"
196+
}
185197
}
186198

187-
gameTestServer {
188-
systemProperty 'neoforge.enabledGameTestNamespaces', "cyclopscore,${mod_id}"
199+
mods {
200+
"${mod_id}" {
201+
sourceSet(sourceSets.main)
202+
}
189203
}
190204

191-
clientData {
192-
arguments.addAll '--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
205+
unitTest {
206+
enable()
207+
testedMod = mods.integratedscripting
193208
}
194209
}
195210

@@ -208,21 +223,6 @@ jar {
208223
}
209224
}
210225

211-
task signJar(type: PotentiallySignJar, dependsOn: jar) {
212-
dependsOn(tasks.jar)
213-
214-
onlyIf {
215-
System.getenv().SIGN_KEYSTORE
216-
}
217-
218-
keyStore = System.getenv().SIGN_KEYSTORE
219-
alias = System.getenv().SIGN_ALIAS
220-
storePass = System.getenv().SIGN_STOREPASS
221-
keyPass = System.getenv().SIGN_KEYPASS
222-
input = jar.archivePath
223-
output = jar.archivePath
224-
}
225-
226226
task deobfJar(type: Jar) {
227227
from sourceSets.main.output
228228
archiveClassifier.set('deobf')
@@ -392,14 +392,10 @@ jacocoTestReport {
392392
}
393393

394394
// Also measure coverage for game tests
395-
tasks.whenTaskAdded { task ->
396-
if (task.name.equals('runGameTestServer')) {
397-
jacocoTestReport.dependsOn test, task
398-
jacoco {
399-
toolVersion = "0.8.12"
400-
applyTo task
401-
}
402-
}
395+
jacocoTestReport.dependsOn test, runGameTestServer
396+
jacoco {
397+
toolVersion = "0.8.12"
398+
applyTo runGameTestServer
403399
}
404400

405401
spotless {
@@ -422,19 +418,3 @@ compileJava.dependsOn updateGitHooks
422418
tasks.withType(JavaCompile).configureEach {
423419
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
424420
}
425-
426-
// The following is required to fix running unit tests during build phase
427-
tasks.configureEach { task ->
428-
if (task.name.startsWith("test")) {
429-
task.enabled = true
430-
}
431-
if (task.name.startsWith("testJunit")) {
432-
task.enabled = false
433-
}
434-
}
435-
436-
task benchmark(type: JavaExec) {
437-
classpath sourceSets.test.runtimeClasspath
438-
main = "org.cyclops.integratedscripting.evaluate.translation.BenchmarkValueTranslators"
439-
}
440-
test.dependsOn benchmark

gradle.properties

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ group=org.cyclops.integratedscripting
44
java_version=21
55

66
# Common
7-
minecraft_version=1.21.8
7+
minecraft_version=1.21.10
88
mod_name=IntegratedScripting
99
mod_author=rubensworks (aka kroeser)
1010
mod_id=integratedscripting
@@ -15,13 +15,13 @@ display_url=https://www.curseforge.com/minecraft/mc-mods/integrated-scripting
1515
description=Create scripts for handling operations in Integrated Dynamics.
1616
fingerprint=bd0353b3e8a2810d60dd584e256e364bc3bedd44
1717

18-
parchment_version=2025.06.15
19-
parchment_minecraft_version=1.21.5
18+
parchment_version=2025.10.12
19+
parchment_minecraft_version=1.21.10
2020
curseforge_project_id=889785
2121
modrinth_project_id=uDJkuFRe
2222

2323
# NeoForge
24-
neoforge_version=21.8.20
24+
neoforge_version=21.10.53-beta
2525
neoforge_loader_version_range=[4,)
2626
neoforge_update_json_url=https://raw.githubusercontent.com/CyclopsMC/Versions/master/neoforge_update/integrated-scripting.json
2727

@@ -32,6 +32,6 @@ org.gradle.caching=true
3232

3333
# Dependencies
3434
graal_version=24.1.1
35-
cyclopscore_version=1.25.5-800
36-
integrateddynamics_version=1.24.1-1300
37-
commoncapabilities_version=2.9.7-251
35+
cyclopscore_version=1.25.5-858
36+
integrateddynamics_version=1.24.1-1417
37+
commoncapabilities_version=2.9.7-299

src/main/java/org/cyclops/integratedscripting/blockentity/BlockEntityScriptingDrive.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import net.minecraft.world.level.block.state.BlockState;
1313
import net.minecraft.world.level.storage.ValueInput;
1414
import net.minecraft.world.level.storage.ValueOutput;
15-
import net.neoforged.neoforge.items.wrapper.InvWrapper;
15+
import net.neoforged.neoforge.transfer.item.VanillaContainerWrapper;
1616
import org.cyclops.cyclopscore.datastructure.DimPos;
1717
import org.cyclops.cyclopscore.inventory.SimpleInventory;
1818
import org.cyclops.cyclopscore.persist.IDirtyMarkListener;
@@ -59,8 +59,8 @@ public void populate() {
5959
super.populate();
6060

6161
add(
62-
net.neoforged.neoforge.capabilities.Capabilities.ItemHandler.BLOCK,
63-
(blockEntity, context) -> new InvWrapper(blockEntity.getInventory())
62+
net.neoforged.neoforge.capabilities.Capabilities.Item.BLOCK,
63+
(blockEntity, context) -> VanillaContainerWrapper.of(blockEntity.getInventory())
6464
);
6565
add(
6666
Capabilities.NetworkElementProvider.BLOCK,

src/main/java/org/cyclops/integratedscripting/client/gui/component/input/TextFieldHelperExtended.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package org.cyclops.integratedscripting.client.gui.component.input;
22

33
import net.minecraft.client.gui.font.TextFieldHelper;
4+
import net.minecraft.client.input.CharacterEvent;
5+
import net.minecraft.client.input.KeyEvent;
46

57
import java.util.function.Consumer;
68
import java.util.function.Predicate;
@@ -33,9 +35,9 @@ public String getSelected() {
3335
}
3436

3537
@Override
36-
public boolean charTyped(char p_95144_) {
38+
public boolean charTyped(CharacterEvent event) {
3739
String selectedBefore = getSelected();
38-
boolean ret = super.charTyped(p_95144_);
40+
boolean ret = super.charTyped(event);
3941
String selectedAfter = getSelected();
4042
if (!selectedBefore.equals(selectedAfter)) {
4143
this.setSelectionFn.accept(selectedAfter);
@@ -44,9 +46,9 @@ public boolean charTyped(char p_95144_) {
4446
}
4547

4648
@Override
47-
public boolean keyPressed(int p_95146_) {
49+
public boolean keyPressed(KeyEvent event) {
4850
String selectedBefore = getSelected();
49-
boolean ret = super.keyPressed(p_95146_);
51+
boolean ret = super.keyPressed(event);
5052
String selectedAfter = getSelected();
5153
if (!selectedBefore.equals(selectedAfter)) {
5254
this.setSelectionFn.accept(selectedAfter);

src/main/java/org/cyclops/integratedscripting/client/gui/component/input/WidgetDialog.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import net.minecraft.client.gui.narration.NarratedElementType;
99
import net.minecraft.client.gui.narration.NarrationElementOutput;
1010
import net.minecraft.client.gui.screens.Screen;
11+
import net.minecraft.client.input.MouseButtonEvent;
1112
import net.minecraft.client.renderer.RenderPipelines;
1213
import net.minecraft.network.chat.Component;
1314
import net.minecraft.resources.ResourceLocation;
@@ -68,10 +69,10 @@ protected void renderWidget(GuiGraphics guiGraphics, int mouseX, int mouseY, flo
6869
}
6970

7071
@Override
71-
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
72-
return this.buttonConfirm.mouseClicked(mouseX, mouseY, mouseButton)
73-
|| this.buttonCancel.mouseClicked(mouseX, mouseY, mouseButton)
74-
|| super.mouseClicked(mouseX, mouseY, mouseButton);
72+
public boolean mouseClicked(MouseButtonEvent mouse, boolean isDoubleClick) {
73+
return this.buttonConfirm.mouseClicked(mouse, isDoubleClick)
74+
|| this.buttonCancel.mouseClicked(mouse, isDoubleClick)
75+
|| super.mouseClicked(mouse, isDoubleClick);
7576
}
7677

7778
@Override

0 commit comments

Comments
 (0)