Created
October 2, 2016 07:42
-
-
Save inklit/c208a36bd5901d56db13ec9b0add94a1 to your computer and use it in GitHub Desktop.
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
package me.acul.me; | |
import org.apache.commons.lang3.ArrayUtils; | |
import org.spongepowered.api.event.Listener; | |
import org.spongepowered.api.event.network.ClientConnectionEvent; | |
import org.spongepowered.api.plugin.Plugin; | |
import org.spongepowered.api.text.Text; | |
import java.util.Arrays; | |
/** | |
* Created by Luca on 02.10.16. | |
*/ | |
@Plugin(id = "logdupepatch", name = "LogDupePatch", version = "1.0") | |
public class main { | |
String[] players = {}; | |
@Listener | |
public void PlayerJoin(ClientConnectionEvent.Join evt) { | |
String uuid = evt.getTargetEntity().getUniqueId().toString(); | |
if (Arrays.asList(players).contains(uuid)){ | |
evt.getTargetEntity().kick(Text.of("You are already logged in!")); | |
} else { | |
players = ArrayUtils.add(players, uuid); | |
} | |
} | |
@Listener | |
public void PlayerLeave(ClientConnectionEvent.Disconnect evt) { | |
players = ArrayUtils.removeElement(players, evt.getTargetEntity().getUniqueId().toString()); | |
} | |
} |
Let me test the update and I will then upload it to my site for distribution. Thanks @Luca0208!
EDIT: Tested and it works. Here's the updated jar. http://switchcraft.pw/logdupepatch-2.0-snapshot.jar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks I applied the changes(I made the plugin for inklit)