Skip to content

Commit f467da8

Browse files
committed
v0.0.4.1
1 parent 25a66d8 commit f467da8

37 files changed

+262
-204
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ fabricApi {
4242

4343
dependencies {
4444
// To change the versions see the gradle.properties file
45-
minecraft "net.minecraft:minecraft:${project.minecraft_version}"
45+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
4646
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
4747
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
4848

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ org.gradle.parallel=true
44

55
# Fabric Properties
66
# check these on https://fabricmc.net/develop
7-
minecraft_version=1.21.4
8-
yarn_mappings=1.21.4+build.8
9-
loader_version=0.16.10
7+
minecraft_version=1.21.5
8+
yarn_mappings=1.21.5+build.1
9+
loader_version=0.16.13
1010

1111
# Mod Properties
12-
mod_version=0.0.4
12+
mod_version=0.0.4.1
1313
maven_group=net.db64.homelawnsecurity
1414
archives_base_name=homelawnsecurity
1515

1616
# Dependencies
17-
fabric_version=0.119.0+1.21.4
17+
fabric_version=0.120.0+1.21.5
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package net.db64.homelawnsecurity.component;
2+
3+
import com.mojang.serialization.Codec;
4+
import com.mojang.serialization.codecs.RecordCodecBuilder;
5+
import net.minecraft.component.ComponentsAccess;
6+
import net.minecraft.item.Item;
7+
import net.minecraft.item.tooltip.TooltipAppender;
8+
import net.minecraft.item.tooltip.TooltipType;
9+
import net.minecraft.network.RegistryByteBuf;
10+
import net.minecraft.network.codec.PacketCodec;
11+
import net.minecraft.network.codec.PacketCodecs;
12+
import net.minecraft.text.Text;
13+
import net.minecraft.util.dynamic.Codecs;
14+
15+
import java.util.function.Consumer;
16+
17+
public record BagOfCurrencyComponent(int amount, String name) implements TooltipAppender {
18+
public static final Codec<BagOfCurrencyComponent> CODEC = RecordCodecBuilder.create(
19+
instance -> instance.group(
20+
Codecs.NON_NEGATIVE_INT.fieldOf("amount").forGetter(BagOfCurrencyComponent::amount),
21+
Codecs.NON_EMPTY_STRING.fieldOf("name").forGetter(BagOfCurrencyComponent::name)
22+
)
23+
.apply(instance, BagOfCurrencyComponent::new)
24+
);
25+
public static final PacketCodec<RegistryByteBuf, BagOfCurrencyComponent> PACKET_CODEC = PacketCodec.tuple(
26+
PacketCodecs.VAR_INT,
27+
BagOfCurrencyComponent::amount,
28+
PacketCodecs.STRING,
29+
BagOfCurrencyComponent::name,
30+
BagOfCurrencyComponent::new
31+
);
32+
33+
@Override
34+
public void appendTooltip(Item.TooltipContext context, Consumer<Text> tooltip, TooltipType type, ComponentsAccess components) {
35+
tooltip.accept(Text.translatable("tooltip.homelawnsecurity.bag_of_" + name, amount));
36+
}
37+
38+
public static class Builder {
39+
private int amount;
40+
private String name;
41+
42+
public BagOfCurrencyComponent.Builder amount(int amount) {
43+
this.amount = amount;
44+
return this;
45+
}
46+
47+
public BagOfCurrencyComponent.Builder name(String name) {
48+
this.name = name;
49+
return this;
50+
}
51+
52+
public BagOfCurrencyComponent build() {
53+
return new BagOfCurrencyComponent(this.amount, this.name);
54+
}
55+
}
56+
}

src/main/java/net/db64/homelawnsecurity/component/CurrencyComponent.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22

33
import com.mojang.serialization.Codec;
44
import com.mojang.serialization.codecs.RecordCodecBuilder;
5+
import net.minecraft.component.ComponentsAccess;
6+
import net.minecraft.item.Item;
7+
import net.minecraft.item.tooltip.TooltipAppender;
8+
import net.minecraft.item.tooltip.TooltipType;
59
import net.minecraft.network.RegistryByteBuf;
610
import net.minecraft.network.codec.PacketCodec;
711
import net.minecraft.network.codec.PacketCodecs;
12+
import net.minecraft.text.Text;
813
import net.minecraft.util.dynamic.Codecs;
914

10-
public record CurrencyComponent(int amount, String name) {
15+
import java.util.function.Consumer;
16+
17+
public record CurrencyComponent(int amount, String name) implements TooltipAppender {
1118
public static final Codec<CurrencyComponent> CODEC = RecordCodecBuilder.create(
1219
instance -> instance.group(
1320
Codecs.NON_NEGATIVE_INT.fieldOf("amount").forGetter(CurrencyComponent::amount),
@@ -23,16 +30,21 @@ public record CurrencyComponent(int amount, String name) {
2330
CurrencyComponent::new
2431
);
2532

33+
@Override
34+
public void appendTooltip(Item.TooltipContext context, Consumer<Text> tooltip, TooltipType type, ComponentsAccess components) {
35+
tooltip.accept(Text.translatable("tooltip.homelawnsecurity.currency." + name, amount));
36+
}
37+
2638
public static class Builder {
2739
private int amount;
2840
private String name;
2941

30-
public CurrencyComponent.Builder cost(int amount) {
42+
public CurrencyComponent.Builder amount(int amount) {
3143
this.amount = amount;
3244
return this;
3345
}
3446

35-
public CurrencyComponent.Builder cooldown(String name) {
47+
public CurrencyComponent.Builder name(String name) {
3648
this.name = name;
3749
return this;
3850
}

src/main/java/net/db64/homelawnsecurity/component/ModDataComponentTypes.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public class ModDataComponentTypes {
1414
public static final ComponentType<CurrencyComponent> CURRENCY =
1515
register("currency", builder -> builder.codec(CurrencyComponent.CODEC).packetCodec(CurrencyComponent.PACKET_CODEC));
1616

17+
public static final ComponentType<BagOfCurrencyComponent> BAG_OF_CURRENCY =
18+
register("bag_of_currency", builder -> builder.codec(BagOfCurrencyComponent.CODEC).packetCodec(BagOfCurrencyComponent.PACKET_CODEC));
19+
1720
public static final ComponentType<SeedPacketComponent> SEED_PACKET =
1821
register("seed_packet", builder -> builder.codec(SeedPacketComponent.CODEC).packetCodec(SeedPacketComponent.PACKET_CODEC));
1922

src/main/java/net/db64/homelawnsecurity/component/TooltipComponent.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import com.google.common.collect.Lists;
55
import com.mojang.serialization.Codec;
6+
import net.minecraft.component.ComponentsAccess;
67
import net.minecraft.item.Item;
78
import net.minecraft.item.tooltip.TooltipAppender;
89
import net.minecraft.item.tooltip.TooltipType;
@@ -22,11 +23,9 @@
2223
public record TooltipComponent(List<Text> lines, List<Text> styledLines) implements TooltipAppender {
2324
public static final TooltipComponent DEFAULT = new TooltipComponent(List.of());
2425
public static final int MAX_TOOLTIPS = 256;
25-
private static final Style STYLE = Style.EMPTY.withColor(Formatting.GRAY);
26-
public static final Codec<TooltipComponent> CODEC = TextCodecs.STRINGIFIED_CODEC.sizeLimitedListOf(256).xmap(TooltipComponent::new, TooltipComponent::lines);
27-
public static final PacketCodec<RegistryByteBuf, TooltipComponent> PACKET_CODEC = TextCodecs.REGISTRY_PACKET_CODEC
28-
.collect(PacketCodecs.toList(MAX_TOOLTIPS))
29-
.xmap(TooltipComponent::new, TooltipComponent::lines);
26+
private static final Style STYLE;
27+
public static final Codec<TooltipComponent> CODEC;
28+
public static final PacketCodec<RegistryByteBuf, TooltipComponent> PACKET_CODEC;
3029

3130
public TooltipComponent(List<Text> lines) {
3231
this(lines, Lists.transform(lines, style -> Texts.setStyleIfAbsent(style.copy(), STYLE)));
@@ -46,7 +45,13 @@ public TooltipComponent with(Text line) {
4645
}
4746

4847
@Override
49-
public void appendTooltip(Item.TooltipContext context, Consumer<Text> tooltip, TooltipType type) {
48+
public void appendTooltip(Item.TooltipContext context, Consumer<Text> tooltip, TooltipType type, ComponentsAccess components) {
5049
this.styledLines.forEach(tooltip);
5150
}
51+
52+
static {
53+
STYLE = Style.EMPTY.withColor(Formatting.GRAY);
54+
CODEC = TextCodecs.CODEC.sizeLimitedListOf(256).xmap(TooltipComponent::new, TooltipComponent::lines);
55+
PACKET_CODEC = TextCodecs.REGISTRY_PACKET_CODEC.collect(PacketCodecs.toList(256)).xmap(TooltipComponent::new, TooltipComponent::lines);
56+
}
5257
}

src/main/java/net/db64/homelawnsecurity/datagen/ModModelProvider.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ public static void registerLawnBlock(BlockStateModelGenerator blockStateModelGen
7676
.put(TextureKey.BOTTOM, TextureMap.getId(ModBlocks.UNSODDED_LAWN_BLOCK))
7777
.put(TextureKey.TOP, TextureMap.getSubId(block, "_top"))
7878
.put(TextureKey.SIDE, TextureMap.getSubId(ModBlocks.LAWN_BLOCK, "_side"));
79-
blockStateModelGenerator.blockStateCollector.accept(BlockStateModelGenerator.createSingletonBlockState(block, Models.CUBE_BOTTOM_TOP.upload(block, textureMap, blockStateModelGenerator.modelCollector)));
79+
blockStateModelGenerator.blockStateCollector.accept(BlockStateModelGenerator.createSingletonBlockState(block, BlockStateModelGenerator.createWeightedVariant(Models.CUBE_BOTTOM_TOP.upload(block, textureMap, blockStateModelGenerator.modelCollector))));
8080
}
8181

8282
public static void registerUnsoddedPathBlock(BlockStateModelGenerator blockStateModelGenerator, Block block) {
8383
TextureMap textureMap = new TextureMap()
8484
.put(TextureKey.BOTTOM, TextureMap.getId(ModBlocks.UNSODDED_LAWN_BLOCK))
8585
.put(TextureKey.TOP, TextureMap.getSubId(block, "_top"))
8686
.put(TextureKey.SIDE, TextureMap.getId(ModBlocks.UNSODDED_LAWN_BLOCK));
87-
blockStateModelGenerator.blockStateCollector.accept(BlockStateModelGenerator.createSingletonBlockState(block, Models.CUBE_BOTTOM_TOP.upload(block, textureMap, blockStateModelGenerator.modelCollector)));
87+
blockStateModelGenerator.blockStateCollector.accept(BlockStateModelGenerator.createSingletonBlockState(block, BlockStateModelGenerator.createWeightedVariant(Models.CUBE_BOTTOM_TOP.upload(block, textureMap, blockStateModelGenerator.modelCollector))));
8888
}
8989

9090
/*public static final TexturedModel.Factory LAWN_BLOCK = makeFactory(TextureMap::all, Models.CUBE_BOTTOM_TOP);
@@ -110,11 +110,11 @@ public static TexturedModel.Factory makeFactory(Function<Block, TextureMap> text
110110
public void generateItemModels(ItemModelGenerator itemModelGenerator) {
111111
//itemModelGenerator.register(ModItems.PEASHOOTER_SPAWN_EGG,
112112
//new Model(Optional.of(Identifier.of("item/template_spawn_egg")), Optional.empty()));
113-
itemModelGenerator.registerSpawnEgg(ModItems.PEASHOOTER_SPAWN_EGG, 0xD7FF37, 0x3BC10E);
113+
//itemModelGenerator.registerSpawnEgg(ModItems.PEASHOOTER_SPAWN_EGG, 0xD7FF37, 0x3BC10E);
114114

115115
//itemModelGenerator.register(ModItems.BASIC_ZOMBIE_SPAWN_EGG,
116116
//new Model(Optional.of(Identifier.of("item/template_spawn_egg")), Optional.empty()));
117-
itemModelGenerator.registerSpawnEgg(ModItems.BASIC_ZOMBIE_SPAWN_EGG, 0x6D7858, 0x4A341D);
117+
//itemModelGenerator.registerSpawnEgg(ModItems.BASIC_ZOMBIE_SPAWN_EGG, 0x6D7858, 0x4A341D);
118118

119119
//ItemModels.registerHeadgear(itemModelGenerator, ModItems.DAVES_PAN, , );
120120

src/main/java/net/db64/homelawnsecurity/entity/animation/ModAnimations.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public static class Peashooter {
117117
new Keyframe(1.5f, AnimationHelper.createRotationalVector(-5f, 0f, 0f),
118118
Transformation.Interpolations.CUBIC)))
119119
.addBoneAnimation("head",
120-
new Transformation(Transformation.Targets.TRANSLATE,
120+
new Transformation(Transformation.Targets.MOVE_ORIGIN,
121121
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -1f, 0f),
122122
Transformation.Interpolations.CUBIC),
123123
new Keyframe(0.5f, AnimationHelper.createTranslationalVector(0f, 0f, 0f),
@@ -197,7 +197,7 @@ public static class Sunflower {
197197
new Keyframe(1.125F, AnimationHelper.createRotationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC),
198198
new Keyframe(1.5F, AnimationHelper.createRotationalVector(0.0F, 0.0F, 5.0F), Transformation.Interpolations.CUBIC)
199199
))
200-
.addBoneAnimation("head", new Transformation(Transformation.Targets.TRANSLATE,
200+
.addBoneAnimation("head", new Transformation(Transformation.Targets.MOVE_ORIGIN,
201201
new Keyframe(0.0F, AnimationHelper.createTranslationalVector(0.0F, -1.0F, 0.0F), Transformation.Interpolations.CUBIC),
202202
new Keyframe(0.5F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC),
203203
new Keyframe(0.75F, AnimationHelper.createTranslationalVector(0.0F, -1.0F, 0.0F), Transformation.Interpolations.CUBIC),
@@ -225,7 +225,7 @@ public static class Sunflower {
225225
new Keyframe(0.875F, AnimationHelper.createRotationalVector(2.5F, 0.0F, -2.5F), Transformation.Interpolations.CUBIC),
226226
new Keyframe(1.5F, AnimationHelper.createRotationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC)
227227
))
228-
.addBoneAnimation("petals3", new Transformation(Transformation.Targets.TRANSLATE,
228+
.addBoneAnimation("petals3", new Transformation(Transformation.Targets.MOVE_ORIGIN,
229229
new Keyframe(0.0F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC),
230230
new Keyframe(0.125F, AnimationHelper.createTranslationalVector(0.25F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC),
231231
new Keyframe(0.75F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC),
@@ -239,7 +239,7 @@ public static class Sunflower {
239239
new Keyframe(0.875F, AnimationHelper.createRotationalVector(2.5F, 0.0F, 2.5F), Transformation.Interpolations.CUBIC),
240240
new Keyframe(1.5F, AnimationHelper.createRotationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC)
241241
))
242-
.addBoneAnimation("petals4", new Transformation(Transformation.Targets.TRANSLATE,
242+
.addBoneAnimation("petals4", new Transformation(Transformation.Targets.MOVE_ORIGIN,
243243
new Keyframe(0.0F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC),
244244
new Keyframe(0.125F, AnimationHelper.createTranslationalVector(-0.25F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC),
245245
new Keyframe(0.75F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC),
@@ -299,10 +299,10 @@ public static class TargetZombie {
299299
.addBoneAnimation("hat", new Transformation(Transformation.Targets.ROTATE,
300300
new Keyframe(0.0F, AnimationHelper.createRotationalVector(-7.5F, 0.0F, 0.0F), Transformation.Interpolations.LINEAR)
301301
))
302-
.addBoneAnimation("hat", new Transformation(Transformation.Targets.TRANSLATE,
302+
.addBoneAnimation("hat", new Transformation(Transformation.Targets.MOVE_ORIGIN,
303303
new Keyframe(0.0F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, -1.0F), Transformation.Interpolations.LINEAR)
304304
))
305-
.addBoneAnimation("target", new Transformation(Transformation.Targets.TRANSLATE,
305+
.addBoneAnimation("target", new Transformation(Transformation.Targets.MOVE_ORIGIN,
306306
new Keyframe(0.0F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC),
307307
new Keyframe(1.0F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, -1.0F), Transformation.Interpolations.CUBIC),
308308
new Keyframe(2.0F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC)
@@ -325,7 +325,7 @@ public static class TargetZombie {
325325
new Keyframe(0.625F, AnimationHelper.createRotationalVector(-7.5F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC),
326326
new Keyframe(1.0F, AnimationHelper.createRotationalVector(5.0F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC)
327327
))
328-
.addBoneAnimation("rightLeg", new Transformation(Transformation.Targets.TRANSLATE,
328+
.addBoneAnimation("rightLeg", new Transformation(Transformation.Targets.MOVE_ORIGIN,
329329
new Keyframe(0.0F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC),
330330
new Keyframe(0.5F, AnimationHelper.createTranslationalVector(0.0F, 2.0F, 0.0F), Transformation.Interpolations.CUBIC),
331331
new Keyframe(0.75F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.CUBIC)
@@ -344,7 +344,7 @@ public static class TargetZombie {
344344
new Keyframe(0.5F, AnimationHelper.createRotationalVector(-101.67F, -30.0F, 60.0F), Transformation.Interpolations.LINEAR),
345345
new Keyframe(0.75F, AnimationHelper.createRotationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.LINEAR)
346346
))
347-
.addBoneAnimation("rightArm", new Transformation(Transformation.Targets.TRANSLATE,
347+
.addBoneAnimation("rightArm", new Transformation(Transformation.Targets.MOVE_ORIGIN,
348348
new Keyframe(0.0F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.LINEAR),
349349
new Keyframe(0.375F, AnimationHelper.createTranslationalVector(0.0F, -2.0F, -1.0F), Transformation.Interpolations.LINEAR),
350350
new Keyframe(0.5F, AnimationHelper.createTranslationalVector(0.0F, -1.33F, -0.67F), Transformation.Interpolations.LINEAR),
@@ -357,7 +357,7 @@ public static class TargetZombie {
357357
new Keyframe(0.875F, AnimationHelper.createRotationalVector(-152.5F, 0.0F, -40.0F), Transformation.Interpolations.LINEAR),
358358
new Keyframe(1.0F, AnimationHelper.createRotationalVector(-101.67F, 30.0F, -60.0F), Transformation.Interpolations.LINEAR)
359359
))
360-
.addBoneAnimation("leftArm", new Transformation(Transformation.Targets.TRANSLATE,
360+
.addBoneAnimation("leftArm", new Transformation(Transformation.Targets.MOVE_ORIGIN,
361361
new Keyframe(0.0F, AnimationHelper.createTranslationalVector(0.0F, -1.33F, -0.67F), Transformation.Interpolations.LINEAR),
362362
new Keyframe(0.25F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.LINEAR),
363363
new Keyframe(0.5F, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), Transformation.Interpolations.LINEAR),
@@ -420,7 +420,7 @@ public static class BasicZombie {
420420
new Keyframe(1f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
421421
Transformation.Interpolations.CUBIC)))
422422
.addBoneAnimation("rightLeg",
423-
new Transformation(Transformation.Targets.TRANSLATE,
423+
new Transformation(Transformation.Targets.MOVE_ORIGIN,
424424
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f),
425425
Transformation.Interpolations.CUBIC),
426426
new Keyframe(0.5f, AnimationHelper.createTranslationalVector(0f, 2f, 0f),
@@ -446,7 +446,7 @@ public static class BasicZombie {
446446

447447
public static final Animation EAT = Animation.Builder.create(1f).looping()
448448
.addBoneAnimation("rightArm",
449-
new Transformation(Transformation.Targets.TRANSLATE,
449+
new Transformation(Transformation.Targets.MOVE_ORIGIN,
450450
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, 0f, 0f),
451451
Transformation.Interpolations.LINEAR),
452452
new Keyframe(0.375f, AnimationHelper.createTranslationalVector(0f, -2f, -1f),
@@ -466,7 +466,7 @@ public static class BasicZombie {
466466
new Keyframe(0.75f, AnimationHelper.createRotationalVector(0f, 0f, 0f),
467467
Transformation.Interpolations.LINEAR)))
468468
.addBoneAnimation("leftArm",
469-
new Transformation(Transformation.Targets.TRANSLATE,
469+
new Transformation(Transformation.Targets.MOVE_ORIGIN,
470470
new Keyframe(0f, AnimationHelper.createTranslationalVector(0f, -1.33f, -0.67f),
471471
Transformation.Interpolations.LINEAR),
472472
new Keyframe(0.25f, AnimationHelper.createTranslationalVector(0f, 0f, 0f),

src/main/java/net/db64/homelawnsecurity/entity/client/other/CurrencyRenderState.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22

33
import net.minecraft.client.render.entity.state.EntityRenderState;
44
import net.minecraft.client.render.item.ItemRenderState;
5-
import net.minecraft.client.render.model.BakedModel;
65
import net.minecraft.item.ItemStack;
7-
import org.jetbrains.annotations.Nullable;
86

97
public class CurrencyRenderState extends EntityRenderState {
10-
@Nullable
11-
public BakedModel model;
128
public ItemStack stack = ItemStack.EMPTY;
139
public float scale = 1.0f;
1410

src/main/java/net/db64/homelawnsecurity/entity/client/other/CurrencyRenderer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
import net.minecraft.client.render.entity.EntityRenderer;
1010
import net.minecraft.client.render.entity.EntityRendererFactory;
1111
import net.minecraft.client.util.math.MatrixStack;
12-
import net.minecraft.entity.FlyingItemEntity;
12+
import net.minecraft.item.ItemDisplayContext;
1313
import net.minecraft.item.ItemStack;
14-
import net.minecraft.item.ModelTransformationMode;
1514
import net.minecraft.util.math.BlockPos;
1615
import net.minecraft.util.math.MathHelper;
1716

@@ -73,7 +72,7 @@ public void updateRenderState(CurrencyEntity entity, CurrencyRenderState state,
7372
super.updateRenderState(entity, state, f);
7473
ItemStack stack = entity.getStack();
7574

76-
this.itemModelManager.updateForNonLivingEntity(state.itemRenderState, stack, ModelTransformationMode.GROUND, entity);
75+
this.itemModelManager.updateForNonLivingEntity(state.itemRenderState, stack, ItemDisplayContext.GROUND, entity);
7776

7877
/*state.model = !stack.isEmpty() ? this.itemModelManager.getModel(stack, entity.getWorld(), null, entity.getId()) : null;
7978
state.stack = stack.copy();*/

0 commit comments

Comments
 (0)