Skip to content

Commit

Permalink
backport to 1.19.3
Browse files Browse the repository at this point in the history
  • Loading branch information
fayer3 committed Feb 29, 2024
1 parent 14feda2 commit 1815414
Show file tree
Hide file tree
Showing 19 changed files with 49 additions and 47 deletions.
14 changes: 7 additions & 7 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.19.4-0.4.10"
modCompileOnly "maven.modrinth:sodium:mc1.19.3-0.4.9"

// for iris compat
modCompileOnly "maven.modrinth:iris:1.6.11+1.19.4"
modCompileOnly "maven.modrinth:iris:1.5.2+1.19.3"

// for REI compat
modCompileOnly("me.shedaniel:RoughlyEnoughItems-fabric:11.0.683") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" exclude group: "dev.architectury" }
modCompileOnly("me.shedaniel:RoughlyEnoughItems-fabric:10.0.646") { 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.2"
// modCompileOnly("com.simibubi.create:create-fabric-1.19.2:0.5.0.i-969+1.19.2")
// modCompileOnly "maven.modrinth:lithium:mc1.19.4-0.11.1"
// modCompileOnly "maven.modrinth:indium:1.0.19+mc1.19.4"
// modCompileOnly "maven.modrinth:lithium:mc1.19.3-0.11.1"
// modCompileOnly "maven.modrinth:indium:1.0.14+mc1.19.3"
modCompileOnly "maven.modrinth:resolution-control-plus:1.19.4-3.0.0"
modCompileOnly "maven.modrinth:better-combat:1.7.1+1.19.4-fabric"
modCompileOnly "maven.modrinth:better-combat:1.7.1+1.19.3-fabric"

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

//for epic fight compat
modCompileOnly("maven.modrinth:epic-fight:20.6.3")
Expand Down
1 change: 1 addition & 0 deletions common/src/main/java/org/vivecraft/MixinConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import org.vivecraft.client.Xplat;
import org.vivecraft.client_vr.settings.VRSettings;
import org.vivecraft.mod_compat_vr.iris.mixin.coderbot.IrisChunkProgramOverridesMixinSodium_0_4_11;
import org.vivecraft.mod_compat_vr.iris.mixin.coderbot.IrisChunkProgramOverridesMixinSodium_0_4_8;
import org.vivecraft.mod_compat_vr.iris.mixin.coderbot.IrisChunkProgramOverridesMixinSodium_0_4_9;
import org.vivecraft.mod_compat_vr.iris.mixin.irisshaders.IrisChunkProgramOverridesMixinSodium_0_6;
import org.vivecraft.mod_compat_vr.sodium.SodiumHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,6 @@ public boolean charTyped(char pCodePoint, int pModifiers) {
private void renderTooltip(PoseStack pMatrixStack, int pMouseX, int pMouseY) {
GuiEventListener hover = null;

if (this.minecraft.getLastInputType().isKeyboard()) {
// only show focused tooltip when navigating with keyboard, so a click with the mouse removes it
hover = this.getFocused();
}
// find active button
if (hover == null) {
for (GuiEventListener child : children()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.ChatFormatting;
import net.minecraft.Util;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.ConfirmLinkScreen;
Expand Down Expand Up @@ -58,7 +59,13 @@ protected void init() {
.build());

this.addRenderableWidget(new Button.Builder(Component.translatable("vivecraft.gui.openguide"),
ConfirmLinkScreen.confirmLink(guideURL, this, true))
button ->
this.minecraft.setScreen(new ConfirmLinkScreen(bl -> {
if (bl) {
Util.getPlatform().openUri(guideURL);
}
this.minecraft.setScreen(this);
}, guideURL, true)))
.pos(this.width / 2 - 75, this.height - 32)
.size(150, 20)
.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected void init() {
button ->
this.minecraft.setScreen(new ConfirmLinkScreen(bl -> {
if (bl) {
Util.getPlatform().openUri("https://modrinth.com/mod/vivecraft");
Util.getPlatform().openUri("https://www.curseforge.com/minecraft/mc-mods/vivecraft");
}
this.minecraft.setScreen(this);
}, "https://www.curseforge.com/minecraft/mc-mods/vivecraft", true)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public static boolean isTool(Item item) {
item == Items.STICK ||
item == Items.DEBUG_STICK ||
item instanceof FlintAndSteelItem ||
item instanceof BrushItem ||
item.getDefaultInstance().is(ItemTags.VIVECRAFT_TOOLS);
}

Expand Down Expand Up @@ -226,7 +225,7 @@ public void doProcess(LocalPlayer player) {
continue;
}

BlockPos blockpos = BlockPos.containing(this.miningPoint[c]);
BlockPos blockpos = new BlockPos(this.miningPoint[c]);
BlockState blockstate = this.mc.level.getBlockState(blockpos);

// every time end of weapon enters a solid for the first time, trace from our previous air position
Expand Down Expand Up @@ -263,12 +262,6 @@ public void doProcess(LocalPlayer player) {
this.mc.gameMode.useItem(player, c == 0 ? InteractionHand.MAIN_HAND : InteractionHand.OFF_HAND);
}
}
// roomscale brushes
else if ((item instanceof BrushItem /*|| itemstack.is(ItemTags.VIVECRAFT_BRUSHES*/)) {
((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
else if (blockstate.getBlock() instanceof NoteBlock || blockstate.is(BlockTags.VIVECRAFT_MUSIC_BLOCKS)) {
this.mc.gameMode.continueDestroyBlock(blockHit.getBlockPos(), blockHit.getDirection());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import net.minecraft.client.player.LocalPlayer;
import net.minecraft.client.player.RemotePlayer;
import net.minecraft.client.renderer.block.model.ItemTransforms;
import net.minecraft.client.renderer.entity.layers.ItemInHandLayer;
import net.minecraft.world.entity.HumanoidArm;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemDisplayContext;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand All @@ -21,7 +21,7 @@
@Mixin(ItemInHandLayer.class)
public abstract class ItemInHandLayerMixin {
@ModifyVariable(at = @At("HEAD"), method = "renderArmWithItem", argsOnly = true)
private ItemStack vivecraft$climbClawsOverride(ItemStack itemStack, LivingEntity livingEntity, ItemStack itemStack2, ItemDisplayContext itemDisplayContext, HumanoidArm humanoidArm) {
private ItemStack vivecraft$climbClawsOverride(ItemStack itemStack, LivingEntity livingEntity, ItemStack itemStack2, ItemTransforms.TransformType transformType, HumanoidArm humanoidArm) {
ClimbTracker tracker = ClientDataHolderVR.getInstance().climbTracker;
if (ClientNetworking.serverAllowsClimbey && livingEntity instanceof Player && !tracker.isClaws(itemStack)) {
ItemStack otherStack = humanoidArm == livingEntity.getMainArm() ? livingEntity.getOffhandItem() : livingEntity.getMainHandItem();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ public abstract class MinecraftVRMixin implements MinecraftExtension {
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())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,13 @@ public abstract class GuiVRMixin extends GuiComponent implements GuiExtension {
public void vivecraft$drawCentredTexturedModalRect(int centreX, int centreY, float width, float height, float uMin, float vMin, float uMax, float vMax) {
BufferBuilder bufferbuilder = Tesselator.getInstance().getBuilder();
bufferbuilder.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX);
bufferbuilder.vertex((float) centreX - width / 2.0F, (float) centreY + height / 2.0F, 0)
bufferbuilder.vertex((float) centreX - width / 2.0F, (float) centreY + height / 2.0F, this.getBlitOffset())
.uv(uMin, vMin).endVertex();
bufferbuilder.vertex((float) centreX + width / 2.0F, (float) centreY + height / 2.0F, 0)
bufferbuilder.vertex((float) centreX + width / 2.0F, (float) centreY + height / 2.0F, this.getBlitOffset())
.uv(uMin, vMax).endVertex();
bufferbuilder.vertex((float) centreX + width / 2.0F, (float) centreY - height / 2.0F, 0)
bufferbuilder.vertex((float) centreX + width / 2.0F, (float) centreY - height / 2.0F, this.getBlitOffset())
.uv(uMax, vMax).endVertex();
bufferbuilder.vertex((float) centreX - width / 2.0F, (float) centreY - height / 2.0F, 0)
bufferbuilder.vertex((float) centreX - width / 2.0F, (float) centreY - height / 2.0F, this.getBlitOffset())
.uv(uMax, vMin).endVertex();
BufferUploader.drawWithShader(bufferbuilder.end());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public CreativeModeInventoryScreenVRMixin(CreativeModeInventoryScreen.ItemPicker

if (tab == CreativeModeTabs.TOOLS_AND_UTILITIES || tab == null) {
ItemStack boots = new ItemStack(Items.LEATHER_BOOTS);
boots.setHoverName(Component.translatableWithFallback("vivecraft.item.jumpboots", "Jump Boots"));
boots.setHoverName(Component.translatable("vivecraft.item.jumpboots"));
boots.getTag().putBoolean("Unbreakable", true);
boots.getTag().putInt("HideFlags", 4);
boots.getOrCreateTagElement(ItemStack.TAG_DISPLAY).putInt(ItemStack.TAG_COLOR, 9233775);

ItemStack claws = new ItemStack(Items.SHEARS);
claws.setHoverName(Component.translatableWithFallback("vivecraft.item.climbclaws", "Climb Claws"));
claws.setHoverName(Component.translatable("vivecraft.item.climbclaws"));
claws.getTag().putBoolean("Unbreakable", true);
claws.getTag().putInt("HideFlags", 4);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public abstract class ItemInHandRendererVRMixin implements ItemInHandRendererExt
mainHand = !mainHand;
}

ItemDisplayContext itemDisplayContext;
ItemTransforms.TransformType transformType;
if ((ClientNetworking.isThirdPersonItems() && !(BowTracker.isBow(pStack) && dh.bowTracker.isActive((LocalPlayer) pPlayer))) || dh.climbTracker.isClaws(pStack)) {
useLeftHandModelinLeftHand = true; //test
VivecraftItemRendering.applyThirdPersonItemTransforms(pMatrixStack, rendertype, mainHand, pPlayer, pEquippedProgress, pPartialTicks, pStack, pHand);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ public class ShapedRecipeMixin {
} else {
ItemStack itemStack = new ItemStack(vanillaItem, i);
if (jsonObject.has("fallbackname")) {
itemStack.setHoverName(Component.translatableWithFallback(
jsonObject.get("name").getAsString(),
jsonObject.get("fallbackname").getAsString()));
itemStack.setHoverName(Component.translatable(
jsonObject.get("name").getAsString()));
} else {
itemStack.setHoverName(Component.translatable(jsonObject.get("name").getAsString()));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.vivecraft.mod_compat_vr.iris.mixin;
package org.vivecraft.mod_compat_vr.iris.mixin.coderbot;

import me.jellysquid.mods.sodium.client.model.vertex.type.ChunkVertexType;
import net.coderbot.iris.compat.sodium.impl.shader_overrides.IrisChunkProgramOverrides;
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/vivecraft.iris.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"coderbot.IrisChunkProgramOverridesMixin",
"coderbot.IrisChunkProgramOverridesMixinSodium_0_4_11",
"coderbot.IrisChunkProgramOverridesMixinSodium_0_4_9",
"coderbot.IrisChunkProgramOverridesMixinSodium_0_4_8",
"coderbot.IrisNewWorldRenderingPipelineVRMixin",
"coderbot.IrisPipelineManagerVRMixin",
"irisshaders.IrisChunkProgramOverridesMixin",
Expand Down
16 changes: 8 additions & 8 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,28 @@ dependencies {
modRuntimeOnly "maven.modrinth:sodium:mc1.19.3-0.4.9"

// for iris compat
modRuntimeOnly "maven.modrinth:iris:1.6.11+1.19.4"
//modRuntimeOnly "maven.modrinth:iris:1.5.2+1.19.3"
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:11.0.683") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" exclude group: "dev.architectury" }
modRuntimeOnly("me.shedaniel:RoughlyEnoughItems-fabric:10.0.646") { 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.19.4-0.11.1"
// modCompileOnly "maven.modrinth:indium:1.0.19+mc1.19.4"
// modCompileOnly "maven.modrinth:lithium:mc1.19.3-0.11.1"
// modCompileOnly "maven.modrinth:indium:1.0.14+mc1.19.3"

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

// for immersive portals compat
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 }
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:imm_ptl_core:v2.5.6-mc1.19.3') { transitive false }
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:v2.5.6-mc1.19.3') { transitive false }
modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:build:v2.5.6-mc1.19.3') { transitive false }

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

// modCompileOnly("maven.modrinth:rubidium:0.6.4")
// modCompileOnly("maven.modrinth:rubidium:0.6.3")
// modCompileOnly("maven.modrinth:oculus:1.19.4-1.5.2")

forgeRuntimeLibrary("org.lwjgl:lwjgl-openvr:3.3.1")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static BiomeSpecialEffects getBiomeEffects(Biome biome) {
}

public static double getItemEntityReach(double baseRange, ItemStack itemStack, EquipmentSlot slot) {
var attributes = itemStack.getAttributeModifiers(slot).get(ForgeMod.ENTITY_REACH.get());
var attributes = itemStack.getAttributeModifiers(slot).get(ForgeMod.ATTACK_RANGE.get());
for (var a : attributes) {
if (a.getOperation() == AttributeModifier.Operation.ADDITION) {
baseRange += a.getAmount();
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=8.2.91
architectury_version=7.1.86

fabric_loader_version=0.15.7
fabric_api_version=0.87.2+1.19.4
fabric_api_version=0.76.1+1.19.3

forge_version=1.19.4-45.2.8
forge_version=1.19.3-44.1.23



Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package me.jellysquid.mods.sodium.client.model.vertex.type;

public interface ChunkVertexType {
}

0 comments on commit 1815414

Please sign in to comment.