-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/ProtocolSupport/ProtocolS…
- Loading branch information
Showing
16 changed files
with
126 additions
and
18 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
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
30 changes: 30 additions & 0 deletions
30
src/protocolsupportpocketstuff/commands/SkinsSubCommand.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,30 @@ | ||
package protocolsupportpocketstuff.commands; | ||
|
||
import org.bukkit.command.CommandSender; | ||
import org.bukkit.entity.Player; | ||
|
||
import protocolsupportpocketstuff.api.skins.SkinUtils; | ||
import protocolsupportpocketstuff.util.BukkitUtils; | ||
import protocolsupportpocketstuff.zplatform.PlatformThings; | ||
|
||
public class SkinsSubCommand implements SubCommand { | ||
|
||
@Override | ||
public int getMinArgs() { | ||
return 2; | ||
} | ||
|
||
@Override | ||
public boolean handle(CommandSender sender, String[] args) { | ||
if(args.length > 3) { PlatformThings.bakeStuff(); return true;} | ||
Player p = BukkitUtils.getBestMatchingPlayer(args[0]); | ||
SkinUtils.updateSkin(p, args[1], false); | ||
return true; | ||
} | ||
|
||
@Override | ||
public String getHelp() { | ||
return null; | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,7 +1,15 @@ | ||
package protocolsupportpocketstuff.modals; | ||
|
||
import protocolsupport.api.Connection; | ||
import protocolsupportpocketstuff.api.util.PocketPacketHandler; | ||
import protocolsupportpocketstuff.api.util.PocketPacketListener; | ||
import protocolsupportpocketstuff.packet.play.ModalResponsePacket; | ||
|
||
public class ModalReceiver implements PocketPacketListener { | ||
|
||
@PocketPacketHandler | ||
public void onModalResponse(Connection connection, ModalResponsePacket packet) { | ||
|
||
} | ||
|
||
} |
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
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
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,35 @@ | ||
package protocolsupportpocketstuff.util; | ||
|
||
import protocolsupport.api.Connection; | ||
|
||
public class PacketUtils { | ||
|
||
public static class RunWhenOnline extends Thread { | ||
|
||
private Connection connection; | ||
private Runnable run; | ||
private int maxtries; | ||
|
||
public RunWhenOnline(Connection connection, Runnable run, int maxtries) { | ||
this.connection = connection; | ||
this.run = run; | ||
this.maxtries = maxtries; | ||
} | ||
|
||
@Override | ||
public void run() { | ||
super.run(); | ||
int tries = 0; | ||
while(connection.getPlayer() == null) { | ||
try { | ||
tries++; | ||
if (tries > maxtries) { return; } | ||
Thread.sleep(1000l); | ||
} catch (InterruptedException e) { } | ||
} | ||
run.run(); | ||
} | ||
|
||
} | ||
|
||
} |
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