mirror of
https://github.com/Shiewk/BedrockDeathScreen.git
synced 2026-04-27 22:44:17 +02:00
1.21.11 support (#5)
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id 'fabric-loom' version "1.11-SNAPSHOT"
|
||||
id 'fabric-loom' version "1.14-SNAPSHOT"
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -1,18 +1,18 @@
|
||||
# Done to increase the memory available to gradle.
|
||||
# Done to increase the memory available to Gradle.
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.21.9
|
||||
yarn_mappings=1.21.9+build.1
|
||||
loader_version=0.17.2
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.21.11
|
||||
yarn_mappings=1.21.11+build.4
|
||||
loader_version=0.17.3
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.3.1
|
||||
maven_group = de.shiewk
|
||||
archives_base_name = BedrockDeathScreen
|
||||
mod_version = 1.3.1
|
||||
maven_group = de.shiewk
|
||||
archives_base_name = BedrockDeathScreen
|
||||
|
||||
# Dependencies
|
||||
# check this on https://modmuss50.me/fabric.html
|
||||
fabric_version=0.134.0+1.21.9
|
||||
modmenu_version=16.0.0-rc.1
|
||||
# check this on https://modmuss50.me/fabric.html
|
||||
fabric_version=0.139.4+1.21.11
|
||||
modmenu_version=17.0.0-beta.1
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.0-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.client.gui.Click;
|
||||
import net.minecraft.client.gui.DrawContext;
|
||||
import net.minecraft.client.gui.screen.DeathScreen;
|
||||
import net.minecraft.client.gui.screen.TitleScreen;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
@@ -37,8 +38,8 @@ public class BedrockDeathScreen extends DeathScreen {
|
||||
private BedrockDeathScreenButton respawnButton;
|
||||
private BedrockDeathScreenButton menuButton;
|
||||
|
||||
public BedrockDeathScreen(@Nullable Text message, boolean isHardcore) {
|
||||
super(message, isHardcore);
|
||||
public BedrockDeathScreen(@Nullable Text message, boolean isHardcore, ClientPlayerEntity decedent) {
|
||||
super(message, isHardcore, decedent);
|
||||
this.config = BedrockDeathScreenClient.getConfig();
|
||||
this.message = message;
|
||||
this.hardcore = isHardcore;
|
||||
|
||||
@@ -5,10 +5,7 @@ import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.Camera;
|
||||
import net.minecraft.entity.Entity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Constant;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyConstant;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
import org.spongepowered.asm.mixin.injection.*;
|
||||
|
||||
@Mixin(Camera.class)
|
||||
public class MixinCamera {
|
||||
@@ -41,4 +38,9 @@ public class MixinCamera {
|
||||
return 4.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@ModifyVariable(method = "update", at = @At("HEAD"), argsOnly = true, index = 3)
|
||||
public boolean updateThirdPerson(boolean value){
|
||||
return value || MinecraftClient.getInstance().currentScreen instanceof BedrockDeathScreen;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package de.shiewk.bedrockdeathscreen.mixin;
|
||||
import de.shiewk.bedrockdeathscreen.client.screen.BedrockDeathScreen;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.network.ClientPlayNetworkHandler;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.network.packet.s2c.play.DeathMessageS2CPacket;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -18,7 +19,7 @@ public abstract class MixinClientPlayNetworkHandler {
|
||||
|
||||
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;setScreen(Lnet/minecraft/client/gui/screen/Screen;)V"), method = "onDeathMessage", cancellable = true)
|
||||
private void onDeathScreenShow(DeathMessageS2CPacket packet, CallbackInfo ci){
|
||||
MinecraftClient.getInstance().setScreen(new BedrockDeathScreen(packet.message(), this.world.getLevelProperties().isHardcore()));
|
||||
MinecraftClient.getInstance().setScreen(new BedrockDeathScreen(packet.message(), this.world.getLevelProperties().isHardcore(), MinecraftClient.getInstance().player));
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.client.render.Camera;
|
||||
import net.minecraft.client.render.GameRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import org.joml.Matrix4f;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
@@ -29,15 +30,6 @@ public abstract class MixinGameRenderer {
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method = "renderWorld", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/Camera;update(Lnet/minecraft/world/BlockView;Lnet/minecraft/entity/Entity;ZZF)V"))
|
||||
public void onCameraUpdate(Camera instance, BlockView area, Entity focusedEntity, boolean thirdPerson, boolean inverseView, float tickDelta){
|
||||
if (client.currentScreen instanceof BedrockDeathScreen){
|
||||
instance.update(area, focusedEntity, true, false, tickDelta);
|
||||
} else {
|
||||
instance.update(area, focusedEntity, thirdPerson, inverseView, tickDelta);
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method = "renderWorld", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/GameRenderer;renderHand(FZLorg/joml/Matrix4f;)V"))
|
||||
public void onCameraUpdate(GameRenderer instance, float tickProgress, boolean sleeping, Matrix4f positionMatrix){
|
||||
if (!(instance.getClient().currentScreen instanceof BedrockDeathScreen)){
|
||||
|
||||
@@ -3,6 +3,7 @@ package de.shiewk.bedrockdeathscreen.mixin;
|
||||
import de.shiewk.bedrockdeathscreen.client.screen.BedrockDeathScreen;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.screen.DeathScreen;
|
||||
import net.minecraft.client.network.ClientPlayerEntity;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.text.Text;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -20,10 +21,10 @@ public class MixinMinecraftClient {
|
||||
|
||||
@Redirect(
|
||||
method = "setScreen",
|
||||
at = @At(value = "NEW", target = "(Lnet/minecraft/text/Text;Z)Lnet/minecraft/client/gui/screen/DeathScreen;")
|
||||
at = @At(value = "NEW", target = "(Lnet/minecraft/text/Text;ZLnet/minecraft/client/network/ClientPlayerEntity;)Lnet/minecraft/client/gui/screen/DeathScreen;")
|
||||
)
|
||||
public DeathScreen bedrockdeathscreen$createModifiedDeathScreen(Text message, boolean isHardcore){
|
||||
return new BedrockDeathScreen(null, world != null && world.getLevelProperties().isHardcore());
|
||||
public DeathScreen bedrockdeathscreen$createModifiedDeathScreen(Text message, boolean isHardcore, ClientPlayerEntity decedent){
|
||||
return new BedrockDeathScreen(null, world != null && world.getLevelProperties().isHardcore(), decedent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user