├── .github └── FUNDING.yml ├── forge ├── gradle.properties └── src │ └── main │ ├── resources │ ├── pack.mcmeta │ ├── vivecraft.forge.mixins.json │ └── META-INF │ │ └── mods.toml │ └── java │ └── org │ └── vivecraft │ └── forge │ ├── event │ └── CommonEvents.java │ ├── mixin │ ├── network │ │ └── ForgeOpenContainerVRMixin.java │ ├── ForgeMinecraftVRMixin.java │ └── ForgeGameRendererVRMixin.java │ └── XeventsImpl.java ├── neoforge ├── gradle.properties └── src │ └── main │ ├── resources │ ├── pack.mcmeta │ └── vivecraft.neoforge.mixins.json │ └── java │ └── org │ └── vivecraft │ └── neoforge │ ├── Vivecraft.java │ ├── event │ └── ServerEvents.java │ └── mixin │ ├── network │ └── NeoForgeOpenContainerVRMixin.java │ └── NeoForgeMinecraftVRMixin.java ├── common └── src │ └── main │ ├── resources │ ├── architectury.common.json │ ├── vivecraft_icon.png │ ├── data │ │ └── vivecraft │ │ │ ├── tags │ │ │ ├── block │ │ │ │ ├── crops.json │ │ │ │ ├── climbable.json │ │ │ │ └── music_blocks.json │ │ │ └── item │ │ │ │ ├── arrows.json │ │ │ │ ├── maps.json │ │ │ │ ├── telescope.json │ │ │ │ ├── rotated_tools.json │ │ │ │ ├── food_sticks.json │ │ │ │ ├── brushes.json │ │ │ │ ├── maces.json │ │ │ │ ├── throw_items.json │ │ │ │ ├── compasses.json │ │ │ │ ├── bow_exclusion.json │ │ │ │ ├── moditems │ │ │ │ └── balkons_weaponsmod │ │ │ │ │ ├── nonbows.json │ │ │ │ │ ├── rotated.json │ │ │ │ │ └── flails.json │ │ │ │ ├── crossbows.json │ │ │ │ ├── spears.json │ │ │ │ ├── fishing_rods.json │ │ │ │ ├── shields.json │ │ │ │ ├── rods.json │ │ │ │ ├── swords.json │ │ │ │ └── hoes.json │ │ │ └── recipe │ │ │ ├── climbclaws.json │ │ │ └── jumpboots.json │ ├── natives │ │ ├── katvr │ │ │ ├── WalkerBase.dll │ │ │ ├── msvcp120d.dll │ │ │ ├── msvcp140d.dll │ │ │ ├── msvcr120d.dll │ │ │ ├── ucrtbased.dll │ │ │ └── vcruntime140d.dll │ │ └── infinadeck │ │ │ └── InfinadeckAPI.dll │ ├── assets │ │ ├── vivecraft │ │ │ ├── items │ │ │ │ ├── camera.json │ │ │ │ ├── camcorder.json │ │ │ │ ├── climb_claws.json │ │ │ │ ├── camera_display.json │ │ │ │ ├── camcorder_display.json │ │ │ │ └── spyglass_in_hand.json │ │ │ ├── textures │ │ │ │ ├── black.png │ │ │ │ ├── white.png │ │ │ │ ├── black_hmd.png │ │ │ │ ├── gold_hmd.png │ │ │ │ ├── blocks │ │ │ │ │ ├── bag.png │ │ │ │ │ ├── camera.png │ │ │ │ │ ├── bag_gold.png │ │ │ │ │ ├── camcorder.png │ │ │ │ │ ├── inv_button.png │ │ │ │ │ └── mini_crafting.png │ │ │ │ ├── diamond_hmd.png │ │ │ │ ├── transparent.png │ │ │ │ ├── item │ │ │ │ │ ├── climb_claws.png │ │ │ │ │ └── spyglass_model.png │ │ │ │ └── gui │ │ │ │ │ └── sprites │ │ │ │ │ └── icon │ │ │ │ │ └── search.png │ │ │ ├── blockstates │ │ │ │ ├── mini_crafting.json │ │ │ │ └── bag.json │ │ │ ├── shaders │ │ │ │ └── core │ │ │ │ │ ├── passthrough_vr.vsh │ │ │ │ │ └── blit_vr.fsh │ │ │ ├── skins │ │ │ │ ├── 6a │ │ │ │ │ └── 6a57b14c8cd96096a5ba715a164a4e92b45f0dc2955b893f0d0bce6bdf5a3 │ │ │ │ └── dd │ │ │ │ │ └── ddd9b5a9d7699b5cc6d5161983d2359ad5b5d33f9157d0447a59e8a4cfc9c50 │ │ │ ├── vivecraft.vrmanifest │ │ │ ├── input │ │ │ │ └── tracker_defaults.json │ │ │ └── models │ │ │ │ └── item │ │ │ │ ├── camera_display.json │ │ │ │ ├── camcorder_display.json │ │ │ │ └── mini_crafting.json │ │ └── minecraft │ │ │ └── atlases │ │ │ ├── gui.json │ │ │ └── blocks.json │ ├── vivecraft.blur.mixins.json │ ├── vivecraft.rei.mixins.json │ ├── vivecraft.alexmobs.mixins.json │ ├── vivecraft.cataclysm.mixins.json │ ├── vivecraft.emf.mixins.json │ ├── vivecraft.mca.mixins.json │ ├── vivecraft.dynamicfps.mixins.json │ ├── vivecraft.modmenu.mixins.json │ ├── vivecraft.bedrockify.mixins.json │ ├── vivecraft.accessories.mixins.json │ ├── vivecraft.resolutioncontrol.mixins.json │ ├── vivecraft.xaerosmimimap.mixins.json │ ├── vivecraft.sereneseasons.mixins.json │ ├── vivecraft.sodium.mixins.json │ ├── vivecraft.optifine.mixins.json │ └── vivecraft.iris.mixins.json │ └── java │ └── org │ └── vivecraft │ ├── client_vr │ ├── provider │ │ ├── ControllerType.java │ │ ├── nullvr │ │ │ ├── NullVRHapticScheduler.java │ │ │ └── BodyPart.java │ │ ├── ActionParams.java │ │ ├── HapticScheduler.java │ │ ├── openvr_lwjgl │ │ │ └── OpenVRUtil.java │ │ └── HardwareType.java │ ├── render │ │ ├── VRFirstPersonArmSwing.java │ │ └── RenderConfigException.java │ ├── extensions │ │ ├── MinecraftExtension.java │ │ ├── StateHolderExtension.java │ │ ├── FrustumExtension.java │ │ ├── EntityRenderDispatcherVRExtension.java │ │ ├── WindowExtension.java │ │ ├── GuiExtension.java │ │ ├── BlockModelWrapperExtension.java │ │ ├── ClassDependentMixin.java │ │ └── MethodDependentMixin.java │ ├── utils │ │ └── osc_trackers │ │ │ └── OSCTracker.java │ ├── gameplay │ │ ├── trackers │ │ │ └── DebugRenderTracker.java │ │ └── interact_modules │ │ │ └── DebugRenderModule.java │ └── gui │ │ └── keyboard │ │ └── EasterEggTheme.java │ ├── server │ ├── config │ │ └── enums │ │ │ ├── ClimbeyBlockmode.java │ │ │ └── HeadshotIndicator.java │ ├── MinecraftServerExt.java │ └── api_impl │ │ └── VRServerAPIImpl.java │ ├── client │ ├── gui │ │ ├── framework │ │ │ ├── screens │ │ │ │ └── ChangeableParentScreen.java │ │ │ └── widgets │ │ │ │ ├── GuiVROption.java │ │ │ │ └── SilentButton.java │ │ ├── pip │ │ │ └── state │ │ │ │ └── GuiFBTPlayerState.java │ │ ├── settings │ │ │ ├── GuiShaderCompatSettings.java │ │ │ ├── GuiWeaponCollisionSettings.java │ │ │ ├── GuiRenderingSettings.java │ │ │ ├── GuiQuickCommandEditor.java │ │ │ ├── GuiBlacklistEditor.java │ │ │ └── GuiPostEffectsSettings.java │ │ └── VivecraftClickEvent.java │ ├── render │ │ ├── models │ │ │ ├── FeetModel.java │ │ │ └── HandModel.java │ │ └── VRPlayerRenderData.java │ ├── extensions │ │ ├── SparkParticleExtension.java │ │ ├── BufferBuilderExtension.java │ │ ├── LevelRenderStateExtension.java │ │ ├── GlDeviceExtension.java │ │ ├── RenderLayerExtension.java │ │ ├── EntityRenderDispatcherExtension.java │ │ └── RenderTargetExtension.java │ ├── utils │ │ ├── RenderLayerType.java │ │ ├── StencilHelper.java │ │ └── LangHelper.java │ └── api_impl │ │ └── event │ │ └── VivecraftClientRegistrationEventImpl.java │ ├── common │ ├── utils │ │ ├── math │ │ │ ├── AngleOrderOperation.java │ │ │ ├── Axis.java │ │ │ └── AngleOrder.java │ │ └── ClassUtils.java │ ├── network │ │ ├── packet │ │ │ ├── c2s │ │ │ │ ├── ClimbingPayloadC2S.java │ │ │ │ ├── DamageDirectionPayloadC2S.java │ │ │ │ ├── UnknownPayloadC2S.java │ │ │ │ ├── DrawPayloadC2S.java │ │ │ │ ├── HeightPayloadC2S.java │ │ │ │ ├── VRActivePayloadC2S.java │ │ │ │ ├── WorldScalePayloadC2S.java │ │ │ │ ├── CrawlPayloadC2S.java │ │ │ │ ├── VRPlayerStatePayloadC2S.java │ │ │ │ ├── LegacyHeadDataPayloadC2S.java │ │ │ │ ├── TeleportPayloadC2S.java │ │ │ │ ├── LegacyController1DataPayloadC2S.java │ │ │ │ └── LegacyController0DataPayloadC2S.java │ │ │ ├── s2c │ │ │ │ ├── RequestDataPayloadS2C.java │ │ │ │ ├── UnknownPayloadS2C.java │ │ │ │ ├── VersionPayloadS2C.java │ │ │ │ ├── DualWieldingPayloadS2C.java │ │ │ │ ├── VRSwitchingPayloadS2C.java │ │ │ │ ├── AttackWhileBlockingPayloadS2C.java │ │ │ │ ├── DamageDirectionPayloadS2C.java │ │ │ │ ├── VRActivePayloadS2C.java │ │ │ │ └── NetworkVersionPayloadS2C.java │ │ │ ├── PayloadIdentifier.java │ │ │ └── VivecraftPayload.java │ │ └── TrackerPose.java │ ├── VRServerPerms.java │ └── CommonDataHolder.java │ ├── data │ ├── ViveModifiers.java │ └── ViveBlockTags.java │ ├── mixin │ ├── client_vr │ │ ├── renderer │ │ │ ├── PostChainVRMixin.java │ │ │ ├── SectionOcclusionGraphAccessor.java │ │ │ ├── item │ │ │ │ └── BlockModelWrapperVRMixin.java │ │ │ ├── GameRendererAccessor.java │ │ │ ├── CubeMapVRMixin.java │ │ │ ├── blockentity │ │ │ │ ├── TheEndGatewayRendererVRMixin.java │ │ │ │ └── TheEndPortalRendererVRMixin.java │ │ │ └── entity │ │ │ │ └── layers │ │ │ │ └── CustomHeadLayerMixin.java │ │ ├── player │ │ │ └── LocalPlayer_PlayerVRMixin.java │ │ ├── blaze3d │ │ │ ├── opengl │ │ │ │ ├── GlStateManagerVRMixin.java │ │ │ │ └── GLCommandEncoderVRMixin.java │ │ │ ├── systems │ │ │ │ └── RenderSystemVRMixin.java │ │ │ ├── platform │ │ │ │ └── InputConstantsVRMixin.java │ │ │ └── audio │ │ │ │ └── LibraryVRMixin.java │ │ ├── ClientBrandRetrieverVRMixin.java │ │ ├── gui │ │ │ └── screens │ │ │ │ └── inventory │ │ │ │ ├── AbstractContainerScreenVRMixin.java │ │ │ │ └── AbstractSignEditScreenVRMixin.java │ │ ├── sounds │ │ │ └── SoundEngineVRMixin.java │ │ └── tutorial │ │ │ └── PunchTreeTutorialStepInstanceVRMixin.java │ ├── client │ │ ├── renderer │ │ │ ├── RenderStateShardAccessor.java │ │ │ ├── entity │ │ │ │ └── layers │ │ │ │ │ └── RenderLayerMixin.java │ │ │ ├── ItemBlockRenderTypesMixin.java │ │ │ ├── block │ │ │ │ └── LiquidBlockRendererMixin.java │ │ │ └── culling │ │ │ │ └── FrustumVRMixin.java │ │ ├── blaze3d │ │ │ ├── ByteBufferBuilderAccessor.java │ │ │ └── BufferBuilderMixin.java │ │ ├── gui │ │ │ └── GuiGraphicsAccessor.java │ │ └── multiplayer │ │ │ └── ClientLevelMixin.java │ ├── server │ │ ├── ChunkMapAccessor.java │ │ ├── TrackedEntityAccessor.java │ │ └── players │ │ │ └── PlayerListMixin.java │ └── world │ │ └── entity │ │ └── monster │ │ └── EndermanMixin.java │ ├── api │ ├── client │ │ ├── data │ │ │ ├── CloseKeyboardContext.java │ │ │ └── OpenKeyboardContext.java │ │ └── ItemInUseTracker.java │ └── data │ │ └── FBTMode.java │ ├── mod_compat_vr │ ├── resolutioncontrol │ │ └── ResolutionControlHelper.java │ ├── shaders │ │ └── patches │ │ │ ├── EbinMadPatch.java │ │ │ ├── ProjDiag4ZPatch.java │ │ │ ├── EbinProjPatch.java │ │ │ ├── EbinProjInvPatch.java │ │ │ ├── SuperDuperMadPatch.java │ │ │ ├── SuperDuperProj2Patch.java │ │ │ ├── RreProjInvPatch.java │ │ │ ├── ProjDiag4Patch.java │ │ │ ├── SuperDuperProj3Patch.java │ │ │ ├── MakeupProjPatch.java │ │ │ ├── ProjDiag3Patch.java │ │ │ ├── SuperDuperLineProj2Patch.java │ │ │ └── MakeupProjInvPatch.java │ ├── sodium │ │ ├── extensions │ │ │ └── ModelCuboidExtension.java │ │ └── mixin │ │ │ └── SodiumLeavesBlockMixin.java │ ├── immersiveportals │ │ └── ImmersivePortalsHelper.java │ ├── cataclysm │ │ └── mixin │ │ │ └── ClientEventMixin.java │ ├── alexmobs │ │ └── mixin │ │ │ └── ClientEventsMixin.java │ ├── iris │ │ ├── extensions │ │ │ ├── PipelineManagerExtension.java │ │ │ └── IrisChunkProgramOverridesExtension.java │ │ └── mixin │ │ │ ├── IrisCameraUniformsMixin.java │ │ │ ├── JcppProcessorVRMixin.java │ │ │ └── IrisShadowRendererMixin.java │ ├── blur │ │ └── mixin │ │ │ └── BlurMixin.java │ ├── modmenu │ │ └── ModMenuHelper.java │ ├── sereneseasons │ │ └── mixin │ │ │ └── ModClientMixin.java │ ├── rei │ │ └── mixin │ │ │ └── reiTextFieldWidgetMixin.java │ ├── xaerosminimap │ │ └── mixin │ │ │ └── ImprovedFramebufferMixin.java │ ├── optifine │ │ └── mixin │ │ │ ├── OptifineLiquidBlockRendererMixin.java │ │ │ └── ShaderPackParserVRMixin.java │ └── pehkui │ │ └── PehkuiHelper.java │ ├── client_xr │ └── render_pass │ │ └── RenderPassType.java │ └── api_beta │ └── VivecraftAPI.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── stubs ├── src │ └── main │ │ └── java │ │ ├── net │ │ ├── coderbot │ │ │ └── iris │ │ │ │ ├── shaderpack │ │ │ │ ├── DimensionId.java │ │ │ │ ├── ProgramSet.java │ │ │ │ ├── PackShadowDirectives.java │ │ │ │ └── materialmap │ │ │ │ │ └── NamespacedId.java │ │ │ │ ├── gl │ │ │ │ └── program │ │ │ │ │ ├── ProgramImages.java │ │ │ │ │ └── ProgramSamplers.java │ │ │ │ ├── pipeline │ │ │ │ ├── ShadowRenderer.java │ │ │ │ ├── SodiumTerrainPipeline.java │ │ │ │ ├── WorldRenderingPipeline.java │ │ │ │ ├── PipelineManager.java │ │ │ │ └── newshader │ │ │ │ │ └── NewWorldRenderingPipeline.java │ │ │ │ ├── shadows │ │ │ │ └── ShadowRenderTargets.java │ │ │ │ ├── compat │ │ │ │ └── sodium │ │ │ │ │ └── impl │ │ │ │ │ └── shader_overrides │ │ │ │ │ ├── IrisTerrainPass.java │ │ │ │ │ ├── IrisChunkShaderInterface.java │ │ │ │ │ └── IrisChunkProgramOverrides.java │ │ │ │ └── Iris.java │ │ ├── irisshaders │ │ │ └── iris │ │ │ │ ├── gl │ │ │ │ ├── program │ │ │ │ │ ├── ProgramImages.java │ │ │ │ │ └── ProgramSamplers.java │ │ │ │ └── uniform │ │ │ │ │ ├── UniformUpdateFrequency.java │ │ │ │ │ └── UniformHolder.java │ │ │ │ ├── shaderpack │ │ │ │ ├── DimensionId.java │ │ │ │ ├── programs │ │ │ │ │ └── ProgramSet.java │ │ │ │ ├── materialmap │ │ │ │ │ └── NamespacedId.java │ │ │ │ └── properties │ │ │ │ │ └── PackShadowDirectives.java │ │ │ │ ├── shadows │ │ │ │ ├── ShadowRenderer.java │ │ │ │ └── ShadowRenderTargets.java │ │ │ │ ├── pipeline │ │ │ │ ├── SodiumTerrainPipeline.java │ │ │ │ ├── WorldRenderingPipeline.java │ │ │ │ ├── PipelineManager.java │ │ │ │ └── IrisRenderingPipeline.java │ │ │ │ ├── helpers │ │ │ │ └── StringPair.java │ │ │ │ ├── compat │ │ │ │ └── sodium │ │ │ │ │ └── impl │ │ │ │ │ └── shader_overrides │ │ │ │ │ ├── IrisTerrainPass.java │ │ │ │ │ ├── IrisChunkShaderInterface.java │ │ │ │ │ └── IrisChunkProgramOverrides.java │ │ │ │ └── Iris.java │ │ ├── optifine │ │ │ └── util │ │ │ │ └── LineBuffer.java │ │ └── caffeinemc │ │ │ └── mods │ │ │ └── sodium │ │ │ └── client │ │ │ ├── render │ │ │ ├── immediate │ │ │ │ └── model │ │ │ │ │ └── ModelCuboid.java │ │ │ └── chunk │ │ │ │ └── vertex │ │ │ │ └── format │ │ │ │ └── ChunkVertexType.java │ │ │ └── gl │ │ │ └── shader │ │ │ └── GlProgram.java │ │ ├── me │ │ └── jellysquid │ │ │ └── mods │ │ │ └── sodium │ │ │ └── client │ │ │ ├── render │ │ │ ├── immediate │ │ │ │ └── model │ │ │ │ │ └── ModelCuboid.java │ │ │ ├── vertex │ │ │ │ └── type │ │ │ │ │ └── ChunkVertexType.java │ │ │ └── chunk │ │ │ │ └── vertex │ │ │ │ └── format │ │ │ │ └── ChunkVertexType.java │ │ │ └── gl │ │ │ └── shader │ │ │ └── GlProgram.java │ │ ├── io │ │ └── wispforest │ │ │ └── accessories │ │ │ └── api │ │ │ └── AccessoriesContainer.java │ │ └── traben │ │ └── entity_model_features │ │ └── models │ │ └── parts │ │ └── EMFModelPart.java └── build.gradle ├── .gitignore ├── fabric └── src │ └── main │ ├── resources │ └── vivecraft.fabric.mixins.json │ └── java │ └── org │ └── vivecraft │ └── fabric │ ├── mixin │ ├── world │ │ └── level │ │ │ └── biome │ │ │ └── BiomeAccessor.java │ └── screenhandler │ │ └── client │ │ └── FabricClientNetworkingVRMixin.java │ ├── VivecraftEarlyEntryForOptifabric.java │ ├── client │ ├── VivecraftModMenuApiImpl.java │ └── ClientEvents.java │ └── XeventsImpl.java ├── settings.gradle └── gradle.properties /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: vivecraft 2 | -------------------------------------------------------------------------------- /forge/gradle.properties: -------------------------------------------------------------------------------- 1 | loom.platform=forge -------------------------------------------------------------------------------- /neoforge/gradle.properties: -------------------------------------------------------------------------------- 1 | loom.platform=neoforge 2 | -------------------------------------------------------------------------------- /common/src/main/resources/architectury.common.json: -------------------------------------------------------------------------------- 1 | { 2 | "accessWidener": "vivecraft.accesswidener" 3 | } 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/vivecraft_icon.png -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/shaderpack/DimensionId.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.shaderpack; 2 | 3 | public interface DimensionId {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/shaderpack/ProgramSet.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.shaderpack; 2 | 3 | public interface ProgramSet {} 4 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/block/crops.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "#minecraft:crops" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/arrows.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "#minecraft:arrows" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/maps.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "minecraft:filled_map" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/gl/program/ProgramImages.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.gl.program; 2 | 3 | public interface ProgramImages {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/pipeline/ShadowRenderer.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.pipeline; 2 | 3 | public interface ShadowRenderer {} 4 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/telescope.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "minecraft:spyglass" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/gl/program/ProgramSamplers.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.gl.program; 2 | 3 | public interface ProgramSamplers {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/shadows/ShadowRenderTargets.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.shadows; 2 | 3 | public interface ShadowRenderTargets {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/gl/program/ProgramImages.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.gl.program; 2 | 3 | public interface ProgramImages {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/shaderpack/DimensionId.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.shaderpack; 2 | 3 | public interface DimensionId {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/shadows/ShadowRenderer.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.shadows; 2 | 3 | public interface ShadowRenderer {} 4 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/block/climbable.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "#minecraft:climbable" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/block/music_blocks.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "minecraft:note_block" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/pipeline/SodiumTerrainPipeline.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.pipeline; 2 | 3 | public class SodiumTerrainPipeline {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/gl/program/ProgramSamplers.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.gl.program; 2 | 3 | public interface ProgramSamplers {} 4 | -------------------------------------------------------------------------------- /common/src/main/resources/natives/katvr/WalkerBase.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/natives/katvr/WalkerBase.dll -------------------------------------------------------------------------------- /common/src/main/resources/natives/katvr/msvcp120d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/natives/katvr/msvcp120d.dll -------------------------------------------------------------------------------- /common/src/main/resources/natives/katvr/msvcp140d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/natives/katvr/msvcp140d.dll -------------------------------------------------------------------------------- /common/src/main/resources/natives/katvr/msvcr120d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/natives/katvr/msvcr120d.dll -------------------------------------------------------------------------------- /common/src/main/resources/natives/katvr/ucrtbased.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/natives/katvr/ucrtbased.dll -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/shaderpack/PackShadowDirectives.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.shaderpack; 2 | 3 | public interface PackShadowDirectives {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/pipeline/SodiumTerrainPipeline.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.pipeline; 2 | 3 | public class SodiumTerrainPipeline {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/shadows/ShadowRenderTargets.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.shadows; 2 | 3 | public interface ShadowRenderTargets {} 4 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/items/camera.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "vivecraft:item/camera" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /common/src/main/resources/natives/katvr/vcruntime140d.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/natives/katvr/vcruntime140d.dll -------------------------------------------------------------------------------- /stubs/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | } 4 | 5 | group = 'org.vivecraft' 6 | version = '1.0' 7 | 8 | repositories { 9 | mavenCentral() 10 | } 11 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/helpers/StringPair.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.helpers; 2 | 3 | public record StringPair(String key, String value) {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/shaderpack/programs/ProgramSet.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.shaderpack.programs; 2 | 3 | public interface ProgramSet {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/optifine/util/LineBuffer.java: -------------------------------------------------------------------------------- 1 | package net.optifine.util; 2 | 3 | public class LineBuffer { 4 | public LineBuffer(String[] linesArr) {} 5 | } 6 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/shaderpack/materialmap/NamespacedId.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.shaderpack.materialmap; 2 | 3 | public interface NamespacedId {} 4 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/items/camcorder.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "vivecraft:item/camcorder" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/items/climb_claws.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "vivecraft:item/climb_claws" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/black.png -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/white.png -------------------------------------------------------------------------------- /common/src/main/resources/natives/infinadeck/InfinadeckAPI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/natives/infinadeck/InfinadeckAPI.dll -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/shaderpack/materialmap/NamespacedId.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.shaderpack.materialmap; 2 | 3 | public interface NamespacedId {} 4 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/black_hmd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/black_hmd.png -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/gold_hmd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/gold_hmd.png -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/rotated_tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "#vivecraft:moditems/balkons_weaponsmod/rotated" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /forge/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "The VR mod for any loader!", 4 | "min_format": [88, 0], 5 | "max_format": [88, 0] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/provider/ControllerType.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.provider; 2 | 3 | public enum ControllerType { 4 | RIGHT, 5 | LEFT 6 | } 7 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/blockstates/mini_crafting.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "standalone": { 4 | "model": "vivecraft:mini_crafting" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/items/camera_display.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "vivecraft:item/camera_display" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/blocks/bag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/blocks/bag.png -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/diamond_hmd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/diamond_hmd.png -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/transparent.png -------------------------------------------------------------------------------- /neoforge/src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "The VR mod for any loader!", 4 | "min_format": [88, 0], 5 | "max_format": [88, 0] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/items/camcorder_display.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:model", 4 | "model": "vivecraft:item/camcorder_display" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/blocks/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/blocks/camera.png -------------------------------------------------------------------------------- /stubs/src/main/java/me/jellysquid/mods/sodium/client/render/immediate/model/ModelCuboid.java: -------------------------------------------------------------------------------- 1 | package me.jellysquid.mods.sodium.client.render.immediate.model; 2 | 3 | public class ModelCuboid {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/shaderpack/properties/PackShadowDirectives.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.shaderpack.properties; 2 | 3 | public interface PackShadowDirectives {} 4 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/blocks/bag_gold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/blocks/bag_gold.png -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/blocks/camcorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/blocks/camcorder.png -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/item/climb_claws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/item/climb_claws.png -------------------------------------------------------------------------------- /stubs/src/main/java/io/wispforest/accessories/api/AccessoriesContainer.java: -------------------------------------------------------------------------------- 1 | package io.wispforest.accessories.api; 2 | 3 | public interface AccessoriesContainer { 4 | String getSlotName(); 5 | } 6 | -------------------------------------------------------------------------------- /stubs/src/main/java/me/jellysquid/mods/sodium/client/render/vertex/type/ChunkVertexType.java: -------------------------------------------------------------------------------- 1 | package me.jellysquid.mods.sodium.client.render.vertex.type; 2 | 3 | public interface ChunkVertexType {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/caffeinemc/mods/sodium/client/render/immediate/model/ModelCuboid.java: -------------------------------------------------------------------------------- 1 | package net.caffeinemc.mods.sodium.client.render.immediate.model; 2 | 3 | public class ModelCuboid {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/compat/sodium/impl/shader_overrides/IrisTerrainPass.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.compat.sodium.impl.shader_overrides; 2 | 3 | public enum IrisTerrainPass {} 4 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/minecraft/atlases/gui.json: -------------------------------------------------------------------------------- 1 | { 2 | "sources": [ 3 | { 4 | "type": "single", 5 | "resource": "vivecraft:gui/sprites/icon/search" 6 | } 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/blocks/inv_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/blocks/inv_button.png -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/item/spyglass_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/item/spyglass_model.png -------------------------------------------------------------------------------- /stubs/src/main/java/me/jellysquid/mods/sodium/client/gl/shader/GlProgram.java: -------------------------------------------------------------------------------- 1 | package me.jellysquid.mods.sodium.client.gl.shader; 2 | 3 | public class GlProgram { 4 | public void delete() {} 5 | } 6 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/compat/sodium/impl/shader_overrides/IrisTerrainPass.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.compat.sodium.impl.shader_overrides; 2 | 3 | public enum IrisTerrainPass {} 4 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/blocks/mini_crafting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/blocks/mini_crafting.png -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/food_sticks.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "minecraft:carrot_on_a_stick", 5 | "minecraft:warped_fungus_on_a_stick" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/caffeinemc/mods/sodium/client/gl/shader/GlProgram.java: -------------------------------------------------------------------------------- 1 | package net.caffeinemc.mods.sodium.client.gl.shader; 2 | 3 | public class GlProgram { 4 | public void delete() {} 5 | } 6 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/textures/gui/sprites/icon/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/textures/gui/sprites/icon/search.png -------------------------------------------------------------------------------- /stubs/src/main/java/me/jellysquid/mods/sodium/client/render/chunk/vertex/format/ChunkVertexType.java: -------------------------------------------------------------------------------- 1 | package me.jellysquid.mods.sodium.client.render.chunk.vertex.format; 2 | 3 | public interface ChunkVertexType {} 4 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/render/VRFirstPersonArmSwing.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.render; 2 | 3 | public enum VRFirstPersonArmSwing { 4 | ATTACK, 5 | USE, 6 | INTERACT 7 | } 8 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/caffeinemc/mods/sodium/client/render/chunk/vertex/format/ChunkVertexType.java: -------------------------------------------------------------------------------- 1 | package net.caffeinemc.mods.sodium.client.render.chunk.vertex.format; 2 | 3 | public interface ChunkVertexType {} 4 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/server/config/enums/ClimbeyBlockmode.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.server.config.enums; 2 | 3 | public enum ClimbeyBlockmode { 4 | DISABLED, 5 | WHITELIST, 6 | BLACKLIST 7 | } 8 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/compat/sodium/impl/shader_overrides/IrisChunkShaderInterface.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.compat.sodium.impl.shader_overrides; 2 | 3 | public interface IrisChunkShaderInterface {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/traben/entity_model_features/models/parts/EMFModelPart.java: -------------------------------------------------------------------------------- 1 | package traben.entity_model_features.models.parts; 2 | 3 | public abstract class EMFModelPart { 4 | public static class Animator {} 5 | } 6 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/server/config/enums/HeadshotIndicator.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.server.config.enums; 2 | 3 | public enum HeadshotIndicator { 4 | NONE, 5 | AUDIO, 6 | VISUAL, 7 | BOTH 8 | } 9 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/compat/sodium/impl/shader_overrides/IrisChunkShaderInterface.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.compat.sodium.impl.shader_overrides; 2 | 3 | public interface IrisChunkShaderInterface {} 4 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/gl/uniform/UniformUpdateFrequency.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.gl.uniform; 2 | 3 | public enum UniformUpdateFrequency { 4 | ONCE, 5 | PER_TICK, 6 | PER_FRAME, 7 | CUSTOM 8 | } 9 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/brushes.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "#c:tools/brush", 6 | "required": false 7 | }, 8 | "minecraft:brush" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/maces.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "#c:tools/mace", 6 | "required": false 7 | }, 8 | 9 | "minecraft:mace" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/pipeline/WorldRenderingPipeline.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.pipeline; 2 | 3 | public interface WorldRenderingPipeline { 4 | void destroy(); 5 | 6 | SodiumTerrainPipeline getSodiumTerrainPipeline(); 7 | } 8 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/throw_items.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | "#minecraft:eggs", 5 | "minecraft:snowball", 6 | "minecraft:splash_potion", 7 | "minecraft:lingering_potion" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/pipeline/WorldRenderingPipeline.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.pipeline; 2 | 3 | public interface WorldRenderingPipeline { 4 | void destroy(); 5 | 6 | SodiumTerrainPipeline getSodiumTerrainPipeline(); 7 | } 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | *.ipr 3 | run/ 4 | *.iws 5 | out/ 6 | *.iml 7 | .gradle/ 8 | output/ 9 | bin/ 10 | libs/ 11 | 12 | .classpath 13 | .project 14 | .idea/ 15 | classes/ 16 | .metadata 17 | .vscode 18 | .settings 19 | *.launch 20 | .architectury-transformer/ 21 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/server/MinecraftServerExt.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.server; 2 | 3 | import java.util.Map; 4 | import java.util.UUID; 5 | 6 | public interface MinecraftServerExt { 7 | Map vivecraft$getPlayersWithVivecraft(); 8 | } 9 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/shaders/core/passthrough_vr.vsh: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | in vec3 Position; 4 | in vec2 UV0; 5 | 6 | out vec2 texCoordinates; 7 | 8 | void main() { 9 | gl_Position = vec4(Position, 1.0); 10 | texCoordinates = UV0; 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/compasses.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "#minecraft:compasses", 6 | "required": false 7 | }, 8 | "minecraft:clock", 9 | "minecraft:compass" 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/skins/6a/6a57b14c8cd96096a5ba715a164a4e92b45f0dc2955b893f0d0bce6bdf5a3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/skins/6a/6a57b14c8cd96096a5ba715a164a4e92b45f0dc2955b893f0d0bce6bdf5a3 -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/skins/dd/ddd9b5a9d7699b5cc6d5161983d2359ad5b5d33f9157d0447a59e8a4cfc9c50: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vivecraft/VivecraftMod/HEAD/common/src/main/resources/assets/vivecraft/skins/dd/ddd9b5a9d7699b5cc6d5161983d2359ad5b5d33f9157d0447a59e8a4cfc9c50 -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/shaders/core/blit_vr.fsh: -------------------------------------------------------------------------------- 1 | #version 330 2 | 3 | uniform sampler2D DiffuseSampler; 4 | 5 | in vec2 texCoordinates; 6 | 7 | out vec4 fragColor; 8 | 9 | void main(){ 10 | fragColor = texture(DiffuseSampler, texCoordinates.st); 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/gui/framework/screens/ChangeableParentScreen.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.gui.framework.screens; 2 | 3 | import net.minecraft.client.gui.screens.Screen; 4 | 5 | public interface ChangeableParentScreen { 6 | void setParent(Screen parent); 7 | } 8 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/render/models/FeetModel.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.render.models; 2 | 3 | import net.minecraft.client.model.geom.ModelPart; 4 | 5 | public interface FeetModel { 6 | ModelPart getLeftFoot(); 7 | 8 | ModelPart getRightFoot(); 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/render/models/HandModel.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.render.models; 2 | 3 | import net.minecraft.client.model.geom.ModelPart; 4 | 5 | public interface HandModel { 6 | ModelPart getLeftHand(); 7 | 8 | ModelPart getRightHand(); 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/utils/math/AngleOrderOperation.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.utils.math; 2 | 3 | import org.joml.Quaternionf; 4 | 5 | @FunctionalInterface 6 | public interface AngleOrderOperation { 7 | Quaternionf getRotation(float x, float y, float z); 8 | } 9 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.blur.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.blur.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "BlurMixin" 8 | ], 9 | "minVersion": "0.8.4" 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.rei.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.rei.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "reiTextFieldWidgetMixin" 8 | ], 9 | "minVersion": "0.8.4" 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.alexmobs.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.alexmobs.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "ClientEventsMixin" 8 | ], 9 | "minVersion": "0.8.4" 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.cataclysm.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.cataclysm.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "ClientEventMixin" 8 | ], 9 | "minVersion": "0.8.4" 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.emf.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.emf.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "EMFModelPartWithStateVRMixin" 8 | ], 9 | "minVersion": "0.8.4" 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.mca.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.mca.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "PlayerEntityExtendedModelMixin" 8 | ], 9 | "minVersion": "0.8.4" 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/bow_exclusion.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "#pokecube:pokecubes", 6 | "required": false 7 | }, 8 | 9 | "#vivecraft:moditems/irons_spellbooks", 10 | "#vivecraft:moditems/balkons_weaponsmod/nonbows" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/moditems/balkons_weaponsmod/nonbows.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "weaponmod:crossbow", 6 | "required": false 7 | }, 8 | { 9 | "id": "weaponmod:javelin", 10 | "required": false 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.dynamicfps.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.dynamicfps.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "DynamicFPSModVRMixin" 8 | ], 9 | "minVersion": "0.8.4" 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.modmenu.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.modmenu.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "PauseScreenVRModMenuMixin" 8 | ], 9 | "minVersion": "0.8.4" 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/extensions/MinecraftExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.extensions; 2 | 3 | public interface MinecraftExtension { 4 | 5 | /** 6 | * returns the partialTick when running and the pausePartialTick when paused 7 | */ 8 | float vivecraft$getPartialTick(); 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.bedrockify.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.bedrockify.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "BedrockBlockShadingMixin" 8 | ], 9 | "minVersion": "0.8.4" 10 | } 11 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/Iris.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris; 2 | 3 | import net.coderbot.iris.pipeline.PipelineManager; 4 | import org.jetbrains.annotations.NotNull; 5 | 6 | public class Iris { 7 | @NotNull 8 | public static PipelineManager getPipelineManager() { 9 | return null; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.accessories.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.accessories.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "AccessoriesRenderLayerVRMixin" 8 | ], 9 | "minVersion": "0.8.4" 10 | } 11 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/Iris.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris; 2 | 3 | import net.irisshaders.iris.pipeline.PipelineManager; 4 | import org.jetbrains.annotations.NotNull; 5 | 6 | public class Iris { 7 | @NotNull 8 | public static PipelineManager getPipelineManager() { 9 | return null; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/crossbows.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "#c:tools/crossbow", 6 | "required": false 7 | }, 8 | 9 | "minecraft:crossbow", 10 | { 11 | "id": "tetra:modular_crossbow", 12 | "required": false 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.resolutioncontrol.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.resolutioncontrol.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "ResolutionControlModMixin" 8 | ], 9 | "minVersion": "0.8.4" 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.xaerosmimimap.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.xaerosminimap.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "ImprovedFramebufferMixin" 8 | ], 9 | "minVersion": "0.8.4", 10 | "mixins": [] 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/extensions/StateHolderExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.extensions; 2 | 3 | import net.minecraft.world.level.block.state.properties.Property; 4 | 5 | import java.util.Map; 6 | 7 | public interface StateHolderExtension { 8 | void vivecraft$setValues(Map, Comparable> values); 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.sereneseasons.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.sereneseasons.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "ModClientMixin", 8 | "SeasonColorHandlersMixin" 9 | ], 10 | "minVersion": "0.8.4" 11 | } 12 | -------------------------------------------------------------------------------- /neoforge/src/main/resources/vivecraft.neoforge.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "org.vivecraft.neoforge.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "NeoForgeMinecraftVRMixin", 8 | "network.NeoForgeOpenContainerVRMixin" 9 | ], 10 | "minVersion": "0.8.4" 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/data/ViveModifiers.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.data; 2 | 3 | import net.minecraft.resources.ResourceLocation; 4 | 5 | public class ViveModifiers { 6 | /** 7 | * id for our walk-up blocks modifier 8 | */ 9 | public static final ResourceLocation WALK_UP_BLOCKS = ResourceLocation.parse("vivecraft:walk_up_blocks"); 10 | } 11 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/pipeline/PipelineManager.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.pipeline; 2 | 3 | import java.util.function.Function; 4 | 5 | public class PipelineManager { 6 | private WorldRenderingPipeline pipeline; 7 | private final Function pipelineFactory = null; 8 | 9 | private void resetTextureState() {} 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/gui/framework/widgets/GuiVROption.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.gui.framework.widgets; 2 | 3 | import net.minecraft.client.gui.layouts.LayoutElement; 4 | import org.vivecraft.client_vr.settings.VRSettings; 5 | 6 | public interface GuiVROption extends LayoutElement { 7 | int getId(); 8 | 9 | VRSettings.VrOptions getOption(); 10 | } 11 | -------------------------------------------------------------------------------- /forge/src/main/resources/vivecraft.forge.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "org.vivecraft.forge.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "ForgeGameRendererVRMixin", 8 | "ForgeMinecraftVRMixin", 9 | "network.ForgeOpenContainerVRMixin" 10 | ], 11 | "minVersion": "0.8.4" 12 | } 13 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/pipeline/PipelineManager.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.pipeline; 2 | 3 | import java.util.function.Function; 4 | 5 | public class PipelineManager { 6 | private WorldRenderingPipeline pipeline; 7 | private final Function pipelineFactory = null; 8 | 9 | private void resetTextureState() {} 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/renderer/PostChainVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.renderer; 2 | 3 | import net.minecraft.client.renderer.PostChain; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | 6 | @Mixin(PostChain.class) 7 | public class PostChainVRMixin { 8 | // TODO figure out how to use stencils when applicable, if that is even in here 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/spears.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "#c:spears", 6 | "required": false 7 | }, 8 | { 9 | "id": "#c:tools/spear", 10 | "required": false 11 | }, 12 | { 13 | "id": "#forge:tools/tridents", 14 | "required": false 15 | }, 16 | "minecraft:trident" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/pipeline/IrisRenderingPipeline.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.pipeline; 2 | 3 | import net.irisshaders.iris.shadows.ShadowRenderTargets; 4 | import net.irisshaders.iris.shadows.ShadowRenderer; 5 | 6 | public class IrisRenderingPipeline { 7 | private ShadowRenderTargets shadowRenderTargets; 8 | 9 | private final ShadowRenderer shadowRenderer = null; 10 | } 11 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/blockstates/bag.json: -------------------------------------------------------------------------------- 1 | { 2 | "variants": { 3 | "type=normal": { 4 | "model": "vivecraft:bag" 5 | }, 6 | "type=gold": { 7 | "model": "vivecraft:bag_gold" 8 | }, 9 | "type=closed": { 10 | "model": "vivecraft:bag_closed" 11 | }, 12 | "type=gold_closed": { 13 | "model": "vivecraft:bag_gold_closed" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/moditems/balkons_weaponsmod/rotated.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "weaponmod:javelin", 6 | "required": false 7 | }, 8 | { 9 | "id": "weaponmod:firerod", 10 | "required": false 11 | }, 12 | { 13 | "id": "weaponmod:crossbow", 14 | "required": false 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/extensions/SparkParticleExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.extensions; 2 | 3 | import java.util.UUID; 4 | 5 | public interface SparkParticleExtension { 6 | /** 7 | * sets the player uuid that this particle was created for 8 | * 9 | * @param playerUUID UUID of the owning player 10 | */ 11 | void vivecraft$setPlayerUUID(UUID playerUUID); 12 | } 13 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/compat/sodium/impl/shader_overrides/IrisChunkProgramOverrides.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.compat.sodium.impl.shader_overrides; 2 | 3 | import me.jellysquid.mods.sodium.client.gl.shader.GlProgram; 4 | 5 | import java.util.EnumMap; 6 | 7 | public class IrisChunkProgramOverrides { 8 | private final EnumMap> programs = null; 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/utils/RenderLayerType.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.utils; 2 | 3 | /** 4 | * part of the hacky way, to copy RenderLayers from the regular PlayerRenderer, to the VRPlayerRenderer 5 | */ 6 | public enum RenderLayerType { 7 | // cant put that inside the other class, because of Mixin 8 | PARENT_ONLY, 9 | PARENT_MODELSET, 10 | PARENT_MODEL_MODEL, 11 | OTHER 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client/renderer/RenderStateShardAccessor.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client.renderer; 2 | 3 | import net.minecraft.client.renderer.RenderStateShard; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(RenderStateShard.class) 8 | public interface RenderStateShardAccessor { 9 | @Accessor 10 | String getName(); 11 | } 12 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/coderbot/iris/pipeline/newshader/NewWorldRenderingPipeline.java: -------------------------------------------------------------------------------- 1 | package net.coderbot.iris.pipeline.newshader; 2 | 3 | import net.irisshaders.iris.shadows.ShadowRenderTargets; 4 | import net.irisshaders.iris.shadows.ShadowRenderer; 5 | 6 | public class NewWorldRenderingPipeline { 7 | private ShadowRenderTargets shadowRenderTargets; 8 | 9 | private final ShadowRenderer shadowRenderer = null; 10 | } 11 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/compat/sodium/impl/shader_overrides/IrisChunkProgramOverrides.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.compat.sodium.impl.shader_overrides; 2 | 3 | import net.caffeinemc.mods.sodium.client.gl.shader.GlProgram; 4 | 5 | import java.util.EnumMap; 6 | 7 | public class IrisChunkProgramOverrides { 8 | private final EnumMap> programs = null; 9 | } 10 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client/blaze3d/ByteBufferBuilderAccessor.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client.blaze3d; 2 | 3 | import com.mojang.blaze3d.vertex.ByteBufferBuilder; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(ByteBufferBuilder.class) 8 | public interface ByteBufferBuilderAccessor { 9 | @Accessor("capacity") 10 | long getCapacity(); 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/fishing_rods.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "#forge:tools/fishing_rods", 6 | "required": false 7 | }, 8 | { 9 | "id": "#c:tools/fishing_rods", 10 | "required": false 11 | }, 12 | 13 | "minecraft:fishing_rod", 14 | "#vivecraft:food_sticks", 15 | "#vivecraft:moditems/balkons_weaponsmod/flails" 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /fabric/src/main/resources/vivecraft.fabric.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "org.vivecraft.fabric.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "FabricGameRendererMixin", 8 | "FabricMinecraftVRMixin", 9 | "screenhandler.client.FabricClientNetworkingVRMixin", 10 | "world.level.biome.BiomeAccessor" 11 | ], 12 | "minVersion": "0.8.4" 13 | } 14 | -------------------------------------------------------------------------------- /fabric/src/main/java/org/vivecraft/fabric/mixin/world/level/biome/BiomeAccessor.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.fabric.mixin.world.level.biome; 2 | 3 | import net.minecraft.world.level.biome.Biome; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(Biome.class) 8 | public interface BiomeAccessor { 9 | @Accessor("climateSettings") 10 | Biome.ClimateSettings getClimateSettings(); 11 | } 12 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.sodium.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.sodium.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "ModelCuboidMixin", 8 | "SodiumLeavesBlockMixin", 9 | "SodiumWorldRendererVRMixin", 10 | "caffeinemc.EntityRendererMixin", 11 | "jellysquid.EntityRendererMixin" 12 | ], 13 | "minVersion": "0.8.4" 14 | } 15 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/utils/osc_trackers/OSCTracker.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.utils.osc_trackers; 2 | 3 | import org.joml.Matrix4f; 4 | 5 | public class OSCTracker { 6 | private final static long TIMEOUT = 10000L; 7 | 8 | public final Matrix4f pose = new Matrix4f(); 9 | protected long timeStamp; 10 | 11 | public boolean isTracking() { 12 | return System.currentTimeMillis() - this.timeStamp < TIMEOUT; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/server/ChunkMapAccessor.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.server; 2 | 3 | import it.unimi.dsi.fastutil.ints.Int2ObjectMap; 4 | import net.minecraft.server.level.ChunkMap; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(ChunkMap.class) 9 | public interface ChunkMapAccessor { 10 | @Accessor("entityMap") 11 | Int2ObjectMap getTrackedEntities(); 12 | } 13 | -------------------------------------------------------------------------------- /fabric/src/main/java/org/vivecraft/fabric/VivecraftEarlyEntryForOptifabric.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.fabric; 2 | 3 | import org.spongepowered.asm.mixin.Mixins; 4 | 5 | public class VivecraftEarlyEntryForOptifabric implements Runnable { 6 | 7 | // add the mixins here, because optifabric loads the optifine classes before regular mixin loading 8 | @Override 9 | public void run() { 10 | Mixins.addConfiguration("vivecraft.optifine.mixins.json"); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/c2s/ClimbingPayloadC2S.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.c2s; 2 | 3 | import org.vivecraft.common.network.packet.PayloadIdentifier; 4 | 5 | /** 6 | * indicates that the client is currently climbing 7 | */ 8 | public record ClimbingPayloadC2S() implements VivecraftPayloadC2S { 9 | 10 | @Override 11 | public PayloadIdentifier payloadId() { 12 | return PayloadIdentifier.CLIMBING; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/extensions/FrustumExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.extensions; 2 | 3 | import net.minecraft.world.phys.AABB; 4 | 5 | public interface FrustumExtension { 6 | 7 | /** 8 | * checks if {@code bb} is partially or fully in the frustum 9 | * 10 | * @param bb bounding box to check 11 | * @return if the AABB is partially or fully in the frustum 12 | */ 13 | boolean vivecraft$isBoundingBoxInFrustum(AABB bb); 14 | } 15 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/shields.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "#forge:tools/shields", 6 | "required": false 7 | }, 8 | { 9 | "id": "#c:shields", 10 | "required": false 11 | }, 12 | { 13 | "id": "#c:tools/shield", 14 | "required": false 15 | }, 16 | { 17 | "id": "tetra:modular_shield", 18 | "required": false 19 | }, 20 | "minecraft:shield" 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { url "https://maven.fabricmc.net/" } 4 | maven { url "https://maven.architectury.dev/" } 5 | maven { url "https://maven.minecraftforge.net/" } 6 | maven { url "https://maven.neoforged.net/" } 7 | gradlePluginPortal() 8 | } 9 | } 10 | 11 | include("common") 12 | include("stubs") 13 | include("fabric") 14 | include("forge") 15 | include("neoforge") 16 | 17 | rootProject.name = "vivecraft" 18 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/extensions/EntityRenderDispatcherVRExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.extensions; 2 | 3 | import net.minecraft.world.entity.player.PlayerModelType; 4 | import org.vivecraft.client_vr.render.VRArmRenderer; 5 | 6 | import java.util.Map; 7 | 8 | public interface EntityRenderDispatcherVRExtension { 9 | 10 | /** 11 | * @return map of VR arm renderers 12 | */ 13 | Map vivecraft$getArmSkinMap(); 14 | } 15 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/s2c/RequestDataPayloadS2C.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.s2c; 2 | 3 | import org.vivecraft.common.network.packet.PayloadIdentifier; 4 | 5 | /** 6 | * indicates that the server wants vr data from the client 7 | */ 8 | public record RequestDataPayloadS2C() implements VivecraftPayloadS2C { 9 | 10 | @Override 11 | public PayloadIdentifier payloadId() { 12 | return PayloadIdentifier.REQUESTDATA; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/extensions/WindowExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.extensions; 2 | 3 | public interface WindowExtension { 4 | /** 5 | * @return the actual height of the desktop window, since we override the default method 6 | */ 7 | int vivecraft$getActualScreenHeight(); 8 | 9 | /** 10 | * @return the actual width of the desktop window, since we override the default method 11 | */ 12 | int vivecraft$getActualScreenWidth(); 13 | } 14 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/c2s/DamageDirectionPayloadC2S.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.c2s; 2 | 3 | import org.vivecraft.common.network.packet.PayloadIdentifier; 4 | 5 | /** 6 | * indicates that the client requested damage direction data 7 | */ 8 | public record DamageDirectionPayloadC2S() implements VivecraftPayloadC2S { 9 | 10 | @Override 11 | public PayloadIdentifier payloadId() { 12 | return PayloadIdentifier.DAMAGE_DIRECTION; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /fabric/src/main/java/org/vivecraft/fabric/client/VivecraftModMenuApiImpl.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.fabric.client; 2 | 3 | import com.terraformersmc.modmenu.api.ConfigScreenFactory; 4 | import com.terraformersmc.modmenu.api.ModMenuApi; 5 | import org.vivecraft.client.gui.settings.VivecraftMainSettings; 6 | 7 | public class VivecraftModMenuApiImpl implements ModMenuApi { 8 | @Override 9 | public ConfigScreenFactory getModConfigScreenFactory() { 10 | return VivecraftMainSettings::new; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx4G 2 | 3 | minecraft_version=1.21.10 4 | enabled_platforms=fabric,forge,neoforge 5 | 6 | archives_base_name=vivecraft 7 | mod_version=1.3.4 8 | maven_group=org.vivecraft 9 | 10 | lwjgl_version=3.3.3 11 | mixin_extras_version=0.4.1 12 | 13 | architectury_version=18.0.3 14 | parchment_version=1.21.9:2025.10.05 15 | 16 | fabric_loader_version=0.17.2 17 | fabric_api_version=0.136.0+1.21.10 18 | 19 | forge_version=1.21.10-60.0.5 20 | neoforge_version=21.10.45-beta 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/extensions/GuiExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.extensions; 2 | 3 | public interface GuiExtension { 4 | 5 | /** 6 | * @return if the player list should always be shown 7 | */ 8 | boolean vivecraft$getShowPlayerList(); 9 | 10 | /** 11 | * set if the player list should be always shown 12 | * 13 | * @param showPlayerList if the player list should be shown 14 | */ 15 | void vivecraft$setShowPlayerList(boolean showPlayerList); 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/provider/nullvr/NullVRHapticScheduler.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.provider.nullvr; 2 | 3 | 4 | import org.vivecraft.client_vr.provider.ControllerType; 5 | import org.vivecraft.client_vr.provider.HapticScheduler; 6 | 7 | public class NullVRHapticScheduler extends HapticScheduler { 8 | 9 | @Override 10 | public void queueHapticPulse( 11 | ControllerType controller, float durationSeconds, float frequency, float amplitude, float delaySeconds) 12 | {} 13 | } 14 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/server/TrackedEntityAccessor.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.server; 2 | 3 | import net.minecraft.server.network.ServerPlayerConnection; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | import java.util.Set; 8 | 9 | @Mixin(targets = "net.minecraft.server.level.ChunkMap$TrackedEntity") 10 | public interface TrackedEntityAccessor { 11 | 12 | @Accessor("seenBy") 13 | Set getPlayersTracking(); 14 | } 15 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/renderer/SectionOcclusionGraphAccessor.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.renderer; 2 | 3 | import net.minecraft.client.renderer.SectionOcclusionGraph; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | import java.util.concurrent.atomic.AtomicBoolean; 8 | 9 | @Mixin(SectionOcclusionGraph.class) 10 | public interface SectionOcclusionGraphAccessor { 11 | @Accessor 12 | AtomicBoolean getNeedsFrustumUpdate(); 13 | } 14 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/render/VRPlayerRenderData.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.render; 2 | 3 | import net.minecraft.world.entity.HumanoidArm; 4 | 5 | public record VRPlayerRenderData(boolean isMainPlayer, float bodyYaw, float xRot, 6 | boolean laying, float layAmount, boolean swimming, boolean noLowerBodyAnimation, 7 | HumanoidArm attackArm, HumanoidArm mainArm, 8 | float bodyScale, float armScale, float legScale) 9 | {} 10 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/utils/math/Axis.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.utils.math; 2 | 3 | import org.joml.Vector3f; 4 | import org.joml.Vector3fc; 5 | 6 | public enum Axis { 7 | PITCH(1.0F, 0.0F, 0.0F), 8 | YAW(0.0F, 1.0F, 0.0F), 9 | ROLL(0.0F, 0.0F, 1.0F); 10 | 11 | private final Vector3fc vector; 12 | 13 | Axis(float x, float y, float z) { 14 | this.vector = new Vector3f(x, y, z); 15 | } 16 | 17 | public Vector3fc getVector() { 18 | return this.vector; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client/gui/GuiGraphicsAccessor.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client.gui; 2 | 3 | import net.minecraft.client.gui.GuiGraphics; 4 | import net.minecraft.client.gui.render.state.GuiRenderState; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(GuiGraphics.class) 9 | public interface GuiGraphicsAccessor { 10 | 11 | @Accessor 12 | Runnable getDeferredTooltip(); 13 | 14 | @Accessor 15 | GuiRenderState getGuiRenderState(); 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/vivecraft.vrmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "source": "builtin", 3 | "applications": [ 4 | { 5 | "app_key": "org.jrbudda.vivecraft.steamvrinput", 6 | "image_path": "https://i1.wp.com/www.vivecraft.org/wp-content/uploads/2016/07/wesYwME.png", 7 | "launch_type": "url", 8 | "url": "steam://launch/", 9 | "strings": { 10 | "en_us": { 11 | "name": "Vivecraft", 12 | "description": "VR mod for Minecraft: Java Edition" 13 | } 14 | } 15 | } 16 | ] 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/rods.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "#forge:rods", 6 | "required": false 7 | }, 8 | { 9 | "id": "#c:rods", 10 | "required": false 11 | }, 12 | 13 | "minecraft:bone", 14 | "minecraft:stick", 15 | "minecraft:debug_stick", 16 | "minecraft:blaze_rod", 17 | "minecraft:breeze_rod", 18 | "minecraft:bamboo", 19 | "minecraft:torch", 20 | "minecraft:redstone_torch", 21 | "minecraft:soul_torch" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/extensions/BufferBuilderExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.extensions; 2 | 3 | /** 4 | * this is an extension to be able to free buffers of custom created BufferBuilders and get their size, 5 | * since vanilla doesn't have that capability 6 | */ 7 | public interface BufferBuilderExtension { 8 | /** 9 | * frees the underlying buffer 10 | */ 11 | void vivecraft$freeBuffer(); 12 | 13 | /** 14 | * @return size of the underlying buffer 15 | */ 16 | long vivecraft$getBufferSize(); 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.optifine.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.optifine.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "OptifineDefaultVertexFormatMixin", 8 | "OptifineLiquidBlockRendererMixin", 9 | "OptifineModelBlockRendererMixin", 10 | "ShaderMacrosVRMixin", 11 | "ShaderPackParserVRMixin", 12 | "ShadersRenderVRMixin", 13 | "ShadersVRMixin" 14 | ], 15 | "minVersion": "0.8.4", 16 | "mixins": [ 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/api/client/data/CloseKeyboardContext.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.api.client.data; 2 | 3 | /** 4 | * Determines how strict the closing of the VR keyboard should be 5 | */ 6 | public enum CloseKeyboardContext { 7 | /** 8 | * Will close the keyboard no matter the situation. 9 | * 10 | * @since 1.3.0 11 | */ 12 | FORCE, 13 | /** 14 | * Will close the keyboard if the user has configured to close the keyboard when an action has been completed. 15 | * 16 | * @since 1.3.0 17 | */ 18 | ACTION_COMPLETE 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/items/spyglass_in_hand.json: -------------------------------------------------------------------------------- 1 | { 2 | "model": { 3 | "type": "minecraft:select", 4 | "cases": [ 5 | { 6 | "model": { 7 | "type": "minecraft:model", 8 | "model": "minecraft:item/spyglass" 9 | }, 10 | "when": [ 11 | "gui", 12 | "ground", 13 | "fixed" 14 | ] 15 | } 16 | ], 17 | "fallback": { 18 | "type": "minecraft:model", 19 | "model": "vivecraft:item/spyglass_in_hand" 20 | }, 21 | "property": "minecraft:display_context" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/extensions/LevelRenderStateExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.extensions; 2 | 3 | import net.minecraft.client.renderer.state.BlockOutlineRenderState; 4 | 5 | public interface LevelRenderStateExtension { 6 | 7 | /** 8 | * sets the outline state for the interact outline 9 | */ 10 | void vivecraft$setInteractOutlineState(int controller, BlockOutlineRenderState interactOutline); 11 | 12 | /** 13 | * gets the states of the interact outline 14 | */ 15 | BlockOutlineRenderState[] vivecraft$getInteractOutlineStates(); 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/extensions/BlockModelWrapperExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.extensions; 2 | 3 | public interface BlockModelWrapperExtension { 4 | /** 5 | * set if any of the parents of this model use the flat generated model 6 | * 7 | * @param generated if any of the parents of this model use the flat generated model 8 | */ 9 | void vivecraft$setGenerated(boolean generated); 10 | 11 | /** 12 | * @return if any of the parents of this model use the flat generated model 13 | */ 14 | boolean vivecraft$isGenerated(); 15 | } 16 | -------------------------------------------------------------------------------- /neoforge/src/main/java/org/vivecraft/neoforge/Vivecraft.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.neoforge; 2 | 3 | import net.neoforged.fml.common.Mod; 4 | import org.vivecraft.server.config.ServerConfig; 5 | 6 | @Mod(Vivecraft.MODID) 7 | public class Vivecraft { 8 | public static final String MODID = "vivecraft"; 9 | 10 | public Vivecraft() { 11 | // init server config 12 | // this is too early for the lang files to be loaded, is needed to register the commands though 13 | // server config is validated again later to have the comments 14 | ServerConfig.init(null); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/render/RenderConfigException.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.render; 2 | 3 | import net.minecraft.network.chat.Component; 4 | 5 | public class RenderConfigException extends Exception { 6 | public Component title; 7 | public Component error; 8 | 9 | public RenderConfigException(Component title, Component error) { 10 | super(error.getString()); 11 | this.title = title; 12 | this.error = error; 13 | } 14 | 15 | public String toString() { 16 | return this.getClass().getName() + ": " + this.error.getString(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/utils/StencilHelper.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.utils; 2 | 3 | public class StencilHelper { 4 | 5 | /** 6 | * @return if the stencil buffer is supported for rendering 7 | */ 8 | public static boolean stencilBufferSupported() { 9 | return false; 10 | // TODO figure out stencil 11 | /* 12 | ClientDataHolderVR.getInstance().vrSettings.stencilBufferDisable && 13 | // disable when satin is loaded, since it causes slowdowns when doing the depth copy 14 | !Xplat.isModLoaded("satin"); 15 | */ 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/input/tracker_defaults.json: -------------------------------------------------------------------------------- 1 | { 2 | "alias_info": {}, 3 | "app_key": "org.jrbudda.vivecraft.steamvrinput", 4 | "bindings": { 5 | "/actions/mixedreality": { 6 | "haptics": [ 7 | ], 8 | "poses": [ 9 | { 10 | "output": "/actions/mixedreality/in/externalcamera", 11 | "path": "/user/camera/pose/raw" 12 | } 13 | ], 14 | "sources": [ 15 | ] 16 | } 17 | }, 18 | "controller_type": "vive_tracker_camera", 19 | "description": "", 20 | "name": "Tracker for Camera", 21 | "options": {}, 22 | "simulated_actions": [] 23 | } 24 | -------------------------------------------------------------------------------- /forge/src/main/java/org/vivecraft/forge/event/CommonEvents.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.forge.event; 2 | 3 | import net.minecraftforge.event.RegisterCommandsEvent; 4 | import net.minecraftforge.eventbus.api.listener.SubscribeEvent; 5 | import net.minecraftforge.fml.common.Mod; 6 | import org.vivecraft.forge.Vivecraft; 7 | import org.vivecraft.server.ServerUtil; 8 | 9 | @Mod.EventBusSubscriber(modid = Vivecraft.MODID) 10 | public class CommonEvents { 11 | @SubscribeEvent 12 | public static void registerCommands(RegisterCommandsEvent event) { 13 | ServerUtil.registerCommands(event.getDispatcher(), event.getBuildContext()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/resolutioncontrol/ResolutionControlHelper.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.resolutioncontrol; 2 | 3 | import io.github.ultimateboomer.resolutioncontrol.ResolutionControlMod; 4 | import org.vivecraft.Xloader; 5 | 6 | public class ResolutionControlHelper { 7 | 8 | public static boolean isLoaded() { 9 | return Xloader.isModLoaded("resolutioncontrol"); 10 | } 11 | 12 | /** 13 | * @return current render scale 14 | */ 15 | public static float getCurrentScaleFactor() { 16 | return (float) ResolutionControlMod.getInstance().getCurrentScaleFactor(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/shaders/patches/EbinMadPatch.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.shaders.patches; 2 | 3 | /** 4 | * patches: 5 | * vec4(projMAD(gl_ProjectionMatrix, viewSpacePosition), viewSpacePosition.z * gl_ProjectionMatrix[2].w); 6 | */ 7 | public class EbinMadPatch extends Patch { 8 | public EbinMadPatch() { 9 | super(""" 10 | vec4(projMAD(gl_ProjectionMatrix, viewSpacePosition), viewSpacePosition.z * gl_ProjectionMatrix[2].w); 11 | """, """ 12 | $2 * vec4($3, 1.0)""", 13 | "vec4\\((\\w+)\\((\\w+),(\\w+)\\),\\3\\.z\\*\\2\\[2]\\.w\\)"); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/gui/framework/widgets/SilentButton.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.gui.framework.widgets; 2 | 3 | import net.minecraft.client.gui.components.Button; 4 | import net.minecraft.client.sounds.SoundManager; 5 | import net.minecraft.network.chat.Component; 6 | 7 | /** 8 | * Button that doesn't play a click sound 9 | */ 10 | public class SilentButton extends Button { 11 | public SilentButton(Component message, OnPress onPress, int width, int height) { 12 | super(0, 0, width, height, message, onPress, DEFAULT_NARRATION); 13 | } 14 | 15 | @Override 16 | public void playDownSound(SoundManager handler) {} 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/VRServerPerms.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common; 2 | 3 | import org.vivecraft.client_vr.ClientDataHolderVR; 4 | 5 | /** 6 | * holds permissions of the client 7 | */ 8 | public class VRServerPerms { 9 | 10 | public static VRServerPerms INSTANCE = new VRServerPerms(); 11 | 12 | public boolean noTeleportClient = true; 13 | 14 | public void setTeleportSupported(boolean supported) { 15 | this.noTeleportClient = !supported; 16 | 17 | if (ClientDataHolderVR.getInstance().vrPlayer != null) { 18 | ClientDataHolderVR.getInstance().vrPlayer.updateTeleportKeys(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/extensions/GlDeviceExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.extensions; 2 | 3 | import com.mojang.blaze3d.textures.GpuTexture; 4 | import com.mojang.blaze3d.textures.TextureFormat; 5 | 6 | import javax.annotation.Nullable; 7 | import java.util.function.Supplier; 8 | 9 | public interface GlDeviceExtension { 10 | /** 11 | * additional method to create a texture with a predefined id 12 | */ 13 | GpuTexture vivecraft$createFixedIdTexture( 14 | @Nullable Supplier labelSupplier, int usageFlags, TextureFormat textureFormat, int width, 15 | int height, int depthLayers, int mipmapLevels, int texId); 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/extensions/RenderLayerExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.extensions; 2 | 3 | /** 4 | * part of the hacky way, to copy RenderLayers from the regular PlayerRenderer, to the VRPlayerRenderer 5 | */ 6 | 7 | public interface RenderLayerExtension { 8 | 9 | /** 10 | * clones the object using the basic Object.clone() call 11 | * no "vivecraft$" since that should mimic the method from the "Cloneable" interface 12 | * 13 | * @return cloned Object 14 | * @throws CloneNotSupportedException shouldn't be thrown, unless the mixin failed 15 | */ 16 | Object clone() throws CloneNotSupportedException; 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/PayloadIdentifier.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet; 2 | 3 | public enum PayloadIdentifier { 4 | VERSION, 5 | REQUESTDATA, 6 | HEADDATA, 7 | CONTROLLER0DATA, 8 | CONTROLLER1DATA, 9 | WORLDSCALE, 10 | DRAW, 11 | MOVEMODE, 12 | UBERPACKET, 13 | TELEPORT, 14 | CLIMBING, 15 | SETTING_OVERRIDE, 16 | HEIGHT, 17 | ACTIVEHAND, 18 | CRAWL, 19 | NETWORK_VERSION, 20 | VR_SWITCHING, 21 | IS_VR_ACTIVE, 22 | VR_PLAYER_STATE, 23 | DUAL_WIELDING, 24 | HAPTIC, 25 | SERVER_VR_CHANGES, 26 | DAMAGE_DIRECTION, 27 | ATTACK_WHILE_BLOCKING 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/moditems/balkons_weaponsmod/flails.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "weaponmod:flail.wood", 6 | "required": false 7 | }, 8 | { 9 | "id": "weaponmod:flail.stone", 10 | "required": false 11 | }, 12 | { 13 | "id": "weaponmod:flail.iron", 14 | "required": false 15 | }, 16 | { 17 | "id": "weaponmod:flail.gold", 18 | "required": false 19 | }, 20 | { 21 | "id": "weaponmod:flail.diamond", 22 | "required": false 23 | }, 24 | { 25 | "id": "weaponmod:flail.netherite", 26 | "required": false 27 | } 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/utils/ClassUtils.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.utils; 2 | 3 | public class ClassUtils { 4 | 5 | /** 6 | * does a class Lookup with an alternative 7 | * 8 | * @param class1 first option 9 | * @param class2 alternative option 10 | * @return found class 11 | * @throws ClassNotFoundException if neither class exists 12 | */ 13 | public static Class getClassWithAlternative(String class1, String class2) throws ClassNotFoundException { 14 | try { 15 | return Class.forName(class1); 16 | } catch (ClassNotFoundException e) { 17 | return Class.forName(class2); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/c2s/UnknownPayloadC2S.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.c2s; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.packet.PayloadIdentifier; 5 | 6 | /** 7 | * unknown received server packet 8 | */ 9 | public record UnknownPayloadC2S() implements VivecraftPayloadC2S { 10 | @Override 11 | public PayloadIdentifier payloadId() { 12 | return null; 13 | } 14 | 15 | public static UnknownPayloadC2S read(FriendlyByteBuf buffer) { 16 | // discard the data 17 | buffer.readBytes(new byte[buffer.readableBytes()]); 18 | return new UnknownPayloadC2S(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/s2c/UnknownPayloadS2C.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.s2c; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.packet.PayloadIdentifier; 5 | 6 | /** 7 | * unknown received client packet 8 | */ 9 | public record UnknownPayloadS2C() implements VivecraftPayloadS2C { 10 | @Override 11 | public PayloadIdentifier payloadId() { 12 | return null; 13 | } 14 | 15 | public static UnknownPayloadS2C read(FriendlyByteBuf buffer) { 16 | // discard the data 17 | buffer.readBytes(new byte[buffer.readableBytes()]); 18 | return new UnknownPayloadS2C(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/shaders/patches/ProjDiag4ZPatch.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.shaders.patches; 2 | 3 | /** 4 | * patches 5 | * pos = pos.xyzz * diag4(gl_ProjectionMatrix) + vec4(0.0, 0.0, gl_ProjectionMatrix[3].z, 0.0); 6 | */ 7 | public class ProjDiag4ZPatch extends Patch { 8 | public ProjDiag4ZPatch() { 9 | super( 10 | """ 11 | pos = pos.xyzz * diag4(gl_ProjectionMatrix) + vec4(0.0, 0.0, gl_ProjectionMatrix[3].z, 0.0); 12 | """, """ 13 | $1 = $3 * vec4($1.xyz, 1.0);""", 14 | "(\\w+)=\\1\\.xyzz\\*(diag4|diagonal4)\\((\\w+)\\)\\+vec4\\(0\\.0,0\\.0,\\3\\[3]\\.z,0\\.0\\);"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/recipe/climbclaws.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "E E", 5 | "S S" 6 | ], 7 | "key": { 8 | "E": "minecraft:spider_eye", 9 | "S": "minecraft:shears" 10 | }, 11 | "result": { 12 | "id": "minecraft:shears", 13 | "count": 1, 14 | "components": { 15 | "minecraft:unbreakable": {}, 16 | "minecraft:custom_name": { 17 | "type": "translatable", 18 | "translate": "vivecraft.item.climbclaws", 19 | "fallback": "Climb Claws" 20 | }, 21 | "tooltip_display": { 22 | "hidden_components": [ 23 | "minecraft:unbreakable" 24 | ] 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/extensions/ClassDependentMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.extensions; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Mixins annotated with this class only apply if the 10 | * given Class is present. 11 | */ 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Target(ElementType.TYPE) 14 | public @interface ClassDependentMixin { 15 | /** 16 | * The classname of the class that should be present to 17 | * load the mixin annotated with this Interface. 18 | * 19 | * @return The String classname. 20 | */ 21 | String value(); 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/provider/ActionParams.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.provider; 2 | 3 | import org.vivecraft.client_vr.provider.openvr_lwjgl.control.VRInputActionSet; 4 | 5 | /** 6 | * holds the parameters for a VR action key 7 | * 8 | * @param requirement if the action is "optional", "suggested" or "mandatory" 9 | * @param type input type of the action. one of "boolean", "vector1, "vector2" or "vector3" 10 | * @param actionSetOverride action set to put it in, any of {@link VRInputActionSet} 11 | */ 12 | public record ActionParams(String requirement, String type, VRInputActionSet actionSetOverride) { 13 | public static final ActionParams DEFAULT = new ActionParams("optional", "boolean", null); 14 | } 15 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/utils/LangHelper.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.utils; 2 | 3 | import net.minecraft.client.resources.language.I18n; 4 | 5 | public class LangHelper { 6 | public static final String YES_KEY = "vivecraft.options.yes"; 7 | public static final String NO_KEY = "vivecraft.options.no"; 8 | public static final String ON_KEY = "options.on"; 9 | public static final String OFF_KEY = "options.off"; 10 | 11 | public static String get(String key, Object... params) { 12 | return I18n.get(key, params); 13 | } 14 | 15 | public static String getYes() { 16 | return I18n.get(YES_KEY); 17 | } 18 | 19 | public static String getNo() { 20 | return I18n.get(NO_KEY); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/extensions/MethodDependentMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.extensions; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Mixins annotated with this class only apply if the 10 | * given Method is present. 11 | */ 12 | @Retention(RetentionPolicy.RUNTIME) 13 | @Target(ElementType.TYPE) 14 | public @interface MethodDependentMixin { 15 | /** 16 | * The method name of the Method that should be present to 17 | * load the mixin annotated with this Interface. 18 | * 19 | * @return The String method name. 20 | */ 21 | String value(); 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/provider/nullvr/BodyPart.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.provider.nullvr; 2 | 3 | import org.vivecraft.client_vr.provider.MCVR; 4 | 5 | public enum BodyPart { 6 | HAND(MCVR.MAIN_CONTROLLER, MCVR.OFFHAND_CONTROLLER), 7 | FOOT(MCVR.RIGHT_FOOT_TRACKER, MCVR.LEFT_FOOT_TRACKER), 8 | ELBOW(MCVR.RIGHT_ELBOW_TRACKER, MCVR.LEFT_ELBOW_TRACKER), 9 | KNEE(MCVR.RIGHT_KNEE_TRACKER, MCVR.LEFT_KNEE_TRACKER), 10 | WAIST(MCVR.WAIST_TRACKER, -1), 11 | HEAD(NullVR.HEAD_TRACKER, -1); 12 | public final int rightIndex; 13 | public final int leftIndex; 14 | 15 | BodyPart(int rightIndex, int leftIndex) { 16 | this.rightIndex = rightIndex; 17 | this.leftIndex = leftIndex; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/minecraft/atlases/blocks.json: -------------------------------------------------------------------------------- 1 | { 2 | "sources": [ 3 | { 4 | "type": "directory", 5 | "source": "blocks", 6 | "prefix": "blocks/" 7 | }, 8 | { 9 | "type": "single", 10 | "resource": "vivecraft:black_hmd" 11 | }, 12 | { 13 | "type": "single", 14 | "resource": "vivecraft:gold_hmd" 15 | }, 16 | { 17 | "type": "single", 18 | "resource": "vivecraft:diamond_hmd" 19 | }, 20 | { 21 | "type": "single", 22 | "resource": "vivecraft:black" 23 | }, 24 | { 25 | "type": "single", 26 | "resource": "vivecraft:white" 27 | }, 28 | { 29 | "type": "single", 30 | "resource": "vivecraft:transparent" 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /forge/src/main/java/org/vivecraft/forge/mixin/network/ForgeOpenContainerVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.forge.mixin.network; 2 | 3 | import net.minecraftforge.network.packets.OpenContainer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | import org.vivecraft.client_vr.gameplay.screenhandlers.GuiHandler; 9 | 10 | @Mixin(OpenContainer.class) 11 | public class ForgeOpenContainerVRMixin { 12 | @Inject(method = "handle", at = @At("HEAD"), remap = false) 13 | private static void vivecraft$markScreenActiveForge(CallbackInfo ci) { 14 | GuiHandler.GUI_APPEAR_OVER_BLOCK_ACTIVE = true; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/player/LocalPlayer_PlayerVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.player; 2 | 3 | import net.minecraft.sounds.SoundSource; 4 | import net.minecraft.world.entity.player.Abilities; 5 | import net.minecraft.world.entity.player.Player; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | 9 | @Mixin(Player.class) 10 | public abstract class LocalPlayer_PlayerVRMixin extends LocalPlayer_LivingEntityVRMixin { 11 | 12 | @Shadow 13 | public abstract Abilities getAbilities(); 14 | 15 | @Shadow 16 | public abstract boolean isSwimming(); 17 | 18 | @Shadow 19 | protected abstract float getBlockSpeedFactor(); 20 | 21 | @Shadow 22 | public abstract SoundSource getSoundSource(); 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/sodium/extensions/ModelCuboidExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.sodium.extensions; 2 | 3 | public interface ModelCuboidExtension { 4 | 5 | /** 6 | * @return vertex overrides for this cuboid 7 | */ 8 | float[][] vivecraft$getOverrides(); 9 | 10 | /** 11 | * sets a vertex override, copies the vertex data from {@code overrideFaceIndex} to {@code sourceFaceIndex} 12 | * 13 | * @param overrideFaceIndex face index to copy from 14 | * @param sourceFaceIndex face index to copy to 15 | * @param source source texture data, first array contains 6 U coords, second array the 3 V coords 16 | */ 17 | void vivecraft$addOverrides(int overrideFaceIndex, int sourceFaceIndex, float[][] source); 18 | } 19 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/swords.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "#c:swords", 6 | "required": false 7 | }, 8 | { 9 | "id": "#forge:tools/swords", 10 | "required": false 11 | }, 12 | 13 | "#minecraft:swords", 14 | 15 | { 16 | "id": "tconstruct:dagger", 17 | "required": false 18 | }, 19 | { 20 | "id": "tconstruct:sword", 21 | "required": false 22 | }, 23 | { 24 | "id": "tconstruct:cleaver", 25 | "required": false 26 | }, 27 | { 28 | "id": "tetra:modular_sword", 29 | "required": false 30 | }, 31 | 32 | "#vivecraft:moditems/mvw_weapons", 33 | "#vivecraft:moditems/balkons_weaponsmod/weapons", 34 | "#vivecraft:maces" 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /neoforge/src/main/java/org/vivecraft/neoforge/event/ServerEvents.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.neoforge.event; 2 | 3 | import net.neoforged.api.distmarker.Dist; 4 | import net.neoforged.bus.api.SubscribeEvent; 5 | import net.neoforged.fml.common.EventBusSubscriber; 6 | import net.neoforged.neoforge.event.server.ServerStartingEvent; 7 | import org.vivecraft.neoforge.Vivecraft; 8 | import org.vivecraft.server.config.ServerConfig; 9 | 10 | @EventBusSubscriber(value = Dist.DEDICATED_SERVER, modid = Vivecraft.MODID) 11 | public class ServerEvents { 12 | @SubscribeEvent 13 | public static void loadServerConfig(ServerStartingEvent serverStartingEvent) { 14 | // on the server reinit the ServerConfig here again, after the lang files got loaded, to have comments 15 | ServerConfig.init(null); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /stubs/src/main/java/net/irisshaders/iris/gl/uniform/UniformHolder.java: -------------------------------------------------------------------------------- 1 | package net.irisshaders.iris.gl.uniform; 2 | 3 | import org.joml.Matrix4fc; 4 | import org.joml.Vector3f; 5 | 6 | import java.util.function.BooleanSupplier; 7 | import java.util.function.IntSupplier; 8 | import java.util.function.Supplier; 9 | 10 | public interface UniformHolder { 11 | 12 | UniformHolder uniform1i(UniformUpdateFrequency updateFrequency, String name, IntSupplier value); 13 | 14 | UniformHolder uniform1b(UniformUpdateFrequency updateFrequency, String name, BooleanSupplier value); 15 | 16 | UniformHolder uniform3f(UniformUpdateFrequency updateFrequency, String name, Supplier value); 17 | 18 | UniformHolder uniformMatrix(UniformUpdateFrequency updateFrequency, String name, Supplier value); 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/models/item/camera_display.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "ambientocclusion": false, 4 | "texture_size": [64, 64], 5 | "textures": { 6 | "1": "vivecraft:transparent", 7 | "particle": "vivecraft:transparent" 8 | }, 9 | "elements": [ 10 | { 11 | "from": [3.733, 1.6, 10], 12 | "to": [12.266, 6.4, 10.3], 13 | "rotation": { 14 | "angle": 0, 15 | "axis": "y", 16 | "origin": [14.2, 9.2, 20] 17 | }, 18 | "faces": { 19 | "south": { 20 | "uv": [0, 0, 16, 16], 21 | "texture": "#1" 22 | } 23 | } 24 | } 25 | ], 26 | "groups": [ 27 | { 28 | "name": "camera", 29 | "origin": [14, 9, 20], 30 | "children": [0] 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/recipe/jumpboots.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "minecraft:crafting_shaped", 3 | "pattern": [ 4 | "B", 5 | "S" 6 | ], 7 | "key": { 8 | "B": "minecraft:leather_boots", 9 | "S": "minecraft:slime_block" 10 | }, 11 | "result": { 12 | "id": "minecraft:leather_boots", 13 | "count": 1, 14 | "components": { 15 | "minecraft:unbreakable": {}, 16 | "minecraft:custom_name": { 17 | "type": "translatable", 18 | "translate": "vivecraft.item.jumpboots", 19 | "fallback": "Jump Boots" 20 | }, 21 | "minecraft:dyed_color": 9233775, 22 | "tooltip_display": { 23 | "hidden_components": [ 24 | "minecraft:unbreakable", 25 | "minecraft:dyed_color" 26 | ] 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/data/ViveBlockTags.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.data; 2 | 3 | import net.minecraft.core.registries.Registries; 4 | import net.minecraft.resources.ResourceLocation; 5 | import net.minecraft.tags.TagKey; 6 | import net.minecraft.world.level.block.Block; 7 | 8 | /** 9 | * holds Vivecrafts tags to identify Blocks 10 | */ 11 | public class ViveBlockTags { 12 | public static final TagKey VIVECRAFT_CLIMBABLE = tag("climbable"); 13 | 14 | public static final TagKey VIVECRAFT_CROPS = tag("crops"); 15 | 16 | public static final TagKey VIVECRAFT_MUSIC_BLOCKS = tag("music_blocks"); 17 | 18 | private static TagKey tag(String name) { 19 | return TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath("vivecraft", name)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/blaze3d/opengl/GlStateManagerVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.blaze3d.opengl; 2 | 3 | import com.mojang.blaze3d.opengl.GlStateManager; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.ModifyArg; 7 | 8 | @Mixin(value = GlStateManager.class, priority = 990) 9 | public class GlStateManagerVRMixin { 10 | 11 | // Change the limit of textures to 32, needed because we add additional samplers to fabulous 12 | @ModifyArg(method = "", at = @At(value = "INVOKE", target = "Ljava/util/stream/IntStream;range(II)Ljava/util/stream/IntStream;"), index = 1) 13 | private static int vivecraft$moreTextures(int endExclusive) { 14 | return 32; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/gameplay/trackers/DebugRenderTracker.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.gameplay.trackers; 2 | 3 | import net.minecraft.client.player.LocalPlayer; 4 | import org.vivecraft.api.client.Tracker; 5 | 6 | /** 7 | * Allows a Tracker to render visual debug information 8 | */ 9 | public interface DebugRenderTracker extends Tracker { 10 | /** 11 | * Renders debug elements to visualize the tracker's state. 12 | * Only called when the tracker is active and set to render debug elements in the debug settings. 13 | *
14 | * This is called every frame, so {@link ProcessType#PER_TICK} trackers should make sure that stuff is not {@code null}, since this could be called before {@link Tracker#activeProcess(LocalPlayer)} is called. 15 | */ 16 | void renderDebug(); 17 | } 18 | -------------------------------------------------------------------------------- /fabric/src/main/java/org/vivecraft/fabric/XeventsImpl.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.fabric; 2 | 3 | import com.mojang.blaze3d.vertex.PoseStack; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.world.entity.player.Player; 6 | import net.minecraft.world.level.block.state.BlockState; 7 | import org.vivecraft.Xevents; 8 | 9 | public class XeventsImpl implements Xevents { 10 | 11 | public static boolean renderBlockOverlay( 12 | Player player, PoseStack poseStack, BlockState blockState, BlockPos blockPos) 13 | { 14 | return false; 15 | } 16 | 17 | public static boolean renderWaterOverlay(Player player, PoseStack poseStack) { 18 | return false; 19 | } 20 | 21 | public static boolean renderFireOverlay(Player player, PoseStack poseStack) { 22 | return false; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /fabric/src/main/java/org/vivecraft/fabric/mixin/screenhandler/client/FabricClientNetworkingVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.fabric.mixin.screenhandler.client; 2 | 3 | import net.fabricmc.fabric.impl.screenhandler.client.ClientNetworking; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | import org.vivecraft.client_vr.gameplay.screenhandlers.GuiHandler; 9 | 10 | @Mixin(ClientNetworking.class) 11 | public class FabricClientNetworkingVRMixin { 12 | @Inject(method = "openScreen", at = @At("HEAD"), remap = false) 13 | private void vivecraft$markScreenActiveFabric(CallbackInfo ci) { 14 | GuiHandler.GUI_APPEAR_OVER_BLOCK_ACTIVE = true; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/shaders/patches/EbinProjPatch.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.shaders.patches; 2 | 3 | /** 4 | * patches 5 | * return (diagonal2(gbufferProjection) * viewSpacePosition.xy + gbufferProjection[3].xy) / -viewSpacePosition.z * 0.5 + 0.5; 6 | */ 7 | public class EbinProjPatch extends Patch { 8 | public EbinProjPatch() { 9 | super(""" 10 | return (diagonal2(gbufferProjection) * viewSpacePosition.xy + gbufferProjection[3].xy) / -viewSpacePosition.z * 0.5 + 0.5; 11 | """, """ 12 | vec4 vivecraft_pos = $2 * vec4($3, 1.0); 13 | return (vivecraft_pos.xy / vivecraft_pos.w) * 0.5 + 0.5;""", 14 | "return\\s+\\((diagonal2|diag2)\\((\\w+)\\)\\*(\\w+)\\.xy\\+\\2\\[3]\\.xy\\)/-\\3\\.z\\*0\\.5\\+0\\.5;"); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/renderer/item/BlockModelWrapperVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.renderer.item; 2 | 3 | import net.minecraft.client.renderer.item.BlockModelWrapper; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Unique; 6 | import org.vivecraft.client_vr.extensions.BlockModelWrapperExtension; 7 | 8 | @Mixin(BlockModelWrapper.class) 9 | public class BlockModelWrapperVRMixin implements BlockModelWrapperExtension { 10 | 11 | @Unique 12 | private boolean vivecraft$generated; 13 | 14 | @Override 15 | public void vivecraft$setGenerated(boolean generated) { 16 | this.vivecraft$generated = generated; 17 | } 18 | 19 | @Override 20 | public boolean vivecraft$isGenerated() { 21 | return this.vivecraft$generated; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/shaders/patches/EbinProjInvPatch.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.shaders.patches; 2 | 3 | /** 4 | * patches 5 | * return projMAD(gbufferProjectionInverse, screenPos) / (screenPos.z * gbufferProjectionInverse[2].w + gbufferProjectionInverse[3].w); 6 | */ 7 | public class EbinProjInvPatch extends Patch { 8 | public EbinProjInvPatch() { 9 | super( 10 | """ 11 | return projMAD(gbufferProjectionInverse, screenPos) / (screenPos.z * gbufferProjectionInverse[2].w + gbufferProjectionInverse[3].w); 12 | """, """ 13 | vec4 vivecraft_$3 = $2 * vec4($3, 1.0); 14 | return vivecraft_$3.xyz / vivecraft_$3.w;""", 15 | "return\\s+(\\w+)\\((\\w+),(\\w+)\\)/\\(\\3\\.z\\*\\2\\[2]\\.w\\+\\2\\[3]\\.w\\);"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_xr/render_pass/RenderPassType.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_xr.render_pass; 2 | 3 | public enum RenderPassType { 4 | VANILLA, 5 | GUI_ONLY, 6 | WORLD_ONLY; 7 | 8 | /** 9 | * @return if the active pass is the vanilla pass 10 | */ 11 | public static boolean isVanilla() { 12 | return RenderPassManager.RENDER_PASS_TYPE == VANILLA; 13 | } 14 | 15 | /** 16 | * @return if the active pass is the GUI pass 17 | */ 18 | public static boolean isGuiOnly() { 19 | return RenderPassManager.RENDER_PASS_TYPE == GUI_ONLY; 20 | } 21 | 22 | /** 23 | * @return if the active pass is a custom world rendering pass 24 | */ 25 | public static boolean isWorldOnly() { 26 | return RenderPassManager.RENDER_PASS_TYPE == WORLD_ONLY; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/ClientBrandRetrieverVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr; 2 | 3 | import net.minecraft.client.ClientBrandRetriever; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 8 | import org.vivecraft.client_vr.VRState; 9 | 10 | @Mixin(ClientBrandRetriever.class) 11 | public class ClientBrandRetrieverVRMixin { 12 | @Inject(method = "getClientModName", at = @At("RETURN"), remap = false, cancellable = true) 13 | private static void vivecraft$vivecraftClientBrand(CallbackInfoReturnable cir) { 14 | if (VRState.VR_ENABLED) { 15 | cir.setReturnValue("vivecraft"); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/extensions/EntityRenderDispatcherExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.extensions; 2 | 3 | import net.minecraft.world.entity.player.PlayerModelType; 4 | import org.vivecraft.client.render.VRPlayerRenderer; 5 | 6 | import java.util.Map; 7 | 8 | public interface EntityRenderDispatcherExtension { 9 | /** 10 | * @return map of VR player renderers with the vanilla model 11 | */ 12 | Map vivecraft$getSkinMapVRVanilla(); 13 | 14 | /** 15 | * @return map of VR player renderers with split arms 16 | */ 17 | Map vivecraft$getSkinMapVRArms(); 18 | 19 | /** 20 | * @return map of VR player renderers with split arms and legs 21 | */ 22 | Map vivecraft$getSkinMapVRLegs(); 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/gui/keyboard/EasterEggTheme.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.gui.keyboard; 2 | 3 | import org.vivecraft.client.utils.ClientUtils; 4 | import org.vivecraft.client_vr.ClientDataHolderVR; 5 | import org.vivecraft.client_vr.utils.RGBAColor; 6 | 7 | public class EasterEggTheme implements KeyboardTheme.PositionTheme { 8 | 9 | public static final EasterEggTheme INSTANCE = new EasterEggTheme(); 10 | 11 | @Override 12 | public void updateColor(RGBAColor color, int keyX, int keyY) { 13 | // https://qimg.techjargaming.com/i/UkG1cWAh.png 14 | color.setRGB(RGBAColor.fromHSB( 15 | (ClientDataHolderVR.getInstance().tickCounter + ClientUtils.getCurrentPartialTick()) / 100.0F + 16 | keyX / (KeyboardKeys.COLUMNS * 3F), 17 | 1.0F, 18 | 1.0F)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/blaze3d/systems/RenderSystemVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.blaze3d.systems; 2 | 3 | import com.mojang.blaze3d.systems.RenderSystem; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | import org.vivecraft.client_vr.VRState; 9 | import org.vivecraft.client_vr.provider.MCVR; 10 | 11 | @Mixin(RenderSystem.class) 12 | public class RenderSystemVRMixin { 13 | @Inject(method = "limitDisplayFPS", at = @At("HEAD"), cancellable = true, remap = false) 14 | private static void vivecraft$noFPSlimit(CallbackInfo ci) { 15 | if (VRState.VR_RUNNING && !MCVR.get().capFPS()) { 16 | ci.cancel(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/renderer/GameRendererAccessor.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.renderer; 2 | 3 | import net.minecraft.client.gui.render.GuiRenderer; 4 | import net.minecraft.client.gui.render.state.GuiRenderState; 5 | import net.minecraft.client.renderer.GameRenderer; 6 | import net.minecraft.client.renderer.ScreenEffectRenderer; 7 | import net.minecraft.client.renderer.fog.FogRenderer; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.gen.Accessor; 10 | 11 | @Mixin(GameRenderer.class) 12 | public interface GameRendererAccessor { 13 | @Accessor 14 | FogRenderer getFogRenderer(); 15 | 16 | @Accessor 17 | ScreenEffectRenderer getScreenEffectRenderer(); 18 | 19 | @Accessor 20 | GuiRenderState getGuiRenderState(); 21 | 22 | @Accessor 23 | GuiRenderer getGuiRenderer(); 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client/renderer/entity/layers/RenderLayerMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client.renderer.entity.layers; 2 | 3 | import net.minecraft.client.model.EntityModel; 4 | import net.minecraft.client.renderer.entity.layers.RenderLayer; 5 | import net.minecraft.client.renderer.entity.state.EntityRenderState; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.vivecraft.client.extensions.RenderLayerExtension; 8 | 9 | /** 10 | * part of the hacky way, to copy RenderLayers from the regular PlayerRenderer, to the VRPlayerRenderer 11 | */ 12 | 13 | @Mixin(RenderLayer.class) 14 | public class RenderLayerMixin> implements Cloneable, RenderLayerExtension { 15 | @Override 16 | public Object clone() throws CloneNotSupportedException { 17 | return super.clone(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/shaders/patches/SuperDuperMadPatch.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.shaders.patches; 2 | 3 | /** 4 | * patches 5 | * gl_Position.xyz = getMatScale(mat3(gl_ProjectionMatrix)) * vertexViewPos; 6 | * gl_Position.z += gl_ProjectionMatrix[3].z; 7 | * gl_Position.w = -vertexViewPos.z; 8 | */ 9 | public class SuperDuperMadPatch extends Patch { 10 | public SuperDuperMadPatch() { 11 | super( 12 | """ 13 | gl_Position.xyz = getMatScale(mat3(gl_ProjectionMatrix)) * vertexViewPos; 14 | gl_Position.z += gl_ProjectionMatrix[3].z; 15 | gl_Position.w = -vertexViewPos.z; 16 | """, """ 17 | $1 = $3 * vec4($4, 1.0);""", 18 | "(\\w+)\\.xyz=(\\w+)\\(mat3\\((\\w+)\\)\\)\\*(\\w+);\\1\\.z\\+=\\3\\[3]\\.z;\\1\\.w=-\\4\\.z;"); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/shaders/patches/SuperDuperProj2Patch.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.shaders.patches; 2 | 3 | /** 4 | * patches 5 | * vec2 clipCoord = vec2(projection[0].x, projection[1].y) * viewPos.xy; 6 | * return 0.5 - (clipCoord.xy / viewPos.z) * 0.5; 7 | */ 8 | public class SuperDuperProj2Patch extends Patch { 9 | public SuperDuperProj2Patch() { 10 | super( 11 | """ 12 | vec2 clipCoord = vec2(projection[0].x, projection[1].y) * viewPos.xy; 13 | return 0.5 - (clipCoord.xy / viewPos.z) * 0.5; 14 | """, """ 15 | vec4 $1 = $2 * vec4($3, 1); 16 | return ($1.xy / $1.w) * 0.5 + 0.5;""", 17 | "vec2\\s+(\\w+)=vec2\\((\\w+)\\[0]\\.x,\\2\\[1]\\.y\\)\\*(\\w+)\\.xy;return\\s+0\\.5-\\(\\1\\.xy/\\3\\.z\\)(\\*0\\.5|/2\\.0);"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/server/api_impl/VRServerAPIImpl.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.server.api_impl; 2 | 3 | import net.minecraft.server.level.ServerPlayer; 4 | import org.vivecraft.api.data.VRBodyPart; 5 | import org.vivecraft.api.server.VRServerAPI; 6 | import org.vivecraft.common.api_impl.VRAPIImpl; 7 | import org.vivecraft.server.ServerNetworking; 8 | 9 | public class VRServerAPIImpl implements VRServerAPI { 10 | 11 | public static final VRServerAPIImpl INSTANCE = new VRServerAPIImpl(); 12 | 13 | @Override 14 | public void sendHapticPulse( 15 | ServerPlayer player, VRBodyPart bodyPart, float duration, float frequency, float amplitude, float delay) 16 | { 17 | if (VRAPIImpl.INSTANCE.isVRPlayer(player)) { 18 | ServerNetworking.sendHapticToClient(player, bodyPart, duration, frequency, amplitude, delay); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/models/item/camcorder_display.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench", 3 | "texture_size": [64, 64], 4 | "textures": { 5 | "1": "vivecraft:transparent", 6 | "particle": "vivecraft:transparent" 7 | }, 8 | "elements": [ 9 | { 10 | "from": [0.2, 4.5, 6], 11 | "to": [9.2, 9.5, 7], 12 | "rotation": { 13 | "angle": 0, 14 | "axis": "y", 15 | "origin": [8.25, 12.5, 14] 16 | }, 17 | "faces": { 18 | "north": { 19 | "uv": [0, 0, 16, 16], 20 | "texture": "#1" 21 | }, 22 | "south": { 23 | "uv": [0, 0, 16, 16], 24 | "texture": "#1" 25 | } 26 | } 27 | } 28 | ], 29 | "groups": [ 30 | { 31 | "name": "group", 32 | "origin": [21, 13, 12], 33 | "children": [0] 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/api/client/data/OpenKeyboardContext.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.api.client.data; 2 | 3 | /** 4 | * Determines how strict the opening of the VR keyboard should be 5 | */ 6 | public enum OpenKeyboardContext { 7 | /** 8 | * Will open the keyboard no matter the situation. 9 | * 10 | * @since 1.3.0 11 | */ 12 | FORCE, 13 | /** 14 | * Only opens the keyboard if the user has configured to open the keyboard when a text box becomes focused. 15 | * 16 | * @since 1.3.0 17 | */ 18 | FOCUS, 19 | /** 20 | * Only opens the keyboard if the user has configured to open the keyboard when a text box or chat becomes focused. 21 | * Same as {@link #FOCUS}, but also works if the user only has chat configured to automatically open the keyboard. 22 | * 23 | * @since 1.3.0 24 | */ 25 | FOCUS_CHAT 26 | } 27 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client/blaze3d/BufferBuilderMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client.blaze3d; 2 | 3 | import com.mojang.blaze3d.vertex.BufferBuilder; 4 | import com.mojang.blaze3d.vertex.ByteBufferBuilder; 5 | import org.spongepowered.asm.mixin.Final; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.vivecraft.client.extensions.BufferBuilderExtension; 9 | 10 | @Mixin(BufferBuilder.class) 11 | public class BufferBuilderMixin implements BufferBuilderExtension { 12 | @Final 13 | @Shadow 14 | private ByteBufferBuilder buffer; 15 | 16 | @Override 17 | public void vivecraft$freeBuffer() { 18 | this.buffer.close(); 19 | } 20 | 21 | @Override 22 | public long vivecraft$getBufferSize() { 23 | return ((ByteBufferBuilderAccessor) this.buffer).getCapacity(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client/multiplayer/ClientLevelMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client.multiplayer; 2 | 3 | import net.minecraft.client.multiplayer.ClientLevel; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | import org.vivecraft.client_vr.ClientDataHolderVR; 9 | import org.vivecraft.common.api_impl.VRAPIImpl; 10 | 11 | @Mixin(ClientLevel.class) 12 | public class ClientLevelMixin { 13 | @Inject(method = "disconnect", at = @At("HEAD")) 14 | private void vivecraft$allowVivecraft(CallbackInfo ci) { 15 | // re allow VR on disconnect 16 | ClientDataHolderVR.getInstance().completelyDisabled = false; 17 | VRAPIImpl.INSTANCE.clearAllPoseHistories(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/immersiveportals/ImmersivePortalsHelper.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.immersiveportals; 2 | 3 | import org.vivecraft.Xloader; 4 | import qouteall.imm_ptl.core.IPGlobal; 5 | import qouteall.imm_ptl.core.render.context_management.PortalRendering; 6 | 7 | public class ImmersivePortalsHelper { 8 | 9 | public static boolean isLoaded() { 10 | return Xloader.isModLoaded("immersive_portals"); 11 | } 12 | 13 | /** 14 | * @return if the renderpass is for a portal 15 | */ 16 | public static boolean isRenderingPortal() { 17 | return PortalRendering.isRendering(); 18 | } 19 | 20 | /** 21 | * @return if the player should be rendered in a portal 22 | */ 23 | public static boolean shouldRenderSelf() { 24 | return IPGlobal.renderYourselfInPortal && isRenderingPortal(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /fabric/src/main/java/org/vivecraft/fabric/client/ClientEvents.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.fabric.client; 2 | 3 | import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; 4 | import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; 5 | import net.minecraft.client.Minecraft; 6 | import org.vivecraft.client.gui.settings.VivecraftMainSettings; 7 | 8 | public class ClientEvents { 9 | public static void registerClientCommands() { 10 | ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> dispatcher.register( 11 | ClientCommandManager.literal("vivecraft-client-config").executes(context -> { 12 | Minecraft mc = context.getSource().getClient(); 13 | mc.schedule(() -> mc.setScreen(new VivecraftMainSettings(mc.screen))); 14 | return 1; 15 | }))); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/c2s/DrawPayloadC2S.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.c2s; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.packet.PayloadIdentifier; 5 | 6 | /** 7 | * holds the clients current bow draw percent 8 | * 9 | * @param draw how far the player has pulled the bow 10 | */ 11 | public record DrawPayloadC2S(float draw) implements VivecraftPayloadC2S { 12 | 13 | @Override 14 | public PayloadIdentifier payloadId() { 15 | return PayloadIdentifier.DRAW; 16 | } 17 | 18 | @Override 19 | public void write(FriendlyByteBuf buffer) { 20 | buffer.writeByte(payloadId().ordinal()); 21 | buffer.writeFloat(this.draw); 22 | } 23 | 24 | public static DrawPayloadC2S read(FriendlyByteBuf buffer) { 25 | return new DrawPayloadC2S(buffer.readFloat()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/cataclysm/mixin/ClientEventMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.cataclysm.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Pseudo; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Pseudo 11 | @Mixin(targets = "com.github.L_Ender.cataclysm.client.event.ClientEvent") 12 | public class ClientEventMixin { 13 | /** 14 | * menuworld fix 15 | */ 16 | @Inject(method = "onGetFluidRenderType", at = @At("HEAD"), remap = false, cancellable = true) 17 | private void vivecraft$fixNoPlayer(CallbackInfo ci) { 18 | if (Minecraft.getInstance().player == null) { 19 | ci.cancel(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /neoforge/src/main/java/org/vivecraft/neoforge/mixin/network/NeoForgeOpenContainerVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.neoforge.mixin.network; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.injection.At; 5 | import org.spongepowered.asm.mixin.injection.Inject; 6 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 7 | import org.vivecraft.client_vr.gameplay.screenhandlers.GuiHandler; 8 | 9 | @Mixin(targets = "net.neoforged.neoforge.client.network.ClientPayloadHandler") 10 | public class NeoForgeOpenContainerVRMixin { 11 | @Inject(method = "handle(Lnet/neoforged/neoforge/network/payload/AdvancedOpenScreenPayload;Lnet/neoforged/neoforge/network/handling/IPayloadContext;)V", at = @At("HEAD"), remap = false) 12 | private static void vivecraft$markScreenActiveNeoForge(CallbackInfo ci) { 13 | GuiHandler.GUI_APPEAR_OVER_BLOCK_ACTIVE = true; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/renderer/CubeMapVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.renderer; 2 | 3 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; 4 | import com.mojang.blaze3d.pipeline.RenderPipeline; 5 | import net.minecraft.client.renderer.CubeMap; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.vivecraft.client_vr.VRState; 9 | import org.vivecraft.client_vr.render.VRShaders; 10 | 11 | @Mixin(CubeMap.class) 12 | public class CubeMapVRMixin { 13 | @ModifyExpressionValue(method = "render", at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/RenderPipelines;PANORAMA:Lcom/mojang/blaze3d/pipeline/RenderPipeline;")) 14 | private RenderPipeline vivecraft$solidPipeline(RenderPipeline instance) { 15 | return VRState.VR_RUNNING ? VRShaders.SOLID_PANORAMA : instance; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/alexmobs/mixin/ClientEventsMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.alexmobs.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Pseudo; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Pseudo 11 | @Mixin(targets = "com.github.alexthe666.alexsmobs.client.event.ClientEvents") 12 | public class ClientEventsMixin { 13 | /** 14 | * menuworld fix 15 | */ 16 | @Inject(method = "onGetFluidRenderType", at = @At("HEAD"), remap = false, cancellable = true) 17 | private void vivecraft$fixNoPlayer(CallbackInfo ci) { 18 | if (Minecraft.getInstance().player == null) { 19 | ci.cancel(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/c2s/HeightPayloadC2S.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.c2s; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.packet.PayloadIdentifier; 5 | 6 | /** 7 | * holds the clients height scale 8 | * 9 | * @param heightScale players calibrated height scale 10 | */ 11 | public record HeightPayloadC2S(float heightScale) implements VivecraftPayloadC2S { 12 | 13 | @Override 14 | public PayloadIdentifier payloadId() { 15 | return PayloadIdentifier.HEIGHT; 16 | } 17 | 18 | @Override 19 | public void write(FriendlyByteBuf buffer) { 20 | buffer.writeByte(payloadId().ordinal()); 21 | buffer.writeFloat(this.heightScale); 22 | } 23 | 24 | public static HeightPayloadC2S read(FriendlyByteBuf buffer) { 25 | return new HeightPayloadC2S(buffer.readFloat()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/s2c/VersionPayloadS2C.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.s2c; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.packet.PayloadIdentifier; 5 | 6 | /** 7 | * packet that holds the Vivecraft server version 8 | * 9 | * @param version Version String of the server 10 | */ 11 | public record VersionPayloadS2C(String version) implements VivecraftPayloadS2C { 12 | 13 | @Override 14 | public PayloadIdentifier payloadId() { 15 | return PayloadIdentifier.VERSION; 16 | } 17 | 18 | @Override 19 | public void write(FriendlyByteBuf buffer) { 20 | buffer.writeByte(payloadId().ordinal()); 21 | buffer.writeUtf(this.version); 22 | } 23 | 24 | public static VersionPayloadS2C read(FriendlyByteBuf buffer) { 25 | return new VersionPayloadS2C(buffer.readUtf()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/provider/HapticScheduler.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.provider; 2 | 3 | import java.util.concurrent.Executors; 4 | import java.util.concurrent.ScheduledExecutorService; 5 | 6 | public abstract class HapticScheduler { 7 | protected ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); 8 | 9 | /** 10 | * schedules a haptic pulse on the give controller at the given delay 11 | * 12 | * @param controller controller to trigger on 13 | * @param durationSeconds duration in seconds 14 | * @param frequency frequency in Hz 15 | * @param amplitude strength 0.0 - 1.0 16 | * @param delaySeconds delay for when to trigger in seconds 17 | */ 18 | public abstract void queueHapticPulse( 19 | ControllerType controller, float durationSeconds, float frequency, float amplitude, float delaySeconds); 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/c2s/VRActivePayloadC2S.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.c2s; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.packet.PayloadIdentifier; 5 | 6 | /** 7 | * holds weather the client is in VR or NONVR mode 8 | * 9 | * @param vr if the client is actively in VR 10 | */ 11 | public record VRActivePayloadC2S(boolean vr) implements VivecraftPayloadC2S { 12 | 13 | @Override 14 | public PayloadIdentifier payloadId() { 15 | return PayloadIdentifier.IS_VR_ACTIVE; 16 | } 17 | 18 | @Override 19 | public void write(FriendlyByteBuf buffer) { 20 | buffer.writeByte(payloadId().ordinal()); 21 | buffer.writeBoolean(this.vr); 22 | } 23 | 24 | public static VRActivePayloadC2S read(FriendlyByteBuf buffer) { 25 | return new VRActivePayloadC2S(buffer.readBoolean()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/c2s/WorldScalePayloadC2S.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.c2s; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.packet.PayloadIdentifier; 5 | 6 | /** 7 | * holds the clients world scale 8 | * 9 | * @param worldScale world scale set by the player 10 | */ 11 | public record WorldScalePayloadC2S(float worldScale) implements VivecraftPayloadC2S { 12 | 13 | @Override 14 | public PayloadIdentifier payloadId() { 15 | return PayloadIdentifier.WORLDSCALE; 16 | } 17 | 18 | @Override 19 | public void write(FriendlyByteBuf buffer) { 20 | buffer.writeByte(payloadId().ordinal()); 21 | buffer.writeFloat(this.worldScale); 22 | } 23 | 24 | public static WorldScalePayloadC2S read(FriendlyByteBuf buffer) { 25 | return new WorldScalePayloadC2S(buffer.readFloat()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/iris/extensions/PipelineManagerExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.iris.extensions; 2 | 3 | import org.vivecraft.api.client.data.RenderPass; 4 | 5 | public interface PipelineManagerExtension { 6 | 7 | /** 8 | * @return the actually used ShadowRenderTarget 9 | */ 10 | Object vivecraft$getShadowRenderTargets(); 11 | 12 | /** 13 | * sets the actually used ShadowRenderTarget 14 | * 15 | * @param targets ShadowRenderTarget to set 16 | */ 17 | void vivecraft$setShadowRenderTargets(Object targets); 18 | 19 | /** 20 | * needed for sodium terrain shaders, to get all pipelines, and not just the one from the current pass 21 | */ 22 | Object vivecraft$getVRPipeline(RenderPass pass); 23 | 24 | /** 25 | * @return the pipeline used for the vanilla pass 26 | */ 27 | Object vivecraft$getVanillaPipeline(); 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/CommonDataHolder.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common; 2 | 3 | import org.vivecraft.Xloader; 4 | 5 | public class CommonDataHolder { 6 | 7 | private static CommonDataHolder INSTANCE = new CommonDataHolder(); 8 | public final String versionIdentifier; 9 | 10 | public CommonDataHolder() { 11 | // to prevent race conditions 12 | INSTANCE = this; 13 | 14 | String mcVersion = ""; 15 | String modVersion = ""; 16 | if (Xloader.isModLoadedSuccess()) { 17 | String[] version = Xloader.getModVersion().split("-", 2); 18 | mcVersion = version[0]; 19 | modVersion = version[1]; 20 | } 21 | 22 | this.versionIdentifier = "Vivecraft-" + mcVersion + "-" + Xloader.getModloader().name + "-" + modVersion; 23 | } 24 | 25 | public static CommonDataHolder getInstance() { 26 | return INSTANCE; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/c2s/CrawlPayloadC2S.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.c2s; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.packet.PayloadIdentifier; 5 | 6 | /** 7 | * holds if the client started or stopped crawling 8 | * 9 | * @param crawling if the player started or stopped crawling 10 | */ 11 | public record CrawlPayloadC2S(boolean crawling) implements VivecraftPayloadC2S { 12 | 13 | @Override 14 | public PayloadIdentifier payloadId() { 15 | return PayloadIdentifier.CRAWL; 16 | } 17 | 18 | @Override 19 | public void write(FriendlyByteBuf buffer) { 20 | buffer.writeByte(payloadId().ordinal()); 21 | buffer.writeBoolean(this.crawling); 22 | } 23 | 24 | public static CrawlPayloadC2S read(FriendlyByteBuf buffer) { 25 | return new CrawlPayloadC2S(buffer.readBoolean()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/server/players/PlayerListMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.server.players; 2 | 3 | import com.llamalad7.mixinextras.sugar.Local; 4 | import net.minecraft.server.level.ServerPlayer; 5 | import net.minecraft.server.players.PlayerList; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | import org.vivecraft.server.ServerUtil; 11 | 12 | @Mixin(PlayerList.class) 13 | public class PlayerListMixin { 14 | 15 | @Inject(method = "placeNewPlayer", at = @At("HEAD")) 16 | private void vivecraft$scheduleLoginMessages(CallbackInfo ci, @Local(argsOnly = true) ServerPlayer serverPlayer) { 17 | ServerUtil.scheduleWelcomeMessageOrKick(serverPlayer); 18 | ServerUtil.sendUpdateNotificationIfOP(serverPlayer); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/TrackerPose.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.joml.Vector3fc; 5 | 6 | /** 7 | * holds a tracker device Pose 8 | * 9 | * @param position position of the device in player local space 10 | */ 11 | public record TrackerPose(Vector3fc position) { 12 | 13 | /** 14 | * @param buffer buffer to read from 15 | * @return a Pose read from the given {@code buffer} 16 | */ 17 | public static TrackerPose deserialize(FriendlyByteBuf buffer) { 18 | return new TrackerPose(CommonNetworkHelper.deserializeFVec3(buffer)); 19 | } 20 | 21 | /** 22 | * writes this Pose to the given {@code buffer} 23 | * 24 | * @param buffer buffer to write to 25 | */ 26 | public void serialize(FriendlyByteBuf buffer) { 27 | CommonNetworkHelper.serializeF(buffer, this.position); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/blur/mixin/BlurMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.blur.mixin; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.Pseudo; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 8 | import org.vivecraft.client_vr.VRState; 9 | 10 | @Pseudo 11 | @Mixin(targets = { 12 | "com.tterrag.blur.Blur", 13 | "de.cheaterpaul.blur.BlurClient" 14 | }) 15 | public class BlurMixin { 16 | /** 17 | * removes any menu blur in vr 18 | */ 19 | @Inject(method = "getProgress", at = @At("HEAD"), cancellable = true, remap = false) 20 | private static void vivecraft$noBlurInVR(CallbackInfoReturnable cir) { 21 | if (VRState.VR_RUNNING) { 22 | cir.setReturnValue(0.0F); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/s2c/DualWieldingPayloadS2C.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.s2c; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.packet.PayloadIdentifier; 5 | 6 | /** 7 | * indicates that the server supports dual wielding 8 | * 9 | * @param allowed if dual wielding is allowed 10 | */ 11 | public record DualWieldingPayloadS2C(boolean allowed) implements VivecraftPayloadS2C { 12 | 13 | @Override 14 | public PayloadIdentifier payloadId() { 15 | return PayloadIdentifier.DUAL_WIELDING; 16 | } 17 | 18 | @Override 19 | public void write(FriendlyByteBuf buffer) { 20 | buffer.writeByte(payloadId().ordinal()); 21 | buffer.writeBoolean(this.allowed); 22 | } 23 | 24 | public static DualWieldingPayloadS2C read(FriendlyByteBuf buffer) { 25 | return new DualWieldingPayloadS2C(buffer.readBoolean()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/iris/extensions/IrisChunkProgramOverridesExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.iris.extensions; 2 | 3 | import java.lang.reflect.InvocationTargetException; 4 | import java.lang.reflect.Method; 5 | 6 | public interface IrisChunkProgramOverridesExtension { 7 | 8 | /** 9 | * creates the sodium pipeline for each RenderPass 10 | * this is done this way, to try to avoid having to have a mixin for each sodium version 11 | * 12 | * @param sodiumTerrainPipeline original sodium pipeline that was provided 13 | * @param chunkVertexType original chunkVertexType 14 | * @param createShaders reflection Method to call to create the shader 15 | */ 16 | void vivecraft$createAllPipelinesShadersSodiumProcessing( 17 | Object sodiumTerrainPipeline, Object chunkVertexType, 18 | Method createShaders) throws InvocationTargetException, IllegalAccessException; 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/s2c/VRSwitchingPayloadS2C.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.s2c; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.packet.PayloadIdentifier; 5 | 6 | /** 7 | * packet that holds if the server allows switching between VR and NONVR 8 | * 9 | * @param allowed if hot switching is allowed 10 | */ 11 | public record VRSwitchingPayloadS2C(boolean allowed) implements VivecraftPayloadS2C { 12 | 13 | @Override 14 | public PayloadIdentifier payloadId() { 15 | return PayloadIdentifier.VR_SWITCHING; 16 | } 17 | 18 | @Override 19 | public void write(FriendlyByteBuf buffer) { 20 | buffer.writeByte(payloadId().ordinal()); 21 | buffer.writeBoolean(this.allowed); 22 | } 23 | 24 | public static VRSwitchingPayloadS2C read(FriendlyByteBuf buffer) { 25 | return new VRSwitchingPayloadS2C(buffer.readBoolean()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/api/client/ItemInUseTracker.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.api.client; 2 | 3 | import net.minecraft.client.player.LocalPlayer; 4 | 5 | /** 6 | * A type of {@link Tracker} which can prevent the vanilla use key from being released, with {@link #itemInUse(LocalPlayer)}. 7 | * 8 | * @since 1.3.0 9 | */ 10 | public interface ItemInUseTracker extends Tracker { 11 | 12 | /** 13 | * Called for the client player, to check if this tracker is currently causing the item to be used to not release 14 | * the use key. In other words, if you want the item currently being held to act as the use key being held, one 15 | * should call the use item function, then return true from this method while the item should still remain used. 16 | * 17 | * @param player The local player which is running this tracker. 18 | * @return Whether the item should remain in use. 19 | * @since 1.3.0 20 | */ 21 | boolean itemInUse(LocalPlayer player); 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/blaze3d/platform/InputConstantsVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.blaze3d.platform; 2 | 3 | import com.mojang.blaze3d.platform.InputConstants; 4 | import com.mojang.blaze3d.platform.Window; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | import org.vivecraft.client_vr.VRState; 10 | import org.vivecraft.client_vr.provider.InputSimulator; 11 | 12 | @Mixin(InputConstants.class) 13 | public class InputConstantsVRMixin { 14 | 15 | @Inject(method = "isKeyDown", at = @At("TAIL"), cancellable = true) 16 | private static void vivecraft$inputSimulatorDown(Window window, int key, CallbackInfoReturnable cir) { 17 | cir.setReturnValue(cir.getReturnValueZ() || (VRState.VR_RUNNING && InputSimulator.isKeyDown(key))); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/modmenu/ModMenuHelper.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.modmenu; 2 | 3 | import java.lang.reflect.Method; 4 | 5 | public class ModMenuHelper { 6 | 7 | /** 8 | * @return if modmenu replaces the bugs button 9 | */ 10 | public static boolean shouldOffsetButtons() { 11 | try { 12 | Class modMenuConfig = Class.forName("com.terraformersmc.modmenu.config.ModMenuConfig"); 13 | Class enumConfig = Class.forName("com.terraformersmc.modmenu.config.option.EnumConfigOption"); 14 | Method value = enumConfig.getDeclaredMethod("getValue"); 15 | 16 | Object style = modMenuConfig.getDeclaredField("GAME_MENU_BUTTON_STYLE").get(null); 17 | 18 | // check for enum name, previously that was REPLACE_BUGS 19 | return value.invoke(style).toString().equals("REPLACE"); 20 | } catch (Exception e) { 21 | return false; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/shaders/patches/RreProjInvPatch.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.shaders.patches; 2 | 3 | /** 4 | * patches 5 | * vec3 viewpos = vec3(vec2(projInv[0].x, projInv[1].y)*screenpos.xy + projInv[3].xy, projInv[3].z); 6 | * viewpos /= projInv[2].w*screenpos.z + projInv[3].w; 7 | */ 8 | public class RreProjInvPatch extends Patch { 9 | public RreProjInvPatch() { 10 | super( 11 | """ 12 | vec3 viewpos = vec3(vec2(projInv[0].x, projInv[1].y)*screenpos.xy + projInv[3].xy, projInv[3].z); 13 | viewpos /= projInv[2].w*screenpos.z + projInv[3].w; 14 | """, """ 15 | vec4 vivecraft_$1 = $2 * vec4($3.xyz, 1.0); 16 | vec3 $1 = vivecraft_$1.xyz / vivecraft_$1.w;""", 17 | "vec3(\\w+)=vec3\\(vec2\\((\\w+)\\[0]\\.x,\\2\\[1]\\.y\\)\\*(\\w+)\\.xy\\+\\2\\[3]\\.xy,\\2\\[3]\\.z\\);\\1/=\\2\\[2]\\.w\\*\\3\\.z\\+\\2\\[3]\\.w;"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/s2c/AttackWhileBlockingPayloadS2C.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.s2c; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.packet.PayloadIdentifier; 5 | 6 | /** 7 | * indicates that the server allows attacks while blocking 8 | * 9 | * @param allowed if attacks while blocking are allowed 10 | */ 11 | public record AttackWhileBlockingPayloadS2C(boolean allowed) implements VivecraftPayloadS2C { 12 | 13 | @Override 14 | public PayloadIdentifier payloadId() { 15 | return PayloadIdentifier.ATTACK_WHILE_BLOCKING; 16 | } 17 | 18 | @Override 19 | public void write(FriendlyByteBuf buffer) { 20 | buffer.writeByte(payloadId().ordinal()); 21 | buffer.writeBoolean(this.allowed); 22 | } 23 | 24 | public static AttackWhileBlockingPayloadS2C read(FriendlyByteBuf buffer) { 25 | return new AttackWhileBlockingPayloadS2C(buffer.readBoolean()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client/renderer/ItemBlockRenderTypesMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client.renderer; 2 | 3 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; 4 | import net.minecraft.client.renderer.ItemBlockRenderTypes; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.vivecraft.client_vr.ClientDataHolderVR; 8 | 9 | @Mixin(ItemBlockRenderTypes.class) 10 | public class ItemBlockRenderTypesMixin { 11 | // always use fancy leaves for menuworld 12 | @ModifyExpressionValue(method = "getChunkRenderType", at = @At(value = "FIELD", target = "Lnet/minecraft/client/renderer/ItemBlockRenderTypes;renderCutout:Z")) 13 | private static boolean vivecraft$fancyLeavesForMenuWorld(boolean original) { 14 | return original || (ClientDataHolderVR.getInstance().menuWorldRenderer != null && 15 | ClientDataHolderVR.getInstance().menuWorldRenderer.isOnBuilderThread() 16 | ); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/shaders/patches/ProjDiag4Patch.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.shaders.patches; 2 | 3 | /** 4 | * patches all of these 5 | * diagonal4(mat) * v.xyzz + mat[3]; 6 | * v.xyzz * diagonal4(mat) + mat[3]; 7 | * vec4(m[0].x, m[1].y, m[2].zw) * pos.xyzz + m[3]; 8 | * iProjDiag * p3.xyzz + gbufferProjectionInverse[3]; 9 | */ 10 | public class ProjDiag4Patch extends Patch { 11 | public ProjDiag4Patch() { 12 | super( 13 | """ 14 | diagonal4(mat) * v.xyzz + mat[3]; 15 | v.xyzz * diagonal4(mat) + mat[3]; 16 | vec4(m[0].x, m[1].y, m[2].zw) * pos.xyzz + m[3]; 17 | iProjDiag * p3.xyzz + gbufferProjectionInverse[3]; 18 | """, """ 19 | $10 * vec4($6, 1.0);""", 20 | "((((diagonal4|diag4)\\(\\w+\\))|\\w+|vec4\\((\\w+)\\[0]\\.x,\\5\\[1]\\.y,\\5\\[2]\\.zw\\))\\*\\s*)?(\\w+)\\.xyzz(\\*((diagonal4|diag4)\\(\\w+\\)))?\\+(\\w+)\\[3];"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/api_beta/VivecraftAPI.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.api_beta; 2 | 3 | import com.google.common.annotations.Beta; 4 | import net.minecraft.world.entity.player.Player; 5 | import org.vivecraft.api.VRAPI; 6 | 7 | /** 8 | * @deprecated since 1.3.0, use {@link VRAPI} instead 9 | */ 10 | @Deprecated(since = "1.3.0", forRemoval = true) 11 | @Beta 12 | public interface VivecraftAPI { 13 | 14 | @Deprecated(since = "1.3.0", forRemoval = true) 15 | VivecraftAPI INSTANCE = player -> VRAPI.instance().isVRPlayer(player); 16 | 17 | /** 18 | * @deprecated since 1.3.0, use {@link VRAPI#instance()} instead 19 | */ 20 | @Deprecated(since = "1.3.0", forRemoval = true) 21 | static VivecraftAPI getInstance() { 22 | return INSTANCE; 23 | } 24 | 25 | /** 26 | * @deprecated since 1.3.0, use {@link VRAPI#isVRPlayer(Player)} instead 27 | */ 28 | @Beta 29 | @Deprecated(since = "1.3.0", forRemoval = true) 30 | boolean isVRPlayer(Player player); 31 | } 32 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/IrisCameraUniformsMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.iris.mixin; 2 | 3 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.Pseudo; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.vivecraft.client_xr.render_pass.RenderPassType; 8 | 9 | @Pseudo 10 | @Mixin(targets = { 11 | "net.coderbot.iris.uniforms.CameraUniforms", 12 | "net.irisshaders.iris.uniforms.CameraUniforms" 13 | }) 14 | public class IrisCameraUniformsMixin { 15 | // we change the near plane to be a bit shorter 16 | @ModifyExpressionValue(method = "lambda$addCameraUniforms$0", at = @At(value = "CONSTANT", args = "doubleValue=0.05"), remap = false) 17 | private static double vivecraft$nearPlane(double original) { 18 | // see GameRendererVRMixin#vivecraft$MIN_CLIP_DISTANCE 19 | return RenderPassType.isVanilla() ? original : 0.02; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/shaders/patches/SuperDuperProj3Patch.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.shaders.patches; 2 | 3 | /** 4 | * patches 5 | * vec2 clipCoord = vec2(projection[0].x, projection[1].y) * viewPos.xy; 6 | * return 0.5 - vec3(clipCoord.xy / viewPos.z, projection[3].z / viewPos.z + projection[2].z) * 0.5; 7 | */ 8 | public class SuperDuperProj3Patch extends Patch { 9 | public SuperDuperProj3Patch() { 10 | super(""" 11 | vec2 clipCoord = vec2(projection[0].x, projection[1].y) * viewPos.xy; 12 | return 0.5 - vec3(clipCoord.xy / viewPos.z, projection[3].z / viewPos.z + projection[2].z) * 0.5; 13 | """, """ 14 | vec4 $1 = $2 * vec4($3, 1); 15 | return ($1.xyz / $1.w) * 0.5 + 0.5;""", 16 | "vec2\\s+(\\w+)=vec2\\((\\w+)\\[0]\\.x,\\2\\[1]\\.y\\)\\*(\\w+)\\.xy;return\\s+0\\.5-vec3\\(\\1\\.xy/\\3\\.z,\\2\\[3]\\.z/\\3\\.z\\+\\2\\[2]\\.z\\)(\\*0\\.5|/2\\.0);"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/utils/math/AngleOrder.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.utils.math; 2 | 3 | import org.joml.Quaternionf; 4 | 5 | public enum AngleOrder implements AngleOrderOperation { 6 | XYZ((x, y, z) -> new Quaternionf().rotationXYZ(x, y, z)), 7 | ZYX((x, y, z) -> new Quaternionf().rotationZYX(z, y, x)), 8 | YXZ((x, y, z) -> new Quaternionf().rotationYXZ(y, x, z)), 9 | ZXY((x, y, z) -> new Quaternionf().rotationZ(z).rotateX(x).rotateY(y)), 10 | YZX((x, y, z) -> new Quaternionf().rotationY(y).rotateZ(z).rotateX(x)), 11 | XZY((x, y, z) -> new Quaternionf().rotationX(x).rotateZ(z).rotateY(y)); 12 | 13 | private final AngleOrderOperation angleOrderOperation; 14 | 15 | AngleOrder(final AngleOrderOperation angleOrderOperation) { 16 | this.angleOrderOperation = angleOrderOperation; 17 | } 18 | 19 | @Override 20 | public Quaternionf getRotation(float x, float y, float z) { 21 | return this.angleOrderOperation.getRotation(x, y, z); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/api_impl/event/VivecraftClientRegistrationEventImpl.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.api_impl.event; 2 | 3 | import org.vivecraft.api.client.InteractModule; 4 | import org.vivecraft.api.client.Tracker; 5 | import org.vivecraft.api.client.event.VivecraftClientRegistrationEvent; 6 | import org.vivecraft.client_vr.ClientDataHolderVR; 7 | 8 | public final class VivecraftClientRegistrationEventImpl implements VivecraftClientRegistrationEvent { 9 | 10 | public static final VivecraftClientRegistrationEventImpl INSTANCE = new VivecraftClientRegistrationEventImpl(); 11 | 12 | private VivecraftClientRegistrationEventImpl() {} 13 | 14 | @Override 15 | public void registerTrackers(Tracker... trackers) { 16 | ClientDataHolderVR.getInstance().registerTracker(trackers); 17 | } 18 | 19 | @Override 20 | public void registerInteractModules(InteractModule... modules) { 21 | ClientDataHolderVR.getInstance().interactTracker.registerModules(modules); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/VivecraftPayload.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import net.minecraft.network.protocol.common.custom.CustomPacketPayload; 5 | import net.minecraft.resources.ResourceLocation; 6 | import org.vivecraft.common.network.CommonNetworkHelper; 7 | 8 | public interface VivecraftPayload extends CustomPacketPayload { 9 | 10 | /** 11 | * writes this data packet to the given buffer 12 | * 13 | * @param buffer Buffer to write to 14 | */ 15 | default void write(FriendlyByteBuf buffer) { 16 | buffer.writeByte(payloadId().ordinal()); 17 | } 18 | 19 | /** 20 | * returns the PacketIdentifier associated with this packet 21 | */ 22 | PayloadIdentifier payloadId(); 23 | 24 | 25 | /** 26 | * @return ResourceLocation identifying this packet 27 | */ 28 | default ResourceLocation id() { 29 | return CommonNetworkHelper.CHANNEL; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/c2s/VRPlayerStatePayloadC2S.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.c2s; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.VrPlayerState; 5 | import org.vivecraft.common.network.packet.PayloadIdentifier; 6 | 7 | /** 8 | * holds the clients complete vr state 9 | * 10 | * @param playerState vr state of the player 11 | */ 12 | public record VRPlayerStatePayloadC2S(VrPlayerState playerState) implements VivecraftPayloadC2S { 13 | @Override 14 | public PayloadIdentifier payloadId() { 15 | return PayloadIdentifier.VR_PLAYER_STATE; 16 | } 17 | 18 | @Override 19 | public void write(FriendlyByteBuf buffer) { 20 | buffer.writeByte(payloadId().ordinal()); 21 | this.playerState.serialize(buffer); 22 | } 23 | 24 | public static VRPlayerStatePayloadC2S read(FriendlyByteBuf buffer) { 25 | return new VRPlayerStatePayloadC2S(VrPlayerState.deserialize(buffer, 0)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/JcppProcessorVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.iris.mixin; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.Pseudo; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 7 | import org.vivecraft.client_vr.VRState; 8 | import org.vivecraft.mod_compat_vr.shaders.ShaderPatcher; 9 | 10 | @Pseudo 11 | @Mixin(targets = { 12 | "net.coderbot.iris.shaderpack.preprocessor.JcppProcessor", 13 | "net.irisshaders.iris.shaderpack.preprocessor.JcppProcessor" 14 | }) 15 | public class JcppProcessorVRMixin { 16 | @ModifyVariable(method = "glslPreprocessSource", at = @At("HEAD"), ordinal = 0, argsOnly = true, remap = false) 17 | private static String vivecraft$patchShader0(String oldShader) { 18 | if (VRState.VR_INITIALIZED) { 19 | oldShader = ShaderPatcher.patchShader(oldShader); 20 | } 21 | return oldShader; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/sereneseasons/mixin/ModClientMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.sereneseasons.mixin; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.world.level.FoliageColor; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.Pseudo; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 10 | 11 | @Pseudo 12 | @Mixin(targets = "sereneseasons.init.ModClient") 13 | public class ModClientMixin { 14 | 15 | /** 16 | * menuworld fix 17 | */ 18 | @Inject(method = "lambda$registerBlockColors$0", at = @At("HEAD"), remap = false, cancellable = true) 19 | private static void vivecraft$grassColor(CallbackInfoReturnable cir) { 20 | if (Minecraft.getInstance().player == null) { 21 | cir.setReturnValue(FoliageColor.FOLIAGE_BIRCH); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/resources/vivecraft.iris.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": false, 3 | "package": "org.vivecraft.mod_compat_vr.iris.mixin", 4 | "plugin": "org.vivecraft.MixinConfig", 5 | "compatibilityLevel": "JAVA_17", 6 | "client": [ 7 | "IrisBeginFrameHack", 8 | "IrisBlockRenderingSettingsMixin", 9 | "IrisCameraUniformsMixin", 10 | "IrisDHCompatVRMixin", 11 | "IrisHandRendererVRMixin", 12 | "IrisLodRenderProgramVRMixin", 13 | "IrisProgramUniformsMixin", 14 | "IrisShadowMatricesMixin", 15 | "IrisShadowRendererMixin", 16 | "JcppProcessorVRMixin", 17 | "irisshaders.IrisChunkProgramOverridesMixin", 18 | "irisshaders.IrisChunkProgramOverridesMixinSodium_0_5_8", 19 | "irisshaders.IrisChunkProgramOverridesMixinSodium_0_6", 20 | "irisshaders.IrisCommonUniformsMixin", 21 | "irisshaders.IrisPipelineManagerVRMixin", 22 | "irisshaders.IrisRenderingPipelineVRMixin", 23 | "irisshaders.IrisStandardMacrosMixin" 24 | ], 25 | "minVersion": "0.8.4", 26 | "mixins": [ 27 | ] 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/provider/openvr_lwjgl/OpenVRUtil.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.provider.openvr_lwjgl; 2 | 3 | import org.joml.Matrix4f; 4 | import org.lwjgl.openvr.HmdMatrix34; 5 | import org.lwjgl.openvr.HmdMatrix44; 6 | 7 | public class OpenVRUtil { 8 | public static Matrix4f convertSteamVRMatrix3ToMatrix4f(HmdMatrix34 hmdMatrix, Matrix4f mat) { 9 | return mat.set( 10 | hmdMatrix.m(0), hmdMatrix.m(4), hmdMatrix.m(8), 0.0F, 11 | hmdMatrix.m(1), hmdMatrix.m(5), hmdMatrix.m(9), 0.0F, 12 | hmdMatrix.m(2), hmdMatrix.m(6), hmdMatrix.m(10), 0.0F, 13 | hmdMatrix.m(3), hmdMatrix.m(7), hmdMatrix.m(11), 1.0F); 14 | } 15 | 16 | public static Matrix4f Matrix4fFromOpenVR(HmdMatrix44 in) { 17 | return new Matrix4f( 18 | in.m(0), in.m(4), in.m(8), in.m(12), 19 | in.m(1), in.m(5), in.m(9), in.m(13), 20 | in.m(2), in.m(6), in.m(10), in.m(14), 21 | in.m(3), in.m(7), in.m(11), in.m(15)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client/renderer/block/LiquidBlockRendererMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client.renderer.block; 2 | 3 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; 4 | import net.minecraft.client.renderer.block.LiquidBlockRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.vivecraft.client_vr.ClientDataHolderVR; 8 | 9 | @Mixin(LiquidBlockRenderer.class) 10 | public class LiquidBlockRendererMixin { 11 | // needed for menuworlds water rendering, to get world space positions, and not per chunk 12 | @ModifyExpressionValue(method = "tesselate", at = @At(value = "CONSTANT", args = "intValue=15")) 13 | private int vivecraft$noChunkWrappingInMenuWorld(int i) { 14 | // -1 is 0xFFFF FFFF 15 | // so no change 16 | return ClientDataHolderVR.getInstance().menuWorldRenderer != null && 17 | ClientDataHolderVR.getInstance().menuWorldRenderer.isOnBuilderThread() ? -1 : i; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/renderer/blockentity/TheEndGatewayRendererVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.renderer.blockentity; 2 | 3 | import net.minecraft.client.renderer.RenderType; 4 | import net.minecraft.client.renderer.blockentity.TheEndGatewayRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | import org.vivecraft.client_vr.render.rendertypes.VRRenderTypes; 10 | import org.vivecraft.client_xr.render_pass.RenderPassType; 11 | 12 | @Mixin(TheEndGatewayRenderer.class) 13 | public class TheEndGatewayRendererVRMixin { 14 | @Inject(method = "renderType", at = @At("HEAD"), cancellable = true) 15 | private void vivecraft$VRShaderOverride(CallbackInfoReturnable cir) { 16 | if (!RenderPassType.isVanilla()) { 17 | cir.setReturnValue(VRRenderTypes.endGateWayVR()); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/gameplay/interact_modules/DebugRenderModule.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.gameplay.interact_modules; 2 | 3 | import net.minecraft.client.player.LocalPlayer; 4 | import net.minecraft.world.InteractionHand; 5 | import net.minecraft.world.phys.Vec3; 6 | import org.vivecraft.api.client.InteractModule; 7 | 8 | /** 9 | * Allows an InteractModule to render visual debug information 10 | */ 11 | public interface DebugRenderModule extends InteractModule { 12 | /** 13 | * Renders debug elements to visualize the module's state. 14 | * Only called when the InteractTracker is set to render debug elements in the debug settings. 15 | *
16 | * This is called every frame, so modules should make sure that stuff is not {@code null}, since this could be called before {@link InteractModule#isActive(LocalPlayer, InteractionHand, Vec3)} is called. 17 | * 18 | * @param isActive if the given module is currently one of active InteractModules 19 | */ 20 | void renderDebug(boolean isActive); 21 | } 22 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/s2c/DamageDirectionPayloadS2C.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.s2c; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.joml.Vector3fc; 5 | import org.vivecraft.common.network.CommonNetworkHelper; 6 | import org.vivecraft.common.network.packet.PayloadIdentifier; 7 | 8 | /** 9 | * contains the last direction the player got damage from 10 | */ 11 | public record DamageDirectionPayloadS2C(Vector3fc damageDir) implements VivecraftPayloadS2C { 12 | 13 | @Override 14 | public PayloadIdentifier payloadId() { 15 | return PayloadIdentifier.DAMAGE_DIRECTION; 16 | } 17 | 18 | @Override 19 | public void write(FriendlyByteBuf buffer) { 20 | buffer.writeByte(payloadId().ordinal()); 21 | CommonNetworkHelper.serializeF(buffer, this.damageDir); 22 | } 23 | 24 | public static DamageDirectionPayloadS2C read(FriendlyByteBuf buffer) { 25 | return new DamageDirectionPayloadS2C(CommonNetworkHelper.deserializeFVec3(buffer)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/gui/screens/inventory/AbstractContainerScreenVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.gui.screens.inventory; 2 | 3 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; 4 | import net.minecraft.client.Minecraft; 5 | import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.vivecraft.client_vr.VRState; 9 | 10 | @Mixin(AbstractContainerScreen.class) 11 | public class AbstractContainerScreenVRMixin { 12 | 13 | @ModifyExpressionValue(method = "mouseDragged", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/screens/inventory/AbstractContainerScreen;isQuickCrafting:Z")) 14 | private boolean vivecraft$noShiftQuickCraft(boolean isQuickCrafting) { 15 | // not sure exactly why we do that, but there probably was a reason for it 16 | return isQuickCrafting && (!VRState.VR_RUNNING || !Minecraft.getInstance().hasShiftDown()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/renderer/blockentity/TheEndPortalRendererVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.renderer.blockentity; 2 | 3 | import net.minecraft.client.renderer.RenderType; 4 | import net.minecraft.client.renderer.blockentity.AbstractEndPortalRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | import org.vivecraft.client_vr.render.rendertypes.VRRenderTypes; 10 | import org.vivecraft.client_xr.render_pass.RenderPassType; 11 | 12 | @Mixin(AbstractEndPortalRenderer.class) 13 | public class TheEndPortalRendererVRMixin { 14 | @Inject(method = "renderType", at = @At("HEAD"), cancellable = true) 15 | private void vivecraft$VRShaderOverride(CallbackInfoReturnable cir) { 16 | if (!RenderPassType.isVanilla()) { 17 | cir.setReturnValue(VRRenderTypes.endPortalVR()); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/sounds/SoundEngineVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.sounds; 2 | 3 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; 4 | import net.minecraft.client.sounds.SoundEngine; 5 | import org.joml.Vector3f; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.vivecraft.api.client.data.RenderPass; 9 | import org.vivecraft.client_vr.ClientDataHolderVR; 10 | import org.vivecraft.client_vr.VRState; 11 | import org.vivecraft.common.utils.MathUtils; 12 | 13 | @Mixin(SoundEngine.class) 14 | public class SoundEngineVRMixin { 15 | @ModifyExpressionValue(method = "updateSource", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Camera;getUpVector()Lorg/joml/Vector3f;")) 16 | private Vector3f vivecraft$useHeadUp(Vector3f original) { 17 | return VRState.VR_RUNNING ? ClientDataHolderVR.getInstance().vrPlayer.getVRDataWorld().getEye(RenderPass.CENTER) 18 | .getCustomVector(MathUtils.UP) : original; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/shaders/patches/MakeupProjPatch.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.shaders.patches; 2 | 3 | /** 4 | * patches: 5 | * final_pos = vec2(gbufferPreviousProjection[0].x, gbufferPreviousProjection[1].y) * prev_view_pos.xy + gbufferPreviousProjection[3].xy; 6 | * texcoord_past = (final_pos / -prev_view_pos.z) * 0.5 + 0.5; 7 | */ 8 | public class MakeupProjPatch extends Patch { 9 | public MakeupProjPatch() { 10 | super(""" 11 | final_pos = vec2(gbufferPreviousProjection[0].x, gbufferPreviousProjection[1].y) * prev_view_pos.xy + gbufferPreviousProjection[3].xy; 12 | texcoord_past = (final_pos / -prev_view_pos.z) * 0.5 + 0.5;""", """ 13 | vec4 viveScreenPos = $2 * vec4($3, 1.0); 14 | $1 = viveScreenPos.xy; 15 | $4 = viveScreenPos.xy / viveScreenPos.w * 0.5 + 0.5; 16 | """, 17 | "(\\w+)=vec2\\((\\w+)\\[0]\\.x,\\2\\[1]\\.y\\)\\*(\\w+)\\.xy\\+\\2\\[3]\\.xy;(\\w+)=\\(\\1/-\\3\\.z\\)\\*0\\.5\\+0\\.5;"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client/renderer/culling/FrustumVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client.renderer.culling; 2 | 3 | import net.minecraft.client.renderer.culling.Frustum; 4 | import net.minecraft.world.phys.AABB; 5 | import org.joml.FrustumIntersection; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.Unique; 9 | import org.vivecraft.client_vr.extensions.FrustumExtension; 10 | 11 | @Mixin(Frustum.class) 12 | public abstract class FrustumVRMixin implements FrustumExtension { 13 | 14 | @Shadow 15 | private int cubeInFrustum(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) { 16 | throw new AssertionError(); 17 | } 18 | 19 | @Override 20 | @Unique 21 | public boolean vivecraft$isBoundingBoxInFrustum(AABB bb) { 22 | int result = this.cubeInFrustum(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ); 23 | return result == FrustumIntersection.INTERSECT || result == FrustumIntersection.INSIDE; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/rei/mixin/reiTextFieldWidgetMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.rei.mixin; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.Pseudo; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | import org.vivecraft.api.client.data.OpenKeyboardContext; 9 | import org.vivecraft.client_vr.VRState; 10 | import org.vivecraft.client_vr.gameplay.screenhandlers.KeyboardHandler; 11 | 12 | @Pseudo 13 | @Mixin(targets = {"me.shedaniel.rei.impl.client.gui.widget.basewidgets.TextFieldWidget"}) 14 | public abstract class reiTextFieldWidgetMixin { 15 | 16 | @Inject(method = {"setFocused", "method_25365", "m_93692_"}, at = @At("HEAD"), remap = false) 17 | private void vivecraft$openKeyboard(boolean focused, CallbackInfo ci) { 18 | if (VRState.VR_RUNNING && focused) { 19 | KeyboardHandler.showOverlay(OpenKeyboardContext.FORCE); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/blaze3d/audio/LibraryVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.blaze3d.audio; 2 | 3 | import com.mojang.blaze3d.audio.Library; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 7 | import org.vivecraft.client_vr.ClientDataHolderVR; 8 | import org.vivecraft.client_vr.VRState; 9 | import org.vivecraft.client_vr.settings.VRSettings; 10 | 11 | @Mixin(Library.class) 12 | public class LibraryVRMixin { 13 | 14 | @ModifyVariable(method = "init", at = @At("HEAD"), argsOnly = true) 15 | private boolean vivecraft$shouldDoHRTF(boolean vanillaHRTF) { 16 | if (VRState.VR_RUNNING) { 17 | // don't force HRTF in nonvr 18 | VRSettings.LOGGER.info("Vivecraft: enabling HRTF: {}", 19 | ClientDataHolderVR.getInstance().vrSettings.hrtfSelection >= 0); 20 | return ClientDataHolderVR.getInstance().vrSettings.hrtfSelection >= 0; 21 | } 22 | return vanillaHRTF; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/resources/assets/vivecraft/models/item/mini_crafting.json: -------------------------------------------------------------------------------- 1 | { 2 | "credit": "Made with Blockbench, a free, modern block model editor by JannisX11", 3 | "textures": { 4 | "0": "vivecraft:blocks/mini_crafting", 5 | "particle": "vivecraft:blocks/mini_crafting" 6 | }, 7 | "elements": [ 8 | { 9 | "name": "cube", 10 | "from": [0, 0, 0], 11 | "to": [7, 2, 7], 12 | "faces": { 13 | "north": { 14 | "uv": [0, 4.5, 4.5, 5.5], 15 | "texture": "#0" 16 | }, 17 | "east": { 18 | "uv": [0, 4.5, 4.5, 5.5], 19 | "texture": "#0" 20 | }, 21 | "south": { 22 | "uv": [0, 4.5, 4.5, 5.5], 23 | "texture": "#0" 24 | }, 25 | "west": { 26 | "uv": [0, 4.5, 4.5, 5.5], 27 | "texture": "#0" 28 | }, 29 | "up": { 30 | "uv": [0, 0, 4.5, 4.5], 31 | "texture": "#0" 32 | }, 33 | "down": { 34 | "uv": [4.5, 0, 9, 4.5], 35 | "texture": "#0" 36 | } 37 | } 38 | } 39 | ] 40 | } 41 | -------------------------------------------------------------------------------- /forge/src/main/resources/META-INF/mods.toml: -------------------------------------------------------------------------------- 1 | modLoader = "javafml" 2 | loaderVersion = "[1,)" 3 | issueTrackerURL = "https://github.com/Vivecraft/VivecraftMod/issues" 4 | license = "LGPLv3" 5 | 6 | [[mods]] 7 | modId = "vivecraft" 8 | version = "${version}" 9 | displayName = "Vivecraft" 10 | displayURL = "https://modrinth.com/mod/vivecraft" 11 | logoFile = "vivecraft_icon.png" 12 | authors = "fayer3, Ferri_Arnus, IMS, jrbudda, minecraft player, Techjar" 13 | displayTest = "IGNORE_SERVER_VERSION" 14 | description = ''' 15 | The VR mod for any loader! 16 | 17 | Support us on Ko-Fi: https://ko-fi.com/vivecraft 18 | 19 | Discord: https://discord.gg/jYyyv7zhSW 20 | ''' 21 | updateJSONURL = "https://raw.githubusercontent.com/Vivecraft/VivecraftMod/forge-versions/forge_updates.json" 22 | 23 | [[dependencies.vivecraft]] 24 | modId = "forge" 25 | mandatory = true 26 | versionRange = "[59.0.0,60.0.12],[60.0.15,)" 27 | ordering = "NONE" 28 | side = "BOTH" 29 | 30 | [[dependencies.vivecraft]] 31 | modId = "minecraft" 32 | mandatory = true 33 | versionRange = "[1.21.9,1.21.10]" 34 | ordering = "NONE" 35 | side = "BOTH" 36 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/gui/pip/state/GuiFBTPlayerState.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.gui.pip.state; 2 | 3 | import net.minecraft.client.gui.navigation.ScreenRectangle; 4 | import net.minecraft.client.gui.render.state.pip.PictureInPictureRenderState; 5 | import org.joml.Vector3fc; 6 | 7 | import javax.annotation.Nullable; 8 | 9 | public record GuiFBTPlayerState(boolean rightReady, boolean leftReady, Vector3fc right, Vector3fc left, float yRot, 10 | int x0, int y0, int x1, int y1, float scale, 11 | ScreenRectangle bounds) implements PictureInPictureRenderState 12 | { 13 | public GuiFBTPlayerState( 14 | boolean rightReady, boolean leftReady, Vector3fc right, Vector3fc left, float yRot, int x0, int y0, int x1, 15 | int y1) 16 | { 17 | this(rightReady, leftReady, right, left, yRot, x0, y0, x1, y1, 1, 18 | new ScreenRectangle(x0, y0, x1 - x0, y1 - y0)); 19 | } 20 | 21 | @Override 22 | public @Nullable ScreenRectangle scissorArea() { 23 | return this.bounds; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /common/src/main/resources/data/vivecraft/tags/item/hoes.json: -------------------------------------------------------------------------------- 1 | { 2 | "replace": false, 3 | "values": [ 4 | { 5 | "id": "#forge:tools/hoes", 6 | "required": false 7 | }, 8 | { 9 | "id": "#c:hoes", 10 | "required": false 11 | }, 12 | 13 | "#minecraft:hoes", 14 | 15 | { 16 | "id": "tconstruct:scythe", 17 | "required": false 18 | }, 19 | 20 | { 21 | "id": "harvest_scythes:wooden_scythe", 22 | "required": false 23 | }, 24 | { 25 | "id": "harvest_scythes:stone_scythe", 26 | "required": false 27 | }, 28 | { 29 | "id": "harvest_scythes:iron_scythe", 30 | "required": false 31 | }, 32 | { 33 | "id": "harvest_scythes:golden_scythe", 34 | "required": false 35 | }, 36 | { 37 | "id": "harvest_scythes:diamond_scythe", 38 | "required": false 39 | }, 40 | { 41 | "id": "harvest_scythes:netherite_scythe", 42 | "required": false 43 | }, 44 | { 45 | "id": "harvest_scythes:creative_scythe", 46 | "required": false 47 | } 48 | ] 49 | } 50 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/s2c/VRActivePayloadS2C.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.s2c; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.packet.PayloadIdentifier; 5 | 6 | import java.util.UUID; 7 | 8 | /** 9 | * packet that holds if a player switched to VR or NONVR 10 | * 11 | * @param vr if the player is now in VR 12 | * @param playerID uuid of the player that switched vr state 13 | */ 14 | public record VRActivePayloadS2C(boolean vr, UUID playerID) implements VivecraftPayloadS2C { 15 | 16 | @Override 17 | public PayloadIdentifier payloadId() { 18 | return PayloadIdentifier.IS_VR_ACTIVE; 19 | } 20 | 21 | @Override 22 | public void write(FriendlyByteBuf buffer) { 23 | buffer.writeByte(payloadId().ordinal()); 24 | buffer.writeBoolean(this.vr); 25 | buffer.writeUUID(this.playerID); 26 | } 27 | 28 | public static VRActivePayloadS2C read(FriendlyByteBuf buffer) { 29 | return new VRActivePayloadS2C(buffer.readBoolean(), buffer.readUUID()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/api/data/FBTMode.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.api.data; 2 | 3 | /** 4 | * The mode used for full-body tracking, denoting which body parts are being tracked. 5 | * 6 | * @since 1.3.0 7 | */ 8 | public enum FBTMode { 9 | /** 10 | * Only head and hands are available. 11 | * 12 | * @since 1.3.0 13 | */ 14 | ARMS_ONLY, 15 | /** 16 | * Head, hands, waist, and feet trackers are available. 17 | * 18 | * @since 1.3.0 19 | */ 20 | ARMS_LEGS, 21 | /** 22 | * Head, hands, waist, feet, elbow, and knee trackers are available. 23 | * 24 | * @since 1.3.0 25 | */ 26 | WITH_JOINTS; 27 | 28 | /** 29 | * Whether the provided body part is available in this full-body tracking mode. 30 | * 31 | * @param bodyPart The body part to see if data is available for in this mode. 32 | * @return Whether the provided body part is available in this mode. 33 | * @since 1.3.0 34 | */ 35 | public boolean bodyPartAvailable(VRBodyPart bodyPart) { 36 | return bodyPart.availableInMode(this); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/extensions/RenderTargetExtension.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.extensions; 2 | 3 | public interface RenderTargetExtension { 4 | 5 | /** 6 | * sets if a combined depth/stencil should be used 7 | * 8 | * @param stencil if a stencil should be added 9 | */ 10 | void vivecraft$setStencil(boolean stencil); 11 | 12 | /** 13 | * @return if the RenderTarget has a stencil added by vivecraft active 14 | */ 15 | boolean vivecraft$hasStencil(); 16 | 17 | /** 18 | * sets if linear filtering should be used, if false or unset will use nearest filtering. 19 | * 20 | * @param linearFilter if linear filtering should be used 21 | */ 22 | void vivecraft$setLinearFilter(boolean linearFilter); 23 | 24 | /** 25 | * sets if mipmaps should be used for sampling 26 | * 27 | * @param mipmaps if mipmaps should be used 28 | */ 29 | void vivecraft$setMipmaps(boolean mipmaps); 30 | 31 | /** 32 | * @return if the RenderTarget is set to use mipmaps 33 | */ 34 | boolean vivecraft$hasMipmaps(); 35 | } 36 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/c2s/LegacyHeadDataPayloadC2S.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.c2s; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.Pose; 5 | import org.vivecraft.common.network.packet.PayloadIdentifier; 6 | 7 | /** 8 | * legacy packet, holds the seated flag and the head pose 9 | * 10 | * @param seated if the player is in seated mode 11 | * @param hmdPose pose of the players headset 12 | */ 13 | public record LegacyHeadDataPayloadC2S(boolean seated, Pose hmdPose) implements VivecraftPayloadC2S { 14 | @Override 15 | public PayloadIdentifier payloadId() { 16 | return PayloadIdentifier.HEADDATA; 17 | } 18 | 19 | @Override 20 | public void write(FriendlyByteBuf buffer) { 21 | buffer.writeByte(payloadId().ordinal()); 22 | buffer.writeBoolean(this.seated); 23 | this.hmdPose.serialize(buffer); 24 | } 25 | 26 | public static LegacyHeadDataPayloadC2S read(FriendlyByteBuf buffer) { 27 | return new LegacyHeadDataPayloadC2S(buffer.readBoolean(), Pose.deserialize(buffer)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/s2c/NetworkVersionPayloadS2C.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.s2c; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.NetworkVersion; 5 | import org.vivecraft.common.network.packet.PayloadIdentifier; 6 | 7 | /** 8 | * packet that holds the network protocol version the server will use to talk to the client 9 | * 10 | * @param version network protocol version the server will use 11 | */ 12 | public record NetworkVersionPayloadS2C(NetworkVersion version) implements VivecraftPayloadS2C { 13 | 14 | @Override 15 | public PayloadIdentifier payloadId() { 16 | return PayloadIdentifier.NETWORK_VERSION; 17 | } 18 | 19 | @Override 20 | public void write(FriendlyByteBuf buffer) { 21 | buffer.writeByte(payloadId().ordinal()); 22 | buffer.writeByte(this.version.protocolVersion()); 23 | } 24 | 25 | public static NetworkVersionPayloadS2C read(FriendlyByteBuf buffer) { 26 | return new NetworkVersionPayloadS2C(NetworkVersion.fromProtocolVersion(buffer.readByte() & 0xFF)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/gui/settings/GuiShaderCompatSettings.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.gui.settings; 2 | 3 | import net.minecraft.client.gui.screens.Screen; 4 | import org.vivecraft.client.gui.framework.VROptionEntry; 5 | import org.vivecraft.client.gui.framework.screens.GuiVROptionsBase; 6 | import org.vivecraft.client_vr.settings.VRSettings; 7 | 8 | public class GuiShaderCompatSettings extends GuiVROptionsBase { 9 | private static final VROptionEntry[] MODEL_OPTIONS = new VROptionEntry[]{ 10 | new VROptionEntry(VRSettings.VrOptions.SHADER_SLOW), 11 | new VROptionEntry(VRSettings.VrOptions.SHADER_PATCHING), 12 | new VROptionEntry(VRSettings.VrOptions.SHADER_GUI_RENDER), 13 | new VROptionEntry(VRSettings.VrOptions.SHADER_SHADOW_MODEL_LIMB_SCALE) 14 | }; 15 | 16 | public GuiShaderCompatSettings(Screen lastScreen) { 17 | super(lastScreen); 18 | } 19 | 20 | @Override 21 | public void init() { 22 | this.vrTitle = "vivecraft.options.screen.shadercompat"; 23 | super.init(MODEL_OPTIONS, true); 24 | 25 | super.addDefaultButtons(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/xaerosminimap/mixin/ImprovedFramebufferMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.xaerosminimap.mixin; 2 | 3 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; 4 | import com.mojang.blaze3d.pipeline.RenderTarget; 5 | import net.minecraft.client.Minecraft; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Pseudo; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | 10 | @Pseudo 11 | @Mixin(targets = "xaero.common.graphics.ImprovedFramebuffer") 12 | public class ImprovedFramebufferMixin { 13 | @ModifyExpressionValue(method = "forceAsMainRenderTarget", at = @At(value = "FIELD", target = "Lxaero/common/graphics/ImprovedFramebuffer;mainRenderTargetBackup:Lcom/mojang/blaze3d/pipeline/RenderTarget;", ordinal = 0, remap = true), remap = false) 14 | private RenderTarget vivecraft$fixConstantReference(RenderTarget mainRenderTarget) { 15 | // refetch main target when not an improved buffer, to get the new gui buffer 16 | return this.getClass().isInstance(Minecraft.getInstance().mainRenderTarget) ? mainRenderTarget : null; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/gui/settings/GuiWeaponCollisionSettings.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.gui.settings; 2 | 3 | import net.minecraft.client.gui.screens.Screen; 4 | import org.vivecraft.client.gui.framework.screens.GuiVROptionsBase; 5 | import org.vivecraft.client_vr.settings.VRSettings; 6 | 7 | public class GuiWeaponCollisionSettings extends GuiVROptionsBase { 8 | private static final VRSettings.VrOptions[] WEAPON_COLLISION_SETTINGS = new VRSettings.VrOptions[]{ 9 | VRSettings.VrOptions.WEAPON_COLLISION, 10 | VRSettings.VrOptions.FEET_COLLISION, 11 | VRSettings.VrOptions.REALISTIC_OPENING, 12 | VRSettings.VrOptions.SWORD_BLOCK_COLLISION, 13 | VRSettings.VrOptions.ONLY_SWORD_COLLISION, 14 | VRSettings.VrOptions.REDUCED_PLAYER_REACH 15 | }; 16 | 17 | public GuiWeaponCollisionSettings(Screen lastScreen) { 18 | super(lastScreen); 19 | } 20 | 21 | @Override 22 | public void init() { 23 | this.vrTitle = "vivecraft.options.screen.weaponcollision"; 24 | super.init(WEAPON_COLLISION_SETTINGS, true); 25 | super.addDefaultButtons(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/world/entity/monster/EndermanMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.world.entity.monster; 2 | 3 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; 4 | import com.llamalad7.mixinextras.sugar.Local; 5 | import net.minecraft.server.level.ServerPlayer; 6 | import net.minecraft.world.entity.monster.EnderMan; 7 | import net.minecraft.world.entity.player.Player; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.vivecraft.server.ServerVRPlayers; 11 | 12 | @Mixin(EnderMan.class) 13 | public abstract class EndermanMixin { 14 | 15 | @ModifyExpressionValue(method = "isBeingStaredBy", at = @At(value = "CONSTANT", args = "doubleValue=0.025")) 16 | private double vivecraft$biggerViewCone(double original, @Local(argsOnly = true) Player player) { 17 | // increase the view cone check from 1.4° to 5.7°, makes it easier to stop enderman, 18 | // since it's hard to know where the center of the view is 19 | return player instanceof ServerPlayer serverPlayer && ServerVRPlayers.isVRPlayer(serverPlayer) ? 0.1 : original; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/shaders/patches/ProjDiag3Patch.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.shaders.patches; 2 | 3 | /** 4 | * patches all of these 5 | * diagonal3(m) * (v) + (m)[3].xyz 6 | * diagonal3(mat) * v + mat[3].xyz 7 | * (diagonal3(m) * v) + m[3].xyz; 8 | * vec3(projection[0].x, projection[1].y, projection[2].z) * viewPosition + projection[3].xyz 9 | */ 10 | public class ProjDiag3Patch extends Patch { 11 | public ProjDiag3Patch() { 12 | super(""" 13 | diagonal3(m) * (v) + (m)[3].xyz 14 | diagonal3(mat) * v + mat[3].xyz 15 | (diagonal3(m) * v) + m[3].xyz; 16 | vec3(projection[0].x, projection[1].y, projection[2].z) * viewPosition + projection[3].xyz 17 | """, """ 18 | ($1 * vec4($2$3, 1.0)).xyz""", 19 | "(?:diagonal3|diag3|vec3)\\((\\w+)(?:\\[0]\\.x,\\1\\[1]\\.y,\\1\\[2]\\.z)?\\)\\*(?:(\\w+)|\\((\\w+)\\))\\+(?:\\(\\1\\)|\\1)\\[3]\\.xyz", 20 | "\\((?:diagonal3|diag3|vec3)\\((\\w+)(?:\\[0]\\.x,\\1\\[1]\\.y,\\1\\[2]\\.z)?\\)\\*(?:(\\w+)|\\((\\w+)\\))\\)\\+(?:\\(\\1\\)|\\1)\\[3]\\.xyz"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/optifine/mixin/OptifineLiquidBlockRendererMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.optifine.mixin; 2 | 3 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; 4 | import net.minecraft.client.renderer.block.LiquidBlockRenderer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.vivecraft.client_vr.ClientDataHolderVR; 8 | import org.vivecraft.client_vr.extensions.ClassDependentMixin; 9 | 10 | @ClassDependentMixin("net.optifine.Config") 11 | @Mixin(LiquidBlockRenderer.class) 12 | public class OptifineLiquidBlockRendererMixin { 13 | /** 14 | * menuworld fix 15 | */ 16 | @ModifyExpressionValue(method = "tesselate", at = @At(value = "INVOKE", target = "Lnet/optifine/Config;isRenderRegions()Z", remap = false), remap = true) 17 | private boolean vivecraft$optifineChunkClipping(boolean renderRegionsEnabled) { 18 | return renderRegionsEnabled && (ClientDataHolderVR.getInstance().menuWorldRenderer == null || 19 | !ClientDataHolderVR.getInstance().menuWorldRenderer.isOnBuilderThread() 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/c2s/TeleportPayloadC2S.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.c2s; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.packet.PayloadIdentifier; 5 | 6 | /** 7 | * holds the clients wanted teleport position 8 | * 9 | * @param x x coordinate the player want to teleport to 10 | * @param y y coordinate the player want to teleport to 11 | * @param z z coordinate the player want to teleport to 12 | */ 13 | public record TeleportPayloadC2S(float x, float y, float z) implements VivecraftPayloadC2S { 14 | 15 | @Override 16 | public PayloadIdentifier payloadId() { 17 | return PayloadIdentifier.TELEPORT; 18 | } 19 | 20 | @Override 21 | public void write(FriendlyByteBuf buffer) { 22 | buffer.writeByte(payloadId().ordinal()); 23 | buffer.writeFloat(this.x); 24 | buffer.writeFloat(this.y); 25 | buffer.writeFloat(this.z); 26 | } 27 | 28 | public static TeleportPayloadC2S read(FriendlyByteBuf buffer) { 29 | return new TeleportPayloadC2S(buffer.readFloat(), buffer.readFloat(), buffer.readFloat()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /forge/src/main/java/org/vivecraft/forge/XeventsImpl.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.forge; 2 | 3 | import com.mojang.blaze3d.vertex.PoseStack; 4 | import net.minecraft.core.BlockPos; 5 | import net.minecraft.world.entity.player.Player; 6 | import net.minecraft.world.level.block.state.BlockState; 7 | import net.minecraftforge.client.ForgeHooksClient; 8 | import net.minecraftforge.client.event.RenderBlockScreenEffectEvent; 9 | import org.vivecraft.Xevents; 10 | 11 | public class XeventsImpl implements Xevents { 12 | 13 | public static boolean renderBlockOverlay( 14 | Player player, PoseStack poseStack, BlockState blockState, BlockPos blockPos) 15 | { 16 | return ForgeHooksClient.renderBlockOverlay(player, poseStack, RenderBlockScreenEffectEvent.OverlayType.BLOCK, 17 | blockState, blockPos); 18 | } 19 | 20 | public static boolean renderWaterOverlay(Player player, PoseStack poseStack) { 21 | return ForgeHooksClient.renderWaterOverlay(player, poseStack); 22 | } 23 | 24 | public static boolean renderFireOverlay(Player player, PoseStack poseStack) { 25 | return ForgeHooksClient.renderFireOverlay(player, poseStack); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/gui/settings/GuiRenderingSettings.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.gui.settings; 2 | 3 | import net.minecraft.client.gui.screens.Screen; 4 | import org.vivecraft.client.gui.framework.VROptionEntry; 5 | import org.vivecraft.client.gui.framework.screens.GuiVROptionsBase; 6 | import org.vivecraft.client_vr.settings.VRSettings; 7 | 8 | public class GuiRenderingSettings extends GuiVROptionsBase { 9 | private final VROptionEntry[] hudOptions = new VROptionEntry[]{ 10 | new VROptionEntry(VRSettings.VrOptions.DOUBLE_GUI_RESOLUTION), 11 | new VROptionEntry(VRSettings.VrOptions.GUI_MIPMAPS), 12 | new VROptionEntry(VRSettings.VrOptions.GUI_SCALE), 13 | new VROptionEntry(VRSettings.VrOptions.GUI_ANISOTROPIC_FILTERING), 14 | new VROptionEntry(VRSettings.VrOptions.HUD_MAX_GUI_SCALE) 15 | }; 16 | 17 | public GuiRenderingSettings(Screen lastScreen) { 18 | super(lastScreen); 19 | } 20 | 21 | @Override 22 | public void init() { 23 | this.vrTitle = "vivecraft.options.screen.guirendering"; 24 | super.init(this.hudOptions, true); 25 | super.addDefaultButtons(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/c2s/LegacyController1DataPayloadC2S.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.c2s; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.Pose; 5 | import org.vivecraft.common.network.packet.PayloadIdentifier; 6 | 7 | /** 8 | * legacy packet, holds the reversed hand flag and the offhand controller pose 9 | * 10 | * @param leftHanded if the player has reversed hands set 11 | * @param offHand pose of the players main controller 12 | */ 13 | public record LegacyController1DataPayloadC2S(boolean leftHanded, Pose offHand) implements VivecraftPayloadC2S { 14 | @Override 15 | public PayloadIdentifier payloadId() { 16 | return PayloadIdentifier.CONTROLLER1DATA; 17 | } 18 | 19 | @Override 20 | public void write(FriendlyByteBuf buffer) { 21 | buffer.writeByte(payloadId().ordinal()); 22 | buffer.writeBoolean(this.leftHanded); 23 | this.offHand.serialize(buffer); 24 | } 25 | 26 | public static LegacyController1DataPayloadC2S read(FriendlyByteBuf buffer) { 27 | return new LegacyController1DataPayloadC2S(buffer.readBoolean(), Pose.deserialize(buffer)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/common/network/packet/c2s/LegacyController0DataPayloadC2S.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.common.network.packet.c2s; 2 | 3 | import net.minecraft.network.FriendlyByteBuf; 4 | import org.vivecraft.common.network.Pose; 5 | import org.vivecraft.common.network.packet.PayloadIdentifier; 6 | 7 | /** 8 | * legacy packet, holds the reversed hand flag and the main hand controller pose 9 | * 10 | * @param leftHanded if the player has reversed hands set 11 | * @param mainHand pose of the players offhand controller 12 | */ 13 | public record LegacyController0DataPayloadC2S(boolean leftHanded, Pose mainHand) implements VivecraftPayloadC2S { 14 | @Override 15 | public PayloadIdentifier payloadId() { 16 | return PayloadIdentifier.CONTROLLER0DATA; 17 | } 18 | 19 | @Override 20 | public void write(FriendlyByteBuf buffer) { 21 | buffer.writeByte(payloadId().ordinal()); 22 | buffer.writeBoolean(this.leftHanded); 23 | this.mainHand.serialize(buffer); 24 | } 25 | 26 | public static LegacyController0DataPayloadC2S read(FriendlyByteBuf buffer) { 27 | return new LegacyController0DataPayloadC2S(buffer.readBoolean(), Pose.deserialize(buffer)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/iris/mixin/IrisShadowRendererMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.iris.mixin; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.Pseudo; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | import org.vivecraft.client_vr.ClientDataHolderVR; 9 | import org.vivecraft.client_xr.render_pass.RenderPassType; 10 | import org.vivecraft.mod_compat_vr.iris.IrisHelper; 11 | 12 | @Pseudo 13 | @Mixin(targets = { 14 | "net.coderbot.iris.pipeline.ShadowRenderer", 15 | "net.irisshaders.iris.shadows.ShadowRenderer" 16 | }) 17 | public class IrisShadowRendererMixin { 18 | 19 | // only render shadows on the first RenderPass 20 | // cancel them here, or we would also cancel prepare shaders 21 | @Inject(method = "renderShadows", at = @At("HEAD"), cancellable = true, remap = false) 22 | private void vivecraft$onlyOneShadow(CallbackInfo ci) { 23 | if (!RenderPassType.isVanilla() && !ClientDataHolderVR.getInstance().isFirstPass && !IrisHelper.SLOW_MODE) { 24 | ci.cancel(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/renderer/entity/layers/CustomHeadLayerMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.renderer.entity.layers; 2 | 3 | import com.llamalad7.mixinextras.sugar.Local; 4 | import net.minecraft.client.renderer.entity.layers.CustomHeadLayer; 5 | import net.minecraft.client.renderer.entity.state.LivingEntityRenderState; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | import org.vivecraft.client_vr.render.helpers.VREffectsHelper; 11 | 12 | @Mixin(CustomHeadLayer.class) 13 | public class CustomHeadLayerMixin { 14 | @Inject(method = "submit(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;ILnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;FF)V", at = @At("HEAD"), cancellable = true) 15 | private void vivecraft$noHelmetInFirstPerson( 16 | CallbackInfo ci, @Local(argsOnly = true) LivingEntityRenderState renderState) 17 | { 18 | if (VREffectsHelper.isRenderingFirstPersonPlayer(renderState)) { 19 | ci.cancel(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/gui/settings/GuiQuickCommandEditor.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.gui.settings; 2 | 3 | import net.minecraft.client.gui.screens.Screen; 4 | import net.minecraft.network.chat.Component; 5 | import org.vivecraft.client.gui.framework.screens.GuiStringListEditorScreen; 6 | import org.vivecraft.client_vr.ClientDataHolderVR; 7 | 8 | import java.util.Arrays; 9 | 10 | public class GuiQuickCommandEditor extends GuiStringListEditorScreen { 11 | public GuiQuickCommandEditor(Screen lastScreen) { 12 | super(Component.translatable("vivecraft.options.screen.quickcommands"), lastScreen, 13 | true, 14 | () -> Arrays.asList(ClientDataHolderVR.getInstance().vrSettings.vrQuickCommands), 15 | () -> { 16 | ClientDataHolderVR.getInstance().vrSettings.vrQuickCommands = ClientDataHolderVR.getInstance().vrSettings.getQuickCommandsDefaults(); 17 | ClientDataHolderVR.getInstance().vrSettings.saveOptions(); 18 | }, values -> { 19 | ClientDataHolderVR.getInstance().vrSettings.vrQuickCommands = values.toArray(new String[0]); 20 | ClientDataHolderVR.getInstance().vrSettings.saveOptions(); 21 | }); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/gui/settings/GuiBlacklistEditor.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.gui.settings; 2 | 3 | import net.minecraft.client.gui.screens.Screen; 4 | import net.minecraft.network.chat.Component; 5 | import org.vivecraft.client.gui.framework.screens.GuiStringListEditorScreen; 6 | import org.vivecraft.client_vr.ClientDataHolderVR; 7 | 8 | import java.util.Arrays; 9 | 10 | public class GuiBlacklistEditor extends GuiStringListEditorScreen { 11 | 12 | public GuiBlacklistEditor(Screen lastScreen) { 13 | super(Component.translatable("vivecraft.options.screen.blocklist"), lastScreen, 14 | false, 15 | () -> Arrays.asList(ClientDataHolderVR.getInstance().vrSettings.vrServerBlacklist), 16 | () -> { 17 | ClientDataHolderVR.getInstance().vrSettings.vrServerBlacklist = ClientDataHolderVR.getInstance().vrSettings.getServerBlacklistDefault(); 18 | ClientDataHolderVR.getInstance().vrSettings.saveOptions(); 19 | }, values -> { 20 | ClientDataHolderVR.getInstance().vrSettings.vrServerBlacklist = values.toArray(new String[0]); 21 | ClientDataHolderVR.getInstance().vrSettings.saveOptions(); 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/sodium/mixin/SodiumLeavesBlockMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.sodium.mixin; 2 | 3 | import net.minecraft.world.level.block.LeavesBlock; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 8 | import org.vivecraft.client_vr.ClientDataHolderVR; 9 | 10 | // priority 1100 so we inject after sodium 11 | @Mixin(value = LeavesBlock.class, priority = 1100) 12 | public class SodiumLeavesBlockMixin { 13 | /** 14 | * don't cull invisible faces in the menu world 15 | */ 16 | @Inject(method = "skipRendering(Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/core/Direction;)Z", at = @At("HEAD"), cancellable = true) 17 | private void vivecraft$sodiumLeavesFix(CallbackInfoReturnable cir) { 18 | if (ClientDataHolderVR.getInstance().menuWorldRenderer != null && 19 | ClientDataHolderVR.getInstance().menuWorldRenderer.isOnBuilderThread()) 20 | { 21 | cir.setReturnValue(false); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /forge/src/main/java/org/vivecraft/forge/mixin/ForgeMinecraftVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.forge.mixin; 2 | 3 | import net.minecraft.client.DeltaTracker; 4 | import net.minecraft.client.Minecraft; 5 | import org.spongepowered.asm.mixin.Final; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | import org.vivecraft.client_vr.VRState; 12 | import org.vivecraft.client_vr.render.helpers.VRPassHelper; 13 | 14 | @Mixin(Minecraft.class) 15 | public class ForgeMinecraftVRMixin { 16 | 17 | @Shadow 18 | @Final 19 | private DeltaTracker.Timer deltaTracker; 20 | 21 | @Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/client/event/ForgeEventFactoryClient;onRenderTickEnd(Lnet/minecraft/client/DeltaTracker;)V", shift = At.Shift.AFTER, remap = false), remap = true) 22 | private void vivecraft$renderVRPassesForge(boolean renderLevel, CallbackInfo ci) { 23 | if (VRState.VR_RUNNING) { 24 | VRPassHelper.renderAndSubmit(renderLevel, this.deltaTracker); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/gui/settings/GuiPostEffectsSettings.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.gui.settings; 2 | 3 | import net.minecraft.client.gui.screens.Screen; 4 | import org.vivecraft.client.gui.framework.VROptionEntry; 5 | import org.vivecraft.client.gui.framework.screens.GuiVROptionsBase; 6 | import org.vivecraft.client_vr.settings.VRSettings; 7 | 8 | public class GuiPostEffectsSettings extends GuiVROptionsBase { 9 | private static final VROptionEntry[] MODEL_OPTIONS = new VROptionEntry[]{ 10 | new VROptionEntry(VRSettings.VrOptions.LOW_HEALTH_INDICATOR), 11 | new VROptionEntry(VRSettings.VrOptions.HIT_INDICATOR), 12 | new VROptionEntry(VRSettings.VrOptions.WATER_EFFECT), 13 | new VROptionEntry(VRSettings.VrOptions.PORTAL_EFFECT), 14 | new VROptionEntry(VRSettings.VrOptions.FREEZE_EFFECT), 15 | new VROptionEntry(VRSettings.VrOptions.PUMPKIN_EFFECT) 16 | }; 17 | 18 | public GuiPostEffectsSettings(Screen lastScreen) { 19 | super(lastScreen); 20 | } 21 | 22 | @Override 23 | public void init() { 24 | this.vrTitle = "vivecraft.options.screen.posteffects"; 25 | super.init(MODEL_OPTIONS, true); 26 | 27 | super.addDefaultButtons(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /neoforge/src/main/java/org/vivecraft/neoforge/mixin/NeoForgeMinecraftVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.neoforge.mixin; 2 | 3 | import net.minecraft.client.DeltaTracker; 4 | import net.minecraft.client.Minecraft; 5 | import org.spongepowered.asm.mixin.Final; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Shadow; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | import org.vivecraft.client_vr.VRState; 12 | import org.vivecraft.client_vr.render.helpers.VRPassHelper; 13 | 14 | @Mixin(Minecraft.class) 15 | public class NeoForgeMinecraftVRMixin { 16 | 17 | @Shadow 18 | @Final 19 | private DeltaTracker.Timer deltaTracker; 20 | 21 | @Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/neoforged/neoforge/client/ClientHooks;fireRenderFramePost(Lnet/minecraft/client/DeltaTracker;)V", shift = At.Shift.AFTER, remap = false), remap = true) 22 | private void vivecraft$renderVRPassesNeoForge(boolean renderLevel, CallbackInfo ci) { 23 | if (VRState.VR_RUNNING) { 24 | VRPassHelper.renderAndSubmit(renderLevel, this.deltaTracker); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client/gui/VivecraftClickEvent.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client.gui; 2 | 3 | import net.minecraft.network.chat.ClickEvent; 4 | 5 | /** 6 | * Custom ClickEvent to do stuff that vanilla doesn't have an option for 7 | */ 8 | public class VivecraftClickEvent implements ClickEvent { 9 | 10 | private final VivecraftAction vivecraftAction; 11 | private final Object value; 12 | 13 | public VivecraftClickEvent(VivecraftAction action, Object value) { 14 | // dummy action, in case our check fails 15 | this.vivecraftAction = action; 16 | this.value = value; 17 | } 18 | 19 | public VivecraftAction getVivecraftAction() { 20 | return this.vivecraftAction; 21 | } 22 | 23 | public Object getVivecraftValue() { 24 | return this.value; 25 | } 26 | 27 | @Override 28 | public Action action() { 29 | return Action.RUN_COMMAND; 30 | } 31 | 32 | public enum VivecraftAction { 33 | OPEN_SCREEN("open_screen"); 34 | 35 | private final String name; 36 | 37 | VivecraftAction(String name) { 38 | this.name = name; 39 | } 40 | 41 | public String getName() { 42 | return this.name; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/pehkui/PehkuiHelper.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.pehkui; 2 | 3 | import net.minecraft.world.entity.Entity; 4 | import org.vivecraft.Xloader; 5 | import virtuoel.pehkui.util.ScaleUtils; 6 | 7 | public class PehkuiHelper { 8 | 9 | public static boolean isLoaded() { 10 | return Xloader.isModLoaded("pehkui"); 11 | } 12 | 13 | /** 14 | * gets the current eye height scale of the give Entity 15 | * 16 | * @param entity Entity to get the eye height scale for 17 | * @param partialTick current partial tick 18 | * @return scale of the entities eye height 19 | */ 20 | public static float getEntityEyeHeightScale(Entity entity, float partialTick) { 21 | return ScaleUtils.getEyeHeightScale(entity, partialTick); 22 | } 23 | 24 | /** 25 | * gets the current bounding box scale of the give Entity 26 | * 27 | * @param entity Entity to get the bounding box scale for 28 | * @param partialTick current partial tick 29 | * @return scale of the entities bounding box 30 | */ 31 | public static float getEntityBbScale(Entity entity, float partialTick) { 32 | return ScaleUtils.getBoundingBoxHeightScale(entity, partialTick); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/tutorial/PunchTreeTutorialStepInstanceVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.tutorial; 2 | 3 | import net.minecraft.client.tutorial.PunchTreeTutorialStepInstance; 4 | import net.minecraft.network.chat.Component; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.ModifyArg; 8 | import org.vivecraft.client_vr.ClientDataHolderVR; 9 | import org.vivecraft.client_vr.VRState; 10 | 11 | @Mixin(PunchTreeTutorialStepInstance.class) 12 | public class PunchTreeTutorialStepInstanceVRMixin { 13 | @ModifyArg(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/components/toasts/TutorialToast;(Lnet/minecraft/client/gui/Font;Lnet/minecraft/client/gui/components/toasts/TutorialToast$Icons;Lnet/minecraft/network/chat/Component;Lnet/minecraft/network/chat/Component;Z)V"), index = 3) 14 | private Component vivecraft$alterDescription(Component description) { 15 | if (!VRState.VR_RUNNING || ClientDataHolderVR.getInstance().vrSettings.seated) { 16 | return description; 17 | } else { 18 | return Component.translatable("tutorial.find_tree.description"); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/optifine/mixin/ShaderPackParserVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.optifine.mixin; 2 | 3 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 4 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 5 | import net.optifine.util.LineBuffer; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.Pseudo; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.vivecraft.client_vr.VRState; 10 | import org.vivecraft.mod_compat_vr.shaders.ShaderPatcher; 11 | 12 | @Pseudo 13 | @Mixin(targets = "net.optifine.shaders.config.ShaderPackParser") 14 | public class ShaderPackParserVRMixin { 15 | @WrapOperation(method = "loadShader", at = @At(value = "INVOKE", target = "Lnet/optifine/shaders/config/ShaderPackParser;addMacros(Lnet/optifine/util/LineBuffer;I)Lnet/optifine/util/LineBuffer;"), remap = false) 16 | private static LineBuffer vivecraft$patchShader(LineBuffer reader, int index, Operation original) { 17 | if (VRState.VR_INITIALIZED) { 18 | String patched = ShaderPatcher.patchShader(reader.toString()); 19 | reader = new LineBuffer(patched.split("\n")); 20 | } 21 | return original.call(reader, index); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/shaders/patches/SuperDuperLineProj2Patch.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.shaders.patches; 2 | 3 | /** 4 | * patches 5 | * vec2 vertexClipCoordStart = vec2(projectionMatrix[0].x, projectionMatrix[1].y) * linePosStart.xy; 6 | * vec2 vertexClipCoordEnd = vec2(projectionMatrix[0].x, projectionMatrix[1].y) * linePosEnd.xy; 7 | * ... 8 | * float vertexViewDepth = linePosStart.z * 0.99609375; 9 | */ 10 | public class SuperDuperLineProj2Patch extends Patch { 11 | public SuperDuperLineProj2Patch() { 12 | super( 13 | """ 14 | vec2 vertexClipCoordStart = vec2(projectionMatrix[0].x, projectionMatrix[1].y) * linePosStart.xy; 15 | vec2 vertexClipCoordEnd = vec2(projectionMatrix[0].x, projectionMatrix[1].y) * linePosEnd.xy; 16 | float vertexViewDepth = linePosStart.z * 0.99609375; // don't patch 17 | """, """ 18 | vec2 $1 = ($2 * vec4($3, 1.0)).xy * 0.99609375; 19 | vec2 $4 = ($2 * vec4($5, 1.0)).xy * 0.99609375; 20 | $6""", 21 | "vec2\\s+(\\w+)=vec2\\((\\w+)\\[0]\\.x,\\2\\[1]\\.y\\)\\*(\\w+)\\.xy;vec2\\s+(\\w+)=vec2\\(\\2\\[0]\\.x,\\2\\[1]\\.y\\)\\*(\\w+)\\.xy;(((.|\\s)+?)\\3\\.z\\*0\\.99609375;)"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mod_compat_vr/shaders/patches/MakeupProjInvPatch.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mod_compat_vr.shaders.patches; 2 | 3 | /** 4 | * patches: 5 | * curr_view_pos = vec3(vec2(gbufferProjectionInverse[0].x, gbufferProjectionInverse[1].y) * (texcoord * 2.0 - 1.0) + gbufferProjectionInverse[3].xy, gbufferProjectionInverse[3].z); 6 | * curr_view_pos /= (gbufferProjectionInverse[2].w * (z_depth * 2.0 - 1.0) + gbufferProjectionInverse[3].w); 7 | */ 8 | public class MakeupProjInvPatch extends Patch { 9 | public MakeupProjInvPatch() { 10 | super(""" 11 | curr_view_pos = 12 | vec3(vec2(gbufferProjectionInverse[0].x, gbufferProjectionInverse[1].y) * (texcoord * 2.0 - 1.0) + gbufferProjectionInverse[3].xy, gbufferProjectionInverse[3].z); 13 | curr_view_pos /= (gbufferProjectionInverse[2].w * (z_depth * 2.0 - 1.0) + gbufferProjectionInverse[3].w); 14 | """, """ 15 | vec4 viveViewPos = $2 * vec4(vec3($3, $4) * 2.0 - 1.0, 1.0); 16 | $1 = viveViewPos.xyz / viveViewPos.w;""", 17 | "(\\w+)=vec3\\(vec2\\((\\w+)\\[0]\\.x,\\2\\[1]\\.y\\)\\*\\((\\w+)\\*2\\.0-1\\.0\\)\\+\\2\\[3]\\.xy,\\2\\[3]\\.z\\);\\1/=\\(\\2\\[2]\\.w\\*\\((\\w+)\\*2\\.0-1\\.0\\)\\+\\2\\[3]\\.w\\);"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/client_vr/provider/HardwareType.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.client_vr.provider; 2 | 3 | import com.google.common.collect.ImmutableList; 4 | 5 | import java.util.HashMap; 6 | import java.util.List; 7 | import java.util.Map; 8 | 9 | public enum HardwareType { 10 | VIVE(true, false, "HTC"), 11 | OCULUS(false, true, "Oculus"), 12 | WINDOWSMR(true, true, "WindowsMR"); 13 | 14 | public final List manufacturers; 15 | public final boolean hasTouchpad; 16 | public final boolean hasStick; 17 | private static final Map MAP = new HashMap<>(); 18 | 19 | HardwareType(boolean hasTouchpad, boolean hasStick, String... manufacturers) { 20 | this.hasTouchpad = hasTouchpad; 21 | this.hasStick = hasStick; 22 | this.manufacturers = ImmutableList.copyOf(manufacturers); 23 | } 24 | 25 | public static HardwareType fromManufacturer(String name) { 26 | return MAP.getOrDefault(name, VIVE); 27 | } 28 | 29 | static { 30 | for (HardwareType hardwaretype : values()) { 31 | for (String s : hardwaretype.manufacturers) { 32 | assert !MAP.containsKey(s) : "Duplicate manufacturer: " + s; 33 | MAP.put(s, hardwaretype); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /forge/src/main/java/org/vivecraft/forge/mixin/ForgeGameRendererVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.forge.mixin; 2 | 3 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; 4 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; 5 | import net.minecraft.client.Camera; 6 | import net.minecraft.client.renderer.GameRenderer; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.vivecraft.api.client.data.RenderPass; 10 | import org.vivecraft.client_vr.ClientDataHolderVR; 11 | import org.vivecraft.client_xr.render_pass.RenderPassType; 12 | 13 | @Mixin(GameRenderer.class) 14 | public class ForgeGameRendererVRMixin { 15 | 16 | @WrapOperation(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Camera;setRotation(FFF)V", remap = false), remap = true) 17 | private void vivecraft$removeAnglesInternal( 18 | Camera instance, float yaw, float pitch, float roll, Operation original) 19 | { 20 | if (RenderPassType.isVanilla() || (ClientDataHolderVR.getInstance().currentPass != RenderPass.LEFT && 21 | ClientDataHolderVR.getInstance().currentPass != RenderPass.RIGHT 22 | )) 23 | { 24 | original.call(instance, yaw, pitch, roll); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/gui/screens/inventory/AbstractSignEditScreenVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.gui.screens.inventory; 2 | 3 | import net.minecraft.client.gui.screens.inventory.AbstractSignEditScreen; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 8 | import org.vivecraft.api.client.data.CloseKeyboardContext; 9 | import org.vivecraft.api.client.data.OpenKeyboardContext; 10 | import org.vivecraft.client_vr.VRState; 11 | import org.vivecraft.client_vr.gameplay.screenhandlers.KeyboardHandler; 12 | 13 | @Mixin(AbstractSignEditScreen.class) 14 | public class AbstractSignEditScreenVRMixin { 15 | 16 | @Inject(method = "init", at = @At("HEAD")) 17 | private void vivecraft$showOverlay(CallbackInfo ci) { 18 | if (VRState.VR_RUNNING) { 19 | KeyboardHandler.showOverlay(OpenKeyboardContext.FORCE); 20 | } 21 | } 22 | 23 | @Inject(method = "removed", at = @At("HEAD")) 24 | private void vivecraft$closeOverlay(CallbackInfo ci) { 25 | if (VRState.VR_RUNNING) { 26 | KeyboardHandler.hideOverlay(CloseKeyboardContext.ACTION_COMPLETE); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /common/src/main/java/org/vivecraft/mixin/client_vr/blaze3d/opengl/GLCommandEncoderVRMixin.java: -------------------------------------------------------------------------------- 1 | package org.vivecraft.mixin.client_vr.blaze3d.opengl; 2 | 3 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; 4 | import com.llamalad7.mixinextras.sugar.Local; 5 | import com.mojang.blaze3d.opengl.GlCommandEncoder; 6 | import com.mojang.blaze3d.pipeline.RenderPipeline; 7 | import com.mojang.blaze3d.platform.DepthTestFunction; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.injection.At; 10 | import org.vivecraft.client_vr.VRState; 11 | import org.vivecraft.client_vr.render.VRShaders; 12 | 13 | @Mixin(GlCommandEncoder.class) 14 | public class GLCommandEncoderVRMixin { 15 | @ModifyExpressionValue(method = "applyPipelineState", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/pipeline/RenderPipeline;getDepthTestFunction()Lcom/mojang/blaze3d/platform/DepthTestFunction;", ordinal = 0, remap = false), remap = true) 16 | private DepthTestFunction vivecraft$depthAlways( 17 | DepthTestFunction depthTest, @Local(argsOnly = true) RenderPipeline renderPipeline) 18 | { 19 | // This is just here because there is no specific ALWAYS_DEPTH_TEST 20 | return (VRState.VR_RUNNING && VRShaders.DEPTH_ALWAYS_PIPELINES.contains(renderPipeline)) ? null : depthTest; 21 | } 22 | } 23 | --------------------------------------------------------------------------------