Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bHaptics integration #310

Open
wants to merge 65 commits into
base: Multiloader-1.21
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
b4e427a
update to 1.20.5
fayer3 Apr 27, 2024
97ceaa8
fix publish script for neoforge change
fayer3 Apr 27, 2024
3cab7a3
fix lwjgl error showing wrong version
fayer3 Apr 28, 2024
3bd2a51
fix menu background in nonvr
fayer3 Apr 28, 2024
c9ceba5
fix serverside packet handling on fabric
fayer3 May 5, 2024
3edcb74
update to 1.20.6
fayer3 May 7, 2024
eed9892
fix forge 50.0.9+ networking
fayer3 May 12, 2024
06895c1
fix forge networking with 50.0.20+
fayer3 May 20, 2024
89e7991
fix forge uberpacket sending crashing the server
fayer3 Jun 3, 2024
a6724bc
fix some screen titles being blurred in nonvr
fayer3 Jun 14, 2024
a6538a8
update to 1.21
fayer3 Jun 14, 2024
34b1c72
toggle shaders off during menuworld loading to prevent random crashes
fayer3 Jun 15, 2024
ff05aea
always show alpha/beta updates when using one
fayer3 Jun 15, 2024
a5475d4
fix server not stopping
fayer3 Jun 20, 2024
ed52016
fix item tags and recipes
fayer3 Jun 20, 2024
b925e82
fix entity nametags
fayer3 Jun 29, 2024
68b8bb7
up neoforge minimum version, and fix connecting to servers without vi…
fayer3 Jul 6, 2024
b4cf2dc
fix modmenu 11.0.1 mods button colliding
fayer3 Jul 6, 2024
8553770
somewhat fix the Distanthorizons button being offscreen, it now is on…
fayer3 Jul 6, 2024
e018ba6
fix neoforge connecting to servers without vivecraft
fayer3 Jul 7, 2024
d1c9d07
Merge remote-tracking branch 'remotes/origin/Multiloader-1.20.4' into…
fayer3 Jul 7, 2024
4bed35c
1.20.5 fixes
fayer3 Jul 7, 2024
cdc7329
stupid workaround to make a functional forge jar, because arch loom s…
fayer3 Jul 8, 2024
f946d90
1.20.5 fixes
fayer3 Jul 8, 2024
d89c6e4
Merge remote-tracking branch 'remotes/origin/Multiloader-1.20.5' into…
fayer3 Jul 8, 2024
86bdd31
1.21 fixes
fayer3 Jul 8, 2024
24ef360
Merge remote-tracking branch 'remotes/origin/Multiloader-1.20.4' into…
fayer3 Jul 9, 2024
fa00cee
Merge remote-tracking branch 'remotes/origin/Multiloader-1.20.5' into…
fayer3 Jul 9, 2024
349b232
fix fire and totem of undying animation
fayer3 Jul 14, 2024
179192f
Merge remote-tracking branch 'remotes/origin/Multiloader-1.20.5' into…
fayer3 Jul 14, 2024
0b2ffdd
fix totem animation crashing the game
fayer3 Jul 14, 2024
2dd64ae
change recipes to vanilla components recipes
fayer3 Jul 20, 2024
6c61121
Merge branch 'refs/heads/Multiloader-1.20.5' into Multiloader-1.21
fayer3 Jul 23, 2024
d124dc2
fix xp orbs and other player facing stuff, as well as nametags with f…
fayer3 Jul 23, 2024
3450698
bump to beta3
fayer3 Jul 23, 2024
5dd2e1f
Merge branch 'refs/heads/Multiloader-1.20.5' into Multiloader-1.21
fayer3 Jul 23, 2024
2d893f8
up minimum neoforge version, to fix crash with the new mod config scr…
fayer3 Jul 27, 2024
f4f58ce
allow to load on 1.21.1
fayer3 Aug 9, 2024
ab0eed7
fix menuworlds with FerriteCore
fayer3 Aug 21, 2024
852d159
use minxin @Mutable, instead of accesswidener, and clarify that the c…
fayer3 Aug 22, 2024
a7515d0
Merge remote-tracking branch 'remotes/origin/Multiloader-1.20.4' into…
fayer3 Sep 15, 2024
ba554ee
remove forge fix command, since arch loom finally fixed it
fayer3 Sep 15, 2024
7ee2cdd
Merge remote-tracking branch 'remotes/origin/Multiloader-1.20.5' into…
fayer3 Sep 15, 2024
9e49613
fix optifine compatibility
fayer3 Sep 15, 2024
b266fd0
fix crash with iris 1.8 beta4
fayer3 Sep 18, 2024
0014dd7
bump to 1.1.12-b3
fayer3 Sep 18, 2024
2aea588
remove textureManager tick for menuworlds, since vanilla now always t…
fayer3 Sep 21, 2024
7fdcb55
fix menu rendering when inside a block
fayer3 Sep 23, 2024
0f8f684
account for player scale attribute
fayer3 Sep 24, 2024
e706a8d
bump version
fayer3 Sep 24, 2024
9b9a785
Merge remote-tracking branch 'remotes/origin/Multiloader-1.20.5' into…
fayer3 Sep 25, 2024
b619c40
1.21 fixes
fayer3 Sep 25, 2024
01f02e9
fix stub class types, fixing crash with iris 1.7.3
fayer3 Sep 27, 2024
23e1e13
fix mace hand position on controllers other than vive wands
fayer3 Sep 27, 2024
a0e55d5
fix crash with iris 1.7.3 when enabling VR in the main menu when a sh…
fayer3 Sep 27, 2024
5750107
bump to same beta as 1.21
fayer3 Sep 27, 2024
eea1369
Merge remote-tracking branch 'remotes/origin/Multiloader-1.20.5' into…
fayer3 Sep 27, 2024
a44f7a1
Merge remote-tracking branch 'remotes/origin/Multiloader-1.20.4' into…
fayer3 Oct 21, 2024
8b557ed
1.20.5 fixes
fayer3 Oct 21, 2024
41613bd
Merge remote-tracking branch 'remotes/origin/Multiloader-1.20.5' into…
fayer3 Oct 21, 2024
fa7cf01
fix cropped mirror aspect
fayer3 Oct 21, 2024
99d0177
compile against 1.21.1
fayer3 Oct 21, 2024
5545c14
fix shadows with iris 1.8 beta 5
fayer3 Nov 3, 2024
f129b12
bHaptics Integration
finaltransmit Nov 10, 2024
db34da6
bHaptics Integration 1.21 fix
finaltransmit Nov 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/publish-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
done < ./fabric/$2
}
parse_forge () {
unzip -o -j "$1" "META-INF/mods.toml" -d ./forge
unzip -o -j "$1" "META-INF/$2" -d ./forge
minecraftDep=false
minecraftIdReg='modId\s+=\s+"minecraft"'
versionRangeReg='versionRange\s+=\s+"(.+?)"'
Expand All @@ -91,7 +91,7 @@ jobs:
echo "${BASH_REMATCH[0]}"
echo "${BASH_REMATCH[1]}"
fi
done < ./forge/mods.toml
done < ./forge/$2
}
file=""
if [ -n "${{ steps.assets.outputs.FABRIC_FILE_NAME }}" ]; then
Expand Down Expand Up @@ -147,11 +147,11 @@ jobs:
echo "FABRIC_MC_VERSIONS="${parsedVersion}"" >> $GITHUB_OUTPUT
fi
if [ -n "${{ steps.assets.outputs.FORGE_FILE_NAME }}" ]; then
parse_forge ${{ steps.assets.outputs.FORGE_FILE_NAME }}
parse_forge ${{ steps.assets.outputs.FORGE_FILE_NAME }} "mods.toml"
echo "FORGE_MC_VERSIONS="${parsedVersion}"" >> $GITHUB_OUTPUT
fi
if [ -n "${{ steps.assets.outputs.NEOFORGE_FILE_NAME }}" ]; then
parse_forge ${{ steps.assets.outputs.NEOFORGE_FILE_NAME }}
parse_forge ${{ steps.assets.outputs.NEOFORGE_FILE_NAME }} "neoforge.mods.toml"
echo "NEOFORGE_MC_VERSIONS="${parsedVersion}"" >> $GITHUB_OUTPUT
fi
if [ -n "${{ steps.assets.outputs.QUILT_FILE_NAME }}" ]; then
Expand Down
15 changes: 9 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.5-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
id 'io.github.juuxel.loom-quiltflower' version '1.8.0' apply false
}

