diff --git a/build.gradle b/build.gradle index df015f7..9381573 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ subprojects { dependencies { minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" // The following line declares the yarn mappings you may select this one as well. - mappings "net.fabricmc:yarn:1.20.1+build.10:v2" + mappings "net.fabricmc:yarn:1.19.2+build.28:v2" } } diff --git a/common/src/main/java/ru/octol1ttle/knockdowns/common/KnockdownsUtils.java b/common/src/main/java/ru/octol1ttle/knockdowns/common/KnockdownsUtils.java index 4d256fd..c4f0fa5 100644 --- a/common/src/main/java/ru/octol1ttle/knockdowns/common/KnockdownsUtils.java +++ b/common/src/main/java/ru/octol1ttle/knockdowns/common/KnockdownsUtils.java @@ -1,5 +1,6 @@ package ru.octol1ttle.knockdowns.common; +import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.MinecraftServer; import ru.octol1ttle.knockdowns.common.api.IKnockableDown; @@ -25,7 +26,7 @@ public class KnockdownsUtils { public static void hurtTenacity(PlayerEntity player, float damage) { player.setInvulnerable(false); //DamageSource recent = player.getRecentDamageSource(); - player.damage(/*Objects.requireNonNullElse(recent, */player.getDamageSources().generic()/*)*/, damage); + player.damage(/*Objects.requireNonNullElse(recent, */DamageSource.GENERIC/*)*/, damage); player.velocityModified = false; } diff --git a/common/src/main/java/ru/octol1ttle/knockdowns/common/events/KnockdownsClientEvents.java b/common/src/main/java/ru/octol1ttle/knockdowns/common/events/KnockdownsClientEvents.java index 47ec31d..bd314da 100644 --- a/common/src/main/java/ru/octol1ttle/knockdowns/common/events/KnockdownsClientEvents.java +++ b/common/src/main/java/ru/octol1ttle/knockdowns/common/events/KnockdownsClientEvents.java @@ -14,7 +14,7 @@ public class KnockdownsClientEvents { } private static void registerOnHudRender() { - ClientGuiEvent.RENDER_HUD.register((drawContext, tickDelta) -> { + ClientGuiEvent.RENDER_HUD.register((matrices, tickDelta) -> { IKnockableDown reviving = (IKnockableDown) KnockdownsClient.reviving; MinecraftClient client = MinecraftClient.getInstance(); if (reviving == null) { @@ -27,17 +27,17 @@ public class KnockdownsClientEvents { TextRenderer renderer = client.textRenderer; String timerText = String.format("%.1f", reviving.get_ReviveTimer() / (float) SharedConstants.TICKS_PER_SECOND); - int timerX = (drawContext.getScaledWindowWidth() - renderer.getWidth(timerText)) / 2; + int timerX = (client.getWindow().getScaledWidth() - renderer.getWidth(timerText)) / 2; int reviverCount = reviving.get_ReviverCount(); Integer color = reviverCount > 1 ? Formatting.GREEN.getColorValue() : Formatting.WHITE.getColorValue(); String reviverCountText = "x" + reviverCount; - int reviveCountX = (drawContext.getScaledWindowWidth() - renderer.getWidth(reviverCountText)) / 2; + int reviveCountX = (client.getWindow().getScaledWidth() - renderer.getWidth(reviverCountText)) / 2; if (color != null) { - drawContext.drawTextWithShadow(renderer, timerText, timerX, drawContext.getScaledWindowHeight() / 2 + 5, color); - drawContext.drawTextWithShadow(renderer, reviverCountText, reviveCountX, drawContext.getScaledWindowHeight() / 2 + 14, color); + renderer.drawWithShadow(matrices, timerText, timerX, client.getWindow().getScaledHeight() / 2.0f + 5, color); + renderer.drawWithShadow(matrices, reviverCountText, reviveCountX, client.getWindow().getScaledHeight() / 2.0f + 14, color); } }); } diff --git a/common/src/main/java/ru/octol1ttle/knockdowns/common/events/KnockdownsEvents.java b/common/src/main/java/ru/octol1ttle/knockdowns/common/events/KnockdownsEvents.java index 06748e2..931d381 100644 --- a/common/src/main/java/ru/octol1ttle/knockdowns/common/events/KnockdownsEvents.java +++ b/common/src/main/java/ru/octol1ttle/knockdowns/common/events/KnockdownsEvents.java @@ -62,7 +62,7 @@ public class KnockdownsEvents { knockable.set_ReviveTimer(KnockdownsCommon.REVIVE_WAIT_TIME); knockable.set_KnockedAge(0); - KnockdownsNetwork.sendToWorld(player.getServerWorld(), new PlayKnockedDownSoundS2CPacket(player.getX(), player.getY(), player.getZ())); + KnockdownsNetwork.sendToWorld(player.getWorld(), new PlayKnockedDownSoundS2CPacket(player.getX(), player.getY(), player.getZ())); Text deathMessage = entity.getDamageTracker().getDeathMessage(); TranslatableTextContent deathContent = (TranslatableTextContent) deathMessage.getContent(); diff --git a/common/src/main/java/ru/octol1ttle/knockdowns/common/network/KnockdownsNetwork.java b/common/src/main/java/ru/octol1ttle/knockdowns/common/network/KnockdownsNetwork.java index 8544efb..6132466 100644 --- a/common/src/main/java/ru/octol1ttle/knockdowns/common/network/KnockdownsNetwork.java +++ b/common/src/main/java/ru/octol1ttle/knockdowns/common/network/KnockdownsNetwork.java @@ -3,7 +3,7 @@ package ru.octol1ttle.knockdowns.common.network; import dev.architectury.networking.NetworkChannel; import dev.architectury.networking.NetworkManager; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.network.packet.Packet; +import net.minecraft.network.Packet; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.Identifier; diff --git a/common/src/main/java/ru/octol1ttle/knockdowns/common/registries/KnockdownsSoundEvents.java b/common/src/main/java/ru/octol1ttle/knockdowns/common/registries/KnockdownsSoundEvents.java index a207925..b8231f0 100644 --- a/common/src/main/java/ru/octol1ttle/knockdowns/common/registries/KnockdownsSoundEvents.java +++ b/common/src/main/java/ru/octol1ttle/knockdowns/common/registries/KnockdownsSoundEvents.java @@ -2,15 +2,15 @@ package ru.octol1ttle.knockdowns.common.registries; import dev.architectury.registry.registries.DeferredRegister; import dev.architectury.registry.registries.RegistrySupplier; -import net.minecraft.registry.RegistryKeys; import net.minecraft.sound.SoundEvent; import net.minecraft.util.Identifier; +import net.minecraft.util.registry.Registry; import ru.octol1ttle.knockdowns.common.KnockdownsCommon; public class KnockdownsSoundEvents { - private static final DeferredRegister SOUND_EVENTS = DeferredRegister.create(KnockdownsCommon.MOD_ID, RegistryKeys.SOUND_EVENT); + private static final DeferredRegister SOUND_EVENTS = DeferredRegister.create(KnockdownsCommon.MOD_ID, Registry.SOUND_EVENT_KEY); public static final RegistrySupplier KNOCKED_DOWN = SOUND_EVENTS.register(KnockdownsCommon.MOD_ID, - () -> SoundEvent.of(new Identifier(KnockdownsCommon.MOD_ID, "knocked_down"))); + () -> new SoundEvent(new Identifier(KnockdownsCommon.MOD_ID, "knocked_down"))); public static void register() { SOUND_EVENTS.register(); diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 48aa342..498821e 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -27,7 +27,7 @@ ], "depends": { "fabric": "*", - "minecraft": ">=1.20.1", - "architectury": ">=9.1.12" + "minecraft": "1.19.*", + "architectury": ">=6.5.85" } } \ No newline at end of file diff --git a/forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml index 9e1ece6..7573bcc 100644 --- a/forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -1,5 +1,5 @@ modLoader = "javafml" -loaderVersion = "[47,)" +loaderVersion = "[43,)" #issueTrackerURL = "" license = "ARR" @@ -16,20 +16,20 @@ DBNO mechanic from Fortnite, ported to Minecraft [[dependencies.knockdowns]] modId = "forge" mandatory = true -versionRange = "[47,)" +versionRange = "[43,)" ordering = "NONE" side = "BOTH" [[dependencies.knockdowns]] modId = "minecraft" mandatory = true -versionRange = "[1.20.1,)" +versionRange = "[1.19.2,1.20)" ordering = "NONE" side = "BOTH" [[dependencies.knockdowns]] modId = "architectury" mandatory = true -versionRange = "[9.1.12,)" +versionRange = "[6.5.85,)" ordering = "AFTER" side = "BOTH" \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 822bf00..3b4b6f1 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,17 +1,17 @@ org.gradle.jvmargs=-Xmx2048M -minecraft_version=1.20.1 +minecraft_version=1.19.2 enabled_platforms=fabric,forge archives_base_name=knockdowns mod_version=2.2.2 maven_group=ru.octol1ttle.knockdowns -architectury_version=9.1.12 -fabric_api_version=0.90.4+1.20.1 +architectury_version=6.5.85 +fabric_api_version=0.77.0+1.19.2 fabric_loader_version=0.15.5 -forge_version=1.20.1-47.2.0 +forge_version=1.19.2-43.3.0