Feature: Allow client-side "game settings" menu gamemode/difficulty changes (#4062)

Removes difficulty/Gamemode settings from the custom server settings form since these are now present in the client side settings.
This commit is contained in:
chris 2023-09-09 00:34:19 +02:00 committed by GitHub
parent 007edcbf11
commit 806ec35a84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 169 additions and 36 deletions

View file

@ -25,6 +25,7 @@
package org.geysermc.geyser.platform.spigot.world.manager;
import com.github.steveice10.mc.protocol.data.game.entity.player.GameMode;
import com.github.steveice10.mc.protocol.data.game.level.block.BlockEntityInfo;
import com.github.steveice10.opennbt.tag.builtin.CompoundTag;
import org.bukkit.Bukkit;
@ -171,6 +172,11 @@ public class GeyserSpigotWorldManager extends WorldManager {
return gameRule.getDefaultIntValue();
}
@Override
public GameMode getDefaultGameMode(GeyserSession session) {
return GameMode.byId(Bukkit.getDefaultGameMode().ordinal());
}
@Override
public boolean hasPermission(GeyserSession session, String permission) {
return Bukkit.getPlayer(session.getPlayerEntity().getUsername()).hasPermission(permission);