Update to 1.19
This commit is contained in:
@@ -7,10 +7,8 @@ import javax.annotation.Nullable;
|
||||
|
||||
import exopandora.worldhandler.builder.argument.IDeserializableArgument;
|
||||
import exopandora.worldhandler.builder.impl.UsercontentCommandBuilder;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.network.chat.ChatType;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.chat.Component;
|
||||
|
||||
public class UsercontentAPI
|
||||
{
|
||||
@@ -35,7 +33,7 @@ public class UsercontentAPI
|
||||
|
||||
public void addChatMessage(Object object)
|
||||
{
|
||||
Minecraft.getInstance().gui.handleChat(ChatType.CHAT, new TextComponent(object != null ? object.toString() : "null"), Util.NIL_UUID);
|
||||
Minecraft.getInstance().player.displayClientMessage(Component.literal(object != null ? object.toString() : "null"), false);
|
||||
}
|
||||
|
||||
public void setArgument(String command, String argument, String value)
|
||||
|
||||
@@ -9,9 +9,8 @@ import exopandora.worldhandler.usercontent.UsercontentAPI;
|
||||
import exopandora.worldhandler.usercontent.model.AbstractJsonWidget;
|
||||
import exopandora.worldhandler.usercontent.model.JsonItem;
|
||||
import exopandora.worldhandler.util.ActionHandler;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.network.chat.MutableComponent;
|
||||
import net.minecraft.network.chat.TextComponent;
|
||||
import net.minecraft.network.chat.TranslatableComponent;
|
||||
|
||||
public abstract class AbstractWidgetFactory
|
||||
{
|
||||
@@ -56,16 +55,16 @@ public abstract class AbstractWidgetFactory
|
||||
{
|
||||
if(item.getTranslation() != null)
|
||||
{
|
||||
return new TranslatableComponent(item.getTranslation());
|
||||
return Component.translatable(item.getTranslation());
|
||||
}
|
||||
|
||||
return new TextComponent(item.getId());
|
||||
return Component.literal(item.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public MutableComponent toTooltip(JsonItem item)
|
||||
{
|
||||
return new TextComponent(item.getId());
|
||||
return Component.literal(item.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user