diff --git a/CHANGELOG.md b/CHANGELOG.md index 271ae12..9e3c07f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1 @@ -- Reduced default rescueDistance to 3 instead of 5 -- Require Line of Sight for rescuing to initiate -- Require the player to be looking towards the downed player for rescuing to initiate \ No newline at end of file +- Updated to Minecraft 1.21.2 diff --git a/common/src/main/java/net/blay09/mods/hardcorerevival/HardcoreRevivalManager.java b/common/src/main/java/net/blay09/mods/hardcorerevival/HardcoreRevivalManager.java index 881ba4a..784e445 100644 --- a/common/src/main/java/net/blay09/mods/hardcorerevival/HardcoreRevivalManager.java +++ b/common/src/main/java/net/blay09/mods/hardcorerevival/HardcoreRevivalManager.java @@ -18,6 +18,7 @@ import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.MinecraftServer; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.damagesource.DamageType; import net.minecraft.world.effect.MobEffectInstance; @@ -37,7 +38,7 @@ public HardcoreRevivalData getRevivalData(Player player) { return provider != null ? provider : InvalidHardcoreRevivalData.INSTANCE; } - public void knockout(Player player, DamageSource source) { + public void knockout(ServerPlayer player, DamageSource source) { HardcoreRevivalData revivalData = getRevivalData(player); if (revivalData.isKnockedOut()) { return; @@ -72,7 +73,7 @@ public void knockout(Player player, DamageSource source) { Balm.getEvents().fireEvent(new PlayerKnockedOutEvent(player, source)); // If enabled, show a death message - if (player.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES)) { + if (player.serverLevel().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES)) { MinecraftServer server = player.getServer(); if (server != null) { Team team = player.getTeam(); @@ -111,7 +112,7 @@ public void wakeup(Player player, boolean applyEffects) { String[] parts = effectString.split("\\|"); ResourceLocation registryName = ResourceLocation.tryParse(parts[0]); if (registryName != null) { - final var holder = BuiltInRegistries.MOB_EFFECT.getHolder(registryName); + final var holder = BuiltInRegistries.MOB_EFFECT.get(registryName); if (holder.isPresent()) { int duration = tryParseInt(parts.length >= 2 ? parts[1] : null, 600); int amplifier = tryParseInt(parts.length >= 3 ? parts[2] : null, 0); @@ -179,8 +180,8 @@ public void notRescuedInTime(Player player) { accessor.setSpawnInvulnerableTime(0); } - final var damageTypes = player.level().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE); - final var damageSource = new DamageSource(damageTypes.getHolderOrThrow(NOT_RESCUED_IN_TIME)); + final var damageTypes = player.level().registryAccess().lookupOrThrow(Registries.DAMAGE_TYPE); + final var damageSource = new DamageSource(damageTypes.getOrThrow(NOT_RESCUED_IN_TIME)); final var revivalData = getRevivalData(player); revivalData.setLastKnockoutTicksPassed(0); reset(player); diff --git a/common/src/main/java/net/blay09/mods/hardcorerevival/InternalMethodsImpl.java b/common/src/main/java/net/blay09/mods/hardcorerevival/InternalMethodsImpl.java index 31fc41b..bbcade6 100644 --- a/common/src/main/java/net/blay09/mods/hardcorerevival/InternalMethodsImpl.java +++ b/common/src/main/java/net/blay09/mods/hardcorerevival/InternalMethodsImpl.java @@ -2,32 +2,32 @@ import net.blay09.mods.hardcorerevival.api.InternalMethods; import net.blay09.mods.hardcorerevival.config.HardcoreRevivalConfig; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.entity.player.Player; public class InternalMethodsImpl implements InternalMethods { @Override - public void knockout(Player player, DamageSource damageSource) { + public void knockout(ServerPlayer player, DamageSource damageSource) { HardcoreRevival.getManager().knockout(player, damageSource); } @Override - public void wakeup(Player player, boolean applyEffects) { + public void wakeup(ServerPlayer player, boolean applyEffects) { HardcoreRevival.getManager().wakeup(player, applyEffects); } @Override - public boolean isKnockedOut(Player player) { + public boolean isKnockedOut(ServerPlayer player) { return HardcoreRevival.getManager().isKnockedOut(player); } @Override - public int getKnockoutTicksPassed(Player player) { + public int getKnockoutTicksPassed(ServerPlayer player) { return HardcoreRevival.getManager().getRevivalData(player).getKnockoutTicksPassed(); } @Override - public int getKnockoutTicksLeft(Player player) { + public int getKnockoutTicksLeft(ServerPlayer player) { final var maxTicksUntilDeath = HardcoreRevivalConfig.getActive().secondsUntilDeath * 20; return Math.max(0, maxTicksUntilDeath - getKnockoutTicksPassed(player)); } diff --git a/common/src/main/java/net/blay09/mods/hardcorerevival/api/HardcoreRevivalAPI.java b/common/src/main/java/net/blay09/mods/hardcorerevival/api/HardcoreRevivalAPI.java index 5e35c9f..fcbe0d2 100644 --- a/common/src/main/java/net/blay09/mods/hardcorerevival/api/HardcoreRevivalAPI.java +++ b/common/src/main/java/net/blay09/mods/hardcorerevival/api/HardcoreRevivalAPI.java @@ -1,7 +1,7 @@ package net.blay09.mods.hardcorerevival.api; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.entity.player.Player; import java.lang.reflect.InvocationTargetException; @@ -18,23 +18,23 @@ private static InternalMethods loadInternalMethods() { } } - public static void knockout(Player player, DamageSource damageSource) { + public static void knockout(ServerPlayer player, DamageSource damageSource) { internalMethods.knockout(player, damageSource); } - public static void wakeup(Player player, boolean applyEffects) { + public static void wakeup(ServerPlayer player, boolean applyEffects) { internalMethods.wakeup(player, applyEffects); } - public static boolean isKnockedOut(Player player) { + public static boolean isKnockedOut(ServerPlayer player) { return internalMethods.isKnockedOut(player); } - public static int getKnockoutTicksPassed(Player player) { + public static int getKnockoutTicksPassed(ServerPlayer player) { return internalMethods.getKnockoutTicksPassed(player); } - public static int getKnockoutTicksLeft(Player player) { + public static int getKnockoutTicksLeft(ServerPlayer player) { return internalMethods.getKnockoutTicksLeft(player); } } diff --git a/common/src/main/java/net/blay09/mods/hardcorerevival/api/InternalMethods.java b/common/src/main/java/net/blay09/mods/hardcorerevival/api/InternalMethods.java index 113bd26..9161efe 100644 --- a/common/src/main/java/net/blay09/mods/hardcorerevival/api/InternalMethods.java +++ b/common/src/main/java/net/blay09/mods/hardcorerevival/api/InternalMethods.java @@ -1,16 +1,16 @@ package net.blay09.mods.hardcorerevival.api; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.entity.player.Player; public interface InternalMethods { - void knockout(Player player, DamageSource damageSource); + void knockout(ServerPlayer player, DamageSource damageSource); - void wakeup(Player player, boolean applyEffects); + void wakeup(ServerPlayer player, boolean applyEffects); - boolean isKnockedOut(Player player); + boolean isKnockedOut(ServerPlayer player); - int getKnockoutTicksPassed(Player player); + int getKnockoutTicksPassed(ServerPlayer player); - int getKnockoutTicksLeft(Player player); + int getKnockoutTicksLeft(ServerPlayer player); } diff --git a/common/src/main/java/net/blay09/mods/hardcorerevival/handler/KnockoutHandler.java b/common/src/main/java/net/blay09/mods/hardcorerevival/handler/KnockoutHandler.java index 2bbd2fe..b526bba 100644 --- a/common/src/main/java/net/blay09/mods/hardcorerevival/handler/KnockoutHandler.java +++ b/common/src/main/java/net/blay09/mods/hardcorerevival/handler/KnockoutHandler.java @@ -68,7 +68,7 @@ private static boolean isKnockoutEnabledFor(ServerPlayer player, DamageSource da } boolean canDamageSourceKnockout = !damageSource.is(DamageTypes.FELL_OUT_OF_WORLD) && !damageSource.is(HardcoreRevivalManager.NOT_RESCUED_IN_TIME); - final var damageSourceId = player.getServer().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getKey(damageSource.type()); + final var damageSourceId = player.getServer().registryAccess().lookupOrThrow(Registries.DAMAGE_TYPE).getKey(damageSource.type()); if (!canDamageSourceKnockout || HardcoreRevivalConfig.getActive().instantDeathSources.contains(damageSourceId)) { return false; } diff --git a/gradle.properties b/gradle.properties index 50e6fda..ab90478 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ mod_id = hardcorerevival mod_name = Hardcore Revival mod_main=HardcoreRevival description=Help your friends back up after they die (if you can make it in time). -version = 21.1.1 +version = 21.2.0 group = net.blay09.mods homepage=https://mods.twelveiterations.com/mc/hardcore-revival sources=https://github.com/TwelveIterationMods/HardcoreRevival @@ -18,16 +18,16 @@ modrinth_release_type = release modrinth_project_id = HqKoXaXz # Minecraft -minecraft_version = 1.21.1 +minecraft_version = 1.21.2-pre1 minimum_minecraft_version = 1.21 -minecraft_versions = 1.21,1.21.1 +minecraft_versions = 1.21,1.21.1,1.21.2-pre1 minecraft_version_range = [1.21,) pack_format_number = 18 java_version = 21 # Balm -balm_version = 21.0.14-SNAPSHOT -balm_version_range = [21.0.0,) +balm_version = 21.2.1-SNAPSHOT +balm_version_range = [21.2.0,) # Forge forge_version = 52.0.2 @@ -40,8 +40,8 @@ neoforge_version_range = [21-beta,) neoforge_loader_version_range = [1,) # Fabric -fabric_version = 0.102.1+1.21.1 -fabric_loader_version = 0.15.11 +fabric_version = 0.105.3+1.21.2 +fabric_loader_version = 0.16.5 # Dependencies mixin_version=0.8.5 @@ -53,6 +53,6 @@ org.gradle.daemon=false mod_author = BlayTheNinth credits = BlayTheNinth kuma_version = [21.0,22) -neo_form_version = 1.21.1-20240808.144430 +neo_form_version = 1.21.2-pre1-20241008.174159 parchment_minecraft = 1.21 parchment_version = 2024.06.23 \ No newline at end of file diff --git a/repositories.gradle b/repositories.gradle index 0fa21f4..d4e1b68 100644 --- a/repositories.gradle +++ b/repositories.gradle @@ -49,6 +49,7 @@ repositories { url = 'https://jitpack.io' content { includeGroup "com.github.BlueMap-Minecraft" + includeGroup "com.github.mattidragon" } } @@ -65,4 +66,22 @@ repositories { includeGroup "de.siphalor" } } + + maven { + url = "https://dl.cloudsmith.io/public/novamachina-mods/release/maven/" + content { + includeGroup "novamachina.novacore" + includeGroup "novamachina.exnihilosequentia" + } + } + + exclusiveContent { + forRepository { + maven { + name = 'Minecraft' + url = 'https://libraries.minecraft.net/' + } + } + filter { includeGroupAndSubgroups("com.mojang") } + } } \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index bce959e..f5a6464 100644 --- a/settings.gradle +++ b/settings.gradle @@ -45,5 +45,5 @@ plugins { include("common") include("fabric") -include("neoforge") -include("forge") +//include("neoforge") +//include("forge")