-
Notifications
You must be signed in to change notification settings - Fork 1
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 #5 from peyang-Celeron/master
Copy mode added.
- Loading branch information
Showing
4 changed files
with
85 additions
and
7 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
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package ml.peya.mc.commands; | ||
|
||
import ml.peya.mc.*; | ||
import net.minecraft.client.*; | ||
import net.minecraft.command.*; | ||
import net.minecraft.util.*; | ||
|
||
import java.awt.*; | ||
import java.awt.datatransfer.*; | ||
import java.lang.reflect.*; | ||
import java.util.*; | ||
import java.util.regex.*; | ||
|
||
public class PeyangDraftCopyUrl extends CommandBase | ||
{ | ||
@Override | ||
public String getCommandName() | ||
{ | ||
return "zzzpeyangdraftcopysandopenurl"; | ||
} | ||
|
||
@Override | ||
public String getCommandUsage(ICommandSender iCommandSender) | ||
{ | ||
return "zzzpeyangdraftcopysandopenurl <json>"; | ||
} | ||
|
||
@Override | ||
public void processCommand(ICommandSender sender, String[] args) throws CommandException | ||
{ | ||
if (args.length == 0) | ||
return; | ||
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); | ||
StringBuilder json = new StringBuilder(); | ||
for(String value: args) | ||
json.append(value); | ||
StringSelection val = new StringSelection(json.toString()); | ||
clipboard.setContents(val, val); | ||
Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(PeyangRawChatViewer.getRawPrefix() + " " + EnumChatFormatting.GREEN + "Copied!")); | ||
} | ||
|
||
@Override | ||
public int getRequiredPermissionLevel() | ||
{ | ||
return 0; | ||
} | ||
|
||
|
||
} |
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