Implements RangeSelectItemModelProperty
API Surface (2) float get(final ItemStack itemStack, final @Nullable ClientLevel level, final @Nullable ItemOwner owner, final int seed)
MapCodec<CompassAngle> type()
Code Graph: Dependencies (5) Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.
Full Source
CompassAngle.java 34 lines · Minecraft 26.3 · verbatim Copy
1 package net.minecraft.client.renderer.item.properties.numeric;
2
3 import com.mojang.serialization.MapCodec;
4 import net.fabricmc.api.EnvType;
5 import net.fabricmc.api.Environment;
6 import net.minecraft.client.multiplayer.ClientLevel;
7 import net.minecraft.world.entity.ItemOwner;
8 import net.minecraft.world.item.ItemStack;
9 import org.jspecify.annotations.Nullable;
10
11 @Environment(EnvType.CLIENT)
12 public class CompassAngle implements RangeSelectItemModelProperty {
13 public static final MapCodec<CompassAngle> MAP_CODEC = CompassAngleState.MAP_CODEC.xmap(CompassAngle::new, c -> c.state);
14 private final CompassAngleState state;
15
16 public CompassAngle(final boolean wobble, final CompassAngleState.CompassTarget compassTarget) {
17 this(new CompassAngleState(wobble, compassTarget));
18 }
19
20 private CompassAngle(final CompassAngleState state) {
21 this.state = state;
22 }
23
24 @Override
25 public float get(final ItemStack itemStack, final @Nullable ClientLevel level, final @Nullable ItemOwner owner, final int seed) {
26 return this.state.get(itemStack, level, owner, seed);
27 }
28
29 @Override
30 public MapCodec<CompassAngle> type() {
31 return MAP_CODEC;
32 }
33 }
34
Decompiled Minecraft 26.3 source of CompassAngle (net/minecraft/client/renderer/item/properties/numeric/CompassAngle.java) with Mojang official mappings, stored verbatim on the site.