generated from neoforged/MDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Renaming
1 parent
cd78b9c
commit a00caff
Showing
4 changed files
with
61 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
src/main/java/com/leclowndu93150/invertedbed/InvertedBed.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package com.leclowndu93150.invertedbed; | ||
|
||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.item.BlockItem; | ||
import net.minecraft.world.item.CreativeModeTab; | ||
import net.minecraft.world.item.CreativeModeTabs; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.state.BlockBehaviour; | ||
import net.minecraft.world.level.material.MapColor; | ||
import net.neoforged.bus.api.IEventBus; | ||
import net.neoforged.fml.common.Mod; | ||
import net.neoforged.neoforge.common.NeoForge; | ||
import net.neoforged.neoforge.registries.DeferredBlock; | ||
import net.neoforged.neoforge.registries.DeferredHolder; | ||
import net.neoforged.neoforge.registries.DeferredItem; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
|
||
@Mod(InvertedBed.MODID) | ||
public class InvertedBed { | ||
public static final String MODID = "invertedbed"; | ||
|
||
public static final DeferredRegister.Blocks BLOCKS = DeferredRegister.createBlocks(MODID); | ||
public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(MODID); | ||
// Create a Deferred Register to hold CreativeModeTabs which will all be registered under the "examplemod" namespace | ||
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID); | ||
|
||
// Creates a new Block with the id "examplemod:example_block", combining the namespace and path | ||
public static final DeferredBlock<Block> INVERTED_BED = BLOCKS.registerSimpleBlock("inverted_bed", BlockBehaviour.Properties.of().mapColor(MapColor.STONE)); | ||
// Creates a new BlockItem with the id "examplemod:example_block", combining the namespace and path | ||
public static final DeferredItem<BlockItem> INVERTED_BED_ITEM = ITEMS.registerSimpleBlockItem("inverted_bed", INVERTED_BED); | ||
|
||
public static final DeferredHolder<CreativeModeTab, CreativeModeTab> INVERTED_TAB = CREATIVE_MODE_TABS.register("inverted_tab", () -> CreativeModeTab.builder() | ||
.title(Component.translatable("itemGroup.invertedbed")) | ||
.withTabsBefore(CreativeModeTabs.COMBAT) | ||
.icon(() -> INVERTED_BED_ITEM.get().getDefaultInstance()) | ||
.displayItems((parameters, output) -> output.accept(INVERTED_BED_ITEM.get())).build()); | ||
|
||
public InvertedBed(IEventBus modEventBus) { | ||
|
||
BLOCKS.register(modEventBus); | ||
|
||
ITEMS.register(modEventBus); | ||
|
||
CREATIVE_MODE_TABS.register(modEventBus); | ||
|
||
NeoForge.EVENT_BUS.register(this); | ||
|
||
} | ||
|
||
} | ||
|