diff --git a/src/main/java/growthcraft/apiary/GrowthcraftApiary.java b/src/main/java/growthcraft/apiary/GrowthcraftApiary.java index baa35ff2..18c63553 100644 --- a/src/main/java/growthcraft/apiary/GrowthcraftApiary.java +++ b/src/main/java/growthcraft/apiary/GrowthcraftApiary.java @@ -48,9 +48,7 @@ private void clientSetupEvent(final FMLClientSetupEvent event) { } private void setup(final FMLCommonSetupEvent event) { - //event.enqueueWork( () -> { - // GrowthcraftOreGeneration.registerConfiguredFeatures(); - //}); + GrowthcraftApiaryItems.registerCompostables(); } @SubscribeEvent diff --git a/src/main/java/growthcraft/apiary/init/GrowthcraftApiaryItems.java b/src/main/java/growthcraft/apiary/init/GrowthcraftApiaryItems.java index 7c4ffc6f..71fed947 100644 --- a/src/main/java/growthcraft/apiary/init/GrowthcraftApiaryItems.java +++ b/src/main/java/growthcraft/apiary/init/GrowthcraftApiaryItems.java @@ -1,6 +1,7 @@ package growthcraft.apiary.init; import growthcraft.apiary.shared.Reference; +import growthcraft.core.utils.CompostableUtils; import growthcraft.lib.item.GrowthcraftItem; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; @@ -100,6 +101,12 @@ private GrowthcraftApiaryItems() { /* Prevent default public constructor */ } + public static void registerCompostables() { + CompostableUtils.registerCompostable(HONEY_COMB_FULL.get(), CompostableUtils.COMPOSTABLE.HIGHEST); + CompostableUtils.registerCompostable(HONEY_COMB_EMPTY.get(), CompostableUtils.COMPOSTABLE.LOW); + CompostableUtils.registerCompostable(BEE.get(), CompostableUtils.COMPOSTABLE.HIGH); + } + public static boolean excludeItemRegistry(ResourceLocation registryName) { ArrayList excludeItems = new ArrayList<>(); //excludeItems.add(Reference.MODID + ":" + Reference.UnlocalizedName.APPLE_TREE_FRUIT); diff --git a/src/main/java/growthcraft/apples/init/GrowthcraftApplesItems.java b/src/main/java/growthcraft/apples/init/GrowthcraftApplesItems.java index 5a4d3dc5..731f0354 100644 --- a/src/main/java/growthcraft/apples/init/GrowthcraftApplesItems.java +++ b/src/main/java/growthcraft/apples/init/GrowthcraftApplesItems.java @@ -2,6 +2,8 @@ import growthcraft.apples.item.AppleSeedsItem; import growthcraft.apples.shared.Reference; +import growthcraft.core.utils.CompostableUtils; +import growthcraft.lib.item.GrowthcraftItem; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.ComposterBlock; @@ -23,13 +25,7 @@ public class GrowthcraftApplesItems { ); public static void registerCompostables() { - float f = 0.3F; - float f1 = 0.5F; - float f2 = 0.65F; - float f3 = 0.85F; - float f4 = 1.0F; - - ComposterBlock.COMPOSTABLES.put(GrowthcraftApplesItems.APPLE_SEEDS.get(), f1); + CompostableUtils.registerCompostable(GrowthcraftApplesItems.APPLE_SEEDS.get(), CompostableUtils.COMPOSTABLE.LOW); } public static boolean excludeItemRegistry(ResourceLocation registryName) { diff --git a/src/main/java/growthcraft/bamboo/GrowthcraftBamboo.java b/src/main/java/growthcraft/bamboo/GrowthcraftBamboo.java index 0256ec36..07075252 100644 --- a/src/main/java/growthcraft/bamboo/GrowthcraftBamboo.java +++ b/src/main/java/growthcraft/bamboo/GrowthcraftBamboo.java @@ -57,7 +57,7 @@ private void clientSetupEvent(final FMLClientSetupEvent event) { } private void setup(final FMLCommonSetupEvent event) { - // Do Nothing for now ... + GrowthcraftBambooItems.registerCompostables(); } @SubscribeEvent diff --git a/src/main/java/growthcraft/bamboo/init/GrowthcraftBambooItems.java b/src/main/java/growthcraft/bamboo/init/GrowthcraftBambooItems.java index 7690355a..574874db 100644 --- a/src/main/java/growthcraft/bamboo/init/GrowthcraftBambooItems.java +++ b/src/main/java/growthcraft/bamboo/init/GrowthcraftBambooItems.java @@ -14,14 +14,7 @@ public class GrowthcraftBambooItems { ); public static void registerCompostables() { - float f = 0.3F; - float f1 = 0.5F; - float f2 = 0.65F; - float f3 = 0.85F; - float f4 = 1.0F; - - // ComposterBlock.COMPOSTABLES.put(GrowthcraftRiceItems.RICE.get(), f2); - + // Do nothing at this time. } public static boolean excludeItemRegistry(ResourceLocation registryName) { diff --git a/src/main/java/growthcraft/cellar/GrowthcraftCellar.java b/src/main/java/growthcraft/cellar/GrowthcraftCellar.java index ba44abad..65a5f9a0 100644 --- a/src/main/java/growthcraft/cellar/GrowthcraftCellar.java +++ b/src/main/java/growthcraft/cellar/GrowthcraftCellar.java @@ -84,6 +84,7 @@ private void clientSetupEvent(final FMLClientSetupEvent event) { private void setup(final FMLCommonSetupEvent event) { GrowthcraftCellarMessages.register(); + GrowthcraftCellarItems.registerCompostables(); } public void buildCreativeTabContents(BuildCreativeModeTabContentsEvent event) { diff --git a/src/main/java/growthcraft/cellar/init/GrowthcraftCellarItems.java b/src/main/java/growthcraft/cellar/init/GrowthcraftCellarItems.java index 07dd15af..33190461 100644 --- a/src/main/java/growthcraft/cellar/init/GrowthcraftCellarItems.java +++ b/src/main/java/growthcraft/cellar/init/GrowthcraftCellarItems.java @@ -4,6 +4,7 @@ import growthcraft.cellar.item.GrapeSeedsItem; import growthcraft.cellar.item.HopsSeedsItem; import growthcraft.cellar.shared.Reference; +import growthcraft.core.utils.CompostableUtils; import growthcraft.lib.item.GrowthcraftFoodItem; import growthcraft.lib.item.GrowthcraftItem; import net.minecraft.resources.ResourceLocation; @@ -69,7 +70,7 @@ public class GrowthcraftCellarItems { Reference.UnlocalizedName.GRAPE_PURPLE, GrowthcraftFoodItem::new ); - public static final RegistryObject PURPLE_RED_SEEDS = ITEMS.register( + public static final RegistryObject GRAPE_PURPLE_SEEDS = ITEMS.register( Reference.UnlocalizedName.GRAPE_SEEDS_PURPLE, () -> new GrapeSeedsItem( GrowthcraftCellarBlocks.PURPLE_GRAPE_VINE.get(), @@ -93,7 +94,7 @@ public class GrowthcraftCellarItems { Reference.UnlocalizedName.GRAPE_WHITE, GrowthcraftFoodItem::new ); - public static final RegistryObject WHITE_RED_SEEDS = ITEMS.register( + public static final RegistryObject GRAPE_WHITE_SEEDS = ITEMS.register( Reference.UnlocalizedName.GRAPE_SEEDS_WHITE, () -> new GrapeSeedsItem( GrowthcraftCellarBlocks.WHITE_GRAPE_VINE.get(), @@ -159,14 +160,34 @@ public class GrowthcraftCellarItems { GRAIN_DEEP_COPPER, GRAIN_GOLDEN, GRAIN_PALE_GOLDEN ); + /** + * Registers the compostable items for GrowthcraftCellarItems. + */ public static void registerCompostables() { - float f = 0.3F; - float f1 = 0.5F; - float f2 = 0.65F; - float f3 = 0.85F; - float f4 = 1.0F; - // ComposterBlock.COMPOSTABLES.put(GrowthcraftRiceItems.RICE.get(), f2); + for (RegistryObject grain : GrowthcraftCellarItems.GRAINS) { + CompostableUtils.registerCompostable(grain.get(), CompostableUtils.COMPOSTABLE.HIGH); + } + + CompostableUtils.registerCompostable(GRAIN.get(), CompostableUtils.COMPOSTABLE.NORMAL); + + CompostableUtils.registerCompostable(GRAPE_PURPLE.get(), CompostableUtils.COMPOSTABLE.HIGHEST); + CompostableUtils.registerCompostable(GRAPE_RED.get(), CompostableUtils.COMPOSTABLE.HIGHEST); + CompostableUtils.registerCompostable(GRAPE_WHITE.get(), CompostableUtils.COMPOSTABLE.HIGHEST); + CompostableUtils.registerCompostable(GRAPE_PURPLE_SEEDS.get(), CompostableUtils.COMPOSTABLE.NORMAL); + CompostableUtils.registerCompostable(GRAPE_RED_SEEDS.get(), CompostableUtils.COMPOSTABLE.NORMAL); + CompostableUtils.registerCompostable(GRAPE_WHITE_SEEDS.get(), CompostableUtils.COMPOSTABLE.NORMAL); + + CompostableUtils.registerCompostable(HOPS.get(), CompostableUtils.COMPOSTABLE.HIGHEST); + CompostableUtils.registerCompostable(HOPS_SEED.get(), CompostableUtils.COMPOSTABLE.NORMAL); + + CompostableUtils.registerCompostable(YEAST_BAYANUS.get(), CompostableUtils.COMPOSTABLE.NORMAL); + CompostableUtils.registerCompostable(YEAST_BAYANUS_ETHEREAL.get(), CompostableUtils.COMPOSTABLE.HIGHEST); + CompostableUtils.registerCompostable(YEAST_BREWERS.get(), CompostableUtils.COMPOSTABLE.NORMAL); + CompostableUtils.registerCompostable(YEAST_BREWERS_ETHEREAL.get(), CompostableUtils.COMPOSTABLE.HIGHEST); + CompostableUtils.registerCompostable(YEAST_ETHEREAL.get(), CompostableUtils.COMPOSTABLE.HIGHEST); + CompostableUtils.registerCompostable(YEAST_LAGER.get(), CompostableUtils.COMPOSTABLE.NORMAL); + CompostableUtils.registerCompostable(YEAST_LAGER_ETHEREAL.get(), CompostableUtils.COMPOSTABLE.HIGHEST); } diff --git a/src/main/java/growthcraft/milk/init/GrowthcraftMilkItems.java b/src/main/java/growthcraft/milk/init/GrowthcraftMilkItems.java index 86bc290d..110b723b 100644 --- a/src/main/java/growthcraft/milk/init/GrowthcraftMilkItems.java +++ b/src/main/java/growthcraft/milk/init/GrowthcraftMilkItems.java @@ -1,5 +1,6 @@ package growthcraft.milk.init; +import growthcraft.core.utils.CompostableUtils; import growthcraft.lib.item.GrowthcraftBowlFoodItem; import growthcraft.lib.item.GrowthcraftFoodItem; import growthcraft.lib.item.GrowthcraftItem; @@ -239,14 +240,20 @@ public class GrowthcraftMilkItems { ); public static void registerCompostables() { - float f = 0.3F; - float f1 = 0.5F; - float f2 = 0.65F; - float f3 = 0.85F; - float f4 = 1.0F; - - // ComposterBlock.COMPOSTABLES.put(GrowthcraftRiceItems.RICE.get(), f2); - + CompostableUtils.registerCompostable(THISTLE.get(), CompostableUtils.COMPOSTABLE.HIGH); + CompostableUtils.registerCompostable(THISTLE_SEED.get(), CompostableUtils.COMPOSTABLE.NORMAL); + CompostableUtils.registerCompostable(STARTER_CULTURE.get(), CompostableUtils.COMPOSTABLE.LOW); + CompostableUtils.registerCompostable(CHEESE_APPENZELLER_SLICE.get(), CompostableUtils.COMPOSTABLE.HIGH); + CompostableUtils.registerCompostable(CHEESE_ASIAGO_SLICE.get(), CompostableUtils.COMPOSTABLE.HIGH); + CompostableUtils.registerCompostable(CHEESE_CASU_MARZU_SLICE.get(), CompostableUtils.COMPOSTABLE.HIGH); + CompostableUtils.registerCompostable(CHEESE_CHEDDAR_SLICE.get(), CompostableUtils.COMPOSTABLE.HIGH); + CompostableUtils.registerCompostable(CHEESE_EMMENTALER_SLICE.get(), CompostableUtils.COMPOSTABLE.HIGH); + CompostableUtils.registerCompostable(CHEESE_GORGONZOLA_SLICE.get(), CompostableUtils.COMPOSTABLE.HIGH); + CompostableUtils.registerCompostable(CHEESE_GOUDA_SLICE.get(), CompostableUtils.COMPOSTABLE.HIGH); + CompostableUtils.registerCompostable(CHEESE_MONTEREY_SLICE.get(), CompostableUtils.COMPOSTABLE.HIGH); + CompostableUtils.registerCompostable(CHEESE_PARMESAN_SLICE.get(), CompostableUtils.COMPOSTABLE.HIGH); + CompostableUtils.registerCompostable(CHEESE_PROVOLONE_SLICE.get(), CompostableUtils.COMPOSTABLE.HIGH); + CompostableUtils.registerCompostable(CHEESE_RICOTTA_SLICE.get(), CompostableUtils.COMPOSTABLE.HIGH); } public static boolean excludeItemRegistry(ResourceLocation registryName) { diff --git a/src/main/java/growthcraft/rice/GrowthcraftRice.java b/src/main/java/growthcraft/rice/GrowthcraftRice.java index 9d4d7ef6..16d3152f 100644 --- a/src/main/java/growthcraft/rice/GrowthcraftRice.java +++ b/src/main/java/growthcraft/rice/GrowthcraftRice.java @@ -48,7 +48,7 @@ private void clientSetupEvent(final FMLClientSetupEvent event) { } private void setup(final FMLCommonSetupEvent event) { - // Do Nothing for now ... + GrowthcraftRiceItems.registerCompostables(); } public void buildCreativeTabContents(BuildCreativeModeTabContentsEvent event) { diff --git a/src/main/java/growthcraft/rice/init/GrowthcraftRiceItems.java b/src/main/java/growthcraft/rice/init/GrowthcraftRiceItems.java index 1d768b66..0278d25a 100644 --- a/src/main/java/growthcraft/rice/init/GrowthcraftRiceItems.java +++ b/src/main/java/growthcraft/rice/init/GrowthcraftRiceItems.java @@ -1,5 +1,6 @@ package growthcraft.rice.init; +import growthcraft.core.utils.CompostableUtils; import growthcraft.lib.item.GrowthcraftFoodItem; import growthcraft.lib.item.GrowthcraftItem; import growthcraft.rice.item.CultivatorItem; @@ -54,18 +55,17 @@ public class GrowthcraftRiceItems { ); public static void registerCompostables() { - float f = 0.3F; - float f1 = 0.5F; - float f2 = 0.65F; - float f3 = 0.85F; - float f4 = 1.0F; - - // Add rice as a compostable - ComposterBlock.COMPOSTABLES.put(GrowthcraftRiceItems.RICE.get(), f2); - ComposterBlock.COMPOSTABLES.put(GrowthcraftRiceItems.RICE_COOKED.get(), f3); - ComposterBlock.COMPOSTABLES.put(GrowthcraftRiceItems.RICE_STALK.get(), f1); - ComposterBlock.COMPOSTABLES.put(GrowthcraftRiceItems.SUSHI_ROLL.get(), f4); - ComposterBlock.COMPOSTABLES.put(GrowthcraftRiceItems.YEAST_SEISHU.get(), f4); + // Add rice as a compostables + CompostableUtils.registerCompostable( + GrowthcraftRiceItems.RICE.get(), CompostableUtils.COMPOSTABLE.NORMAL); + CompostableUtils.registerCompostable( + GrowthcraftRiceItems.RICE_COOKED.get(), CompostableUtils.COMPOSTABLE.HIGH); + CompostableUtils.registerCompostable( + GrowthcraftRiceItems.RICE_STALK.get(), CompostableUtils.COMPOSTABLE.LOW); + CompostableUtils.registerCompostable( + GrowthcraftRiceItems.SUSHI_ROLL.get(), CompostableUtils.COMPOSTABLE.HIGHEST); + CompostableUtils.registerCompostable( + GrowthcraftRiceItems.YEAST_SEISHU.get(), CompostableUtils.COMPOSTABLE.HIGHEST); } public static boolean excludeItemRegistry(ResourceLocation registryName) {