You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.5 KiB
54 lines
1.5 KiB
package net.mcbat.LightningEvent;
|
|
|
|
import java.util.logging.Logger;
|
|
|
|
import org.bukkit.Location;
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
|
|
|
import net.mcbat.LightningEvent.Commands.CommandCast;
|
|
import net.mcbat.LightningEvent.Listeners.LightningEventEntityListener;
|
|
import net.mcbat.LightningEvent.Listeners.LightningEventPlayerListener;
|
|
|
|
public class LightningEvent extends JavaPlugin {
|
|
private final Logger _logger = Logger.getLogger("minecraft");
|
|
|
|
private CommandCast _castCommand;
|
|
|
|
@Override
|
|
public void onEnable() {
|
|
_logger.info("[LightningEvent] v"+this.getDescription().getVersion()+" (Helium) loaded.");
|
|
_logger.info("[LightningEvent] Developed by: [Mattera, Steven (IchigoKyger)]");
|
|
|
|
_castCommand = new CommandCast(this);
|
|
|
|
(new LightningEventEntityListener(this)).registerEvents();
|
|
(new LightningEventPlayerListener(this)).registerEvents();
|
|
}
|
|
|
|
@Override
|
|
public void onDisable() {
|
|
_logger.info("[LightningEvent] Plugin disabled.");
|
|
}
|
|
|
|
@Override
|
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
|
if (command.getName().equals("cast"))
|
|
return _castCommand.onCommand(sender, command, label, args);
|
|
|
|
return true;
|
|
}
|
|
|
|
public Logger getMinecraftLogger() {
|
|
return _logger;
|
|
}
|
|
|
|
public void castRealLightningAtLocation(Location location) {
|
|
location.getWorld().strikeLightning(location);
|
|
}
|
|
|
|
public void castFakeLightningAtLocation(Location location) {
|
|
location.getWorld().strikeLightningEffect(location);
|
|
}
|
|
}
|
|
|