Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ allprojects {
apply plugin: "java"
apply plugin: "idea"

java.toolchain.languageVersion = JavaLanguageVersion.of(21)
java.toolchain.languageVersion = JavaLanguageVersion.of(25)

tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
options.compilerArgs = ["-Xlint:deprecation"]
}

dependencies {
implementation("org.jspecify:jspecify:1.0.0") //TODO Use version catalog
implementation(libs.jspecify)
compileOnly(libs.lombok)
annotationProcessor(libs.lombok)
}
Expand Down Expand Up @@ -106,7 +106,7 @@ def isAlpha = false
if (version.contains("b")) {
relType = "beta"
}
if (version.contains("a") || version.contains("dev")) {
if (version.contains("a") || version.contains("dev") || version.contains("snapshot")) {
relType = "alpha"
isAlpha = true
}
Expand Down Expand Up @@ -182,7 +182,7 @@ curseforge {
addGameVersion(minecraftVersion)
}

addGameVersion("Java 21")
addGameVersion("Java 25")
if (project.includeFabric.toBoolean()) {
addGameVersion("Fabric")
}
Expand Down
17 changes: 7 additions & 10 deletions fabric/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,21 @@ plugins {

dependencies {
minecraft(libs.minecraft)
mappings(loom.officialMojangMappings())

modImplementation(libs.bundles.fabric) {
implementation(libs.bundles.fabric) {
exclude(module = "fabric-api-deprecated")
}

implementation(project(":common"))

modImplementation(libs.modmenu) {
api(libs.modmenu) {
exclude(group = "net.fabricmc.fabric-api")
}

modImplementation(libs.clothConfigFabric) {
exclude(group = "net.fabricmc.fabric-api")
exclude(module = "modmenu")
}
// modImplementation(libs.clothConfigFabric) {
// exclude(group = "net.fabricmc.fabric-api")
// exclude(module = "modmenu")
// }
}

tasks {
Expand All @@ -36,7 +35,7 @@ tasks {
compileJava {
options.encoding = "UTF-8"
options.isDeprecation = true
options.release.set(21)
options.release.set(25)
}
}

Expand All @@ -56,8 +55,6 @@ loom {
defaultRefmapName.set("fabric.${modId}.refmap.json")
}

accessWidenerPath.set(file("src/main/resources/fallingtree.accesswidener"))

runs {
create("FTFabricClient") {
client()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,30 @@

import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;
import fr.rakambda.fallingtree.common.FallingTreeCommon;
import fr.rakambda.fallingtree.fabric.FallingTree;
import fr.rakambda.fallingtree.fabric.client.cloth.ClothConfigHook;
import net.fabricmc.loader.api.FabricLoader;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.lang.reflect.InvocationTargetException;

public class ModMenuImpl implements ModMenuApi{
private static final Logger log = LogManager.getLogger(ModMenuImpl.class);

@Override
public ConfigScreenFactory<?> getModConfigScreenFactory(){
if(FabricLoader.getInstance().isModLoaded("cloth-config")){
return (screen) -> {
try{
return Class.forName("fr.rakambda.fallingtree.fabric.client.cloth.ClothConfigHook")
.asSubclass(ClothConfigHook.class)
.getConstructor(FallingTreeCommon.class)
.newInstance(FallingTree.getMod())
.load()
.apply(screen);
}
catch(ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e){
log.error("Failed to hook into ClothConfig", e);
}
return null;
};
}
// if(FabricLoader.getInstance().isModLoaded("cloth-config")){
// return (screen) -> {
// try{
// return Class.forName("fr.rakambda.fallingtree.fabric.client.cloth.ClothConfigHook")
// .asSubclass(ClothConfigHook.class)
// .getConstructor(FallingTreeCommon.class)
// .newInstance(FallingTree.getMod())
// .load()
// .apply(screen);
// }
// catch(ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e){
// log.error("Failed to hook into ClothConfig", e);
// }
// return null;
// };
// }
return screen -> null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import fr.rakambda.fallingtree.fabric.network.FabricServerPacketHandler;
import lombok.Getter;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLevelEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerWorldEvents;
import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
Expand Down Expand Up @@ -263,7 +263,7 @@ public void register(){
getServerPacketHandler().registerServer();

ServerTickEvents.END_SERVER_TICK.register(new LeafBreakingListener(this));
ServerWorldEvents.UNLOAD.register(new LeafBreakingListener(this));
ServerLevelEvents.UNLOAD.register(new LeafBreakingListener(this));
PlayerBlockBreakEvents.BEFORE.register(new BlockBreakListener(this));
PlayerBlockBreakEvents.AFTER.register(new BlockBreakListener(this));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ public class ChunkPosWrapper implements IChunkPos{

@Override
public int getX(){
return raw.x;
return raw.x();
}

@Override
public int getZ(){
return raw.z;
return raw.z();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public ILevel getLevel(){
@Override
@NonNull
public Set<String> getTags(){
return raw.getTags();
return raw.entityTags();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
import fr.rakambda.fallingtree.common.FallingTreeCommon;
import fr.rakambda.fallingtree.fabric.common.wrapper.ServerLevelWrapper;
import lombok.RequiredArgsConstructor;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLevelEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerWorldEvents;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
import org.jspecify.annotations.NonNull;

@RequiredArgsConstructor
public class LeafBreakingListener implements ServerTickEvents.EndTick, ServerWorldEvents.Unload{
public class LeafBreakingListener implements ServerTickEvents.EndTick, ServerLevelEvents.Unload{
@NonNull
private final FallingTreeCommon<?> mod;

@Override
public void onEndTick(MinecraftServer minecraftServer){
public void onEndTick(@NonNull MinecraftServer minecraftServer){
mod.getLeafBreakingHandler().onServerTick();
}

@Override
public void onWorldUnload(MinecraftServer server, ServerLevel world){
public void onLevelUnload(@NonNull MinecraftServer server, @NonNull ServerLevel world){
mod.getLeafBreakingHandler().onWorldUnload(new ServerLevelWrapper(world));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class FabricServerPacketHandler implements ServerPacketHandler{

@Override
public void registerServer(){
PayloadTypeRegistry.configurationS2C().register(FallingTreeConfigPacket.TYPE, FallingTreeConfigPacket.CODEC);
PayloadTypeRegistry.clientboundConfiguration().register(FallingTreeConfigPacket.TYPE, FallingTreeConfigPacket.CODEC);
ServerConfigurationConnectionEvents.CONFIGURE.register(((handler, server) -> {
var packet = ConfigurationPacket.get(server.isDedicatedServer(), mod.getConfiguration());
ServerConfigurationNetworking.send(handler, new FallingTreeConfigPacket(packet));
Expand Down
3 changes: 1 addition & 2 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@
"mixins": [
"fallingtree.mixins.json"
],
"accessWidener" : "fallingtree.accesswidener",
"depends": {
"fabricloader": ">=0.18.2",
"fabric-lifecycle-events-v1": "*",
"fabric-api": ">=0.91",
"java": ">=21"
"java": ">=25"
},
"suggests": {
"modmenu": "*",
Expand Down
2 changes: 0 additions & 2 deletions fabric/src/main/resources/fallingtree.accesswidener

This file was deleted.

4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ org.gradle.daemon=false
modId=fallingtree
modName=FallingTree
includeFabric=true
includeForge=true
includeNeoForge=true
includeForge=false
includeNeoForge=false
# Repository
repoUser=Rakambda
repoName=FallingTree
Expand Down
12 changes: 6 additions & 6 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ gson-version = "2.13.2"
log4j2-version = "2.25.3"

# Minecraft / Loaders
minecraftVersion = "1.21.11"
minecraftVersion = "26.1-snapshot-6"
fabric-loader-version = "0.18.4"
fabric-api-version = "0.139.5+"
fabric-api-version = "0.143.2+26.1"
forge-version = "1.21.11-61.0.7"
forgeEventbusValidator-version = "7.0-beta.12"
neoforgeVersion = "21.11.0-beta"

# Mod dependencies
modmenu-version = "17.0.0-beta.2"
modmenu-version = "18.0.0-alpha.5"
clothConfigVersion = "20.0.149"

fabric-loom-version = "1.13-SNAPSHOT"
fabric-loom-version = "1.15-SNAPSHOT"
forge-plugin-version = "[6.0.46,6.2)"
neoforge-plugin-version = "2.0.140"
curse-version = "1.4.0"
Expand All @@ -28,7 +28,7 @@ git-version-plugin-version = "4.2.0"

[libraries]
lombok = { group = "org.projectlombok", name = "lombok", version.ref = "lombok-version" }
jSpecify = { group = "org.jspecify", name = "jspecify", version.ref = "jspecify-version" }
jspecify = { group = "org.jspecify", name = "jspecify", version.ref = "jspecify-version" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson-version" }
log4j2 = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "log4j2-version" }
minecraft = { group = "com.mojang", name = "minecraft", version.ref = "minecraftVersion" }
Expand All @@ -48,7 +48,7 @@ fabric = ["fabric-loader", "fabric-api"]
curse = { id = "com.matthewprenger.cursegradle", version.ref = "curse-version"}
modrinth = { id = "com.modrinth.minotaur", version.ref = "modrinth-version"}
names = { id = "com.github.ben-manes.versions", version.ref = "names-version" }
loom = { id = "fabric-loom", version.ref = "fabric-loom-version" }
loom = { id = "net.fabricmc.fabric-loom", version.ref = "fabric-loom-version" }
forge = { id = "net.minecraftforge.gradle", version.ref = "forge-plugin-version" }
neoforge = { id = "net.neoforged.moddev", version.ref = "neoforge-plugin-version" }
gitVersion = { id = "com.palantir.git-version", version.ref = "git-version-plugin-version" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-rc-1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading