generated from Team-Abode/abode-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend chicken and parrot food items
Cantaloupe seeds can be fed to chickens and parrots
- Loading branch information
1 parent
c39a120
commit d1a9ff0
Showing
3 changed files
with
72 additions
and
14 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
src/main/java/com/teamabode/verdance/core/mixin/general/ChickenEntityMixin.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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.teamabode.verdance.core.mixin.general; | ||
|
||
import com.teamabode.verdance.core.registry.VerdanceItems; | ||
import net.minecraft.entity.passive.ChickenEntity; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.recipe.Ingredient; | ||
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.CallbackInfo; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Mixin(ChickenEntity.class) | ||
public class ChickenEntityMixin { | ||
@Mutable | ||
@Shadow | ||
@Final | ||
private static Ingredient BREEDING_INGREDIENT; | ||
|
||
@Inject(method = "<clinit>", at = @At("TAIL")) | ||
private static void verdance$appendBreedingIngredient(CallbackInfo ci) { | ||
ArrayList<ItemStack> items = new ArrayList<>(List.of(BREEDING_INGREDIENT.getMatchingStacks())); | ||
items.add(new ItemStack(VerdanceItems.CANTALOUPE_SEEDS)); | ||
BREEDING_INGREDIENT = Ingredient.ofStacks(items.toArray(ItemStack[]::new)); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/teamabode/verdance/core/mixin/general/ParrotEntityMixin.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.teamabode.verdance.core.mixin.general; | ||
|
||
import com.teamabode.verdance.core.registry.VerdanceItems; | ||
import net.minecraft.entity.passive.ParrotEntity; | ||
import net.minecraft.item.Item; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
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.CallbackInfo; | ||
|
||
import java.util.Set; | ||
|
||
@Mixin(ParrotEntity.class) | ||
public class ParrotEntityMixin { | ||
@Shadow | ||
@Final | ||
private static Set<Item> TAMING_INGREDIENTS; | ||
|
||
@Inject(method = "<clinit>", at = @At("TAIL")) | ||
private static void verdance$appendTamingIngredient(CallbackInfo ci) { | ||
TAMING_INGREDIENTS.add(VerdanceItems.CANTALOUPE_SEEDS); | ||
} | ||
} |
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,17 +1,19 @@ | ||
{ | ||
"required": true, | ||
"minVersion": "0.8", | ||
"package": "com.teamabode.verdance.core.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"mixins": [ | ||
"accessor.StructurePoolAccessor", | ||
"general.DecoratedPotPatternsMixin", | ||
"general.LightningEntityMixin", | ||
"general.SporeBlossomBlockMixin", | ||
"general.SugarCaneBlockMixin" | ||
], | ||
"client": [], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
"required": true, | ||
"minVersion": "0.8", | ||
"package": "com.teamabode.verdance.core.mixin", | ||
"compatibilityLevel": "JAVA_17", | ||
"mixins": [ | ||
"accessor.StructurePoolAccessor", | ||
"general.ChickenEntityMixin", | ||
"general.DecoratedPotPatternsMixin", | ||
"general.LightningEntityMixin", | ||
"general.ParrotEntityMixin", | ||
"general.SporeBlossomBlockMixin", | ||
"general.SugarCaneBlockMixin" | ||
], | ||
"client": [], | ||
"injectors": { | ||
"defaultRequire": 1 | ||
} | ||
} |