Skip to content

Commit

Permalink
Merge pull request #353 from IcarussOne/main
Browse files Browse the repository at this point in the history
Chicken Shedding Tweak
  • Loading branch information
ACGaming authored Jan 11, 2024
2 parents 07b5275 + 2642091 commit 043a391
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ All changes are toggleable via config files.
* **Burning Baby Zombies:** Lets baby zombies burn in daylight as in Minecraft 1.13+
* **Charged Creeper Spawning:** Sets the chance for creepers to spawn charged
* **Check Animated Models:** Improves model load times by checking if an animated model exists before trying to load it
* **Chicken Shedding:** Allows chickens to have a chance to shed feathers (similarly to laying eggs)
* **Chunk Gen Limit:** Limits maximum chunk generation per tick for improved server performance
* **Copy World Seed:** Enables clicking of `/seed` world seed in chat to copy to clipboard
* **Crafting Cache:** Adds an IRecipe cache to improve recipe performance in large modpacks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ public static class EntitiesCategory
@Config.LangKey("cfg.universaltweaks.tweaks.entities.betterburning")
@Config.Name("Better Burning")
public final BetterBurningCategory BETTER_BURNING = new BetterBurningCategory();

@Config.LangKey("cfg.universaltweaks.tweaks.entities.chickenshedding")
@Config.Name("Chicken Shedding")
public final ChickenSheddingCategory CHICKEN_SHEDDING = new ChickenSheddingCategory();

@Config.LangKey("cfg.universaltweaks.tweaks.entities.collisiondamage")
@Config.Name("Collision Damage")
Expand Down Expand Up @@ -474,6 +478,21 @@ public static class BetterBurningCategory
@Config.Comment("Allows fire to spread from entity to entity (30% chance * regional difficulty)")
public boolean utBBSpreadingToggle = true;
}

public static class ChickenSheddingCategory
{
@Config.Name("[1] Chicken Shedding")
@Config.Comment("Enables chickens to have a chance to shed a feather")
public boolean utChickenSheddingToggle = true;

@Config.Name("[2] Shed Frequency")
@Config.Comment("How frequently feathers shed from chickens (lower means more)")
public int utChickenSheddingFrequency = 28000;

@Config.Name("[3] Baby Chickens Shed Feathers")
@Config.Comment("Allows baby chickens to also shed feathers")
public boolean utChickenSheddingBabyToggle = false;
}

public static class EasyBreedingCategory
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package mod.acgaming.universaltweaks.tweaks.entities.chickenshedding;

import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.init.Items;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;

import mod.acgaming.universaltweaks.UniversalTweaks;
import mod.acgaming.universaltweaks.config.UTConfigGeneral;
import mod.acgaming.universaltweaks.config.UTConfigTweaks;

// Courtesy of holmraven
@Mod.EventBusSubscriber(modid = UniversalTweaks.MODID)
public class UTChickenShedding {
@SubscribeEvent
public static void onLivingUpdate(LivingUpdateEvent event)
{
if (event.getEntity().world.isRemote || !(event.getEntity() instanceof EntityChicken) || !(UTConfigTweaks.ENTITIES.CHICKEN_SHEDDING.utChickenSheddingToggle))
{
return;
}

EntityChicken chicken = (EntityChicken) event.getEntity();
if (UTConfigTweaks.ENTITIES.CHICKEN_SHEDDING.utChickenSheddingBabyToggle || !(chicken.isChild()) && chicken.world.rand.nextInt(UTConfigTweaks.ENTITIES.CHICKEN_SHEDDING.utChickenSheddingFrequency) == 0)
{
if (UTConfigGeneral.DEBUG.utDebugToggle) UniversalTweaks.LOGGER.debug("UTChickenShedding ::: Living update event");
chicken.dropItem(Items.FEATHER, 1);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public static List<String> obsoleteModsMessage()
if (Loader.isModLoaded("bottomsugarcanharvest") && UTConfigTweaks.BLOCKS.utSugarCaneSize != 3) messages.add("Bottom Sugar Cane Harvest");
if (Loader.isModLoaded("bowinfinityfix") && UTConfigTweaks.ITEMS.utBowInfinityToggle) messages.add("Bow Infinity Fix");
if (Loader.isModLoaded("burnbabyburn") && UTConfigTweaks.ENTITIES.utBurningBabyZombiesToggle) messages.add("BurnBabyBurn");
if (Loader.isModLoaded("chickensshed") && UTConfigTweaks.ENTITIES.CHICKEN_SHEDDING.utChickenSheddingToggle) messages.add("ChickensShed");
if (Loader.isModLoaded("cie") && UTConfigTweaks.ITEMS.ITEM_ENTITIES.utItemEntitiesToggle) messages.add("Configurable Item Entities (CIE)");
if (Loader.isModLoaded("classiccombat") && UTConfigTweaks.ITEMS.ATTACK_COOLDOWN.utAttackCooldownToggle) messages.add("Classic Combat");
if (Loader.isModLoaded("cleardespawn") && UTConfigTweaks.ITEMS.ITEM_ENTITIES.utIEClearDespawnToggle) messages.add("Clear Despawn");
Expand Down

0 comments on commit 043a391

Please sign in to comment.