mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-26 23:13:07 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1a4edfbc89 | ||
|
|
525fcc56ad | ||
|
|
a36120fc91 | ||
|
|
238b041f12 | ||
|
|
0b0e99024d | ||
|
|
a1db9a100e | ||
|
|
3c42abd7ac |
No files matched your search
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
// Add your dependencies here
|
// Add your dependencies here
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("com.github.GTNewHorizons:CodeChickenCore:1.4.3:dev")
|
implementation("com.github.GTNewHorizons:CodeChickenCore:1.4.7:dev")
|
||||||
compileOnly("com.github.GTNewHorizons:Angelica:1.0.0-beta53:dev")
|
compileOnly("com.github.GTNewHorizons:Angelica:1.0.0-beta62:dev")
|
||||||
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.7.69-GTNH:dev") {
|
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.8.20-GTNH:dev") {
|
||||||
exclude group: 'com.github.GTNewHorizons', module: 'CodeChickenCore'
|
exclude group: 'com.github.GTNewHorizons', module: 'CodeChickenCore'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+35
-3
@@ -39,10 +39,34 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
|
|||||||
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
|
||||||
developmentEnvironmentUserName = Developer
|
developmentEnvironmentUserName = Developer
|
||||||
|
|
||||||
# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
|
# Enables modern Java syntax support. Valid values:
|
||||||
# See https://github.com/bsideup/jabel for details on how this works.
|
# - false: No modern syntax, Java 8 only
|
||||||
|
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
|
||||||
|
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
|
||||||
|
# - modern: Native modern Java bytecode, no downgrading
|
||||||
enableModernJavaSyntax = false
|
enableModernJavaSyntax = false
|
||||||
|
|
||||||
|
# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
|
||||||
|
# and should *not* be used in most situations. -1 disables this.
|
||||||
|
# forceToolchainVersion = -1
|
||||||
|
|
||||||
|
# Target JVM version for JVM Downgrader bytecode downgrading.
|
||||||
|
# Only used when enableModernJavaSyntax = jvmDowngrader
|
||||||
|
# downgradeTargetVersion = 8
|
||||||
|
|
||||||
|
# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
|
||||||
|
# Classes will be available in META-INF/versions/N/ for each version N in this list.
|
||||||
|
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
|
||||||
|
# jvmDowngraderMultiReleaseVersions = 21,25
|
||||||
|
|
||||||
|
# Specifies how JVM Downgrader API stubs are provided. Options:
|
||||||
|
# - shade: Shade minimized stubs into the jar
|
||||||
|
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
|
||||||
|
# - external: Another dependency provides stubs (no constraint, no warning)
|
||||||
|
# - (empty): Warning reminding you to configure stubs
|
||||||
|
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
|
||||||
|
# jvmDowngraderStubsProvider =
|
||||||
|
|
||||||
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
# Enables injecting missing generics into the decompiled source code for a better coding experience.
|
||||||
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
|
||||||
enableGenericInjection = false
|
enableGenericInjection = false
|
||||||
@@ -96,7 +120,9 @@ usesMixinDebug = false
|
|||||||
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
|
||||||
mixinPlugin =
|
mixinPlugin =
|
||||||
|
|
||||||
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
|
# Specify the package that contains all of your Mixins. The package must exist or
|
||||||
|
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
|
||||||
|
# it must match with this or the build will fail.
|
||||||
mixinsPackage =
|
mixinsPackage =
|
||||||
|
|
||||||
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
|
||||||
@@ -172,6 +198,12 @@ curseForgeRelations =
|
|||||||
# projects. New projects should not use this parameter.
|
# projects. New projects should not use this parameter.
|
||||||
# customArchiveBaseName =
|
# customArchiveBaseName =
|
||||||
|
|
||||||
|
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
|
||||||
|
# runClientWorkingDirectory = run/client
|
||||||
|
|
||||||
|
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
|
||||||
|
# runServerWorkingDirectory = run/server
|
||||||
|
|
||||||
# Optional parameter to have the build automatically fail if an illegal version is used.
|
# Optional parameter to have the build automatically fail if an illegal version is used.
|
||||||
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
|
||||||
# The check is ONLY performed if the version is a git tag.
|
# The check is ONLY performed if the version is a git tag.
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
#This file is generated by updateDaemonJvm
|
||||||
|
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||||
|
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||||
|
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||||
|
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||||
|
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/d4fd992c9557644e637ebe98263e0ae7/redirect
|
||||||
|
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/faa12903720d410b387cc69ccafb1a74/redirect
|
||||||
|
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
||||||
|
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||||
|
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a4c09dd2e2d7079373d30e524bbc2829/redirect
|
||||||
|
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/b96cb7670c095245220e7d01d5927b58/redirect
|
||||||
|
toolchainVersion=25
|
||||||
Vendored
BIN
Binary file not shown.
+1
-1
@@ -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.13-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright © 2015-2021 the original authors.
|
# Copyright © 2015 the original authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@@ -172,7 +171,6 @@ fi
|
|||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
if "$cygwin" || "$msys" ; then
|
if "$cygwin" || "$msys" ; then
|
||||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
||||||
|
|
||||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
@@ -212,8 +210,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
org.gradle.wrapper.GradleWrapperMain \
|
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
# Stop when "xargs" is not available.
|
# Stop when "xargs" is not available.
|
||||||
|
|||||||
Vendored
+1
-2
@@ -70,11 +70,10 @@ goto fail
|
|||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
|||||||
+1
-3
@@ -17,7 +17,5 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.41'
|
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.23'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@ object MultipartRenderer
|
|||||||
f: Float
|
f: Float
|
||||||
) {
|
) {
|
||||||
val tmpart = t.asInstanceOf[TileMultipartClient]
|
val tmpart = t.asInstanceOf[TileMultipartClient]
|
||||||
if (tmpart.partList.isEmpty)
|
if (tmpart.partList.isEmpty | !tmpart.hasDynamicParts)
|
||||||
return
|
return
|
||||||
|
|
||||||
val state = CCRenderState.instance
|
val state = CCRenderState.instance
|
||||||
|
|||||||
@@ -316,6 +316,12 @@ abstract class TMultiPart {
|
|||||||
*/
|
*/
|
||||||
def doesTick = true
|
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
|
/** Called once per world tick. This will be called even if doesTick returns
|
||||||
* false if another part in the space needs ticks.
|
* false if another part in the space needs ticks.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package codechicken.multipart
|
package codechicken.multipart
|
||||||
|
|
||||||
import net.minecraft.tileentity.TileEntity
|
import net.minecraft.tileentity.TileEntity
|
||||||
|
|
||||||
import scala.collection.mutable.ListBuffer
|
import scala.collection.mutable.ListBuffer
|
||||||
import codechicken.lib.packet.PacketCustom
|
import codechicken.lib.packet.PacketCustom
|
||||||
import codechicken.lib.vec.{Cuboid6, BlockCoord, Vector3}
|
import codechicken.lib.vec.{BlockCoord, Cuboid6, Vector3}
|
||||||
import net.minecraft.world.World
|
import net.minecraft.world.World
|
||||||
|
|
||||||
import java.util.List
|
import java.util.List
|
||||||
import net.minecraft.nbt.NBTTagCompound
|
import net.minecraft.nbt.NBTTagCompound
|
||||||
import codechicken.lib.data.MCDataOutput
|
import codechicken.lib.data.MCDataOutput
|
||||||
@@ -15,16 +17,20 @@ import codechicken.multipart.handler.{
|
|||||||
}
|
}
|
||||||
import net.minecraft.item.ItemStack
|
import net.minecraft.item.ItemStack
|
||||||
import net.minecraft.nbt.NBTTagList
|
import net.minecraft.nbt.NBTTagList
|
||||||
|
|
||||||
import java.util.Random
|
import java.util.Random
|
||||||
import net.minecraft.entity.item.EntityItem
|
import net.minecraft.entity.item.EntityItem
|
||||||
import net.minecraft.entity.player.EntityPlayer
|
import net.minecraft.entity.player.EntityPlayer
|
||||||
import net.minecraft.entity.Entity
|
import net.minecraft.entity.Entity
|
||||||
|
|
||||||
import scala.collection.JavaConversions._
|
import scala.collection.JavaConversions._
|
||||||
import java.util.Collection
|
import java.util.Collection
|
||||||
import codechicken.lib.raytracer.ExtendedMOP
|
import codechicken.lib.raytracer.ExtendedMOP
|
||||||
import net.minecraft.util.Vec3
|
import net.minecraft.util.{AxisAlignedBB, Vec3}
|
||||||
|
|
||||||
import java.lang.Iterable
|
import java.lang.Iterable
|
||||||
import codechicken.lib.world.IChunkLoadTile
|
import codechicken.lib.world.IChunkLoadTile
|
||||||
|
import net.minecraft.block.Block
|
||||||
|
|
||||||
class TileMultipart extends TileEntity with IChunkLoadTile {
|
class TileMultipart extends TileEntity with IChunkLoadTile {
|
||||||
|
|
||||||
@@ -110,6 +116,7 @@ class TileMultipart extends TileEntity with IChunkLoadTile {
|
|||||||
|
|
||||||
override def validate() {
|
override def validate() {
|
||||||
super.validate()
|
super.validate()
|
||||||
|
|
||||||
if (worldObj != null && worldObj.isRemote)
|
if (worldObj != null && worldObj.isRemote)
|
||||||
TileCache.add(this)
|
TileCache.add(this)
|
||||||
}
|
}
|
||||||
@@ -162,7 +169,20 @@ class TileMultipart extends TileEntity with IChunkLoadTile {
|
|||||||
*/
|
*/
|
||||||
def getWeakChanges = false
|
def getWeakChanges = false
|
||||||
|
|
||||||
def getLightValue = partList.view.map(_.getLightValue).max
|
def getLightValue: Int = {
|
||||||
|
if (partList.isEmpty) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var max = 0
|
||||||
|
val it = partList.iterator
|
||||||
|
while (it.hasNext) {
|
||||||
|
val l = it.next().getLightValue
|
||||||
|
if (l > max) max = l
|
||||||
|
}
|
||||||
|
|
||||||
|
max
|
||||||
|
}
|
||||||
|
|
||||||
def getExplosionResistance(entity: Entity) =
|
def getExplosionResistance(entity: Entity) =
|
||||||
partList.view.map(_.explosionResistance(entity)).max
|
partList.view.map(_.explosionResistance(entity)).max
|
||||||
@@ -326,6 +346,8 @@ class TileMultipart extends TileEntity with IChunkLoadTile {
|
|||||||
if (r < 0)
|
if (r < 0)
|
||||||
throw new IllegalArgumentException("Tried to remove a non-existant part")
|
throw new IllegalArgumentException("Tried to remove a non-existant part")
|
||||||
|
|
||||||
|
val removedLightValue = part.getLightValue
|
||||||
|
|
||||||
part.preRemove()
|
part.preRemove()
|
||||||
partList = partList.filterNot(_ == part)
|
partList = partList.filterNot(_ == part)
|
||||||
|
|
||||||
@@ -357,6 +379,7 @@ class TileMultipart extends TileEntity with IChunkLoadTile {
|
|||||||
private[multipart] def loadParts(parts: scala.Iterable[TMultiPart]) {
|
private[multipart] def loadParts(parts: scala.Iterable[TMultiPart]) {
|
||||||
clearParts()
|
clearParts()
|
||||||
parts.foreach(p => addPart_do(p))
|
parts.foreach(p => addPart_do(p))
|
||||||
|
|
||||||
if (worldObj != null) {
|
if (worldObj != null) {
|
||||||
if (worldObj.isRemote)
|
if (worldObj.isRemote)
|
||||||
operate(_.onWorldJoin())
|
operate(_.onWorldJoin())
|
||||||
@@ -449,24 +472,109 @@ class TileMultipart extends TileEntity with IChunkLoadTile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
trait TileMultipartClient extends TileMultipart {
|
trait TileMultipartClient extends TileMultipart {
|
||||||
def renderStatic(pos: Vector3, pass: Int) =
|
private var cachedRenderBounds: AxisAlignedBB = null
|
||||||
partList.foldLeft(false)((r, part) => part.renderStatic(pos, pass) || r)
|
private var staticCache: Array[TMultiPart] = null
|
||||||
|
private var dynamicCache: Array[TMultiPart] = null
|
||||||
|
|
||||||
|
var hasDynamicParts: Boolean = false
|
||||||
|
|
||||||
|
def updateRenderCache() {
|
||||||
|
if (partList != null) {
|
||||||
|
val (dynamic, static) =
|
||||||
|
partList.partition(p => p.doesTick || p.shouldRenderDynamic)
|
||||||
|
val sArr = static.toArray
|
||||||
|
val dArr = dynamic.toArray
|
||||||
|
|
||||||
|
var c: Cuboid6 = null
|
||||||
|
var i = 0
|
||||||
|
val allParts = sArr ++ dArr
|
||||||
|
while (i < allParts.length) {
|
||||||
|
val b = allParts(i).getRenderBounds
|
||||||
|
if (c == null) c = b.copy
|
||||||
|
else c.enclose(b)
|
||||||
|
i += 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c == null) c = Cuboid6.full
|
||||||
|
|
||||||
|
c.add(Vector3.fromTileEntity(this))
|
||||||
|
cachedRenderBounds = c.toAABB
|
||||||
|
staticCache = sArr
|
||||||
|
dynamicCache = dArr
|
||||||
|
hasDynamicParts = dArr.length > 0
|
||||||
|
} else {
|
||||||
|
staticCache = Array.empty
|
||||||
|
dynamicCache = Array.empty
|
||||||
|
hasDynamicParts = false
|
||||||
|
cachedRenderBounds = AxisAlignedBB.getBoundingBox(
|
||||||
|
xCoord,
|
||||||
|
yCoord,
|
||||||
|
zCoord,
|
||||||
|
xCoord + 1,
|
||||||
|
yCoord + 1,
|
||||||
|
zCoord + 1
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def renderStatic(pos: Vector3, pass: Int) = {
|
||||||
|
if (staticCache == null) updateRenderCache()
|
||||||
|
var rendered = false
|
||||||
|
|
||||||
|
val statics = staticCache
|
||||||
|
if (statics != null) {
|
||||||
|
var i = 0
|
||||||
|
val len = statics.length
|
||||||
|
while (i < len) {
|
||||||
|
if (statics(i) != null && statics(i).renderStatic(pos, pass))
|
||||||
|
rendered = true
|
||||||
|
i += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val dynamics = dynamicCache
|
||||||
|
if (dynamics != null) {
|
||||||
|
var i = 0
|
||||||
|
val len = dynamics.length
|
||||||
|
while (i < len) {
|
||||||
|
if (dynamics(i) != null && dynamics(i).renderStatic(pos, pass))
|
||||||
|
rendered = true
|
||||||
|
i += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rendered
|
||||||
|
}
|
||||||
|
|
||||||
def renderDynamic(pos: Vector3, frame: Float, pass: Int) {
|
def renderDynamic(pos: Vector3, frame: Float, pass: Int) {
|
||||||
partList.foreach(part => part.renderDynamic(pos, frame, pass: Int))
|
if (!hasDynamicParts) return
|
||||||
|
|
||||||
|
val dynamics = dynamicCache
|
||||||
|
if (dynamics != null) {
|
||||||
|
var i = 0
|
||||||
|
val len = dynamics.length
|
||||||
|
while (i < len) {
|
||||||
|
if (dynamics(i) != null) dynamics(i).renderDynamic(pos, frame, pass)
|
||||||
|
i += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def randomDisplayTick(random: Random) {}
|
def randomDisplayTick(random: Random) {}
|
||||||
|
|
||||||
override def shouldRenderInPass(pass: Int) = {
|
override def shouldRenderInPass(pass: Int) = {
|
||||||
MultipartRenderer.pass = pass
|
MultipartRenderer.pass = pass
|
||||||
true
|
if (staticCache == null) updateRenderCache()
|
||||||
|
hasDynamicParts
|
||||||
}
|
}
|
||||||
|
|
||||||
override def getRenderBoundingBox = {
|
override def getRenderBoundingBox = {
|
||||||
val c = Cuboid6.full.copy
|
if (cachedRenderBounds == null) updateRenderCache()
|
||||||
partList.foreach(part => c.enclose(part.getRenderBounds))
|
cachedRenderBounds
|
||||||
c.add(Vector3.fromTileEntity(this)).toAABB
|
}
|
||||||
|
|
||||||
|
override def markRender(): Unit = {
|
||||||
|
super.markRender()
|
||||||
|
updateRenderCache()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
package codechicken.multipart.handler
|
package codechicken.multipart.handler
|
||||||
|
|
||||||
import cpw.mods.fml.common.Mod
|
import cpw.mods.fml.common.Mod
|
||||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent
|
import cpw.mods.fml.common.event.{
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent
|
FMLInitializationEvent,
|
||||||
import cpw.mods.fml.common.event.FMLInitializationEvent
|
FMLPostInitializationEvent,
|
||||||
|
FMLPreInitializationEvent,
|
||||||
|
FMLServerAboutToStartEvent,
|
||||||
|
FMLServerStoppedEvent
|
||||||
|
}
|
||||||
import cpw.mods.fml.common.Mod.EventHandler
|
import cpw.mods.fml.common.Mod.EventHandler
|
||||||
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent
|
|
||||||
import codechicken.multipart.MultiPartRegistry
|
import codechicken.multipart.MultiPartRegistry
|
||||||
import codechicken.multipart.Tags
|
import codechicken.multipart.Tags
|
||||||
|
|
||||||
@@ -39,4 +42,9 @@ object MultipartMod {
|
|||||||
def beforeServerStart(event: FMLServerAboutToStartEvent) {
|
def beforeServerStart(event: FMLServerAboutToStartEvent) {
|
||||||
MultiPartRegistry.beforeServerStart()
|
MultiPartRegistry.beforeServerStart()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
def serverStopped(event: FMLServerStoppedEvent) {
|
||||||
|
MultipartSaveLoad.loadingWorld = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,11 @@ object MultipartCPH extends MultipartPH with IClientPacketHandler {
|
|||||||
for (i <- 0 until num)
|
for (i <- 0 until num)
|
||||||
TileMultipart.handleDescPacket(
|
TileMultipart.handleDescPacket(
|
||||||
world,
|
world,
|
||||||
indexInChunk(cc, packet.readShort),
|
new BlockCoord(
|
||||||
|
packet.readByte + (cc.chunkXPos << 4),
|
||||||
|
packet.readInt,
|
||||||
|
packet.readByte + (cc.chunkZPos << 4)
|
||||||
|
),
|
||||||
packet
|
packet
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -220,7 +224,9 @@ object MultipartSPH
|
|||||||
while (it.hasNext) {
|
while (it.hasNext) {
|
||||||
val tile = it.next
|
val tile = it.next
|
||||||
if (tile.isInstanceOf[TileMultipart]) {
|
if (tile.isInstanceOf[TileMultipart]) {
|
||||||
s.writeShort(indexInChunk(new BlockCoord(tile)))
|
s.writeByte(tile.xCoord & 0xf)
|
||||||
|
s.writeInt(tile.yCoord)
|
||||||
|
s.writeByte(tile.zCoord & 0xf)
|
||||||
tile.asInstanceOf[TileMultipart].writeDesc(s)
|
tile.asInstanceOf[TileMultipart].writeDesc(s)
|
||||||
num += 1
|
num += 1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user