From ba452d0988cf8bb4676c8e0b7a53a41994e51fd6 Mon Sep 17 00:00:00 2001 From: Michael Hillcox Date: Sun, 6 Dec 2020 20:42:28 +0000 Subject: [PATCH] Foods skeletons :D --- .../common/items/ActuallyItems.java | 46 +++++++------- .../common/items/misc/YummyItem.java | 61 +++++++++++++++++++ .../common/items/useables/DrillItem.java | 2 +- 3 files changed, 87 insertions(+), 22 deletions(-) create mode 100644 src/main/java/de/ellpeck/actuallyadditions/common/items/misc/YummyItem.java diff --git a/src/main/java/de/ellpeck/actuallyadditions/common/items/ActuallyItems.java b/src/main/java/de/ellpeck/actuallyadditions/common/items/ActuallyItems.java index 6397b0ff7..1fbd25821 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/common/items/ActuallyItems.java +++ b/src/main/java/de/ellpeck/actuallyadditions/common/items/ActuallyItems.java @@ -3,6 +3,7 @@ package de.ellpeck.actuallyadditions.common.items; import com.google.common.collect.ImmutableSet; import de.ellpeck.actuallyadditions.common.ActuallyAdditions; import de.ellpeck.actuallyadditions.common.items.misc.DrillAugmentItem; +import de.ellpeck.actuallyadditions.common.items.misc.YummyItem; import de.ellpeck.actuallyadditions.common.items.useables.*; import de.ellpeck.actuallyadditions.common.materials.ArmorMaterials; import de.ellpeck.actuallyadditions.common.materials.ToolMaterials; @@ -142,27 +143,30 @@ public final class ActuallyItems { public static final RegistryObject CUP_WITH_COFFEE = ITEMS.register("cup_with_coffee", basicItem()); public static final RegistryObject PHANTOM_CONNECTOR = ITEMS.register("phantom_connector", basicItem()); public static final RegistryObject RESONANT_RICE = ITEMS.register("resonant_rice", basicItem()); - public static final RegistryObject FOOD_CHEESE = ITEMS.register("food_cheese", basicItem()); - public static final RegistryObject FOOD_PUMPKIN_STEW = ITEMS.register("food_pumpkin_stew", basicItem()); - public static final RegistryObject FOOD_CARROT_JUICE = ITEMS.register("food_carrot_juice", basicItem()); - public static final RegistryObject FOOD_FISH_N_CHIPS = ITEMS.register("food_fish_n_chips", basicItem()); - public static final RegistryObject FOOD_FRENCH_FRIES = ITEMS.register("food_french_fries", basicItem()); - public static final RegistryObject FOOD_FRENCH_FRY = ITEMS.register("food_french_fry", basicItem()); - public static final RegistryObject FOOD_SPAGHETTI = ITEMS.register("food_spaghetti", basicItem()); - public static final RegistryObject FOOD_NOODLE = ITEMS.register("food_noodle", basicItem()); - public static final RegistryObject FOOD_CHOCOLATE_CAKE = ITEMS.register("food_chocolate_cake", basicItem()); - public static final RegistryObject FOOD_CHOCOLATE = ITEMS.register("food_chocolate", basicItem()); - public static final RegistryObject FOOD_TOAST = ITEMS.register("food_toast", basicItem()); - public static final RegistryObject FOOD_SUBMARINE_SANDWICH = ITEMS.register("food_submarine_sandwich", basicItem()); - public static final RegistryObject FOOD_BIG_COOKIE = ITEMS.register("food_big_cookie", basicItem()); - public static final RegistryObject FOOD_HAMBURGER = ITEMS.register("food_hamburger", basicItem()); - public static final RegistryObject FOOD_PIZZA = ITEMS.register("food_pizza", basicItem()); - public static final RegistryObject FOOD_BAGUETTE = ITEMS.register("food_baguette", basicItem()); - public static final RegistryObject FOOD_RICE = ITEMS.register("food_rice", basicItem()); - public static final RegistryObject FOOD_RICE_BREAD = ITEMS.register("food_rice_bread", basicItem()); - public static final RegistryObject FOOD_DOUGHNUT = ITEMS.register("food_doughnut", basicItem()); - public static final RegistryObject FOOD_TOAST_O_CHOCOLATE = ITEMS.register("food_toast_o_chocolate", basicItem()); - public static final RegistryObject FOOD_BACON = ITEMS.register("food_bacon", basicItem()); + + // Foods! :D + public static final RegistryObject FOOD_CHEESE = ITEMS.register("food_cheese", () -> new YummyItem(YummyItem.Foods.CHEESE)); + public static final RegistryObject FOOD_PUMPKIN_STEW = ITEMS.register("food_pumpkin_stew", () -> new YummyItem(YummyItem.Foods.PUMPKIN_STEW)); + public static final RegistryObject FOOD_CARROT_JUICE = ITEMS.register("food_carrot_juice", () -> new YummyItem(YummyItem.Foods.CARROT_JUICE)); + public static final RegistryObject FOOD_FISH_N_CHIPS = ITEMS.register("food_fish_n_chips", () -> new YummyItem(YummyItem.Foods.FISH_N_CHIPS)); + public static final RegistryObject FOOD_FRENCH_FRIES = ITEMS.register("food_french_fries", () -> new YummyItem(YummyItem.Foods.FRENCH_FRIES)); + public static final RegistryObject FOOD_FRENCH_FRY = ITEMS.register("food_french_fry", () -> new YummyItem(YummyItem.Foods.FRENCH_FRY)); + public static final RegistryObject FOOD_SPAGHETTI = ITEMS.register("food_spaghetti", () -> new YummyItem(YummyItem.Foods.SPAGHETTI)); + public static final RegistryObject FOOD_NOODLE = ITEMS.register("food_noodle", () -> new YummyItem(YummyItem.Foods.NOODLE)); + public static final RegistryObject FOOD_CHOCOLATE_CAKE = ITEMS.register("food_chocolate_cake", () -> new YummyItem(YummyItem.Foods.CHOCOLATE_CAKE)); + public static final RegistryObject FOOD_CHOCOLATE = ITEMS.register("food_chocolate", () -> new YummyItem(YummyItem.Foods.CHOCOLATE)); + public static final RegistryObject FOOD_TOAST = ITEMS.register("food_toast", () -> new YummyItem(YummyItem.Foods.TOAST)); + public static final RegistryObject FOOD_SUBMARINE_SANDWICH = ITEMS.register("food_submarine_sandwich", () -> new YummyItem(YummyItem.Foods.SUBMARINE_SANDWICH)); + public static final RegistryObject FOOD_BIG_COOKIE = ITEMS.register("food_big_cookie", () -> new YummyItem(YummyItem.Foods.BIG_COOKIE)); + public static final RegistryObject FOOD_HAMBURGER = ITEMS.register("food_hamburger", () -> new YummyItem(YummyItem.Foods.HAMBURGER)); + public static final RegistryObject FOOD_PIZZA = ITEMS.register("food_pizza", () -> new YummyItem(YummyItem.Foods.PIZZA)); + public static final RegistryObject FOOD_BAGUETTE = ITEMS.register("food_baguette", () -> new YummyItem(YummyItem.Foods.BAGUETTE)); + public static final RegistryObject FOOD_RICE = ITEMS.register("food_rice", () -> new YummyItem(YummyItem.Foods.RICE)); + public static final RegistryObject FOOD_RICE_BREAD = ITEMS.register("food_rice_bread", () -> new YummyItem(YummyItem.Foods.RICE_BREAD)); + public static final RegistryObject FOOD_DOUGHNUT = ITEMS.register("food_doughnut", () -> new YummyItem(YummyItem.Foods.DOUGHNUT)); + public static final RegistryObject FOOD_TOAST_O_CHOCOLATE = ITEMS.register("food_toast_o_chocolate", () -> new YummyItem(YummyItem.Foods.CHOCOLATE_TOAST)); + public static final RegistryObject FOOD_BACON = ITEMS.register("food_bacon", () -> new YummyItem(YummyItem.Foods.BACON)); + public static final RegistryObject CU_BA_RA_JAM = ITEMS.register("jam_cu_ba_ra", basicItem()); public static final RegistryObject GRA_KI_BA_JAM = ITEMS.register("jam_gra_ki_ba", basicItem()); public static final RegistryObject PL_AP_LE_JAM = ITEMS.register("jam_pl_ap_le", basicItem()); diff --git a/src/main/java/de/ellpeck/actuallyadditions/common/items/misc/YummyItem.java b/src/main/java/de/ellpeck/actuallyadditions/common/items/misc/YummyItem.java new file mode 100644 index 000000000..d9ae2938a --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/common/items/misc/YummyItem.java @@ -0,0 +1,61 @@ +package de.ellpeck.actuallyadditions.common.items.misc; + +import de.ellpeck.actuallyadditions.common.items.ActuallyItem; +import de.ellpeck.actuallyadditions.common.items.ActuallyItems; +import net.minecraft.item.Food; +import net.minecraft.item.ItemStack; +import net.minecraft.item.Items; + +public class YummyItem extends ActuallyItem { + private final Foods food; + + public YummyItem(Foods food) { + super(baseProps().food(food.food)); + + this.food = food; + } + + public enum Foods { + CHEESE(new Food.Builder().hunger(1).saturation(0.05F), 3), + PUMPKIN_STEW(new Food.Builder().hunger(6).saturation(0.3F), 30, true, new ItemStack(Items.BOWL)), + CARROT_JUICE(new Food.Builder().hunger(4).saturation(0.2F), 20, true, new ItemStack(Items.GLASS_BOTTLE)), + FISH_N_CHIPS(new Food.Builder().hunger(14).saturation(0.65F), 40, new ItemStack(ActuallyItems.PAPER_CONE.get())), + FRENCH_FRIES(new Food.Builder().hunger(10).saturation(0.6F), 32, new ItemStack(ActuallyItems.PAPER_CONE.get())), + FRENCH_FRY(new Food.Builder().hunger(2).saturation(0.025F), 3), + SPAGHETTI(new Food.Builder().hunger(7).saturation(0.4F), 38, new ItemStack(Items.BOWL)), + NOODLE(new Food.Builder().hunger(1).saturation(0.01F), 3), + CHOCOLATE_CAKE(new Food.Builder().hunger(16).saturation(0.8F), 45), + CHOCOLATE(new Food.Builder().hunger(3).saturation(0.3F), 15), + TOAST(new Food.Builder().hunger(3).saturation(0.08F), 25), + SUBMARINE_SANDWICH(new Food.Builder().hunger(9).saturation(0.4F), 40), + BIG_COOKIE(new Food.Builder().hunger(4).saturation(0.25F), 20), + HAMBURGER(new Food.Builder().hunger(13).saturation(0.65F), 40), + PIZZA(new Food.Builder().hunger(16).saturation(0.8F), 45), + BAGUETTE(new Food.Builder().hunger(6).saturation(0.5F), 25), + RICE(new Food.Builder().hunger(2).saturation(0.05F), 10), + RICE_BREAD(new Food.Builder().hunger(6).saturation(0.5F), 25), + DOUGHNUT(new Food.Builder().hunger(2).saturation(0.1F), 10), + CHOCOLATE_TOAST(new Food.Builder().hunger(5).saturation(0.2F), 40), + BACON(new Food.Builder().hunger(4).saturation(0.1F), 30); + + Food food; + int useDuration; + boolean isDrunken; + ItemStack returnItem; + + Foods(Food.Builder food, int useDuration, boolean isDrunken, ItemStack returnItem) { + this.food = food.build(); + this.useDuration = useDuration; + this.isDrunken = isDrunken; + this.returnItem = returnItem; + } + + Foods(Food.Builder food, int useDuration) { + this(food, useDuration, false, ItemStack.EMPTY); + } + + Foods(Food.Builder food, int useDuration, ItemStack returnItem) { + this(food, useDuration, false, returnItem); + } + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/common/items/useables/DrillItem.java b/src/main/java/de/ellpeck/actuallyadditions/common/items/useables/DrillItem.java index 3b4712c59..23fe04127 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/common/items/useables/DrillItem.java +++ b/src/main/java/de/ellpeck/actuallyadditions/common/items/useables/DrillItem.java @@ -48,7 +48,7 @@ import static de.ellpeck.actuallyadditions.common.items.misc.DrillAugmentItem.Au /** * @implNote The augment system might be made more abstract as I think other things might use it. * - * todo: Still need to support the placement augment. Tired out after all the AOE crap + * todo: Still need to support the placement augment. Tired out after all the AOE crap */ public class DrillItem extends CrystalFluxItem { public static final String NBT_AUGMENT_TAG = "augments";