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
|
|
|
|
2019-10-24 18:47:23 +02:00
|
|
|
public class CommandFreeze extends ToggleCommand {
|
2019-08-06 20:26:04 +02:00
|
|
|
|
2019-10-24 18:47:23 +02:00
|
|
|
public CommandFreeze(){
|
|
|
|
super(false);
|
|
|
|
}
|
2019-08-06 20:26:04 +02:00
|
|
|
|
2019-10-24 18:47:23 +02:00
|
|
|
public static ToggleCommand getInstance(){
|
|
|
|
return getInstance(CommandFreeze.class);
|
|
|
|
}
|
2019-08-06 20:26:04 +02:00
|
|
|
|
2019-10-24 18:47:23 +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
|
|
|
}
|