Skip to content

Commit

Permalink
Merge pull request #418 from WaitingIdly/plague-cloud-disabling
Browse files Browse the repository at this point in the history
Adds config to disable AbyssalCraft plague potion clouds
  • Loading branch information
ACGaming authored Apr 5, 2024
2 parents b9c5193 + c4785bc commit 7ca6614
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ All changes are toggleable via config files.

* **AbyssalCraft**
* **Optimized Item Transport:** Optimizes AbyssalCraft's item transport system to reduce tick overhead
* **Disable Plague Potion Clouds:** Disables AbyssalCraft's Plague-type mobs spawning lingering potion effects on death
* **Actually Additions**
* **Duplication Fixes:** Fixes various duplication exploits
* **Advent of Ascension**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ public static class AbyssalCraftCategory
@Config.Name("Optimized Item Transport")
@Config.Comment("Optimizes AbyssalCraft's item transport system to reduce tick overhead")
public boolean utOptimizedItemTransferToggle = true;

@Config.Name("Disable Plague Potion Clouds")
@Config.Comment("Disables AbyssalCraft's Plague-type mobs spawning lingering potion effects on death")
public boolean utDisablePlaguePotionClouds = false;
}

public static class ActuallyAdditionsCategory
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package mod.acgaming.universaltweaks.mods.abyssalcraft.mixin;

import com.shinoow.abyssalcraft.common.handlers.PlagueEventHandler;
import mod.acgaming.universaltweaks.config.UTConfigMods;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
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.CallbackInfo;

// Courtesy of WaitingIdly
@Mixin(value = PlagueEventHandler.class, remap = false)
public class UTPlagueEventHandlerMixin
{
@Inject(method = "onDeath", at = @At(value = "HEAD"), cancellable = true)
private void utOnDeath(LivingDeathEvent event, CallbackInfo ci)
{
if (!UTConfigMods.ABYSSALCRAFT.utDisablePlaguePotionClouds) return;
ci.cancel();
}
}
2 changes: 1 addition & 1 deletion src/main/resources/mixins.mods.abyssalcraft.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"mixins": ["UTItemConfiguratorMixin", "UTItemTransferEventHandlerMixin"]
"mixins": ["UTItemConfiguratorMixin", "UTItemTransferEventHandlerMixin", "UTPlagueEventHandlerMixin"]
}

0 comments on commit 7ca6614

Please sign in to comment.