Compare commits

..
4 Commits
Author SHA1 Message Date
Martin Robertz 017876c80b derp 2023-12-31 12:53:35 +01:00
Martin Robertz fa58f9366a backdate ccl mod 2023-12-31 12:52:05 +01:00
Martin Robertz a416e48809 update bs+sa+gradle+deps 2023-12-31 12:36:47 +01:00
Roadhog360 d819d94422 Fix ButtonPart.java crashes, tweaks to allow mods to hook it
`ButtonPart`:
- Rewrite `getBounds()` to use a list generated from the button hitbox itself, instead of being a hardcoded list. Then mods like Et Futurum Requiem which change buttons only have to mix to `metaSideMap` and `sideMetaMap`
  - This adds an access transformer to get the button hitbox states, which are ordinarily private.
- Change `placement` to check if the corresponding side's value in `sideMetaMap` is `-1` instead of a hardcoded side check, so top/bottom is still unplaceable unless mods add it.
`McSidedMetaPart.java`:
- Fix crash from out of bounds side values from meta (notably in this commit, `-1` from buttons) by making any value below 0 or above 5 return false.
2023-12-31 03:07:59 -06:00
14 changed files with 76 additions and 77 deletions

No files matched your search

+20 -15
View File
@@ -1,4 +1,4 @@
//version: 1704751096
//version: 1702141377
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -31,7 +31,8 @@ buildscript {
maven {
// GTNH RetroFuturaGradle and ASM Fork
name "GTNH Maven"
url "https://nexus.gtnewhorizons.com/repository/public/"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
}
mavenLocal()
}
@@ -48,12 +49,12 @@ plugins {
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.palantir.git-version' version '3.0.0' apply false
id 'de.undercouch.download' version '5.5.0'
id 'de.undercouch.download' version '5.4.0'
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.modrinth.minotaur' version '2.+' apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.27'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.26'
}
print("You might want to check out './gradlew :faq' if your build fails.\n")
@@ -117,7 +118,7 @@ propertyDefaultIfUnset("forceEnableMixins", false)
propertyDefaultIfUnset("channel", "stable")
propertyDefaultIfUnset("mappingsVersion", "12")
propertyDefaultIfUnset("usesMavenPublishing", true)
propertyDefaultIfUnset("mavenPublishUrl", "https://nexus.gtnewhorizons.com/repository/releases/")
propertyDefaultIfUnset("mavenPublishUrl", "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases")
propertyDefaultIfUnset("modrinthProjectId", "")
propertyDefaultIfUnset("modrinthRelations", "")
propertyDefaultIfUnset("curseForgeProjectId", "")
@@ -571,17 +572,15 @@ afterEvaluate {
}
repositories {
maven {
name = "GTNH Maven"
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 {
name 'Overmind forge repo mirror'
url 'https://gregtech.overminddl1.com/'
}
maven {
name = "GTNH Maven"
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
}
maven {
name 'sonatype'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
@@ -786,7 +785,7 @@ dependencies {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.4.4')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.35')
}
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
@@ -961,7 +960,8 @@ if (usesShadowedDependencies.toBoolean()) {
configurations.runtimeElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar))
configurations.apiElements.outgoing.artifact(tasks.named("shadowJar", ShadowJar))
tasks.named("jar", Jar) {
archiveClassifier.set('dev-preshadow')
enabled = false
finalizedBy(tasks.shadowJar)
}
tasks.named("reobfJar", ReobfuscatedJar) {
inputJar.set(tasks.named("shadowJar", ShadowJar).flatMap({it.archiveFile}))
@@ -970,6 +970,11 @@ if (usesShadowedDependencies.toBoolean()) {
javaComponent.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
skip()
}
for (runTask in ["runClient", "runServer", "runClient17", "runServer17"]) {
tasks.named(runTask).configure {
dependsOn("shadowJar")
}
}
}
ext.publishableDevJar = usesShadowedDependencies.toBoolean() ? tasks.shadowJar : tasks.jar
ext.publishableObfJar = tasks.reobfJar
@@ -1173,7 +1178,7 @@ publishing {
if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) {
maven {
url = mavenPublishUrl
allowInsecureProtocol = mavenPublishUrl.startsWith("http://")
allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven
credentials {
username = System.getenv("MAVEN_USER") ?: "NONE"
password = System.getenv("MAVEN_PASSWORD") ?: "NONE"
+2 -3
View File
@@ -1,7 +1,6 @@
// Add your dependencies here
dependencies {
api("com.github.GTNewHorizons:CodeChickenLib:1.2.0:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.5.3-GTNH:dev")
api("com.github.GTNewHorizons:CodeChickenLib:1.1.8:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.4.13-GTNH:dev")
}
Binary file not shown.
Vendored
+8 -9
View File
@@ -83,8 +83,7 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -145,7 +144,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
@@ -153,7 +152,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -202,11 +201,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# 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
# treated as '${Hostname}' itself on the command line.
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
+5 -4
View File
@@ -4,9 +4,10 @@ pluginManagement {
maven {
// RetroFuturaGradle
name "GTNH Maven"
url "https://nexus.gtnewhorizons.com/repository/public/"
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
allowInsecureProtocol = true
mavenContent {
includeGroupByRegex("com\\.gtnewhorizons\\..+")
includeGroup("com.gtnewhorizons.retrofuturagradle")
}
}
gradlePluginPortal()
@@ -16,8 +17,8 @@ pluginManagement {
}
plugins {
id 'com.diffplug.blowdryerSetup' version '1.7.1'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.7.0' // Provides java toolchains
id 'com.diffplug.blowdryerSetup' version '1.6.0'
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
}
blowdryerSetup {
+3 -3
View File
@@ -1,7 +1,7 @@
{
"repo": "https://github.com/GTNewHorizons/CodeChickenLib/releases/download/1.2.0/",
"file": "CodeChickenLib-1.2.0.jar",
"dev": "CodeChickenLib-1.2.0-dev.jar",
"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) = {
this.pass = pass
builder = CCRenderState.instance().pipeline.builder()
builder = CCRenderState.pipeline.builder()
builder.add(pos.translation()).add(uvt)
this
}
@@ -36,7 +36,7 @@ object MaterialRenderHelper {
def lighting() = {
if (pass != -1)
builder.add(CCRenderState.instance().lightMatrix)
builder.add(CCRenderState.lightMatrix)
this
}
@@ -85,10 +85,9 @@ class BlockMicroMaterial(val block: Block, val meta: Int = 0)
if (pass == -1)
block.getBlockColor << 8 | 0xff
else {
val state = CCRenderState.instance
val pos = state.lightMatrix.pos
val pos = CCRenderState.lightMatrix.pos
block.colorMultiplier(
state.lightMatrix.access,
CCRenderState.lightMatrix.access,
pos.x,
pos.y,
pos.z
@@ -2,7 +2,7 @@ package codechicken.microblock
import codechicken.lib.vec.{Cuboid6, Vector3}
import net.minecraft.block.Block
import codechicken.lib.render.CCRenderState
import codechicken.lib.render.{ColourMultiplier, CCRenderState}
import net.minecraft.block.BlockGrass
import net.minecraft.init.Blocks
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) {
val face = CCRenderState.instance().model.asInstanceOf[BlockFace]
val face = CCRenderState.model.asInstanceOf[BlockFace]
if (pass != -1)
face.computeLightCoords()
@@ -42,7 +42,7 @@ class GrassMicroMaterial extends BlockMicroMaterial(Blocks.grass, 0) {
class TopMicroMaterial($block: Block, $meta: Int = 0)
extends BlockMicroMaterial($block, $meta) {
override def renderMicroFace(pos: Vector3, pass: Int, bounds: Cuboid6) {
val face = CCRenderState.instance().model.asInstanceOf[BlockFace]
val face = CCRenderState.model.asInstanceOf[BlockFace]
if (face.side <= 1)
MaterialRenderHelper
.start(pos, pass, icont)
@@ -14,6 +14,7 @@ import Vector3._
import codechicken.lib.raytracer.IndexedCuboid6
import org.lwjgl.opengl.GL11
import codechicken.lib.render.uv.IconTransformation
import codechicken.lib.lighting.LightMatrix
object HollowPlacement extends PlacementProperties {
object HollowPlacementGrid extends FaceEdgeGrid(3 / 8d)
@@ -73,9 +74,8 @@ trait HollowMicroblockClient
}
override def drawBreaking(renderBlocks: RenderBlocks) {
val state = CCRenderState.instance
state.reset()
state.setPipeline(
CCRenderState.reset()
CCRenderState.setPipeline(
new Translation(x, y, z),
new IconTransformation(renderBlocks.overrideBlockTexture)
)
@@ -170,17 +170,17 @@ object ItemMicroPartRenderer extends IItemRenderer {
GL11.glScaled(0.5, 0.5, 0.5)
if (t == ItemRenderType.INVENTORY || t == ItemRenderType.ENTITY)
GL11.glTranslatef(-0.5f, -0.5f, -0.5f)
TextureUtils.bindAtlas(0)
val state = CCRenderState.instance
state.reset()
state.useNormals = true
state.pullLightmap()
state.startDrawing()
CCRenderState.reset()
CCRenderState.useNormals = true
CCRenderState.pullLightmap()
CCRenderState.startDrawing()
val part =
mcrClass.create(true, getMaterialID(item)).asInstanceOf[MicroblockClient]
part.setShape(size, mcrClass.itemSlot)
part.render(new Vector3(0.5, 0.5, 0.5).subtract(part.getBounds.center), -1)
state.draw()
CCRenderState.draw()
GL11.glPopMatrix()
}
@@ -112,17 +112,17 @@ object ItemSawRenderer extends IItemRenderer {
)
case _ => return
}
val state = CCRenderState.instance
state.reset()
state.useNormals = true
state.pullLightmap()
CCRenderState.reset()
CCRenderState.useNormals = true
CCRenderState.pullLightmap()
CCRenderState.changeTexture("microblock:textures/items/saw.png")
state.startDrawing()
CCRenderState.startDrawing()
handle.render(t)
holder.render(t)
state.draw()
CCRenderState.draw()
GL11.glDisable(GL11.GL_CULL_FACE)
state.startDrawing()
CCRenderState.startDrawing()
blade.render(
t,
new UVTranslation(
@@ -130,7 +130,7 @@ object ItemSawRenderer extends IItemRenderer {
(item.getItem.asInstanceOf[Saw].getCuttingStrength(item) - 1) * 4 / 64d
)
)
state.draw()
CCRenderState.draw()
GL11.glEnable(GL11.GL_CULL_FACE)
}
}
@@ -31,7 +31,6 @@ object MicroblockRender {
return
val pos = placement.pos
val part = placement.part.asInstanceOf[MicroblockClient]
val state = CCRenderState.instance
glPushMatrix()
glTranslated(pos.x + 0.5, pos.y + 0.5, pos.z + 0.5)
@@ -41,14 +40,14 @@ object MicroblockRender {
glEnable(GL_BLEND)
glDepthMask(false)
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
// TODO: update to use a thread local copy
TextureUtils.bindAtlas(0)
state.reset()
state.alphaOverride = 80
state.useNormals = true
state.startDrawing()
CCRenderState.reset()
CCRenderState.alphaOverride = 80
CCRenderState.useNormals = true
CCRenderState.startDrawing()
part.render(Vector3.zero, -1)
state.draw()
CCRenderState.draw()
glDisable(GL_BLEND)
glDepthMask(true)
@@ -63,7 +62,7 @@ object MicroblockRender {
c: Cuboid6,
faces: Int
) {
CCRenderState.instance().setModel(face)
CCRenderState.setModel(face)
for (s <- 0 until 6 if (faces & 1 << s) == 0) {
face.loadCuboidFace(c, s)
mat.renderMicroFace(pos, pass, c)
@@ -36,10 +36,9 @@ object MultipartRenderer
if (tmpart.partList.isEmpty)
return
val state = CCRenderState.instance
state.reset()
state.pullLightmap()
state.useNormals = true
CCRenderState.reset()
CCRenderState.pullLightmap()
CCRenderState.useNormals = true
val pos = new Vector3(x, y, z)
tmpart.renderDynamic(pos, f, pass)
@@ -82,9 +81,8 @@ object MultipartRenderer
return false
}
val state = CCRenderState.instance
state.reset()
state.lightMatrix.locate(world, x, y, z)
CCRenderState.reset()
CCRenderState.lightMatrix.locate(world, x, y, z)
return tmpart.renderStatic(new Vector3(x, y, z), pass)
}
@@ -31,9 +31,8 @@ trait TCuboidPart extends TMultiPart {
@SideOnly(Side.CLIENT)
override def drawBreaking(renderBlocks: RenderBlocks) {
val state = CCRenderState.instance
state.reset()
state.setPipeline(
CCRenderState.reset()
CCRenderState.setPipeline(
new Translation(x, y, z),
new IconTransformation(renderBlocks.overrideBlockTexture)
)