Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-24 15:20:35 +01:00
Add javadoc and reorganize the player settings stuff.
Dieser Commit ist enthalten in:
Ursprung
37eabde0c5
Commit
f273c046ec
@ -1,7 +1,7 @@
|
||||
package com.velocitypowered.api.event.player;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.velocitypowered.api.playersettings.PlayerSettings;
|
||||
import com.velocitypowered.api.proxy.player.PlayerSettings;
|
||||
import com.velocitypowered.api.proxy.Player;
|
||||
|
||||
public class PlayerSettingsChangedEvent {
|
||||
|
@ -1,29 +0,0 @@
|
||||
package com.velocitypowered.api.playersettings;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public interface PlayerSettings {
|
||||
|
||||
Locale getLocale();
|
||||
|
||||
byte getViewDistance();
|
||||
|
||||
ChatMode getChatMode();
|
||||
|
||||
boolean hasChatColors();
|
||||
|
||||
SkinParts getSkinParts();
|
||||
|
||||
MainHand getMainHand();
|
||||
|
||||
public enum ChatMode {
|
||||
SHOWN,
|
||||
COMMANDS_ONLY,
|
||||
HIDDEN
|
||||
}
|
||||
|
||||
public enum MainHand {
|
||||
LEFT,
|
||||
RIGHT
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package com.velocitypowered.api.proxy;
|
||||
|
||||
import com.velocitypowered.api.command.CommandSource;
|
||||
import com.velocitypowered.api.playersettings.PlayerSettings;
|
||||
import com.velocitypowered.api.proxy.player.PlayerSettings;
|
||||
import com.velocitypowered.api.proxy.messages.ChannelMessageSink;
|
||||
import com.velocitypowered.api.proxy.messages.ChannelMessageSource;
|
||||
import com.velocitypowered.api.proxy.server.ServerInfo;
|
||||
|
@ -0,0 +1,56 @@
|
||||
package com.velocitypowered.api.proxy.player;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Represents the client settings for the player.
|
||||
*/
|
||||
public interface PlayerSettings {
|
||||
/**
|
||||
* Returns the locale of the Minecraft client.
|
||||
* @return the client locale
|
||||
*/
|
||||
Locale getLocale();
|
||||
|
||||
/**
|
||||
* Returns the client's view distance. This does not guarantee the client will see this many chunks, since your
|
||||
* servers are responsible for sending the chunks.
|
||||
* @return the client view distance
|
||||
*/
|
||||
byte getViewDistance();
|
||||
|
||||
/**
|
||||
* Returns the chat setting for the client.
|
||||
* @return the chat setting
|
||||
*/
|
||||
ChatMode getChatMode();
|
||||
|
||||
/**
|
||||
* Returns whether or not the client has chat colors disabled.
|
||||
* @return whether or not the client has chat colors disabled
|
||||
*/
|
||||
boolean hasChatColors();
|
||||
|
||||
/**
|
||||
* Returns the parts of player skins the client will show.
|
||||
* @return the skin parts for the client
|
||||
*/
|
||||
SkinParts getSkinParts();
|
||||
|
||||
/**
|
||||
* Returns the primary hand of the client.
|
||||
* @return the primary hand of the client
|
||||
*/
|
||||
MainHand getMainHand();
|
||||
|
||||
enum ChatMode {
|
||||
SHOWN,
|
||||
COMMANDS_ONLY,
|
||||
HIDDEN
|
||||
}
|
||||
|
||||
enum MainHand {
|
||||
LEFT,
|
||||
RIGHT
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package com.velocitypowered.api.playersettings;
|
||||
package com.velocitypowered.api.proxy.player;
|
||||
|
||||
public class SkinParts {
|
||||
|
@ -0,0 +1,4 @@
|
||||
/**
|
||||
* Provides an interface to work with Minecraft client settings.
|
||||
*/
|
||||
package com.velocitypowered.api.proxy.player;
|
@ -1,7 +1,7 @@
|
||||
package com.velocitypowered.proxy.connection.client;
|
||||
|
||||
import com.velocitypowered.api.playersettings.PlayerSettings;
|
||||
import com.velocitypowered.api.playersettings.SkinParts;
|
||||
import com.velocitypowered.api.proxy.player.PlayerSettings;
|
||||
import com.velocitypowered.api.proxy.player.SkinParts;
|
||||
import com.velocitypowered.proxy.protocol.packet.ClientSettings;
|
||||
import java.util.Locale;
|
||||
|
||||
|
@ -6,7 +6,7 @@ import com.velocitypowered.api.event.player.PlayerSettingsChangedEvent;
|
||||
import com.velocitypowered.api.event.player.ServerPreConnectEvent;
|
||||
import com.velocitypowered.api.permission.PermissionFunction;
|
||||
import com.velocitypowered.api.permission.PermissionProvider;
|
||||
import com.velocitypowered.api.playersettings.PlayerSettings;
|
||||
import com.velocitypowered.api.proxy.player.PlayerSettings;
|
||||
import com.velocitypowered.api.proxy.ConnectionRequestBuilder;
|
||||
import com.velocitypowered.api.proxy.ServerConnection;
|
||||
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren