Ursprung
ccdfb40d71
Commit
c664e08fa6
@ -26,9 +26,9 @@ import de.steamwar.schematicsystem.commands.schematiccommand.SchematicCommand;
|
||||
import de.steamwar.sql.SchematicData;
|
||||
import de.steamwar.sql.SchematicNode;
|
||||
import de.steamwar.sql.SteamwarUser;
|
||||
import lombok.SneakyThrows;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@ -40,17 +40,24 @@ public class AprilPart extends SWCommand {
|
||||
super(null);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
@Register("prompt")
|
||||
public void prompt(Player player, String... prompt) {
|
||||
SteamwarUser user = SteamwarUser.get(player.getName());
|
||||
String message = String.join(" ", prompt);
|
||||
SchematicSystem.MESSAGE.send("AI_START", player, message);
|
||||
try {
|
||||
Thread.sleep(random.nextInt(3000));
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
int randomInt = random.nextInt(100);
|
||||
if (randomInt < 33) {
|
||||
List<SchematicNode> nodes = SchematicNode.getAll(user);
|
||||
try {
|
||||
new SchematicData(nodes.get(random.nextInt(nodes.size()))).loadToPlayer(player);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
SchematicSystem.MESSAGE.send("AI_FINISH", player);
|
||||
} else if (randomInt < 66) {
|
||||
SchematicSystem.MESSAGE.send("AI_NO_STEAMIES", player);
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren