Skip to content

Commit

Permalink
feat: 1.20.40 (#1404)
Browse files Browse the repository at this point in the history
* 1.20.40

* 1.20.40-R1 Protocol Release (#1401)

* Made BlockWood use the same WoodType Block state as the other blocks
(OLD_LOG_TYPE was deprecated)

* Fixed BlockRedstoneRepeater Direction

* Fixed block_mappings for log axis

* Removed doubled log2 section

* Updated Release Version to 1.20.30-r2

* release +u

* Updated Release Version to 1.20.30-r2 (#1399)

* Made BlockWood use the same WoodType Block state as the other blocks
(OLD_LOG_TYPE was deprecated)

* Fixed BlockRedstoneRepeater Direction

* Fixed block_mappings for log axis

* Removed doubled log2 section

* Updated Release Version to 1.20.30-r2

* release +u

* Fixed UPDATE blocks causing a lot of issues in World generation

* Fixed Facing Direction property error on BlockAmethystBud

* Realized that BLOCK_FACE is required instead of FACING_DIRECTION

* Fixed AmethystBud Block  FACING_DIRECTION property (#1400)

* Made BlockWood use the same WoodType Block state as the other blocks
(OLD_LOG_TYPE was deprecated)

* Fixed BlockRedstoneRepeater Direction

* Fixed block_mappings for log axis

* Removed doubled log2 section

* Updated Release Version to 1.20.30-r2

* release +u

* Fixed UPDATE blocks causing a lot of issues in World generation

* Fixed Facing Direction property error on BlockAmethystBud

* Realized that BLOCK_FACE is required instead of FACING_DIRECTION

* release +u

* Updated Block Direction states from Chest, EnderChest and StoneCutter to CARDINAL_DIRECTION
TODO: Update Hashes in creativeitems.json

* Retention DisconnectPacket_v618

---------

Co-authored-by: Verox001 <verox@cimeyclust.com>
  • Loading branch information
lt-name and Verox001 committed Oct 27, 2023
1 parent 7e56c03 commit 9a9e505
Show file tree
Hide file tree
Showing 17 changed files with 226 additions and 79 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Join US:

What's new in PowerNukkitX? Let's See:

1. Support for 1.20.30 protocol.
1. Support for 1.20.40 protocol.
2. Support for 384 world height.
3. Support for The Nether world, no need to install additional plugin.
4. Support 3D biomes.<!--Custom dimension interface TODO-->
Expand Down Expand Up @@ -146,7 +146,7 @@ repositories {
}
dependencies {
compile group: 'cn.powernukkitx', name: 'powernukkitx', version: '1.20.30-r2'
compile group: 'cn.powernukkitx', name: 'powernukkitx', version: '1.20.40-r1'
}
```

Expand All @@ -156,7 +156,7 @@ dependencies {
<dependency>
<groupId>cn.powernukkitx</groupId>
<artifactId>powernukkitx</artifactId>
<version>1.20.30-r2</version>
<version>1.20.40-r1</version>
</dependency>
</dependencies>
```
Expand Down
8 changes: 4 additions & 4 deletions dumps/block-states.ini
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ pillar_axis=x,y,z
stripped_bit=0,1

[minecraft:chest]
facing_direction=0,1,2,3,4,5
minecraft:cardinal_direction=east,north,south,west

[minecraft:chiseled_bookshelf]
books_stored=0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63
Expand Down Expand Up @@ -1161,7 +1161,7 @@ facing_direction=0,1,2,3,4,5
[minecraft:end_stone]

[minecraft:ender_chest]
facing_direction=0,1,2,3,4,5
minecraft:cardinal_direction=east,north,south,west

[minecraft:exposed_copper]

Expand Down Expand Up @@ -2312,7 +2312,7 @@ stone_brick_type=chiseled,cracked,default,mossy,smooth
[minecraft:stonecutter]

[minecraft:stonecutter_block]
facing_direction=0,1,2,3,4,5
minecraft:cardinal_direction=east,north,south,west

[minecraft:stripped_acacia_log]
pillar_axis=x,y,z
Expand Down Expand Up @@ -2401,7 +2401,7 @@ open_bit=0,1
upside_down_bit=0,1

[minecraft:trapped_chest]
facing_direction=0,1,2,3,4,5
minecraft:cardinal_direction=east,north,south,west

[minecraft:trip_wire]
attached_bit=0,1
Expand Down
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-r2</version>
<version>1.20.40-r1</version>

<inceptionYear>2023</inceptionYear>
<organization>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class BlockChest extends BlockTransparentMeta implements Faceable, BlockE

@PowerNukkitOnly
@Since("1.5.0.0-PN")
public static final BlockProperties PROPERTIES = CommonBlockProperties.FACING_DIRECTION_BLOCK_PROPERTIES;
public static final BlockProperties PROPERTIES = new BlockProperties(CommonBlockProperties.CARDINAL_DIRECTION);

public BlockChest() {
this(0);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/cn/nukkit/block/BlockEnderChest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import cn.nukkit.blockentity.BlockEntity;
import cn.nukkit.blockentity.BlockEntityEnderChest;
import cn.nukkit.blockproperty.BlockProperties;
import cn.nukkit.blockproperty.CommonBlockProperties;
import cn.nukkit.item.Item;
import cn.nukkit.item.ItemBlock;
import cn.nukkit.item.ItemTool;
Expand All @@ -27,7 +28,7 @@ public class BlockEnderChest extends BlockTransparentMeta implements Faceable, B

@PowerNukkitOnly
@Since("1.5.0.0-PN")
public static final BlockProperties PROPERTIES = BlockChest.PROPERTIES;
public static final BlockProperties PROPERTIES = new BlockProperties(CommonBlockProperties.CARDINAL_DIRECTION);

private final Set<Player> viewers = new HashSet<>();

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/nukkit/block/BlockStonecutterBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class BlockStonecutterBlock extends BlockTransparentMeta implements Facea

@PowerNukkitOnly
@Since("1.5.0.0-PN")
public static final BlockProperties PROPERTIES = CommonBlockProperties.FACING_DIRECTION_BLOCK_PROPERTIES;
public static final BlockProperties PROPERTIES = new BlockProperties(CommonBlockProperties.CARDINAL_DIRECTION);

@PowerNukkitOnly
public BlockStonecutterBlock() {
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
4 changes: 2 additions & 2 deletions src/main/java/cn/nukkit/network/protocol/ProtocolInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ public interface ProtocolInfo {
/**
* Actual Minecraft: PE protocol version
*/
int CURRENT_PROTOCOL = dynamic(618);
int CURRENT_PROTOCOL = dynamic(622);

List<Integer> SUPPORTED_PROTOCOLS = Ints.asList(CURRENT_PROTOCOL);

String MINECRAFT_VERSION_NETWORK = dynamic("1.20.30");
String MINECRAFT_VERSION_NETWORK = dynamic("1.20.40");

String MINECRAFT_VERSION = 'v' + MINECRAFT_VERSION_NETWORK;

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
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package cn.nukkit.network.protocol.v618;

import cn.nukkit.network.protocol.DataPacket;
import cn.nukkit.network.protocol.ProtocolInfo;
import lombok.ToString;

/**
* @since 15-10-12
*/
@ToString
@Deprecated(since = "1.20.40-r1")
public class DisconnectPacket_v618 extends DataPacket {
public static final byte NETWORK_ID = ProtocolInfo.DISCONNECT_PACKET;

public boolean hideDisconnectionScreen = false;
public String message;

@Override
public byte pid() {
return NETWORK_ID;
}

@Override
public void decode() {
this.hideDisconnectionScreen = this.getBoolean();
this.message = this.getString();
}

@Override
public void encode() {
this.reset();
this.putBoolean(this.hideDisconnectionScreen);
if (!this.hideDisconnectionScreen) {
this.putString(this.message);
}
}


}
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 9a9e505

Please sign in to comment.