Skip to content

Commit

Permalink
1.20.40
Browse files Browse the repository at this point in the history
  • Loading branch information
lt-name committed Oct 27, 2023
1 parent fb538f3 commit 31fc989
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<groupId>cn.powernukkitx</groupId>
<artifactId>powernukkitx</artifactId>
<version>1.20.30-r1</version>
<version>1.20.40-r1</version>

<inceptionYear>2023</inceptionYear>
<organization>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cn.nukkit.network.protocol;

import cn.nukkit.network.protocol.types.DisconnectFailReason;
import lombok.ToString;

/**
Expand All @@ -9,6 +10,7 @@
public class DisconnectPacket extends DataPacket {
public static final byte NETWORK_ID = ProtocolInfo.DISCONNECT_PACKET;

public DisconnectFailReason reason = DisconnectFailReason.UNKNOWN;
public boolean hideDisconnectionScreen = false;
public String message;

Expand All @@ -19,13 +21,15 @@ public byte pid() {

@Override
public void decode() {
this.reason = DisconnectFailReason.values()[this.getVarInt()];
this.hideDisconnectionScreen = this.getBoolean();
this.message = this.getString();
}

@Override
public void encode() {
this.reset();
this.putVarInt(this.reason.ordinal());
this.putBoolean(this.hideDisconnectionScreen);
if (!this.hideDisconnectionScreen) {
this.putString(this.message);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,9 @@ public class LevelSoundEventPacket extends DataPacket {
public static final int SOUND_HOGLIN_CONVERT_TO_ZOMBIE = 474;
public static final int SOUND_AMBIENT_UNDERWATER_ENTER = 475;
public static final int SOUND_AMBIENT_UNDERWATER_EXIT = 476;
public static final int SOUND_UNDEFINED = dynamic(477);
public static final int SOUND_BOTTLE_FILL = 477;
public static final int SOUND_BOTTLE_EMPTY = 478;
public static final int SOUND_UNDEFINED = dynamic(479);

public int sound;
public float x;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class PlayerActionPacket extends DataPacket {

public static final int ACTION_START_FLYING = 34;
public static final int ACTION_STOP_FLYING = 35;
public static final int ACTION_RECEIVED_SERVER_DATA = 36;

public long entityId;
public int action;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
package cn.nukkit.network.protocol.types;

public enum DisconnectFailReason {
UNKNOWN,
CANT_CONNECT_NO_INTERNET,
NO_PERMISSIONS,
UNRECOVERABLE_ERROR,
THIRD_PARTY_BLOCKED,
THIRD_PARTY_NO_INTERNET,
THIRD_PARTY_BAD_IP,
THIRD_PARTY_NO_SERVER_OR_SERVER_LOCKED,
VERSION_MISMATCH,
SKIN_ISSUE,
INVITE_SESSION_NOT_FOUND,
EDU_LEVEL_SETTINGS_MISSING,
LOCAL_SERVER_NOT_FOUND,
LEGACY_DISCONNECT,
USER_LEAVE_GAME_ATTEMPTED,
PLATFORM_LOCKED_SKINS_ERROR,
REALMS_WORLD_UNASSIGNED,
REALMS_SERVER_CANT_CONNECT,
REALMS_SERVER_HIDDEN,
REALMS_SERVER_DISABLED_BETA,
REALMS_SERVER_DISABLED,
CROSS_PLATFORM_DISALLOWED,
CANT_CONNECT,
SESSION_NOT_FOUND,
CLIENT_SETTINGS_INCOMPATIBLE_WITH_SERVER,
SERVER_FULL,
INVALID_PLATFORM_SKIN,
EDITION_VERSION_MISMATCH,
EDITION_MISMATCH,
LEVEL_NEWER_THAN_EXE_VERSION,
NO_FAIL_OCCURRED,
BANNED_SKIN,
TIMEOUT,
SERVER_NOT_FOUND,
OUTDATED_SERVER,
OUTDATED_CLIENT,
NO_PREMIUM_PLATFORM,
MULTIPLAYER_DISABLED,
NO_WIFI,
WORLD_CORRUPTION,
NO_REASON,
DISCONNECTED,
INVALID_PLAYER,
LOGGED_IN_OTHER_LOCATION,
SERVER_ID_CONFLICT,
NOT_ALLOWED,
NOT_AUTHENTICATED,
INVALID_TENANT,
UNKNOWN_PACKET,
UNEXPECTED_PACKET,
INVALID_COMMAND_REQUEST_PACKET,
HOST_SUSPENDED,
LOGIN_PACKET_NO_REQUEST,
LOGIN_PACKET_NO_CERT,
MISSING_CLIENT,
KICKED,
KICKED_FOR_EXPLOIT,
KICKED_FOR_IDLE,
RESOURCE_PACK_PROBLEM,
INCOMPATIBLE_PACK,
OUT_OF_STORAGE,
INVALID_LEVEL,
DISCONNECT_PACKET_DEPRECATED,
BLOCK_MISMATCH,
INVALID_HEIGHTS,
INVALID_WIDTHS,
CONNECTION_LOST,
ZOMBIE_CONNECTION,
SHUTDOWN,
REASON_NOT_SET,
LOADING_STATE_TIMEOUT,
RESOURCE_PACK_LOADING_FAILED,
SEARCHING_FOR_SESSION_LOADING_SCREEN_FAILED,
CONN_PROTOCOL_VERSION,
SUBSYSTEM_STATUS_ERROR,
EMPTY_AUTH_FROM_DISCOVERY,
EMPTY_URL_FROM_DISCOVERY,
EXPIRED_AUTH_FROM_DISCOVERY,
UNKNOWN_SIGNAL_SERVICE_SIGN_IN_FAILURE,
XBL_JOIN_LOBBY_FAILURE,
UNSPECIFIED_CLIENT_INSTANCE_DISCONNECTION,
CONN_SESSION_NOT_FOUND,
CONN_CREATE_PEER_CONNECTION,
CONN_ICE,
CONN_CONNECT_REQUEST,
CONN_CONNECT_RESPONSE,
CONN_NEGOTIATION_TIMEOUT,
CONN_INACTIVITY_TIMEOUT,
STALE_CONNECTION_BEING_REPLACED,
REALMS_SESSION_NOT_FOUND,
BAD_PACKET
}

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ public enum PlayerActionType {
/**
* @since v618
*/
STOP_FLYING;
STOP_FLYING,
/**
* @since v622
*/
RECEIVED_SERVER_DATA;

private static final PlayerActionType[] VALUES = values();

Expand Down
Binary file modified src/main/resources/canonical_block_states.nbt
Binary file not shown.
8 changes: 4 additions & 4 deletions src/main/resources/creativeitems.json
Original file line number Diff line number Diff line change
Expand Up @@ -4327,15 +4327,15 @@
"name": "minecraft:composter"
},
{
"block_states": "CgAAAxAAZmFjaW5nX2RpcmVjdGlvbgAAAAAA",
"block_states": "CgAACBwAbWluZWNyYWZ0OmNhcmRpbmFsX2RpcmVjdGlvbgUAbm9ydGgA",
"name": "minecraft:chest"
},
{
"block_states": "CgAAAxAAZmFjaW5nX2RpcmVjdGlvbgAAAAAA",
"block_states": "CgAACBwAbWluZWNyYWZ0OmNhcmRpbmFsX2RpcmVjdGlvbgUAbm9ydGgA",
"name": "minecraft:trapped_chest"
},
{
"block_states": "CgAAAxAAZmFjaW5nX2RpcmVjdGlvbgAAAAAA",
"block_states": "CgAACBwAbWluZWNyYWZ0OmNhcmRpbmFsX2RpcmVjdGlvbgUAbm9ydGgA",
"name": "minecraft:ender_chest"
},
{
Expand Down Expand Up @@ -4620,7 +4620,7 @@
"name": "minecraft:conduit"
},
{
"block_states": "CgAAAxAAZmFjaW5nX2RpcmVjdGlvbgAAAAAA",
"block_states": "CgAACBwAbWluZWNyYWZ0OmNhcmRpbmFsX2RpcmVjdGlvbgUAbm9ydGgA",
"name": "minecraft:stonecutter_block"
},
{
Expand Down
Binary file modified src/main/resources/entity_identifiers.nbt
Binary file not shown.

0 comments on commit 31fc989

Please sign in to comment.