Schemnodes #56
@ -132,6 +132,9 @@ public class Loadtimer implements Listener {
|
|||||||
if (stage == Stage.COUNTING) {
|
if (stage == Stage.COUNTING) {
|
||||||
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||||
Material type = event.getClickedBlock().getType();
|
Material type = event.getClickedBlock().getType();
|
||||||
|
if (type == Material.IRON_TRAPDOOR) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (type.name().contains("_BUTTON") || type == Material.LEVER || type.name().contains("_TRAPDOOR") || type == Material.NOTE_BLOCK) {
|
if (type.name().contains("_BUTTON") || type == Material.LEVER || type.name().contains("_TRAPDOOR") || type == Material.NOTE_BLOCK) {
|
||||||
setActivate();
|
setActivate();
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
package de.steamwar.bausystem.features.simulator;
|
||||||
|
|
||||||
|
import de.steamwar.bausystem.linkage.Disable;
|
||||||
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
|
|
||||||
|
@Linked(LinkageType.DISABLE_LINK)
|
||||||
|
public class TNTSimulatorDisable implements Disable {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disable() {
|
||||||
|
for (TNTSimulator simulator : TNTSimulator.TNT_SIMULATOR_MAP.values()) {
|
||||||
|
simulator.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -23,7 +23,6 @@ package de.steamwar.bausystem.features.simulator;
|
|||||||
|
|
||||||
import de.steamwar.bausystem.BauSystem;
|
import de.steamwar.bausystem.BauSystem;
|
||||||
import de.steamwar.bausystem.Permission;
|
import de.steamwar.bausystem.Permission;
|
||||||
import de.steamwar.bausystem.linkage.Disable;
|
|
||||||
import de.steamwar.bausystem.linkage.LinkageType;
|
import de.steamwar.bausystem.linkage.LinkageType;
|
||||||
import de.steamwar.bausystem.linkage.Linked;
|
import de.steamwar.bausystem.linkage.Linked;
|
||||||
import org.bukkit.FluidCollisionMode;
|
import org.bukkit.FluidCollisionMode;
|
||||||
@ -48,8 +47,7 @@ import static de.steamwar.bausystem.features.simulator.TNTSimulator.WAND;
|
|||||||
import static de.steamwar.bausystem.features.simulator.TNTSimulator.get;
|
import static de.steamwar.bausystem.features.simulator.TNTSimulator.get;
|
||||||
|
|
||||||
@Linked(LinkageType.LISTENER)
|
@Linked(LinkageType.LISTENER)
|
||||||
@Linked(LinkageType.DISABLE_LINK)
|
public class TNTSimulatorListener implements Listener {
|
||||||
public class TNTSimulatorListener implements Listener, Disable {
|
|
||||||
|
|
||||||
private boolean permissionCheck(Player player) {
|
private boolean permissionCheck(Player player) {
|
||||||
if (!Permission.hasPermission(player, Permission.WORLD)) {
|
if (!Permission.hasPermission(player, Permission.WORLD)) {
|
||||||
@ -119,6 +117,7 @@ public class TNTSimulatorListener implements Listener, Disable {
|
|||||||
if (event.getItem() == null || !event.getItem().isSimilar(WAND)) {
|
if (event.getItem() == null || !event.getItem().isSimilar(WAND)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
System.out.println(event);
|
||||||
|
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
if (!permissionCheck(event.getPlayer())) {
|
if (!permissionCheck(event.getPlayer())) {
|
||||||
@ -143,11 +142,4 @@ public class TNTSimulatorListener implements Listener, Disable {
|
|||||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||||
get(event.getPlayer()).saveAndDelete();
|
get(event.getPlayer()).saveAndDelete();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void disable() {
|
|
||||||
for (TNTSimulator simulator : TNTSimulator.TNT_SIMULATOR_MAP.values()) {
|
|
||||||
simulator.save();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,6 @@ import org.bukkit.event.Listener;
|
|||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
import org.bukkit.inventory.Inventory;
|
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
|
|
||||||
@Linked(LinkageType.LISTENER)
|
@Linked(LinkageType.LISTENER)
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren