-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hide curios/trinket head cosmetics in first person
- Loading branch information
Showing
10 changed files
with
96 additions
and
1 deletion.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
common/src/main/java/org/vivecraft/mod_compat_vr/curios/mixin/CuriosLayerVRMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.vivecraft.mod_compat_vr.curios.mixin; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import org.vivecraft.client_vr.render.helpers.VREffectsHelper; | ||
|
||
@Pseudo | ||
@Mixin(targets = "top.theillusivec4.curios.client.render.CuriosLayer") | ||
public class CuriosLayerVRMixin { | ||
@Inject(method = "lambda$render$1(Lnet/minecraft/world/entity/LivingEntity;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;IFFFFFFLjava/lang/String;Ltop/theillusivec4/curios/api/type/inventory/ICurioStacksHandler;)V", at = @At("HEAD"), cancellable = true) | ||
private void vivecraft$noHeadInFirstPerson( | ||
CallbackInfo ci, @Local(argsOnly = true) LivingEntity entity, @Local(argsOnly = true) String id) | ||
{ | ||
if ("head".equals(id) && VREffectsHelper.isRenderingFirstPersonPlayer(entity)) { | ||
ci.cancel(); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...c/main/java/org/vivecraft/mod_compat_vr/trinkets/mixin/TrinketFeatureRendererVRMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.vivecraft.mod_compat_vr.trinkets.mixin; | ||
|
||
import com.llamalad7.mixinextras.sugar.Local; | ||
import dev.emi.trinkets.api.SlotReference; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Pseudo; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import org.vivecraft.client_vr.render.helpers.VREffectsHelper; | ||
|
||
@Pseudo | ||
@Mixin(targets = "dev.emi.trinkets.TrinketFeatureRenderer") | ||
public class TrinketFeatureRendererVRMixin { | ||
|
||
@Inject(method = "lambda$render$1(Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;ILnet/minecraft/world/entity/LivingEntity;FFFFFFLdev/emi/trinkets/api/SlotReference;Lnet/minecraft/world/item/ItemStack;)V", at = @At("HEAD"), cancellable = true) | ||
private void vivecraft$noHeadInFirstPerson( | ||
CallbackInfo ci, @Local(argsOnly = true) LivingEntity entity, @Local(argsOnly = true) SlotReference reference) | ||
{ | ||
if ("head".equals(reference.inventory().getSlotType().getGroup()) && | ||
VREffectsHelper.isRenderingFirstPersonPlayer(entity)) | ||
{ | ||
ci.cancel(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"required": false, | ||
"package": "org.vivecraft.mod_compat_vr.curios.mixin", | ||
"plugin": "org.vivecraft.MixinConfig", | ||
"compatibilityLevel": "JAVA_17", | ||
"client": [ | ||
"CuriosLayerVRMixin" | ||
], | ||
"minVersion": "0.8.4" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"required": false, | ||
"package": "org.vivecraft.mod_compat_vr.trinkets.mixin", | ||
"plugin": "org.vivecraft.MixinConfig", | ||
"compatibilityLevel": "JAVA_17", | ||
"client": [ | ||
"TrinketFeatureRendererVRMixin" | ||
], | ||
"minVersion": "0.8.4" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package dev.emi.trinkets.api; | ||
|
||
public record SlotReference(TrinketInventory inventory, int index) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package dev.emi.trinkets.api; | ||
|
||
public class SlotType { | ||
public String getGroup() { | ||
return ""; | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
stubs/src/main/java/dev/emi/trinkets/api/TrinketInventory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package dev.emi.trinkets.api; | ||
|
||
public class TrinketInventory { | ||
public SlotType getSlotType() { | ||
return null; | ||
} | ||
} |