Skip to content

Commit 664d1a3

Browse files
committed
working 1.20.6
1 parent 7304728 commit 664d1a3

File tree

33 files changed

+167
-119
lines changed

33 files changed

+167
-119
lines changed

build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ allprojects {
1515
tasks.withType<JavaCompile>().configureEach {
1616
options.isFork = true
1717
options.isIncremental = true
18+
options.release.set(21)
1819
}
1920

2021
tasks.withType<Test>().configureEach {
@@ -44,7 +45,7 @@ afterEvaluate {
4445
}
4546
project(":platforms:bukkit:common").configureDistribution()
4647
forSubProjects(":common:addons") {
47-
apply(plugin = "com.github.johnrengelman.shadow")
48+
apply(plugin = "com.gradleup.shadow")
4849

4950
tasks.named("build") {
5051
finalizedBy(tasks.named("shadowJar"))

buildSrc/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ repositories {
1616

1717
dependencies {
1818
//TODO Allow pulling from Versions.kt
19-
implementation("com.github.johnrengelman", "shadow", "8.1.1")
20-
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.7.1")
19+
implementation("com.gradleup.shadow", "shadow-gradle-plugin", "8.3.1")
20+
implementation("io.papermc.paperweight.userdev", "io.papermc.paperweight.userdev.gradle.plugin", "1.7.2")
2121

2222
implementation("org.ow2.asm", "asm", "9.7")
2323
implementation("org.ow2.asm", "asm-tree", "9.7")
2424
implementation("com.dfsek.tectonic", "common", "4.2.1")
25-
implementation("org.yaml", "snakeyaml", "2.2")
25+
implementation("org.yaml", "snakeyaml", "2.3")
2626
}

buildSrc/src/main/kotlin/DependencyConfig.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ fun Project.configureDependencies() {
4848
maven("https://jitpack.io") {
4949
name = "JitPack"
5050
}
51+
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
52+
name = "Sonatype Snapshots"
53+
}
5154
}
5255

5356
dependencies {

buildSrc/src/main/kotlin/DistributionConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import kotlin.io.path.exists
2121

2222

2323
fun Project.configureDistribution() {
24-
apply(plugin = "com.github.johnrengelman.shadow")
24+
apply(plugin = "com.gradleup.shadow")
2525

2626
val downloadDefaultPacks = tasks.create("downloadDefaultPacks") {
2727
group = "terra"

buildSrc/src/main/kotlin/Versions.kt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,23 @@ object Versions {
88
const val paralithic = "0.7.1"
99
const val strata = "1.3.2"
1010

11-
const val cloud = "2.0.0-rc.2"
12-
const val cloudPaper = "2.0.0-beta.9"
13-
const val cloudFabric = "2.0.0-beta.7"
11+
const val cloud = "2.0.0"
12+
const val cloudPaper = "2.0.0-beta.10"
13+
const val cloudFabric = "2.0.0-beta.9"
1414

1515
const val caffeine = "3.1.8"
1616

17-
const val slf4j = "2.0.13"
17+
const val slf4j = "2.0.16"
1818

1919
object Internal {
20-
const val shadow = "8.1.1"
20+
const val shadow = "8.3.1"
2121
const val apacheText = "1.12.0"
2222
const val apacheIO = "2.16.1"
23-
const val guava = "33.1.0-jre"
23+
const val guava = "33.3.0-jre"
2424
const val asm = "9.7"
25-
const val snakeYml = "2.2"
25+
const val snakeYml = "2.3"
2626
const val jetBrainsAnnotations = "24.1.0"
27-
const val junit = "5.10.2"
27+
const val junit = "5.11.0"
2828
}
2929
}
3030

@@ -38,14 +38,14 @@ object Versions {
3838
// }
3939

4040
object Mod {
41-
const val mixin = "0.12.5+mixin.0.8.5"
41+
const val mixin = "0.15.3+mixin.0.8.7"
4242

4343
const val minecraft = "1.20.6"
4444
const val yarn = "$minecraft+build.1"
45-
const val fabricLoader = "0.15.10"
45+
const val fabricLoader = "0.16.5"
4646

47-
const val architecuryLoom = "1.6.395"
48-
const val architecturyPlugin = "3.4.155"
47+
const val architecuryLoom = "1.7.413"
48+
const val architecturyPlugin = "3.4.159"
4949
}
5050
//
5151
// object Forge {
@@ -54,14 +54,14 @@ object Versions {
5454
// }
5555

5656
object Bukkit {
57-
const val minecraft = "1.21"
58-
const val paperBuild = "$minecraft-R0.1-SNAPSHOT"
57+
const val minecraft = "1.21.1"
58+
const val paperBuild = "$minecraft-R0.1-20240917.151311-80"
5959
const val paper = paperBuild
6060
const val paperLib = "1.0.8"
6161
const val reflectionRemapper = "0.1.1"
6262
const val paperDevBundle = paperBuild
63-
const val runPaper = "2.3.0"
64-
const val paperWeight = "1.7.1"
63+
const val runPaper = "2.3.1"
64+
const val paperWeight = "1.7.2"
6565
}
6666

6767
//
@@ -73,6 +73,6 @@ object Versions {
7373
//
7474
object CLI {
7575
const val nbt = "6.1"
76-
const val logback = "1.4.14"
76+
const val logback = "1.5.8"
7777
}
7878
}

gradle/wrapper/gradle-wrapper.jar

-9 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionSha256Sum=1541fa36599e12857140465f3c91a97409b4512501c26f9631fb113e392c5bd1
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.

gradlew.bat

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
4343
%JAVA_EXE% -version >NUL 2>&1
4444
if %ERRORLEVEL% equ 0 goto execute
4545

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5151

5252
goto fail
5353

@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5757

5858
if exist "%JAVA_EXE%" goto execute
5959

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6565

6666
goto fail
6767

platforms/bukkit/build.gradle.kts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ plugins {
22
id("xyz.jpenilla.run-paper") version Versions.Bukkit.runPaper
33
}
44

5-
repositories {
6-
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
7-
name = "Sonatype"
8-
}
9-
}
10-
115
dependencies {
126
shaded(project(":platforms:bukkit:common"))
137
shaded(project(":platforms:bukkit:nms:v1_21", configuration = "reobf"))

platforms/bukkit/nms/v1_21/build.gradle.kts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
apply(plugin = "io.papermc.paperweight.userdev")
22

3-
repositories {
4-
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
5-
}
6-
73
dependencies {
84
api(project(":platforms:bukkit:common"))
95
paperDevBundle(Versions.Bukkit.paperDevBundle)

platforms/bukkit/nms/v1_21/src/main/java/com/dfsek/terra/bukkit/nms/v1_21/AwfulBukkitHacks.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import net.minecraft.resources.ResourceKey;
1111
import net.minecraft.resources.ResourceLocation;
1212
import net.minecraft.tags.TagKey;
13+
import net.minecraft.world.item.ItemStack;
1314
import net.minecraft.world.level.biome.Biome;
1415
import org.bukkit.NamespacedKey;
1516
import org.slf4j.Logger;

platforms/fabric/build.gradle.kts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@ architectury {
1010
loader("fabric")
1111
}
1212

13-
repositories {
14-
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") {
15-
name = "Sonatype Snapshots"
16-
}
17-
}
18-
1913
dependencies {
2014
shadedApi(project(":common:implementation:base"))
2115

@@ -51,10 +45,6 @@ loom {
5145
addonDir(project.file("./run/config/Terra/addons"), tasks.named("configureLaunch").get())
5246

5347
tasks {
54-
compileJava {
55-
options.release.set(17)
56-
}
57-
5848
remapJar {
5949
dependsOn("installAddons")
6050

platforms/fabric/src/main/resources/fabric.mod.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
"terra.common.mixins.json"
2727
],
2828
"depends": {
29-
"fabricloader": ">=0.15.1",
30-
"java": ">=17",
31-
"minecraft": ">=1.20.4",
29+
"fabricloader": ">=0.16.5",
30+
"java": ">=21",
31+
"minecraft": ">=1.20.6",
3232
"fabric": "*"
3333
}
3434
}

platforms/fabric/src/main/resources/terra.fabric.mixins.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"required": true,
33
"minVersion": "0.8",
44
"package": "com.dfsek.terra.fabric.mixin",
5-
"compatibilityLevel": "JAVA_17",
5+
"compatibilityLevel": "JAVA_21",
66
"mixins": [
77
],
88
"client": [

platforms/forge/src/main/resources/terra.forge.mixins.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"required": true,
33
"minVersion": "0.8",
44
"package": "com.dfsek.terra.forge.mixin",
5-
"compatibilityLevel": "JAVA_17",
5+
"compatibilityLevel": "JAVA_21",
66
"mixins": [
77
"lifecycle.NoiseConfigMixin"
88
],

platforms/mixin-common/src/main/java/com/dfsek/terra/mod/handle/MinecraftItemHandle.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@
2525
import net.minecraft.registry.Registry;
2626
import net.minecraft.registry.RegistryKey;
2727
import net.minecraft.registry.RegistryWrapper;
28+
import net.minecraft.registry.RegistryWrapper.Impl;
2829
import net.minecraft.util.Identifier;
2930

31+
import java.util.Optional;
3032
import java.util.Set;
3133
import java.util.stream.Collectors;
34+
import java.util.stream.Stream;
3235

3336
import com.dfsek.terra.api.handle.ItemHandle;
3437
import com.dfsek.terra.api.inventory.Item;
@@ -43,8 +46,13 @@ public Item createItem(String data) {
4346
try {
4447
return (Item) new ItemStackArgumentType(new CommandRegistryAccess() {
4548
@Override
46-
public <T> RegistryWrapper<T> createWrapper(RegistryKey<? extends Registry<T>> registryRef) {
47-
return CommonPlatform.get().getServer().getRegistryManager().getWrapperOrThrow(registryRef);
49+
public Stream<RegistryKey<? extends Registry<?>>> streamAllRegistryKeys() {
50+
return CommonPlatform.get().getServer().getRegistryManager().streamAllRegistryKeys();
51+
}
52+
53+
@Override
54+
public <T> Optional<Impl<T>> getOptionalWrapper(RegistryKey<? extends Registry<? extends T>> registryRef) {
55+
return Optional.of(CommonPlatform.get().getServer().getRegistryManager().getWrapperOrThrow(registryRef));
4856
}
4957
}).parse(new StringReader(data)).getItem();
5058
} catch(CommandSyntaxException e) {

platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/block/entity/MobSpawnerBlockEntityMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private MobSpawnerBlockEntityMixin(BlockEntityType<?> type, BlockPos pos, BlockS
5050
public abstract MobSpawnerLogic getLogic();
5151

5252
@Shadow
53-
public abstract void setEntityType(net.minecraft.entity.EntityType<?> entityType, Random random);
53+
public abstract void method_46408(net.minecraft.entity.EntityType<?> entityType, Random random);
5454

5555
public EntityType terra$getSpawnedType() {
5656
return (EntityType) Registries.ENTITY_TYPE.get(
@@ -64,7 +64,7 @@ private MobSpawnerBlockEntityMixin(BlockEntityType<?> type, BlockPos pos, BlockS
6464
} else {
6565
rand = Random.create();
6666
}
67-
setEntityType((net.minecraft.entity.EntityType<?>) creatureType, rand);
67+
method_46408((net.minecraft.entity.EntityType<?>) creatureType, rand);
6868
}
6969

7070
public int terra$getDelay() {

platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemMixin.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@
3030
@Implements(@Interface(iface = com.dfsek.terra.api.inventory.Item.class, prefix = "terra$"))
3131
public abstract class ItemMixin {
3232
@Shadow
33-
public abstract int getMaxDamage();
33+
public abstract net.minecraft.item.ItemStack getDefaultStack();
3434

3535
@SuppressWarnings("ConstantConditions")
3636
public ItemStack terra$newItemStack(int amount) {
3737
return (ItemStack) (Object) new net.minecraft.item.ItemStack((Item) (Object) this, amount);
3838
}
3939

4040
public double terra$getMaxDurability() {
41-
return getMaxDamage();
41+
//TODO verify this is correct
42+
return getDefaultStack().getMaxDamage();
4243
}
4344
}

platforms/mixin-common/src/main/java/com/dfsek/terra/mod/mixin/implementations/terra/inventory/item/ItemStackMixin.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@
1717

1818
package com.dfsek.terra.mod.mixin.implementations.terra.inventory.item;
1919

20+
import net.minecraft.component.Component;
21+
import net.minecraft.component.ComponentChanges;
22+
import net.minecraft.component.ComponentMap;
23+
import net.minecraft.component.ComponentMapImpl;
24+
import net.minecraft.component.DataComponentType;
2025
import net.minecraft.item.ItemStack;
2126
import net.minecraft.nbt.NbtCompound;
2227
import org.jetbrains.annotations.Nullable;
28+
import org.spongepowered.asm.mixin.Final;
2329
import org.spongepowered.asm.mixin.Implements;
2430
import org.spongepowered.asm.mixin.Interface;
2531
import org.spongepowered.asm.mixin.Intrinsic;
@@ -46,7 +52,11 @@ public abstract class ItemStackMixin {
4652
public abstract boolean isDamageable();
4753

4854
@Shadow
49-
public abstract void setNbt(@Nullable NbtCompound tag);
55+
public abstract ComponentMap getComponents();
56+
57+
@Shadow
58+
@Final
59+
private ComponentMapImpl components;
5060

5161
public int terra$getAmount() {
5262
return getCount();
@@ -66,7 +76,13 @@ public abstract class ItemStackMixin {
6676

6777
@SuppressWarnings("ConstantConditions")
6878
public void terra$setItemMeta(ItemMeta meta) {
69-
setNbt(((ItemStack) (Object) meta).getNbt());
79+
ComponentChanges.Builder builder = ComponentChanges.builder();
80+
this.getComponents().getTypes().forEach(builder::remove);
81+
82+
ComponentMap components = ((ItemStack) (Object) meta).getComponents();
83+
components.forEach(builder::add);
84+
85+
this.components.applyChanges(builder.build());
7086
}
7187

7288
@Intrinsic

0 commit comments

Comments
 (0)