Skip to content

Commit

Permalink
backport to 1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
fayer3 committed Feb 28, 2024
1 parent 246755e commit 29289ed
Show file tree
Hide file tree
Showing 9 changed files with 49 additions and 36 deletions.
18 changes: 9 additions & 9 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@ dependencies {
modApi("dev.architectury:architectury-fabric:${rootProject.architectury_version}") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" }

// for sodium compat
modCompileOnly "maven.modrinth:sodium:mc1.20.1-0.5.8"
modCompileOnly "maven.modrinth:sodium:mc1.19.4-0.4.10"

// for iris compat
modCompileOnly "maven.modrinth:iris:1.6.17+1.20.1"
modCompileOnly "maven.modrinth:iris:1.6.11+1.19.4"

// for REI compat
modCompileOnly("me.shedaniel:RoughlyEnoughItems-fabric:12.0.684") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" exclude group: "dev.architectury" }
modCompileOnly("me.shedaniel:RoughlyEnoughItems-fabric:11.0.683") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" exclude group: "dev.architectury" }

// for Pehkui compat
modApi("com.github.Virtuoel:Pehkui:3.7.12") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" }

// other mods
modCompileOnly "maven.modrinth:dynamic-fps:3.4.1"
modCompileOnly "maven.modrinth:dynamic-fps:3.4.2"
// modCompileOnly("com.simibubi.create:create-fabric-1.19.2:0.5.0.i-969+1.19.2")
// modCompileOnly "maven.modrinth:lithium:mc1.20.1-0.11.2"
// modCompileOnly "maven.modrinth:indium:1.0.30+mc1.20.4"
modCompileOnly "maven.modrinth:resolution-control-plus:1.20-3.0.0"
modCompileOnly "maven.modrinth:better-combat:1.8.3+1.20.1-fabric"
// modCompileOnly "maven.modrinth:lithium:mc1.19.4-0.11.1"
// modCompileOnly "maven.modrinth:indium:1.0.19+mc1.19.4"
modCompileOnly "maven.modrinth:resolution-control-plus:1.19.4-3.0.0"
modCompileOnly "maven.modrinth:better-combat:1.7.1+1.19.4-fabric"

// for immersive portals compat
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:v3.3.7-mc1.20.1') { transitive false }
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:v2.7.5-mc1.19.4') { transitive false }

//for epic fight compat
modCompileOnly("maven.modrinth:epic-fight:20.6.3")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package org.vivecraft.client.gui.screens;

import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.ConfirmLinkScreen;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.ClickEvent;
import net.minecraft.network.chat.CommonComponents;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.HoverEvent;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -39,7 +38,7 @@ protected void init() {
Component.translatable("vivecraft.gui.openguide").withStyle(style -> style
.withUnderlined(true)
.withColor(ChatFormatting.GREEN)
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, CommonComponents.GUI_OPEN_IN_BROWSER))
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Component.translatable("chat.link.open")))
.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, guideURL))));
this.addRenderableWidget(new TextScrollWidget(this.width / 2 - 155, 30, 310, this.height - 30 - 60, message));

Expand All @@ -66,10 +65,10 @@ protected void init() {
}

