mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-01 17:01:56 +01:00
Fix patch, need to investigate build issues
This commit is contained in:
parent
4b7796fe7c
commit
5ba385dd4c
1 changed files with 1 additions and 10 deletions
|
@ -53,9 +53,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.player.resetIdleTimer();
|
||||
+
|
||||
+ // Paper start - Rate limit UseItem as well, copied from Spigot implementation below in BlockPlace
|
||||
+ boolean throttled = false;
|
||||
+ if (lastPlaceUse != -1 && packetplayinuseitem.timestamp - lastPlaceUse < 30 && packetsUse++ >= 4) {
|
||||
+ throttled = true;
|
||||
+ return;
|
||||
+ } else if (packetplayinuseitem.timestamp - lastPlaceUse >= 30 || lastPlaceUse == -1) {
|
||||
+ lastPlaceUse = packetplayinuseitem.timestamp;
|
||||
+ packetsUse = 0;
|
||||
|
@ -65,12 +64,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
if (blockposition.getY() >= this.minecraftServer.getMaxBuildHeight() - 1 && (enumdirection == EnumDirection.UP || blockposition.getY() >= this.minecraftServer.getMaxBuildHeight())) {
|
||||
ChatMessage chatmessage = new ChatMessage("build.tooHigh", new Object[] { Integer.valueOf(this.minecraftServer.getMaxBuildHeight())});
|
||||
|
||||
chatmessage.getChatModifier().setColor(EnumChatFormat.RED);
|
||||
this.player.playerConnection.sendPacket(new PacketPlayOutChat(chatmessage));
|
||||
- } else if (this.teleportPos == null && this.player.e((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && !this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
|
||||
+ // Paper - Ignore if throttled
|
||||
+ } else if (!throttled && this.teleportPos == null && this.player.e((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && !this.minecraftServer.a(worldserver, blockposition, this.player) && worldserver.getWorldBorder().a(blockposition)) {
|
||||
// CraftBukkit start - Check if we can actually do something over this large a distance
|
||||
Location eyeLoc = this.getPlayer().getEyeLocation();
|
||||
double reachDistance = NumberConversions.square(eyeLoc.getX() - blockposition.getX()) + NumberConversions.square(eyeLoc.getY() - blockposition.getY()) + NumberConversions.square(eyeLoc.getZ() - blockposition.getZ());
|
||||
--
|
Loading…
Reference in a new issue