Skip to content

Commit 31e40a9

Browse files
committed
Show all commands to OPs and remove old recipie code
1 parent a890709 commit 31e40a9

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/main/java/org/geysermc/globallinkserver/GlobalLinkServer.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -121,23 +121,26 @@ public void onEnable() {
121121
world.setGameRule(GameRule.RANDOM_TICK_SPEED, 0);
122122
world.setGameRule(GameRule.SHOW_DEATH_MESSAGES, false);
123123

124+
// Make nighttime
125+
world.setTime(18000);
126+
124127
// Other changes
125128
getServer().motd(Component.text("GeyserMC ").color(NamedTextColor.GREEN)
126129
.append(Component.text("Link ").color(NamedTextColor.AQUA))
127130
.append(Component.text("Server").color(NamedTextColor.WHITE)));
128131

129132
getServer().clearRecipes();
130-
131-
// Make nighttime
132-
world.setTime(18000);
133-
134133
getServer().setDefaultGameMode(GameMode.ADVENTURE);
135134

136135
LOGGER.info("Started Global Linking plugin!");
137136
}
138137

139138
@EventHandler
140139
public void onCommands(PlayerCommandSendEvent event) {
140+
if (event.getPlayer().isOp()) {
141+
return;
142+
}
143+
141144
Collection<String> toRemove = new ArrayList<>();
142145
for (String command : event.getCommands()) {
143146
if (command.startsWith("link")) {
@@ -251,9 +254,4 @@ public void onServerListPing(PaperServerListPingEvent event) {
251254
event.setNumPlayers(0);
252255
event.setMaxPlayers(1);
253256
}
254-
255-
@EventHandler
256-
public void onPlayerRecipeDiscover(PlayerRecipeDiscoverEvent event) {
257-
event.setCancelled(true);
258-
}
259257
}

0 commit comments

Comments
 (0)