-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #460 from j10a1n15/technical/event
Backend: Use new Event System
- Loading branch information
Showing
46 changed files
with
225 additions
and
359 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
40 changes: 40 additions & 0 deletions
40
src/main/kotlin/me/partlysanestudios/partlysaneskies/api/WaypointRenderPipeline.kt
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,40 @@ | ||
// | ||
// Written by Su386. | ||
// See LICENSE for copyright and license notices. | ||
// | ||
|
||
package me.partlysanestudios.partlysaneskies.api | ||
|
||
import me.partlysanestudios.partlysaneskies.render.waypoint.Waypoint | ||
import me.partlysanestudios.partlysaneskies.utils.geometry.vectors.Point3d.Companion.toPoint3d | ||
import net.minecraft.client.Minecraft | ||
|
||
class WaypointRenderPipeline { | ||
private val waypointsToRender = ArrayList<Waypoint>() | ||
|
||
/** | ||
* Adds a waypoint to the render pipeline | ||
* | ||
* @param waypoint the waypoint to be rendered | ||
*/ | ||
fun add(waypoint: Waypoint) { | ||
waypointsToRender.add(waypoint) | ||
} | ||
|
||
// Written partially by j10a1n15 | ||
/** | ||
* Renders all the waypoints in the pipeline | ||
* | ||
* @param partialTicks the amount of partial ticks since the last frame that rendered | ||
*/ | ||
internal fun renderAll(partialTicks: Float) { | ||
val mc = Minecraft.getMinecraft() | ||
|
||
for (waypoint in waypointsToRender) { | ||
val waypointPos = waypoint.position.toPoint3d() | ||
val distance = waypointPos.distanceToPlayer() | ||
|
||
waypoint.render(distance) | ||
} | ||
} | ||
} |
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
Oops, something went wrong.