made SignEditListener formatting consistent and optimized ReportJoinListener to handle admin notifications asynchronously
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
package eu.mhsl.craftattack.spawn.common.appliances.metaGameplay.report.listeners;
|
package eu.mhsl.craftattack.spawn.common.appliances.metaGameplay.report.listeners;
|
||||||
|
|
||||||
import eu.mhsl.craftattack.spawn.common.appliances.metaGameplay.report.Report;
|
import eu.mhsl.craftattack.spawn.common.appliances.metaGameplay.report.Report;
|
||||||
|
import eu.mhsl.craftattack.spawn.core.Main;
|
||||||
import eu.mhsl.craftattack.spawn.core.appliance.ApplianceListener;
|
import eu.mhsl.craftattack.spawn.core.appliance.ApplianceListener;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
@@ -9,6 +11,9 @@ public class ReportJoinListener extends ApplianceListener<Report> {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
if(!event.getPlayer().hasPermission("admin")) return;
|
if(!event.getPlayer().hasPermission("admin")) return;
|
||||||
this.getAppliance().sendReportsInfo(event.getPlayer());
|
Bukkit.getScheduler().runTaskAsynchronously(
|
||||||
|
Main.instance(),
|
||||||
|
() -> this.getAppliance().sendReportsInfo(event.getPlayer())
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ class SignEditListener extends ApplianceListener<AntiIllegalSignCharacters> {
|
|||||||
(int)'€', (int)'°', (int)'µ'
|
(int)'€', (int)'°', (int)'µ'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onSignEdit(SignChangeEvent event) {
|
public void onSignEdit(SignChangeEvent event) {
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user