- Added 1.7.10 Buildcraft support

- Exceptions can now log to the minetweaker log, for easier bug resolution
- /mt hand now copies to the clipboard too
- /mt hand now outputs ore dictionary entries to which it belongs
- Reducing verbosity a bit
This commit is contained in:
Stan Hebben committed 2014-10-08 14:50:50 +02:00
1 parent 86a3568e9e
commit a8aae17d8a
29 files changed
+1289 -24

No files matched your search

@@ -1,5 +1,8 @@
package minetweaker;
import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.StringSelection;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
@@ -124,7 +127,7 @@ public class MineTweakerImplementationAPI {
MineTweakerAPI.logCommand("Liquids:");
for (ILiquidDefinition liquid : liquids) {
MineTweakerAPI.logCommand("<" + liquid.getName() + "> -- " + liquid.getDisplayName());
MineTweakerAPI.logCommand("<liquid:" + liquid.getName() + "> -- " + liquid.getDisplayName());
}
if (player != null) {
@@ -204,7 +207,14 @@ public class MineTweakerImplementationAPI {
public void execute(String[] arguments, IPlayer player) {
IItemStack hand = player.getCurrentItem();
if (hand != null) {
player.sendChat(hand.toString());
String value = hand.toString();
player.sendChat(value);
copyToClipboard(value);
List<IOreDictEntry> entries = hand.getOres();
for (IOreDictEntry entry : entries) {
player.sendChat("Is in <ore:" + entry.getName() + ">");
}
}
}
}));
@@ -576,6 +586,16 @@ public class MineTweakerImplementationAPI {
MineTweakerAPI.apply(new AddMineTweakerCommandAction(new MineTweakerCommand(name, description, function)));
}
// ##############################
// ### Private static methods ###
// ##############################
private static void copyToClipboard(String value) {
StringSelection stringSelection = new StringSelection(value);
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(stringSelection, null);
}
// ############################
// ### Public inner classes ###
// ############################