-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Required mod FTBLib and ThermalExpansion satchel
- Loading branch information
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/main/java/forgefuck/team/xenobyte/modules/FTBSatchelDupe.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,42 @@ | ||
package forgefuck.team.xenobyte.modules; | ||
|
||
import cpw.mods.fml.common.Loader; | ||
import forgefuck.team.xenobyte.api.module.Category; | ||
import forgefuck.team.xenobyte.api.module.CheatModule; | ||
import forgefuck.team.xenobyte.api.module.PerformMode; | ||
import forgefuck.team.xenobyte.api.module.PerformSource; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.nbt.NBTTagCompound; | ||
|
||
public class FTBSatchelDupe extends CheatModule{ | ||
|
||
public FTBSatchelDupe() { | ||
super("FTBSatchelDupe", Category.MODS, PerformMode.SINGLE); | ||
} | ||
|
||
@Override public void onPerform(PerformSource src) { | ||
try { | ||
if (Class.forName("cofh.thermalexpansion.gui.container.ContainerSatchel").isInstance(utils.player().openContainer)) { | ||
Class.forName("ftb.lib.api.net.MessageLM").getMethod("sendToServer").invoke(Class.forName("ftb.lib.mod.net.MessageClientItemAction").getConstructor(String.class, NBTTagCompound.class).newInstance("", new NBTTagCompound())); | ||
int dropCount = (int) Class.forName("cofh.thermalexpansion.item.ItemSatchel").getMethod("getStorageIndex", ItemStack.class).invoke(null, utils.item()); | ||
for(int slot = utils.mySlotsCount(); slot < utils.mySlotsCount() + dropCount * 9; slot++) { | ||
utils.dropSlot(slot, true); | ||
} | ||
utils.player().closeScreen(); | ||
} | ||
} catch (Exception e) {} | ||
} | ||
|
||
@Override public boolean inGuiPerform() { | ||
return true; | ||
} | ||
|
||
@Override public boolean isWorking() { | ||
return Loader.isModLoaded("ThermalExpansion") && Loader.isModLoaded("FTBL"); | ||
} | ||
|
||
@Override public String moduleDesc() { | ||
return lang.get("Open any ThermalExpansion bag with Items and press keybind of function", "Открыть любую сумку из ThermalExpansion с вещами и нажать кейбинд функции"); | ||
} | ||
|
||
} |