[add] Banana
[add] Banana Peel
This commit is contained in:
@@ -2,17 +2,11 @@ package ovh.glitchlabs.masterwild.Item;
|
||||
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.ItemLike;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.neoforged.bus.api.IEventBus;
|
||||
import net.neoforged.neoforge.registries.DeferredRegister;
|
||||
import ovh.glitchlabs.masterwild.Block.ModBlocks;
|
||||
import ovh.glitchlabs.masterwild.Masterwild;
|
||||
import ovh.glitchlabs.masterwild.entity.ModEntities;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
@@ -24,6 +18,10 @@ public class ModCreativeModeTabs {
|
||||
() -> CreativeModeTab.builder().icon(() -> new ItemStack(ModItems.PINGUIN_SPAWN_EGG.get()))
|
||||
.title(Component.translatable("creativetab.masterwild.masterwild"))
|
||||
.displayItems((itemDisplayParameters, output) -> {
|
||||
|
||||
output.accept(ModItems.BANANA);
|
||||
output.accept(ModItems.BANANA_PEEL);
|
||||
|
||||
output.accept(ModItems.PINGUIN_SPAWN_EGG);
|
||||
output.accept(ModItems.FIREFLY_SPAWN_EGG);
|
||||
output.accept(ModItems.ROOSTER_SPAWN_EGG);
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package ovh.glitchlabs.masterwild.Item;
|
||||
|
||||
import net.minecraft.world.food.FoodProperties;
|
||||
|
||||
public class ModFoodProperties {
|
||||
public static final FoodProperties BANANA = new FoodProperties.Builder()
|
||||
.nutrition(3)
|
||||
.saturationModifier(0.25F)
|
||||
.usingConvertsTo(ModItems.BANANA_PEEL.get())
|
||||
.build();
|
||||
|
||||
|
||||
}
|
||||
@@ -11,7 +11,18 @@ import ovh.glitchlabs.masterwild.entity.ModEntities;
|
||||
public class ModItems {
|
||||
public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(Masterwild.MODID);
|
||||
|
||||
//things
|
||||
public static final DeferredItem<Item> BANANA_PEEL = ITEMS.register("banana_peel",
|
||||
() -> new Item(new Item.Properties()
|
||||
.stacksTo(16)
|
||||
));
|
||||
|
||||
//food
|
||||
public static final DeferredItem<Item> BANANA = ITEMS.register("banana",
|
||||
() -> new Item(new Item.Properties()
|
||||
.stacksTo(16)
|
||||
.food(ModFoodProperties.BANANA)
|
||||
));
|
||||
|
||||
//SpawnEggs
|
||||
public static final DeferredItem<Item> PINGUIN_SPAWN_EGG = ITEMS.register("pinguin_spawn_egg",
|
||||
|
||||
@@ -13,7 +13,14 @@ public class ModItemModelProvider extends ItemModelProvider {
|
||||
|
||||
@Override
|
||||
protected void registerModels() {
|
||||
//basicItem(ModItems.BISMUTH.get());
|
||||
|
||||
//things
|
||||
basicItem(ModItems.BANANA_PEEL.get());
|
||||
|
||||
//food
|
||||
basicItem(ModItems.BANANA.get());
|
||||
|
||||
//spawneggs
|
||||
withExistingParent(ModItems.PINGUIN_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||
withExistingParent(ModItems.FIREFLY_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||
withExistingParent(ModItems.ROOSTER_SPAWN_EGG.getId().getPath(), mcLoc("item/template_spawn_egg"));
|
||||
|
||||
@@ -14,6 +14,9 @@ public class ModLanguageProvider extends LanguageProvider {
|
||||
|
||||
@Override
|
||||
protected void addTranslations() {
|
||||
add(ModItems.BANANA.get(), "Banana");
|
||||
add(ModItems.BANANA_PEEL.get(), "Banana Peel");
|
||||
|
||||
add(ModEntities.PINGUIN.get(), "Pinguin");
|
||||
add(ModEntities.FIREFLY.get(), "Firefly");
|
||||
add(ModEntities.ROOSTER.get(), "Rooster");
|
||||
|
||||
Reference in New Issue
Block a user