-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
because i wont be able to work on this for a few days
- Loading branch information
1 parent
fbb58d9
commit 21107d3
Showing
10 changed files
with
75 additions
and
17 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
.../cammiescorner/arcanuscontinuum/common/enchantments/EffectTypeProficiencyEnchantment.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,18 @@ | ||
package dev.cammiescorner.arcanuscontinuum.common.enchantments; | ||
|
||
import dev.cammiescorner.arcanuscontinuum.common.registry.ArcanusTags; | ||
import net.minecraft.enchantment.Enchantment; | ||
import net.minecraft.enchantment.EnchantmentTarget; | ||
import net.minecraft.entity.EquipmentSlot; | ||
import net.minecraft.item.ItemStack; | ||
|
||
public class EffectTypeProficiencyEnchantment extends Enchantment { | ||
public EffectTypeProficiencyEnchantment(Rarity weight, EquipmentSlot[] slotTypes) { | ||
super(weight, EnchantmentTarget.TRIDENT, slotTypes); | ||
} | ||
|
||
@Override | ||
public boolean isAcceptableItem(ItemStack stack) { | ||
return stack.isIn(ArcanusTags.STAVES); | ||
} | ||
} |
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
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
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
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
31 changes: 31 additions & 0 deletions
31
src/main/java/dev/cammiescorner/arcanuscontinuum/mixin/common/EnchantmentHelperMixin.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 dev.cammiescorner.arcanuscontinuum.mixin.common; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyExpressionValue; | ||
import com.llamalad7.mixinextras.sugar.Local; | ||
import com.llamalad7.mixinextras.sugar.Share; | ||
import com.llamalad7.mixinextras.sugar.ref.LocalRef; | ||
import net.minecraft.enchantment.Enchantment; | ||
import net.minecraft.enchantment.EnchantmentHelper; | ||
import net.minecraft.enchantment.EnchantmentLevelEntry; | ||
import net.minecraft.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
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.List; | ||
|
||
@Mixin(EnchantmentHelper.class) | ||
public class EnchantmentHelperMixin { | ||
@Inject(method = "getPossibleEntries", at = @At("HEAD")) | ||
private static void arcanuscontinuum$captureStack(int power, ItemStack stack, boolean treasureAllowed, CallbackInfoReturnable<List<EnchantmentLevelEntry>> info, @Share("stack") LocalRef<ItemStack> ref) { | ||
ref.set(stack); | ||
} | ||
|
||
@ModifyExpressionValue(method = "getPossibleEntries", at = @At(value = "INVOKE", | ||
target = "Lnet/minecraft/enchantment/EnchantmentTarget;isAcceptableItem(Lnet/minecraft/item/Item;)Z" | ||
)) | ||
private static boolean arcanuscontinuum$patchEnchantStuff(boolean original, @Local(ordinal = 0) Enchantment enchantment, @Share("stack") LocalRef<ItemStack> ref) { | ||
return enchantment.isAcceptableItem(ref.get()); | ||
} | ||
} |
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