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
991ad1d3
Commit
991ad1d3
authored
Apr 11, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shorten entity name rendering and add ... for long names.
parent
532d6779
Pipeline
#11976
passed with stage
in 20 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
BubbleRenderer.java
src/client/java/com/owlmaddie/ui/BubbleRenderer.java
+6
-0
No files found.
src/client/java/com/owlmaddie/ui/BubbleRenderer.java
View file @
991ad1d3
...
...
@@ -190,6 +190,12 @@ public class BubbleRenderer {
if
(
entity
.
getCustomName
()
!=
null
)
{
TextRenderer
fontRenderer
=
MinecraftClient
.
getInstance
().
textRenderer
;
String
lineText
=
entity
.
getCustomName
().
getLiteralString
();
// Ensure the string is no longer than X characters
if
(
lineText
.
length
()
>
14
)
{
lineText
=
lineText
.
substring
(
0
,
14
)
+
"..."
;
}
fontRenderer
.
draw
(
lineText
,
-
fontRenderer
.
getWidth
(
lineText
)
/
2
f
,
yOffset
,
0xffffff
,
false
,
matrix
,
immediate
,
TextLayerType
.
NORMAL
,
0
,
fullBright
);
}
...
...
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