Alter return types of ChatHelpers to be MutableComponent

This commit is contained in:
Aria 2023-04-22 04:51:02 -07:00
parent 60517bfdf6
commit 2d0504fec6
2 changed files with 7 additions and 9 deletions

View file

@ -5,8 +5,8 @@ org.gradle.daemon=false
mc_version=1.19.4
forge_version=45.0.46
myversion=1.0.7.0422230411
parchment_version=2023.03.12
myversion=1.0.7.0422230450
# parchment_version=2023.03.12
# luckperms_api_version=5.4
libac=1.1.3

View file

@ -80,7 +80,7 @@ public class ChatHelpers {
* @param inputs Entries to replace with in input
* @return
*/
public static Component macro(String input, String... inputs)
public static MutableComponent macro(String input, String... inputs)
{
return Component.literal(macroize(input,inputs));
}
@ -108,10 +108,9 @@ public class ChatHelpers {
* @param ce Click event to add to the component
* @return Component + Merged Event
*/
public static Component applyClickEvent(Component comp, ClickEvent ce)
public static MutableComponent applyClickEvent(MutableComponent comp, ClickEvent ce)
{
MutableComponent mc = MutableComponent.create(comp.getContents());
return ComponentUtils.mergeStyles(mc, comp.getStyle().withClickEvent(ce));
return comp.setStyle(comp.getStyle().withClickEvent(ce));
}
/**
@ -120,9 +119,8 @@ public class ChatHelpers {
* @param ce Hover event to add to the component
* @return Component + Merged Event
*/
public static Component applyHoverEvent(Component comp, HoverEvent ce)
public static MutableComponent applyHoverEvent(MutableComponent comp, HoverEvent ce)
{
MutableComponent mc = MutableComponent.create(comp.getContents());
return ComponentUtils.mergeStyles(mc, comp.getStyle().withHoverEvent(ce));
return comp.setStyle(comp.getStyle().withHoverEvent(ce));
}
}