Disabled the id tags in F3 mode and config option for this

master
Wynd 2023-10-07 15:39:21 +03:00
parent 166c43d9c4
commit 26d3b8207d
2 changed files with 19 additions and 6 deletions

View File

@ -17,8 +17,9 @@ public class ModConfig {
public static final Option<Boolean> SUGAR_CANE_ON_SAND = make("Sugar Cane on sand", true, "Allows sugar canes to be placed on sand");
public static final Option<Boolean> ADD_MORE_SOUNDS = make("Add more sounds", true,
"Links a few more sounds from your local 'resources' folder with the game, namely for item breaking, minecarts and chests");
public static final Option<Boolean> ENABLE_CLOUDS = make("Enable Clouds", true,
"Enables the rendering of clouds");
public static final Option<Boolean> ENABLE_CLOUDS = make("Enable Clouds", true, "Enables the rendering of clouds");
public static final Option<Boolean> DISABLE_ID_TAGS = make("Disable ID Tags", true,
"Disables id tags showing above entities in F3 mode");
public static final Option<Boolean> FIX_BOW_MODEL = make("Fix bow model", true,
"Makes the box model held by players and skeletons bigger and facing forward");

View File

@ -2,9 +2,14 @@ package xyz.pixelatedw.finalbeta.mixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.client.render.entity.LivingEntityRenderer;
import net.minecraft.client.render.entity.model.EntityModel;
import net.minecraft.entity.LivingEntity;
import xyz.pixelatedw.finalbeta.ModConfig;
@Mixin(LivingEntityRenderer.class)
public class LivingEntityRendererMixin {
@ -13,4 +18,11 @@ public class LivingEntityRendererMixin {
@Shadow
protected EntityModel model;
@Inject(method = "method_821", at = @At("HEAD"), cancellable = true)
public void method_821(LivingEntity entity, double d, double d1, double d2, CallbackInfo ci) {
if (ModConfig.DISABLE_ID_TAGS.get()) {
ci.cancel();
}
}
}