forked from Sk1erLLC/Patcher
-
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.
change: use mixin for clean projectiles
- Loading branch information
Showing
4 changed files
with
29 additions
and
56 deletions.
There are no files selected for viewing
55 changes: 0 additions & 55 deletions
55
src/main/java/club/sk1er/patcher/asm/render/world/entity/RenderSnowballTransformer.java
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
src/main/java/club/sk1er/patcher/mixins/features/RenderSnowballMixin_CleanProjectiles.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,28 @@ | ||
package club.sk1er.patcher.mixins.features; | ||
|
||
import club.sk1er.patcher.asm.external.mods.optifine.RenderTransformer; | ||
import club.sk1er.patcher.config.PatcherConfig; | ||
import net.minecraft.client.renderer.entity.RenderSnowball; | ||
import net.minecraft.entity.Entity; | ||
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.ModifyArg; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(RenderSnowball.class) | ||
public class RenderSnowballMixin_CleanProjectiles<T extends Entity> { | ||
|
||
@Inject(method = "doRender", at = @At("HEAD"), cancellable = true) | ||
public void patcher$cleanProjectiles(T entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo ci) { | ||
if (PatcherConfig.cleanProjectiles && entity.ticksExisted < 2) ci.cancel(); | ||
} | ||
|
||
//#if MC==10809 | ||
@ModifyArg(method = "doRender", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V", ordinal = 1), index = 0) | ||
public float patcher$fixPerspectiveRendering(float x) { | ||
return RenderTransformer.checkPerspective() * x; | ||
} | ||
//#endif | ||
} |
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