Skip to content

Commit

Permalink
update test mod
Browse files Browse the repository at this point in the history
  • Loading branch information
CammiePone committed Nov 9, 2024
1 parent 5404350 commit c6125ac
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.MenuProvider;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.ChestMenu;
import net.minecraft.world.inventory.ClickAction;
import net.minecraft.world.inventory.MenuType;
import net.minecraft.world.item.Items;
import org.jetbrains.annotations.Nullable;

public class SparkweaveTestmod implements MainEntryPoint {

Expand All @@ -39,7 +44,17 @@ public void onInitialize(ModContainer mod) {
return false;
});

CustomLecternMenuEvent.EVENT.register(event -> event.register((containerId, inventory, player) -> MenuType.CRAFTER_3x3.create(containerId, inventory), Items.DIAMOND));
CustomLecternMenuEvent.EVENT.register(event -> event.register((level, pos, player, blockEntity, stack) -> new MenuProvider() {
@Override
public Component getDisplayName() {
return Component.empty();
}

@Override
public @Nullable AbstractContainerMenu createMenu(int i, Inventory inventory, Player player) {
return MenuType.GENERIC_3x3.create(i, inventory);
}
}, Items.DIAMOND));
}

public static ResourceLocation id(String path) {
Expand Down

0 comments on commit c6125ac

Please sign in to comment.