Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
437267f4
Commit
437267f4
authored
Jan 04, 2025
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dark transparent background behind chat screen added back for Minecraft 1.20 and 1.20.1.
parent
f056dd02
Pipeline
#13261
passed with stages
in 2 minutes 13 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
CHANGELOG.md
CHANGELOG.md
+1
-0
ChatScreen.java
src/client/java/com/owlmaddie/ui/ChatScreen.java
+11
-0
VersionUtils.java
src/client/java/com/owlmaddie/utils/VersionUtils.java
+14
-0
No files found.
CHANGELOG.md
View file @
437267f4
...
...
@@ -18,6 +18,7 @@ All notable changes to **CreatureChat** are documented in this file. The format
### Fixed
-
Changing death message timestamp output to use DEBUG log level
-
Bug with build causing issues with 1.20, 1.20.1 builds (wrong minimum version set in fabric.mod.json)
-
Dark transparent background behind chat screen added back for Minecraft 1.20 and 1.20.1.
## [1.2.1] - 2025-01-01
...
...
src/client/java/com/owlmaddie/ui/ChatScreen.java
View file @
437267f4
...
...
@@ -2,6 +2,7 @@ package com.owlmaddie.ui;
import
com.owlmaddie.chat.ChatDataManager
;
import
com.owlmaddie.network.ClientPackets
;
import
com.owlmaddie.utils.VersionUtils
;
import
net.minecraft.client.gui.DrawContext
;
import
net.minecraft.client.gui.screen.Screen
;
import
net.minecraft.client.gui.widget.ButtonWidget
;
...
...
@@ -99,6 +100,11 @@ public class ChatScreen extends Screen {
@Override
public
void
render
(
DrawContext
context
,
int
mouseX
,
int
mouseY
,
float
delta
)
{
// Render custom background only for older versions
if
(
VersionUtils
.
isOlderThan
(
"1.20.2"
))
{
renderBackground
(
context
);
}
// Render the label text above the text field
int
labelWidth
=
textRenderer
.
getWidth
(
labelText
);
int
labelX
=
(
this
.
width
-
labelWidth
)
/
2
;
// Centered X position
...
...
@@ -116,6 +122,11 @@ public class ChatScreen extends Screen {
super
.
render
(
context
,
mouseX
,
mouseY
,
delta
);
}
public
void
renderBackground
(
DrawContext
context
)
{
// Draw a slightly lighter semi-transparent rectangle as the background
context
.
fillGradient
(
0
,
0
,
this
.
width
,
this
.
height
,
0xA3000000
,
0xA3000000
);
}
@Override
public
boolean
shouldCloseOnEsc
()
{
// Return true if you want the screen to close when the ESC key is pressed
...
...
src/client/java/com/owlmaddie/utils/VersionUtils.java
0 → 100644
View file @
437267f4
package
com
.
owlmaddie
.
utils
;
import
net.minecraft.SharedConstants
;
/**
* The {@code VersionUtils} class is used to quickly compare the current version of Minecraft.
*/
public
class
VersionUtils
{
public
static
boolean
isOlderThan
(
String
targetVersion
)
{
String
currentVersion
=
SharedConstants
.
getGameVersion
().
getName
();
return
currentVersion
.
compareTo
(
targetVersion
)
<
0
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment