diff --git a/src/main/java/io/wispforest/affinity/client/AffinityClient.java b/src/main/java/io/wispforest/affinity/client/AffinityClient.java index 87c70705..47bf8df9 100644 --- a/src/main/java/io/wispforest/affinity/client/AffinityClient.java +++ b/src/main/java/io/wispforest/affinity/client/AffinityClient.java @@ -17,6 +17,7 @@ import io.wispforest.affinity.client.render.entity.*; import io.wispforest.affinity.client.render.item.AzaleaChestItemRenderer; import io.wispforest.affinity.client.render.item.MangroveBasketItemRenderer; +import io.wispforest.affinity.client.render.item.VillagerArmsItemRenderer; import io.wispforest.affinity.client.render.item.VoidResonantEtherealAmethystShardRenderer; import io.wispforest.affinity.client.render.program.*; import io.wispforest.affinity.client.screen.*; @@ -101,6 +102,8 @@ public void onInitializeClient() { BuiltinItemRendererRegistry.INSTANCE.register(AffinityBlocks.FIELD_COHERENCE_MODULATOR, new FieldCoherenceModulatorBlockEntityRenderer(null)); BuiltinItemRendererRegistry.INSTANCE.register(AffinityItems.VOID_RESONANT_ETHEREAL_AMETHYST_SHARD, new VoidResonantEtherealAmethystShardRenderer()); BuiltinItemRendererRegistry.INSTANCE.register(AffinityBlocks.AZALEA_CHEST, new AzaleaChestItemRenderer()); + BuiltinItemRendererRegistry.INSTANCE.register(AffinityItems.VILLAGER_ARMS, new VillagerArmsItemRenderer()); + PostItemRenderCallback.EVENT.register((stack, mode, leftHanded, matrices, vertexConsumers, light, overlay, model, item) -> { boolean hasItemGlow = item != null && item.getComponent(AffinityComponents.ENTITY_FLAGS).hasFlag(EntityFlagComponent.ITEM_GLOW); if (mode == ModelTransformationMode.GUI || (!stack.isOf(AffinityItems.DRAGON_DROP) && !hasItemGlow)) return; diff --git a/src/main/java/io/wispforest/affinity/client/render/blockentity/VillagerArmatureBlockEntityRenderer.java b/src/main/java/io/wispforest/affinity/client/render/blockentity/VillagerArmatureBlockEntityRenderer.java index ba346de2..96ee86f0 100644 --- a/src/main/java/io/wispforest/affinity/client/render/blockentity/VillagerArmatureBlockEntityRenderer.java +++ b/src/main/java/io/wispforest/affinity/client/render/blockentity/VillagerArmatureBlockEntityRenderer.java @@ -23,6 +23,27 @@ public class VillagerArmatureBlockEntityRenderer extends AffinityBlockEntityRenderer { + public static final ModelPart ARMS; + + static { + var rootPart = new ModelData().getRoot(); + rootPart.addChild( + "arms", + ModelPartBuilder.create() + .uv(40, 38) + .cuboid(-4.0F, 2.1618F, -2.0F, 8.0F, 4.0F, 4.0F) + .uv(44, 22) + .cuboid(-8.0F, -1.8382F, -2.0F, 4.0F, 8.0F, 4.0F) + .uv(44, 22) + .mirrored() + .cuboid(4.0F, -1.8382F, -2.0F, 4.0F, 8.0F, 4.0F) + .mirrored(false), + ModelTransform.of(0.0F, 11.6667F, 2.0F, 2.356f, 0.0F, 0.0F) + ); + ARMS = rootPart.createPart(64, 64); + } + + public static final Transformation.Interpolation EXPO = (result, delta, keyframes, start, end, scale) -> { var from = keyframes[start].target(); var to = keyframes[end].target(); @@ -31,58 +52,41 @@ public class VillagerArmatureBlockEntityRenderer extends AffinityBlockEntityRend }; public static final Animation PUNCH_ANIMATION = Animation.Builder.create(0.3f) - .addBoneAnimation("arms", new Transformation(Transformation.Targets.ROTATE, - new Keyframe(0f, AnimationHelper.createRotationalVector(0.0F, 0.0F, 0.0F), EXPO), - new Keyframe(0.15f, AnimationHelper.createRotationalVector(-17.5F, 0.0F, 0.0F), EXPO), - new Keyframe(0.3f, AnimationHelper.createRotationalVector(0.0F, 0.0F, 0.0F), EXPO) - )) - .addBoneAnimation("arms", new Transformation(Transformation.Targets.TRANSLATE, - new Keyframe(0f, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), EXPO), - new Keyframe(0.15f, AnimationHelper.createTranslationalVector(0.0F, 1.0F, 1.5F), EXPO), - new Keyframe(0.3f, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), EXPO) - )) - .build(); - - private final ModelPart arms; + .addBoneAnimation("arms", new Transformation( + Transformation.Targets.ROTATE, + new Keyframe(0f, AnimationHelper.createRotationalVector(0.0F, 0.0F, 0.0F), EXPO), + new Keyframe(0.15f, AnimationHelper.createRotationalVector(-17.5F, 0.0F, 0.0F), EXPO), + new Keyframe(0.3f, AnimationHelper.createRotationalVector(0.0F, 0.0F, 0.0F), EXPO) + )) + .addBoneAnimation("arms", new Transformation( + Transformation.Targets.TRANSLATE, + new Keyframe(0f, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), EXPO), + new Keyframe(0.15f, AnimationHelper.createTranslationalVector(0.0F, 1.0F, 1.5F), EXPO), + new Keyframe(0.3f, AnimationHelper.createTranslationalVector(0.0F, 0.0F, 0.0F), EXPO) + )) + .build(); public VillagerArmatureBlockEntityRenderer(BlockEntityRendererFactory.Context ctx) { super(ctx); - - var rootPart = new ModelData().getRoot(); - rootPart.addChild( - "arms", - ModelPartBuilder.create() - .uv(0, 16) - .cuboid(-4.0F, 2.1618F, -2.0F, 8.0F, 4.0F, 4.0F) - .uv(4, 0) - .cuboid(-8.0F, -1.8382F, -2.0F, 4.0F, 8.0F, 4.0F) - .uv(4, 0) - .mirrored() - .cuboid(4.0F, -1.8382F, -2.0F, 4.0F, 8.0F, 4.0F) - .mirrored(false), - ModelTransform.of(0.0F, 11.6667F, 2.0F, 2.356f, 0.0F, 0.0F) - ); - - this.arms = rootPart.createPart(32, 32); } @Override protected void render(VillagerArmatureBlockEntity entity, float tickDelta, float frameDelta, long time, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) { var animationState = entity.punchAnimationState; - this.arms.traverse().forEach(ModelPart::resetTransform); + ARMS.traverse().forEach(ModelPart::resetTransform); animationState.update(entity.time() + tickDelta, 1f); - animationState.run(state -> animate(this.arms, PUNCH_ANIMATION, state.getTimeRunning(), 1f, new Vector3f())); + animationState.run(state -> animate(ARMS, PUNCH_ANIMATION, state.getTimeRunning(), 1f, new Vector3f())); matrices.push(); matrices.translate(.5, 0, .5); matrices.multiply(entity.getCachedState().get(VillagerArmatureBlock.FACING).getRotationQuaternion().rotateX((float) (Math.PI / -2))); var buffer = vertexConsumers.getBuffer(RenderLayer.getEntitySolid(Affinity.id("textures/item/villager_arms.png"))); - this.arms.render(matrices, buffer, light, overlay); + ARMS.render(matrices, buffer, light, overlay); if (!entity.heldStack().isEmpty()) { - this.arms.getChild("arms").rotate(matrices); + ARMS.getChild("arms").rotate(matrices); matrices.translate(0, .325, -.1); matrices.multiply(new Quaternionf().rotationY((float) Math.PI).rotateX((float) Math.toRadians(100))); this.ctx.getItemRenderer().renderItem(entity.heldStack(), ModelTransformationMode.THIRD_PERSON_RIGHT_HAND, light, overlay, matrices, vertexConsumers, entity.getWorld(), 0); diff --git a/src/main/java/io/wispforest/affinity/client/render/item/VillagerArmsItemRenderer.java b/src/main/java/io/wispforest/affinity/client/render/item/VillagerArmsItemRenderer.java new file mode 100644 index 00000000..cc907807 --- /dev/null +++ b/src/main/java/io/wispforest/affinity/client/render/item/VillagerArmsItemRenderer.java @@ -0,0 +1,48 @@ +package io.wispforest.affinity.client.render.item; + +import io.wispforest.affinity.client.render.blockentity.VillagerArmatureBlockEntityRenderer; +import io.wispforest.affinity.item.VillagerArmsItem; +import io.wispforest.affinity.mixin.VillagerClothingFeatureRendererAccessor; +import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry; +import net.minecraft.client.render.RenderLayer; +import net.minecraft.client.render.VertexConsumerProvider; +import net.minecraft.client.render.model.json.ModelTransformationMode; +import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.item.ItemStack; +import net.minecraft.registry.Registries; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.RotationAxis; +import net.minecraft.village.VillagerProfession; + +import java.util.function.UnaryOperator; + +import static net.minecraft.entity.EntityType.VILLAGER; + +public class VillagerArmsItemRenderer implements BuiltinItemRendererRegistry.DynamicItemRenderer { + public static final Identifier NORMIE = Identifier.ofVanilla("textures/entity/villager/villager.png"); + + @Override + public void render(ItemStack stack, ModelTransformationMode mode, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) { + matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180)); + matrices.translate(-0.5, -1/7f, -0.75); + this.renderArms(NORMIE, matrices, vertexConsumers, light, overlay); + var data = stack.get(VillagerArmsItem.VILLAGER_DATA); + if (data == null) return; + this.renderArms(this.findTexture("type", Registries.VILLAGER_TYPE.getId(data.getType())), matrices, vertexConsumers, light, overlay); + var profession = data.getProfession(); + if (profession == VillagerProfession.NONE) return; + this.renderArms(this.findTexture("profession", Registries.VILLAGER_PROFESSION.getId(profession)), matrices, vertexConsumers, light, overlay); + if (profession == VillagerProfession.NITWIT) return; + this.renderArms(this.findTexture("profession_level", VillagerClothingFeatureRendererAccessor.affinity$LevelToIdMap().get(MathHelper.clamp(data.getLevel(), 1, VillagerClothingFeatureRendererAccessor.affinity$LevelToIdMap().size()))), matrices, vertexConsumers, light, overlay); + } + + private void renderArms(Identifier id, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) { + var buffer = vertexConsumers.getBuffer(RenderLayer.getEntityCutoutNoCull(id)); + VillagerArmatureBlockEntityRenderer.ARMS.render(matrices, buffer, light, overlay); + } + + private Identifier findTexture(String keyType, Identifier keyId) { + return keyId.withPath(path -> "textures/entity/villager/" + keyType + "/" + path + ".png"); + } +} diff --git a/src/main/java/io/wispforest/affinity/datagen/AffinityDataGeneratorEntrypoint.java b/src/main/java/io/wispforest/affinity/datagen/AffinityDataGeneratorEntrypoint.java index b7593c01..4f19f3d0 100644 --- a/src/main/java/io/wispforest/affinity/datagen/AffinityDataGeneratorEntrypoint.java +++ b/src/main/java/io/wispforest/affinity/datagen/AffinityDataGeneratorEntrypoint.java @@ -18,6 +18,7 @@ public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { pack.addProvider(AffinityRecipesProvider::new); pack.addProvider(AffinityDynamicRegistryProvider::new); pack.addProvider(AffinityEnchantmentTagProvider::new); + pack.addProvider(AffinityFluidTagProvider::new); var blockTagProvider = pack.addProvider(AffinityBlockTagProvider::new); pack.addProvider((output, registries) -> new AffinityItemTagProvider(output, registries, blockTagProvider)); diff --git a/src/main/java/io/wispforest/affinity/datagen/AffinityFluidTagProvider.java b/src/main/java/io/wispforest/affinity/datagen/AffinityFluidTagProvider.java new file mode 100644 index 00000000..2c654e40 --- /dev/null +++ b/src/main/java/io/wispforest/affinity/datagen/AffinityFluidTagProvider.java @@ -0,0 +1,31 @@ +package io.wispforest.affinity.datagen; + +import io.wispforest.affinity.Affinity; +import io.wispforest.affinity.object.AffinityBlocks; +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; +import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; +import net.minecraft.fluid.Fluid; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.RegistryWrapper; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; + +import java.util.concurrent.CompletableFuture; + +public class AffinityFluidTagProvider extends FabricTagProvider.FluidTagProvider { + + public static final TagKey ARCANE_FADE = TagKey.of(RegistryKeys.FLUID, Identifier.of("c","arcane_fade")); + + public AffinityFluidTagProvider(FabricDataOutput output, CompletableFuture completableFuture) { + super(output, completableFuture); + } + + @Override + @SuppressWarnings("UnstableApiUsage") + protected void configure(RegistryWrapper.WrapperLookup arg) { + var arcaneFadeInternal = TagKey.of(RegistryKeys.FLUID, Affinity.id("arcane_fade")); + + this.getOrCreateTagBuilder(arcaneFadeInternal).add(AffinityBlocks.Fluids.ARCANE_FADE, AffinityBlocks.Fluids.ARCANE_FADE_FLOWING); + this.getOrCreateTagBuilder(ARCANE_FADE).addTag(arcaneFadeInternal); + } +} diff --git a/src/main/java/io/wispforest/affinity/datagen/AffinityItemTagProvider.java b/src/main/java/io/wispforest/affinity/datagen/AffinityItemTagProvider.java index 06fded12..bd7e6cf8 100644 --- a/src/main/java/io/wispforest/affinity/datagen/AffinityItemTagProvider.java +++ b/src/main/java/io/wispforest/affinity/datagen/AffinityItemTagProvider.java @@ -9,14 +9,15 @@ import io.wispforest.owo.registration.reflect.FieldRegistrationHandler; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; -import net.fabricmc.fabric.api.tag.convention.v1.ConventionalBlockTags; -import net.fabricmc.fabric.api.tag.convention.v1.ConventionalItemTags; +import net.fabricmc.fabric.api.tag.convention.v2.ConventionalBlockTags; +import net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags; import net.minecraft.item.Item; import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.RegistryWrapper; import net.minecraft.registry.tag.BlockTags; import net.minecraft.registry.tag.ItemTags; import net.minecraft.registry.tag.TagKey; +import net.minecraft.util.Identifier; import org.jetbrains.annotations.Nullable; import java.util.concurrent.CompletableFuture; @@ -30,6 +31,8 @@ public class AffinityItemTagProvider extends FabricTagProvider.ItemTagProvider { public static final TagKey WISP_MATTER = TagKey.of(RegistryKeys.ITEM, Affinity.id("wisp_matter")); public static final TagKey WISP_MIST = TagKey.of(RegistryKeys.ITEM, Affinity.id("wisp_mist")); + public static final TagKey AMETHYST_SHARDS = TagKey.of(RegistryKeys.ITEM, Affinity.id("amethyst_shards")); + public AffinityItemTagProvider(FabricDataOutput output, CompletableFuture completableFuture, @Nullable BlockTagProvider blockTagProvider) { super(output, completableFuture, blockTagProvider); } @@ -72,6 +75,16 @@ protected void configure(RegistryWrapper.WrapperLookup arg) { this.getOrCreateTagBuilder(ItemTags.SWORDS).addTag(TagKey.of(RegistryKeys.ITEM, Affinity.id("artifact_blades"))); + this.getOrCreateTagBuilder(ItemTags.BOW_ENCHANTABLE).add(AZALEA_BOW); + this.getOrCreateTagBuilder(ConventionalItemTags.BOW_TOOLS).add(AZALEA_BOW); + + this.getOrCreateTagBuilder(ItemTags.HEAD_ARMOR).add(EMERALD_CHESTPLATE); + this.getOrCreateTagBuilder(ItemTags.CHEST_ARMOR).add(EMERALD_CHESTPLATE); + this.getOrCreateTagBuilder(ItemTags.LEG_ARMOR).add(EMERALD_LEGGINGS); + this.getOrCreateTagBuilder(ItemTags.FOOT_ARMOR).add(EMERALD_BOOTS); + + this.getOrCreateTagBuilder(TagKey.of(RegistryKeys.ITEM, Identifier.of("c","buckets/arcane_fade"))).add(ARCANE_FADE_BUCKET); + FieldRegistrationHandler.process(AffinityItems.class, (item, name, field) -> { if (item instanceof StaffItem && !(item instanceof AethumFireExtinguisherItem)) { this.getOrCreateTagBuilder(STAFFS).add(item); @@ -84,6 +97,7 @@ protected void configure(RegistryWrapper.WrapperLookup arg) { if (item instanceof WispMistItem) { this.getOrCreateTagBuilder(WISP_MIST).add(item); } + }, false); } } diff --git a/src/main/java/io/wispforest/affinity/item/AffinityItemGroup.java b/src/main/java/io/wispforest/affinity/item/AffinityItemGroup.java index 3fc6c755..91fef489 100644 --- a/src/main/java/io/wispforest/affinity/item/AffinityItemGroup.java +++ b/src/main/java/io/wispforest/affinity/item/AffinityItemGroup.java @@ -10,29 +10,31 @@ import io.wispforest.owo.itemgroup.gui.ItemGroupButton; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.minecraft.block.Blocks; import net.minecraft.component.type.PotionContentsComponent; import net.minecraft.enchantment.EnchantmentLevelEntry; -import net.minecraft.item.EnchantedBookItem; -import net.minecraft.item.Item; -import net.minecraft.item.ItemGroup; -import net.minecraft.item.Items; +import net.minecraft.item.*; import net.minecraft.potion.Potion; import net.minecraft.potion.Potions; -import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.Registries; import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.RegistryWrapper; +import net.minecraft.village.VillagerData; +import net.minecraft.village.VillagerProfession; +import net.minecraft.village.VillagerType; +import java.util.ArrayList; import java.util.Calendar; import java.util.Objects; +import static io.wispforest.affinity.item.VillagerArmsItem.VILLAGER_DATA; import static io.wispforest.affinity.object.AffinityBlocks.*; import static io.wispforest.affinity.object.AffinityItems.*; public class AffinityItemGroup { private static OwoItemGroup GROUP; + public static void register() { GROUP = OwoItemGroup.builder(Affinity.id("affinity"), () -> Icon.of(INERT_WISP_MATTER)).initializer(group -> { //noinspection Convert2MethodRef @@ -214,6 +216,24 @@ private static void initializeGroup(OwoItemGroup group) { entries.add(INERT_WISP_SPAWN_EGG); entries.add(WISE_WISP_SPAWN_EGG); entries.add(VICIOUS_WISP_SPAWN_EGG); + var items = new ArrayList(); + for (var villagerProfession : Registries.VILLAGER_PROFESSION) { + var stack = VILLAGER_ARMS.getDefaultStack(); + stack.set(VILLAGER_DATA, new VillagerData(VillagerType.PLAINS, villagerProfession, 5)); + items.add(stack); + } + entries.addAll(items, ItemGroup.StackVisibility.PARENT_TAB_ONLY); + items.clear(); + for (var villagerType : Registries.VILLAGER_TYPE) { + for (var villagerProfession : Registries.VILLAGER_PROFESSION) { + for (int i = 1; i < ((villagerProfession.equals(VillagerProfession.NITWIT) || villagerProfession.equals(VillagerProfession.NONE)) ? 2 : 6); i++) { + var stack = VILLAGER_ARMS.getDefaultStack(); + stack.set(VILLAGER_DATA, new VillagerData(villagerType, villagerProfession, i)); + items.add(stack); + } + } + } + entries.addAll(items, ItemGroup.StackVisibility.SEARCH_TAB_ONLY); }, false); group.addButton(ItemGroupButton.github(group, "https://github.com/wisp-forest/affinity")); diff --git a/src/main/java/io/wispforest/affinity/item/VillagerArmsItem.java b/src/main/java/io/wispforest/affinity/item/VillagerArmsItem.java index f5ed8594..6de36c54 100644 --- a/src/main/java/io/wispforest/affinity/item/VillagerArmsItem.java +++ b/src/main/java/io/wispforest/affinity/item/VillagerArmsItem.java @@ -1,21 +1,35 @@ package io.wispforest.affinity.item; +import io.wispforest.affinity.Affinity; import io.wispforest.affinity.component.AffinityComponents; import io.wispforest.affinity.component.EntityFlagComponent; import io.wispforest.affinity.object.AffinityItems; import io.wispforest.owo.ops.ItemOps; +import io.wispforest.owo.serialization.CodecUtils; import net.fabricmc.fabric.api.event.player.UseEntityCallback; +import net.minecraft.component.ComponentType; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.tooltip.TooltipType; import net.minecraft.registry.tag.ItemTags; import net.minecraft.sound.SoundEvents; +import net.minecraft.text.Text; import net.minecraft.util.ActionResult; +import net.minecraft.util.Colors; import net.minecraft.util.Hand; import net.minecraft.util.ItemScatterer; +import net.minecraft.village.VillagerData; + +import java.util.List; + +import static net.minecraft.village.VillagerProfession.*; public class VillagerArmsItem extends Item { + public static ComponentType VILLAGER_DATA = Affinity.component("villager_data", CodecUtils.toEndec(VillagerData.CODEC)); + public VillagerArmsItem(Settings settings) { super(settings); } @@ -32,7 +46,9 @@ public VillagerArmsItem(Settings settings) { // ha! gottem flags.setFlag(EntityFlagComponent.VILLAGER_HAS_NO_ARMS); AffinityComponents.ENTITY_FLAGS.sync(villager); - ItemScatterer.spawn(world, villager.getX(), villager.getY(), villager.getZ(), AffinityItems.VILLAGER_ARMS.getDefaultStack()); + var stack = AffinityItems.VILLAGER_ARMS.getDefaultStack(); + stack.set(VILLAGER_DATA, villager.getVillagerData()); + ItemScatterer.spawn(world, villager.getX(), villager.getY(), villager.getZ(), stack); villager.playSound(SoundEvents.ITEM_AXE_STRIP); player.getStackInHand(hand).damage(1, player, hand == Hand.MAIN_HAND ? EquipmentSlot.MAINHAND : EquipmentSlot.OFFHAND); @@ -47,6 +63,21 @@ public VillagerArmsItem(Settings settings) { if (!(entity instanceof VillagerEntity villager)) return ActionResult.PASS; + var data = stack.get(VILLAGER_DATA); + var villagerData = villager.getVillagerData(); + + if (data != null && !data.getProfession().equals(NITWIT)) { + if (!data.getType().equals(villagerData.getType())) return ActionResult.PASS; + if (!data.getProfession().equals(NONE)) { + if (!data.getProfession().equals(villagerData.getProfession())) return ActionResult.PASS; + if (data.getProfession() != NITWIT && data.getLevel() >= villagerData.getLevel()) return ActionResult.PASS; + //if (data.getLevel() == villagerData.getLevel()) { + //TODO "good as new" advancement + //} + } + } + + var flags = AffinityComponents.ENTITY_FLAGS.get(villager); if (!flags.hasFlag(EntityFlagComponent.VILLAGER_HAS_NO_ARMS)) return ActionResult.PASS; @@ -58,4 +89,27 @@ public VillagerArmsItem(Settings settings) { return ActionResult.SUCCESS; }); } + + @Override + public Text getName(ItemStack stack) { + var data = stack.get(VILLAGER_DATA); + if (data == null) return super.getName(stack); + var key = "item.affinity.villager_arms"; + if (!data.getProfession().equals(NONE)) { + key += ".with_profession"; + if (!data.getProfession().equals(NITWIT)) key += ".with_level"; + } + var profession = Text.translatable("entity.minecraft.villager." + data.getProfession().toString().toLowerCase()); + var level = Text.translatable("merchant.level." + data.getLevel()); + + return Text.translatable(key, profession, level); + } + + @Override + public void appendTooltip(ItemStack stack, TooltipContext context, List tooltip, TooltipType type) { + super.appendTooltip(stack, context, tooltip, type); + var data = stack.get(VILLAGER_DATA); + if (data == null) return; + tooltip.add(Text.translatable("villagerType.minecraft." + data.getType()).withColor(Colors.LIGHT_GRAY)); + } } diff --git a/src/main/java/io/wispforest/affinity/mixin/VillagerClothingFeatureRendererAccessor.java b/src/main/java/io/wispforest/affinity/mixin/VillagerClothingFeatureRendererAccessor.java new file mode 100644 index 00000000..655f44d2 --- /dev/null +++ b/src/main/java/io/wispforest/affinity/mixin/VillagerClothingFeatureRendererAccessor.java @@ -0,0 +1,13 @@ +package io.wispforest.affinity.mixin; + +import it.unimi.dsi.fastutil.ints.Int2ObjectMap; +import net.minecraft.client.render.entity.feature.VillagerClothingFeatureRenderer; +import net.minecraft.util.Identifier; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; + +@Mixin(VillagerClothingFeatureRenderer.class) +public interface VillagerClothingFeatureRendererAccessor { + @Accessor("LEVEL_TO_ID") + static Int2ObjectMap affinity$LevelToIdMap() {throw new UnsupportedOperationException();} +} diff --git a/src/main/resources/affinity.mixins.json b/src/main/resources/affinity.mixins.json index a307466b..62e89ff2 100644 --- a/src/main/resources/affinity.mixins.json +++ b/src/main/resources/affinity.mixins.json @@ -58,6 +58,7 @@ "ThrowablePotionItemMixin", "TippedArrowRecipeMixin", "TrackTargetGoalMixin", + "VillagerClothingFeatureRendererAccessor", "WorldChunkMixin", "WorldMixin", "WorldViewMixin", diff --git a/src/main/resources/assets/affinity/lang/en_us.json b/src/main/resources/assets/affinity/lang/en_us.json index 60388156..238b9a4b 100644 --- a/src/main/resources/assets/affinity/lang/en_us.json +++ b/src/main/resources/assets/affinity/lang/en_us.json @@ -19,51 +19,133 @@ "item.affinity.wispen_testament": "The Wispen Testament", "text.affinity.wispen_testament.next_page": "Continued on next page...", - "text.affinity.wispen_testament.staff_pedestal_function": {"text": "On Staff Pedestal", "color": "dark_gray"}, + "text.affinity.wispen_testament.staff_pedestal_function": { + "text": "On Staff Pedestal", + "color": "dark_gray" + }, "structure.affinity.augmented_crafting_table": "Augmented Crafting Table", "structure.affinity.void_beacon": "Void Beacon", "structure.affinity.rudimentary_aspen_infusion": "Rudimentary Aspen Infusion", "key.affinity.activate_evade_ring": [ - {"translate": "text.affinity.prefix"}, + { + "translate": "text.affinity.prefix" + }, " Activate Evade Ring" ], "key.affinity.select_staff_from_bundle": [ - {"translate": "text.affinity.prefix"}, + { + "translate": "text.affinity.prefix" + }, " Select Staff from Bundle" ], "text.affinity.ethereal_aethum_flux_injector.node_location_tooltip": [ - {"index": 0}, - {"text": " in ", "color": "gray"}, - {"index": 1, "color": "#4D4C7D"} + { + "index": 0 + }, + { + "text": " in ", + "color": "gray" + }, + { + "index": 1, + "color": "#4D4C7D" + } ], "text.affinity.ethereal_aethum_flux_injector.linked_node_tooltip": [ - "", {"text": "[", "color": "dark_gray"}, {"text": "⌘", "color": "#6A67CE"}, {"text": "]", "color": "dark_gray"}, - {"text": " Linked (click to unlink)", "color": "gray"} + "", + { + "text": "[", + "color": "dark_gray" + }, + { + "text": "⌘", + "color": "#6A67CE" + }, + { + "text": "]", + "color": "dark_gray" + }, + { + "text": " Linked (click to unlink)", + "color": "gray" + } ], "text.affinity.ethereal_aethum_flux_injector.unlinked_node_tooltip": [ - "", {"text": "[", "color": "dark_gray"}, {"text": "+", "color": "green"}, {"text": "]", "color": "dark_gray"}, - {"text": " Click to link", "color": "gray"} + "", + { + "text": "[", + "color": "dark_gray" + }, + { + "text": "+", + "color": "green" + }, + { + "text": "]", + "color": "dark_gray" + }, + { + "text": " Click to link", + "color": "gray" + } ], "text.affinity.ethereal_aethum_flux_injector.global_nodes": [ - "", {"text": "u ", "font": "affinity:symbols"}, + "", + { + "text": "u ", + "font": "affinity:symbols" + }, "All public nodes" ], "text.affinity.ethereal_aethum_flux_injector.private_nodes": [ - "", {"text": "l ", "font": "affinity:symbols"}, + "", + { + "text": "l ", + "font": "affinity:symbols" + }, "My nodes only" ], - "text.affinity.aethum_flux_consumer": {"translate": "text.affinity.aethum_flux_member_template", "with": ["consumer"]}, - "text.affinity.aethum_flux_generator": {"translate": "text.affinity.aethum_flux_member_template", "with": ["generator"]}, - "text.affinity.aethum_flux_node": {"translate": "text.affinity.aethum_flux_member_template", "with": ["node"]}, - "text.affinity.aethum_flux_storage": {"translate": "text.affinity.aethum_flux_member_template", "with": ["storage"]}, + "text.affinity.aethum_flux_consumer": { + "translate": "text.affinity.aethum_flux_member_template", + "with": [ + "consumer" + ] + }, + "text.affinity.aethum_flux_generator": { + "translate": "text.affinity.aethum_flux_member_template", + "with": [ + "generator" + ] + }, + "text.affinity.aethum_flux_node": { + "translate": "text.affinity.aethum_flux_member_template", + "with": [ + "node" + ] + }, + "text.affinity.aethum_flux_storage": { + "translate": "text.affinity.aethum_flux_member_template", + "with": [ + "storage" + ] + }, "text.affinity.aethum_flux_member_template": [ "", - {"text": "a", "font": "affinity:symbols"}, - {"text": " Flux ", "color": "gray"}, - {"index": 0, "color": "gray"} + { + "text": "a", + "font": "affinity:symbols" + }, + { + "text": " Flux ", + "color": "gray" + }, + { + "index": 0, + "color": "gray" + } ], "entity.affinity.wisp": "Wisp", @@ -114,7 +196,9 @@ "block.affinity.ritual_socle_composer": "Ritual Socle Composer", "block.affinity.affine_infuser": "Affine Infuser", "block.affinity.ranthracite_wire": "Ranthracite Dust", - "item.affinity.ranthracite_dust": {"translate": "block.affinity.ranthracite_wire"}, + "item.affinity.ranthracite_dust": { + "translate": "block.affinity.ranthracite_wire" + }, "block.affinity.crop_reaper": "Crop Reaper", "block.affinity.affine_candle": "Affine Candle", "block.affinity.world_pin": "World Pin", @@ -149,12 +233,18 @@ "block.affinity.spirit_integration_apparatus.tooltip.complete": "Complete", "block.affinity.spirit_integration_apparatus.tooltip.incomplete.singular": [ "Missing ", - {"index": 0, "color": "blue"}, + { + "index": 0, + "color": "blue" + }, " core" ], "block.affinity.spirit_integration_apparatus.tooltip.incomplete.plural": [ "Missing ", - {"index": 0, "color": "blue"}, + { + "index": 0, + "color": "blue" + }, " cores" ], "death.attack.ritual_sacrifice": "%s was commited to the Way of the Goat", @@ -164,29 +254,67 @@ "block.affinity.holographic_stereopticon.tooltip_dont_spin": "Don't spin", "block.affinity.holographic_stereopticon.tooltip.assembling": "Assembling...", "block.affinity.holographic_stereopticon.imprint_block_hint": [ - {"text": "Sneak-use on", "color": "gray"}, - {"text": " block ", "color": "blue"}, + { + "text": "Sneak-use on", + "color": "gray" + }, + { + "text": " block ", + "color": "blue" + }, "to imprint" ], "block.affinity.holographic_stereopticon.imprint_item_hint": [ - {"text": "Right-click onto", "color": "gray"}, - {"text": " item ", "color": "blue"}, + { + "text": "Right-click onto", + "color": "gray" + }, + { + "text": " item ", + "color": "blue" + }, "to imprint" ], "block.affinity.holographic_stereopticon.imprint_entity_hint": [ - {"text": "Sneak-use on", "color": "gray"}, - {"text": " entity ", "color": "blue"}, + { + "text": "Sneak-use on", + "color": "gray" + }, + { + "text": " entity ", + "color": "blue" + }, "to imprint" ], "block.affinity.holographic_stereopticon.imprint_section_hint": [ - {"text": "Sneak-use to imprint", "color": "gray"}, - {"text": " world section ", "color": "blue"} + { + "text": "Sneak-use to imprint", + "color": "gray" + }, + { + "text": " world section ", + "color": "blue" + } + ], + "block.affinity.holographic_stereopticon.cycle_imprint_kind_hint": { + "text": "Right-click to cycle imprint kind", + "color": "gray" + }, + "block.affinity.holographic_stereopticon.imprinted.section_at": [ + "Section at ", + { + "index": 0 + } ], - "block.affinity.holographic_stereopticon.cycle_imprint_kind_hint": {"text": "Right-click to cycle imprint kind", "color": "gray"}, - "block.affinity.holographic_stereopticon.imprinted.section_at": ["Section at ", {"index": 0}], "block.affinity.holographic_stereopticon.imprinted": [ - {"text": "Imprinted: ", "color": "gray"}, - {"index": 0, "color": "dark_gray"} + { + "text": "Imprinted: ", + "color": "gray" + }, + { + "index": 0, + "color": "dark_gray" + } ], "block.affinity.azalea_planks": "Azalea Planks", @@ -236,8 +364,13 @@ "item.affinity.emerald_wand_of_iridescence": "Emerald Wand of Iridescence", "item.affinity.sapphire_wand_of_iridescence": "Sapphire Wand of Iridescence", "item.affinity.wand_of_iridescence.mode_suffix": [ - {"text": " [", "color": "dark_gray"}, - {"index": 0}, + { + "text": " [", + "color": "dark_gray" + }, + { + "index": 0 + }, "]" ], "item.affinity.wand_of_iridescence.help": { @@ -281,8 +414,14 @@ "item.affinity.time_staff.mode.fast": "Fast (x%s)", "item.affinity.time_staff.mode.ludicrous": "Ludicrous (x%s)", "item.affinity.time_staff.tooltip": [ - {"text": "☄ ", "color": "#c624ed"}, - {"index": 0, "color": "gray"} + { + "text": "☄ ", + "color": "#c624ed" + }, + { + "index": 0, + "color": "gray" + } ], "item.affinity.wand_of_inquiry": "Wand of Inquiry", @@ -294,7 +433,16 @@ "item.affinity.cultivation_staff.super_foraging_mode": "Super Foraging Mode™", "item.affinity.salvo_staff": "Salvo Staff", "item.affinity.swivel_staff": "Swivel Staff", - "item.affinity.swivel_staff.tooltip.consumption_per_spin": [{"index": 0, "color": "#4D4C7D"}, {"text": " aethum to spin an entity", "color": "gray"}], + "item.affinity.swivel_staff.tooltip.consumption_per_spin": [ + { + "index": 0, + "color": "#4D4C7D" + }, + { + "text": " aethum to spin an entity", + "color": "gray" + } + ], "item.affinity.nimble_staff": "Nimble Staff", "item.affinity.nimble_staff.direction.north": "North", "item.affinity.nimble_staff.direction.south": "South", @@ -317,8 +465,26 @@ "item.affinity.archetypal_iron_ring": "Archetypal Iron Ring", "item.affinity.featherweight_ring": "Featherweight Ring", "item.affinity.evade_ring": "Evade Ring", - "item.affinity.evade_ring.tooltip.consumption_per_use": [{"index": 0, "color": "#4D4C7D"}, {"text": " aethum per use", "color": "gray"}], - "item.affinity.evade_ring.tooltip.take_control": [{"text": "▼ ", "color": "#690926"}, {"text": "Take Control", "color": "gray"}], + "item.affinity.evade_ring.tooltip.consumption_per_use": [ + { + "index": 0, + "color": "#4D4C7D" + }, + { + "text": " aethum per use", + "color": "gray" + } + ], + "item.affinity.evade_ring.tooltip.take_control": [ + { + "text": "▼ ", + "color": "#690926" + }, + { + "text": "Take Control", + "color": "gray" + } + ], "item.affinity.lavaliere_of_safe_keeping": "Lavaliere of Safekeeping", "item.affinity.assassins_quiver": "Assassin's Quiver", "item.affinity.aethum_fire_extinguisher": "Aethum Fire Extinguisher", @@ -326,7 +492,10 @@ "item.affinity.crystallized_experience": "Crystallized Experience", "item.affinity.uncanny_rod": "Uncanny Rod", "item.affinity.staff_prototype": "Staff Prototype", - "item.affinity.misty_potion": {"text": "Misty Potion", "italic": false}, + "item.affinity.misty_potion": { + "text": "Misty Potion", + "italic": false + }, "item.affinity.potion_of_infinite_prowess": { "text": "Potion of Infinite Prowess", "italic": false, @@ -335,35 +504,119 @@ "item.affinity.resounding_chime": "Resounding Chime", "item.affinity.azalea_bow": "Azalea Bow", - "item.affinity.azalea_bow.tooltip.consumption_per_shot": [{"index": 0, "color": "#4D4C7D"}, {"text": " aethum per shot", "color": "gray"}], + "item.affinity.azalea_bow.tooltip.consumption_per_shot": [ + { + "index": 0, + "color": "#4D4C7D" + }, + { + "text": " aethum per shot", + "color": "gray" + } + ], "death.attack.resonating": "%s was late to class", "death.attack.resonating.player": "%s was late to class because they were chatting with %s", "item.affinity.staff.mode_template": [ - {"text": " [", "color": "dark_gray"}, - {"index": 0, "color": "gray"}, + { + "text": " [", + "color": "dark_gray" + }, + { + "index": 0, + "color": "gray" + }, "]" ], - "item.affinity.staff.tooltip.consumption_per_use": [{"index": 0, "color": "#4D4C7D"}, {"text": " aethum per use", "color": "gray"}], - "item.affinity.staff.tooltip.consumption_per_second": [{"index": 0, "color": "#4D4C7D"}, {"text": " aethum per second", "color": "gray"}], - "item.affinity.staff.tooltip.cycle_mode_hint": [{"text": "⇄", "color": "#4D4C7D"}, {"text": " Sneak-use to cycle modes", "color": "gray"}], + "item.affinity.staff.tooltip.consumption_per_use": [ + { + "index": 0, + "color": "#4D4C7D" + }, + { + "text": " aethum per use", + "color": "gray" + } + ], + "item.affinity.staff.tooltip.consumption_per_second": [ + { + "index": 0, + "color": "#4D4C7D" + }, + { + "text": " aethum per second", + "color": "gray" + } + ], + "item.affinity.staff.tooltip.cycle_mode_hint": [ + { + "text": "⇄", + "color": "#4D4C7D" + }, + { + "text": " Sneak-use to cycle modes", + "color": "gray" + } + ], - "item.affinity.kinesis_staff.tooltip.consumption_per_throw": [{"index": 0, "color": "#4D4C7D"}, {"text": " aethum per throw", "color": "gray"}], + "item.affinity.kinesis_staff.tooltip.consumption_per_throw": [ + { + "index": 0, + "color": "#4D4C7D" + }, + { + "text": " aethum per throw", + "color": "gray" + } + ], "item.affinity.astrokinesis_staff.tooltip.consumption_per_throw": [ - {"index": 0, "color": "#4D4C7D"}, - {"text": " aethum to throw an asteroid", "color": "gray"} + { + "index": 0, + "color": "#4D4C7D" + }, + { + "text": " aethum to throw an asteroid", + "color": "gray" + } + ], + "item.affinity.salvo_staff.tooltip.consumption_per_missile": [ + { + "index": 0, + "color": "#4D4C7D" + }, + { + "text": " aethum per missile", + "color": "gray" + } ], - "item.affinity.salvo_staff.tooltip.consumption_per_missile": [{"index": 0, "color": "#4D4C7D"}, {"text": " aethum per missile", "color": "gray"}], "text.affinity.attuned_shard_range": [ - {"text": "Range: ", "color": "gray"}, - {"index": 0, "color": "#4D4C7D"}, - {"text": " blocks", "color": "#4D4C7D"} + { + "text": "Range: ", + "color": "gray" + }, + { + "index": 0, + "color": "#4D4C7D" + }, + { + "text": " blocks", + "color": "#4D4C7D" + } ], "text.affinity.attuned_shard_max_transfer": [ - {"text": "Rate: ", "color": "gray"}, - {"index": 0, "color": "#4D4C7D"}, - {"text": " af/s", "color": "#4D4C7D"} + { + "text": "Rate: ", + "color": "gray" + }, + { + "index": 0, + "color": "#4D4C7D" + }, + { + "text": " af/s", + "color": "#4D4C7D" + } ], "text.affinity.echo_shard_location": "Bound to %s in %s", "item.affinity.mildly_attuned_amethyst_shard": "Mildly Attuned Amethyst Shard", @@ -371,26 +624,47 @@ "item.affinity.greatly_attuned_amethyst_shard": "Greatly Attuned Amethyst Shard", "item.affinity.sculk_resonant_ethereal_amethyst_shard": "Sculk-Resonant Ethereal Amethyst Shard", "item.affinity.void_resonant_ethereal_amethyst_shard": "Void-Resonant Ethereal Amethyst Shard", + "item.affinity.villager_arms": "Villager Arms", + "item.affinity.villager_arms.with_profession": "%s Arms", + "item.affinity.villager_arms.with_profession.with_level": "%2$s %1$s Arms", "item.affinity.anthracite_powder": "Anthracite Powder", "item.affinity.carbon_copy.empty": "Carbon Copy of ... Nothing?", "item.affinity.carbon_copy": [ "Carbon Copy of ", - {"index": 0, "color": "gray"}, - {"text": "x ", "color": "dark_gray"}, - {"index": 1, "color": "gray"} + { + "index": 0, + "color": "gray" + }, + { + "text": "x ", + "color": "dark_gray" + }, + { + "index": 1, + "color": "gray" + } ], "item.affinity.scintillant_anthracite_blend": "Scintillant Anthracite Blend", "item.affinity.crystalline_wisp_matter_composite": "Crystalline Wisp Matter Composite", "item.affinity.aethum_map_prototype": "Aethum Map Prototype", "item.affinity.realized_aethum_map": "Realized Aethum Map", - "item.affinity.realized_aethum_map.tooltip.locked": {"text": "Locked", "color": "gray"}, - "item.affinity.realized_aethum_map.tooltip.unlocked": {"text": "Unlocked", "color": "gray"}, + "item.affinity.realized_aethum_map.tooltip.locked": { + "text": "Locked", + "color": "gray" + }, + "item.affinity.realized_aethum_map.tooltip.unlocked": { + "text": "Unlocked", + "color": "gray" + }, "enchantment.affinity.curse_of_illiteracy": "Curse of Illiteracy", "enchantment.affinity.curse_of_illiteracy.desc": [ - {"text": "honestly strange that this is now readable", "obfuscated": true} + { + "text": "honestly strange that this is now readable", + "obfuscated": true + } ], "enchantment.affinity.curse_of_health": "Curse of Health", "enchantment.affinity.curse_of_health.desc": "Increases your health when put on. Taking off is not recommended", @@ -399,23 +673,41 @@ "enchantment.affinity.ender_scourge": "Ender Scourge", "enchantment.affinity.ender_scourge.desc": "Increased damage to creatures from the End", "text.affinity.absolute_enchantment_prefix": [ - {"text": "Absolute", "color": "#541690"}, - {"text": " | ", "color": "gray"} + { + "text": "Absolute", + "color": "#541690" + }, + { + "text": " | ", + "color": "gray" + } ], "enchantment.affinity.berserker": "Berserker", "enchantment.affinity.berserker.desc": [ - {"translate": "text.affinity.absolute_enchantment_prefix"}, - {"text": "Increased maximum health and higher attack damage the lower your health"} + { + "translate": "text.affinity.absolute_enchantment_prefix" + }, + { + "text": "Increased maximum health and higher attack damage the lower your health" + } ], "enchantment.affinity.gravecaller": "Gravecaller", "enchantment.affinity.gravecaller.desc": [ - {"translate": "text.affinity.absolute_enchantment_prefix"}, - {"text": "Your armor conjures undead minions and subdues other undead in range"} + { + "translate": "text.affinity.absolute_enchantment_prefix" + }, + { + "text": "Your armor conjures undead minions and subdues other undead in range" + } ], "enchantment.affinity.bastion": "Bastion", "enchantment.affinity.bastion.desc": [ - {"translate": "text.affinity.absolute_enchantment_prefix"}, - {"text": "Extreme, health-based regeneration at the cost of halving your damage output"} + { + "translate": "text.affinity.absolute_enchantment_prefix" + }, + { + "text": "Extreme, health-based regeneration at the cost of halving your damage output" + } ], "enchantment.affinity.wounding": "Wounding", "enchantment.affinity.wounding.desc": "Increased critical hit damage", @@ -461,18 +753,84 @@ "gui.affinity.augmented_crafting_table.title": "Augmented Crafting Table", "gui.affinity.flux_network_visualizer.network_statistics": "Network statistics", - "gui.affinity.flux_network_visualizer.member_count": ["Member count: ", {"index": 0, "color": "blue"}], - "gui.affinity.flux_network_visualizer.node_count": ["Node count: ", {"index": 0, "color": "blue"}], - "gui.affinity.flux_network_visualizer.flux_capacity": ["Flux capacity: ", {"index": 0, "color": "blue"}], - "gui.affinity.flux_network_visualizer.total_flux": ["Total flux: ", {"index": 0, "color": "blue"}], - "gui.affinity.flux_network_visualizer.rotate_hint": ["Mouse 1 to ", {"text": "rotate", "color": "yellow"}], - "gui.affinity.flux_network_visualizer.move_hint": ["Mouse 2 to ", {"text": "move", "color": "yellow"}], - "gui.affinity.flux_network_visualizer.reset_hint": ["Double-click to ", {"text": "reset", "color": "yellow"}], - "gui.affinity.flux_network_visualizer.hover_hint": ["Hover to ", {"text": "view information", "color": "yellow"}], - - "gui.affinity.villager_armature.rotate_hint": ["Mouse 1 to ", {"text": "rotate", "color": "yellow"}], - "gui.affinity.villager_armature.click_hint": ["Mouse 2 to ", {"text": "set target", "color": "yellow"}], - "gui.affinity.villager_armature.reset_hint": ["Double-click to ", {"text": "reset", "color": "yellow"}], + "gui.affinity.flux_network_visualizer.member_count": [ + "Member count: ", + { + "index": 0, + "color": "blue" + } + ], + "gui.affinity.flux_network_visualizer.node_count": [ + "Node count: ", + { + "index": 0, + "color": "blue" + } + ], + "gui.affinity.flux_network_visualizer.flux_capacity": [ + "Flux capacity: ", + { + "index": 0, + "color": "blue" + } + ], + "gui.affinity.flux_network_visualizer.total_flux": [ + "Total flux: ", + { + "index": 0, + "color": "blue" + } + ], + "gui.affinity.flux_network_visualizer.rotate_hint": [ + "Mouse 1 to ", + { + "text": "rotate", + "color": "yellow" + } + ], + "gui.affinity.flux_network_visualizer.move_hint": [ + "Mouse 2 to ", + { + "text": "move", + "color": "yellow" + } + ], + "gui.affinity.flux_network_visualizer.reset_hint": [ + "Double-click to ", + { + "text": "reset", + "color": "yellow" + } + ], + "gui.affinity.flux_network_visualizer.hover_hint": [ + "Hover to ", + { + "text": "view information", + "color": "yellow" + } + ], + + "gui.affinity.villager_armature.rotate_hint": [ + "Mouse 1 to ", + { + "text": "rotate", + "color": "yellow" + } + ], + "gui.affinity.villager_armature.click_hint": [ + "Mouse 2 to ", + { + "text": "set target", + "color": "yellow" + } + ], + "gui.affinity.villager_armature.reset_hint": [ + "Double-click to ", + { + "text": "reset", + "color": "yellow" + } + ], "advancement.affinity.root.title": "Affinity", "advancement.affinity.root.description": "Tomfoolery awaits", @@ -542,26 +900,61 @@ "text.affinity.prefix": [ "", - {"text": "[", "color": "gray"}, - {"text":"A","color":"#0096ff"}, - {"text":"f","color":"#009fff"}, - {"text":"f","color":"#00a8ff"}, - {"text":"i","color":"#00b1ff"}, - {"text":"n","color":"#00bbff"}, - {"text":"i","color":"#00c4ff"}, - {"text":"t","color":"#00cdff"}, - {"text":"y","color":"#00d7ff"}, - {"text": "]", "color": "gray"} + { + "text": "[", + "color": "gray" + }, + { + "text": "A", + "color": "#0096ff" + }, + { + "text": "f", + "color": "#009fff" + }, + { + "text": "f", + "color": "#00a8ff" + }, + { + "text": "i", + "color": "#00b1ff" + }, + { + "text": "n", + "color": "#00bbff" + }, + { + "text": "i", + "color": "#00c4ff" + }, + { + "text": "t", + "color": "#00cdff" + }, + { + "text": "y", + "color": "#00d7ff" + }, + { + "text": "]", + "color": "gray" + } ], "text.config.affinity.title": [ - {"translate": "text.affinity.prefix"}, + { + "translate": "text.affinity.prefix" + }, " Configuration" ], "text.config.affinity.option.renderEntitiesInStereopticonSectionImprints": "Show entities", "text.config.affinity.option.renderBlockEntitiesInStereopticonSectionImprints": "Show block entities", "text.config.affinity.option.affineInfuserCostPerDurabilityPoint": "Flux cost per durability point repaired", "text.config.affinity.option.maxFluxNodeShards": "Maximum outer shards per Flux Node", - "text.config.affinity.section.experimental": {"text": "Experimental", "color": "red"}, + "text.config.affinity.section.experimental": { + "text": "Experimental", + "color": "red" + }, "text.config.affinity.option.stereopticonSectionImprintRecursionLimit": "Recursion limit", "text.config.affinity.option.stereopticonSectionImprintRecursionLimit.tooltip": "How many times a stereopticon's section may be rendered\nwhen nested inside another stereopticon's section", "text.config.affinity.option.theSkyIrisIntegration": "Integrate The Sky with Iris shaders", @@ -666,5 +1059,13 @@ "dimension.minecraft.overworld": "The Overworld", "dimension.minecraft.the_nether": "The Nether", - "dimension.minecraft.the_end": "The End" -} \ No newline at end of file + "dimension.minecraft.the_end": "The End", + + "villagerType.minecraft.desert": "Desert", + "villagerType.minecraft.jungle": "Jungle", + "villagerType.minecraft.plains": "Plains", + "villagerType.minecraft.savanna": "Savanna", + "villagerType.minecraft.snow": "Snow", + "villagerType.minecraft.swamp": "Swamp", + "villagerType.minecraft.taiga": "Taiga" +} diff --git a/src/main/resources/assets/affinity/models/item/villager_arms.json b/src/main/resources/assets/affinity/models/item/villager_arms.json index fc93b4cb..6f22d346 100644 --- a/src/main/resources/assets/affinity/models/item/villager_arms.json +++ b/src/main/resources/assets/affinity/models/item/villager_arms.json @@ -1,54 +1,7 @@ { - "credit": "Made with Blockbench", - "texture_size": [32, 32], - "textures": { - "0": "affinity:item/villager_arms", - "particle": "affinity:item/villager_arms" - }, - "elements": [ - { - "name": "arms", - "from": [4, 5, 8], - "to": [12, 9, 12], - "rotation": {"angle": 45, "axis": "x", "origin": [8, 10, 8]}, - "faces": { - "north": {"uv": [2, 10, 6, 12], "texture": "#0"}, - "east": {"uv": [0, 10, 2, 12], "texture": "#0"}, - "south": {"uv": [8, 10, 12, 12], "texture": "#0"}, - "west": {"uv": [6, 10, 8, 12], "texture": "#0"}, - "up": {"uv": [6, 10, 2, 8], "texture": "#0"}, - "down": {"uv": [10, 8, 6, 10], "texture": "#0"} - } - }, - { - "name": "arms", - "from": [12, 5, 8], - "to": [16, 13, 12], - "rotation": {"angle": 45, "axis": "x", "origin": [8, 10, 8]}, - "faces": { - "north": {"uv": [4, 2, 6, 6], "texture": "#0"}, - "east": {"uv": [2, 2, 4, 6], "texture": "#0"}, - "south": {"uv": [8, 2, 10, 6], "texture": "#0"}, - "west": {"uv": [6, 2, 8, 6], "texture": "#0"}, - "up": {"uv": [6, 2, 4, 0], "texture": "#0"}, - "down": {"uv": [8, 0, 6, 2], "texture": "#0"} - } - }, - { - "name": "mirrored", - "from": [0, 5, 8], - "to": [4, 13, 12], - "rotation": {"angle": 45, "axis": "x", "origin": [8, 10, 8]}, - "faces": { - "north": {"uv": [6, 2, 4, 6], "texture": "#0"}, - "east": {"uv": [8, 2, 6, 6], "texture": "#0"}, - "south": {"uv": [10, 2, 8, 6], "texture": "#0"}, - "west": {"uv": [4, 2, 2, 6], "texture": "#0"}, - "up": {"uv": [4, 2, 6, 0], "texture": "#0"}, - "down": {"uv": [6, 0, 8, 2], "texture": "#0"} - } - } - ], + "credit": "Made by chyzman", + "parent": "minecraft:builtin/entity", + "gui_light": "front", "display": { "thirdperson_righthand": { "rotation": [45, 0, 0], @@ -84,14 +37,5 @@ "fixed": { "translation": [0, 0.5, 0] } - }, - "groups": [ - { - "name": "arms", - "origin": [0, 21.05, -1.05], - "rotation": [43, 0, 0], - "color": 0, - "children": [0, 1, 2] - } - ] -} \ No newline at end of file + } +} diff --git a/src/main/resources/data/affinity/tags/item/chowl_packing_group/artifact_blades.json b/src/main/resources/data/affinity/tags/item/chowl_packing_group/artifact_blades.json new file mode 100644 index 00000000..22f5c1cf --- /dev/null +++ b/src/main/resources/data/affinity/tags/item/chowl_packing_group/artifact_blades.json @@ -0,0 +1,5 @@ +{ + "values": [ + "#affinity:artifact_blades" + ] +} diff --git a/src/main/resources/data/affinity/tags/item/chowl_packing_group/staffs.json b/src/main/resources/data/affinity/tags/item/chowl_packing_group/staffs.json new file mode 100644 index 00000000..a840f768 --- /dev/null +++ b/src/main/resources/data/affinity/tags/item/chowl_packing_group/staffs.json @@ -0,0 +1,6 @@ +{ + "values": [ + "#affinity:staffs", + "affinity:aethum_fire_extinguisher" + ] +} diff --git a/src/main/resources/data/affinity/tags/item/chowl_packing_group/wisp_matter.json b/src/main/resources/data/affinity/tags/item/chowl_packing_group/wisp_matter.json new file mode 100644 index 00000000..2648b14b --- /dev/null +++ b/src/main/resources/data/affinity/tags/item/chowl_packing_group/wisp_matter.json @@ -0,0 +1,5 @@ +{ + "values": [ + "#affinity:wisp_matter" + ] +} diff --git a/src/main/resources/data/affinity/tags/item/chowl_packing_group/wisp_mist.json b/src/main/resources/data/affinity/tags/item/chowl_packing_group/wisp_mist.json new file mode 100644 index 00000000..51c879ee --- /dev/null +++ b/src/main/resources/data/affinity/tags/item/chowl_packing_group/wisp_mist.json @@ -0,0 +1,5 @@ +{ + "values": [ + "#affinity:wisp_mist" + ] +} diff --git a/src/main/resources/data/c/tags/items/ingots/emerald.json b/src/main/resources/data/c/tags/items/ingots/emerald.json new file mode 100644 index 00000000..d871e1ea --- /dev/null +++ b/src/main/resources/data/c/tags/items/ingots/emerald.json @@ -0,0 +1,5 @@ +{ + "values": [ + "affinity:emerald_ingot" + ] +} diff --git a/src/main/resources/data/c/tags/items/nuggets/emerald.json b/src/main/resources/data/c/tags/items/nuggets/emerald.json new file mode 100644 index 00000000..071e2a88 --- /dev/null +++ b/src/main/resources/data/c/tags/items/nuggets/emerald.json @@ -0,0 +1,5 @@ +{ + "values": [ + "affinity:emerald_nugget" + ] +}