Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass a handle for the flying queue to sub checks of blockinteract.
To be done: * Use yaw and pitch of past packjets for Direction and Reach. * If block break mathes the last interacted block (+ moving sequence indicates no change), skip some checks like direction and reach there, possibly keep track if those were run at all.
- Loading branch information
Showing
6 changed files
with
59 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/net/FlyingQueueHandle.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package fr.neatmonster.nocheatplus.checks.net; | ||
|
||
import org.bukkit.entity.Player; | ||
|
||
import fr.neatmonster.nocheatplus.checks.CheckType; | ||
import fr.neatmonster.nocheatplus.checks.net.model.DataPacketFlying; | ||
import fr.neatmonster.nocheatplus.components.registry.event.IHandle; | ||
|
||
/** | ||
* Convenience for providing several checks with a lazy-init handle for fetching | ||
* queued flying packets. Future concept should be somehow linking follow-up | ||
* packets (flying->dig) to each other... | ||
* | ||
* @author asofold | ||
* | ||
*/ | ||
public class FlyingQueueHandle implements IHandle<DataPacketFlying[]> { | ||
|
||
private final Player player; | ||
private DataPacketFlying[] queue; | ||
|
||
public FlyingQueueHandle(Player player) { | ||
this.player = player; | ||
} | ||
|
||
@Override | ||
public DataPacketFlying[] getHandle() { | ||
if (queue == null) { | ||
queue = ((NetData) CheckType.NET.getDataFactory().getData(player)).copyFlyingQueue(); | ||
} | ||
return queue; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters