mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-18 00:25:30 +01:00
Added PlayerStartDiggingEvent warning
This commit is contained in:
parent
408ce03cfb
commit
f30330c59b
@ -8,6 +8,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
/**
|
||||
* Called when a {@link Player} start digging a block,
|
||||
* can be used to forbid the {@link Player} from mining it.
|
||||
* <p>
|
||||
* Be aware that cancelling this event does not necessary prevent the player from breaking the block
|
||||
* (could be because of high latency or a modified client) so cancelling {@link PlayerBlockBreakEvent} is also necessary.
|
||||
* Could be fixed in future Minestom version.
|
||||
*/
|
||||
public class PlayerStartDiggingEvent extends CancellableEvent {
|
||||
|
||||
|
@ -74,6 +74,7 @@ public class NettyServer {
|
||||
pipeline.addLast("traffic-limiter", channelTrafficShapingHandler);
|
||||
|
||||
// First check should verify if the packet is a legacy ping (from 1.6 version and earlier)
|
||||
// Removed from the pipeline later in LegacyPingHandler if unnecessary (>1.6)
|
||||
pipeline.addLast("legacy-ping", new LegacyPingHandler());
|
||||
|
||||
// Adds packetLength at start | Reads framed bytebuf
|
||||
|
@ -65,8 +65,8 @@ public class NettyPlayerConnection extends PlayerConnection {
|
||||
public void setEncryptionKey(@NotNull SecretKey secretKey) {
|
||||
Check.stateCondition(encrypted, "Encryption is already enabled!");
|
||||
this.encrypted = true;
|
||||
getChannel().pipeline().addBefore("framer", "decrypt", new Decrypter(MojangCrypt.getCipher(2, secretKey)));
|
||||
getChannel().pipeline().addBefore("framer", "encrypt", new Encrypter(MojangCrypt.getCipher(1, secretKey)));
|
||||
channel.pipeline().addBefore("framer", "decrypt", new Decrypter(MojangCrypt.getCipher(2, secretKey)));
|
||||
channel.pipeline().addBefore("framer", "encrypt", new Encrypter(MojangCrypt.getCipher(1, secretKey)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user