@Override
public void render(@NotNull GuiGraphics guiGraphics, int i, int j, float f) {
this.renderBackground(guiGraphics);
guiGraphics.drawCenteredString(this.font, this.title, this.width / 2, 15, 16777215);
super.render(guiGraphics, i, j, f);
public void render(@NotNull PoseStack poseStack, int i, int j, float f) {
this.renderBackground(poseStack);
drawCenteredString(poseStack, this.font, this.title, this.width / 2, 15, 16777215);
super.render(poseStack, i, j, f);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ public void doProcess(LocalPlayer player) {
}
// roomscale brushes
else if ((item instanceof BrushItem /*|| itemstack.is(ItemTags.VIVECRAFT_BRUSHES*/)) {
((BrushItem) item).spawnDustParticles(player.level(), blockHit, blockstate, player.getViewVector(0.0F), c == 0 ? player.getMainArm() : player.getMainArm().getOpposite());
player.level().playSound(player, blockHit.getBlockPos(), blockstate.getBlock() instanceof BrushableBlock ? ((BrushableBlock) blockstate.getBlock()).getBrushSound() : SoundEvents.BRUSH_GENERIC, SoundSource.BLOCKS);
((BrushItem) item).spawnDustParticles(player.level, blockHit, blockstate, player.getViewVector(0.0F));
player.level.playSound(player, blockHit.getBlockPos(), SoundEvents.BRUSH_BRUSHING, SoundSource.PLAYERS);
this.mc.gameMode.useItemOn(player, c == 0 ? InteractionHand.MAIN_HAND : InteractionHand.OFF_HAND, blockHit);
}
// roomscale noteblocks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected TitleScreenMixin(Component component) {
vivecraft$updateButton.visible = UpdateChecker.hasUpdate;

if (vivecraft$vrModeButton.visible && vivecraft$vrModeButton.isMouseOver(i, j)) {
guiGraphics.renderTooltip(font, font.split(Component.translatable("vivecraft.options.VR_ENABLED.tooltip"), Math.max(width / 2 - 43, 170)), i, j);
renderTooltip(poseStack, font.split(Component.translatable("vivecraft.options.VR_ENABLED.tooltip"), Math.max(width / 2 - 43, 170)), i, j);
}
if (VRState.vrInitialized && !VRState.vrRunning) {
Component hotswitchMessage = Component.translatable("vivecraft.messages.vrhotswitchinginfo");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import org.vivecraft.client.VRPlayersClient;
import org.vivecraft.client.VivecraftVRMod;
import org.vivecraft.client.Xplat;
import org.vivecraft.client.extensions.RenderTargetExtension;
import org.vivecraft.client.gui.VivecraftClickEvent;
import org.vivecraft.client.gui.screens.ErrorScreen;
Expand Down Expand Up @@ -262,8 +263,21 @@ public abstract class MinecraftVRMixin implements MinecraftExtension {
}
}

@Inject(at = @At("TAIL"), method = "setInitialScreen")
private void vivecraft$showGarbageCollectorScreen(CallbackInfo ci) {
@Inject(at = @At("TAIL"), method = "<init>")
private void vivecraft$showGarbageCollectorScreenFabric(CallbackInfo ci) {
if ("fabric".equals(Xplat.getModloader())) {
vivecraft$showGarbageCollectorScreen();
}
}
@Inject(at = @At("TAIL"), method = "lambda$new$2", remap = false, require = 0, expect = 0)
private void vivecraft$showGarbageCollectorScreenForge(CallbackInfo ci) {
if ("forge".equals(Xplat.getModloader())) {
vivecraft$showGarbageCollectorScreen();
}
}

@Unique
private void vivecraft$showGarbageCollectorScreen() {
// set the Garbage collector screen here, when it got reset after loading, but don't set it when using quickplay, because it would be removed after loading has finished
if (VRState.vrEnabled && !ClientDataHolderVR.getInstance().incorrectGarbageCollector.isEmpty()
&& !(screen instanceof LevelLoadingScreen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public abstract class ServerGamePacketListenerImplMixin implements ServerGamePac
@Inject(at = @At("HEAD"), method = "handleCustomPayload", cancellable = true)
public void vivecraft$handleVivecraftPackets(ServerboundCustomPayloadPacket payloadPacket, CallbackInfo ci) {
if (CommonNetworkHelper.CHANNEL.equals(payloadPacket.getIdentifier())) {
PacketUtils.ensureRunningOnSameThread(payloadPacket, this, this.player.serverLevel());
PacketUtils.ensureRunningOnSameThread(payloadPacket, this, this.player.getLevel());

CommonNetworkHelper.PacketDiscriminators packetId = CommonNetworkHelper.PacketDiscriminators.values()[payloadPacket.getData().readByte()];

Expand Down
18 changes: 9 additions & 9 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,31 @@ dependencies {
modApi("dev.architectury:architectury-fabric:${rootProject.architectury_version}") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" }

// for sodium compat
modRuntimeOnly "maven.modrinth:sodium:mc1.20.1-0.5.8"
modRuntimeOnly "maven.modrinth:sodium:mc1.19.4-0.4.10"

// for iris compat
modRuntimeOnly "maven.modrinth:iris:1.6.17+1.20.1"
modRuntimeOnly "maven.modrinth:iris:1.6.11+1.19.4"
modRuntimeOnly 'org.anarres:jcpp:1.4.14' //temp iris
modRuntimeOnly 'io.github.douira:glsl-transformer:2.0.0-pre13' //temp iris

// for REI compat
modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-fabric:12.0.684") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" exclude group: "dev.architectury" }
modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-fabric:11.0.683") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" exclude group: "dev.architectury" }

// for Pehkui compat
modCompileOnly("com.github.Virtuoel:Pehkui:3.7.12") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" }

// other mods
// modRuntimeOnly("com.simibubi.create:create-fabric-1.19.2:0.5.0.i-969+1.19.2")
// modCompileOnly "maven.modrinth:lithium:mc1.20.1-0.11.2"
// modCompileOnly "maven.modrinth:indium:1.0.30+mc1.20.4"
// modCompileOnly "maven.modrinth:lithium:mc1.19.4-0.11.1"
// modCompileOnly "maven.modrinth:indium:1.0.19+mc1.19.4"

//mod menu
modApi("com.terraformersmc:modmenu:7.2.2") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" }
modApi("com.terraformersmc:modmenu:6.3.1") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" }

// for immersive portals compat
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:v3.3.7-mc1.20.1') { transitive false }
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:v3.3.7-mc1.20.1') { transitive false }
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:build:v3.3.7-mc1.20.1') { transitive false }
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:v2.7.5-mc1.19.4') { transitive false }
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:v2.7.5-mc1.19.4') { transitive false }
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:build:v2.7.5-mc1.19.4') { transitive false }

// needed for resource loading
include(modImplementation(fabricApi.module("fabric-resource-loader-v0", rootProject.fabric_api_version)))
Expand Down
4 changes: 2 additions & 2 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ dependencies {
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false }

// modCompileOnly("maven.modrinth:rubidium:0.6.5")
// modCompileOnly("maven.modrinth:oculus:1.20-1.6.4")
// modCompileOnly("maven.modrinth:rubidium:0.6.4")
// modCompileOnly("maven.modrinth:oculus:1.19.4-1.5.2")

forgeRuntimeLibrary("org.lwjgl:lwjgl-openvr:3.3.1")
forgeRuntimeLibrary("org.lwjgl:lwjgl-openvr:3.3.1:natives-linux")
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ archives_base_name=vivecraft
mod_version=1.1.7
maven_group=org.vivecraft

architectury_version=9.1.13
architectury_version=8.2.91

fabric_loader_version=0.15.7
fabric_api_version=0.90.7+1.20.1
fabric_api_version=0.87.2+1.19.4

forge_version=1.20.1-47.2.20
forge_version=1.19.4-45.2.8



0 comments on commit 29289ed

Please sign in to comment.