Merge branch 'master' into fight-replays
Dieser Commit ist enthalten in:
Commit
8c62f97980
@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
package de.steamwar.command;
|
package de.steamwar.command;
|
||||||
|
|
||||||
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
@ -69,6 +70,7 @@ public class SWCommandUtils {
|
|||||||
if (s.equals("a") || s.equals("adventure") || s.equals("2")) return GameMode.ADVENTURE;
|
if (s.equals("a") || s.equals("adventure") || s.equals("2")) return GameMode.ADVENTURE;
|
||||||
return null;
|
return null;
|
||||||
}, s -> Arrays.asList("s", "survival", "0", "c", "creative", "1", "sp", "spectator", "3", "a", "adventure", "2")));
|
}, s -> Arrays.asList("s", "survival", "0", "c", "creative", "1", "sp", "spectator", "3", "a", "adventure", "2")));
|
||||||
|
MAPPER_FUNCTIONS.put(SteamwarUser.class.getTypeName(), createMapper(SteamwarUser::get, s -> Bukkit.getOnlinePlayers().stream().map(Player::getName).collect(Collectors.toList())));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addMapper(Class<?> clazz, Class<?> alternativeClazz, TypeMapper<?> mapper) {
|
private static void addMapper(Class<?> clazz, Class<?> alternativeClazz, TypeMapper<?> mapper) {
|
||||||
|
@ -29,7 +29,8 @@ public interface TypeMapper<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For backwards compatibility, can be removed later on
|
// For backwards compatibility, can be removed later on
|
||||||
@Deprecated(since = "Use the other map Function without calling super!")
|
// SINCE="Use the other map Function without calling super!"
|
||||||
|
@Deprecated
|
||||||
default T map(String[] previousArguments, String s) {
|
default T map(String[] previousArguments, String s) {
|
||||||
throw new SecurityException();
|
throw new SecurityException();
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,7 @@ public class BungeeReceiver implements PluginMessageListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
registerHandler(PacketIdManager.BAUMEMBER_UPDATE, byteArrayDataInput -> BauweltMember.clear());
|
||||||
registerHandler(PacketIdManager.INVENTORY_PACKET, new InventoryHandler());
|
registerHandler(PacketIdManager.INVENTORY_PACKET, new InventoryHandler());
|
||||||
registerHandler(PacketIdManager.INVENTORY_CLOSE_PACKET, byteArrayDataInput -> {
|
registerHandler(PacketIdManager.INVENTORY_CLOSE_PACKET, byteArrayDataInput -> {
|
||||||
Player player = Bukkit.getPlayer(SteamwarUser.get(byteArrayDataInput.readInt()).getUUID());
|
Player player = Bukkit.getPlayer(SteamwarUser.get(byteArrayDataInput.readInt()).getUUID());
|
||||||
|
@ -25,6 +25,7 @@ public class PacketIdManager {
|
|||||||
public final static byte PING_PACKET = 0x01;
|
public final static byte PING_PACKET = 0x01;
|
||||||
public final static byte TABLIST_NAME = 0x02;
|
public final static byte TABLIST_NAME = 0x02;
|
||||||
public static final byte PREPARE_SCHEM = 0x03;
|
public static final byte PREPARE_SCHEM = 0x03;
|
||||||
|
public final static byte BAUMEMBER_UPDATE = 0x04;
|
||||||
//0x1(X) Bungee Inventory
|
//0x1(X) Bungee Inventory
|
||||||
public final static byte INVENTORY_PACKET = 0x10;
|
public final static byte INVENTORY_PACKET = 0x10;
|
||||||
public final static byte INVENTORY_CALLBACK_PACKET = 0x11;
|
public final static byte INVENTORY_CALLBACK_PACKET = 0x11;
|
||||||
|
@ -34,6 +34,10 @@ public class BauweltMember{
|
|||||||
|
|
||||||
private static final List<BauweltMember> members = new ArrayList<>();
|
private static final List<BauweltMember> members = new ArrayList<>();
|
||||||
|
|
||||||
|
public static void clear() {
|
||||||
|
members.clear();
|
||||||
|
}
|
||||||
|
|
||||||
private BauweltMember(int ownerID, int memberID, boolean worldEdit, boolean world, boolean updateDB){
|
private BauweltMember(int ownerID, int memberID, boolean worldEdit, boolean world, boolean updateDB){
|
||||||
bauweltID = ownerID;
|
bauweltID = ownerID;
|
||||||
this.memberID = memberID;
|
this.memberID = memberID;
|
||||||
|
@ -64,5 +64,4 @@ public class UserConfig {
|
|||||||
public static void removePlayerConfig(int id, String config) {
|
public static void removePlayerConfig(int id, String config) {
|
||||||
SQL.update("DELETE FROM UserConfig WHERE User = ? AND Config = ?", id, config);
|
SQL.update("DELETE FROM UserConfig WHERE User = ? AND Config = ?", id, config);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren