Skip to content

Commit

Permalink
Add compostability to some of the gysahl produce (Closes #89)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrbysco committed Aug 9, 2024
1 parent 8e081b8 commit 5010c3a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions common/src/main/java/net/chococraft/registry/ModRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.ComposterBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.MapColor;
Expand Down Expand Up @@ -79,4 +80,11 @@ public class ModRegistry {
private static Item.Properties itemBuilder() {
return new Item.Properties();
}

public static void registerCompostables() {
ComposterBlock.COMPOSTABLES.put(GYSAHL_GREEN_SEEDS.get(), 0.3F);
ComposterBlock.COMPOSTABLES.put(GYSAHL_GREEN_ITEM.get(), 0.65F);
ComposterBlock.COMPOSTABLES.put(LOVERLY_GYSAHL_GREEN.get(), 0.65F);
ComposterBlock.COMPOSTABLES.put(GOLD_GYSAHL.get(), 0.65F);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.chococraft.fabric;

import dev.architectury.event.events.common.LifecycleEvent;
import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.ConfigHolder;
import me.shedaniel.autoconfig.serializer.GsonConfigSerializer;
Expand All @@ -14,6 +15,7 @@
import net.chococraft.fabric.event.MountEvent;
import net.chococraft.fabric.registry.ModDataSerializers;
import net.chococraft.registry.ModEntities;
import net.chococraft.registry.ModRegistry;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
import net.minecraft.network.syncher.EntityDataSerializers;
Expand Down Expand Up @@ -57,5 +59,9 @@ public void onInitialize() {

return InteractionResult.PASS;
});

LifecycleEvent.SETUP.register(() -> {
ModRegistry.registerCompostables();
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.chococraft.neoforge.common.modifier.ModModifiers;
import net.chococraft.neoforge.registry.ModDataSerializers;
import net.chococraft.registry.ModEntities;
import net.chococraft.registry.ModRegistry;
import net.minecraft.world.entity.SpawnPlacementTypes;
import net.minecraft.world.level.levelgen.Heightmap;
import net.neoforged.api.distmarker.Dist;
Expand Down Expand Up @@ -48,6 +49,7 @@ public ChococraftNeoForge(IEventBus eventBus, ModContainer container, Dist dist)
}

private void setup(final FMLCommonSetupEvent event) {
ModRegistry.registerCompostables();
BreedingConfig.initializeConfig();
}

Expand Down

0 comments on commit 5010c3a

Please sign in to comment.