Skip to content

Commit

Permalink
Add creative mode tab
Browse files Browse the repository at this point in the history
  • Loading branch information
gedorinku committed Jul 28, 2022
1 parent 5b9f23e commit ef424f3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.gedorinku.frostedglass;

import com.gedorinku.frostedglass.block.BlockItems;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;

public class FrostedGlassCreativeModeTab {
public static final CreativeModeTab TAB = new CreativeModeTab(FrostedGlassMod.ID) {
@Override
public ItemStack makeIcon() {
return BlockItems.FROSTED_GLASS_BLOCK_ITEM.get().getDefaultInstance();
}
};
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.gedorinku.frostedglass.block;

import com.gedorinku.frostedglass.FrostedGlassCreativeModeTab;
import com.gedorinku.frostedglass.FrostedGlassMod;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
Expand All @@ -9,6 +10,6 @@

public class BlockItems {
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, FrostedGlassMod.ID);
public static final RegistryObject<Item> FROSTED_GLASS_BLOCK_ITEM = ITEMS.register("frosted_glass", () -> new BlockItem(Blocks.FROSTED_GLASS_BLOCK.get(), new Item.Properties()));
public static final RegistryObject<Item> FROSTED_GLASS_PANE_BLOCK_ITEM = ITEMS.register("frosted_glass_pane", () -> new BlockItem(Blocks.FROSTED_GLASS_PANE_BLOCK.get(), new Item.Properties()));
public static final RegistryObject<Item> FROSTED_GLASS_BLOCK_ITEM = ITEMS.register("frosted_glass", () -> new BlockItem(Blocks.FROSTED_GLASS_BLOCK.get(), new Item.Properties().tab(FrostedGlassCreativeModeTab.TAB)));
public static final RegistryObject<Item> FROSTED_GLASS_PANE_BLOCK_ITEM = ITEMS.register("frosted_glass_pane", () -> new BlockItem(Blocks.FROSTED_GLASS_PANE_BLOCK.get(), new Item.Properties().tab(FrostedGlassCreativeModeTab.TAB)));
}
3 changes: 2 additions & 1 deletion src/main/resources/assets/frostedglass/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"block.frostedglass.frosted_glass": "Frosted Glass",
"block.frostedglass.frosted_glass_pane": "Frosted Glass Pane"
"block.frostedglass.frosted_glass_pane": "Frosted Glass Pane",
"itemGroup.frostedglass": "Frosted Glass"
}
3 changes: 2 additions & 1 deletion src/main/resources/assets/frostedglass/lang/ja_jp.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"block.frostedglass.frosted_glass": "すりガラス",
"block.frostedglass.frosted_glass_pane": "すりガラス板"
"block.frostedglass.frosted_glass_pane": "すりガラス板",
"itemGroup.frostedglass": "すりガラス"
}

0 comments on commit ef424f3

Please sign in to comment.