diff --git a/README.md b/README.md index b9bad871..264e06b6 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,7 @@ All changes are toggleable via the config file. * **Duplication Fixes:** Fixes various duplication exploits * **Infernal Mobs** * **Sticky Recall Compatibility:** Enables compatibility between Infernal Mobs' Sticky effect and Capsule's Recall enchantment + * **Sticky Pedestal Compatibility:** Enables compatibility between Infernal Mobs' Sticky effect and Reliquary's Pedestal * **Iron Backpacks** * **Duplication Fixes:** Fixes various duplication exploits * **Item Stages** diff --git a/src/main/java/mod/acgaming/universaltweaks/config/UTConfig.java b/src/main/java/mod/acgaming/universaltweaks/config/UTConfig.java index 9671c523..09c1d0a1 100644 --- a/src/main/java/mod/acgaming/universaltweaks/config/UTConfig.java +++ b/src/main/java/mod/acgaming/universaltweaks/config/UTConfig.java @@ -2294,6 +2294,11 @@ public static class InfernalMobsCategory @Config.Name("Sticky Recall Compatibility") @Config.Comment("Enables compatibility between Infernal Mobs' Sticky effect and Capsule's Recall enchantment") public boolean utIMStickyRecallToggle = true; + + @Config.RequiresMcRestart + @Config.Name("Sticky Pedestal Compatibility") + @Config.Comment("Enables compatibility between Infernal Mobs' Sticky effect and Reliquary's Pedestal") + public boolean utIMStickyPedestalToggle = true; } public static class IronBackpacksCategory diff --git a/src/main/java/mod/acgaming/universaltweaks/mods/infernalmobs/mixin/UTInfernalMobsStickyMixin.java b/src/main/java/mod/acgaming/universaltweaks/mods/infernalmobs/mixin/UTInfernalMobsStickyMixin.java index 205cf2c7..7abb86be 100644 --- a/src/main/java/mod/acgaming/universaltweaks/mods/infernalmobs/mixin/UTInfernalMobsStickyMixin.java +++ b/src/main/java/mod/acgaming/universaltweaks/mods/infernalmobs/mixin/UTInfernalMobsStickyMixin.java @@ -2,7 +2,10 @@ import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; import atomicstryker.infernalmobs.common.mods.MM_Sticky; import mod.acgaming.universaltweaks.UniversalTweaks; @@ -15,7 +18,7 @@ public class UTInfernalMobsStickyMixin { @Redirect(method = "onHurt", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/item/EntityItem;setPickupDelay(I)V")) - public void utInfernalMobsSticky(EntityItem entityItem, int ticks) + public void utInfernalMobsStickyRecall(EntityItem entityItem, int ticks) { if (!UTConfig.MOD_INTEGRATION.INFERNAL_MOBS.utIMStickyRecallToggle) entityItem.setPickupDelay(ticks); if (UTConfig.DEBUG.utDebugToggle) UniversalTweaks.LOGGER.debug("UTInfernalMobsSticky ::: Set pickup delay"); @@ -23,4 +26,15 @@ public void utInfernalMobsSticky(EntityItem entityItem, int ticks) if (recall != null && EnchantmentHelper.getEnchantmentLevel(recall, entityItem.getItem()) > 0) entityItem.setNoPickupDelay(); else entityItem.setPickupDelay(ticks); } + + @Redirect(method = "onHurt", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/DamageSource;getTrueSource()Lnet/minecraft/entity/Entity;", ordinal = 0)) + public Entity utInfernalMobsStickyPedestal(DamageSource source) + { + if (UTConfig.MOD_INTEGRATION.INFERNAL_MOBS.utIMStickyPedestalToggle) + { + if (UTConfig.DEBUG.utDebugToggle) UniversalTweaks.LOGGER.debug("UTInfernalMobsSticky ::: Get true source"); + if (source.getTrueSource() instanceof EntityPlayer && ((EntityPlayer) source.getTrueSource()).getName().equals("reliquary_pedestal_fake_player")) return null; + } + return source.getTrueSource(); + } } \ No newline at end of file