Skip to content

Commit

Permalink
v1_13 fix
Browse files Browse the repository at this point in the history
 - Remove v1_13_R1 (Confirms not to be working)
 - Fix relative Move for v1_13_R2 (NMS Packet incompatible with v1_14_R1+)
  • Loading branch information
patrick-choe committed Jun 28, 2020
1 parent 47228ae commit 35d6684
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 394 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.comphenix.protocol.events.PacketContainer
import com.comphenix.protocol.wrappers.EnumWrappers
import com.comphenix.protocol.wrappers.WrappedDataWatcher
import com.github.noonmaru.tap.fake.createFakeEntity
import com.github.noonmaru.tap.loader.LibraryLoader
import org.bukkit.FireworkEffect
import org.bukkit.Location
import org.bukkit.entity.*
Expand Down Expand Up @@ -166,10 +167,17 @@ class EntityPacketSupport {
return PacketContainer(PacketType.Play.Server.REL_ENTITY_MOVE).apply {
integers
.write(0, entityId)
shorts
.write(0, deltaX)
.write(1, deltaY)
.write(2, deltaZ)
if (isLegacyProtocolVersion) {
integers
.write(0, deltaX.toInt())
.write(1, deltaY.toInt())
.write(2, deltaZ.toInt())
} else {
shorts
.write(0, deltaX)
.write(1, deltaY)
.write(2, deltaZ)
}
booleans
.write(0, onGround)
}
Expand Down Expand Up @@ -210,10 +218,17 @@ class EntityPacketSupport {
return PacketContainer(PacketType.Play.Server.REL_ENTITY_MOVE_LOOK).apply {
integers
.write(0, entityId)
shorts
.write(0, deltaX)
.write(1, deltaY)
.write(2, deltaZ)
if (isLegacyProtocolVersion) {
integers
.write(0, deltaX.toInt())
.write(1, deltaY.toInt())
.write(2, deltaZ.toInt())
} else {
shorts
.write(0, deltaX)
.write(1, deltaY)
.write(2, deltaZ)
}
bytes
.write(0, (yaw * 256.0 / 360.0).toByte())
.write(1, (pitch * 256.0 / 360.0).toByte())
Expand Down Expand Up @@ -290,4 +305,7 @@ class EffectPacketSupport {
)
}
}
}
}

private val isLegacyProtocolVersion: Boolean
get() = LibraryLoader.getBukkitVersion().split("_")[1].toInt() < 14
1 change: 0 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ rootProject.name = "tap"

include(
"api",
"v1_13_R1",
"v1_13_R2",
"v1_14_R1",
"v1_15_R1",
Expand Down
3 changes: 0 additions & 3 deletions v1_13_R1/build.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 35d6684

Please sign in to comment.