Merge remote-tracking branch 'origin/master' into dev

This commit is contained in:
Nassim Jahnke 2021-11-03 09:30:20 +01:00
commit d9307dad0c
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
2 changed files with 6 additions and 3 deletions

View File

@ -97,8 +97,8 @@ public enum ClientboundPackets1_13 implements ClientboundPacketType {
SPAWN_POSITION, // 0x49
TIME_UPDATE, // 0x4A
TITLE, // 0x4B
STOP_SOUND, // 0x4D
SOUND, // 0x4C
STOP_SOUND, // 0x4C
SOUND, // 0x4D
TAB_LIST, // 0x4E
COLLECT_ITEM, // 0x4F
ENTITY_TELEPORT, // 0x50

View File

@ -350,10 +350,13 @@ public class PlayerPackets {
map(Type.FLOAT); //1 - Value
handler(wrapper -> {
if (wrapper.get(Type.UNSIGNED_BYTE, 0) == 3) { //Change gamemode
short reason = wrapper.get(Type.UNSIGNED_BYTE, 0);
if (reason == 3) { //Change gamemode
int gamemode = wrapper.get(Type.FLOAT, 0).intValue();
EntityTracker1_9 tracker = wrapper.user().getEntityTracker(Protocol1_9To1_8.class);
tracker.setGameMode(GameMode.getById(gamemode));
} else if (reason == 4) { //Open credits screen
wrapper.set(Type.FLOAT, 0, 1F);
}
});
}