Expand All @@ -27,15 +27,18 @@ subprojects {
mappings loom.officialMojangMappings()
// The following line declares the yarn mappings you may select this one as well.
// mappings "net.fabricmc:yarn:1.18.2+build.4:v2"
implementation("org.lwjgl:lwjgl-openvr:3.3.2")
implementation("org.lwjgl:lwjgl-openvr:3.3.2:natives-linux")
implementation("org.lwjgl:lwjgl-openvr:3.3.2:natives-macos")
implementation("org.lwjgl:lwjgl-openvr:3.3.2:natives-windows")
implementation("org.lwjgl:lwjgl-openvr:3.3.3")
implementation("org.lwjgl:lwjgl-openvr:3.3.3:natives-linux")
implementation("org.lwjgl:lwjgl-openvr:3.3.3:natives-macos")
implementation("org.lwjgl:lwjgl-openvr:3.3.3:natives-windows")

// bHaptics Integration
implementation ("com.github.bhaptics:tact-java:0.1.4")
}

tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.release = 17
options.release = 21
}

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

// for sodium compat
modCompileOnly "maven.modrinth:sodium:mc1.20.4-0.5.8"
modCompileOnly "maven.modrinth:sodium:mc1.21-0.6.0-beta.2-fabric"

// for iris compat
modCompileOnly "maven.modrinth:iris:1.7.0+1.20.4"
modCompileOnly "maven.modrinth:iris:1.8.0-beta.4+1.21-fabric"

