Do not lose stack information in case of server overload command termination #38
@ -28,7 +28,7 @@ import de.steamwar.sql.SteamwarUser;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.Deque;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
|
||||
@ -56,16 +56,16 @@ public class CommandPortal implements PortalHandler {
|
||||
maxId = stackIds[i-1];
|
||||
}
|
||||
|
||||
Deque<Portal> stack = Portals.getStack(player);
|
||||
Iterator<Portal> stack = Portals.getStack(player).iterator();
|
||||
String[] pieces = new String[stackIds.length];
|
||||
while (maxId > 0) {
|
||||
if(stack.isEmpty()) {
|
||||
if(!stack.hasNext()) {
|
||||
LobbySystem.getPlugin().getLogger().log(Level.WARNING, "Stackportal with missing elements: " + player.getName() + " /" + command);
|
||||
player.sendMessage("§cEigentlich solltest du gerade gar nicht durch dieses Portal durchgehen können...");
|
||||
return;
|
||||
}
|
||||
|
||||
Portal portal = stack.pop();
|
||||
Portal portal = stack.next();
|
||||
if(portal.type() == PortalType.STACK) {
|
||||
for(int i = 0; i < stackIds.length; i++) {
|
||||
if(stackIds[i] == maxId) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren