Update Permission #220
@ -23,6 +23,7 @@ import de.steamwar.bausystem.BauSystem;
|
|||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.utils.BauMemberUpdateEvent;
|
import de.steamwar.bausystem.utils.BauMemberUpdateEvent;
|
||||||
import de.steamwar.core.CraftbukkitWrapper;
|
import de.steamwar.core.CraftbukkitWrapper;
|
||||||
|
import de.steamwar.inventory.SWItem;
|
||||||
import de.steamwar.linkage.Linked;
|
import de.steamwar.linkage.Linked;
|
||||||
import de.steamwar.techhider.TechHider;
|
import de.steamwar.techhider.TechHider;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -49,9 +50,56 @@ public class SpectatorListener implements Listener {
|
|||||||
private static final Set<Player> NO_TECHHIDER = new HashSet<>();
|
private static final Set<Player> NO_TECHHIDER = new HashSet<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
Set<Material> materials = new HashSet<>();
|
||||||
|
materials.add(Material.REDSTONE_WIRE);
|
||||||
|
materials.add(Material.REDSTONE_TORCH);
|
||||||
|
materials.add(Material.REDSTONE_BLOCK);
|
||||||
|
materials.add(Material.REPEATER);
|
||||||
|
materials.add(Material.COMPARATOR);
|
||||||
|
materials.add(Material.LEVER);
|
||||||
|
for (Material value : Material.values()) {
|
||||||
|
if (value.name().endsWith("_BUTTON")) {
|
||||||
|
materials.add(value);
|
||||||
|
}
|
||||||
|
if (value.name().endsWith("_PRESSURE_PLATE")) {
|
||||||
|
materials.add(value);
|
||||||
|
}
|
||||||
|
if (value.name().endsWith("_SIGN")) {
|
||||||
|
materials.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
materials.add(SWItem.getMaterial("SCULK_SENSOR"));
|
||||||
|
materials.add(SWItem.getMaterial("CALIBRATED_SCULK_SENSOR"));
|
||||||
|
materials.add(SWItem.getMaterial("SCULK_SHRIEKER"));
|
||||||
|
materials.add(SWItem.getMaterial("AMETHYST_BLOCK"));
|
||||||
|
materials.add(SWItem.getMaterial("AMETHYST_CLUSTER"));
|
||||||
|
materials.add(SWItem.getMaterial("SMALL_AMETHYST_BUG"));
|
||||||
|
materials.add(SWItem.getMaterial("MEDIUM_AMETHYST_BUG"));
|
||||||
|
materials.add(SWItem.getMaterial("LARGE_AMETHYST_BUG"));
|
||||||
|
materials.add(Material.TRIPWIRE_HOOK);
|
||||||
|
materials.add(Material.TRIPWIRE);
|
||||||
|
materials.add(Material.DAYLIGHT_DETECTOR);
|
||||||
|
materials.add(SWItem.getMaterial("LIGHTNING_ROD"));
|
||||||
|
materials.add(Material.PISTON);
|
||||||
|
materials.add(Material.PISTON_HEAD);
|
||||||
|
materials.add(Material.MOVING_PISTON);
|
||||||
|
materials.add(Material.STICKY_PISTON);
|
||||||
|
materials.add(Material.SLIME_BLOCK);
|
||||||
|
materials.add(Material.HONEY_BLOCK);
|
||||||
|
materials.add(Material.OBSERVER);
|
||||||
|
materials.add(Material.RAIL);
|
||||||
|
materials.add(Material.POWERED_RAIL);
|
||||||
|
materials.add(Material.DETECTOR_RAIL);
|
||||||
|
materials.add(Material.ACTIVATOR_RAIL);
|
||||||
|
materials.add(Material.TNT);
|
||||||
|
materials.add(Material.REDSTONE_ORE);
|
||||||
|
materials.add(SWItem.getMaterial("SCAFFOLDING"));
|
||||||
|
materials.add(Material.WATER);
|
||||||
|
materials.remove(Material.BARRIER);
|
||||||
|
materials.remove(Material.STONE);
|
||||||
TechHider techHider = new TechHider((player, i, i1) -> {
|
TechHider techHider = new TechHider((player, i, i1) -> {
|
||||||
return Permission.BUILD.hasPermission(player) || Permission.isTempOnlySpectator(player) || NO_TECHHIDER.contains(player);
|
return Permission.BUILD.hasPermission(player) || Permission.isTempOnlySpectator(player) || NO_TECHHIDER.contains(player);
|
||||||
}, Material.END_STONE, new HashSet<>(Arrays.asList(Material.REDSTONE_WIRE)), new HashSet<>());
|
}, Material.END_STONE, materials, new HashSet<>());
|
||||||
techHider.enable();
|
techHider.enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren