Skip to content

Commit

Permalink
Merge pull request #25 from Keriils/main
Browse files Browse the repository at this point in the history
fetch main
  • Loading branch information
Keriils authored Sep 14, 2024
2 parents 7a7254e + ef692ff commit 5ee7a5e
Show file tree
Hide file tree
Showing 11 changed files with 127 additions and 9 deletions.
3 changes: 3 additions & 0 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ dependencies {
// lunch box plus
implementation("com.github.GTNewHorizons:SpiceOfLife:2.1.12-carrot:dev")

// jabba
implementation("com.github.GTNewHorizons:Jabba:1.3.5:dev")

// debug info & nbtEdit
runtimeOnly("com.github.GTNewHorizons:ServerUtilities:2.0.66:dev")
runtimeOnly files("libs/ForgeNBTEdit.jar")
Expand Down
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....
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@
import cpw.mods.fml.common.registry.GameRegistry;

@SuppressWarnings("unused")
public class WorldLoad {
public class GetModItemWhileWorldLoad {

public static int healingAxe;
private static int healingAxe;
private static Item itemHealingAxe;

@SubscribeEvent
public void initHealingAxeIdOnWorldLoad(EntityJoinWorldEvent event) {
healingAxe = Item.getIdFromItem(GameRegistry.findItem("ExtraUtilities", "defoliageAxe"));
itemHealingAxe = GameRegistry.findItem("ExtraUtilities", "defoliageAxe");
healingAxe = Item.getIdFromItem(itemHealingAxe);
}

public static int getHealingAxeID() {
return healingAxe;
}

public static Item getItemHealingAxe() {
return itemHealingAxe;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.xir.NHUtilities.common.recipes.GTRecipes;

import static com.github.technus.tectech.thing.CustomItemList.hatch_CreativeMaintenance;
import static gregtech.api.recipe.RecipeMaps.assemblerRecipes;
import static gregtech.api.recipe.RecipeMaps.centrifugeRecipes;
import static gregtech.api.recipe.RecipeMaps.extractorRecipes;
Expand All @@ -13,6 +14,7 @@

import goodgenerator.items.MyMaterial;
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Materials;
import gregtech.api.enums.OrePrefixes;
import gregtech.api.enums.TierEU;
Expand Down Expand Up @@ -176,5 +178,13 @@ public static void registerNHUtilitiesGTRecipe() {
.duration(100 * SECOND)
.eut(TierEU.RECIPE_EV)
.addTo(extractorRecipes);

// for adding debug maintenance recipe
GT_Values.RA.stdBuilder()
.itemInputs(ItemList.Hull_EV.get(1), ItemList.Duct_Tape.get(1), GT_Utility.getIntegratedCircuit(16))
.itemOutputs(hatch_CreativeMaintenance.get(1))
.duration(25 * SECOND)
.eut(TierEU.RECIPE_HV)
.addTo(assemblerRecipes);
}
}
15 changes: 15 additions & 0 deletions src/main/java/com/xir/NHUtilities/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ public class Config {
public static boolean enableEnhancedTeleporterMKII = true;
public static boolean enableModifyEnderIoCapBankIO = true;
public static boolean enableWEToolWithExuHealingAxe = false;
public static boolean enableEnhancedExUHealingAxe = true;
public static boolean enableAccelerateEnderIoMachine = true;
public static boolean disableSuperChestOrTankDebuff = true;
public static boolean disableDollyDebuff = true;
public static boolean enableLunchBoxPlus = true;
public static String[] listeningMods = new String[] { "NHUtilities", "TwistSpaceTechnology", "boxplusplus",
"programmablehatches" };
Expand Down Expand Up @@ -166,6 +169,18 @@ static File minecraftHome() {
"enable Accelerate EnderIO Machine");
enableLunchBoxPlus = configuration
.getBoolean("enableLunchBoxPlus", CATEGORY_MIXIN_CONFIG, enableLunchBoxPlus, "enable Lunch Box Plus");
enableEnhancedExUHealingAxe = configuration.getBoolean(
"enableEnhancedExUHealingAxe",
CATEGORY_MIXIN_CONFIG,
enableEnhancedExUHealingAxe,
"enable Enhanced ExU Healing Axe");
disableSuperChestOrTankDebuff = configuration.getBoolean(
"disableSuperChestOrTankDebuff",
CATEGORY_MIXIN_CONFIG,
disableSuperChestOrTankDebuff,
"disable Super Chest Or Tank Debuff");
disableDollyDebuff = configuration
.getBoolean("disableDollyDebuff", CATEGORY_MIXIN_CONFIG, disableDollyDebuff, "disable Dolly Debuff");

}

Expand Down
11 changes: 8 additions & 3 deletions src/main/java/com/xir/NHUtilities/loader/EventLoader.java
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());
}
}
}
8 changes: 8 additions & 0 deletions src/main/java/com/xir/NHUtilities/mixins/Mixins.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.xir.NHUtilities.mixins;

import static com.xir.NHUtilities.config.Config.disableDollyDebuff;
import static com.xir.NHUtilities.config.Config.disableSuperChestOrTankDebuff;
import static com.xir.NHUtilities.config.Config.enableAccelerateEnderIoMachine;
import static com.xir.NHUtilities.config.Config.enableAccelerateGregTechMachine;
import static com.xir.NHUtilities.config.Config.enableEnhancedTeleporterMKII;
Expand Down Expand Up @@ -40,6 +42,10 @@ public enum Mixins {
"SpiceOfLife.GuiHandler_Server_Mixin", TargetMod.SpiceOfLife),
SpiceOfLife_LunchBoxGuiHandlerClient(Category.LunchBoxPlus, Side.CLIENT, Phase.LATE,
"SpiceOfLife.GuiHandler_Client_Mixin", TargetMod.SpiceOfLife),
DisableDebuff_Mixin(Category.DisableSuperTankOrChestDebuff, Side.BOTH, Phase.LATE, "GregTech.DisableDebuff_Mixin",
TargetMod.GregTech),
DisableDollyDebuff_Mixin(Category.DisableDollyDebuff, Side.BOTH, Phase.LATE, "JABBA.DisableDollyDebuff_Mixin",
TargetMod.JABBA),

;

Expand All @@ -51,6 +57,8 @@ private enum Category {
WEToolWithExuHealingAxe(enableWEToolWithExuHealingAxe),
ToAccelerateEnderIoMachine(enableAccelerateEnderIoMachine),
LunchBoxPlus(enableLunchBoxPlus),
DisableSuperTankOrChestDebuff(disableSuperChestOrTankDebuff),
DisableDollyDebuff(disableDollyDebuff),

;

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/xir/NHUtilities/mixins/TargetMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ public enum TargetMod {
EnderIO("Ender IO", "EnderIO"),
WorldEdit("WorldEdit", "worldedit"),
ExtraUtilities("Extra Utilities", "ExtraUtilities"),
SpiceOfLife("SpiceOfLife", "SpiceOfLife"),;
SpiceOfLife("SpiceOfLife", "SpiceOfLife"),
JABBA("JABBA", "JABBA"),

;

public final String modName;
public final String modId;
Expand Down
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
}
}
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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import com.sk89q.worldedit.entity.Player;
import com.sk89q.worldedit.extension.platform.PlatformManager;
import com.xir.NHUtilities.common.events.WorldLoad;
import com.xir.NHUtilities.common.events.GetModItemWhileWorldLoad;

@Mixin(value = PlatformManager.class, remap = false)
public class ModifyWEWithExU {
Expand All @@ -35,7 +35,8 @@ public class ModifyWEWithExU {
@Unique
private int NHUtilities$check(@NotNull Player instance) {
int itemInHand = instance.getItemInHand();
return itemInHand == WorldLoad.getHealingAxeID() ? NHUtilities$pManager.getConfiguration().wandItem
return itemInHand == GetModItemWhileWorldLoad.getHealingAxeID()
? NHUtilities$pManager.getConfiguration().wandItem
: itemInHand;
}

Expand Down

0 comments on commit 5ee7a5e

Please sign in to comment.