Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Fixes for 1.19.1+ and bump dependencies #117

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.19
loader_version=0.14.6
minecraft_version=1.19.2
loader_version=0.14.9

# Mod Properties
core_version = 0.3.0
play_version = 0.3.2
maven_group = net.sorenon

# Dependencies
fabric_version=0.55.1+1.19
pehkui_version=3.3.2
fabric_version=0.60.0+1.19.2
pehkui_version=3.4.1
joml_version=1.10.4
night_config_version=3.6.5
quilt_mappings=1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.joml.Vector3f;
import org.lwjgl.openxr.XR;
import org.lwjgl.system.Configuration;
import virtuoel.pehkui.util.ScaleUtils;
import virtuoel.pehkui.util.ScaleRenderUtils;

import static net.minecraft.client.gui.GuiComponent.GUI_ICONS_LOCATION;

Expand Down Expand Up @@ -205,7 +205,7 @@ public static float getCameraScale(float delta) {

public static float modifyProjectionMatrixDepth(float depth, Entity entity, float tickDelta) {
if (FabricLoader.getInstance().isModLoaded("pehkui")) {
return ScaleUtils.modifyProjectionMatrixDepth(MCXRPlayClient.getCameraScale(tickDelta), depth, entity, tickDelta);
return ScaleRenderUtils.modifyProjectionMatrixDepth(MCXRPlayClient.getCameraScale(tickDelta), depth, entity, tickDelta);
}
return depth;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package net.sorenon.mcxr.play.gui;

import net.minecraft.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.chat.ClientChatPreview;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.ChatScreen;
import net.minecraft.network.chat.Component;
Expand Down Expand Up @@ -77,10 +79,11 @@ protected void init() {

this.addRenderableWidget(
new Button(buttonX, buttonY, buttonWidth, buttonHeight, Component.translatable(word), (button -> {
Component component = Util.mapNullable(this.getChatPreview().pull(word), ClientChatPreview.Preview::response);
if (word.startsWith("/")) {
Minecraft.getInstance().player.command(word.substring(1));
Minecraft.getInstance().player.commandSigned(word.substring(1), component);
} else {
Minecraft.getInstance().player.chat(word);
Minecraft.getInstance().player.chatSigned(word, component);
}
// Minecraft.getInstance().gui.getChat().clearMessages(true);
}))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package net.sorenon.mcxr.play.gui.keyboard;

import net.minecraft.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.chat.ClientChatPreview;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.EditBox;
import net.minecraft.network.chat.Component;
import net.sorenon.mcxr.play.gui.XrChatScreen;

public class XrChatKeyboard extends XrAbstract2DKeyboard {
Expand Down Expand Up @@ -53,11 +56,12 @@ public void returnButton(Button instance) {
if (_chatBox.getValue().equals("")) {
_chatScreen.onClose();
} else {
Component component = Util.mapNullable(this._chatScreen.getChatPreview().pull(_chatBox.getValue()), ClientChatPreview.Preview::response);
if(_chatBox.getValue().startsWith("/")) {
Minecraft.getInstance().player.command(_chatBox.getValue().substring(1));
Minecraft.getInstance().player.commandSigned(_chatBox.getValue().substring(1),component);
_chatScreen.onClose();
} else {
Minecraft.getInstance().player.chat(_chatBox.getValue());
Minecraft.getInstance().player.chatSigned(_chatBox.getValue(),component);
_chatScreen.onClose();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
@Mixin(ResourceManagerReloadListener.class)
public interface ResourceManagerReloadListenerMixin {

@Inject(method = "method_29490", at = @At("HEAD"))
@Inject(method = "m_wjnqjlju", at = @At("HEAD"))
default void preReload(ProfilerFiller profilerFiller, ResourceManager resourceManager, CallbackInfo ci){
MCXRPlayClient.MCXR_GAME_RENDERER.reloadingDepth += 1;
}

@Inject(method = "method_29490", at = @At("RETURN"))
@Inject(method = "m_wjnqjlju", at = @At("RETURN"))
default void postReload(ProfilerFiller profilerFiller, ResourceManager resourceManager, CallbackInfo ci){
MCXRPlayClient.MCXR_GAME_RENDERER.reloadingDepth -= 1;
}
Expand Down