Skip to content

Commit

Permalink
0.0.3 START #70 + lead recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
MBatt1 committed Aug 24, 2023
1 parent 1cd8183 commit d2dd8ec
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ org.gradle.jvmargs=-Xmx2G


# Mod Properties
mod_version = 0.0.2
mod_version = 0.0.3-dev
maven_group = net.cr24
archives_base_name = primeval
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@

import net.cr24.primeval.item.PrimevalItems;
import net.minecraft.entity.passive.PigEntity;
import net.minecraft.item.ItemConvertible;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.recipe.Ingredient;
import net.minecraft.world.GameRules;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import java.util.Map;

@Mixin(PigEntity.class)
public class PigEntityMixin {

@Inject(method = "isBreedingItem", at = @At("HEAD"), cancellable = true)
private void isBreedingItem(ItemStack stack, CallbackInfoReturnable<Boolean> info) {
info.setReturnValue(stack.isOf(PrimevalItems.CARROT));
}
@Shadow
@Final
@Mutable
private static Ingredient BREEDING_INGREDIENT = Ingredient.ofItems(new ItemConvertible[]{PrimevalItems.CARROT, PrimevalItems.POTATO});

}
17 changes: 17 additions & 0 deletions src/main/resources/data/primeval/recipes/lead.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
" ##",
" ##",
"# "
],
"key": {
"#": {
"item": "primeval:straw"
}
},
"result": {
"item": "minecraft:lead",
"count": 1
}
}

0 comments on commit d2dd8ec

Please sign in to comment.