-
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.
- Loading branch information
1 parent
9214bbc
commit 612b902
Showing
6 changed files
with
34 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
plugins { | ||
id 'fabric-loom' version '1.7-SNAPSHOT' | ||
id 'fabric-loom' version '1.9-SNAPSHOT' | ||
id 'maven-publish' | ||
} | ||
|
||
|
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
30 changes: 25 additions & 5 deletions
30
src/client/java/wtf/wooly/hide_arrows/mixin/client/ArrowsMixin.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,18 +1,38 @@ | ||
package wtf.wooly.hide_arrows.mixin.client; | ||
|
||
import net.minecraft.client.render.VertexConsumerProvider; | ||
import net.minecraft.client.render.entity.feature.StuckArrowsFeatureRenderer; | ||
import net.minecraft.client.render.entity.ArrowEntityRenderer; | ||
import net.minecraft.client.render.entity.feature.StuckObjectsFeatureRenderer; | ||
import net.minecraft.client.util.math.MatrixStack; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.util.Identifier; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
@Mixin(StuckArrowsFeatureRenderer.class) | ||
import java.lang.reflect.Field; | ||
|
||
@Mixin(StuckObjectsFeatureRenderer.class) | ||
public class ArrowsMixin { | ||
|
||
@Unique | ||
private static final Logger LOGGER = LogManager.getLogger(); | ||
|
||
@Inject(method = "renderObject", at = @At("HEAD"), cancellable = true) | ||
private void cancel(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, Entity entity, float directionX, float directionY, float directionZ, float tickDelta, CallbackInfo ci) { | ||
ci.cancel(); | ||
private void cancelRendering(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, float f, float directionX, float directionY, CallbackInfo ci) { | ||
try { | ||
Field textureField = StuckObjectsFeatureRenderer.class.getDeclaredField("texture"); | ||
textureField.setAccessible(true); | ||
Identifier texture = (Identifier) textureField.get(this); | ||
|
||
if(texture == ArrowEntityRenderer.TEXTURE){ | ||
ci.cancel(); | ||
} | ||
} catch (NoSuchFieldException | IllegalAccessException e) { | ||
LOGGER.error("Failed to access 'texture' field in StuckObjectsFeatureRenderer", e); | ||
} | ||
} | ||
} |
1 change: 0 additions & 1 deletion
1
src/main/java/wtf/wooly/hide_arrows/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
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