Limit block placement/interaction packets

By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
CraftBukkit/Spigot
2014-06-29 21:10:34 +01:00
parent 7bee9a20b3
commit 804b118219
3 changed files with 120 additions and 67 deletions

View File

@@ -5,3 +5,19 @@
package net.minecraft.network.protocol.game;
import net.minecraft.network.FriendlyByteBuf;
@@ -13,6 +14,7 @@
private final BlockHitResult blockHit;
private final InteractionHand hand;
private final int sequence;
+ public long timestamp; // Spigot
public ServerboundUseItemOnPacket(InteractionHand hand, BlockHitResult blockHitResult, int sequence) {
this.hand = hand;
@@ -21,6 +23,7 @@
}
private ServerboundUseItemOnPacket(FriendlyByteBuf buf) {
+ this.timestamp = System.currentTimeMillis(); // Spigot
this.hand = (InteractionHand) buf.readEnum(InteractionHand.class);
this.blockHit = buf.readBlockHitResult();
this.sequence = buf.readVarInt();

View File

@@ -5,3 +5,19 @@
package net.minecraft.network.protocol.game;
import net.minecraft.network.FriendlyByteBuf;
@@ -13,6 +14,7 @@
private final int sequence;
private final float yRot;
private final float xRot;
+ public long timestamp; // Spigot
public ServerboundUseItemPacket(InteractionHand hand, int sequence, float yaw, float pitch) {
this.hand = hand;
@@ -22,6 +24,7 @@
}
private ServerboundUseItemPacket(FriendlyByteBuf buf) {
+ this.timestamp = System.currentTimeMillis(); // Spigot
this.hand = (InteractionHand) buf.readEnum(InteractionHand.class);
this.sequence = buf.readVarInt();
this.yRot = buf.readFloat();