@EventHandler public void onDestroyed(VehicleDestroyEvent e) { String time = DateFormat.getInstance().format(new Date(System.currentTimeMillis())) + " "; Location loc = e.getVehicle().getLocation(); String entity = ""; if (e.getAttacker() != null) { entity = "by " + e.getAttacker().getClass(); } out.log( time + e.getVehicle().toString() + " " + plugin.translate("vehicle.destroy") + " " + entity + " " + plugin.translate("in") + " [" + (int) loc.getX() + "," + (int) loc.getY() + "," + (int) loc.getZ() + "]"); }
@EventHandler public void onCreated(VehicleCreateEvent e) { String time = DateFormat.getInstance().format(new Date(System.currentTimeMillis())) + " "; Location loc = e.getVehicle().getLocation(); out.log( time + e.getVehicle().toString() + " " + plugin.translate("vehicle.place") + " " + plugin.translate("in") + " [" + (int) loc.getX() + "," + (int) loc.getY() + "," + (int) loc.getZ() + "]"); }
@EventHandler public void onEnter(VehicleEnterEvent e) { String time = DateFormat.getInstance().format(new Date(System.currentTimeMillis())) + " "; Location loc = e.getVehicle().getLocation(); String entity = e.getEntered().getClass() + ""; out.log( time + entity + " " + plugin.translate("vehicle.enter") + " " + e.getVehicle().toString() + " " + plugin.translate("in") + " [" + (int) loc.getX() + "," + (int) loc.getY() + "," + (int) loc.getZ() + "]"); }
public VehicleLogger(MainLogger main, boolean is, int max, Date s) { this.plugin = main; plugin.getServer().getPluginManager().registerEvents(this, plugin); out = new LoggerFile(log, is, max, s); }