Skip to content

Commit

Permalink
1.6.8 STABLE release
Browse files Browse the repository at this point in the history
  • Loading branch information
retrooper committed Sep 16, 2020
1 parent 33ed5ff commit 9347e7a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public final class PacketEventsAPI {
private final PlayerUtils playerUtils = new PlayerUtils();
private final ServerUtils serverUtils = new ServerUtils();
private final PacketEventsSettings settings = new PacketEventsSettings();
//private final UpdateChecker updateChecker = new UpdateChecker();

/**
* Not thread safe
Expand Down Expand Up @@ -63,6 +64,7 @@ public long currentMillis() {

/**
* Get all utilities to do with the player
*
* @return Player Utilities
*/
public PlayerUtils getPlayerUtils() {
Expand All @@ -71,6 +73,7 @@ public PlayerUtils getPlayerUtils() {

/**
* Get all utilities to do with the server
*
* @return Server Utilities
*/
public ServerUtils getServerUtils() {
Expand All @@ -81,6 +84,7 @@ public ServerUtils getServerUtils() {
/**
* Get the event manager
* Used to call events, register and unregister listeners
*
* @return PacketEvents' event manager
*/
public EventManager getEventManager() {
Expand All @@ -89,9 +93,19 @@ public EventManager getEventManager() {

/**
* Get the PacketEvents settings.
*
* @return Configure some settings for the API
*/
public PacketEventsSettings getSettings() {
return settings;
}
/*
/**
* Get the update checker
* @return Update Checker
*
public UpdateChecker getUpdateChecker() {
return updateChecker;
}
*/
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class PacketEventsSettings {
private boolean uninjectAsync = true;
private boolean injectAsync = true;
private boolean useProtocolLibIfAvailable = true;
private boolean checkForUpdates = true;

/**
* If PacketEvents fails to detect your server version, it will use the recommended version
Expand All @@ -61,6 +62,7 @@ public void setDefaultServerVersion(final ServerVersion version) {
* If you manually set the identifier using its setter '#setIdentifier(String)'.
* We will use that identifier to generate each player's handler name.
* If you do not set the identifier manually, we automatically generate one for you.
*
* @return stored identifier or new generated identifier
*/
public String getIdentifier() {
Expand Down Expand Up @@ -99,6 +101,7 @@ public boolean doAutoResolveClientProtocolVersion() {
* (when ViaVersion, ProtocolLib or ProtocolSupport can't be found on the server),
* should it assume that the client is using the same version as the server?
* Returns ACCESS_FAILURE if this is set to FALSE(default value is false).
*
* @param autoResolveClientProtocolVersion boolean
*/
public void setDoAutoResolveClientProtocolVersion(boolean autoResolveClientProtocolVersion) {
Expand Down Expand Up @@ -144,9 +147,18 @@ public boolean isUseProtocolLibIfAvailable() {
* with other plugins that might be using ProtocolLib.
* Especially if they or you are doing packet cancellations,
* PacketEvents passes the event priority to ProtocolLib.
*
* @param val boolean
*/
public void setUseProtocolLibIfAvailable(boolean val) {
this.useProtocolLibIfAvailable = val;
}

/*public void setShouldCheckForUpdates(boolean val) {
this.checkForUpdates = val;
}
public boolean shouldCheckForUpdates() {
return checkForUpdates;
}*/
}

0 comments on commit 9347e7a

Please sign in to comment.