3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-25 15:50:19 +01:00

Add javadoc and reorganize the player settings stuff.

Dieser Commit ist enthalten in:
Andrew Steinborn 2018-08-25 12:54:30 -04:00
Ursprung 37eabde0c5
Commit f273c046ec
8 geänderte Dateien mit 66 neuen und 35 gelöschten Zeilen

Datei anzeigen

@ -1,7 +1,7 @@
package com.velocitypowered.api.event.player; package com.velocitypowered.api.event.player;
import com.google.common.base.Preconditions; 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; import com.velocitypowered.api.proxy.Player;
public class PlayerSettingsChangedEvent { public class PlayerSettingsChangedEvent {

Datei anzeigen

@ -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
}
}

Datei anzeigen

@ -1,7 +1,7 @@
package com.velocitypowered.api.proxy; package com.velocitypowered.api.proxy;
import com.velocitypowered.api.command.CommandSource; 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.ChannelMessageSink;
import com.velocitypowered.api.proxy.messages.ChannelMessageSource; import com.velocitypowered.api.proxy.messages.ChannelMessageSource;
import com.velocitypowered.api.proxy.server.ServerInfo; import com.velocitypowered.api.proxy.server.ServerInfo;

Datei anzeigen

@ -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
}
}

Datei anzeigen

@ -1,4 +1,4 @@
package com.velocitypowered.api.playersettings; package com.velocitypowered.api.proxy.player;
public class SkinParts { public class SkinParts {

Datei anzeigen

@ -0,0 +1,4 @@
/**
* Provides an interface to work with Minecraft client settings.
*/
package com.velocitypowered.api.proxy.player;

Datei anzeigen

@ -1,7 +1,7 @@
package com.velocitypowered.proxy.connection.client; package com.velocitypowered.proxy.connection.client;
import com.velocitypowered.api.playersettings.PlayerSettings; import com.velocitypowered.api.proxy.player.PlayerSettings;
import com.velocitypowered.api.playersettings.SkinParts; import com.velocitypowered.api.proxy.player.SkinParts;
import com.velocitypowered.proxy.protocol.packet.ClientSettings; import com.velocitypowered.proxy.protocol.packet.ClientSettings;
import java.util.Locale; import java.util.Locale;

Datei anzeigen

@ -6,7 +6,7 @@ import com.velocitypowered.api.event.player.PlayerSettingsChangedEvent;
import com.velocitypowered.api.event.player.ServerPreConnectEvent; import com.velocitypowered.api.event.player.ServerPreConnectEvent;
import com.velocitypowered.api.permission.PermissionFunction; import com.velocitypowered.api.permission.PermissionFunction;
import com.velocitypowered.api.permission.PermissionProvider; 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.ConnectionRequestBuilder;
import com.velocitypowered.api.proxy.ServerConnection; import com.velocitypowered.api.proxy.ServerConnection;
import com.velocitypowered.api.proxy.messages.ChannelIdentifier; import com.velocitypowered.api.proxy.messages.ChannelIdentifier;