generated from JamCoreModding/multi-loader-template-mod
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab76d60
commit 55d4ba0
Showing
17 changed files
with
252 additions
and
610 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
1.20.4 support. | ||
- Remove the Pillager, since I could never get it to function as I wanted so it was just a | ||
half-baked feature. | ||
- Some cleanup pre-1.20.6. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,39 @@ | ||
# Reaping | ||
![Reaping: Harvest your animals in the most cursed way possible](https://cdn.jamalam.tech/mod-assets/reaping-banner.png) | ||
|
||
<p align="center"> | ||
<img alt="forge" height="25" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact/supported/forge_vector.svg"> | ||
<img alt="fabric" height="25" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact/supported/fabric_vector.svg"> | ||
<img alt="quilt" height="25" src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/compact/supported/quilt_vector.svg"> | ||
</p> | ||
<div align="center"> | ||
|
||
## Harvest your animals in the most cursed way possible. | ||
[Report Issues](https://github.com/JamCoreModding/reaping) • [Chat on Discord](https://discord.jamalam.tech) • [CurseForge](https://curseforge.com/minecraft/mc-mods/reaping) • [Modrinth](https://modrinth.com/mod/reaping) | ||
|
||
<img src="https://github.com/JamCoreModding/reaping/blob/1.20.2-multiloader/demo.gif?raw=true" width="100%"> | ||
</div> | ||
|
||
By using the Reaper you can harvest food from animals as if you had killed them, but without the guilt of killing them - the reaper tool simply cuts off most of the animal, making them a child again - **_science_**! | ||
<div align="center"> | ||
|
||
- Obtain 4 types of reaper, the Iron Reaper, the Gold Reaper, the Diamond Reaper, and the Netherite Reaper. The sharpness and cooldown system means each has its own benefits and drawbacks! | ||
- Reap animals to turn them into babies and drop meat; reap babies to kill them and drop bones! | ||
- Reap players or villagers to obtain s̶u̴s̷p̵i̷c̷i̵o̴u̶s̶ ̸m̸e̷a̵t̸... | ||
- Put a reaper in a dispenser to automate your crimes! | ||
- Fight a new kind of pillager, who carries a reaper! | ||
![A demo of a cow being reaped](https://cdn.jamalam.tech/mod-assets/reaping-demo.gif) | ||
|
||
<a href="https://bisecthosting.com/jamalam"><img src="https://www.bisecthosting.com/partners/custom-banners/982884df-e307-4b8d-b8c2-9f1868a1f13a.webp" height="120"></a> | ||
</div> | ||
|
||
## How to Use | ||
|
||
<div align="center"> | ||
|
||
![The recipe for the Reaper](https://cdn.jamalam.tech/mod-assets/reaping-recipe.png) | ||
|
||
</div> | ||
|
||
1. Craft a Reaper; Iron, Gold, Diamond, and Netherite variants are available. | ||
2. Right-click on an animal (or human...) to harvest it. | ||
3. The animal turns into a child and drops meat! | ||
4. Sometimes, the animal will die during the reaping process - upgrade your reaper to avoid this, | ||
and make sure it doesn't have the Curse of Bluntness! | ||
|
||
## How to Configure | ||
|
||
Reaping can be configured via an in-game configuration screen which can be accessed in the mods | ||
screen. | ||
|
||
## I think I found a bug! | ||
|
||
Please report any issues you find on | ||
the [GitHub issue tracker](https://github.com/JamCoreModding/reaping). | ||
|
||
[![Rent a server with Bisect Hosting: Use Code jamalam to get 25% off](https://www.bisecthosting.com/partners/custom-banners/e0cc6668-0d29-40ff-9820-4d4f5433198a.webp)](https://bisecthosting.com/jamalam) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
141 changes: 66 additions & 75 deletions
141
common/src/main/java/io/github/jamalam360/reaping/Content.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,93 @@ | ||
package io.github.jamalam360.reaping; | ||
|
||
import dev.architectury.registry.level.entity.EntityAttributeRegistry; | ||
import dev.architectury.registry.level.entity.trade.SimpleTrade; | ||
import dev.architectury.registry.level.entity.trade.TradeRegistry; | ||
import dev.architectury.registry.registries.DeferredRegister; | ||
import dev.architectury.registry.registries.RegistrySupplier; | ||
import io.github.jamalam360.reaping.item.CurseOfBluntness; | ||
import io.github.jamalam360.reaping.item.ReaperItem; | ||
import io.github.jamalam360.reaping.pillager.ReapingPillager; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.effect.MobEffect; | ||
import net.minecraft.world.effect.MobEffectInstance; | ||
import net.minecraft.world.effect.MobEffects; | ||
import net.minecraft.world.entity.EntityType; | ||
import net.minecraft.world.entity.MobCategory; | ||
import net.minecraft.world.entity.npc.VillagerProfession; | ||
import net.minecraft.world.food.FoodProperties; | ||
import net.minecraft.world.item.*; | ||
import net.minecraft.world.item.CreativeModeTabs; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.Items; | ||
import net.minecraft.world.item.Tiers; | ||
import net.minecraft.world.item.enchantment.Enchantment; | ||
import net.minecraft.world.level.block.DispenserBlock; | ||
|
||
public class Content { | ||
private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(Reaping.MOD_ID, Registries.ITEM); | ||
private static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(Reaping.MOD_ID, Registries.ENTITY_TYPE); | ||
private static final DeferredRegister<MobEffect> EFFECTS = DeferredRegister.create(Reaping.MOD_ID, Registries.MOB_EFFECT); | ||
private static final DeferredRegister<Enchantment> ENCHANTMENTS = DeferredRegister.create(Reaping.MOD_ID, Registries.ENCHANTMENT); | ||
private static final DeferredRegister<ResourceLocation> STATS = DeferredRegister.create(Reaping.MOD_ID, Registries.CUSTOM_STAT); | ||
|
||
public static final RegistrySupplier<ReaperItem> IRON_REAPER = ITEMS.register(Reaping.id("iron_reaper"), () -> createReaper(Tiers.IRON, 1.0F)); | ||
public static final RegistrySupplier<ReaperItem> GOLD_REAPER = ITEMS.register(Reaping.id("gold_reaper"), () -> createReaper(Tiers.GOLD, 0.75F)); | ||
public static final RegistrySupplier<ReaperItem> DIAMOND_REAPER = ITEMS.register(Reaping.id("diamond_reaper"), () -> createReaper(Tiers.DIAMOND, 0.4F)); | ||
public static final RegistrySupplier<ReaperItem> NETHERITE_REAPER = ITEMS.register(Reaping.id("netherite_reaper"), () -> createReaper(Tiers.NETHERITE, 0.2F)); | ||
public static final RegistrySupplier<Item> HUMANOID_MEAT = ITEMS.register(Reaping.id("humanoid_meat"), | ||
() -> new Item( | ||
new Item.Properties() | ||
.arch$tab(CreativeModeTabs.FOOD_AND_DRINKS) | ||
.food(new FoodProperties.Builder() | ||
.meat().alwaysEat() | ||
.nutrition(7).saturationMod(1.4f) | ||
.effect(new MobEffectInstance(MobEffects.HUNGER, 25 * 20), 1) | ||
.effect(new MobEffectInstance(MobEffects.CONFUSION, 35 * 20), 1) | ||
.effect(new MobEffectInstance(MobEffects.POISON, 10 * 20), 1) | ||
.build() | ||
) | ||
)); | ||
public static final RegistrySupplier<EntityType<ReapingPillager>> PILLAGER = ENTITIES.register(Reaping.id("pillager"), () -> EntityType.Builder | ||
.of(ReapingPillager::new, MobCategory.MONSTER) | ||
.canSpawnFarFromPlayer() | ||
.sized(0.6F, 1.95F) | ||
.clientTrackingRange(8) | ||
.build("reaping_pillager")); | ||
public static final RegistrySupplier<ShrinkEffect> SHRINK = EFFECTS.register(Reaping.id("shrink"), ShrinkEffect::new); | ||
public static final RegistrySupplier<CurseOfBluntness> CURSE_OF_BLUNTNESS = ENCHANTMENTS.register(Reaping.id("curse_of_bluntness"), CurseOfBluntness::new); | ||
public static final ResourceLocation USE_REAPER_TOOL_STAT = Reaping.id("use_reaper_tool"); | ||
private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(Reaping.MOD_ID, Registries.ITEM); | ||
private static final DeferredRegister<MobEffect> EFFECTS = DeferredRegister.create(Reaping.MOD_ID, Registries.MOB_EFFECT); | ||
private static final DeferredRegister<Enchantment> ENCHANTMENTS = DeferredRegister.create(Reaping.MOD_ID, Registries.ENCHANTMENT); | ||
private static final DeferredRegister<ResourceLocation> STATS = DeferredRegister.create(Reaping.MOD_ID, Registries.CUSTOM_STAT); | ||
|
||
public static void registerAll() { | ||
ITEMS.register(); | ||
ENTITIES.register(); | ||
EFFECTS.register(); | ||
ENCHANTMENTS.register(); | ||
STATS.register(); | ||
public static final RegistrySupplier<ReaperItem> IRON_REAPER = ITEMS.register(Reaping.id("iron_reaper"), () -> createReaper(Tiers.IRON, 1.0F)); | ||
public static final RegistrySupplier<ReaperItem> GOLD_REAPER = ITEMS.register(Reaping.id("gold_reaper"), () -> createReaper(Tiers.GOLD, 0.75F)); | ||
public static final RegistrySupplier<ReaperItem> DIAMOND_REAPER = ITEMS.register(Reaping.id("diamond_reaper"), () -> createReaper(Tiers.DIAMOND, 0.4F)); | ||
public static final RegistrySupplier<ReaperItem> NETHERITE_REAPER = ITEMS.register(Reaping.id("netherite_reaper"), () -> createReaper(Tiers.NETHERITE, 0.2F)); | ||
public static final RegistrySupplier<Item> HUMANOID_MEAT = ITEMS.register(Reaping.id("humanoid_meat"), | ||
() -> new Item( | ||
new Item.Properties() | ||
.arch$tab(CreativeModeTabs.FOOD_AND_DRINKS) | ||
.food(new FoodProperties.Builder() | ||
.meat().alwaysEat() | ||
.nutrition(7).saturationMod(1.4f) | ||
.effect(new MobEffectInstance(MobEffects.HUNGER, 25 * 20), 1) | ||
.effect(new MobEffectInstance(MobEffects.CONFUSION, 35 * 20), 1) | ||
.effect(new MobEffectInstance(MobEffects.POISON, 10 * 20), 1) | ||
.build() | ||
) | ||
)); | ||
public static final RegistrySupplier<ShrinkEffect> SHRINK = EFFECTS.register(Reaping.id("shrink"), ShrinkEffect::new); | ||
public static final RegistrySupplier<CurseOfBluntness> CURSE_OF_BLUNTNESS = ENCHANTMENTS.register(Reaping.id("curse_of_bluntness"), CurseOfBluntness::new); | ||
public static final ResourceLocation USE_REAPER_TOOL_STAT = Reaping.id("use_reaper_tool"); | ||
|
||
EntityAttributeRegistry.register(PILLAGER, ReapingPillager::createReapingPillagerAttributes); | ||
public static void registerAll() { | ||
ITEMS.register(); | ||
EFFECTS.register(); | ||
ENCHANTMENTS.register(); | ||
STATS.register(); | ||
|
||
DIAMOND_REAPER.listen((item) -> TradeRegistry.registerVillagerTrade( | ||
VillagerProfession.BUTCHER, | ||
5, | ||
new SimpleTrade( | ||
new ItemStack(Items.EMERALD, 13), | ||
ItemStack.EMPTY, | ||
item.getDefaultInstance(), | ||
3, | ||
30, | ||
1 | ||
) | ||
)); | ||
DIAMOND_REAPER.listen((item) -> TradeRegistry.registerVillagerTrade( | ||
VillagerProfession.BUTCHER, | ||
5, | ||
new SimpleTrade( | ||
new ItemStack(Items.EMERALD, 13), | ||
ItemStack.EMPTY, | ||
item.getDefaultInstance(), | ||
3, | ||
30, | ||
1 | ||
) | ||
)); | ||
|
||
HUMANOID_MEAT.listen((meat) -> TradeRegistry.registerTradeForWanderingTrader( | ||
true, | ||
new SimpleTrade( | ||
new ItemStack(Items.EMERALD, 7), | ||
ItemStack.EMPTY, | ||
meat.getDefaultInstance(), | ||
6, | ||
20, | ||
1 | ||
) | ||
)); | ||
} | ||
HUMANOID_MEAT.listen((meat) -> TradeRegistry.registerTradeForWanderingTrader( | ||
true, | ||
new SimpleTrade( | ||
new ItemStack(Items.EMERALD, 7), | ||
ItemStack.EMPTY, | ||
meat.getDefaultInstance(), | ||
6, | ||
20, | ||
1 | ||
) | ||
)); | ||
} | ||
|
||
private static ReaperItem createReaper(Tiers tier, float sharpnessModifier) { | ||
ReaperItem item = new ReaperItem(tier, new Item.Properties(), sharpnessModifier); | ||
DispenserBlock.registerBehavior(item, new ReaperItem.DispenserBehavior()); | ||
return item; | ||
} | ||
private static ReaperItem createReaper(Tiers tier, float sharpnessModifier) { | ||
ReaperItem item = new ReaperItem(tier, new Item.Properties(), sharpnessModifier); | ||
DispenserBlock.registerBehavior(item, new ReaperItem.DispenserBehavior()); | ||
return item; | ||
} | ||
|
||
static { | ||
STATS.register(USE_REAPER_TOOL_STAT, () -> USE_REAPER_TOOL_STAT); | ||
} | ||
static { | ||
STATS.register(USE_REAPER_TOOL_STAT, () -> USE_REAPER_TOOL_STAT); | ||
} | ||
} |
Oops, something went wrong.