forked from tr7zw/FirstPersonModel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request tr7zw#8 from tr7zw/Update_1.15.2
Update 1.15.2
- Loading branch information
Showing
9 changed files
with
87 additions
and
138 deletions.
There are no files selected for viewing
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
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
60 changes: 31 additions & 29 deletions
60
...n/mixins/EntityRenderDispatcherMixin.java → ...irstperson/mixins/WorldRendererMixin.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 |
---|---|---|
@@ -1,29 +1,31 @@ | ||
package de.tr7zw.firstperson.mixins; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import de.tr7zw.firstperson.FirstPersonModelMod; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.network.AbstractClientPlayerEntity; | ||
import net.minecraft.client.render.entity.EntityRenderDispatcher; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
|
||
@Mixin(EntityRenderDispatcher.class) | ||
public class EntityRenderDispatcherMixin { | ||
|
||
@Inject(at = @At("HEAD"), method = "render") | ||
public void render(Entity entity_1, float float_1, boolean boolean_1, CallbackInfo info) { | ||
if(MinecraftClient.getInstance().options.perspective != 0)return; | ||
if(entity_1 instanceof AbstractClientPlayerEntity) { | ||
if(!((PlayerEntity) entity_1).isMainPlayer())return; | ||
FirstPersonModelMod.hideNextHeadArmor = true; | ||
FirstPersonModelMod.hideNextHeadItem = true; | ||
FirstPersonModelMod.isRenderingPlayer = true; | ||
} | ||
} | ||
|
||
} | ||
package de.tr7zw.firstperson.mixins; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import de.tr7zw.firstperson.FirstPersonModelMod; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.network.AbstractClientPlayerEntity; | ||
import net.minecraft.client.render.VertexConsumerProvider; | ||
import net.minecraft.client.render.WorldRenderer; | ||
import net.minecraft.client.util.math.MatrixStack; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
|
||
@Mixin(WorldRenderer.class) | ||
public class WorldRendererMixin { | ||
|
||
@Inject(at = @At("HEAD"), method = "renderEntity") | ||
private void renderEntity(Entity entity_1, double double_1, double double_2, double double_3, float float_1, MatrixStack matrixStack_1, VertexConsumerProvider vertexConsumerProvider_1, CallbackInfo info) { | ||
if(MinecraftClient.getInstance().options.perspective != 0)return; | ||
if(entity_1 instanceof AbstractClientPlayerEntity) { | ||
if(!((PlayerEntity) entity_1).isMainPlayer())return; | ||
FirstPersonModelMod.hideNextHeadArmor = true; | ||
FirstPersonModelMod.hideNextHeadItem = true; | ||
FirstPersonModelMod.isRenderingPlayer = true; | ||
} | ||
} | ||
|
||
} |
Oops, something went wrong.