Skip to content

Commit

Permalink
Update to 1.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Woolyenough committed Dec 4, 2024
1 parent 9214bbc commit 612b902
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
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'
}

Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.21
yarn_mappings=1.21+build.9
loader_version=0.15.11
minecraft_version=1.21.2
yarn_mappings=1.21.2+build.1
loader_version=0.16.9

# Mod Properties
mod_version=v1.3
mod_version=v1.4
maven_group=wtf.wooly
archives_base_name=hide-arrows

# Dependencies
fabric_version=0.100.6+1.21
fabric_version=0.106.1+1.21.2
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
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);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package wtf.wooly.hide_arrows.mixin;


import net.minecraft.entity.LivingEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
}
],
"depends": {
"fabricloader": ">=0.15.11",
"minecraft": ">=1.21",
"fabricloader": ">=0.16",
"minecraft": ">=1.21.2",
"java": ">=21",
"fabric-api": "*"
},
Expand Down

0 comments on commit 612b902

Please sign in to comment.