Fixed red butterfly item texture

This commit is contained in:
Sollace 2024-10-12 20:28:45 +01:00
parent 2723fbf7b3
commit 2ce52b3a0f
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 9 additions and 3 deletions

View file

@ -133,8 +133,14 @@ public interface URenderers {
ModelPredicateProviderRegistry.register(UItems.GEMSTONE, Identifier.ofVanilla("affinity"), (stack, world, entity, seed) -> EnchantableItem.getSpellKey(stack).getAffinity().getAlignment()); ModelPredicateProviderRegistry.register(UItems.GEMSTONE, Identifier.ofVanilla("affinity"), (stack, world, entity, seed) -> EnchantableItem.getSpellKey(stack).getAffinity().getAlignment());
ModelPredicateProviderRegistry.register(UItems.GEMSTONE, Identifier.ofVanilla("shape"), (stack, world, entity, seed) -> EnchantableItem.getSpellKey(stack).getGemShape().getId()); ModelPredicateProviderRegistry.register(UItems.GEMSTONE, Identifier.ofVanilla("shape"), (stack, world, entity, seed) -> EnchantableItem.getSpellKey(stack).getGemShape().getId());
ModelPredicateProviderRegistry.register(UItems.ROCK_CANDY, Identifier.ofVanilla("count"), (stack, world, entity, seed) -> stack.getCount() / (float)stack.getMaxCount()); ModelPredicateProviderRegistry.register(UItems.ROCK_CANDY, Identifier.ofVanilla("count"), (stack, world, entity, seed) -> stack.getCount() / (float)stack.getMaxCount());
ModelPredicateProviderRegistry.register(UItems.BUTTERFLY, Identifier.ofVanilla("variant"), (stack, world, entity, seed) -> (float)BufferflyVariantComponent.get(stack).variant().ordinal() / ButterflyEntity.Variant.VALUES.length); ModelPredicateProviderRegistry.register(UItems.BUTTERFLY, Identifier.ofVanilla("variant"), (stack, world, entity, seed) -> {
ModelPredicateProviderRegistry.register(UItems.GIANT_BALLOON, Identifier.ofVanilla("design"), (stack, world, entity, seed) -> (float)BalloonDesignComponent.get(stack).design().ordinal() / AirBalloonEntity.BalloonDesign.VALUES.length); // float operations do be weird like
return BufferflyVariantComponent.get(stack).variant().ordinal() * (1F / ButterflyEntity.Variant.VALUES.length);
});
ModelPredicateProviderRegistry.register(UItems.GIANT_BALLOON, Identifier.ofVanilla("design"), (stack, world, entity, seed) -> {
// float operations do be weird like
return BalloonDesignComponent.get(stack).design().ordinal() * (1F / AirBalloonEntity.BalloonDesign.VALUES.length);
});
ModelPredicateProviderRegistry.register(Unicopia.id("zap_cycle"), new ClampedModelPredicateProvider() { ModelPredicateProviderRegistry.register(Unicopia.id("zap_cycle"), new ClampedModelPredicateProvider() {
private double targetAngle; private double targetAngle;
private double lastAngle; private double lastAngle;

View file

@ -387,7 +387,7 @@ public class ButterflyEntity extends AmbientEntity {
WHITE_MONARCH, WHITE_MONARCH,
BRIMSTONE; BRIMSTONE;
public static final Variant[] VALUES = Variant.values(); public static final Variant[] VALUES = values();
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
public static final EnumCodec<Variant> CODEC = StringIdentifiable.createCodec(Variant::values); public static final EnumCodec<Variant> CODEC = StringIdentifiable.createCodec(Variant::values);