Skip to content

Commit

Permalink
移除不必要的判断 + 增加 refresh_ticks 选项
Browse files Browse the repository at this point in the history
  • Loading branch information
glorydark committed Feb 19, 2024
1 parent 15c4c32 commit e50b749
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/glorydark/DLevelEventPlus/CheckTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void onRun(int i) {
player.setImmobile(!movable);
}
}
if (forceGamemode != -1 && player.getGamemode() != forceGamemode) {
if (forceGamemode != -1) {
player.setGamemode(forceGamemode);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void onEnable() {
this.getServer().getPluginManager().registerEvents(new WorldEventListener(), this);
this.getServer().getPluginManager().registerEvents(new InventoryEventListener(), this);
this.getServer().getPluginManager().registerEvents(new FormEventListener(), this);
this.getServer().getScheduler().scheduleRepeatingTask(this, new CheckTask(), 20);
this.getServer().getScheduler().scheduleRepeatingTask(this, new CheckTask(), config.getInt("refresh_ticks", 20));
// Register Commands
this.getServer().getCommandMap().register("", new Command("dwp"));
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
language: chs
experimental: false
auto_update_files: false
auto_update_files: false
refresh_ticks: 20

0 comments on commit e50b749

Please sign in to comment.