diff --git a/src/main/java/io/github/fripe070/pirkko/Pirkko.java b/src/main/java/io/github/fripe070/pirkko/Pirkko.java index 1d4830c..79a847d 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,8 +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; @@ -32,12 +31,8 @@ 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 SoundEvent PIRKKO_SOUND = registerSoundEvent("pirkko/pirkko", SoundEvents.ENTITY_COD_FLOP); - public static final SoundEvent PIRKKO_GHOST_SOUND = registerSoundEvent("pirkko/ghost", SoundEvents.ENTITY_COD_FLOP); - public static final SoundEvent PIRKKO_PHOZ_SOUND = registerSoundEvent("pirkko/phoz", SoundEvents.ENTITY_COD_FLOP); - public static final SoundEvent PIRKKO_KONGLIG_SOUND = registerSoundEvent("pirkko/konglig", SoundEvents.ENTITY_COD_FLOP); + public static final PirkkoItem PIRKKO_ITEM = registerPirkkoItem("pirkko", PIRKKO_BLOCK); + public static final SoundEvent DEFAULT_PIRKKO_SOUND = registerSoundEvent("pirkko/pirkko", SoundEvents.ENTITY_COD_FLOP); public static final StatusEffect PIRKKO_POWER = new PirkkoPowerEffect(); @Override @@ -46,7 +41,13 @@ public void onInitialize() { PolymerResourcePackUtils.markAsRequired(); Registry.register(Registries.STATUS_EFFECT, Identifier.of(MOD_ID, "pirkko_power"), PIRKKO_POWER); - PirkkoKind.InitializePirkkoKindData(); + + 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) { @@ -60,15 +61,14 @@ 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() - .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 7d79440..d33f098 100644 --- a/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java +++ b/src/main/java/io/github/fripe070/pirkko/PirkkoKind.java @@ -1,89 +1,102 @@ 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.Objects; +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"), - PRIDE_AROMANTIC(22, "pride/aromantic"), - PRIDE_ASEXUAL(23, "pride/asexual"), - PRIDE_BISEXUAL(24, "pride/bisexual"), - PRIDE_GAY_M(25, "pride/gay_m"), - PRIDE_GENDER_FLUID(26, "pride/genderfluid"), - PRIDE_LESBIAN(27, "pride/lesbian"), - PRIDE_NONBINARY(28, "pride/nonbinary"), - PRIDE_RAINBOW(29, "pride/rainbow"), - PRIDE_TRANSGENDER(30, "pride/transgender"); + 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), - private final int index; - private final String id; - private final String friendlyId; - private final PirkkoKindData pirkkoKindData; + 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), - PirkkoKind(int index, String id) { - this.index = index; - this.id = id; - this.friendlyId = id.replace("/", "_"); - this.pirkkoKindData = new PirkkoKindData(); - } + 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 String assetPath; + private final Rarity rarity; + private final @Nullable SoundEvent soundEvent; - public static void InitializePirkkoKindData() { - GHOST.pirkkoKindData() - .setSound(Pirkko.PIRKKO_GHOST_SOUND); - PHOZ.pirkkoKindData() - .setSound(Pirkko.PIRKKO_PHOZ_SOUND); - KONGLIG.pirkkoKindData() - .setSound(Pirkko.PIRKKO_KONGLIG_SOUND); + 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; } - @Override - public String asString() { - return friendlyId; + public String getPath() { + return assetPath; + } + public String getId() { + return assetPath.replace("/", "_"); + } + public String getTranslationKey() { + return assetPath.replace("/", "."); } - public String realId() { - return id; + public Rarity getRarity() { + return rarity; + } + public boolean usesCustomSound() { + return soundEvent != null; + } + public SoundEvent getSound() { + return Optional.ofNullable(soundEvent).orElse(Pirkko.DEFAULT_PIRKKO_SOUND); } - public PirkkoKindData pirkkoKindData() { - return pirkkoKindData; + @Override + public String asString() { + return this.getId(); } - public int getIndex() { - return index; + @Nullable + public static PirkkoKind fromPath(String path) { + return Stream.of(values()) + .filter(kind -> kind.getPath().equals(path)) + .findFirst() + .orElse(null); } @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 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 6420bcc..3800de8 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; @@ -45,20 +50,18 @@ import java.util.List; import java.util.Locale; -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,68 +69,74 @@ 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(BlockState state, World world, BlockPos pos) { - playPirkko(state, 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(BlockState state, World world, BlockPos pos, float pitch) { - playPirkko(world, pos, state.get(PIRKKO_KIND), pitch); - } - public void playPirkko(World world, BlockPos pos, PirkkoKind kind, float pitch) { - var sound = kind.pirkkoKindData().GetSound(); - if (sound == null) { - sound = PIRKKO_SOUND; + 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)); } - world.playSound(null, pos, sound, SoundCategory.BLOCKS, 0.8f, pitch); - } - 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) { - this.playPirkko(state, 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); @@ -137,49 +146,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, BlockState state) { + this.playPirkko(world, pos, state, 1.1f + (this.random.nextFloat() - 0.5f) * 0.3f); + } + public void playPirkko(World world, BlockPos pos, BlockState state, float pitch) { + world.playSound(null, pos, state.get(KIND).getSound(), 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 @@ -223,10 +205,9 @@ 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(state, (World) world, pos); + this.playPirkko((World) world, pos, state); } - @Override protected boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { return true; @@ -239,11 +220,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)) { @@ -266,38 +248,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 @@ -308,14 +282,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/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 de63b0d..0aaf5e0 100644 --- a/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java +++ b/src/main/java/io/github/fripe070/pirkko/item/PirkkoItem.java @@ -4,15 +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.Nullable; +import org.jetbrains.annotations.NotNull; import xyz.nucleoid.packettweaker.PacketContext; import java.util.List; @@ -23,21 +23,15 @@ 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); - 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( + public static ItemStack getStack(@NotNull PirkkoKind kind) { + var stack = Pirkko.PIRKKO_ITEM.getDefaultStack(); + 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(), - List.of(kind.asString()), + List.of(kind.getId()), oldModelData.colors())); - return itemStack; + return stack; } @Override @@ -45,27 +39,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,24 +54,14 @@ 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); + stack.set(DataComponentTypes.RARITY, kind.getRarity()); + 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); - } } \ No newline at end of file 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..1cb243e 100644 --- a/src/main/resources/assets/pirkko/lang/en_us.json +++ b/src/main/resources/assets/pirkko/lang/en_us.json @@ -1,32 +1,41 @@ { - "block.pirkko.pirkko": "Pirkko", "effect.pirkko.pirkko_power": "Pirkko Power", "sound.pirkko.pirkko": "Pirkko pirkkos", - "item.pirkko.pirkko": "Pirkko", + "block.pirkko.pirkko": "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.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.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", - "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.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/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/standard.json b/src/main/resources/assets/pirkko/models/item/pirkko/base.json similarity index 98% rename from src/main/resources/assets/pirkko/models/item/pirkko/standard.json rename to src/main/resources/assets/pirkko/models/item/pirkko/base.json index ce54b78..8e9530a 100644 --- a/src/main/resources/assets/pirkko/models/item/pirkko/standard.json +++ b/src/main/resources/assets/pirkko/models/item/pirkko/base.json @@ -3,7 +3,7 @@ "credit": "Made with Blockbench", "texture_size": [32, 32], "textures": { - "texture": "pirkko:item/pirkko/standard" + "texture": "pirkko:item/pirkko/blank" }, "elements": [ {