-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5 Speed check fixes, violation data timeout + new command.
- Loading branch information
Showing
12 changed files
with
199 additions
and
59 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
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
47 changes: 47 additions & 0 deletions
47
src/main/java/me/vrekt/arc/utility/block/ray/RayTrace.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,47 @@ | ||
package me.vrekt.arc.utility.block.ray; | ||
|
||
import cn.nukkit.level.Level; | ||
import cn.nukkit.level.Location; | ||
import cn.nukkit.math.AxisAlignedBB; | ||
|
||
/** | ||
* Represents a ray tracer. | ||
*/ | ||
public interface RayTrace { | ||
|
||
/** | ||
* Set where to ray-trace. | ||
* | ||
* @param from the starting location | ||
* @param to the end location | ||
* @param bb the player bounding box. | ||
*/ | ||
void set(Location from, Location to, AxisAlignedBB bb); | ||
|
||
/** | ||
* Loop through all blocks defined within the start and end position. | ||
*/ | ||
void loop(); | ||
|
||
/** | ||
* Step through the next block, returning {@code true} if there is a collision. | ||
* | ||
* @param level the level | ||
* @param blockX the block X | ||
* @param blockY the block Y | ||
* @param blockZ the block Z | ||
* @param minX minimum X | ||
* @param minY minimum Y | ||
* @param minZ minimum Z | ||
* @param maxX maximum X | ||
* @param maxY maximum Y | ||
* @param maxZ maximum Z | ||
* @return {@code true} if any collision occurs. | ||
*/ | ||
boolean step(Level level, final int blockX, final int blockY, final int blockZ, | ||
final double minX, final double minY, final double minZ, | ||
final double maxX, final double maxY, final double maxZ); | ||
|
||
boolean collides(); | ||
|
||
} |
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
Oops, something went wrong.