-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from Keriils/main
fetch main
- Loading branch information
Showing
11 changed files
with
127 additions
and
9 deletions.
There are no files selected for viewing
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
21 changes: 21 additions & 0 deletions
21
src/main/java/com/xir/NHUtilities/common/events/EnhanceExUHealingAxe.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,21 @@ | ||
package com.xir.NHUtilities.common.events; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraftforge.event.entity.player.PlayerEvent; | ||
|
||
import cpw.mods.fml.common.eventhandler.SubscribeEvent; | ||
|
||
@SuppressWarnings("unused") | ||
public class EnhanceExUHealingAxe { | ||
|
||
@SubscribeEvent | ||
public void onHeldHealingAxe(PlayerEvent event) { | ||
EntityPlayer entityPlayer = event.entityPlayer; | ||
if (entityPlayer.worldObj.getTotalWorldTime() % 40L == 0L && entityPlayer.getHeldItem() != null | ||
&& (entityPlayer.getHeldItem() | ||
.getItem() == GetModItemWhileWorldLoad.getItemHealingAxe())) { | ||
entityPlayer.getFoodStats() | ||
.addStats(20, 5.0F); // ha.... | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,26 @@ | ||
package com.xir.NHUtilities.loader; | ||
|
||
import static com.xir.NHUtilities.config.Config.enableEnhancedExUHealingAxe; | ||
import static com.xir.NHUtilities.config.Config.enableGluttonyRingAndHungerRing; | ||
import static com.xir.NHUtilities.config.Config.enableWEToolWithExuHealingAxe; | ||
|
||
import net.minecraftforge.common.MinecraftForge; | ||
|
||
import com.xir.NHUtilities.common.events.EnhanceExUHealingAxe; | ||
import com.xir.NHUtilities.common.events.GetModItemWhileWorldLoad; | ||
import com.xir.NHUtilities.common.events.GluttonyRingEvent; | ||
import com.xir.NHUtilities.common.events.WorldLoad; | ||
|
||
public class EventLoader { | ||
|
||
public static void registerNHUtilitiesEvents() { | ||
if (enableGluttonyRingAndHungerRing) { | ||
MinecraftForge.EVENT_BUS.register(new GluttonyRingEvent()); | ||
} | ||
if (enableWEToolWithExuHealingAxe) { | ||
MinecraftForge.EVENT_BUS.register(new WorldLoad()); | ||
if (enableWEToolWithExuHealingAxe || enableEnhancedExUHealingAxe) { | ||
MinecraftForge.EVENT_BUS.register(new GetModItemWhileWorldLoad()); | ||
} | ||
if (enableEnhancedExUHealingAxe) { | ||
MinecraftForge.EVENT_BUS.register(new EnhanceExUHealingAxe()); | ||
} | ||
} | ||
} |
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
23 changes: 23 additions & 0 deletions
23
src/main/java/com/xir/NHUtilities/mixins/late/GregTech/DisableDebuff_Mixin.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,23 @@ | ||
package com.xir.NHUtilities.mixins.late.GregTech; | ||
|
||
import net.minecraft.entity.EntityLivingBase; | ||
import net.minecraft.potion.PotionEffect; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import gregtech.common.blocks.GT_Item_Machines; | ||
|
||
@Mixin(value = GT_Item_Machines.class, remap = false) | ||
public class DisableDebuff_Mixin { | ||
|
||
@Redirect( | ||
method = "onUpdate", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/entity/EntityLivingBase;addPotionEffect(Lnet/minecraft/potion/PotionEffect;)V")) | ||
private void NHUtilities$disableDebuff(EntityLivingBase instance, PotionEffect p_70690_1_) { | ||
// nothing | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/xir/NHUtilities/mixins/late/JABBA/DisableDollyDebuff_Mixin.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,23 @@ | ||
package com.xir.NHUtilities.mixins.late.JABBA; | ||
|
||
import net.minecraft.entity.player.EntityPlayer; | ||
import net.minecraft.potion.PotionEffect; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import mcp.mobius.betterbarrels.common.items.dolly.ItemBarrelMover; | ||
|
||
@Mixin(value = ItemBarrelMover.class, remap = false) | ||
public class DisableDollyDebuff_Mixin { | ||
|
||
@Redirect( | ||
method = "onUpdate", | ||
at = @At( | ||
value = "INVOKE", | ||
target = "Lnet/minecraft/entity/player/EntityPlayer;addPotionEffect(Lnet/minecraft/potion/PotionEffect;)V")) | ||
private void NHUtilities$disableDebuff(EntityPlayer instance, PotionEffect potionEffect) { | ||
// nothing | ||
} | ||
} |
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