Skip to content

Commit ba089f5

Browse files
committed
Partial update to 26.1 snapshot
1 parent cdb5f8a commit ba089f5

68 files changed

Lines changed: 164 additions & 471 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/gradle.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ jobs:
88

99
steps:
1010
- name: Checkout Repository
11-
uses: actions/checkout@v4
11+
uses: actions/checkout@v6
1212

13-
- name: Setup JDK 21
14-
uses: actions/setup-java@v4
13+
- name: Setup JDK 25
14+
uses: actions/setup-java@v5
1515
with:
1616
distribution: adopt
17-
java-version: 21
17+
java-version: 25
1818

1919
- name: Setup Gradle
20-
uses: gradle/actions/setup-gradle@v4
20+
uses: gradle/actions/setup-gradle@v5
2121

2222
- name: Grant execute permission for gradlew
2323
run: chmod +x gradlew
@@ -26,7 +26,7 @@ jobs:
2626
run: ./gradlew build
2727

2828
- name: Upload Build Artifacts
29-
uses: actions/upload-artifact@v4
29+
uses: actions/upload-artifact@v7
3030
with:
3131
name: build-artifacts
3232
path: build/libs

.github/workflows/pull_request.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ jobs:
88

99
steps:
1010
- name: Checkout Repository
11-
uses: actions/checkout@v4
11+
uses: actions/checkout@v6
1212

13-
- name: Setup JDK 21
14-
uses: actions/setup-java@v4
13+
- name: Setup JDK 25
14+
uses: actions/setup-java@v5
1515
with:
1616
distribution: adopt
17-
java-version: 21
17+
java-version: 25
1818

1919
- name: Setup Gradle
20-
uses: gradle/actions/setup-gradle@v4
20+
uses: gradle/actions/setup-gradle@v5
2121

2222
- name: Grant execute permission for gradlew
2323
run: chmod +x gradlew

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@ jobs:
2626
environment: Publishing
2727
steps:
2828
- name: Checkout Repository
29-
uses: actions/checkout@v4
29+
uses: actions/checkout@v6
3030

31-
- name: Setup JDK 21
32-
uses: actions/setup-java@v4
31+
- name: Setup JDK 25
32+
uses: actions/setup-java@v5
3333
with:
3434
distribution: adopt
35-
java-version: 21
35+
java-version: 25
3636

3737
- name: Setup Gradle
38-
uses: gradle/actions/setup-gradle@v4
38+
uses: gradle/actions/setup-gradle@v5
3939
with:
4040
gradle-home-cache-cleanup: true
4141
cache-read-only: true

build.gradle.kts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
plugins {
22
id("java")
3-
id("fabric-loom") version ("1.14-SNAPSHOT") apply (false)
3+
id("net.fabricmc.fabric-loom") version ("1.15-SNAPSHOT") apply (false)
44
id("me.modmuss50.mod-publish-plugin") version ("0.8.1") apply (false)
55

66
}
77

88
// Fabric: https://fabricmc.net/develop/
99
// Neoforge: https://neoforged.net/
10-
val MINECRAFT_VERSION by extra { "1.21.11" } //MUST manually update fabric.mod.json and neoforge.mods.toml
11-
val NEOFORGE_VERSION by extra { "21.11.0-beta" }
12-
val FABRIC_LOADER_VERSION by extra { "0.18.2" }
13-
val FABRIC_API_VERSION by extra { "0.139.4+1.21.11" }
10+
val MINECRAFT_VERSION by extra { "26.1-rc-3" } //MUST manually update fabric.mod.json and neoforge.mods.toml
11+
val NEOFORGE_VERSION by extra { "26.1.0.0-alpha.4+snapshot-1" }
12+
val FABRIC_LOADER_VERSION by extra { "0.18.4" }
13+
val FABRIC_API_VERSION by extra { "0.144.0+26.1" }
1414

