Skip to content

Commit b7d7563

Browse files
committed
soulbound tags
1 parent fb1063e commit b7d7563

7 files changed

Lines changed: 49 additions & 2 deletions

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ loom.platform = forge
44
org.gradle.vfs.watch=true
55

66
# Mod properties
7-
mod_version = 1.11-pre2
7+
mod_version = 1.11-pre3
88
maven_group = cc.cassian.raspberry
99
archives_name = raspberry_core
1010

src/main/java/cc/cassian/raspberry/mixin/RaspberryMixinPlugin.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ else if (checkMixin("architects_palette", mixinClassName)){
3434
else if (checkMixin("aquaculture", mixinClassName)){
3535
return false;
3636
}
37+
else if (checkMixin("buzzier_bees", mixinClassName)){
38+
return false;
39+
}
3740
else if (checkMixin("brewinandchewin", mixinClassName)){
3841
return false;
3942
}
@@ -64,6 +67,9 @@ else if (checkMixin("dynamiccrosshair", mixinClassName)){
6467
else if (checkMixin("endergetic", mixinClassName)){
6568
return false;
6669
}
70+
else if (checkMixin("ensorcellation", mixinClassName)){
71+
return false;
72+
}
6773
else if (checkMixin("emi", mixinClassName)){
6874
return false;
6975
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package cc.cassian.raspberry.mixin.ensorcellation;
2+
3+
import cc.cassian.raspberry.registry.RaspberryTags;
4+
import cofh.ensorcellation.enchantment.SoulboundEnchantment;
5+
import cofh.lib.enchantment.EnchantmentCoFH;
6+
import net.minecraft.world.item.ItemStack;
7+
import net.minecraft.world.item.enchantment.Enchantment;
8+
import net.minecraft.world.item.enchantment.EnchantmentCategory;
9+
import org.spongepowered.asm.mixin.Mixin;
10+
import org.spongepowered.asm.mixin.injection.At;
11+
import org.spongepowered.asm.mixin.injection.Inject;
12+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
13+
14+
@Mixin(EnchantmentCoFH.class)
15+
public class SoulboundEnchantmentMixin {
16+
@Inject(method = "canApplyAtEnchantingTable", remap = false, at = @At(value = "HEAD"), cancellable = true)
17+
private void mixin(ItemStack stack, CallbackInfoReturnable<Boolean> cir) {
18+
var enchantment = (EnchantmentCoFH) (Object) this;
19+
if (enchantment instanceof SoulboundEnchantment && stack.is(RaspberryTags.ENCHANTABLE_SOULBOUND))
20+
cir.setReturnValue(true);
21+
}
22+
}

src/main/java/cc/cassian/raspberry/mixin/ensorcellation/SoulboundEventsMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
public class SoulboundEventsMixin {
1212
@Inject(
1313
method = "handlePlayerCloneEvent", remap = false, at = @At(value = "HEAD"), cancellable = true)
14-
private static void raspberry$disableCuring(PlayerEvent.Clone event, CallbackInfo ci) {
14+
private static void raspberry$disableDuping(PlayerEvent.Clone event, CallbackInfo ci) {
1515
ci.cancel();
1616
}
1717
}

src/main/java/cc/cassian/raspberry/registry/RaspberryTags.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public class RaspberryTags {
1717

1818
public static final TagKey<Item> ENCHANTABLE_WEAPON = createItemTag("enchantable/weapon");
1919
public static final TagKey<Item> ENCHANTABLE_HEARTFELT = createItemTag("enchantable/heartfelt");
20+
public static final TagKey<Item> ENCHANTABLE_SOULBOUND = createItemTag("enchantable/soulbound");
2021

2122
public static final TagKey<Item> COPPER_ARMOR = createItemTag("copper_armor");
2223

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"values": [
3+
"#forge:armors",
4+
"#forge:tools",
5+
"minecraft:elytra",
6+
"minecraft:shield",
7+
"minecraft:bow",
8+
"minecraft:crossbow",
9+
"minecraft:trident",
10+
"minecraft:flint_and_steel",
11+
"minecraft:shears",
12+
"minecraft:brush",
13+
"minecraft:fishing_rod",
14+
"minecraft:carrot_on_a_stick",
15+
"minecraft:warped_fungus_on_a_stick"
16+
]
17+
}

src/main/resources/raspberry.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"emi.EmiRecipesMixin",
6565
"endergetic.EnderWallTorchMixin",
6666
"endermanoverhaul.ReplacedEndermanMixin",
67+
"ensorcellation.SoulboundEnchantmentMixin",
6768
"ensorcellation.SoulboundEventsMixin",
6869
"environmental.AbstractSkeletonMixin",
6970
"environmental.ArmorItemMixin",

0 commit comments

Comments
 (0)