mirror of
https://github.com/Shiewk/BedrockDeathScreen.git
synced 2026-04-27 22:44:17 +02:00
Update main branch to version 1.2.0 (#1)
- Updated mod license - Added score text
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
|
||||
loader_version=0.15.11
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.1
|
||||
mod_version = 1.2.0
|
||||
maven_group = de.shiewk
|
||||
archives_base_name = BedrockDeathScreen
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.sound.SoundCategory;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.text.MutableText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Formatting;
|
||||
import net.minecraft.util.Identifier;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -17,6 +18,7 @@ public class BedrockDeathScreen extends DeathScreen {
|
||||
|
||||
private int ticksSinceDeath = 0;
|
||||
private final Text message;
|
||||
private Text scoreText = Text.empty();
|
||||
private static final Text menuMessage = Text.translatable("deathScreen.titleScreen");
|
||||
private static final MutableText confirmQuitText = Text.translatable("deathScreen.quit.confirm");
|
||||
private Text respawnMessage;
|
||||
@@ -167,6 +169,10 @@ public class BedrockDeathScreen extends DeathScreen {
|
||||
context.getMatrices().pop();
|
||||
context.drawCenteredTextWithShadow(this.textRenderer, this.message, this.width / 2, (int) (this.height / 3.5), new Color(255, 255, 255, textOpacity).getRGB());
|
||||
}
|
||||
final int scoreTextOpacity = (int) Math.min(255, (totalDelta - 1250f) / 3f);
|
||||
if (scoreTextOpacity > 0){
|
||||
context.drawCenteredTextWithShadow(this.textRenderer, this.scoreText, this.width / 2, (int) (this.height / 3.5) + 12, new Color(255, 255, 255, scoreTextOpacity).getRGB());
|
||||
}
|
||||
}
|
||||
if (!confirmingExit){
|
||||
if (totalDelta > 1250f){
|
||||
@@ -188,6 +194,9 @@ public class BedrockDeathScreen extends DeathScreen {
|
||||
@Override
|
||||
protected void init() {
|
||||
this.respawnMessage = this.hardcore ? Text.translatable("deathScreen.spectate") : Text.translatable("deathScreen.respawn");
|
||||
if (this.client != null && this.client.player != null) {
|
||||
this.scoreText = Text.translatable("deathScreen.score.value", Text.literal(Integer.toString(this.client.player.getScore())).formatted(Formatting.YELLOW));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"contact": {
|
||||
"repo": "https://github.com/Shiewk/BedrockDeathScreen"
|
||||
},
|
||||
"license": "unlicense",
|
||||
"license": "Apache-2.0",
|
||||
"icon": "assets/bedrockdeathscreen/icon.png",
|
||||
"environment": "client",
|
||||
"entrypoints": {
|
||||
|
||||
Reference in New Issue
Block a user