Skip to content

Commit

Permalink
Fix catnip generation in the wild.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulyhedral committed Mar 20, 2022
1 parent 393d17f commit 4ff7b15
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/sweetrpg/catherder/CatHerder.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public CatHerder() {
forgeEventBus.addListener(this::serverStarting);
forgeEventBus.addListener(this::registerCommands);

forgeEventBus.register(new EventHandler());
// forgeEventBus.register(new EventHandler());
// forgeEventBus.register(new BackwardsComp());

// Client Events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.sweetrpg.catherder.common.config.ConfigHandler;
import com.sweetrpg.catherder.common.entity.CatEntity;
import com.sweetrpg.catherder.common.lib.Constants;
import com.sweetrpg.catherder.common.registry.ModEntityTypes;
import com.sweetrpg.catherder.common.registry.ModItems;
import com.sweetrpg.catherder.common.talent.BirdCatcherTalent;
Expand All @@ -25,14 +26,25 @@
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.world.BiomeLoadingEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

@Mod.EventBusSubscriber(modid = Constants.MOD_ID)
public class EventHandler {

@SubscribeEvent
public static void onBiomeLoad(BiomeLoadingEvent event) {
BiomeGenerationSettingsBuilder builder = event.getGeneration();
Biome.ClimateSettings climate = event.getClimate();
if((event.getCategory().equals(Biome.BiomeCategory.PLAINS) || event.getCategory().equals(Biome.BiomeCategory.TAIGA) || event.getCategory().equals(Biome.BiomeCategory.MOUNTAIN) || event.getCategory().equals(Biome.BiomeCategory.JUNGLE)) && (climate.temperature > 0.3F && climate.temperature < 1.0F)) {

if((event.getCategory().equals(Biome.BiomeCategory.PLAINS) ||
event.getCategory().equals(Biome.BiomeCategory.EXTREME_HILLS) ||
event.getCategory().equals(Biome.BiomeCategory.FOREST) ||
event.getCategory().equals(Biome.BiomeCategory.SAVANNA) ||
event.getCategory().equals(Biome.BiomeCategory.MUSHROOM) ||
event.getCategory().equals(Biome.BiomeCategory.TAIGA) ||
event.getCategory().equals(Biome.BiomeCategory.MOUNTAIN) ||
event.getCategory().equals(Biome.BiomeCategory.JUNGLE)) &&
(climate.temperature >= 0.2F && climate.temperature < 1.5F)) {
builder.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, WildCropGeneration.PATCH_WILD_CATNIP);
}
}
Expand Down

0 comments on commit 4ff7b15

Please sign in to comment.