diff --git a/common/build.gradle b/common/build.gradle index da1c061a0..afa9c445b 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -15,13 +15,14 @@ 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.2-0.4.4" + modCompileOnly 'org.joml:joml:1.10.4' // for iris compat - modCompileOnly "maven.modrinth:iris:1.6.11+1.19.4" + modCompileOnly "maven.modrinth:iris:1.6.11+1.19.2" // 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:9.1.682") { 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" } @@ -29,16 +30,16 @@ dependencies { // 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.2-0.11.1" + // modCompileOnly "maven.modrinth:indium:1.0.9+mc1.19.2" 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-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.3.1-1.19') { transitive false } //for epic fight compat - modCompileOnly("maven.modrinth:epic-fight:20.6.3") + modCompileOnly("maven.modrinth:epic-fight:19.5.22") // needed dependencies compileOnly("com.google.code.findbugs:jsr305:3.0.2") diff --git a/common/src/main/java/org/vivecraft/MixinConfig.java b/common/src/main/java/org/vivecraft/MixinConfig.java index d17f4fbc4..24e154468 100644 --- a/common/src/main/java/org/vivecraft/MixinConfig.java +++ b/common/src/main/java/org/vivecraft/MixinConfig.java @@ -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; diff --git a/common/src/main/java/org/vivecraft/client/gui/framework/GuiVROptionsBase.java b/common/src/main/java/org/vivecraft/client/gui/framework/GuiVROptionsBase.java index 6b7f9fc97..2f41515ce 100644 --- a/common/src/main/java/org/vivecraft/client/gui/framework/GuiVROptionsBase.java +++ b/common/src/main/java/org/vivecraft/client/gui/framework/GuiVROptionsBase.java @@ -272,10 +272,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()) { @@ -323,6 +319,6 @@ private void renderTooltip(PoseStack pMatrixStack, int pMouseX, int pMouseY) { } private boolean isMouseOver(AbstractWidget widget, double x, double y) { - return widget.visible && x >= widget.getX() && y >= widget.getY() && x < (widget.getX() + widget.getWidth()) && y < (widget.getY() + widget.getHeight()); + return widget.visible && x >= widget.x && y >= widget.y && x < (widget.x + widget.getWidth()) && y < (widget.y + widget.getHeight()); } } diff --git a/common/src/main/java/org/vivecraft/client/gui/screens/ErrorScreen.java b/common/src/main/java/org/vivecraft/client/gui/screens/ErrorScreen.java index 9494a2316..2164c0222 100644 --- a/common/src/main/java/org/vivecraft/client/gui/screens/ErrorScreen.java +++ b/common/src/main/java/org/vivecraft/client/gui/screens/ErrorScreen.java @@ -25,16 +25,16 @@ protected void init() { text = this.addRenderableWidget(new TextScrollWidget(this.width / 2 - 155, 30, 310, this.height - 30 - 36, error)); - this.addRenderableWidget(new Button.Builder(Component.translatable("gui.back"), (p) -> - Minecraft.getInstance().setScreen(this.lastScreen)) - .pos(this.width / 2 + 5, this.height - 32) - .size(150, 20) - .build()); - this.addRenderableWidget(new Button.Builder(Component.translatable("chat.copy.click"), (p) -> - Minecraft.getInstance().keyboardHandler.setClipboard(this.title.getString() + "\n" + error.getString())) - .pos(this.width / 2 - 155, this.height - 32) - .size(150, 20) - .build()); + this.addRenderableWidget(new Button( + this.width / 2 + 5, this.height - 32, + 150, 20, + Component.translatable("gui.back"), + (p) -> Minecraft.getInstance().setScreen(this.lastScreen))); + this.addRenderableWidget(new Button( + this.width / 2 - 155, this.height - 32, + 150, 20, + Component.translatable("chat.copy.click"), + (p) -> Minecraft.getInstance().keyboardHandler.setClipboard(this.title.getString() + "\n" + error.getString()))); } @Override diff --git a/common/src/main/java/org/vivecraft/client/gui/screens/GarbageCollectorScreen.java b/common/src/main/java/org/vivecraft/client/gui/screens/GarbageCollectorScreen.java index b6b04a1ed..7be8d086a 100644 --- a/common/src/main/java/org/vivecraft/client/gui/screens/GarbageCollectorScreen.java +++ b/common/src/main/java/org/vivecraft/client/gui/screens/GarbageCollectorScreen.java @@ -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; @@ -42,26 +43,34 @@ protected void init() { .withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, guideURL)))); this.addRenderableWidget(new TextScrollWidget(this.width / 2 - 155, 30, 310, this.height - 30 - 60, message)); - this.addRenderableWidget(new Button.Builder(Component.translatable("vivecraft.gui.dontshowagain"), (p) -> { - ClientDataHolderVR.getInstance().vrSettings.disableGarbageCollectorMessage = true; - ClientDataHolderVR.getInstance().vrSettings.saveOptions(); - Minecraft.getInstance().setScreen(this.lastScreen); - }) - .pos(this.width / 2 - 155, this.height - 56) - .size(150, 20) - .build()); + this.addRenderableWidget(new Button( + this.width / 2 - 155, this.height - 56, + 150, 20, + Component.translatable("vivecraft.gui.dontshowagain"), + (p) -> { + ClientDataHolderVR.getInstance().vrSettings.disableGarbageCollectorMessage = true; + ClientDataHolderVR.getInstance().vrSettings.saveOptions(); + Minecraft.getInstance().setScreen(this.lastScreen); + })); - this.addRenderableWidget(new Button.Builder(Component.translatable("vivecraft.gui.ok"), (p) -> - onClose()) - .pos(this.width / 2 + 5, this.height - 56) - .size(150, 20) - .build()); + this.addRenderableWidget(new Button( + this.width / 2 + 5, this.height - 56, + 150, 20, + Component.translatable("vivecraft.gui.ok"), + (p) -> onClose())); - this.addRenderableWidget(new Button.Builder(Component.translatable("vivecraft.gui.openguide"), - ConfirmLinkScreen.confirmLink(guideURL, this, true)) - .pos(this.width / 2 - 75, this.height - 32) - .size(150, 20) - .build()); + this.addRenderableWidget(new Button( + this.width / 2 - 75, this.height - 32, + 150, 20, + Component.translatable("vivecraft.gui.openguide"), + (p) -> { + this.minecraft.setScreen(new ConfirmLinkScreen(bl -> { + if (bl) { + Util.getPlatform().openUri(guideURL); + } + this.minecraft.setScreen(this); + }, guideURL, true)); + })); } @Override diff --git a/common/src/main/java/org/vivecraft/client/gui/screens/UpdateScreen.java b/common/src/main/java/org/vivecraft/client/gui/screens/UpdateScreen.java index 6644b0e82..a9a5477b6 100644 --- a/common/src/main/java/org/vivecraft/client/gui/screens/UpdateScreen.java +++ b/common/src/main/java/org/vivecraft/client/gui/screens/UpdateScreen.java @@ -27,17 +27,29 @@ protected void init() { text = this.addRenderableWidget(new TextScrollWidget(this.width / 2 - 155, 30, 310, this.height - 30 - 60, UpdateChecker.changelog)); - this.addRenderableWidget(new Button.Builder(Component.translatable("vivecraft.gui.downloadfrom", Component.literal("Modrinth")), - ConfirmLinkScreen.confirmLink("https://modrinth.com/mod/vivecraft", this, true)) - .pos(this.width / 2 - 155, this.height - 56) - .size(150, 20) - .build()); + this.addRenderableWidget(new Button( + this.width / 2 - 155, this.height - 56, 150, 20, + Component.translatable("vivecraft.gui.downloadfrom", Component.literal("Modrinth")), + button -> + this.minecraft.setScreen(new ConfirmLinkScreen(bl -> { + if (bl) { + Util.getPlatform().openUri("https://modrinth.com/mod/vivecraft"); + } + this.minecraft.setScreen(this); + }, "https://modrinth.com/mod/vivecraft", true)) + )); - this.addRenderableWidget(new Button.Builder(Component.translatable("vivecraft.gui.downloadfrom", Component.literal("CurseForge")), - ConfirmLinkScreen.confirmLink("https://www.curseforge.com/minecraft/mc-mods/vivecraft", this, true)) - .pos(this.width / 2 + 5, this.height - 56) - .size(150, 20) - .build()); + this.addRenderableWidget(new Button( + this.width / 2 + 5, this.height - 56, 150, 20, + Component.translatable("vivecraft.gui.downloadfrom", Component.literal("CurseForge")), + button -> + this.minecraft.setScreen(new ConfirmLinkScreen(bl -> { + if (bl) { + Util.getPlatform().openUri("https://www.curseforge.com/minecraft/mc-mods/vivecraft"); + } + this.minecraft.setScreen(this); + }, "https://www.curseforge.com/minecraft/mc-mods/vivecraft", true)) + )); this.addRenderableWidget(new Button( this.width / 2 - 75, this.height - 32, diff --git a/common/src/main/java/org/vivecraft/client/gui/settings/VivecraftMainSettings.java b/common/src/main/java/org/vivecraft/client/gui/settings/VivecraftMainSettings.java index a64fd19a6..c5d31c698 100644 --- a/common/src/main/java/org/vivecraft/client/gui/settings/VivecraftMainSettings.java +++ b/common/src/main/java/org/vivecraft/client/gui/settings/VivecraftMainSettings.java @@ -28,16 +28,18 @@ protected List getEntries() { entries.add(new SettingsList.WidgetEntry( Component.translatable("vivecraft.options.screen.main"), - Button.builder(Component.translatable("vivecraft.options.screen.main"), button -> this.minecraft.setScreen(new GuiMainVRSettings(this))) - .size(SettingsList.WidgetEntry.valueButtonWidth, 20) - .build() + new Button( + 0, 0, SettingsList.WidgetEntry.valueButtonWidth, 20, + Component.translatable("vivecraft.options.screen.main"), + button -> this.minecraft.setScreen(new GuiMainVRSettings(this))) )); entries.add(new SettingsList.WidgetEntry( Component.translatable("vivecraft.options.screen.server"), - Button.builder(Component.translatable("vivecraft.options.screen.server"), button -> this.minecraft.setScreen(new GuiServerSettings(this))) - .size(SettingsList.WidgetEntry.valueButtonWidth, 20) - .build() + new Button( + 0, 0, SettingsList.WidgetEntry.valueButtonWidth, 20, + Component.translatable("vivecraft.options.screen.server"), + button -> this.minecraft.setScreen(new GuiServerSettings(this))) )); entries.add(new SettingsList.CategoryEntry(Component.literal("Vivecraft Buttons"))); diff --git a/common/src/main/java/org/vivecraft/client/gui/widgets/SettingsList.java b/common/src/main/java/org/vivecraft/client/gui/widgets/SettingsList.java index 7254b71ad..ae4ebad70 100644 --- a/common/src/main/java/org/vivecraft/client/gui/widgets/SettingsList.java +++ b/common/src/main/java/org/vivecraft/client/gui/widgets/SettingsList.java @@ -57,7 +57,7 @@ public static BaseEntry vrOptionToEntry(VRSettings.VrOptions option) { ClientDataHolderVR dh = ClientDataHolderVR.getInstance(); String optionString = "vivecraft.options." + option.name(); String tooltipString = optionString + ".tooltip"; - Tooltip tooltip; + Component tooltip; // check if it has a tooltip if (I18n.exists(tooltipString)) { String tooltipPrefix = ""; @@ -70,7 +70,7 @@ public static BaseEntry vrOptionToEntry(VRSettings.VrOptions option) { tooltipPrefix = I18n.get("vivecraft.message.limitedbyserver", setting.getValueMin(), setting.getValueMax()); } } - tooltip = Tooltip.create(Component.literal(tooltipPrefix + I18n.get(tooltipString, (Object) null))); + tooltip = Component.literal(tooltipPrefix + I18n.get(tooltipString, (Object) null)); } else { tooltip = null; } @@ -82,18 +82,29 @@ public static BaseEntry vrOptionToEntry(VRSettings.VrOptions option) { widget = new GuiVROptionSlider(option.returnEnumOrdinal(), 0, 0, WidgetEntry.valueButtonWidth, 20, - option, true); - widget.setTooltip(tooltip); + option, true) { + @Override + public void renderButton(PoseStack poseStack, int x, int y, float f) { + super.renderButton(poseStack, x, y, f); + if (this.isHovered && tooltip != null) { + Minecraft.getInstance().screen.renderTooltip(poseStack, Minecraft.getInstance().font.split(tooltip, 200), x, y); + } + } + }; } else { // regular button - widget = Button.builder(Component.literal(dh.vrSettings.getButtonDisplayString(option, true)) - , button -> { - dh.vrSettings.setOptionValue(option); - button.setMessage(Component.literal(dh.vrSettings.getButtonDisplayString(option, true))); - }) - .size(WidgetEntry.valueButtonWidth, 20) - .tooltip(tooltip) - .build(); + widget = new Button( + 0, 0, WidgetEntry.valueButtonWidth, 20, + Component.literal(dh.vrSettings.getButtonDisplayString(option, true)), + button -> { + dh.vrSettings.setOptionValue(option); + button.setMessage(Component.literal(dh.vrSettings.getButtonDisplayString(option, true))); + }, + (button, poseStack, x, y) -> { + if (tooltip != null) { + Minecraft.getInstance().screen.renderTooltip(poseStack, Minecraft.getInstance().font.split(tooltip, 200), x, y); + } + }); } BaseEntry entry = new WidgetEntry(Component.translatable(optionString), widget); diff --git a/common/src/main/java/org/vivecraft/client_vr/gameplay/trackers/SwingTracker.java b/common/src/main/java/org/vivecraft/client_vr/gameplay/trackers/SwingTracker.java index 57b5b3ef1..139927fe7 100644 --- a/common/src/main/java/org/vivecraft/client_vr/gameplay/trackers/SwingTracker.java +++ b/common/src/main/java/org/vivecraft/client_vr/gameplay/trackers/SwingTracker.java @@ -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); } @@ -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 @@ -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()); diff --git a/common/src/main/java/org/vivecraft/mixin/client/renderer/entity/layers/ItemInHandLayerMixin.java b/common/src/main/java/org/vivecraft/mixin/client/renderer/entity/layers/ItemInHandLayerMixin.java index 8304f2f18..51b0e6cc8 100644 --- a/common/src/main/java/org/vivecraft/mixin/client/renderer/entity/layers/ItemInHandLayerMixin.java +++ b/common/src/main/java/org/vivecraft/mixin/client/renderer/entity/layers/ItemInHandLayerMixin.java @@ -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; @@ -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(); diff --git a/common/src/main/java/org/vivecraft/mixin/client_vr/MinecraftVRMixin.java b/common/src/main/java/org/vivecraft/mixin/client_vr/MinecraftVRMixin.java index 15231622c..7ead2cf8d 100644 --- a/common/src/main/java/org/vivecraft/mixin/client_vr/MinecraftVRMixin.java +++ b/common/src/main/java/org/vivecraft/mixin/client_vr/MinecraftVRMixin.java @@ -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())) { @@ -773,9 +774,9 @@ public abstract class MinecraftVRMixin implements MinecraftExtension { if (VivecraftVRMod.INSTANCE.keyQuickCommands[i].consumeClick()) { String command = ClientDataHolderVR.getInstance().vrSettings.vrQuickCommands[i]; if (command.startsWith("/")) { - this.player.connection.sendCommand(command.substring(1)); + this.player.commandSigned(command.substring(1), Component.empty()); } else { - this.player.connection.sendChat(command); + this.player.chatSigned(command, Component.empty()); } } } diff --git a/common/src/main/java/org/vivecraft/mixin/client_vr/gui/GuiVRMixin.java b/common/src/main/java/org/vivecraft/mixin/client_vr/gui/GuiVRMixin.java index 099ce041d..f60b01431 100644 --- a/common/src/main/java/org/vivecraft/mixin/client_vr/gui/GuiVRMixin.java +++ b/common/src/main/java/org/vivecraft/mixin/client_vr/gui/GuiVRMixin.java @@ -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()); } diff --git a/common/src/main/java/org/vivecraft/mixin/client_vr/gui/screens/inventory/CreativeModeInventoryScreenVRMixin.java b/common/src/main/java/org/vivecraft/mixin/client_vr/gui/screens/inventory/CreativeModeInventoryScreenVRMixin.java index 128ae9ddb..197b6753b 100644 --- a/common/src/main/java/org/vivecraft/mixin/client_vr/gui/screens/inventory/CreativeModeInventoryScreenVRMixin.java +++ b/common/src/main/java/org/vivecraft/mixin/client_vr/gui/screens/inventory/CreativeModeInventoryScreenVRMixin.java @@ -33,7 +33,7 @@ public CreativeModeInventoryScreenVRMixin(CreativeModeInventoryScreen.ItemPicker vivecraft$addCreativeSearch(this.searchBox.getValue(), this.menu.items); } - @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/core/NonNullList;addAll(Ljava/util/Collection;)Z", ordinal = 1, shift = At.Shift.AFTER), method = "selectTab") + @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/CreativeModeTab;fillItemList(Lnet/minecraft/core/NonNullList;)V", shift = At.Shift.AFTER), method = "selectTab") public void vivecraft$fill(CreativeModeTab creativeModeTab, CallbackInfo ci) { vivecraft$addCreativeItems(creativeModeTab, this.menu.items); } @@ -50,13 +50,13 @@ public CreativeModeInventoryScreenVRMixin(CreativeModeInventoryScreen.ItemPicker if (tab == CreativeModeTab.TAB_TOOLS || 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); diff --git a/common/src/main/java/org/vivecraft/mixin/client_vr/renderer/ItemInHandRendererVRMixin.java b/common/src/main/java/org/vivecraft/mixin/client_vr/renderer/ItemInHandRendererVRMixin.java index aa454c861..70690edcb 100644 --- a/common/src/main/java/org/vivecraft/mixin/client_vr/renderer/ItemInHandRendererVRMixin.java +++ b/common/src/main/java/org/vivecraft/mixin/client_vr/renderer/ItemInHandRendererVRMixin.java @@ -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); diff --git a/common/src/main/java/org/vivecraft/mixin/world/item/crafting/ShapedRecipeMixin.java b/common/src/main/java/org/vivecraft/mixin/world/item/crafting/ShapedRecipeMixin.java index acaa38707..d7e66c35a 100644 --- a/common/src/main/java/org/vivecraft/mixin/world/item/crafting/ShapedRecipeMixin.java +++ b/common/src/main/java/org/vivecraft/mixin/world/item/crafting/ShapedRecipeMixin.java @@ -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())); } diff --git a/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/coderbot/IrisChunkProgramOverridesMixinSodium_0_4_8.java b/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/coderbot/IrisChunkProgramOverridesMixinSodium_0_4_8.java new file mode 100644 index 000000000..209d21a26 --- /dev/null +++ b/common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/coderbot/IrisChunkProgramOverridesMixinSodium_0_4_8.java @@ -0,0 +1,31 @@ +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; +import net.coderbot.iris.pipeline.SodiumTerrainPipeline; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Group; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.vivecraft.mod_compat_vr.iris.extensions.IrisChunkProgramOverridesExtension; + +import java.lang.reflect.InvocationTargetException; + +@Mixin(IrisChunkProgramOverrides.class) +public class IrisChunkProgramOverridesMixinSodium_0_4_8 { + + @Group(name = "create sodium shaders", min = 1, max = 1) + @Redirect(at = @At(value = "INVOKE", target = "Lnet/coderbot/iris/compat/sodium/impl/shader_overrides/IrisChunkProgramOverrides;createShaders(Lnet/coderbot/iris/pipeline/SodiumTerrainPipeline;Lme/jellysquid/mods/sodium/client/model/vertex/type/ChunkVertexType;)V"), method = "getProgramOverride", remap = false, expect = 0) + public void createAllPipelinesShadersSodium_0_4_9(IrisChunkProgramOverrides instance, SodiumTerrainPipeline sodiumTerrainPipeline, ChunkVertexType chunkVertexType) { + try { + ((IrisChunkProgramOverridesExtension) this).vivecraft$createAllPipelinesShadersSodiumProcessing( + sodiumTerrainPipeline, + chunkVertexType, + instance.getClass().getMethod("createShaders", SodiumTerrainPipeline.class, ChunkVertexType.class) + ); + } catch (InvocationTargetException | IllegalAccessException | NoSuchMethodException e) { + // this shouldn't happen if everything went well + throw new RuntimeException(e); + } + } +} diff --git a/common/src/main/resources/vivecraft.iris.mixins.json b/common/src/main/resources/vivecraft.iris.mixins.json index 2673ae2d4..3dd53186d 100644 --- a/common/src/main/resources/vivecraft.iris.mixins.json +++ b/common/src/main/resources/vivecraft.iris.mixins.json @@ -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", diff --git a/fabric/build.gradle b/fabric/build.gradle index 01ae95aa9..41126d1e1 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -33,7 +33,7 @@ dependencies { modRuntimeOnly 'org.joml:joml:1.10.4' //temp sodium // for iris compat - modRuntimeOnly "maven.modrinth:iris:1.6.11+1.19.4" + modRuntimeOnly "maven.modrinth:iris:1.6.11+1.19.2" modRuntimeOnly 'org.anarres:jcpp:1.4.14' //temp iris modRuntimeOnly 'io.github.douira:glsl-transformer:2.0.0-pre13' //temp iris @@ -42,23 +42,23 @@ dependencies { //modRuntimeOnly 'io.github.douira:glsl-transformer:1.0.1' //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:9.1.682") { 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.2-0.11.1" + // modCompileOnly "maven.modrinth:indium:1.0.9+mc1.19.2" //mod menu - modApi("com.terraformersmc:modmenu:6.3.1") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" } + modApi("com.terraformersmc:modmenu:4.1.2") { 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.3.1-1.19') { transitive false } + modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:q_misc_util:v2.3.1-1.19') { transitive false } + modCompileOnly('com.github.iPortalTeam.ImmersivePortalsMod:build:v2.3.1-1.19') { transitive false } // needed for resource loading include(modImplementation(fabricApi.module("fabric-resource-loader-v0", rootProject.fabric_api_version))) diff --git a/forge/build.gradle b/forge/build.gradle index 3977e51ae..fb888ae1e 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -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.4") - // modCompileOnly("maven.modrinth:oculus:1.19.4-1.5.2") + // modCompileOnly("maven.modrinth:rubidium:0.6.2c") + // modCompileOnly("maven.modrinth:oculus:1.19.2-1.6.9") forgeRuntimeLibrary("org.lwjgl:lwjgl-openvr:3.3.1") forgeRuntimeLibrary("org.lwjgl:lwjgl-openvr:3.3.1:natives-linux") diff --git a/forge/src/main/java/org/vivecraft/client/forge/XplatImpl.java b/forge/src/main/java/org/vivecraft/client/forge/XplatImpl.java index 6ae336f70..7254745e0 100644 --- a/forge/src/main/java/org/vivecraft/client/forge/XplatImpl.java +++ b/forge/src/main/java/org/vivecraft/client/forge/XplatImpl.java @@ -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(); diff --git a/gradle.properties b/gradle.properties index 73af97777..3d2ff15e3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,12 +7,12 @@ archives_base_name=vivecraft mod_version=1.1.7 maven_group=org.vivecraft -architectury_version=8.2.91 +architectury_version=6.5.90 fabric_loader_version=0.15.7 -fabric_api_version=0.87.2+1.19.4 +fabric_api_version=0.77.0+1.19.2 -forge_version=1.19.4-45.2.8 +forge_version=1.19.2-43.3.8 diff --git a/stubs/src/main/java/me/jellysquid/mods/sodium/client/model/vertex/type/ChunkVertexType.java b/stubs/src/main/java/me/jellysquid/mods/sodium/client/model/vertex/type/ChunkVertexType.java new file mode 100644 index 000000000..18f93bfd8 --- /dev/null +++ b/stubs/src/main/java/me/jellysquid/mods/sodium/client/model/vertex/type/ChunkVertexType.java @@ -0,0 +1,4 @@ +package me.jellysquid.mods.sodium.client.model.vertex.type; + +public interface ChunkVertexType { +}