Skip to content

Commit

Permalink
Merge pull request #165 from moonfather1/fixes_23
Browse files Browse the repository at this point in the history
small things
  • Loading branch information
Alatyami authored Oct 23, 2024
2 parents a66fd7f + 33ff1a8 commit 18ff0ea
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/main/java/growthcraft/cellar/GrowthcraftCellar.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ private void clientSetupEvent(final FMLClientSetupEvent event) {

private void setup(final FMLCommonSetupEvent event) {
GrowthcraftCellarMessages.register();
GrowthcraftCellarItems.registerCompostables();
}

public void buildCreativeTabContents(BuildCreativeModeTabContentsEvent event) {
Expand Down
25 changes: 19 additions & 6 deletions src/main/java/growthcraft/cellar/init/GrowthcraftCellarItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
import growthcraft.lib.item.GrowthcraftItem;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.ComposterBlock;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;

public class GrowthcraftCellarItems {

Expand Down Expand Up @@ -155,20 +157,31 @@ public class GrowthcraftCellarItems {
);

public static void registerCompostables() {
float f = 0.3F;
float f0 = 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);

ComposterBlock.COMPOSTABLES.put(GrowthcraftCellarItems.GRAPE_WHITE_SEEDS.get(), 0.1f);
ComposterBlock.COMPOSTABLES.put(GrowthcraftCellarItems.GRAPE_RED_SEEDS.get(), 0.1f);
ComposterBlock.COMPOSTABLES.put(GrowthcraftCellarItems.GRAPE_PURPLE_SEED.get(), 0.1f);
ComposterBlock.COMPOSTABLES.put(GrowthcraftCellarItems.GRAPE_WHITE.get(), 0.6f);
ComposterBlock.COMPOSTABLES.put(GrowthcraftCellarItems.GRAPE_RED.get(), 0.6f);
ComposterBlock.COMPOSTABLES.put(GrowthcraftCellarItems.GRAPE_PURPLE.get(), 0.6f);
for (RegistryObject<? extends Item> grain : GRAINS) {
ComposterBlock.COMPOSTABLES.put(grain.get(), 0.2f);
}
ComposterBlock.COMPOSTABLES.put(GrowthcraftCellarItems.GRAIN.get(), 0.3f);
ComposterBlock.COMPOSTABLES.put(GrowthcraftCellarItems.HOPS.get(), 0.3f);
ComposterBlock.COMPOSTABLES.put(GrowthcraftCellarItems.HOPS_SEED.get(), 0.1f);
ComposterBlock.COMPOSTABLES.put(GrowthcraftCellarItems.YEAST_LAGER.get(), 0.5f);
ComposterBlock.COMPOSTABLES.put(GrowthcraftCellarItems.YEAST_BAYANUS.get(), 0.5f);
ComposterBlock.COMPOSTABLES.put(GrowthcraftCellarItems.YEAST_BREWERS.get(), 0.5f);
}

public static boolean excludeItemRegistry(ResourceLocation registryName) {
ArrayList<String> excludeItems = new ArrayList<>();
//excludeItems.add(Reference.MODID + ":" + Reference.UnlocalizedName.APPLE_TREE_FRUIT);
return excludeItems.contains(registryName.toString());
return false;
}

private GrowthcraftCellarItems() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ public class GrowthcraftMilkBlocks {

/////////// shop signs ////////////

private static final RegistryObject<Block> SHOP_SIGN_1_OAK = registerBlock("hanging_sign_1_oak", () -> makeSign(Blocks.OAK_HANGING_SIGN));
private static final RegistryObject<Block> SHOP_SIGN_2_OAK = registerBlock("hanging_sign_2_oak", () -> makeSign(Blocks.OAK_WALL_HANGING_SIGN));
private static final RegistryObject<Block> SHOP_SIGN_1_SPRUCE = registerBlock("hanging_sign_1_spruce", () -> makeSign(Blocks.SPRUCE_HANGING_SIGN));
private static final RegistryObject<Block> SHOP_SIGN_2_SPRUCE = registerBlock("hanging_sign_2_spruce", () -> makeSign(Blocks.SPRUCE_WALL_HANGING_SIGN));
private static final RegistryObject<Block> SHOP_SIGN_1_OAK = registerBlock("hanging_sign_1_oak", () -> makeSign(Blocks.OAK_HANGING_SIGN), true);
private static final RegistryObject<Block> SHOP_SIGN_2_OAK = registerBlock("hanging_sign_2_oak", () -> makeSign(Blocks.OAK_WALL_HANGING_SIGN), true);
private static final RegistryObject<Block> SHOP_SIGN_1_SPRUCE = registerBlock("hanging_sign_1_spruce", () -> makeSign(Blocks.SPRUCE_HANGING_SIGN), true);
private static final RegistryObject<Block> SHOP_SIGN_2_SPRUCE = registerBlock("hanging_sign_2_spruce", () -> makeSign(Blocks.SPRUCE_WALL_HANGING_SIGN), true);

///////////////////////////////////

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/growthcraft/milk/init/GrowthcraftMilkItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,9 +246,8 @@ public static void registerCompostables() {
float f2 = 0.65F;
float f3 = 0.85F;
float f4 = 1.0F;

ComposterBlock.COMPOSTABLES.put(GrowthcraftMilkItems.THISTLE_SEED.get(), f2);

ComposterBlock.COMPOSTABLES.put(GrowthcraftMilkItems.THISTLE_SEED.get(), f);
ComposterBlock.COMPOSTABLES.put(GrowthcraftMilkItems.THISTLE.get(), f1);
}

public static boolean excludeItemRegistry(ResourceLocation registryName) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/growthcraft/rice/GrowthcraftRice.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private void clientSetupEvent(final FMLClientSetupEvent event) {
}

private void setup(final FMLCommonSetupEvent event) {
// Do nothing
GrowthcraftRiceItems.registerCompostables();
}

public void buildCreativeTabContents(BuildCreativeModeTabContentsEvent event) {
Expand Down

0 comments on commit 18ff0ea

Please sign in to comment.