diff options
| author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-08-18 18:03:04 +1000 |
|---|---|---|
| committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2018-08-18 18:03:04 +1000 |
| commit | 5a5552cde7c60d2cdbbdf009aef9888f4a3e08f9 (patch) | |
| tree | 7cd230304edd93a0a7121c9b87e6281c10dec980 /src/Java/gtPlusPlus/xmod/thaumcraft/commands | |
| parent | ae6844407be97824e2db9355fdcf04608592a7a9 (diff) | |
| download | GT5-Unofficial-5a5552cde7c60d2cdbbdf009aef9888f4a3e08f9.tar.gz GT5-Unofficial-5a5552cde7c60d2cdbbdf009aef9888f4a3e08f9.tar.bz2 GT5-Unofficial-5a5552cde7c60d2cdbbdf009aef9888f4a3e08f9.zip | |
+ Added Forming Press mode to the Large Bending Machine. Closes #347.
+ Added a command to dump TC aspect information from all Items & Blocks. Use /DA or /DumpAspects to begin the process.
$ Fixed PSS not accepting any tier Hatches. Closes #354, also fixes https://github.com/GTNewHorizons/NewHorizons/issues/3470.
$ Fixed Hand-Pumps duping things, because other modders can't follow guidelines. Closes #353.
$ Fixed a rare bug involving Hand-Pumps & EU items having getDisplayName() called on them.
$ Fixed an issue where some Multiblocks had a bad GUI.
$ Removed TC libs from my custom Railcraft build.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/thaumcraft/commands')
| -rw-r--r-- | src/Java/gtPlusPlus/xmod/thaumcraft/commands/CommandDumpAspects.java | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/xmod/thaumcraft/commands/CommandDumpAspects.java b/src/Java/gtPlusPlus/xmod/thaumcraft/commands/CommandDumpAspects.java new file mode 100644 index 0000000000..dda5a62b27 --- /dev/null +++ b/src/Java/gtPlusPlus/xmod/thaumcraft/commands/CommandDumpAspects.java @@ -0,0 +1,90 @@ +package gtPlusPlus.xmod.thaumcraft.commands; + +import static gtPlusPlus.core.util.minecraft.PlayerUtils.messagePlayer; + +import java.util.ArrayList; +import java.util.List; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.commands.CommandUtils; +import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.xmod.thaumcraft.objects.ThreadAspectScanner; +import net.minecraft.command.ICommand; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; + +public class CommandDumpAspects implements ICommand { + private final List<String> aliases; + public static long mLastScanTime = System.currentTimeMillis(); + + public CommandDumpAspects() { + this.aliases = new ArrayList<>(); + this.aliases.add("DA"); + this.aliases.add("da"); + this.aliases.add("dumpaspects"); + this.aliases.add("dumptc"); + Logger.INFO("Registered Aspect Dump Command."); + } + + @Override + public int compareTo(final Object o) { + return 0; + } + + @Override + public String getCommandName() { + return "DumpAspects"; + } + + @Override + public String getCommandUsage(final ICommandSender var1) { + return "/DumpAspects"; + } + + @Override + public List<String> getCommandAliases() { + return this.aliases; + } + + @Override + public void processCommand(final ICommandSender S, final String[] argString) { + final EntityPlayer P = CommandUtils.getPlayer(S); + final long T = System.currentTimeMillis(); + final long D = T - mLastScanTime; + final int Z = (int) (D / 1000); + if (Z >= 30) { + // Lets process this in the Background on a new Thread. + Thread t = createNewThread(); + messagePlayer(P, "Beginning to dump information about all items/blocks & their aspects to file."); + messagePlayer(P, "Please do not close your game during this process, you will be notified upon completion."); + t.start(); + } else { + messagePlayer(P, "Your last run of DA was less than 30 seconds ago, please wait " + (30 - Z) + + " seconds before trying again."); + } + } + + @Override + public boolean canCommandSenderUseCommand(final ICommandSender var1) { + final EntityPlayer P = CommandUtils.getPlayer(var1); + if (P == null || !PlayerUtils.isPlayerOP(P)) { + return false; + } + return true; + } + + @Override + public List<?> addTabCompletionOptions(final ICommandSender var1, final String[] var2) { + return null; + } + + @Override + public boolean isUsernameIndex(final String[] var1, final int var2) { + return false; + } + + private static Thread createNewThread() { + return new ThreadAspectScanner(); + } + +}
\ No newline at end of file |
