Compare commits

...
5 Commits
Author SHA1 Message Date
bombcar 901dfcb5a0 Merge pull request #21 from GTNewHorizons/chicken
update to support 1.2.0 CCL - needs work to be more performant
2024-01-03 05:38:30 -06:00
bombcar 794c3ca030 fix the rest 2024-01-02 13:07:44 -06:00
bombcar ee37e779fd partial maintain state 2024-01-02 13:02:02 -06:00
bombcar 5039fb8984 update to support 1.2.0 CCL - needs work to be more performant 2024-01-02 11:38:11 -06:00
Martin Robertz cb276d92f5 update bs 2024-01-01 20:21:30 +01:00
11 changed files with 57 additions and 64 deletions

No files matched your search

+13 -18
View File
@@ -1,4 +1,4 @@
//version: 1702141377 //version: 1704135167
/* /*
DO NOT CHANGE THIS FILE! DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available. Also, you may replace this file at any time if there is an update available.
@@ -31,8 +31,7 @@ buildscript {
maven { maven {
// GTNH RetroFuturaGradle and ASM Fork // GTNH RetroFuturaGradle and ASM Fork
name "GTNH Maven" name "GTNH Maven"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" url "https://nexus.gtnewhorizons.com/repository/public/"
allowInsecureProtocol = true
} }
mavenLocal() mavenLocal()
} }
@@ -49,7 +48,7 @@ plugins {
id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle id 'org.ajoberstar.grgit' version '4.1.1' // 4.1.1 is the last jvm8 supporting version, unused, available for addon.gradle
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false id 'com.github.johnrengelman.shadow' version '8.1.1' apply false
id 'com.palantir.git-version' version '3.0.0' apply false id 'com.palantir.git-version' version '3.0.0' apply false
id 'de.undercouch.download' version '5.4.0' id 'de.undercouch.download' version '5.5.0'
id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle id 'com.github.gmazzo.buildconfig' version '3.1.0' apply false // Unused, available for addon.gradle
id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version
id 'com.modrinth.minotaur' version '2.+' apply false id 'com.modrinth.minotaur' version '2.+' apply false
@@ -118,7 +117,7 @@ propertyDefaultIfUnset("forceEnableMixins", false)
propertyDefaultIfUnset("channel", "stable") propertyDefaultIfUnset("channel", "stable")
propertyDefaultIfUnset("mappingsVersion", "12") propertyDefaultIfUnset("mappingsVersion", "12")
propertyDefaultIfUnset("usesMavenPublishing", true) propertyDefaultIfUnset("usesMavenPublishing", true)
propertyDefaultIfUnset("mavenPublishUrl", "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases") propertyDefaultIfUnset("mavenPublishUrl", "https://nexus.gtnewhorizons.com/repository/releases/")
propertyDefaultIfUnset("modrinthProjectId", "") propertyDefaultIfUnset("modrinthProjectId", "")
propertyDefaultIfUnset("modrinthRelations", "") propertyDefaultIfUnset("modrinthRelations", "")
propertyDefaultIfUnset("curseForgeProjectId", "") propertyDefaultIfUnset("curseForgeProjectId", "")
@@ -573,13 +572,15 @@ afterEvaluate {
repositories { repositories {
maven { maven {
name 'Overmind forge repo mirror' name = "GTNH Maven"
url 'https://gregtech.overminddl1.com/' url = "https://nexus.gtnewhorizons.com/repository/public/"
// Links for convenience:
// Simple HTML browsing: https://nexus.gtnewhorizons.com/service/rest/repository/browse/releases/
// Rich web UI browsing: https://nexus.gtnewhorizons.com/#browse/browse:releases
} }
maven { maven {
name = "GTNH Maven" name 'Overmind forge repo mirror'
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/" url 'https://gregtech.overminddl1.com/'
allowInsecureProtocol = true
} }
maven { maven {
name 'sonatype' name 'sonatype'
@@ -960,8 +961,7 @@ if (usesShadowedDependencies.toBoolean()) {
configurations.runtimeElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) configurations.runtimeElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar))
configurations.apiElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar)) configurations.apiElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar))
tasks.named("jar", Jar) { tasks.named("jar", Jar) {
enabled = false archiveClassifier.set('dev-preshadow')
finalizedBy(tasks.shadowJar)
} }
tasks.named("reobfJar", ReobfuscatedJar) { tasks.named("reobfJar", ReobfuscatedJar) {
inputJar.set(tasks.named("shadowJar", ShadowJar).flatMap({it.archiveFile})) inputJar.set(tasks.named("shadowJar", ShadowJar).flatMap({it.archiveFile}))
@@ -970,11 +970,6 @@ if (usesShadowedDependencies.toBoolean()) {
javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) { javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
skip() skip()
} }
for (runTask in ["runClient", "runServer", "runClient17", "runServer17"]) {
tasks.named(runTask).configure {
dependsOn("shadowJar")
}
}
} }
ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar
ext.publishableObfJar = tasks.reobfJar ext.publishableObfJar = tasks.reobfJar
@@ -1178,7 +1173,7 @@ publishing {
if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) { if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) {
maven { maven {
url = mavenPublishUrl url = mavenPublishUrl
allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven allowInsecureProtocol = mavenPublishUrl.startsWith("http://")
credentials { credentials {
username = System.getenv("MAVEN_USER") ?: "NONE" username = System.getenv("MAVEN_USER") ?: "NONE"
password = System.getenv("MAVEN_PASSWORD") ?: "NONE" password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
+1 -1
View File
@@ -1,6 +1,6 @@
// Add your dependencies here // Add your dependencies here
dependencies { dependencies {
api("com.github.GTNewHorizons:CodeChickenLib:1.1.8:dev") api("com.github.GTNewHorizons:CodeChickenLib:1.2.0:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.4.13-GTNH:dev") devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.4.13-GTNH:dev")
} }
-7
View File
@@ -1,7 +0,0 @@
{
"repo": "https://github.com/GTNewHorizons/CodeChickenLib/releases/download/1.1.5.5/",
"file": "CodeChickenLib-1.7.10-1.1.5.5.jar",
"dev": "https://github.com/GTNewHorizons/CodeChickenLib/releases/download/1.1.5.5/CodeChickenLib-1.7.10-1.1.5.5-dev.jar",
"class": "codechicken.lib.asm.ASMHelper",
"coreLib": true
}
@@ -24,7 +24,7 @@ object MaterialRenderHelper {
def start(pos: Vector3, pass: Int, uvt: UVTransformation) = { def start(pos: Vector3, pass: Int, uvt: UVTransformation) = {
this.pass = pass this.pass = pass
builder = CCRenderState.pipeline.builder() builder = CCRenderState.instance().pipeline.builder()
builder.add(pos.translation()).add(uvt) builder.add(pos.translation()).add(uvt)
this this
} }
@@ -36,7 +36,7 @@ object MaterialRenderHelper {
def lighting() = { def lighting() = {
if (pass != -1) if (pass != -1)
builder.add(CCRenderState.lightMatrix) builder.add(CCRenderState.instance().lightMatrix)
this this
} }
@@ -85,9 +85,10 @@ class BlockMicroMaterial(val block: Block, val meta: Int = 0)
if (pass == -1) if (pass == -1)
block.getBlockColor << 8 | 0xff block.getBlockColor << 8 | 0xff
else { else {
val pos = CCRenderState.lightMatrix.pos val state = CCRenderState.instance
val pos = state.lightMatrix.pos
block.colorMultiplier( block.colorMultiplier(
CCRenderState.lightMatrix.access, state.lightMatrix.access,
pos.x, pos.x,
pos.y, pos.y,
pos.z pos.z
@@ -2,7 +2,7 @@ package codechicken.microblock
import codechicken.lib.vec.{Cuboid6, Vector3} import codechicken.lib.vec.{Cuboid6, Vector3}
import net.minecraft.block.Block import net.minecraft.block.Block
import codechicken.lib.render.{ColourMultiplier, CCRenderState} import codechicken.lib.render.CCRenderState
import net.minecraft.block.BlockGrass import net.minecraft.block.BlockGrass
import net.minecraft.init.Blocks import net.minecraft.init.Blocks
import codechicken.lib.render.uv.{UVTranslation, IconTransformation} import codechicken.lib.render.uv.{UVTranslation, IconTransformation}
@@ -17,7 +17,7 @@ class GrassMicroMaterial extends BlockMicroMaterial(Blocks.grass, 0) {
} }
override def renderMicroFace(pos: Vector3, pass: Int, bounds: Cuboid6) { override def renderMicroFace(pos: Vector3, pass: Int, bounds: Cuboid6) {
val face = CCRenderState.model.asInstanceOf[BlockFace] val face = CCRenderState.instance().model.asInstanceOf[BlockFace]
if (pass != -1) if (pass != -1)
face.computeLightCoords() face.computeLightCoords()
@@ -42,7 +42,7 @@ class GrassMicroMaterial extends BlockMicroMaterial(Blocks.grass, 0) {
class TopMicroMaterial($block: Block, $meta: Int = 0) class TopMicroMaterial($block: Block, $meta: Int = 0)
extends BlockMicroMaterial($block, $meta) { extends BlockMicroMaterial($block, $meta) {
override def renderMicroFace(pos: Vector3, pass: Int, bounds: Cuboid6) { override def renderMicroFace(pos: Vector3, pass: Int, bounds: Cuboid6) {
val face = CCRenderState.model.asInstanceOf[BlockFace] val face = CCRenderState.instance().model.asInstanceOf[BlockFace]
if (face.side <= 1) if (face.side <= 1)
MaterialRenderHelper MaterialRenderHelper
.start(pos, pass, icont) .start(pos, pass, icont)
@@ -14,7 +14,6 @@ import Vector3._
import codechicken.lib.raytracer.IndexedCuboid6 import codechicken.lib.raytracer.IndexedCuboid6
import org.lwjgl.opengl.GL11 import org.lwjgl.opengl.GL11
import codechicken.lib.render.uv.IconTransformation import codechicken.lib.render.uv.IconTransformation
import codechicken.lib.lighting.LightMatrix
object HollowPlacement extends PlacementProperties { object HollowPlacement extends PlacementProperties {
object HollowPlacementGrid extends FaceEdgeGrid(3 / 8d) object HollowPlacementGrid extends FaceEdgeGrid(3 / 8d)
@@ -74,8 +73,9 @@ trait HollowMicroblockClient
} }
override def drawBreaking(renderBlocks: RenderBlocks) { override def drawBreaking(renderBlocks: RenderBlocks) {
CCRenderState.reset() val state = CCRenderState.instance
CCRenderState.setPipeline( state.reset()
state.setPipeline(
new Translation(x, y, z), new Translation(x, y, z),
new IconTransformation(renderBlocks.overrideBlockTexture) new IconTransformation(renderBlocks.overrideBlockTexture)
) )
@@ -170,17 +170,17 @@ object ItemMicroPartRenderer extends IItemRenderer {
GL11.glScaled(0.5, 0.5, 0.5) GL11.glScaled(0.5, 0.5, 0.5)
if (t == ItemRenderType.INVENTORY || t == ItemRenderType.ENTITY) if (t == ItemRenderType.INVENTORY || t == ItemRenderType.ENTITY)
GL11.glTranslatef(-0.5f, -0.5f, -0.5f) GL11.glTranslatef(-0.5f, -0.5f, -0.5f)
TextureUtils.bindAtlas(0) TextureUtils.bindAtlas(0)
CCRenderState.reset() val state = CCRenderState.instance
CCRenderState.useNormals = true state.reset()
CCRenderState.pullLightmap() state.useNormals = true
CCRenderState.startDrawing() state.pullLightmap()
state.startDrawing()
val part = val part =
mcrClass.create(true, getMaterialID(item)).asInstanceOf[MicroblockClient] mcrClass.create(true, getMaterialID(item)).asInstanceOf[MicroblockClient]
part.setShape(size, mcrClass.itemSlot) part.setShape(size, mcrClass.itemSlot)
part.render(new Vector3(0.5, 0.5, 0.5).subtract(part.getBounds.center), -1) part.render(new Vector3(0.5, 0.5, 0.5).subtract(part.getBounds.center), -1)
CCRenderState.draw() state.draw()
GL11.glPopMatrix() GL11.glPopMatrix()
} }
@@ -112,17 +112,17 @@ object ItemSawRenderer extends IItemRenderer {
) )
case _ => return case _ => return
} }
val state = CCRenderState.instance
CCRenderState.reset() state.reset()
CCRenderState.useNormals = true state.useNormals = true
CCRenderState.pullLightmap() state.pullLightmap()
CCRenderState.changeTexture("microblock:textures/items/saw.png") CCRenderState.changeTexture("microblock:textures/items/saw.png")
CCRenderState.startDrawing() state.startDrawing()
handle.render(t) handle.render(t)
holder.render(t) holder.render(t)
CCRenderState.draw() state.draw()
GL11.glDisable(GL11.GL_CULL_FACE) GL11.glDisable(GL11.GL_CULL_FACE)
CCRenderState.startDrawing() state.startDrawing()
blade.render( blade.render(
t, t,
new UVTranslation( new UVTranslation(
@@ -130,7 +130,7 @@ object ItemSawRenderer extends IItemRenderer {
(item.getItem.asInstanceOf[Saw].getCuttingStrength(item) - 1) * 4 / 64d (item.getItem.asInstanceOf[Saw].getCuttingStrength(item) - 1) * 4 / 64d
) )
) )
CCRenderState.draw() state.draw()
GL11.glEnable(GL11.GL_CULL_FACE) GL11.glEnable(GL11.GL_CULL_FACE)
} }
} }
@@ -31,6 +31,7 @@ object MicroblockRender {
return return
val pos = placement.pos val pos = placement.pos
val part = placement.part.asInstanceOf[MicroblockClient] val part = placement.part.asInstanceOf[MicroblockClient]
val state = CCRenderState.instance
glPushMatrix() glPushMatrix()
glTranslated(pos.x + 0.5, pos.y + 0.5, pos.z + 0.5) glTranslated(pos.x + 0.5, pos.y + 0.5, pos.z + 0.5)
@@ -40,14 +41,14 @@ object MicroblockRender {
glEnable(GL_BLEND) glEnable(GL_BLEND)
glDepthMask(false) glDepthMask(false)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
// TODO: update to use a thread local copy
TextureUtils.bindAtlas(0) TextureUtils.bindAtlas(0)
CCRenderState.reset() state.reset()
CCRenderState.alphaOverride = 80 state.alphaOverride = 80
CCRenderState.useNormals = true state.useNormals = true
CCRenderState.startDrawing() state.startDrawing()
part.render(Vector3.zero, -1) part.render(Vector3.zero, -1)
CCRenderState.draw() state.draw()
glDisable(GL_BLEND) glDisable(GL_BLEND)
glDepthMask(true) glDepthMask(true)
@@ -62,7 +63,7 @@ object MicroblockRender {
c: Cuboid6, c: Cuboid6,
faces: Int faces: Int
) { ) {
CCRenderState.setModel(face) CCRenderState.instance().setModel(face)
for (s <- 0 until 6 if (faces & 1 << s) == 0) { for (s <- 0 until 6 if (faces & 1 << s) == 0) {
face.loadCuboidFace(c, s) face.loadCuboidFace(c, s)
mat.renderMicroFace(pos, pass, c) mat.renderMicroFace(pos, pass, c)
@@ -36,9 +36,10 @@ object MultipartRenderer
if (tmpart.partList.isEmpty) if (tmpart.partList.isEmpty)
return return
CCRenderState.reset() val state = CCRenderState.instance
CCRenderState.pullLightmap() state.reset()
CCRenderState.useNormals = true state.pullLightmap()
state.useNormals = true
val pos = new Vector3(x, y, z) val pos = new Vector3(x, y, z)
tmpart.renderDynamic(pos, f, pass) tmpart.renderDynamic(pos, f, pass)
@@ -81,8 +82,9 @@ object MultipartRenderer
return false return false
} }
CCRenderState.reset() val state = CCRenderState.instance
CCRenderState.lightMatrix.locate(world, x, y, z) state.reset()
state.lightMatrix.locate(world, x, y, z)
return tmpart.renderStatic(new Vector3(x, y, z), pass) return tmpart.renderStatic(new Vector3(x, y, z), pass)
} }
@@ -31,8 +31,9 @@ trait TCuboidPart extends TMultiPart {
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
override def drawBreaking(renderBlocks: RenderBlocks) { override def drawBreaking(renderBlocks: RenderBlocks) {
CCRenderState.reset() val state = CCRenderState.instance
CCRenderState.setPipeline( state.reset()
state.setPipeline(
new Translation(x, y, z), new Translation(x, y, z),
new IconTransformation(renderBlocks.overrideBlockTexture) new IconTransformation(renderBlocks.overrideBlockTexture)
) )