diff --git a/src/main/java/dev/tr7zw/exordium/mixin/ChatComponentMixin.java b/src/main/java/dev/tr7zw/exordium/mixin/ChatComponentMixin.java index 1f20c86..ddc4f49 100644 --- a/src/main/java/dev/tr7zw/exordium/mixin/ChatComponentMixin.java +++ b/src/main/java/dev/tr7zw/exordium/mixin/ChatComponentMixin.java @@ -12,7 +12,7 @@ import net.minecraft.client.gui.components.ChatComponent; @Mixin(ChatComponent.class) -public class ChatComponentMixin implements ChatAccess { +public abstract class ChatComponentMixin implements ChatAccess { @Getter @Final @@ -21,61 +21,6 @@ public class ChatComponentMixin implements ChatAccess { @Shadow private int chatScrollbarPos; -// @Unique -// private int lastScrollbarPos = 0; -// @Unique -// private int messageCount = 0; -// @Unique -// private boolean wasFocused = false; -// @Unique -// private GuiMessage.Line lastMessage = null; -// -// @Unique -// boolean outdated = false; -// -// @Unique -// private final BufferedComponent chatBufferedComponent = new BufferedComponent( -// () -> ExordiumModBase.instance.config.chatSettings) { -// -// @Override -// public boolean shouldRenderNextCappedFrame() { -// return outdated; -// } -// -// @Override -// public void captureState() { -// lastMessage = trimmedMessages.isEmpty() ? null : trimmedMessages.get(0); -// lastScrollbarPos = chatScrollbarPos; -// messageCount = trimmedMessages.size(); -// wasFocused = isChatFocused(); -// } -// }; -// -// @Unique -// public boolean hasChanged(int i) { -// GuiMessage.Line msg = trimmedMessages.isEmpty() ? null : trimmedMessages.get(0); -// boolean changed = chatScrollbarPos != lastScrollbarPos || messageCount != trimmedMessages.size() -// || isChatFocused() != wasFocused || msg != lastMessage; -// if (changed) { -// return true; -// } -// int j = getLinesPerPage(); -// for (int o = 0; o + this.chatScrollbarPos < this.trimmedMessages.size() && o < j; o++) { -// GuiMessage.Line guiMessage = this.trimmedMessages.get(o + this.chatScrollbarPos); -// if (guiMessage != null) { -// int p = i - guiMessage.addedTime(); -// if (p > 170 && p < 200) { // 180 is correct, add a tiny buffer for the frame to catch up -// return true; -// } -// } -// } -// return false; -// } -// -// public void updateState(int tickCount) { -// outdated = hasChanged(tickCount); -// } - @Override public int getChatScollbarPos() { return chatScrollbarPos; @@ -83,28 +28,14 @@ public int getChatScollbarPos() { @Override @Shadow - public boolean isChatFocused() { - // TODO Auto-generated method stub - return false; - } + public abstract boolean isChatFocused(); @Override @Shadow - public boolean isChatHidden() { - // TODO Auto-generated method stub - return false; - } + public abstract boolean isChatHidden(); @Override @Shadow - public int getLinesPerPage() { - // TODO Auto-generated method stub - return 0; - } - -// @Override -// public BufferedComponent getChatOverlayBuffer() { -// return chatBufferedComponent; -// } + public abstract int getLinesPerPage(); }