Skip to content

Commit

Permalink
use custom item for lectern test
Browse files Browse the repository at this point in the history
  • Loading branch information
UpcraftLP committed Nov 11, 2024
1 parent c8414bf commit 1cb5325
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package dev.upcraft.sparkweave.testmod;

import dev.upcraft.sparkweave.api.entrypoint.MainEntryPoint;
import dev.upcraft.sparkweave.api.event.RegisterCustomLecternMenuEvent;
import dev.upcraft.sparkweave.api.event.ItemMenuInteractionEvent;
import dev.upcraft.sparkweave.api.event.RegisterCustomLecternMenuEvent;
import dev.upcraft.sparkweave.api.platform.ModContainer;
import dev.upcraft.sparkweave.api.platform.services.RegistryService;
import dev.upcraft.sparkweave.testmod.init.TestCreativeTabs;
Expand Down Expand Up @@ -54,7 +54,7 @@ public Component getDisplayName() {
public @Nullable AbstractContainerMenu createMenu(int i, Inventory inventory, Player player) {
return MenuType.GENERIC_3x3.create(i, inventory);
}
}, Items.DIAMOND));
}, TestItems.TEST_ITEM));
}

public static ResourceLocation id(String path) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import dev.upcraft.sparkweave.testmod.client.models.MageRobesModel;
import dev.upcraft.sparkweave.testmod.client.renderers.DiamondLecternRenderer;
import dev.upcraft.sparkweave.testmod.client.renderers.MageRobesRenderer;
import dev.upcraft.sparkweave.testmod.init.TestItems;
import net.minecraft.client.Minecraft;
import net.minecraft.world.item.Items;

Expand All @@ -21,7 +22,7 @@ public class SparkweaveTestmodClient implements ClientEntryPoint {
public void onInitializeClient(ModContainer mod) {
RegisterLayerDefinitionsEvent.EVENT.register(event -> event.registerModelLayers(MageRobesModel.MODEL_LAYER, MageRobesModel::createBodyLayer));
RegisterCustomArmorRenderersEvent.EVENT.register(event -> event.register((entity, context, renderer) -> new MageRobesRenderer(context), Items.CHAINMAIL_HELMET, Items.CHAINMAIL_CHESTPLATE, Items.CHAINMAIL_LEGGINGS, Items.CHAINMAIL_BOOTS));
RegisterLecternItemRendererEvent.EVENT.register(event -> event.registerRenderer(DiamondLecternRenderer::new, Items.DIAMOND));
RegisterLecternItemRendererEvent.EVENT.register(event -> event.registerRenderer(DiamondLecternRenderer::new, TestItems.TEST_ITEM));
}

public static void onClientTickStart(Minecraft client) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"replace": false,
"values": [
"minecraft:diamond"
"sparkweave_testmod:test_item"
]
}

0 comments on commit 1cb5325

Please sign in to comment.