// for REI compat
modCompileOnly("me.shedaniel:RoughlyEnoughItems-fabric:14.0.688") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" exclude group: "dev.architectury" }
Expand All @@ -27,7 +27,7 @@ dependencies {
modApi("com.github.Virtuoel:Pehkui:3.7.12") { exclude group: "net.fabricmc" exclude group: "net.fabricmc.fabric-api" }

// other mods
modCompileOnly "maven.modrinth:dynamic-fps:3.4.1"
modCompileOnly "maven.modrinth:dynamic-fps:3.4.3"
// modCompileOnly("com.simibubi.create:create-fabric-1.19.2:0.5.0.i-969+1.19.2")
// modCompileOnly "maven.modrinth:lithium:mc1.20.4-0.12.1"
// modCompileOnly "maven.modrinth:indium:1.0.30+mc1.20.4"
Expand Down
6 changes: 1 addition & 5 deletions common/src/main/java/org/vivecraft/MixinConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import org.spongepowered.asm.service.MixinService;
import org.vivecraft.client.Xplat;
import org.vivecraft.client_vr.settings.VRSettings;
import org.vivecraft.mod_compat_vr.iris.mixin.coderbot.IrisChunkProgramOverridesMixinSodium_0_4_11;
import org.vivecraft.mod_compat_vr.iris.mixin.coderbot.IrisChunkProgramOverridesMixinSodium_0_4_9;
import org.vivecraft.mod_compat_vr.iris.mixin.irisshaders.IrisChunkProgramOverridesMixin;
import org.vivecraft.mod_compat_vr.iris.mixin.irisshaders.IrisChunkProgramOverridesMixinSodium_0_5_8;
import org.vivecraft.mod_compat_vr.iris.mixin.irisshaders.IrisChunkProgramOverridesMixinSodium_0_6;
Expand Down Expand Up @@ -74,9 +72,7 @@ public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {

String neededClass = "";
// apply iris sodium version specific mixins only when the right class is there
if (mixinClassName.equals(IrisChunkProgramOverridesMixinSodium_0_4_9.class.getName())) {
neededClass = "me.jellysquid.mods.sodium.client.render.vertex.type.ChunkVertexType";
} else if (mixinClassName.equals(IrisChunkProgramOverridesMixinSodium_0_4_11.class.getName()) || mixinClassName.equals(IrisChunkProgramOverridesMixinSodium_0_5_8.class.getName())
if (mixinClassName.equals(IrisChunkProgramOverridesMixinSodium_0_5_8.class.getName())
) {
neededClass = "me.jellysquid.mods.sodium.client.render.chunk.vertex.format.ChunkVertexType";
} else if (mixinClassName.equals(IrisChunkProgramOverridesMixinSodium_0_6.class.getName())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public RotInfo getRotationsForPlayer(UUID uuid) {
if (playermodelcontroller$rotinfo != null && this.vivePlayersLast.containsKey(uuid)) {
RotInfo playermodelcontroller$rotinfo1 = this.vivePlayersLast.get(uuid);
RotInfo playermodelcontroller$rotinfo2 = new RotInfo();
float f = Minecraft.getInstance().getFrameTime();
float f = Minecraft.getInstance().getTimer().getGameTimeDeltaPartialTick(false);
playermodelcontroller$rotinfo2.reverse = playermodelcontroller$rotinfo.reverse;
playermodelcontroller$rotinfo2.seated = playermodelcontroller$rotinfo.seated;
playermodelcontroller$rotinfo2.hmd = playermodelcontroller$rotinfo.hmd;
Expand Down
5 changes: 3 additions & 2 deletions common/src/main/java/org/vivecraft/client/Xevents.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.mojang.blaze3d.vertex.PoseStack;
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.client.DeltaTracker;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.block.state.BlockState;
Expand All @@ -24,12 +25,12 @@ static boolean renderFireOverlay(Player player, PoseStack mat) {
}

@ExpectPlatform
static void onRenderTickStart(float f) {
static void onRenderTickStart(DeltaTracker partialTick) {

}

@ExpectPlatform
static void onRenderTickEnd(float f) {
static void onRenderTickEnd(DeltaTracker partialTick) {

}
}
10 changes: 2 additions & 8 deletions common/src/main/java/org/vivecraft/client/Xplat.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.BiomeSpecialEffects;
Expand Down Expand Up @@ -102,11 +100,7 @@ static BiomeSpecialEffects getBiomeEffects(Biome biome) {
}

@ExpectPlatform
static double getItemEntityReach(double baseRange, ItemStack itemStack, EquipmentSlot slot) {
return 0;
}

@ExpectPlatform
static void addNetworkChannel(ClientPacketListener listener, ResourceLocation resourceLocation) {
static boolean serverAcceptsPacket(ClientPacketListener connection, ResourceLocation id) {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@

public interface RenderTargetExtension {

default void vivecraft$blitToScreen(int i, int viewWidth, int viewHeight, int j, boolean b, float f, float g, boolean c) {
vivecraft$blitToScreen(null, i, viewWidth, viewHeight, j, b, f, g, c);
}

void vivecraft$blitToScreen(ShaderInstance instance, int i, int viewWidth, int viewHeight, int j, boolean b, float f, float g, boolean c);
void vivecraft$blitToScreen(int i, int viewWidth, int viewHeight, int j, boolean b, float f, float g, boolean c);

default void vivecraft$genMipMaps() {
GL30.glGenerateMipmap(3553);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ protected void init() {

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

super.render(guiGraphics, i, j, f);
guiGraphics.drawCenteredString(this.font, this.title, this.width / 2, 15, 16777215);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,8 @@ protected void init() {

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

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ protected void init() {

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

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ public void onClose() {
this.minecraft.setScreen(lastScreen);
}

@Override
public void renderBackground(GuiGraphics guiGraphics, int i, int j, float f) {
this.renderDirtBackground(guiGraphics);
}

@Override
public void render(GuiGraphics guiGraphics, int i, int j, float f) {
if (reinit) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,15 @@ public static void resetServerSettings() {
}

public static void sendVersionInfo() {
//Minecraft.getInstance().getConnection().send(new ServerboundCustomPayloadPacket(new ChannelRegisterPacket(CommonNetworkHelper.CHANNEL.toString())));
Xplat.addNetworkChannel(Minecraft.getInstance().getConnection(), CommonNetworkHelper.CHANNEL);
// send version string, with currently running
Minecraft.getInstance().getConnection().send(getVivecraftClientPacket(CommonNetworkHelper.PacketDiscriminators.VERSION,
(CommonDataHolder.getInstance().versionIdentifier + (VRState.vrRunning ? " VR" : " NONVR")
+ "\n" + CommonNetworkHelper.MAX_SUPPORTED_NETWORK_VERSION
+ "\n" + CommonNetworkHelper.MIN_SUPPORTED_NETWORK_VERSION
).getBytes(Charsets.UTF_8)));
ClientPacketListener con = Minecraft.getInstance().getConnection();
if (con != null && Xplat.serverAcceptsPacket(con, CommonNetworkHelper.CHANNEL)) {
con.send(getVivecraftClientPacket(CommonNetworkHelper.PacketDiscriminators.VERSION,
(CommonDataHolder.getInstance().versionIdentifier + (VRState.vrRunning ? " VR" : " NONVR")
+ "\n" + CommonNetworkHelper.MAX_SUPPORTED_NETWORK_VERSION
+ "\n" + CommonNetworkHelper.MIN_SUPPORTED_NETWORK_VERSION
).getBytes(Charsets.UTF_8)));
}
}

public static void sendVRPlayerPositions(VRPlayer vrPlayer) {
Expand Down Expand Up @@ -255,7 +256,7 @@ public static void handlePacket(CommonNetworkHelper.PacketDiscriminators packetI

while (buffer.readableBytes() > 0) {
String s12 = buffer.readUtf(16384);
Block block = BuiltInRegistries.BLOCK.get(new ResourceLocation(s12));
Block block = BuiltInRegistries.BLOCK.get(ResourceLocation.parse(s12));

// if the block is not there AIR is returned
if (block != Blocks.AIR) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

public class HMDLayer extends RenderLayer<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> {

ResourceLocation DIAMOND_HMD = new ResourceLocation("vivecraft:textures/diamond_hmd.png");
ResourceLocation GOLD_HMD = new ResourceLocation("vivecraft:textures/gold_hmd.png");
ResourceLocation BLACK_HMD = new ResourceLocation("vivecraft:textures/black_hmd.png");
ResourceLocation DIAMOND_HMD = ResourceLocation.parse("vivecraft:textures/diamond_hmd.png");
ResourceLocation GOLD_HMD = ResourceLocation.parse("vivecraft:textures/gold_hmd.png");
ResourceLocation BLACK_HMD = ResourceLocation.parse("vivecraft:textures/black_hmd.png");

public HMDLayer(RenderLayerParent<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> renderLayerParent) {
super(renderLayerParent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.phys.Vec3;
import org.vivecraft.client.VRPlayersClient;
import org.vivecraft.client.Xplat;
import org.vivecraft.client_vr.utils.ScaleHelper;
import org.vivecraft.mod_compat_vr.optifine.OptifineHelper;
import org.vivecraft.mod_compat_vr.pehkui.PehkuiHelper;
import org.vivecraft.mod_compat_vr.sodium.SodiumHelper;

public class VRPlayerModel_WithArms<T extends LivingEntity> extends VRPlayerModel<T> {
Expand Down Expand Up @@ -157,13 +156,11 @@ public void setupAnim(T pEntity, float pLimbSwing, float pLimbSwingAmount, float
this.leftShoulder.y += 3.2F;
}

Vec3 vec3 = rotinfo.leftArmPos;
Vec3 vec32 = rotinfo.rightArmPos;
if (Xplat.isModLoaded("pehkui")) {
// remove pehkui scale from that, since the whole entity is scaled
vec3 = vec3.scale(1.0F / PehkuiHelper.getPlayerScale(pEntity, Minecraft.getInstance().getFrameTime()));
vec32 = vec32.scale(1.0F / PehkuiHelper.getPlayerScale(pEntity, Minecraft.getInstance().getFrameTime()));
}
// remove entity scale from that
float scale = 1.0F / ScaleHelper.getEntityScale(pEntity, Minecraft.getInstance().getTimer().getGameTimeDeltaPartialTick(false));
Vec3 vec3 = rotinfo.leftArmPos.scale(scale);
Vec3 vec32 = rotinfo.rightArmPos.scale(scale);

vec3 = vec3.add(0.0D, d0, 0.0D);
vec3 = vec3.yRot((float) (-Math.PI + d1));
vec3 = vec3.scale(16.0F / rotinfo.heightScale);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ public void setModelProperties(AbstractClientPlayer pClientPlayer) {
}

@Override
protected void setupRotations(AbstractClientPlayer pEntityLiving, PoseStack pMatrixStack, float pAgeInTicks, float pRotationYaw, float pPartialTicks) {
protected void setupRotations(AbstractClientPlayer pEntityLiving, PoseStack pMatrixStack, float pAgeInTicks, float pRotationYaw, float pPartialTicks, float entityScale) {
UUID uuid = pEntityLiving.getUUID();
if (ClientDataHolderVR.getInstance().currentPass != RenderPass.GUI && VRPlayersClient.getInstance().isTracked(uuid)) {
VRPlayersClient.RotInfo playermodelcontroller$rotinfo = VRPlayersClient.getInstance().getRotationsForPlayer(uuid);
pRotationYaw = (float) Math.toDegrees(playermodelcontroller$rotinfo.getBodyYawRadians());
}

//vanilla below here
super.setupRotations(pEntityLiving, pMatrixStack, pAgeInTicks, pRotationYaw, pPartialTicks);
super.setupRotations(pEntityLiving, pMatrixStack, pAgeInTicks, pRotationYaw, pPartialTicks, entityScale);
}
}
12 changes: 4 additions & 8 deletions common/src/main/java/org/vivecraft/client/utils/Debug.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package org.vivecraft.client.utils;

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.Tesselator;
import com.mojang.blaze3d.vertex.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.debug.DebugRenderer;
Expand Down Expand Up @@ -169,17 +167,15 @@ public void render(float partialTicks, long finishTimeNano) {
//GlStateManager._disableLighting();
RenderSystem.depthMask(false);
RenderSystem.disableDepthTest();
Tesselator tesselator = Tesselator.getInstance();
BufferBuilder bufferbuilder = tesselator.getBuilder();
//bufferbuilder.begin(3, DefaultVertexFormat.POSITION_COLOR);
BufferBuilder bufferbuilder = Tesselator.getInstance().begin(VertexFormat.Mode.DEBUG_LINE_STRIP, DefaultVertexFormat.POSITION_COLOR);

for (Polygon debug$polygon : this.toDraw) {
for (int i = 0; i < debug$polygon.vertices.length; ++i) {
this.renderVertex(bufferbuilder, debug$polygon.vertices[i], debug$polygon.colors[i], d0, d1, d2);
}
}

tesselator.end();
BufferUploader.drawWithShader(bufferbuilder.buildOrThrow());
RenderSystem.depthMask(true);
//GlStateManager._enableLighting();
RenderSystem.enableDepthTest();
Expand All @@ -194,7 +190,7 @@ public void clear() {
}

void renderVertex(BufferBuilder buffer, Vec3 vert, Color color, double offX, double offY, double offZ) {
buffer.vertex(vert.x - offX, vert.y - offY, vert.z - offZ).color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()).endVertex();
buffer.addVertex((float) (vert.x - offX), (float) (vert.y - offY), (float) (vert.z - offZ)).setColor(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha());
}

public void render(PoseStack pMatrixStack, MultiBufferSource pBuffer, double pCamX, double p_113510_, double pCamY) {
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/java/org/vivecraft/client/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public static InputStream getAssetAsStream(String name, boolean required) {

try {
try {
Optional<Resource> resource = Minecraft.getInstance().getResourceManager().getResource(new ResourceLocation("vivecraft", name));
Optional<Resource> resource = Minecraft.getInstance().getResourceManager().getResource(ResourceLocation.fromNamespaceAndPath("vivecraft", name));
if (resource.isPresent()) {
inputstream = resource.get().open();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.BufferBuilder;
import com.mojang.blaze3d.vertex.BufferUploader;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.Tesselator;
import com.mojang.blaze3d.vertex.VertexFormat.Mode;
Expand Down Expand Up @@ -72,22 +73,20 @@ public void render(int vertexCount, Color c, float partialTicks) {
double d2 = player.zOld + (player.getZ() - player.zOld) * (double) partialTicks;
//GlStateManager._disableLighting();
RenderSystem.depthMask(false);
Tesselator tesselator = Tesselator.getInstance();
BufferBuilder bufferbuilder = tesselator.getBuilder();
bufferbuilder.begin(Mode.LINES, DefaultVertexFormat.POSITION_COLOR);
BufferBuilder bufferbuilder = Tesselator.getInstance().begin(Mode.LINES, DefaultVertexFormat.POSITION_COLOR);
Vec3[] avec3 = this.getLinearInterpolation(vertexCount / this.nodes.size());

for (int i = 0; i < avec3.length; ++i) {
this.renderVertex(bufferbuilder, avec3[i], c, d0, d1, d2);
}

tesselator.end();
BufferUploader.drawWithShader(bufferbuilder.buildOrThrow());
//GlStateManager._enableLighting();
RenderSystem.depthMask(true);
}

void renderVertex(BufferBuilder buffer, Vec3 vert, Color color, double offX, double offY, double offZ) {
buffer.vertex(vert.x - offX, vert.y - offY, vert.z - offZ).color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()).endVertex();
buffer.addVertex((float) (vert.x - offX), (float) (vert.y - offY), (float) (vert.z - offZ)).setColor(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha());
}

public static class Node {
Expand Down
Loading