mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-18 03:25:35 +00:00
Add dynamic render option without relying on doesTick (#38)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
238b041f12
commit
a36120fc91
2 files changed
+8
-1
No files matched your search
@@ -316,6 +316,12 @@ abstract class TMultiPart {
|
||||
*/
|
||||
def doesTick = true
|
||||
|
||||
/** Return whether this part needs to be included in the dynamic render loop
|
||||
* (renderDynamic). Default is false. Override this to true for parts like
|
||||
* lights that need per-frame rendering but no logic updates.
|
||||
*/
|
||||
def shouldRenderDynamic = false
|
||||
|
||||
/** Called once per world tick. This will be called even if doesTick returns
|
||||
* false if another part in the space needs ticks.
|
||||
*/
|
||||
|
||||
@@ -480,7 +480,8 @@ trait TileMultipartClient extends TileMultipart {
|
||||
|
||||
def updateRenderCache() {
|
||||
if (partList != null) {
|
||||
val (dynamic, static) = partList.partition(_.doesTick)
|
||||
val (dynamic, static) =
|
||||
partList.partition(p => p.doesTick || p.shouldRenderDynamic)
|
||||
val sArr = static.toArray
|
||||
val dArr = dynamic.toArray
|
||||
|
||||
|
||||
Reference in new issue
Block a user