forked from Crasher508/Barrel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update for CloudburstMC/Protocol v3 and MCBE 1.19.80
- Loading branch information
1 parent
dfea0bc
commit cfeb934
Showing
48 changed files
with
305 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/org/barrelmc/barrel/network/translator/bedrock/DisconnectPacket.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 10 additions & 10 deletions
20
src/main/java/org/barrelmc/barrel/network/translator/bedrock/NetworkSettingsPacket.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
package org.barrelmc.barrel.network.translator.bedrock; | ||
|
||
import com.nukkitx.protocol.bedrock.BedrockPacket; | ||
import org.cloudburstmc.protocol.bedrock.packet.BedrockPacket; | ||
import org.barrelmc.barrel.network.translator.interfaces.BedrockPacketTranslator; | ||
import org.barrelmc.barrel.player.Player; | ||
import org.barrelmc.barrel.server.ProxyServer; | ||
|
||
public class NetworkSettingsPacket implements BedrockPacketTranslator { | ||
@Override | ||
public void translate(BedrockPacket pk, Player player) { | ||
com.nukkitx.protocol.bedrock.packet.NetworkSettingsPacket packet = (com.nukkitx.protocol.bedrock.packet.NetworkSettingsPacket) pk; | ||
player.getBedrockClient().getSession().setCompression(packet.getCompressionAlgorithm()); | ||
org.cloudburstmc.protocol.bedrock.packet.NetworkSettingsPacket packet = (org.cloudburstmc.protocol.bedrock.packet.NetworkSettingsPacket) pk; | ||
player.getBedrockClientSession().setCompression(packet.getCompressionAlgorithm()); | ||
|
||
if (ProxyServer.getInstance().getConfig().getAuth().equals("offline")) { | ||
player.getBedrockClient().getSession().sendPacketImmediately(player.getLoginPacket()); | ||
} else { | ||
try { | ||
player.getBedrockClient().getSession().sendPacketImmediately(player.getOnlineLoginPacket()); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
try { | ||
if (ProxyServer.getInstance().getConfig().getAuth().equals("offline")) { | ||
player.getBedrockClientSession().sendPacketImmediately(player.getLoginPacket()); | ||
} else { | ||
player.getBedrockClientSession().sendPacketImmediately(player.getOnlineLoginPacket()); | ||
} | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
Oops, something went wrong.