6 Commits
Author SHA1 Message Date
Maya 972ccacc69 update 2025-06-03 13:00:41 -06:00
AlexdoruandMaya e58530f587 Fix WorldClient memory leak (#9)
Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
2025-06-03 19:00:30 +00:00
Martin Robertz c75c509fda update 2025-06-03 18:20:45 +02:00
Alexdoru b2c051b597 use one local variable for the Tesselator, so it can be transformed properly (#8) 2025-06-03 13:19:41 +02:00
Martin Robertz 5b34a69e2b update 2025-01-03 23:29:50 +01:00
Martin Robertz 582ed32314 update cc Render State 2025-01-03 23:29:30 +01:00
10 changed files with 31 additions and 22 deletions

No files matched your search

+1
View File
@@ -30,3 +30,4 @@ src/main/resources/mixins.*.json
*.bat *.bat
*.DS_Store *.DS_Store
!gradlew.bat !gradlew.bat
layout.json
+1 -1
View File
@@ -1,3 +1,3 @@
dependencies { dependencies {
api 'com.github.GTNewHorizons:MrTJPCore:1.2.1:dev' api 'com.github.GTNewHorizons:MrTJPCore:1.3.0:dev'
} }
+1 -1
View File
@@ -14,7 +14,7 @@ modId = ForgeRelocation
modGroup = mrtjp.relocation modGroup = mrtjp.relocation
# Whether to use modGroup as the maven publishing group. # Whether to use modGroup as the maven publishing group.
# Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods. # When false, com.github.GTNewHorizons is used.
useModGroupForPublishing = false useModGroupForPublishing = false
# Updates your build.gradle and settings.gradle automatically whenever an update is available. # Updates your build.gradle and settings.gradle automatically whenever an update is available.
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
Vendored
+2 -3
View File
@@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034 # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/} APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum MAX_FD=maximum
@@ -206,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command: # Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, # * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped. # and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line. # treated as '${Hostname}' itself on the command line.
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
} }
plugins { plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30' id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.38'
} }
+8 -8
View File
@@ -191,9 +191,9 @@ object RenderFrame extends ISimpleBlockRenderingHandler {
) { ) {
TextureUtils.bindAtlas(0) TextureUtils.bindAtlas(0)
val state = CCRenderState.instance val state = CCRenderState.instance
state.reset() state.resetInstance()
state.lightMatrix.locate(w, x, y, z) state.lightMatrix.locate(w, x, y, z)
state.setBrightness(w, x, y, z) state.setBrightnessInstance(w, x, y, z)
if (r.hasOverrideBlockTexture) { if (r.hasOverrideBlockTexture) {
getOrGenerateModel(0).render( getOrGenerateModel(0).render(
@@ -206,15 +206,15 @@ object RenderFrame extends ISimpleBlockRenderingHandler {
def renderInvBlock(r: RenderBlocks, meta: Int) { def renderInvBlock(r: RenderBlocks, meta: Int) {
TextureUtils.bindAtlas(0) TextureUtils.bindAtlas(0)
val state = CCRenderState.instance val state = CCRenderState.instance
state.reset() state.resetInstance()
state.setDynamic() state.setDynamicInstance()
state.pullLightmap() state.pullLightmapInstance()
state.startDrawing() state.startDrawingInstance()
RenderFrame.render(new Vector3(-0.5, -0.5, -0.5), 0) RenderFrame.render(new Vector3(-0.5, -0.5, -0.5), 0)
state.render() state.renderInstance()
state.draw() state.drawInstance()
} }
def registerIcons(reg: IIconRegister) { def registerIcons(reg: IIconRegister) {
+3 -1
View File
@@ -52,7 +52,9 @@ object RelocationClientEventHandler {
@SubscribeEvent @SubscribeEvent
def clientTick(event: TickEvent.ClientTickEvent) { def clientTick(event: TickEvent.ClientTickEvent) {
if (event.phase == TickEvent.Phase.END) if (event.phase == TickEvent.Phase.END) {
MovementManager2.onTick(true) MovementManager2.onTick(true)
MovingRenderer.onTick()
}
} }
} }
+13 -6
View File
@@ -32,7 +32,6 @@ object MovingRenderer {
private def mc = Minecraft.getMinecraft private def mc = Minecraft.getMinecraft
private def world = mc.theWorld private def world = mc.theWorld
private def tes = Tessellator.instance
private def render(x: Int, y: Int, z: Int, rpos: Vector3) { private def render(x: Int, y: Int, z: Int, rpos: Vector3) {
val oldOcclusion = mc.gameSettings.ambientOcclusion val oldOcclusion = mc.gameSettings.ambientOcclusion
@@ -65,8 +64,9 @@ object MovingRenderer {
) )
for (pass <- 0 to 1) { for (pass <- 0 to 1) {
tes.startDrawingQuads() val tess = Tessellator.instance
tes.setTranslation( tess.startDrawingQuads()
tess.setTranslation(
-TileEntityRendererDispatcher.staticPlayerX + MathLib -TileEntityRendererDispatcher.staticPlayerX + MathLib
.clamp(-1f, 1f, rpos.x.toFloat), .clamp(-1f, 1f, rpos.x.toFloat),
-TileEntityRendererDispatcher.staticPlayerY + MathLib -TileEntityRendererDispatcher.staticPlayerY + MathLib
@@ -77,7 +77,7 @@ object MovingRenderer {
rpos.z.toFloat rpos.z.toFloat
) )
) )
tes.setColorOpaque(1, 1, 1) tess.setColorOpaque(1, 1, 1)
block.getRenderBlockPass block.getRenderBlockPass
if (block.canRenderInPass(pass)) { if (block.canRenderInPass(pass)) {
@@ -86,8 +86,8 @@ object MovingRenderer {
renderHack = true renderHack = true
} }
tes.setTranslation(0, 0, 0) tess.setTranslation(0, 0, 0)
tes.draw() tess.draw()
} }
RenderHelper.enableStandardItemLighting() RenderHelper.enableStandardItemLighting()
mc.entityRenderer.disableLightmap(frame) mc.entityRenderer.disableLightmap(frame)
@@ -106,6 +106,13 @@ object MovingRenderer {
render(b.x, b.y, b.z, renderPos(s, frame)) render(b.x, b.y, b.z, renderPos(s, frame))
} }
def onTick() = {
if (oldWorld != null && world == null) {
oldWorld = null
renderBlocks = null
}
}
def onPreRenderTick(time: Float) { def onPreRenderTick(time: Float) {
isRendering = true isRendering = true
frame = time frame = time