Skip to content

Commit

Permalink
feat: 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamalam360 committed May 21, 2024
1 parent ab76d60 commit 55d4ba0
Show file tree
Hide file tree
Showing 17 changed files with 252 additions and 610 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
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.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2023 Jamalam
Copyright 2024 Jamalam

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
48 changes: 33 additions & 15 deletions README.md
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)
25 changes: 13 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false
id "me.shedaniel.unified-publishing" version "0.1.+" apply false
id "com.github.breadmoirai.github-release" version "2.4.1"
}
Expand Down Expand Up @@ -28,19 +28,16 @@ subprojects {
silentMojangMappingsLicense()
}

base {
archivesName = "reaping"
}

jar {
manifest {
attributes([
'Specification-Title' : mod_name,
'Specification-Version' : project.jar.archiveVersion,
'Implementation-Title' : project.name,
'Implementation-Version' : project.jar.archiveVersion,
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Built-On-Minecraft' : minecraft_version
'Specification-Title' : mod_name,
'Specification-Version' : project.jar.archiveVersion,
'Implementation-Title' : project.name,
'Implementation-Version': project.jar.archiveVersion,
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
'Built-On-Minecraft' : minecraft_version,
'JamLib-File-Name' : "reaping-${project.base.archivesName.get()}-${rootProject.version}.jar"
])
}
}
Expand All @@ -59,6 +56,10 @@ allprojects {
version = rootProject.version
group = rootProject.group

base {
archivesName = "reaping"
}

repositories {
mavenCentral()

Expand Down Expand Up @@ -88,7 +89,7 @@ allprojects {
java {
withSourcesJar()
}

tasks.publish {
dependsOn(":githubRelease")
dependsOn("fabric:publishUnified")
Expand Down
141 changes: 66 additions & 75 deletions common/src/main/java/io/github/jamalam360/reaping/Content.java
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);
}
}
Loading

0 comments on commit 55d4ba0

Please sign in to comment.