SteamWar/BauSystem
Archiviert
13
0
Dieses Repository wurde am 2024-08-04 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
BauSystem/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandFreeze.java

84 Zeilen
2.2 KiB
Java

2020-08-26 18:48:57 +02:00
/*
This file is a part of the SteamWar software.
Copyright (C) 2020 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2019-08-06 20:26:04 +02:00
package de.steamwar.bausystem.commands;
import org.bukkit.event.EventHandler;
2020-03-01 15:37:38 +01:00
import org.bukkit.event.block.*;
2020-03-01 16:02:14 +01:00
import org.bukkit.event.inventory.InventoryMoveItemEvent;
2019-08-06 20:26:04 +02:00
public class CommandFreeze extends ToggleCommand {
2019-08-06 20:26:04 +02:00
public CommandFreeze(){
super(false);
}
2019-08-06 20:26:04 +02:00
public static ToggleCommand getInstance(){
return getInstance(CommandFreeze.class);
}
2019-08-06 20:26:04 +02:00
@Override
String getNoPermMessage() {
return "§cDu darfst diese Welt nicht einfrieren";
}
@Override
String getEnableMessage(){
return "§cWelt eingefroren";
}
@Override
String getDisableMessage(){
return "§aWelt aufgetaut";
2019-08-06 20:26:04 +02:00
}
@EventHandler
public void onPhysicsEvent(BlockPhysicsEvent e){
e.setCancelled(true);
}
2020-03-01 15:37:38 +01:00
@EventHandler
public void onPistonExtend(BlockPistonExtendEvent e){
e.setCancelled(true);
}
@EventHandler
public void onPistonRetract(BlockPistonRetractEvent e){
e.setCancelled(true);
}
@EventHandler
public void onBlockGrow(BlockGrowEvent e){
e.setCancelled(true);
}
@EventHandler
public void onRedstoneEvent(BlockRedstoneEvent e){
e.setNewCurrent(e.getOldCurrent());
}
2020-03-01 15:43:32 +01:00
@EventHandler
public void onBlockDispense(BlockDispenseEvent e){
e.setCancelled(true);
}
2020-03-01 16:02:14 +01:00
@EventHandler
public void onInventoryMoveEvent(InventoryMoveItemEvent e){
e.setCancelled(true);
}
2019-08-06 20:26:04 +02:00
}