mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-26 23:13:07 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1450dd8265 | ||
|
|
bc3542efd2 | ||
|
|
ad7a1d3cea | ||
|
|
1bd4ef4a0f | ||
|
|
439243b00a | ||
|
|
38a2bf629f | ||
|
|
2abb775696 |
No files matched your search
+2
-3
@@ -1,7 +1,6 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api("com.github.GTNewHorizons:CodeChickenLib:1.2.1:dev")
|
||||
|
||||
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.5.17-GTNH:dev")
|
||||
|
||||
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.7.8-GTNH:dev")
|
||||
}
|
||||
+12
-1
@@ -85,6 +85,11 @@ accessTransformersFile = multipart_at.cfg
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
|
||||
# Set to a non-empty string to configure mixins in a separate source set under src/VALUE, instead of src/main.
|
||||
# This can speed up compile times thanks to not running the mixin annotation processor on all input sources.
|
||||
# Mixin classes will have access to "main" classes, but not the other way around.
|
||||
separateMixinSourceSet =
|
||||
|
||||
# Adds some debug arguments like verbose output and class export.
|
||||
usesMixinDebug = false
|
||||
|
||||
@@ -117,9 +122,15 @@ minimizeShadowedDependencies = true
|
||||
# If disabled, won't rename the shadowed classes.
|
||||
relocateShadowedDependencies = true
|
||||
|
||||
# Adds the GTNH maven, CurseMaven, IC2/Player maven, and some more well-known 1.7.10 repositories.
|
||||
# Adds CurseMaven, Modrinth, and some more well-known 1.7.10 repositories.
|
||||
includeWellKnownRepositories = true
|
||||
|
||||
# A list of repositories to exclude from the includeWellKnownRepositories setting. Should be a space separated
|
||||
# list of strings, with the acceptable keys being(case does not matter):
|
||||
# cursemaven
|
||||
# modrinth
|
||||
excludeWellKnownRepositories =
|
||||
|
||||
# Change these to your Maven coordinates if you want to publish to a custom Maven repository instead of the default GTNH Maven.
|
||||
# Authenticate with the MAVEN_USER and MAVEN_PASSWORD environment variables.
|
||||
# If you need a more complex setup disable maven publishing here and add a publishing repository to addon.gradle.
|
||||
|
||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
@@ -55,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
@@ -84,7 +86,8 @@ done
|
||||
# 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 -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
Vendored
+2
@@ -13,6 +13,8 @@
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.30'
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ item.microblock:sawIron.name=Iron Saw
|
||||
item.microblock:sawDiamond.name=Diamond Saw
|
||||
item.microblock:stoneRod.name=Stone Rod
|
||||
|
||||
item.microblock.name=Microblock
|
||||
|
||||
mcr_face.1.name=%s Cover
|
||||
mcr_face.1.subset=Cover
|
||||
mcr_face.2.name=%s Panel
|
||||
@@ -36,4 +38,4 @@ mcr_cnr.4.subset=Notch
|
||||
|
||||
nei.subsets.Microblocks=Microblocks
|
||||
|
||||
key.control=Switch block disposition
|
||||
key.control=Switch block disposition
|
||||
@@ -10,17 +10,31 @@ import codechicken.lib.vec.{Cuboid6, Vector3}
|
||||
import net.minecraft.entity.player.EntityPlayer
|
||||
import codechicken.lib.render.{
|
||||
CCRenderPipeline,
|
||||
ColourMultiplier,
|
||||
CCRenderState
|
||||
CCRenderState,
|
||||
ColourMultiplier
|
||||
}
|
||||
import codechicken.microblock.handler.MicroblockProxy
|
||||
import net.minecraft.entity.Entity
|
||||
import codechicken.lib.render.uv.{UVTransformation, MultiIconTransformation}
|
||||
import cpw.mods.fml.common.registry.{GameRegistry, GameData}
|
||||
|
||||
import java.util.function.Supplier
|
||||
|
||||
private class ThreadState {
|
||||
var pass = 0
|
||||
var builder: CCRenderPipeline#PipelineBuilder = _
|
||||
}
|
||||
|
||||
object MaterialRenderHelper {
|
||||
private var pass = 0
|
||||
private var builder: CCRenderPipeline#PipelineBuilder = _
|
||||
private val threadState =
|
||||
ThreadLocal.withInitial[ThreadState](new Supplier[ThreadState]() {
|
||||
override def get(): ThreadState = new ThreadState()
|
||||
})
|
||||
def pass = threadState.get().pass
|
||||
def pass_=(pass: Int) = threadState.get().pass = pass
|
||||
def builder = threadState.get().builder
|
||||
def builder_=(builder: CCRenderPipeline#PipelineBuilder) =
|
||||
threadState.get().builder = builder
|
||||
|
||||
def start(pos: Vector3, pass: Int, uvt: UVTransformation) = {
|
||||
this.pass = pass
|
||||
|
||||
@@ -74,8 +74,8 @@ trait HollowMicroblockClient
|
||||
|
||||
override def drawBreaking(renderBlocks: RenderBlocks) {
|
||||
val state = CCRenderState.instance
|
||||
state.reset()
|
||||
state.setPipeline(
|
||||
state.resetInstance()
|
||||
state.setPipelineInstance(
|
||||
new Translation(x, y, z),
|
||||
new IconTransformation(renderBlocks.overrideBlockTexture)
|
||||
)
|
||||
|
||||
@@ -172,15 +172,15 @@ object ItemMicroPartRenderer extends IItemRenderer {
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f)
|
||||
TextureUtils.bindAtlas(0)
|
||||
val state = CCRenderState.instance
|
||||
state.reset()
|
||||
state.resetInstance()
|
||||
state.useNormals = true
|
||||
state.pullLightmap()
|
||||
state.startDrawing()
|
||||
state.pullLightmapInstance()
|
||||
state.startDrawingInstance()
|
||||
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()
|
||||
state.drawInstance()
|
||||
GL11.glPopMatrix()
|
||||
}
|
||||
|
||||
|
||||
@@ -113,16 +113,16 @@ object ItemSawRenderer extends IItemRenderer {
|
||||
case _ => return
|
||||
}
|
||||
val state = CCRenderState.instance
|
||||
state.reset()
|
||||
state.resetInstance()
|
||||
state.useNormals = true
|
||||
state.pullLightmap()
|
||||
state.pullLightmapInstance()
|
||||
CCRenderState.changeTexture("microblock:textures/items/saw.png")
|
||||
state.startDrawing()
|
||||
state.startDrawingInstance()
|
||||
handle.render(t)
|
||||
holder.render(t)
|
||||
state.draw()
|
||||
state.drawInstance()
|
||||
GL11.glDisable(GL11.GL_CULL_FACE)
|
||||
state.startDrawing()
|
||||
state.startDrawingInstance()
|
||||
blade.render(
|
||||
t,
|
||||
new UVTranslation(
|
||||
@@ -130,7 +130,7 @@ object ItemSawRenderer extends IItemRenderer {
|
||||
(item.getItem.asInstanceOf[Saw].getCuttingStrength(item) - 1) * 4 / 64d
|
||||
)
|
||||
)
|
||||
state.draw()
|
||||
state.drawInstance()
|
||||
GL11.glEnable(GL11.GL_CULL_FACE)
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import org.lwjgl.opengl.GL11._
|
||||
import codechicken.lib.render.{CCRenderState, TextureUtils}
|
||||
import codechicken.lib.render.BlockRenderer.BlockFace
|
||||
import codechicken.microblock.MicroMaterialRegistry.IMicroMaterial
|
||||
import java.util.function.Supplier
|
||||
|
||||
object MicroblockRender {
|
||||
def renderHighlight(
|
||||
@@ -43,19 +44,21 @@ object MicroblockRender {
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
|
||||
// TODO: update to use a thread local copy
|
||||
TextureUtils.bindAtlas(0)
|
||||
state.reset()
|
||||
state.resetInstance()
|
||||
state.alphaOverride = 80
|
||||
state.useNormals = true
|
||||
state.startDrawing()
|
||||
state.startDrawingInstance()
|
||||
part.render(Vector3.zero, -1)
|
||||
state.draw()
|
||||
state.drawInstance()
|
||||
|
||||
glDisable(GL_BLEND)
|
||||
glDepthMask(true)
|
||||
glPopMatrix()
|
||||
}
|
||||
|
||||
val face = new BlockFace()
|
||||
val face = ThreadLocal.withInitial[BlockFace](new Supplier[BlockFace]() {
|
||||
override def get(): BlockFace = new BlockFace()
|
||||
})
|
||||
def renderCuboid(
|
||||
pos: Vector3,
|
||||
mat: IMicroMaterial,
|
||||
@@ -63,9 +66,10 @@ object MicroblockRender {
|
||||
c: Cuboid6,
|
||||
faces: Int
|
||||
) {
|
||||
CCRenderState.instance().setModel(face)
|
||||
val localFace = face.get()
|
||||
CCRenderState.instance().setModelInstance(localFace)
|
||||
for (s <- 0 until 6 if (faces & 1 << s) == 0) {
|
||||
face.loadCuboidFace(c, s)
|
||||
localFace.loadCuboidFace(c, s)
|
||||
mat.renderMicroFace(pos, pass, c)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ object ControlKeyHandler
|
||||
) {
|
||||
import ControlKeyModifer._
|
||||
var wasPressed = false
|
||||
var oldPlayer: EntityPlayer = null
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -52,5 +53,13 @@ object ControlKeyHandler
|
||||
packet.sendToServer()
|
||||
}
|
||||
}
|
||||
if (oldPlayer != null) {
|
||||
if (oldPlayer != Minecraft.getMinecraft.thePlayer) {
|
||||
map.remove(oldPlayer)
|
||||
oldPlayer = Minecraft.getMinecraft.thePlayer
|
||||
}
|
||||
} else {
|
||||
oldPlayer = Minecraft.getMinecraft.thePlayer
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -37,8 +37,8 @@ object MultipartRenderer
|
||||
return
|
||||
|
||||
val state = CCRenderState.instance
|
||||
state.reset()
|
||||
state.pullLightmap()
|
||||
state.resetInstance()
|
||||
state.pullLightmapInstance()
|
||||
state.useNormals = true
|
||||
|
||||
val pos = new Vector3(x, y, z)
|
||||
@@ -83,7 +83,7 @@ object MultipartRenderer
|
||||
}
|
||||
|
||||
val state = CCRenderState.instance
|
||||
state.reset()
|
||||
state.resetInstance()
|
||||
state.lightMatrix.locate(world, x, y, z)
|
||||
return tmpart.renderStatic(new Vector3(x, y, z), pass)
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ trait TCuboidPart extends TMultiPart {
|
||||
@SideOnly(Side.CLIENT)
|
||||
override def drawBreaking(renderBlocks: RenderBlocks) {
|
||||
val state = CCRenderState.instance
|
||||
state.reset()
|
||||
state.setPipeline(
|
||||
state.resetInstance()
|
||||
state.setPipelineInstance(
|
||||
new Translation(x, y, z),
|
||||
new IconTransformation(renderBlocks.overrideBlockTexture)
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user