Skip to content

Commit

Permalink
Port to 1.21.4 [build] [publish]
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrbysco committed Dec 8, 2024
1 parent 54830d0 commit 27537ca
Show file tree
Hide file tree
Showing 18 changed files with 42 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/BUG_REPORT.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ body:
id: loader-info
attributes:
label: Loader version
placeholder: ex. Forge 36.2.0 / Fabric 0.14.12
placeholder: ex. NeoForge 21.1.0 / Fabric 0.14.12
description: Please be as specific as possible, latest is not a valid version
validations:
required: true
- type: input
id: minecraft-info
attributes:
label: Minecraft version
placeholder: ex. 1.16.5
placeholder: ex. 1.21.1
description: Please be as specific as possible, latest is not a valid version
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: ./gradlew build
- uses: actions/upload-artifact@v4
with:
name: ForgeArtifact
name: NeoForgeArtifact
path: ./forge/build/libs/*.jar
- uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
// Required for NeoGradle
id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7"
id "net.darkhax.curseforgegradle" version "1.1.24" apply(false)
id "net.darkhax.curseforgegradle" version "1.1.25" apply(false)
id "com.modrinth.minotaur" version "2.+" apply(false)
}

Expand Down
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* Fix startup crash on fabric due to entrypoint mistake
* Initial update to 1.21.4
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
import com.mrbysco.dailydadserver.platform.Services;
import net.minecraft.ChatFormatting;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Player;
import net.minecraft.server.level.ServerPlayer;
import org.jetbrains.annotations.Nullable;

public class JokeHandler {
public static void onLoggedIn(@Nullable Player player) {
public static void onLoggedIn(@Nullable ServerPlayer player) {
if (player != null) {
Services.PLATFORM.getJokeAsync((joke, component) ->
player.sendSystemMessage(Component.literal("<DailyDad> ").withStyle(ChatFormatting.GOLD).append(component)));
}
}

public static void onPlayerRespawn(Player player, boolean endConquered) {
public static void onPlayerRespawn(ServerPlayer player, boolean endConquered) {
if (Services.PLATFORM.getJokeUponRespawn() && !endConquered) {
Services.PLATFORM.getJokeAsync((joke, component) ->
player.sendSystemMessage(Component.literal("<DailyDad> ").withStyle(ChatFormatting.GOLD).append(component)));
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"description": "Daily Dad Server Resources",
"pack_format": 32
"pack_format": 46
}
}
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java'
id 'idea'
id 'maven-publish'
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'fabric-loom' version '1.9-SNAPSHOT'
id 'net.darkhax.curseforgegradle'
id 'com.modrinth.minotaur'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;

public interface PlayerEventsCallback {
Event<Login> LOGIN_EVENT = EventFactory.createArrayBacked(Login.class, (listeners) -> (player) -> {
Expand All @@ -19,7 +19,7 @@ public interface PlayerEventsCallback {
});

interface Login {
InteractionResult onLogin(Player player);
InteractionResult onLogin(ServerPlayer player);
}

Event<Respawn> RESPAWN_EVENT = EventFactory.createArrayBacked(Respawn.class, (listeners) -> (player, endConquered) -> {
Expand All @@ -35,6 +35,6 @@ interface Login {
});

interface Respawn {
InteractionResult respawn(Player player, boolean endConquered);
InteractionResult respawn(ServerPlayer player, boolean endConquered);
}
}
6 changes: 3 additions & 3 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"dailydad_server.fabric.mixins.json"
],
"depends": {
"fabricloader": ">=0.15.11",
"minecraft": "~1.21",
"fabricloader": ">=0.16.7",
"minecraft": "~1.21.4",
"java": ">=21",
"fabric-api": "*",
"cloth-config": ">=15"
"cloth-config": ">=17"
}
}
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Project
version=2.0.2
version=2.1.0
group=com.mrbysco.dailydadserver

# Common
minecraft_version=1.21
minecraft_version=1.21.4

# NeoForge
neo_version=21.0.8-beta
neogradle.subsystems.parchment.minecraftVersion=1.20.6
neogradle.subsystems.parchment.mappingsVersion=2024.06.02
neo_version=21.4.10-beta
neogradle.subsystems.parchment.minecraftVersion=1.21.1
neogradle.subsystems.parchment.mappingsVersion=2024.11.17
neogradle.subsystems.conventions.runs.create-default-run-per-type=false

# Fabric
fabric_version=0.100.1+1.21
fabric_loader_version=0.15.11
cloth_config_version=15.0.127
mod_menu_version=11.0.0-beta.1
fabric_version=0.110.5+1.21.4
fabric_loader_version=0.16.9
cloth_config_version=17.0.142
mod_menu_version=13.0.0-beta.1

# Mod options
mod_name=DailyDad-Server
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
2 changes: 1 addition & 1 deletion neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.neoforged.gradle.userdev' version '7.0.142'
id 'net.neoforged.gradle.userdev' version '7.0.171'
id 'net.darkhax.curseforgegradle'
id 'com.modrinth.minotaur'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.mrbysco.dailydadserver.commands.ForgeDadCommands;
import com.mrbysco.dailydadserver.config.JokeConfig;
import com.mrbysco.dailydadserver.handler.JokeHandler;
import net.neoforged.api.distmarker.Dist;
import net.minecraft.server.level.ServerPlayer;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.Mod;
Expand All @@ -16,7 +16,7 @@
@Mod(Constants.MOD_ID)
public class DailyDadNeoForge {

public DailyDadNeoForge(IEventBus eventBus, Dist dist, ModContainer container) {
public DailyDadNeoForge(IEventBus eventBus, ModContainer container) {
container.registerConfig(Type.COMMON, JokeConfig.serverSpec);
eventBus.register(JokeConfig.class);

Expand All @@ -26,11 +26,13 @@ public DailyDadNeoForge(IEventBus eventBus, Dist dist, ModContainer container) {
}

public void onLoggedIn(PlayerLoggedInEvent event) {
JokeHandler.onLoggedIn(event.getEntity());
if (event.getEntity() instanceof ServerPlayer serverPlayer)
JokeHandler.onLoggedIn(serverPlayer);
}

public void onPlayerRespawn(PlayerEvent.PlayerRespawnEvent event) {
JokeHandler.onPlayerRespawn(event.getEntity(), event.isEndConquered());
if (event.getEntity() instanceof ServerPlayer serverPlayer)
JokeHandler.onPlayerRespawn(serverPlayer, event.isEndConquered());
}

public void onCommandRegister(RegisterCommandsEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static class Server {

internal_dadabase = builder
.comment("The internal dad-abase of jokes for in case the mod is unable to reach the API")
.defineList("internal_dadabase", List.of(dadabase), o -> (o instanceof String));
.defineList("internal_dadabase", List.of(dadabase), String::new, o -> (o instanceof String));

jokeUponRespawn = builder
.comment("Should a joke be told upon death [default: false]")
Expand Down
2 changes: 1 addition & 1 deletion neoforge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ Sometimes he laughs at them
[[dependencies.dailydad_server]]
modId="minecraft"
type="required"
versionRange="[1.21,1.22)"
versionRange="[1.21.4,1.22)"
ordering="NONE"
side="BOTH"

0 comments on commit 27537ca

Please sign in to comment.