SteamWar/BauSystem
Archiviert
13
0

Add VersionedRunnable to RegionListener

Dieser Commit ist enthalten in:
jojo 2021-02-08 21:02:47 +01:00
Ursprung 9dc5c535f5
Commit d45c39c528

Datei anzeigen

@ -21,6 +21,7 @@ package de.steamwar.bausystem.world;
import com.comphenix.protocol.PacketType; import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.PacketAdapter; import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.events.PacketEvent; import com.comphenix.protocol.events.PacketEvent;
@ -28,10 +29,10 @@ import com.comphenix.protocol.wrappers.BlockPosition;
import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.Permission;
import de.steamwar.core.Core; import de.steamwar.core.Core;
import de.steamwar.core.VersionedCallable;
import de.steamwar.core.VersionedRunnable; import de.steamwar.core.VersionedRunnable;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import com.comphenix.protocol.ProtocolLibrary;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.Sign; import org.bukkit.block.Sign;
@ -105,13 +106,8 @@ public class RegionListener implements Listener {
if(command.startsWith(shortcut)) if(command.startsWith(shortcut))
return true; return true;
switch(Core.getVersion()){ return VersionedCallable.call(new VersionedCallable<>(() -> RegionListener_12.isWorldEditCommand(command), 8),
case 12: new VersionedCallable<>(() -> RegionListener_15.isWorldEditCommand(command), 15));
return RegionListener_12.isWorldEditCommand(command);
case 15:
default:
return RegionListener_15.isWorldEditCommand(command);
}
} }
@EventHandler @EventHandler