-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
248 additions
and
859 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
16 changes: 0 additions & 16 deletions
16
src/main/java/nl/enjarai/showmeyourskin/compat/elytratrinket/ElytraTrinketMixinPlugin.java
This file was deleted.
Oops, something went wrong.
63 changes: 0 additions & 63 deletions
63
...java/nl/enjarai/showmeyourskin/compat/elytratrinket/mixin/ElytraTrinketRendererMixin.java
This file was deleted.
Oops, something went wrong.
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
44 changes: 44 additions & 0 deletions
44
src/main/java/nl/enjarai/showmeyourskin/mixin/EntityRenderDispatcherMixin.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,44 @@ | ||
package nl.enjarai.showmeyourskin.mixin; | ||
|
||
import com.llamalad7.mixinextras.sugar.Share; | ||
import com.llamalad7.mixinextras.sugar.ref.LocalRef; | ||
import net.minecraft.client.render.VertexConsumerProvider; | ||
import net.minecraft.client.render.entity.EntityRenderDispatcher; | ||
import net.minecraft.client.render.entity.EntityRenderer; | ||
import net.minecraft.client.render.entity.state.EntityRenderState; | ||
import net.minecraft.client.util.math.MatrixStack; | ||
import net.minecraft.entity.Entity; | ||
import nl.enjarai.showmeyourskin.ShowMeYourSkin; | ||
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; | ||
|
||
@Mixin(EntityRenderDispatcher.class) | ||
public class EntityRenderDispatcherMixin { | ||
@Inject( | ||
method = "render(Lnet/minecraft/entity/Entity;DDDFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/client/render/entity/EntityRenderer;)V", | ||
at = @At("HEAD") | ||
) | ||
private <E extends Entity, S extends EntityRenderState> void captureEntityContext(E entity, double x, double y, double z, | ||
float tickDelta, MatrixStack matrices, | ||
VertexConsumerProvider vertexConsumers, | ||
int light, EntityRenderer<? super E, S> renderer, | ||
CallbackInfo ci, | ||
@Share(namespace = ShowMeYourSkin.MODID, value = "renderedEntity") LocalRef<Entity> ctx) { | ||
ctx.set(entity); | ||
} | ||
|
||
@Inject( | ||
method = "render(Lnet/minecraft/entity/Entity;DDDFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/client/render/entity/EntityRenderer;)V", | ||
at = @At("RETURN") | ||
) | ||
private <E extends Entity, S extends EntityRenderState> void clearEntityContext(E entity, double x, double y, double z, | ||
float tickDelta, MatrixStack matrices, | ||
VertexConsumerProvider vertexConsumers, | ||
int light, EntityRenderer<? super E, S> renderer, | ||
CallbackInfo ci, | ||
@Share(namespace = ShowMeYourSkin.MODID, value = "renderedEntity") LocalRef<Entity> ctx) { | ||
ctx.set(null); | ||
} | ||
} |
14 changes: 9 additions & 5 deletions
14
...urskin/mixin/ClientPlayerEntityMixin.java → ...owmeyourskin/mixin/LivingEntityMixin.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,20 +1,24 @@ | ||
package nl.enjarai.showmeyourskin.mixin; | ||
|
||
import net.minecraft.client.network.ClientPlayerEntity; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.entity.damage.DamageSource; | ||
import nl.enjarai.showmeyourskin.util.CombatLogger; | ||
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 org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(ClientPlayerEntity.class) | ||
public abstract class ClientPlayerEntityMixin { | ||
@Mixin(LivingEntity.class) | ||
public abstract class LivingEntityMixin { | ||
@Inject( | ||
method = "damage(Lnet/minecraft/entity/damage/DamageSource;F)Z", | ||
method = "onDamaged", | ||
at = @At(value = "HEAD") | ||
) | ||
private void showmeyourskin$triggerCombat(DamageSource source, float amount, CallbackInfoReturnable<Boolean> cir) { | ||
CombatLogger.INSTANCE.triggerCombat(((ClientPlayerEntity) (Object) this).getUuid()); | ||
private void showmeyourskin$triggerCombat(DamageSource damageSource, CallbackInfo ci) { | ||
if ((Object) this instanceof ClientPlayerEntity player) { | ||
CombatLogger.INSTANCE.triggerCombat(player.getUuid()); | ||
} | ||
} | ||
} |
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
20 changes: 0 additions & 20 deletions
20
src/main/java/nl/enjarai/showmeyourskin/mixin/OtherClientPlayerEntityMixin.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.