1515
// This value can be set to null to disable Parchment.
1616
val PARCHMENT_VERSION by extra { null }
@@ -35,7 +35,7 @@ subprojects {
3535
apply(plugin = "maven-publish")
3636
apply(plugin = "me.modmuss50.mod-publish-plugin")
3737

38-
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
38+
java.toolchain.languageVersion = JavaLanguageVersion.of(25)
3939

4040

4141
fun createVersionString(): String {
@@ -73,9 +73,11 @@ subprojects {
7373
version = createVersionString()
7474
group = "net.caffeinemc.mods"
7575

76+
java.toolchain.languageVersion = JavaLanguageVersion.of(25)
77+
7678
tasks.withType<JavaCompile> {
7779
options.encoding = "UTF-8"
78-
options.release.set(21)
80+
options.release.set(25)
7981
}
8082

8183
tasks.withType<GenerateModuleMetadata>().configureEach {

common/build.gradle.kts

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import net.fabricmc.loom.task.RemapJarTask
21

32
plugins {
43
id("java")
54
id("idea")
6-
id("fabric-loom") version ("1.14-SNAPSHOT")
5+
id("net.fabricmc.fabric-loom") version ("1.15-SNAPSHOT")
76
}
87

98
repositories {
@@ -18,34 +17,27 @@ val FABRIC_API_VERSION: String by rootProject.extra
1817

1918
dependencies {
2019
minecraft(group = "com.mojang", name = "minecraft", version = MINECRAFT_VERSION)
21-
mappings(loom.layered() {
22-
officialMojangMappings()
23-
if (PARCHMENT_VERSION != null) {
24-
parchment("org.parchmentmc.data:parchment-${MINECRAFT_VERSION}:${PARCHMENT_VERSION}@zip")
25-
}
26-
})
27-
28-
modCompileOnly("net.fabricmc:fabric-loader:$FABRIC_LOADER_VERSION")
20+
compileOnly("net.fabricmc:fabric-loader:$FABRIC_LOADER_VERSION")
2921

3022
fun addDependentFabricModule(name: String) {
3123
val module = fabricApi.module(name, FABRIC_API_VERSION)
32-
modCompileOnly(module)
24+
compileOnly(module)
3325
}
3426

3527
fun addEmbeddedFabricModule(name: String) {
3628
val module = fabricApi.module(name, FABRIC_API_VERSION)
37-
modImplementation(module)
29+
implementation(module)
3830
include(module)
3931
}
4032

4133
fun addCompileOnlyFabricModule(name: String) {
4234
val module = fabricApi.module(name, FABRIC_API_VERSION)
43-
modCompileOnly(module)
35+
compileOnly(module)
4436
}
4537

4638
fun addFabricModule(name: String) {
4739
val module = fabricApi.module(name, FABRIC_API_VERSION)
48-
modImplementation(module)
40+
implementation(module)
4941
}
5042

5143
//Copied from fabric build.gradle to avoid having multiple slightly different (few fabric interfaces added) minecraft merged mapped jars
@@ -96,21 +88,13 @@ tasks.register<Jar>("apiJar") {
9688
destinationDirectory = rootDir.resolve("build").resolve("libs")
9789
}
9890

99-
tasks.register<RemapJarTask>("remapApiJar") {
100-
dependsOn("apiJar")
101-
archiveBaseName.set("lithium-fabric")
102-
archiveClassifier.set("api")
103-
inputFile.set(tasks.named<Jar>("apiJar").get().archiveFile)
104-
destinationDirectory = rootDir.resolve("build").resolve("libs")
105-
}
106-
10791
tasks.named<Jar>("jar") {
10892
from(sourceSets["api"].output.classesDirs)
10993
from(sourceSets["api"].output.resourcesDir)
11094
}
11195

11296
tasks.named("build") {
113-
dependsOn("remapApiJar", "apiJar")
97+
dependsOn("apiJar")
11498
}
11599

116100
loom {

common/src/main/java/net/caffeinemc/mods/lithium/common/ai/useless_behaviors/LithiumEmptyBehavior.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
import net.minecraft.world.entity.LivingEntity;
55
import net.minecraft.world.entity.ai.behavior.Behavior;
66
import net.minecraft.world.entity.ai.behavior.BehaviorControl;
7+
import net.minecraft.world.entity.ai.memory.MemoryModuleType;
8+
9+
import java.util.Set;
710

811
/**
912
* Dummy behavior to replace useless behaviors with.
@@ -16,6 +19,11 @@ public Behavior.Status getStatus() {
1619
return Behavior.Status.STOPPED;
1720
}
1821

22+
@Override
23+
public Set<MemoryModuleType<?>> getRequiredMemories() {
24+
return Set.of();
25+
}
26+
1927
@Override
2028
public boolean tryStart(ServerLevel serverLevel, E livingEntity, long l) {
2129
return false;

common/src/main/java/net/caffeinemc/mods/lithium/common/block/entity/SleepUntilTimeBlockEntityTickInvoker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package net.caffeinemc.mods.lithium.common.block.entity;
22

33
import net.minecraft.core.BlockPos;
4+
import net.minecraft.core.registries.BuiltInRegistries;
45
import net.minecraft.world.level.block.entity.BlockEntity;
5-
import net.minecraft.world.level.block.entity.BlockEntityType;
66
import net.minecraft.world.level.block.entity.TickingBlockEntity;
77
import org.jetbrains.annotations.NotNull;
88

@@ -32,6 +32,6 @@ public boolean isRemoved() {
3232
@Override
3333
public @NotNull String getType() {
3434
//noinspection ConstantConditions
35-
return BlockEntityType.getKey(this.sleepingBlockEntity.getType()).toString();
35+
return BuiltInRegistries.BLOCK_ENTITY_TYPE.getKey(this.sleepingBlockEntity.getType()).toString();
3636
}
3737
}
Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,12 @@
11
package net.caffeinemc.mods.lithium.common.client;
22

3-
import com.google.common.collect.ImmutableList;
4-
import com.mojang.datafixers.util.Pair;
5-
import com.mojang.serialization.Codec;
6-
import com.mojang.serialization.DataResult;
7-
import com.mojang.serialization.DynamicOps;
8-
import net.caffeinemc.mods.lithium.common.util.collections.DummyList;
9-
import net.minecraft.world.entity.LivingEntity;
103
import net.minecraft.world.entity.ai.Brain;
114
import org.spongepowered.asm.mixin.Unique;
125

13-
import java.util.List;
146
import java.util.concurrent.atomic.AtomicInteger;
157

168
public class SharedFields {
179
public static final AtomicInteger MAXIMUM_BIOME_PARTICLE_CHANCE = new AtomicInteger(Float.floatToIntBits(0.0F)); //Using atomic integer as replacement for atomic float
1810
@Unique
19-
public static final Brain<?> DUMMY_BRAIN = new Brain<>(new DummyList<>(), List.of(), ImmutableList.of(), () -> new Codec<>() {
20-
@Override
21-
public <T> DataResult<Pair<Brain<LivingEntity>, T>> decode(DynamicOps<T> dynamicOps, T t) {
22-
throw new IllegalStateException("Trying to decode client side brain! If you really want this, disable lithium's client side brain optimization!");
23-
}
24-
25-
@Override
26-
public <T> DataResult<T> encode(Brain<LivingEntity> livingEntityBrain, DynamicOps<T> dynamicOps, T t) {
27-
return DataResult.success(t); //Encode nothing, compatible with mods that just want the nbt of the entire mob for something else
28-
}
29-
});
11+
public static final Brain<?> DUMMY_BRAIN = new Brain<>();
3012
}

common/src/main/java/net/caffeinemc/mods/lithium/common/entity/EntityClassGroup.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import it.unimi.dsi.fastutil.objects.Reference2ByteOpenHashMap;
55
import it.unimi.dsi.fastutil.objects.ReferenceReferenceImmutablePair;
66
import net.caffeinemc.mods.lithium.common.reflection.ReflectionUtil;
7-
import net.caffeinemc.mods.lithium.common.services.PlatformMappingInformation;
87
import net.minecraft.world.entity.Entity;
98
import net.minecraft.world.entity.EntityType;
109
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
@@ -33,7 +32,7 @@ public class EntityClassGroup {
3332
public static final EntityClassGroup CUSTOM_COLLIDE_LIKE_MINECART_BOAT_WINDCHARGE; //aka entities that will attempt to collide with all other entities when moving
3433

3534
static {
36-
String remapped_collidesWith = PlatformMappingInformation.INSTANCE.mapMethodName("intermediary", "net.minecraft.class_1297", "method_30949", "(Lnet/minecraft/class_1297;)Z", "canCollideWith");
35+
String remapped_collidesWith = "canCollideWith";
3736
CUSTOM_COLLIDE_LIKE_MINECART_BOAT_WINDCHARGE = new EntityClassGroup(
3837
(Class<?> entityClass, Supplier<EntityType<?>> entityType) -> ReflectionUtil.hasMethodOverride(entityClass, Entity.class, true, remapped_collidesWith, Entity.class));
3938

@@ -135,7 +134,7 @@ public static class NoDragonClassGroup extends EntityClassGroup {
135134
public static final NoDragonClassGroup BOAT_SHULKER_LIKE_COLLISION; //aka entities that other entities will do block-like collisions with when moving
136135

137136
static {
138-
String remapped_canBeCollidedWith = PlatformMappingInformation.INSTANCE.mapMethodName("intermediary", "net.minecraft.class_1297", "method_30948", "(Lnet/minecraft/class_1297;)Z", "canBeCollidedWith");
137+
String remapped_canBeCollidedWith = "canBeCollidedWith";
139138
BOAT_SHULKER_LIKE_COLLISION = new NoDragonClassGroup(
140139
(Class<?> entityClass, Supplier<EntityType<?>> entityType) -> ReflectionUtil.hasMethodOverride(entityClass, Entity.class, true, remapped_canBeCollidedWith, Entity.class));
141140

common/src/main/java/net/caffeinemc/mods/lithium/common/entity/projectile/ProjectileEntityClassGroup.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import net.caffeinemc.mods.lithium.common.entity.EntityClassGroup;
44
import net.caffeinemc.mods.lithium.common.reflection.ReflectionUtil;
5-
import net.caffeinemc.mods.lithium.common.services.PlatformMappingInformation;
65
import net.minecraft.tags.EntityTypeTags;
76
import net.minecraft.world.entity.Entity;
87
import net.minecraft.world.entity.EntityType;
@@ -30,7 +29,7 @@ public class ProjectileEntityClassGroup {
3029

3130

3231
static {
33-
String remapped_canHitEntity = PlatformMappingInformation.INSTANCE.mapMethodName("intermediary", "net.minecraft.class_1676", "method_26958", "(Lnet/minecraft/class_1297;)Z", "canHitEntity");
32+
String remapped_canHitEntity = "canHitEntity";
3433
OPTIMIZED_PROJECTILES = new EntityClassGroup(
3534
(Class<?> entityClass, Supplier<EntityType<?>> entityType) -> {
3635
Class<?> parentClass = Projectile.class;
@@ -48,8 +47,8 @@ public class ProjectileEntityClassGroup {
4847
return !ReflectionUtil.hasMethodOverride(entityClass, parentClass, true, remapped_canHitEntity, Entity.class);
4948
});
5049

51-
String remapped_canBeHitByProjectile = PlatformMappingInformation.INSTANCE.mapMethodName("intermediary", "net.minecraft.class_1297", "method_49108", "()Z", "canBeHitByProjectile");
52-
String remapped_isPickable = PlatformMappingInformation.INSTANCE.mapMethodName("intermediary", "net.minecraft.class_1297", "method_5863", "()Z", "isPickable");
50+
String remapped_canBeHitByProjectile = "canBeHitByProjectile";
51+
String remapped_isPickable = "isPickable";
5352
CAN_MAYBE_BE_HIT_BY_OPTIMIZED_PROJECTILE = new EntityClassGroup(
5453
(entityClass, entityType) -> {
5554
Class<?> parentClass_isPickable = Entity.class;
@@ -67,7 +66,7 @@ public class ProjectileEntityClassGroup {
6766
if (AbstractArrow.class.isAssignableFrom(entityClass)) {
6867
parentClass_isPickable = AbstractArrow.class;
6968
}
70-
if (entityType.get().is(EntityTypeTags.REDIRECTABLE_PROJECTILE)) {
69+
if (entityType.get().builtInRegistryHolder().is(EntityTypeTags.REDIRECTABLE_PROJECTILE)) {
7170
return true;
7271
}
7372
}

0 commit comments

Comments
 (0)