mirror of
https://github.com/funkemunky/KauriV3.git
synced 2026-07-01 02:08:27 +00:00
Fixed NoFall (C) false positives, optimized chunk watching, fixed lag backs
This commit is contained in:
@@ -89,13 +89,13 @@ public class Check implements ECheck {
|
||||
} else {
|
||||
player.getInfo().getLastCancel().reset();
|
||||
|
||||
Location ground = player.getInfo().isServerGround() && player.getMovement().getLastTeleport().isPassed(1)
|
||||
final Location ground = player.getInfo().isServerGround()
|
||||
? player.getMovement().getFrom().getLoc()
|
||||
.toLocation(player.getBukkitPlayer().getWorld())
|
||||
: MovementUtils.findGroundLocation(player.getMovement().getFrom().getLoc()
|
||||
.toLocation(player.getBukkitPlayer().getWorld()), 10);
|
||||
|
||||
player.getBukkitPlayer().teleport(ground);
|
||||
RunUtils.task(() -> player.getBukkitPlayer().teleport(ground));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,14 +34,14 @@ public class NoFallC extends Check {
|
||||
fallDistance = 0;
|
||||
} else fallDistance+= player.getMovement().getDeltaY();
|
||||
|
||||
if(player.getInfo().isServerGround()) {
|
||||
if(player.getBlockInfo().blocksBelow && packet.getY() % MathUtils.GROUND_DIVISOR == 0) {
|
||||
trueFallDistance = 0;
|
||||
fallDistance = 0;
|
||||
} else trueFallDistance+= player.getMovement().getDeltaY();
|
||||
|
||||
double delta = MathUtils.getDelta(trueFallDistance, fallDistance);
|
||||
|
||||
if(delta > 0.1) {
|
||||
if(delta > 0.1 && !player.getInfo().isNearGround()) {
|
||||
flag("delta=%.4f;fd=%.4f;tf=%.4f", delta, fallDistance, trueFallDistance);
|
||||
fallDistance = trueFallDistance = 0;
|
||||
cancel();
|
||||
|
||||
@@ -195,6 +195,7 @@ public class BlockInformation {
|
||||
XMaterial blockMaterial = BlockUtils.getXMaterial(type);
|
||||
|
||||
if(newBox(1.4, 0).expandMin(0, -1, 0)
|
||||
.expand(0.3,0,0.3)
|
||||
.isIntersected(blockBox))
|
||||
blocksBelow = true;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class LoggerManager {
|
||||
long now = System.currentTimeMillis();
|
||||
if(logList.size() > 0 && (now - lastWrite.get() > 10000L || logList.size() > 600)) {
|
||||
try {
|
||||
WebSocket socket = new WebSocketFactory().createSocket("ws://5.161.41.238/logsocket").connect();
|
||||
WebSocket socket = new WebSocketFactory().createSocket("ws://logs.funkemunky.cc/logsocket").connect();
|
||||
|
||||
System.out.println("Writing logs");
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
@@ -199,7 +199,7 @@ public class LoggerManager {
|
||||
}
|
||||
|
||||
private WebSocket createSocket(Consumer<List<Log>> logsConsumer) throws IOException {
|
||||
return new WebSocketFactory().createSocket("ws://5.161.41.238/logsocket")
|
||||
return new WebSocketFactory().createSocket("ws://logs.funkemunky.cc/logsocket")
|
||||
.addListener(new WebSocketAdapter() {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -756,7 +756,8 @@ public class Processor_18 implements PacketConverter {
|
||||
int chunkZ = serialized.readInt();
|
||||
boolean groundUp = serialized.readBoolean();
|
||||
int size = serialized.readShort();
|
||||
byte[] locs = serialized.a();
|
||||
byte[] locs = new byte[serialized.e()];
|
||||
serialized.readBytes(locs);
|
||||
|
||||
Map<IntVector, WPacketPlayOutMapChunk.MinBlock> blocks = new HashMap<>();
|
||||
|
||||
|
||||
@@ -15,6 +15,8 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class MathUtils {
|
||||
|
||||
public static double GROUND_DIVISOR = 0.015625;
|
||||
|
||||
public static double offset(Vector from, Vector to) {
|
||||
from.setY(0);
|
||||
to.setY(0);
|
||||
|
||||
@@ -141,7 +141,7 @@ public class MovementUtils {
|
||||
if(!block.isPresent()) break; //No point in continuing since the one below will still be not present.
|
||||
|
||||
if(Materials.checkFlag(block.get().getType(), Materials.SOLID)
|
||||
&& Materials.checkFlag(block.get().getType(), Materials.LIQUID)) {
|
||||
|| Materials.checkFlag(block.get().getType(), Materials.LIQUID)) {
|
||||
CollisionBox box = BlockData.getData(block.get().getType())
|
||||
.getBox(block.get(), ProtocolVersion.getGameVersion());
|
||||
|
||||
@@ -155,7 +155,7 @@ public class MovementUtils {
|
||||
box.downCast(sboxes);
|
||||
|
||||
double maxY = sboxes.stream().max(Comparator.comparing(sbox -> sbox.maxY)).map(s -> s.maxY)
|
||||
.orElse(y + 1.);
|
||||
.orElse(y + 0.01);
|
||||
|
||||
return new Location(block.get().getWorld(), x, maxY, z);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user