From 7e3d76f721d4b3a2c6ae478fadda17b1d1fe1b87 Mon Sep 17 00:00:00 2001 From: Fripe070 <72686066+Fripe070@users.noreply.github.com> Date: Sat, 11 Oct 2025 18:30:46 +0200 Subject: [PATCH 1/4] Refactor --- .../pirkko/models/item/pirkko/blank.json | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 src/main/resources/assets/pirkko/models/item/pirkko/blank.json diff --git a/src/main/resources/assets/pirkko/models/item/pirkko/blank.json b/src/main/resources/assets/pirkko/models/item/pirkko/blank.json new file mode 100644 index 0000000..8e9530a --- /dev/null +++ b/src/main/resources/assets/pirkko/models/item/pirkko/blank.json @@ -0,0 +1,116 @@ +{ + "format_version": "1.21.6", + "credit": "Made with Blockbench", + "texture_size": [32, 32], + "textures": { + "texture": "pirkko:item/pirkko/blank" + }, + "elements": [ + { + "name": "head_extention", + "from": [7, 6, 7], + "to": [9, 7, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 6, 8]}, + "faces": { + "north": {"uv": [6, 9, 8, 10], "texture": "#texture"}, + "east": {"uv": [4, 9, 6, 10], "texture": "#texture"}, + "south": {"uv": [2, 9, 4, 10], "texture": "#texture"}, + "west": {"uv": [0, 9, 2, 10], "texture": "#texture"}, + "up": {"uv": [4, 9, 2, 7], "rotation": 180, "texture": "#texture"}, + "down": {"uv": [0.5, 0, 0, 0.5], "rotation": 180, "texture": "#texture"} + } + }, + { + "name": "head", + "from": [7, 3, 7], + "to": [9, 6, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 3, 8]}, + "faces": { + "north": {"uv": [6, 13, 8, 16], "texture": "#texture"}, + "east": {"uv": [4, 13, 6, 16], "texture": "#texture"}, + "south": {"uv": [2, 13, 4, 16], "texture": "#texture"}, + "west": {"uv": [0, 13, 2, 16], "texture": "#texture"}, + "up": {"uv": [4, 13, 2, 11], "rotation": 180, "texture": "#texture"}, + "down": {"uv": [0.5, 0, 0, 0.5], "rotation": 180, "texture": "#texture"} + } + }, + { + "name": "body", + "from": [6.5, 0, 6.5], + "to": [9.5, 3, 9.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, + "faces": { + "north": {"uv": [11, 3.5, 14, 6.5], "texture": "#texture"}, + "east": {"uv": [8, 3.5, 11, 6.5], "texture": "#texture"}, + "south": {"uv": [5, 3.5, 8, 6.5], "texture": "#texture"}, + "west": {"uv": [2, 3.5, 5, 6.5], "texture": "#texture"}, + "up": {"uv": [8, 3.5, 5, 0.5], "rotation": 180, "texture": "#texture"}, + "down": {"uv": [11, 0.5, 8, 3.5], "rotation": 180, "texture": "#texture"} + } + }, + { + "name": "right_arm", + "from": [8.5, 1.5, 7.5], + "to": [9.5, 3.5, 8.5], + "rotation": {"angle": -45, "axis": "z", "origin": [8.5, 1.5, 7.5]}, + "faces": { + "north": {"uv": [13, 1, 14, 3], "texture": "#texture"}, + "east": {"uv": [12, 1, 13, 3], "texture": "#texture"}, + "south": {"uv": [15, 1, 16, 3], "texture": "#texture"}, + "west": {"uv": [14, 1, 15, 3], "texture": "#texture"}, + "up": {"uv": [14, 1, 13, 0], "texture": "#texture"}, + "down": {"uv": [15, 0, 14, 1], "texture": "#texture"} + } + }, + { + "name": "left_arm", + "from": [6.5, 1.5, 7.5], + "to": [7.5, 3.5, 8.5], + "rotation": {"angle": 45, "axis": "z", "origin": [7.5, 1.5, 7.5]}, + "faces": { + "north": {"uv": [2, 1, 1, 3], "texture": "#texture"}, + "east": {"uv": [3, 1, 2, 3], "texture": "#texture"}, + "south": {"uv": [4, 1, 3, 3], "texture": "#texture"}, + "west": {"uv": [1, 1, 0, 3], "texture": "#texture"}, + "up": {"uv": [1, 1, 2, 0], "texture": "#texture"}, + "down": {"uv": [2, 0, 3, 1], "texture": "#texture"} + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [0, 7, 0] + }, + "thirdperson_lefthand": { + "translation": [0, 7, 0] + }, + "firstperson_righthand": { + "rotation": [0, -20, 0], + "translation": [0, 10, 0], + "scale": [1.4, 1.4, 1.4] + }, + "firstperson_lefthand": { + "rotation": [0, -20, 0], + "translation": [0, 10, 0], + "scale": [1.4, 1.4, 1.4] + }, + "ground": { + "translation": [0, 6, 0] + }, + "gui": { + "rotation": [0, -17, 0], + "translation": [0, 8, 0], + "scale": [2, 2, 2] + }, + "head": { + "rotation": [0, -180, 0], + "translation": [0, 17.5, 0], + "scale": [1.4, 1.4, 1.4] + }, + "fixed": { + "rotation": [0, -180, 0], + "translation": [0, 11, 0], + "scale": [2.5, 2.5, 2.5] + } + } +} \ No newline at end of file From 6d23f68a0e8b60fd9733d43450fbdc0d80ad8424 Mon Sep 17 00:00:00 2001 From: Fripe070 <72686066+Fripe070@users.noreply.github.com> Date: Sat, 11 Oct 2025 19:07:24 +0200 Subject: [PATCH 2/4] Refactor part 2 --- .../io/github/fripe070/pirkko/Pirkko.java | 10 +- .../io/github/fripe070/pirkko/PirkkoKind.java | 52 +++-- .../fripe070/pirkko/block/PirkkoBlock.java | 179 ++++++++---------- .../pirkko/datagen/ModelProvider.java | 29 ++- .../pirkko/datagen/RecipesProvider.java | 44 ++--- .../fripe070/pirkko/item/PirkkoItem.java | 51 ++--- .../resources/assets/pirkko/lang/en_pt.json | 47 +++-- .../resources/assets/pirkko/lang/en_us.json | 47 +++-- .../resources/assets/pirkko/lang/lol_us.json | 47 +++-- .../item/pirkko/{blank.json => base.json} | 0 .../pirkko/models/item/pirkko/standard.json | 116 ------------ 11 files changed, 230 insertions(+), 392 deletions(-) rename src/main/resources/assets/pirkko/models/item/pirkko/{blank.json => base.json} (100%) delete mode 100644 src/main/resources/assets/pirkko/models/item/pirkko/standard.json diff --git a/src/main/java/io/github/fripe070/pirkko/Pirkko.java b/src/main/java/io/github/fripe070/pirkko/Pirkko.java index a723f83..71e7cbe 100644 --- a/src/main/java/io/github/fripe070/pirkko/Pirkko.java +++ b/src/main/java/io/github/fripe070/pirkko/Pirkko.java @@ -9,8 +9,6 @@ import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; import net.minecraft.block.AbstractBlock; import net.minecraft.block.MapColor; -import net.minecraft.component.DataComponentTypes; -import net.minecraft.component.type.CustomModelDataComponent; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.item.Item; @@ -27,7 +25,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.util.List; import java.util.Optional; public class Pirkko implements ModInitializer { @@ -35,7 +32,7 @@ public class Pirkko implements ModInitializer { public static final Logger LOGGER = LoggerFactory.getLogger("pirkko"); public static final PirkkoBlock PIRKKO_BLOCK = registerPirkkoBlock("pirkko"); - public static final Item DEFAULT_PIRKKO_ITEM = registerPirkkoItem("pirkko", PIRKKO_BLOCK); + public static final PirkkoItem PIRKKO_ITEM = registerPirkkoItem("pirkko", PIRKKO_BLOCK); public static final SoundEvent PIRKKO_SOUND = registerSoundEvent("pirkko", SoundEvents.ENTITY_COD_FLOP); public static final StatusEffect PIRKKO_POWER = new PirkkoPowerEffect(); @@ -59,15 +56,16 @@ private static PirkkoBlock registerPirkkoBlock(String name) { return block; } - private static Item registerPirkkoItem(String name, PirkkoBlock block) { + private static PirkkoItem registerPirkkoItem(String name, PirkkoBlock block) { var registryKey = Identifier.of(MOD_ID, name); var item = new PirkkoItem(block, new Item.Settings() .maxCount(65) .fireproof() + // TODO: Vary the rarity based on the kind .rarity(Rarity.EPIC) .equippableUnswappable(EquipmentSlot.HEAD) .registryKey(RegistryKey.of(RegistryKeys.ITEM, registryKey)) -// .useBlockPrefixedTranslationKey() + .useBlockPrefixedTranslationKey() ); Registry.register(Registries.ITEM, Identifier.of(MOD_ID, name), item); ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(entries -> { diff --git a/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java b/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java index 113e8c4..e1c488c 100644 --- a/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java +++ b/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java @@ -4,6 +4,7 @@ import org.jetbrains.annotations.Nullable; import java.util.Objects; +import java.util.stream.Stream; public enum PirkkoKind implements StringIdentifiable { BLANK(0, "blank"), @@ -29,35 +30,44 @@ public enum PirkkoKind implements StringIdentifiable { LASERVIOLETT(20, "laserviolett"), CERISE(21, "cerise"); - private final int index; - private final String id; - private final String friendlyId; + private final String assetPath; - PirkkoKind(int index, String id) { + PirkkoKind(int index, String assetPath) { this.index = index; - this.id = id; - this.friendlyId = id.replace("/", "_"); + this.assetPath = assetPath; } - @Override - public String asString() { - return friendlyId; + public String getPath() { + return assetPath; } - public String realId() { - return id; + public String getId() { + return assetPath.replace("/", "_"); + } + public String getTranslationKey() { + return assetPath.replace("/", "."); } - public int getIndex() { return index; } + + @Override + public String asString() { + return this.getId(); + } + @Nullable - public static PirkkoKind fromName(String name) { - for (PirkkoKind kind : PirkkoKind.values()) { - if (Objects.equals(kind.asString(), name)) { - return kind; - } - } - return null; - } -} + public static PirkkoKind fromPath(String path) { + return Stream.of(values()) + .filter(kind -> kind.getPath().equals(path)) + .findFirst() + .orElse(null); + } + @Nullable + public static PirkkoKind fromId(String id) { + return Stream.of(values()) + .filter(kind -> kind.getId().equals(id)) + .findFirst() + .orElse(null); + } +} \ No newline at end of file diff --git a/src/main/java/io/github/fripe070/pirkko/block/PirkkoBlock.java b/src/main/java/io/github/fripe070/pirkko/block/PirkkoBlock.java index e352ff8..d87696f 100644 --- a/src/main/java/io/github/fripe070/pirkko/block/PirkkoBlock.java +++ b/src/main/java/io/github/fripe070/pirkko/block/PirkkoBlock.java @@ -48,17 +48,17 @@ import static io.github.fripe070.pirkko.Pirkko.PIRKKO_SOUND; -// TODO: Allow waterlogging public class PirkkoBlock extends Block implements BlockWithElementHolder, PolymerTexturedBlock, Waterloggable { public static final MapCodec CODEC = createCodec(PirkkoBlock::new); - public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; + public static final IntProperty ROTATION = Properties.ROTATION; public static final EnumProperty UP_DIRECTION = Properties.FACING; - public static final EnumProperty PIRKKO_KIND = EnumProperty.of("pirkko_kind", PirkkoKind.class); + public static final BooleanProperty WATERLOGGED = Properties.WATERLOGGED; + public static final BooleanProperty POWERED = BooleanProperty.of("powered"); + public static final EnumProperty KIND = EnumProperty.of("kind", PirkkoKind.class); protected static final int SQUISH_TICKS = 4; public static final IntProperty SQUISH_TICK = IntProperty.of("squish_tick", 0, SQUISH_TICKS); - public static final BooleanProperty POWERED = BooleanProperty.of("powered"); protected final Random random; @@ -66,57 +66,70 @@ public class PirkkoBlock extends Block implements BlockWithElementHolder, Polyme public MapCodec getCodec() { return CODEC; } - @Override protected void appendProperties(StateManager.Builder builder) { - builder.add(UP_DIRECTION, WATERLOGGED, SQUISH_TICK, POWERED, ROTATION, PIRKKO_KIND); + builder.add(ROTATION, UP_DIRECTION, WATERLOGGED, POWERED, KIND, SQUISH_TICK); } - protected ItemStack getItemStack(BlockState blockState) { - var pirkkoKind = blockState.get(PIRKKO_KIND); - return PirkkoItem.getStack(pirkkoKind); + public PirkkoBlock(AbstractBlock.Settings settings) { + super(settings); + this.random = Random.create(); + this.setDefaultState(this.stateManager.getDefaultState() + .with(ROTATION, RotationPropertyHelper.fromDirection(Direction.NORTH)) + .with(UP_DIRECTION, Direction.UP) + .with(WATERLOGGED, false) + .with(POWERED, false) + .with(KIND, PirkkoKind.BLANK) + .with(SQUISH_TICK, 0) + ); } + protected ItemStack getItemStack(BlockState blockState) { + return PirkkoItem.getStack(blockState.get(KIND)); + } @Override protected ItemStack getPickStack(WorldView world, BlockPos pos, BlockState state, boolean includeData) { return this.getItemStack(state); } - @Override protected List getDroppedStacks(BlockState state, LootWorldContext.Builder builder) { return List.of(getItemStack(state)); } - public PirkkoBlock(AbstractBlock.Settings settings) { - super(settings); - this.random = Random.create(); - this.setDefaultState(this.stateManager.getDefaultState() - .with(UP_DIRECTION, Direction.NORTH) - .with(WATERLOGGED, false) - .with(SQUISH_TICK, 0) - .with(POWERED, false) - .with(ROTATION, 2) - .with(PIRKKO_KIND, PirkkoKind.BLANK) - ); - } + @Nullable + public BlockState getPlacementState(ItemPlacementContext ctx) { + var side = ctx.getSide(); + BlockState blockState = this.getDefaultState(); + blockState = blockState.with(UP_DIRECTION, side); + blockState = blockState.with(KIND, PirkkoItem.getPirkkoKind(ctx.getStack())); + blockState = blockState.with(WATERLOGGED, ctx.getWorld().getFluidState(ctx.getBlockPos()).getFluid() == Fluids.WATER); - public void playPirkko(World world, BlockPos pos) { - playPirkko(world, pos, 1.1f + (this.random.nextFloat() - 0.5f) * 0.3f); - } + // Determine the rotation based on the side it is placed on and where the player is looking + // Yes, this is horrible + if (side == Direction.UP || side == Direction.DOWN) { + // Display entity will be rotated such that the horizontal rotation inverts when upside down, hence we invert + var horizontalAngle = RotationPropertyHelper.fromYaw(side == Direction.DOWN + ? ctx.getPlayerYaw() + : -ctx.getPlayerYaw()); + blockState = blockState.with(ROTATION, horizontalAngle); + } else { + @Nullable PlayerEntity player = ctx.getPlayer(); + Vec3d playerLook = player != null ? player.getRotationVector() : new Vec3d(0, -1, 0); - public void playPirkko(World world, BlockPos pos, float pitch) { - world.playSound(null, pos, PIRKKO_SOUND, SoundCategory.BLOCKS, 0.8f, pitch); - } + Vector3f perpToSide = side.getUnitVector().cross(Direction.UP.getUnitVector()); + double angle = Math.atan2(playerLook.getY(), perpToSide.dot(playerLook.toVector3f())); + + blockState = blockState.with(ROTATION, RotationPropertyHelper.fromYaw((float) Math.toDegrees(angle) - 90)); + } - protected Direction getPlacedDirection(BlockState state) { - var facing = state.get(UP_DIRECTION); - return facing.getOpposite(); + if (!blockState.canPlaceAt(ctx.getWorld(), ctx.getBlockPos())) + return null; + return blockState; } - protected BlockState getPlacedAgainstBlock(BlockState state, World world, BlockPos pos) { - var direction = getPlacedDirection(state); - var newPos = pos.add(direction.getVector()); - return world.getBlockState(newPos); + @Override + protected ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) { + return squish(state, world, pos); } protected ActionResult squish(BlockState state, World world, BlockPos pos) { @@ -130,49 +143,22 @@ protected ActionResult squish(BlockState state, World world, BlockPos pos) { protected int getSquishTicks(BlockState state) { return state.get(SQUISH_TICK); } - protected boolean isSquishing(BlockState state) { var squishTick = getSquishTicks(state); return squishTick > 0; } - @Nullable - public BlockState getPlacementState(ItemPlacementContext ctx) { - var side = ctx.getSide(); - BlockState blockState = this.getDefaultState(); - blockState = blockState.with(UP_DIRECTION, side); - - // Determine the rotation - // Yes, this is horrible - if (side == Direction.UP || side == Direction.DOWN) { - var playerYaw = ctx.getPlayerYaw(); - if (side == Direction.UP) { - playerYaw = -playerYaw; // yaw needs to be inverted for some reason - } - var horizontalLookAngle = RotationPropertyHelper.fromYaw(playerYaw); - blockState = blockState.with(ROTATION, horizontalLookAngle); - } else { - if (ctx.getPlayer() != null) { - var playerPitch = Math.toRadians(ctx.getPlayer().getPitch()); - var playerYaw = Math.toRadians(ctx.getPlayer().getYaw()); - var playerLookingDirection = new Vec3d(-Math.sin(playerYaw) * Math.cos(playerPitch), Math.sin(playerPitch), Math.cos(playerYaw) * Math.cos(playerPitch)); - var perpToSide = side.getUnitVector().cross(Direction.UP.getUnitVector()); - var angle = Math.atan2(playerLookingDirection.getY(), perpToSide.dot(playerLookingDirection.toVector3f())); - blockState = blockState.with(ROTATION, RotationPropertyHelper.fromYaw((float) Math.toDegrees(angle) - 90)); - } - } - - var pirkkoKind = PirkkoItem.getPirkkoKind(ctx.getStack()); - blockState = blockState.with(PIRKKO_KIND, pirkkoKind); - if (blockState.canPlaceAt(ctx.getWorld(), ctx.getBlockPos())) { - return blockState.with(WATERLOGGED, ctx.getWorld().getFluidState(ctx.getBlockPos()).getFluid() == Fluids.WATER); - } - return null; + public void playPirkko(World world, BlockPos pos) { + this.playPirkko(world, pos, 1.1f + (this.random.nextFloat() - 0.5f) * 0.3f); + } + public void playPirkko(World world, BlockPos pos, float pitch) { + world.playSound(null, pos, PIRKKO_SOUND, SoundCategory.BLOCKS, 0.8f, pitch); } - @Override - protected ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) { - return squish(state, world, pos); + protected BlockState getFloorBlock(BlockState state, World world, BlockPos pos) { + var direction = state.get(UP_DIRECTION).getOpposite(); + var newPos = pos.add(direction.getVector()); + return world.getBlockState(newPos); } @Override @@ -219,7 +205,6 @@ public void onBroken(WorldAccess world, BlockPos pos, BlockState state) { this.playPirkko((World) world, pos); } - @Override protected boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { return true; @@ -232,11 +217,12 @@ public FluidState getFluidState(BlockState state) { @Override protected BlockState getStateForNeighborUpdate(BlockState state, WorldView world, ScheduledTickView tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, Random random) { - if (state.get(WATERLOGGED)) tickView.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + if (state.get(WATERLOGGED)) { + tickView.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + } return super.getStateForNeighborUpdate(state, world, tickView, pos, direction, neighborPos, neighborState, random); } - @Override public BlockState getPolymerBlockState(BlockState state, PacketContext context) { return PolymerBlockResourceUtils.requestEmpty(BlockModelType.valueOf((switch (state.get(UP_DIRECTION)) { @@ -259,38 +245,30 @@ public boolean tickElementHolder(ServerWorld world, BlockPos pos, BlockState ini @SuppressWarnings("removal") static class PirkkoHolder extends ElementHolder { private final ItemDisplayElement display; - //private final TextDisplayElement debugText; - private Matrix4f baseTransform; + private final Matrix4f baseTransform; public PirkkoHolder(BlockState initialBlockState, ItemStack itemStack) { - this.baseTransform = new Matrix4f(); - this.RecomputeBaseTransform(initialBlockState); + this.baseTransform = this.computeTransform(initialBlockState); + this.display = addElement(new ItemDisplayElement(itemStack)); this.display.setModelTransformation(ItemDisplayContext.NONE); this.display.setTransformation(this.baseTransform); - this.display.setInterpolationDuration(1); - - //this.debugText = addElement(new TextDisplayElement(Text.of("Debug"))); - //this.debugText.setBillboardMode(DisplayEntity.BillboardMode.CENTER); - //this.debugText.setScale(new Vector3f(0.5f)); + this.display.setInterpolationDuration(1); // Blockstate is only updated each tick, this smooths it on the client } - public void RecomputeBaseTransform(BlockState blockState) { - this.baseTransform = new Matrix4f(); + public Matrix4f computeTransform(BlockState blockState) { + var transform = new Matrix4f(); var facing = blockState.get(UP_DIRECTION); if (facing == Direction.DOWN) { - this.baseTransform.rotateY((float) Math.toRadians(180)); - this.baseTransform.rotateX((float) Math.toRadians(180)); + transform.rotateY((float) Math.toRadians(180)); + transform.rotateX((float) Math.toRadians(180)); } else if (facing != Direction.UP) { var rotation = Direction.getHorizontalDegreesOrThrow(facing); - this.baseTransform.rotateY((float) Math.toRadians(-rotation)); - this.baseTransform.rotateX((float) Math.toRadians(90)); + transform.rotateY((float) Math.toRadians(-rotation)); + transform.rotateX((float) Math.toRadians(90)); } - this.baseTransform.rotateY((float) Math.toRadians(RotationPropertyHelper.toDegrees(blockState.get(ROTATION)))); - } - - public PirkkoHolder(BlockState initialBlockState, Item item) { - this(initialBlockState, item.getDefaultStack()); + transform.rotateY((float) Math.toRadians(RotationPropertyHelper.toDegrees(blockState.get(ROTATION)))); + return transform; } @Override @@ -301,14 +279,13 @@ protected void onTick() { if (squishTick > 0) { float squishFactor = squishTick / (float) SQUISH_TICKS; - Vector3f squishScale = new Vector3f( - 1f + 0.2f * squishFactor, - 1f - 0.3f * squishFactor, - 1f + 0.2f * squishFactor - ); this.display.setTransformation(new Matrix4f(this.baseTransform) - .translate(0, -0.5f, 0) - .scale(squishScale) + .translate(0, -0.5f, 0) // Scale down from this origin (offset from center) + .scale(new Vector3f( + 1f + 0.2f * squishFactor, + 1f - 0.3f * squishFactor, + 1f + 0.2f * squishFactor + )) .translate(0, 0.5f, 0) ); this.display.startInterpolation(); diff --git a/src/main/java/io/github/fripe070/pirkko/datagen/ModelProvider.java b/src/main/java/io/github/fripe070/pirkko/datagen/ModelProvider.java index ee98a8e..f25c1ba 100644 --- a/src/main/java/io/github/fripe070/pirkko/datagen/ModelProvider.java +++ b/src/main/java/io/github/fripe070/pirkko/datagen/ModelProvider.java @@ -8,49 +8,48 @@ import net.minecraft.client.render.item.model.ItemModel; import net.minecraft.client.render.item.model.SelectItemModel; import net.minecraft.client.render.item.property.select.CustomModelDataStringProperty; -import net.minecraft.util.DyeColor; import net.minecraft.util.Identifier; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.Optional; -import java.util.stream.Stream; public class ModelProvider extends FabricModelProvider { public ModelProvider(FabricDataOutput output) { super(output); } - @Override - public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { - } - - @Override public void generateItemModels(ItemModelGenerator itemModelGenerator) { - var standardPirkkoId = Identifier.of(Pirkko.MOD_ID, "item/pirkko/standard"); - var pirkkoModel = new Model(Optional.of(standardPirkkoId), Optional.empty(), TextureKey.TEXTURE); + var blankPirkkoId = Identifier.of(Pirkko.MOD_ID, "item/pirkko/base"); + var pirkkoModel = new Model(Optional.of(blankPirkkoId), Optional.empty(), TextureKey.TEXTURE); List> pirkkoModels = new ArrayList<>(); for (PirkkoKind kind : PirkkoKind.values()) { + // Skip the default blank kind + if (kind == PirkkoKind.BLANK) continue; + var subModel = pirkkoModel.upload( - ModelIds.getItemSubModelId(Pirkko.DEFAULT_PIRKKO_ITEM, "/" + kind.realId()), - TextureMap.texture(TextureMap.getSubId(Pirkko.DEFAULT_PIRKKO_ITEM, "/" + kind.realId())), + ModelIds.getItemSubModelId(Pirkko.PIRKKO_ITEM, "/" + kind.getPath()), + TextureMap.texture(TextureMap.getSubId(Pirkko.PIRKKO_ITEM, "/" + kind.getPath())), itemModelGenerator.modelCollector ); ItemModel.Unbaked model = ItemModels.basic(subModel); - pirkkoModels.add(ItemModels.switchCase(kind.asString(), model)); + pirkkoModels.add(ItemModels.switchCase(kind.getId(), model)); } // Create the json file at models/item/pirkko.json itemModelGenerator.output.accept( - Pirkko.DEFAULT_PIRKKO_ITEM, + Pirkko.PIRKKO_ITEM, ItemModels.select( new CustomModelDataStringProperty(0), - ItemModels.basic(standardPirkkoId), + ItemModels.basic(blankPirkkoId), pirkkoModels ) ); } + + @Override + public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { + } } diff --git a/src/main/java/io/github/fripe070/pirkko/datagen/RecipesProvider.java b/src/main/java/io/github/fripe070/pirkko/datagen/RecipesProvider.java index f4f028d..1491c09 100644 --- a/src/main/java/io/github/fripe070/pirkko/datagen/RecipesProvider.java +++ b/src/main/java/io/github/fripe070/pirkko/datagen/RecipesProvider.java @@ -5,34 +5,19 @@ import io.github.fripe070.pirkko.item.PirkkoItem; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider; -import net.minecraft.advancement.Advancement; -import net.minecraft.advancement.AdvancementEntry; -import net.minecraft.advancement.criterion.InventoryChangedCriterion; -import net.minecraft.component.DataComponentTypes; -import net.minecraft.component.type.CustomModelDataComponent; -import net.minecraft.component.type.DyedColorComponent; import net.minecraft.data.recipe.RecipeExporter; import net.minecraft.data.recipe.RecipeGenerator; import net.minecraft.data.recipe.ShapedRecipeJsonBuilder; import net.minecraft.data.recipe.ShapelessRecipeJsonBuilder; -import net.minecraft.item.DyeItem; import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; import net.minecraft.item.Items; -import net.minecraft.recipe.Recipe; -import net.minecraft.recipe.ShapedRecipe; -import net.minecraft.recipe.ShapelessRecipe; import net.minecraft.recipe.book.RecipeCategory; import net.minecraft.registry.Registries; -import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.RegistryWrapper; import net.minecraft.util.DyeColor; import net.minecraft.util.Identifier; -import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; -import java.util.List; import java.util.concurrent.CompletableFuture; class RecipesProvider extends FabricRecipeProvider { @@ -46,7 +31,7 @@ protected RecipeGenerator getRecipeGenerator(RegistryWrapper.WrapperLookup regis @Override public void generate() { RegistryWrapper.Impl itemLookup = registries.getOrThrow(RegistryKeys.ITEM); - ShapedRecipeJsonBuilder.create(itemLookup, RecipeCategory.DECORATIONS, Pirkko.DEFAULT_PIRKKO_ITEM) + ShapedRecipeJsonBuilder.create(itemLookup, RecipeCategory.DECORATIONS, Pirkko.PIRKKO_ITEM) .pattern(" t ") .pattern("trt") .pattern(" t ") @@ -56,16 +41,27 @@ public void generate() { .criterion(hasItem(Items.RESIN_BRICK), conditionsFromItem(Items.RESIN_BRICK)) .offerTo(exporter); + generateDyeingRecipes(itemLookup); + } + + private void generateDyeingRecipes(RegistryWrapper.Impl itemLookup) { + String recipeGroup = Identifier.of(Pirkko.MOD_ID, "pirkko_dyeing").toString(); for (var dye : DyeColor.values()) { - //var stack = new ItemStack(Pirkko.DEFAULT_PIRKKO_ITEM); - var stack = PirkkoItem.getStack(PirkkoKind.fromName("color_" + dye.getId())); + var kind = PirkkoKind.fromPath("color/" + dye.getId()); + if (kind == null) { + Pirkko.LOGGER.warn("Unknown dye color: {}", dye.getId()); + continue; + } + + var dyeItem = Registries.ITEM.get(Identifier.ofVanilla(dye.asString() + "_dye")); + String recipeId = Identifier.of(Pirkko.MOD_ID, dye.asString() + "_pirkko").toString(); - ShapelessRecipeJsonBuilder.create(itemLookup, RecipeCategory.DECORATIONS, stack) - .group(Identifier.of(Pirkko.MOD_ID, "pirkko_dye").toString()) - .input(Pirkko.DEFAULT_PIRKKO_ITEM) - .input(Registries.ITEM.get(Identifier.ofVanilla(dye.asString() + "_dye"))) - .criterion(hasItem(Pirkko.DEFAULT_PIRKKO_ITEM), conditionsFromItem(Pirkko.DEFAULT_PIRKKO_ITEM)) - .offerTo(exporter, Identifier.of(Pirkko.MOD_ID, dye.asString() + "_pirkko").toString()); + ShapelessRecipeJsonBuilder.create(itemLookup, RecipeCategory.DECORATIONS, PirkkoItem.getStack(kind)) + .group(recipeGroup) + .input(Pirkko.PIRKKO_ITEM) + .input(dyeItem) + .criterion(hasItem(Pirkko.PIRKKO_ITEM), conditionsFromItem(Pirkko.PIRKKO_ITEM)) + .offerTo(exporter, recipeId); } } }; diff --git a/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java b/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java index de63b0d..80ea8ce 100644 --- a/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java +++ b/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java @@ -12,6 +12,7 @@ import net.minecraft.text.Text; import net.minecraft.util.ActionResult; import net.minecraft.util.Identifier; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import xyz.nucleoid.packettweaker.PacketContext; @@ -23,21 +24,18 @@ public PirkkoItem(Block block, Settings settings) { super(block, settings); } - public static ItemStack getStack(PirkkoKind kind) { - var itemStack = Pirkko.DEFAULT_PIRKKO_ITEM.getDefaultStack(); - var oldModelData = itemStack.get(DataComponentTypes.CUSTOM_MODEL_DATA); + public static ItemStack getStack(@NotNull PirkkoKind kind) { + var stack = Pirkko.PIRKKO_ITEM.getDefaultStack(); + var oldModelData = stack.get(DataComponentTypes.CUSTOM_MODEL_DATA); if (oldModelData == null) { oldModelData = new CustomModelDataComponent(List.of(), List.of(), List.of(), List.of()); } - if (kind == null) { - kind = PirkkoKind.BLANK; - } - itemStack.set(DataComponentTypes.CUSTOM_MODEL_DATA, new CustomModelDataComponent( + stack.set(DataComponentTypes.CUSTOM_MODEL_DATA, new CustomModelDataComponent( oldModelData.floats(), oldModelData.flags(), - List.of(kind.asString()), + List.of(kind.getId()), oldModelData.colors())); - return itemStack; + return stack; } @Override @@ -45,27 +43,12 @@ public Item getPolymerItem(ItemStack itemStack, PacketContext context) { return Items.TRIAL_KEY; } - @Override - public @Nullable Identifier getPolymerItemModel(ItemStack stack, PacketContext context) { - return PolymerItem.super.getPolymerItemModel(stack, context); - } - - @Override - public ActionResult place(ItemPlacementContext context) { - return super.place(context); - } - - public static String getPirkkoKindString(ItemStack stack) { + public static @NotNull PirkkoKind getPirkkoKind(ItemStack stack) { var modelData = stack.get(DataComponentTypes.CUSTOM_MODEL_DATA); if (modelData == null || modelData.strings().isEmpty()) { - return "standard"; + return PirkkoKind.BLANK; } - var kind = modelData.strings().getFirst(); - return kind; - } - public static PirkkoKind getPirkkoKind(ItemStack stack) { - var pirkkoKindString = getPirkkoKindString(stack); - var pirkkoKind = PirkkoKind.fromName(pirkkoKindString); + var pirkkoKind = PirkkoKind.fromId(modelData.strings().getFirst()); if (pirkkoKind == null) { return PirkkoKind.BLANK; } @@ -75,22 +58,16 @@ public static PirkkoKind getPirkkoKind(ItemStack stack) { @Override public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipType tooltipType, PacketContext context) { var stack = PolymerItem.super.getPolymerItemStack(itemStack, tooltipType, context); - String kind = getPirkkoKindString(stack); + PirkkoKind kind = getPirkkoKind(stack); + Text translationName = stack.get(DataComponentTypes.ITEM_NAME); - if (!kind.equals("standard")) { - translationName = Text.translatable("item.pirkko." + kind + "_pirkko"); + if (!kind.equals(PirkkoKind.BLANK)) { + translationName = Text.translatable(this.translationKey + "." + kind.getTranslationKey()); } stack.set(DataComponentTypes.ITEM_NAME, translationName); return stack; } - @Override - protected @Nullable BlockState getPlacementState(ItemPlacementContext context) { - BlockState blockState = this.getBlock().getPlacementState(context); - return blockState != null && this.canPlace(context, blockState) ? blockState : null; -// return super.getPlacementState(context); - } - @Override public void modifyClientTooltip(List tooltip, ItemStack stack, PacketContext context) { PolymerItem.super.modifyClientTooltip(tooltip, stack, context); diff --git a/src/main/resources/assets/pirkko/lang/en_pt.json b/src/main/resources/assets/pirkko/lang/en_pt.json index bc585fc..c2d5ac9 100644 --- a/src/main/resources/assets/pirkko/lang/en_pt.json +++ b/src/main/resources/assets/pirkko/lang/en_pt.json @@ -1,32 +1,31 @@ { - "block.pirkko.pirkko": "Pirkko", "effect.pirkko.pirkko_power": "Pirkko", "sound.pirkko.pirkko": "Pirkko pirkkos", - "item.pirkko.pirkko": "Pirkko", + "block.pirkko.pirkko": "Pirkko", - "item.pirkko.unknown_pirkko": "Uncharted Pirkko", - "item.pirkko.cerise_pirkko": "Pink Pirkko", - "item.pirkko.ghost_pirkko": "Ghoul Pirkko", - "item.pirkko.konglig_pirkko": "Regal Pirkko", - "item.pirkko.laserviolett_pirkko": "Cutlass beam o' violet Pirkko", - "item.pirkko.phoz_pirkko": "PHÖZ PIRKKO", + "block.pirkko.pirkko.unknown": "Uncharted Pirkko", + "block.pirkko.pirkko.cerise": "Pink Pirkko", + "block.pirkko.pirkko.ghost": "Ghoul Pirkko", + "block.pirkko.pirkko.konglig": "Regal Pirkko", + "block.pirkko.pirkko.laserviolett": "Cutlass beam o' violet Pirkko", + "block.pirkko.pirkko.phoz": "PHÖZ PIRKKO", - "item.pirkko.color_white_pirkko": "White Pirkko", - "item.pirkko.color_orange_pirkko": "Orange Pirkko", - "item.pirkko.color_magenta_pirkko": "Magenta Pirkko", - "item.pirkko.color_light_blue_pirkko": "Light Blue Pirkko", - "item.pirkko.color_yellow_pirkko": "Yellow Pirkko", - "item.pirkko.color_lime_pirkko": "Lime Pirkko", - "item.pirkko.color_pink_pirkko": "Pink Pirkko", - "item.pirkko.color_gray_pirkko": "Gray Pirkko", - "item.pirkko.color_light_gray_pirkko": "Light Gray Pirkko", - "item.pirkko.color_cyan_pirkko": "Ocean Blue Pirkko", - "item.pirkko.color_purple_pirkko": "Purple Pirkko", - "item.pirkko.color_blue_pirkko": "Blue Pirkko", - "item.pirkko.color_brown_pirkko": "Brown Pirkko", - "item.pirkko.color_green_pirkko": "Green Pirkko", - "item.pirkko.color_red_pirkko": "Scarlet Pirkko", - "item.pirkko.color_black_pirkko": "Black Pirkko" + "block.pirkko.pirkko.color.white": "White Pirkko", + "block.pirkko.pirkko.color.orange": "Orange Pirkko", + "block.pirkko.pirkko.color.magenta": "Magenta Pirkko", + "block.pirkko.pirkko.color.light_blue": "Light Blue Pirkko", + "block.pirkko.pirkko.color.yellow": "Yellow Pirkko", + "block.pirkko.pirkko.color.lime": "Lime Pirkko", + "block.pirkko.pirkko.color.pink": "Pink Pirkko", + "block.pirkko.pirkko.color.gray": "Gray Pirkko", + "block.pirkko.pirkko.color.light_gray": "Light Gray Pirkko", + "block.pirkko.pirkko.color.cyan": "Ocean Blue Pirkko", + "block.pirkko.pirkko.color.purple": "Purple Pirkko", + "block.pirkko.pirkko.color.blue": "Blue Pirkko", + "block.pirkko.pirkko.color.brown": "Brown Pirkko", + "block.pirkko.pirkko.color.green": "Green Pirkko", + "block.pirkko.pirkko.color.red": "Scarlet Pirkko", + "block.pirkko.pirkko.color.black": "Black Pirkko" } \ No newline at end of file diff --git a/src/main/resources/assets/pirkko/lang/en_us.json b/src/main/resources/assets/pirkko/lang/en_us.json index 2962c22..f24a31e 100644 --- a/src/main/resources/assets/pirkko/lang/en_us.json +++ b/src/main/resources/assets/pirkko/lang/en_us.json @@ -1,32 +1,31 @@ { - "block.pirkko.pirkko": "Pirkko", "effect.pirkko.pirkko_power": "Pirkko Power", "sound.pirkko.pirkko": "Pirkko pirkkos", - "item.pirkko.pirkko": "Pirkko", + "block.pirkko.pirkko": "Pirkko", - "item.pirkko.unknown_pirkko": "Unknown Pirkko", - "item.pirkko.cerise_pirkko": "Cerise Pirkko", - "item.pirkko.ghost_pirkko": "Ghost Pirkko", - "item.pirkko.konglig_pirkko": "Konglig Pirkko", - "item.pirkko.laserviolett_pirkko": "Laserviolett Pirkko", - "item.pirkko.phoz_pirkko": "PHÖZ PIRKKO", + "block.pirkko.pirkko.unknown": "Unknown Pirkko", + "block.pirkko.pirkko.cerise": "Cerise Pirkko", + "block.pirkko.pirkko.ghost": "Ghost Pirkko", + "block.pirkko.pirkko.konglig": "Konglig Pirkko", + "block.pirkko.pirkko.laserviolett": "Laserviolett Pirkko", + "block.pirkko.pirkko.phoz": "PHÖZ PIRKKO", - "item.pirkko.color_white_pirkko": "White Pirkko", - "item.pirkko.color_orange_pirkko": "Orange Pirkko", - "item.pirkko.color_magenta_pirkko": "Magenta Pirkko", - "item.pirkko.color_light_blue_pirkko": "Light Blue Pirkko", - "item.pirkko.color_yellow_pirkko": "Yellow Pirkko", - "item.pirkko.color_lime_pirkko": "Lime Pirkko", - "item.pirkko.color_pink_pirkko": "Pink Pirkko", - "item.pirkko.color_gray_pirkko": "Gray Pirkko", - "item.pirkko.color_light_gray_pirkko": "Light Gray Pirkko", - "item.pirkko.color_cyan_pirkko": "Cyan Pirkko", - "item.pirkko.color_purple_pirkko": "Purple Pirkko", - "item.pirkko.color_blue_pirkko": "Blue Pirkko", - "item.pirkko.color_brown_pirkko": "Brown Pirkko", - "item.pirkko.color_green_pirkko": "Green Pirkko", - "item.pirkko.color_red_pirkko": "Red Pirkko", - "item.pirkko.color_black_pirkko": "Black Pirkko" + "block.pirkko.pirkko.color.white": "White Pirkko", + "block.pirkko.pirkko.color.orange": "Orange Pirkko", + "block.pirkko.pirkko.color.magenta": "Magenta Pirkko", + "block.pirkko.pirkko.color.light_blue": "Light Blue Pirkko", + "block.pirkko.pirkko.color.yellow": "Yellow Pirkko", + "block.pirkko.pirkko.color.lime": "Lime Pirkko", + "block.pirkko.pirkko.color.pink": "Pink Pirkko", + "block.pirkko.pirkko.color.gray": "Gray Pirkko", + "block.pirkko.pirkko.color.light_gray": "Light Gray Pirkko", + "block.pirkko.pirkko.color.cyan": "Cyan Pirkko", + "block.pirkko.pirkko.color.purple": "Purple Pirkko", + "block.pirkko.pirkko.color.blue": "Blue Pirkko", + "block.pirkko.pirkko.color.brown": "Brown Pirkko", + "block.pirkko.pirkko.color.green": "Green Pirkko", + "block.pirkko.pirkko.color.red": "Red Pirkko", + "block.pirkko.pirkko.color.black": "Black Pirkko" } \ No newline at end of file diff --git a/src/main/resources/assets/pirkko/lang/lol_us.json b/src/main/resources/assets/pirkko/lang/lol_us.json index c4cfff7..c45951e 100644 --- a/src/main/resources/assets/pirkko/lang/lol_us.json +++ b/src/main/resources/assets/pirkko/lang/lol_us.json @@ -1,32 +1,31 @@ { - "block.pirkko.pirkko": "goop", "effect.pirkko.pirkko_power": "Goopy power", "sound.pirkko.pirkko": "Plasik goop goops", - "item.pirkko.pirkko": "goop", + "block.pirkko.pirkko": "goop", - "item.pirkko.unknown_pirkko": "missingno", - "item.pirkko.cerise_pirkko": "veri pink", - "item.pirkko.ghost_pirkko": "spoopy goop", - "item.pirkko.konglig_pirkko": "ni Pirkko myself", - "item.pirkko.laserviolett_pirkko": "purfekt Pirkko", - "item.pirkko.phoz_pirkko": "meanie goop", + "block.pirkko.pirkko.unknown": "missingno", + "block.pirkko.pirkko.cerise": "veri pink", + "block.pirkko.pirkko.ghost": "spoopy goop", + "block.pirkko.pirkko.konglig": "ni Pirkko myself", + "block.pirkko.pirkko.laserviolett": "purfekt Pirkko", + "block.pirkko.pirkko.phoz": "meanie goop", - "item.pirkko.color_white_pirkko": "plastik goop", - "item.pirkko.color_orange_pirkko": "3d printer goop", - "item.pirkko.color_magenta_pirkko": "plasty rasp", - "item.pirkko.color_light_blue_pirkko": "bluish goop", - "item.pirkko.color_yellow_pirkko": "yelo plastik", - "item.pirkko.color_lime_pirkko": "lime goop", - "item.pirkko.color_pink_pirkko": "plasty pink", - "item.pirkko.color_gray_pirkko": "gray goop", - "item.pirkko.color_light_gray_pirkko": "lite grai goop", - "item.pirkko.color_cyan_pirkko": "bluu goop", - "item.pirkko.color_purple_pirkko": "purlp goop", - "item.pirkko.color_blue_pirkko": "bluuer goop", - "item.pirkko.color_brown_pirkko": "braun plastgoop", - "item.pirkko.color_green_pirkko": "grein goop", - "item.pirkko.color_red_pirkko": "red goop", - "item.pirkko.color_black_pirkko": "blackish goop" + "block.pirkko.pirkko.color.white": "plastik goop", + "block.pirkko.pirkko.color.orange": "3d printer goop", + "block.pirkko.pirkko.color.magenta": "plasty rasp", + "block.pirkko.pirkko.color.light_blue": "bluish goop", + "block.pirkko.pirkko.color.yellow": "yelo plastik", + "block.pirkko.pirkko.color.lime": "lime goop", + "block.pirkko.pirkko.color.pink": "plasty pink", + "block.pirkko.pirkko.color.gray": "gray goop", + "block.pirkko.pirkko.color.light_gray": "lite grai goop", + "block.pirkko.pirkko.color.cyan": "bluu goop", + "block.pirkko.pirkko.color.purple": "purlp goop", + "block.pirkko.pirkko.color.blue": "bluuer goop", + "block.pirkko.pirkko.color.brown": "braun plastgoop", + "block.pirkko.pirkko.color.green": "grein goop", + "block.pirkko.pirkko.color.red": "red goop", + "block.pirkko.pirkko.color.black": "blackish goop" } \ No newline at end of file diff --git a/src/main/resources/assets/pirkko/models/item/pirkko/blank.json b/src/main/resources/assets/pirkko/models/item/pirkko/base.json similarity index 100% rename from src/main/resources/assets/pirkko/models/item/pirkko/blank.json rename to src/main/resources/assets/pirkko/models/item/pirkko/base.json diff --git a/src/main/resources/assets/pirkko/models/item/pirkko/standard.json b/src/main/resources/assets/pirkko/models/item/pirkko/standard.json deleted file mode 100644 index ce54b78..0000000 --- a/src/main/resources/assets/pirkko/models/item/pirkko/standard.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "format_version": "1.21.6", - "credit": "Made with Blockbench", - "texture_size": [32, 32], - "textures": { - "texture": "pirkko:item/pirkko/standard" - }, - "elements": [ - { - "name": "head_extention", - "from": [7, 6, 7], - "to": [9, 7, 9], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 6, 8]}, - "faces": { - "north": {"uv": [6, 9, 8, 10], "texture": "#texture"}, - "east": {"uv": [4, 9, 6, 10], "texture": "#texture"}, - "south": {"uv": [2, 9, 4, 10], "texture": "#texture"}, - "west": {"uv": [0, 9, 2, 10], "texture": "#texture"}, - "up": {"uv": [4, 9, 2, 7], "rotation": 180, "texture": "#texture"}, - "down": {"uv": [0.5, 0, 0, 0.5], "rotation": 180, "texture": "#texture"} - } - }, - { - "name": "head", - "from": [7, 3, 7], - "to": [9, 6, 9], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 3, 8]}, - "faces": { - "north": {"uv": [6, 13, 8, 16], "texture": "#texture"}, - "east": {"uv": [4, 13, 6, 16], "texture": "#texture"}, - "south": {"uv": [2, 13, 4, 16], "texture": "#texture"}, - "west": {"uv": [0, 13, 2, 16], "texture": "#texture"}, - "up": {"uv": [4, 13, 2, 11], "rotation": 180, "texture": "#texture"}, - "down": {"uv": [0.5, 0, 0, 0.5], "rotation": 180, "texture": "#texture"} - } - }, - { - "name": "body", - "from": [6.5, 0, 6.5], - "to": [9.5, 3, 9.5], - "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, - "faces": { - "north": {"uv": [11, 3.5, 14, 6.5], "texture": "#texture"}, - "east": {"uv": [8, 3.5, 11, 6.5], "texture": "#texture"}, - "south": {"uv": [5, 3.5, 8, 6.5], "texture": "#texture"}, - "west": {"uv": [2, 3.5, 5, 6.5], "texture": "#texture"}, - "up": {"uv": [8, 3.5, 5, 0.5], "rotation": 180, "texture": "#texture"}, - "down": {"uv": [11, 0.5, 8, 3.5], "rotation": 180, "texture": "#texture"} - } - }, - { - "name": "right_arm", - "from": [8.5, 1.5, 7.5], - "to": [9.5, 3.5, 8.5], - "rotation": {"angle": -45, "axis": "z", "origin": [8.5, 1.5, 7.5]}, - "faces": { - "north": {"uv": [13, 1, 14, 3], "texture": "#texture"}, - "east": {"uv": [12, 1, 13, 3], "texture": "#texture"}, - "south": {"uv": [15, 1, 16, 3], "texture": "#texture"}, - "west": {"uv": [14, 1, 15, 3], "texture": "#texture"}, - "up": {"uv": [14, 1, 13, 0], "texture": "#texture"}, - "down": {"uv": [15, 0, 14, 1], "texture": "#texture"} - } - }, - { - "name": "left_arm", - "from": [6.5, 1.5, 7.5], - "to": [7.5, 3.5, 8.5], - "rotation": {"angle": 45, "axis": "z", "origin": [7.5, 1.5, 7.5]}, - "faces": { - "north": {"uv": [2, 1, 1, 3], "texture": "#texture"}, - "east": {"uv": [3, 1, 2, 3], "texture": "#texture"}, - "south": {"uv": [4, 1, 3, 3], "texture": "#texture"}, - "west": {"uv": [1, 1, 0, 3], "texture": "#texture"}, - "up": {"uv": [1, 1, 2, 0], "texture": "#texture"}, - "down": {"uv": [2, 0, 3, 1], "texture": "#texture"} - } - } - ], - "display": { - "thirdperson_righthand": { - "translation": [0, 7, 0] - }, - "thirdperson_lefthand": { - "translation": [0, 7, 0] - }, - "firstperson_righthand": { - "rotation": [0, -20, 0], - "translation": [0, 10, 0], - "scale": [1.4, 1.4, 1.4] - }, - "firstperson_lefthand": { - "rotation": [0, -20, 0], - "translation": [0, 10, 0], - "scale": [1.4, 1.4, 1.4] - }, - "ground": { - "translation": [0, 6, 0] - }, - "gui": { - "rotation": [0, -17, 0], - "translation": [0, 8, 0], - "scale": [2, 2, 2] - }, - "head": { - "rotation": [0, -180, 0], - "translation": [0, 17.5, 0], - "scale": [1.4, 1.4, 1.4] - }, - "fixed": { - "rotation": [0, -180, 0], - "translation": [0, 11, 0], - "scale": [2.5, 2.5, 2.5] - } - } -} \ No newline at end of file From 28ccd39f2a136992de3d483a393b43df04c2470c Mon Sep 17 00:00:00 2001 From: Fripe070 <72686066+Fripe070@users.noreply.github.com> Date: Sat, 11 Oct 2025 19:09:37 +0200 Subject: [PATCH 3/4] Remove unused imports> --- src/main/java/io/github/fripe070/pirkko/Pirkko.java | 2 +- src/main/java/io/github/fripe070/pirkko/PirkkoKind.java | 1 - .../io/github/fripe070/pirkko/block/PirkkoBlock.java | 9 +++++++-- .../github/fripe070/pirkko/effect/PirkkoPowerEffect.java | 5 ----- .../java/io/github/fripe070/pirkko/item/PirkkoItem.java | 9 ++++----- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/main/java/io/github/fripe070/pirkko/Pirkko.java b/src/main/java/io/github/fripe070/pirkko/Pirkko.java index 71e7cbe..8f6210d 100644 --- a/src/main/java/io/github/fripe070/pirkko/Pirkko.java +++ b/src/main/java/io/github/fripe070/pirkko/Pirkko.java @@ -1,6 +1,7 @@ package io.github.fripe070.pirkko; import eu.pb4.polymer.core.api.other.PolymerSoundEvent; +import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils; import eu.pb4.polymer.rsm.api.RegistrySyncUtils; import io.github.fripe070.pirkko.block.PirkkoBlock; import io.github.fripe070.pirkko.effect.PirkkoPowerEffect; @@ -20,7 +21,6 @@ import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; -import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils; import net.minecraft.util.Rarity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java b/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java index e1c488c..debcb77 100644 --- a/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java +++ b/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java @@ -3,7 +3,6 @@ import net.minecraft.util.StringIdentifiable; import org.jetbrains.annotations.Nullable; -import java.util.Objects; import java.util.stream.Stream; public enum PirkkoKind implements StringIdentifiable { diff --git a/src/main/java/io/github/fripe070/pirkko/block/PirkkoBlock.java b/src/main/java/io/github/fripe070/pirkko/block/PirkkoBlock.java index d87696f..5504bd4 100644 --- a/src/main/java/io/github/fripe070/pirkko/block/PirkkoBlock.java +++ b/src/main/java/io/github/fripe070/pirkko/block/PirkkoBlock.java @@ -10,12 +10,17 @@ import eu.pb4.polymer.virtualentity.api.elements.ItemDisplayElement; import io.github.fripe070.pirkko.PirkkoKind; import io.github.fripe070.pirkko.item.PirkkoItem; -import net.minecraft.block.*; +import net.minecraft.block.AbstractBlock; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Waterloggable; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.fluid.FluidState; import net.minecraft.fluid.Fluids; -import net.minecraft.item.*; +import net.minecraft.item.ItemDisplayContext; +import net.minecraft.item.ItemPlacementContext; +import net.minecraft.item.ItemStack; import net.minecraft.loot.context.LootWorldContext; import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundCategory; diff --git a/src/main/java/io/github/fripe070/pirkko/effect/PirkkoPowerEffect.java b/src/main/java/io/github/fripe070/pirkko/effect/PirkkoPowerEffect.java index 18099e0..0b795b0 100644 --- a/src/main/java/io/github/fripe070/pirkko/effect/PirkkoPowerEffect.java +++ b/src/main/java/io/github/fripe070/pirkko/effect/PirkkoPowerEffect.java @@ -6,13 +6,8 @@ import net.minecraft.entity.attribute.AttributeContainer; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectCategory; -import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; -import net.minecraft.particle.ParticleEffect; -import net.minecraft.particle.ParticleTypes; -import net.minecraft.particle.TintedParticleEffect; import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.math.ColorHelper; import org.jetbrains.annotations.Nullable; import xyz.nucleoid.packettweaker.PacketContext; diff --git a/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java b/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java index 80ea8ce..43cbad0 100644 --- a/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java +++ b/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java @@ -4,16 +4,15 @@ import io.github.fripe070.pirkko.Pirkko; import io.github.fripe070.pirkko.PirkkoKind; import net.minecraft.block.Block; -import net.minecraft.block.BlockState; import net.minecraft.component.DataComponentTypes; import net.minecraft.component.type.CustomModelDataComponent; -import net.minecraft.item.*; +import net.minecraft.item.BlockItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; import net.minecraft.item.tooltip.TooltipType; import net.minecraft.text.Text; -import net.minecraft.util.ActionResult; -import net.minecraft.util.Identifier; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import xyz.nucleoid.packettweaker.PacketContext; import java.util.List; From 6c2c664e47e4c25144494cf5aa7957cd18a0e557 Mon Sep 17 00:00:00 2001 From: Fripe070 <72686066+Fripe070@users.noreply.github.com> Date: Sat, 11 Oct 2025 22:51:15 +0200 Subject: [PATCH 4/4] Implement sounds from main --- .../io/github/fripe070/pirkko/Pirkko.java | 12 ++- .../io/github/fripe070/pirkko/PirkkoKind.java | 83 +++++++++++++------ .../fripe070/pirkko/block/PirkkoBlock.java | 14 ++-- .../fripe070/pirkko/item/PirkkoItem.java | 11 +-- .../resources/assets/pirkko/lang/en_us.json | 12 ++- src/main/resources/assets/pirkko/sounds.json | 20 ++++- 6 files changed, 102 insertions(+), 50 deletions(-) diff --git a/src/main/java/io/github/fripe070/pirkko/Pirkko.java b/src/main/java/io/github/fripe070/pirkko/Pirkko.java index 8f6210d..b941f2a 100644 --- a/src/main/java/io/github/fripe070/pirkko/Pirkko.java +++ b/src/main/java/io/github/fripe070/pirkko/Pirkko.java @@ -21,7 +21,6 @@ import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; import net.minecraft.util.Identifier; -import net.minecraft.util.Rarity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,7 +33,7 @@ public class Pirkko implements ModInitializer { public static final PirkkoBlock PIRKKO_BLOCK = registerPirkkoBlock("pirkko"); public static final PirkkoItem PIRKKO_ITEM = registerPirkkoItem("pirkko", PIRKKO_BLOCK); - public static final SoundEvent PIRKKO_SOUND = registerSoundEvent("pirkko", SoundEvents.ENTITY_COD_FLOP); + public static final SoundEvent DEFAULT_PIRKKO_SOUND = registerSoundEvent("pirkko/pirkko", SoundEvents.ENTITY_COD_FLOP); public static final StatusEffect PIRKKO_POWER = new PirkkoPowerEffect(); @Override @@ -43,6 +42,13 @@ public void onInitialize() { PolymerResourcePackUtils.markAsRequired(); Registry.register(Registries.STATUS_EFFECT, Identifier.of(MOD_ID, "pirkko_power"), PIRKKO_POWER); + + for (PirkkoKind kind : PirkkoKind.values()) { + if (!kind.usesCustomSound()) continue; + var sound = kind.getSound(); + Registry.register(Registries.SOUND_EVENT, sound.id(), sound); + PolymerSoundEvent.registerOverlay(sound); + } } private static PirkkoBlock registerPirkkoBlock(String name) { @@ -61,8 +67,6 @@ private static PirkkoItem registerPirkkoItem(String name, PirkkoBlock block) { var item = new PirkkoItem(block, new Item.Settings() .maxCount(65) .fireproof() - // TODO: Vary the rarity based on the kind - .rarity(Rarity.EPIC) .equippableUnswappable(EquipmentSlot.HEAD) .registryKey(RegistryKey.of(RegistryKeys.ITEM, registryKey)) .useBlockPrefixedTranslationKey() diff --git a/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java b/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java index debcb77..355405b 100644 --- a/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java +++ b/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java @@ -1,40 +1,62 @@ package io.github.fripe070.pirkko; +import net.minecraft.sound.SoundEvent; +import net.minecraft.util.Identifier; +import net.minecraft.util.Rarity; import net.minecraft.util.StringIdentifiable; import org.jetbrains.annotations.Nullable; +import java.util.Optional; import java.util.stream.Stream; public enum PirkkoKind implements StringIdentifiable { - BLANK(0, "blank"), - COLOR_WHITE(1, "color/white"), - COLOR_ORANGE(2, "color/orange"), - COLOR_MAGENTA(3, "color/magenta"), - COLOR_LIGHT_BLUE(4, "color/light_blue"), - COLOR_YELLOW(5, "color/yellow"), - COLOR_LIME(6, "color/lime"), - COLOR_PINK(7, "color/pink"), - COLOR_GRAY(8, "color/gray"), - COLOR_LIGHT_GRAY(9, "color/light_gray"), - COLOR_CYAN(10, "color/cyan"), - COLOR_PURPLE(11, "color/purple"), - COLOR_BLUE(12, "color/blue"), - COLOR_BROWN(13, "color/brown"), - COLOR_GREEN(14, "color/green"), - COLOR_RED(15, "color/red"), - COLOR_BLACK(16, "color/black"), - PHOZ(17, "phoz"), - KONGLIG(18, "konglig"), - GHOST(19, "ghost"), - LASERVIOLETT(20, "laserviolett"), - CERISE(21, "cerise"); + BLANK("blank", Rarity.UNCOMMON), + + COLOR_WHITE("color/white", Rarity.UNCOMMON), + COLOR_ORANGE("color/orange", Rarity.UNCOMMON), + COLOR_MAGENTA("color/magenta", Rarity.UNCOMMON), + COLOR_LIGHT_BLUE("color/light_blue", Rarity.UNCOMMON), + COLOR_YELLOW("color/yellow", Rarity.UNCOMMON), + COLOR_LIME("color/lime", Rarity.UNCOMMON), + COLOR_PINK("color/pink", Rarity.UNCOMMON), + COLOR_GRAY("color/gray", Rarity.UNCOMMON), + COLOR_LIGHT_GRAY("color/light_gray", Rarity.UNCOMMON), + COLOR_CYAN("color/cyan", Rarity.UNCOMMON), + COLOR_PURPLE("color/purple", Rarity.UNCOMMON), + COLOR_BLUE("color/blue", Rarity.UNCOMMON), + COLOR_BROWN("color/brown", Rarity.UNCOMMON), + COLOR_GREEN("color/green", Rarity.UNCOMMON), + COLOR_RED("color/red", Rarity.UNCOMMON), + COLOR_BLACK("color/black", Rarity.UNCOMMON), + + PRIDE_AROMANTIC("pride/aromantic", Rarity.UNCOMMON), + PRIDE_ASEXUAL("pride/asexual", Rarity.UNCOMMON), + PRIDE_BISEXUAL("pride/bisexual", Rarity.UNCOMMON), + PRIDE_GAY_M("pride/gay_m", Rarity.UNCOMMON), + PRIDE_GENDER_FLUID("pride/genderfluid", Rarity.UNCOMMON), + PRIDE_LESBIAN("pride/lesbian", Rarity.UNCOMMON), + PRIDE_NONBINARY("pride/nonbinary", Rarity.UNCOMMON), + PRIDE_RAINBOW("pride/rainbow", Rarity.UNCOMMON), + PRIDE_TRANSGENDER("pride/transgender", Rarity.UNCOMMON), + + LASERVIOLETT("laserviolett", Rarity.RARE), + CERISE("cerise", Rarity.RARE), + PHOZ("phoz", Rarity.RARE, true), + KONGLIG("konglig", Rarity.RARE, true), + GHOST("ghost", Rarity.RARE, true); - private final int index; private final String assetPath; + private final Rarity rarity; + private final @Nullable SoundEvent soundEvent; - PirkkoKind(int index, String assetPath) { - this.index = index; + PirkkoKind(String assetPath, Rarity rarity) { + this(assetPath, rarity, false); + } + PirkkoKind(String assetPath, Rarity rarity, boolean useCustomSound) { this.assetPath = assetPath; + this.rarity = rarity; + var sound = SoundEvent.of(Identifier.of(Pirkko.MOD_ID, "pirkko/" + this.getPath())); + this.soundEvent = useCustomSound ? sound : null; } public String getPath() { @@ -46,8 +68,15 @@ public String getId() { public String getTranslationKey() { return assetPath.replace("/", "."); } - public int getIndex() { - return index; + + public Rarity getRarity() { + return rarity; + } + public boolean usesCustomSound() { + return soundEvent != null; + } + public SoundEvent getSound() { + return Optional.ofNullable(soundEvent).orElse(Pirkko.DEFAULT_PIRKKO_SOUND); } @Override diff --git a/src/main/java/io/github/fripe070/pirkko/block/PirkkoBlock.java b/src/main/java/io/github/fripe070/pirkko/block/PirkkoBlock.java index 5504bd4..3800de8 100644 --- a/src/main/java/io/github/fripe070/pirkko/block/PirkkoBlock.java +++ b/src/main/java/io/github/fripe070/pirkko/block/PirkkoBlock.java @@ -50,8 +50,6 @@ import java.util.List; import java.util.Locale; -import static io.github.fripe070.pirkko.Pirkko.PIRKKO_SOUND; - public class PirkkoBlock extends Block implements BlockWithElementHolder, PolymerTexturedBlock, Waterloggable { public static final MapCodec CODEC = createCodec(PirkkoBlock::new); @@ -138,7 +136,7 @@ protected ActionResult onUse(BlockState state, World world, BlockPos pos, Player } protected ActionResult squish(BlockState state, World world, BlockPos pos) { - this.playPirkko(world, pos); + this.playPirkko(world, pos, state); world.setBlockState(pos, state.with(SQUISH_TICK, SQUISH_TICKS)); world.scheduleBlockTick(pos, this, 1); world.emitGameEvent(null, GameEvent.NOTE_BLOCK_PLAY, pos); @@ -153,11 +151,11 @@ protected boolean isSquishing(BlockState state) { return squishTick > 0; } - public void playPirkko(World world, BlockPos pos) { - this.playPirkko(world, pos, 1.1f + (this.random.nextFloat() - 0.5f) * 0.3f); + public void playPirkko(World world, BlockPos pos, BlockState state) { + this.playPirkko(world, pos, state, 1.1f + (this.random.nextFloat() - 0.5f) * 0.3f); } - public void playPirkko(World world, BlockPos pos, float pitch) { - world.playSound(null, pos, PIRKKO_SOUND, SoundCategory.BLOCKS, 0.8f, pitch); + public void playPirkko(World world, BlockPos pos, BlockState state, float pitch) { + world.playSound(null, pos, state.get(KIND).getSound(), SoundCategory.BLOCKS, 0.8f, pitch); } protected BlockState getFloorBlock(BlockState state, World world, BlockPos pos) { @@ -207,7 +205,7 @@ public void onPlaced(World world, BlockPos pos, BlockState state, @Nullable Livi @Override public void onBroken(WorldAccess world, BlockPos pos, BlockState state) { super.onBroken(world, pos, state); - this.playPirkko((World) world, pos); + this.playPirkko((World) world, pos, state); } @Override diff --git a/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java b/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java index 43cbad0..0aaf5e0 100644 --- a/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java +++ b/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java @@ -25,10 +25,7 @@ public PirkkoItem(Block block, Settings settings) { public static ItemStack getStack(@NotNull PirkkoKind kind) { var stack = Pirkko.PIRKKO_ITEM.getDefaultStack(); - var oldModelData = stack.get(DataComponentTypes.CUSTOM_MODEL_DATA); - if (oldModelData == null) { - oldModelData = new CustomModelDataComponent(List.of(), List.of(), List.of(), List.of()); - } + var oldModelData = stack.getOrDefault(DataComponentTypes.CUSTOM_MODEL_DATA, new CustomModelDataComponent(List.of(), List.of(), List.of(), List.of())); stack.set(DataComponentTypes.CUSTOM_MODEL_DATA, new CustomModelDataComponent( oldModelData.floats(), oldModelData.flags(), @@ -58,6 +55,7 @@ public Item getPolymerItem(ItemStack itemStack, PacketContext context) { public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipType tooltipType, PacketContext context) { var stack = PolymerItem.super.getPolymerItemStack(itemStack, tooltipType, context); PirkkoKind kind = getPirkkoKind(stack); + stack.set(DataComponentTypes.RARITY, kind.getRarity()); Text translationName = stack.get(DataComponentTypes.ITEM_NAME); if (!kind.equals(PirkkoKind.BLANK)) { @@ -66,9 +64,4 @@ public ItemStack getPolymerItemStack(ItemStack itemStack, TooltipType tooltipTyp stack.set(DataComponentTypes.ITEM_NAME, translationName); return stack; } - - @Override - public void modifyClientTooltip(List tooltip, ItemStack stack, PacketContext context) { - PolymerItem.super.modifyClientTooltip(tooltip, stack, context); - } } \ No newline at end of file diff --git a/src/main/resources/assets/pirkko/lang/en_us.json b/src/main/resources/assets/pirkko/lang/en_us.json index f24a31e..1cb243e 100644 --- a/src/main/resources/assets/pirkko/lang/en_us.json +++ b/src/main/resources/assets/pirkko/lang/en_us.json @@ -27,5 +27,15 @@ "block.pirkko.pirkko.color.brown": "Brown Pirkko", "block.pirkko.pirkko.color.green": "Green Pirkko", "block.pirkko.pirkko.color.red": "Red Pirkko", - "block.pirkko.pirkko.color.black": "Black Pirkko" + "block.pirkko.pirkko.color.black": "Black Pirkko", + + "block.pirkko.pirkko.pride.aromantic": "Aromantic Pirkko", + "block.pirkko.pirkko.pride.asexual":"Asexual Pirkko", + "block.pirkko.pirkko.pride.bisexual": "Bisexual Pirkko", + "block.pirkko.pirkko.pride.gay_m":"Gay Pirkko", + "block.pirkko.pirkko.pride.genderfluid": "Genderfluid Pirkko", + "block.pirkko.pirkko.pride.lesbian":"Lesbian Pirkko", + "block.pirkko.pirkko.pride.nonbinary": "Nonbinary Pirkko", + "block.pirkko.pirkko.pride.rainbow":"Rainbow Pirkko", + "block.pirkko.pirkko.pride.transgender": "Transgender Pirkko" } \ No newline at end of file diff --git a/src/main/resources/assets/pirkko/sounds.json b/src/main/resources/assets/pirkko/sounds.json index 15fa73e..0fc3af4 100644 --- a/src/main/resources/assets/pirkko/sounds.json +++ b/src/main/resources/assets/pirkko/sounds.json @@ -1,10 +1,28 @@ { - "pirkko": { + "pirkko/pirkko": { "subtitle": "sound.pirkko.pirkko", "sounds": [ "pirkko:pirkko", "pirkko:pirkko2", "pirkko:pirkko3", "pirkko:pirkko4"] + }, + "pirkko/konglig": { + "subtitle": "sound.pirkko.konglig", + "sounds": [ + "pirkko:konglig" + ] + }, + "pirkko/phoz": { + "subtitle": "sound.pirkko.phoz", + "sounds": [ + "pirkko:phoz" + ] + }, + "pirkko/ghost": { + "subtitle": "sound.pirkko.ghost", + "sounds": [ + "pirkko:ghost" + ] } } \ No newline at end of file