generated from neoforged/MDK
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
3064ded
commit 5b6f48a
Showing
9 changed files
with
108 additions
and
216 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.
19 changes: 19 additions & 0 deletions
19
src/main/java/com/leclowndu93150/flightutils/FlightUtilsMain.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,19 @@ | ||
package com.leclowndu93150.flightutils; | ||
|
||
import com.leclowndu93150.flightutils.registry.CreativeTabRegistry; | ||
import com.leclowndu93150.flightutils.registry.ItemRegistry; | ||
import net.neoforged.bus.api.IEventBus; | ||
import net.neoforged.fml.common.Mod; | ||
|
||
// The value here should match an entry in the META-INF/neoforge.mods.toml file | ||
@Mod(FlightUtilsMain.MODID) | ||
public class FlightUtilsMain | ||
{ | ||
public static final String MODID = "flightutils"; | ||
|
||
public FlightUtilsMain(IEventBus modEventBus) | ||
{ | ||
CreativeTabRegistry.CREATIVE_MODE_TABS.register(modEventBus); | ||
ItemRegistry.ITEMS.register(modEventBus); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/leclowndu93150/flightutils/items/AngelRingItem.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,10 @@ | ||
package com.leclowndu93150.flightutils.items; | ||
|
||
import net.minecraft.world.item.Item; | ||
|
||
public class AngelRingItem extends Item { | ||
|
||
public AngelRingItem() { | ||
super(new Item.Properties()); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/leclowndu93150/flightutils/items/IntertiaRingItem.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,9 @@ | ||
package com.leclowndu93150.flightutils.items; | ||
|
||
import net.minecraft.world.item.Item; | ||
|
||
public class IntertiaRingItem extends Item { | ||
public IntertiaRingItem() { | ||
super(new Item.Properties()); | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/leclowndu93150/flightutils/items/MiningRingItem.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,9 @@ | ||
package com.leclowndu93150.flightutils.items; | ||
|
||
import net.minecraft.world.item.Item; | ||
|
||
public class MiningRingItem extends Item { | ||
public MiningRingItem() { | ||
super(new Item.Properties()); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/leclowndu93150/flightutils/registry/CreativeTabRegistry.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,26 @@ | ||
package com.leclowndu93150.flightutils.registry; | ||
|
||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.item.CreativeModeTab; | ||
import net.minecraft.world.item.CreativeModeTabs; | ||
import net.neoforged.neoforge.registries.DeferredHolder; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
|
||
import static com.leclowndu93150.flightutils.FlightUtilsMain.MODID; | ||
import static com.leclowndu93150.flightutils.registry.ItemRegistry.ANGEL_RING; | ||
|
||
public class CreativeTabRegistry { | ||
public static final DeferredRegister<CreativeModeTab> CREATIVE_MODE_TABS = DeferredRegister.create(Registries.CREATIVE_MODE_TAB, MODID); | ||
|
||
public static final DeferredHolder<CreativeModeTab, CreativeModeTab> UTILS_TAB = CREATIVE_MODE_TABS.register("example_tab", () -> CreativeModeTab.builder() | ||
.title(Component.translatable("Flight Utilities")) //The language key for the title of your CreativeModeTab | ||
.withTabsBefore(CreativeModeTabs.COMBAT) | ||
.icon(() -> ANGEL_RING.get().getDefaultInstance()) | ||
.displayItems((parameters, output) -> { | ||
output.accept(ANGEL_RING.get()); | ||
}).build()); | ||
|
||
} | ||
|
||
|
24 changes: 24 additions & 0 deletions
24
src/main/java/com/leclowndu93150/flightutils/registry/ItemRegistry.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,24 @@ | ||
package com.leclowndu93150.flightutils.registry; | ||
|
||
import com.leclowndu93150.flightutils.items.AngelRingItem; | ||
import com.leclowndu93150.flightutils.items.IntertiaRingItem; | ||
import com.leclowndu93150.flightutils.items.MiningRingItem; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.food.FoodProperties; | ||
import net.minecraft.world.item.Item; | ||
import net.neoforged.neoforge.registries.DeferredItem; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
|
||
import static com.leclowndu93150.flightutils.FlightUtilsMain.MODID; | ||
|
||
public class ItemRegistry { | ||
|
||
public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(MODID); | ||
|
||
public static final DeferredItem<Item> ANGEL_RING = ITEMS.register("angel_ring", (ResourceLocation pProperties) -> new AngelRingItem()); | ||
|
||
public static final DeferredItem<Item> INERTIA_RING = ITEMS.register("inertia_ring", (ResourceLocation pProperties) -> new IntertiaRingItem()); | ||
|
||
public static final DeferredItem<Item> MINING_RING = ITEMS.register("mining_ring", (ResourceLocation pProperties) -> new MiningRingItem()); | ||
|
||
} |