Tiny cleanup allow it to be disabled via config and add lenis0012 to contributors <3

This commit is contained in:
Myles 2016-03-09 21:30:43 +00:00
parent 7b36a9de51
commit c11ad7930f
5 changed files with 12 additions and 7 deletions

View File

@ -40,6 +40,8 @@ Contributors:
**fillefilip8**
**lenis0012**
Releases / Dev Builds:

View File

@ -73,7 +73,8 @@ public class ViaVersionPlugin extends JavaPlugin implements ViaVersionAPI {
getLogger().info("ViaVersion " + getDescription().getVersion() + " is now enabled, injecting. (Allows 1.8 to be accessed via 1.9)");
injectPacketHandler();
new ViaIdleThread(portedPlayers).runTaskTimerAsynchronously(this, 1L, 1L); // Updates player's idle status
if (getConfig().getBoolean("simulate-pt", true))
new ViaIdleThread(portedPlayers).runTaskTimerAsynchronously(this, 1L, 1L); // Updates player's idle status
if (getConfig().getBoolean("checkforupdates"))
UpdateUtil.sendUpdateMessage(this);

View File

@ -38,11 +38,6 @@ public class ViaDecodeHandler extends ByteToMessageDecoder {
bytebuf.clear();
throw e;
}
// Update idle status (player, position, look, positionandlook)
if(id == 0x0F || id == 0x0E || id == 0x0D || id == 0x0C) {
info.incrementIdlePacket();
}
}
// call minecraft decoder
list.addAll(PacketUtil.callDecode(this.minecraftDecoder, ctx, bytebuf));

View File

@ -43,6 +43,11 @@ public class IncomingTransformer {
if (packet == PacketType.PLAY_TP_CONFIRM || packet == PacketType.PLAY_VEHICLE_MOVE_REQUEST) { //TODO handle client-sided horse riding
throw new CancelException();
}
// Handle movement increment
// Update idle status (player, position, look, positionandlook)
if(packet == PacketType.PLAY_PLAYER || packet == PacketType.PLAY_PLAYER_POSITION_REQUEST || packet == PacketType.PLAY_PLAYER_LOOK_REQUEST || packet == PacketType.PLAY_PLAYER_POSITION_LOOK_REQUEST) {
info.incrementIdlePacket();
}
PacketUtil.writeVarInt(packetID, output);
if (packet == PacketType.HANDSHAKE) {
int protVer = PacketUtil.readVarInt(input);

View File

@ -16,4 +16,6 @@ shield-blocking: true
# If they're in the wrong place enable this
hologram-patch: false
# This is the offset, should work as default when enabled.
hologram-y: -1
hologram-y: -1
# Enable player tick simulation, this fixes eating, drinking, nether portals.
simulate-pt: true