Skip to content

Commit 9010732

Browse files
committed
修复 Listener 未注册的 bug
1 parent f50bfac commit 9010732

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ apply plugin: 'net.minecraftforge.gradle'
1212
apply plugin: 'eclipse'
1313
apply plugin: 'maven-publish'
1414

15-
version = '1.1.4'
15+
version = '1.2.3'
1616
group = 'chloeprime.fix4log4j' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
1717
archivesBaseName = 'Fix4Log4J'
1818

src/main/java/chloeprime/fix4log4j/bukkit/Fix4Log4JBukkitPlugin.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import chloeprime.fix4log4j.Fixer;
55
import org.apache.logging.log4j.LogManager;
66
import org.bukkit.event.EventHandler;
7+
import org.bukkit.event.EventPriority;
78
import org.bukkit.event.Listener;
89
import org.bukkit.event.player.AsyncPlayerChatEvent;
910
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
@@ -25,10 +26,12 @@ public void onLoad() {
2526
public void onEnable() {
2627
super.onEnable();
2728
Fixer.doRuntimeTest(LogManager.getLogger("Fix4Log4J"));
28-
doCensor = getConfig().getBoolean("censor-user-input");
29+
30+
doCensor = getConfig().getBoolean("censor-user-input", true);
31+
getServer().getPluginManager().registerEvents(this, this);
2932
}
3033

31-
@EventHandler
34+
@EventHandler(priority = EventPriority.LOWEST)
3235
public void censorCommand(PlayerCommandPreprocessEvent event) {
3336
if (!doCensor) {
3437
return;
@@ -39,7 +42,7 @@ public void censorCommand(PlayerCommandPreprocessEvent event) {
3942
}
4043
}
4144

42-
@EventHandler
45+
@EventHandler(priority = EventPriority.LOWEST)
4346
public void censorChatAsync(AsyncPlayerChatEvent event) {
4447
if (!doCensor) {
4548
return;

src/main/java/chloeprime/fix4log4j/forge/Fix4Log4JMod.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
public class Fix4Log4JMod {
1919
public static final String MODID = "fix4log4j";
2020
public static final String NAME = "Fix4Log4J";
21-
public static final String VERSION = "1.1.4";
21+
public static final String VERSION = "1.2.3";
2222

2323
@EventHandler
2424
public void construct(FMLConstructionEvent event) {

0 commit comments

Comments
 (0)