mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-27 15:33:05 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b42613eca8 | ||
|
|
deeb23c22d | ||
|
|
290dc4a815 | ||
|
|
9eb69cdc13 | ||
|
|
7808254465 | ||
|
|
71340a23ef |
No files matched your search
@@ -27,4 +27,5 @@ whitelist.json
|
|||||||
*.iws
|
*.iws
|
||||||
src/main/resources/mixins.*.refmap.json
|
src/main/resources/mixins.*.refmap.json
|
||||||
*.bat
|
*.bat
|
||||||
|
*.sh
|
||||||
layout.json
|
layout.json
|
||||||
+8
-6
@@ -1,13 +1,15 @@
|
|||||||
// Add your dependencies here
|
// Add your dependencies here
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation("com.github.GTNewHorizons:CodeChickenCore:1.4.19:dev")
|
implementation("com.github.GTNewHorizons:CodeChickenCore:1.4.22:dev")
|
||||||
compileOnly("com.github.GTNewHorizons:Angelica:2.1.19:dev")
|
compileOnly("com.cardinalstar.cubicchunks:CubicChunks1710:v0.1.8-alpha:dev")
|
||||||
compileOnly("com.github.GTNewHorizons:Postea:1.2.5:dev") {transitive = false}
|
compileOnly("com.github.GTNewHorizons:Angelica:2.2.32:dev")
|
||||||
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.8.93-GTNH:dev") {
|
runtimeOnlyNonPublishable("com.github.GTNewHorizons:Hodgepodge:2.7.216:dev")
|
||||||
|
compileOnly("com.github.GTNewHorizons:Postea:1.2.7:dev") {transitive = false}
|
||||||
|
devOnlyNonPublishable("com.github.GTNewHorizons:NotEnoughItems:2.8.160-GTNH:dev") {
|
||||||
exclude group: 'com.github.GTNewHorizons', module: 'CodeChickenCore'
|
exclude group: 'com.github.GTNewHorizons', module: 'CodeChickenCore'
|
||||||
}
|
}
|
||||||
compileOnly("com.github.GTNewHorizons:GTNHLib:0.11.44:dev")
|
compileOnly("com.github.GTNewHorizons:GTNHLib:0.11.54:dev")
|
||||||
// devOnlyNonPublishable("com.github.GTNewHorizons:Angelica:2.2.10:dev")
|
// devOnlyNonPublishable("com.github.GTNewHorizons:Angelica:2.2.32:dev")
|
||||||
devOnlyNonPublishable("io.github.legacymoddingmc:unimixins:0.1.23:dev")
|
devOnlyNonPublishable("io.github.legacymoddingmc:unimixins:0.1.23:dev")
|
||||||
}
|
}
|
||||||
@@ -186,6 +186,11 @@ modrinthRelations =
|
|||||||
# Leave this empty if you don't want to publish on CurseForge.
|
# Leave this empty if you don't want to publish on CurseForge.
|
||||||
curseForgeProjectId =
|
curseForgeProjectId =
|
||||||
|
|
||||||
|
# Comma-separated supported CurseForge environments: client, server (case-insensitive).
|
||||||
|
# Use client or server for mods that only support one environment. Defaults to client,server.
|
||||||
|
# These tags describe where the mod can run, not whether installation is required on both sides.
|
||||||
|
curseForgeEnvironments = client,server
|
||||||
|
|
||||||
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||||
# Syntax: type1:name1;type2:name2;...
|
# Syntax: type1:name1;type2:name2;...
|
||||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#This file is generated by updateDaemonJvm
|
#This file is generated by updateDaemonJvm
|
||||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c2dd35c9d0aaf0ba6ad0791320f99dfc/redirect
|
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
|
||||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/e5810bd7fd1f8a586644409d395a7e55/redirect
|
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
|
||||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
|
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7b3c4877c0749019e6805bb61e421497/redirect
|
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
|
||||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
|
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
|
||||||
toolchainVersion=25
|
toolchainVersion=25
|
||||||
Vendored
BIN
Binary file not shown.
+3
-1
@@ -1,7 +1,9 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
|
retries=0
|
||||||
|
retryBackOffMs=500
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
# Gradle start up script for POSIX generated by Gradle.
|
# gradlew start up script for POSIX generated by Gradle.
|
||||||
#
|
#
|
||||||
# Important for running:
|
# Important for running:
|
||||||
#
|
#
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
# bash, then to run this script, type that shell name before the whole
|
# bash, then to run this script, type that shell name before the whole
|
||||||
# command line, like:
|
# command line, like:
|
||||||
#
|
#
|
||||||
# ksh Gradle
|
# ksh gradlew
|
||||||
#
|
#
|
||||||
# Busybox and similar reduced shells will NOT work, because this script
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
# requires all of these POSIX shell features:
|
# requires all of these POSIX shell features:
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
|||||||
Vendored
+12
-23
@@ -19,12 +19,12 @@
|
|||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem gradlew startup script for Windows
|
||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
setlocal EnableExtensions
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%"=="" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
@@ -51,7 +51,7 @@ echo. 1>&2
|
|||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation. 1>&2
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
"%COMSPEC%" /c exit 1
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
:findJavaFromJavaHome
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
@@ -65,29 +65,18 @@ echo. 1>&2
|
|||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||||
echo location of your Java installation. 1>&2
|
echo location of your Java installation. 1>&2
|
||||||
|
|
||||||
goto fail
|
"%COMSPEC%" /c exit 1
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute gradlew
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||||
|
@rem which allows us to clear the local environment before executing the java command
|
||||||
|
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||||
|
|
||||||
:end
|
:exitWithErrorLevel
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||||
|
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
set EXIT_CODE=%ERRORLEVEL%
|
|
||||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
|
||||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
|
||||||
exit /b %EXIT_CODE%
|
|
||||||
|
|
||||||
:mainEnd
|
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
|
||||||
:omega
|
|
||||||
+1
-1
@@ -17,5 +17,5 @@ pluginManagement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
|
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.34'
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ object MicroRecipe extends IRecipe {
|
|||||||
def findMaterial(item: ItemStack): Int =
|
def findMaterial(item: ItemStack): Int =
|
||||||
MicroMaterialRegistry.getIdMap.find { m =>
|
MicroMaterialRegistry.getIdMap.find { m =>
|
||||||
val mitem = m._2.getItem
|
val mitem = m._2.getItem
|
||||||
item.getItem == mitem.getItem &&
|
m._2 != MissingMicroMaterial && item.getItem == mitem.getItem &&
|
||||||
item.getItemDamage == mitem.getItemDamage &&
|
item.getItemDamage == mitem.getItemDamage &&
|
||||||
ItemStack.areItemStackTagsEqual(item, mitem)
|
ItemStack.areItemStackTagsEqual(item, mitem)
|
||||||
} match {
|
} match {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package codechicken.microblock.handler
|
package codechicken.microblock.handler
|
||||||
|
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent
|
import cpw.mods.fml.common.eventhandler.{EventPriority, SubscribeEvent}
|
||||||
import cpw.mods.fml.relauncher.SideOnly
|
import cpw.mods.fml.relauncher.SideOnly
|
||||||
import cpw.mods.fml.relauncher.Side
|
import cpw.mods.fml.relauncher.Side
|
||||||
import net.minecraftforge.client.event.TextureStitchEvent
|
import net.minecraftforge.client.event.TextureStitchEvent
|
||||||
@@ -14,7 +14,7 @@ import cpw.mods.fml.common.LoaderState
|
|||||||
import net.minecraft.util.MovingObjectPosition.MovingObjectType
|
import net.minecraft.util.MovingObjectPosition.MovingObjectType
|
||||||
|
|
||||||
object MicroblockEventHandler {
|
object MicroblockEventHandler {
|
||||||
@SubscribeEvent
|
@SubscribeEvent(priority = EventPriority.LOW)
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
def postTextureStitch(event: TextureStitchEvent.Post) {
|
def postTextureStitch(event: TextureStitchEvent.Post) {
|
||||||
if (event.map.getTextureType == 0)
|
if (event.map.getTextureType == 0)
|
||||||
|
|||||||
@@ -81,12 +81,14 @@ object MultipartGenerator extends ScratchBitSet {
|
|||||||
pos: BlockCoord,
|
pos: BlockCoord,
|
||||||
part: TMultiPart
|
part: TMultiPart
|
||||||
): TileMultipart = {
|
): TileMultipart = {
|
||||||
val (tile, converted) = TileMultipart.getOrConvertTile2(world, pos)
|
val (tile, converted) =
|
||||||
|
if (world.isRemote) (TileMultipart.getTile(world, pos), false)
|
||||||
|
else TileMultipart.getOrConvertTile2(world, pos)
|
||||||
val bitset = setTraits(part, world.isRemote)
|
val bitset = setTraits(part, world.isRemote)
|
||||||
|
|
||||||
var ntile = tile
|
var ntile = tile
|
||||||
if (ntile != null) {
|
if (ntile != null) {
|
||||||
if (converted) { // perform client conversion
|
if (converted) { // server-side conversion, then tell the clients
|
||||||
ntile.partList(0).invalidateConvertedTile()
|
ntile.partList(0).invalidateConvertedTile()
|
||||||
world.setBlock(pos.x, pos.y, pos.z, MultipartProxy.block, 0, 0)
|
world.setBlock(pos.x, pos.y, pos.z, MultipartProxy.block, 0, 0)
|
||||||
silentAddTile(world, pos, ntile)
|
silentAddTile(world, pos, ntile)
|
||||||
@@ -122,9 +124,14 @@ object MultipartGenerator extends ScratchBitSet {
|
|||||||
* adding it to the tick list
|
* adding it to the tick list
|
||||||
*/
|
*/
|
||||||
def silentAddTile(world: World, pos: BlockCoord, tile: TileEntity) {
|
def silentAddTile(world: World, pos: BlockCoord, tile: TileEntity) {
|
||||||
|
tile.xCoord = pos.x;
|
||||||
|
tile.yCoord = pos.y;
|
||||||
|
tile.zCoord = pos.z;
|
||||||
|
|
||||||
val chunk = world.getChunkFromBlockCoords(pos.x, pos.z)
|
val chunk = world.getChunkFromBlockCoords(pos.x, pos.z)
|
||||||
if (chunk != null)
|
if (chunk != null) {
|
||||||
chunk.func_150812_a(pos.x & 15, pos.y, pos.z & 15, tile)
|
chunk.addTileEntity(tile)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Check if tile satisfies all the interfaces required by parts. If not,
|
/** Check if tile satisfies all the interfaces required by parts. If not,
|
||||||
|
|||||||
@@ -78,7 +78,8 @@ class TileMultipart extends TileEntity with IChunkLoadTile {
|
|||||||
val it = partList.iterator
|
val it = partList.iterator
|
||||||
while (it.hasNext) {
|
while (it.hasNext) {
|
||||||
val p = it.next()
|
val p = it.next()
|
||||||
if (p.tile != null) f(p)
|
// A replaced tile can still receive queued callbacks after its parts have moved.
|
||||||
|
if (p.tile == this) f(p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package codechicken.multipart.handler
|
||||||
|
|
||||||
|
import com.cardinalstar.cubicchunks.api.event.CubeEvent
|
||||||
|
import cpw.mods.fml.common.eventhandler.{EventPriority, SubscribeEvent}
|
||||||
|
import net.minecraftforge.common.MinecraftForge
|
||||||
|
import scala.collection.JavaConversions._
|
||||||
|
|
||||||
|
object CubicChunksCompat {
|
||||||
|
def init(): Unit = MinecraftForge.EVENT_BUS.register(this)
|
||||||
|
|
||||||
|
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||||
|
def onTileEntitiesLoad(event: CubeEvent.DataLoad): Unit = {
|
||||||
|
val cube = event.cube
|
||||||
|
val world = event.world
|
||||||
|
|
||||||
|
MultipartSaveLoad.loadTiles(world, cube.cubeTileEntityMap)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,30 +1,28 @@
|
|||||||
package codechicken.multipart.handler
|
package codechicken.multipart.handler
|
||||||
|
|
||||||
import codechicken.multipart.{
|
import codechicken.multipart.{BlockMultipart, TileCache, TileMultipart}
|
||||||
TileCache,
|
|
||||||
TileMultipart,
|
|
||||||
MultiPartRegistry,
|
|
||||||
BlockMultipart
|
|
||||||
}
|
|
||||||
import cpw.mods.fml.common.eventhandler.{EventPriority, SubscribeEvent}
|
import cpw.mods.fml.common.eventhandler.{EventPriority, SubscribeEvent}
|
||||||
import net.minecraft.server.MinecraftServer
|
|
||||||
import codechicken.lib.packet.PacketCustom
|
|
||||||
import net.minecraftforge.event.world._
|
|
||||||
import java.util.EnumSet
|
|
||||||
import scala.collection.JavaConverters._
|
|
||||||
import java.util.List
|
|
||||||
import net.minecraft.entity.player.EntityPlayerMP
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly
|
|
||||||
import cpw.mods.fml.relauncher.Side
|
|
||||||
import net.minecraftforge.client.event.DrawBlockHighlightEvent
|
|
||||||
import net.minecraft.util.MovingObjectPosition
|
|
||||||
import net.minecraft.util.MovingObjectPosition.MovingObjectType
|
|
||||||
import cpw.mods.fml.common.gameevent.TickEvent
|
import cpw.mods.fml.common.gameevent.TickEvent
|
||||||
|
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||||
|
import net.minecraft.entity.player.EntityPlayerMP
|
||||||
|
import net.minecraft.server.MinecraftServer
|
||||||
|
import net.minecraft.tileentity.TileEntity
|
||||||
|
import net.minecraft.util.MovingObjectPosition.MovingObjectType
|
||||||
|
import net.minecraft.world.ChunkPosition
|
||||||
|
import net.minecraftforge.client.event.DrawBlockHighlightEvent
|
||||||
|
import net.minecraftforge.event.world._
|
||||||
|
|
||||||
|
import java.util.List
|
||||||
|
import scala.collection.JavaConverters._
|
||||||
|
|
||||||
object MultipartEventHandler {
|
object MultipartEventHandler {
|
||||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||||
def tileEntityLoad(event: ChunkDataEvent.Load) {
|
def tileEntityLoad(event: ChunkDataEvent.Load) {
|
||||||
MultipartSaveLoad.loadTiles(event.getChunk)
|
MultipartSaveLoad.loadTiles(
|
||||||
|
event.getChunk.worldObj,
|
||||||
|
event.getChunk.chunkTileEntityMap
|
||||||
|
.asInstanceOf[java.util.Map[ChunkPosition, TileEntity]]
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|||||||
@@ -2,14 +2,16 @@ package codechicken.multipart.handler
|
|||||||
|
|
||||||
import net.minecraft.tileentity.TileEntity
|
import net.minecraft.tileentity.TileEntity
|
||||||
import net.minecraft.nbt.NBTTagCompound
|
import net.minecraft.nbt.NBTTagCompound
|
||||||
|
|
||||||
import java.util.Map
|
import java.util.Map
|
||||||
import net.minecraft.world.chunk.Chunk
|
|
||||||
import net.minecraft.world.ChunkPosition
|
import net.minecraft.world.ChunkPosition
|
||||||
import codechicken.multipart.{MultipartHelper, TileMultipart}
|
import codechicken.multipart.{MultipartHelper, TileMultipart}
|
||||||
import codechicken.lib.asm.ObfMapping
|
import codechicken.lib.asm.ObfMapping
|
||||||
import net.minecraft.world.World
|
import net.minecraft.world.World
|
||||||
|
|
||||||
import scala.collection.mutable
|
import scala.collection.mutable
|
||||||
import codechicken.multipart.MultipartHelper.IPartTileConverter
|
import codechicken.multipart.MultipartHelper.IPartTileConverter
|
||||||
|
|
||||||
import scala.collection.JavaConversions._
|
import scala.collection.JavaConversions._
|
||||||
|
|
||||||
/** Hack due to lack of TileEntityLoadEvent in forge
|
/** Hack due to lack of TileEntityLoadEvent in forge
|
||||||
@@ -58,12 +60,9 @@ object MultipartSaveLoad {
|
|||||||
field.get(null).asInstanceOf[Map[Class[_ <: TileEntity], String]]
|
field.get(null).asInstanceOf[Map[Class[_ <: TileEntity], String]]
|
||||||
}
|
}
|
||||||
|
|
||||||
def loadTiles(chunk: Chunk) {
|
def loadTiles(world: World, tiles: Map[ChunkPosition, TileEntity]) {
|
||||||
loadingWorld = chunk.worldObj
|
loadingWorld = world
|
||||||
val iterator = chunk.chunkTileEntityMap
|
val iterator = tiles.entrySet.iterator
|
||||||
.asInstanceOf[Map[ChunkPosition, TileEntity]]
|
|
||||||
.entrySet
|
|
||||||
.iterator
|
|
||||||
while (iterator.hasNext) {
|
while (iterator.hasNext) {
|
||||||
val e = iterator.next
|
val e = iterator.next
|
||||||
var next = false
|
var next = false
|
||||||
@@ -88,7 +87,7 @@ object MultipartSaveLoad {
|
|||||||
|
|
||||||
if (!next) {
|
if (!next) {
|
||||||
if (t != null) {
|
if (t != null) {
|
||||||
t.setWorldObj(e.getValue.getWorldObj)
|
t.setWorldObj(world)
|
||||||
t.validate()
|
t.validate()
|
||||||
e.setValue(t)
|
e.setValue(t)
|
||||||
} else
|
} else
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import codechicken.lib.packet.PacketCustom
|
|||||||
import net.minecraft.world.ChunkCoordIntPair
|
import net.minecraft.world.ChunkCoordIntPair
|
||||||
import codechicken.lib.vec.BlockCoord
|
import codechicken.lib.vec.BlockCoord
|
||||||
import codechicken.lib.world.{TileChunkLoadHook, WorldExtensionManager}
|
import codechicken.lib.world.{TileChunkLoadHook, WorldExtensionManager}
|
||||||
import cpw.mods.fml.common.FMLCommonHandler
|
import cpw.mods.fml.common.{FMLCommonHandler, Loader}
|
||||||
import cpw.mods.fml.common.registry.GameRegistry
|
import cpw.mods.fml.common.registry.GameRegistry
|
||||||
import net.minecraft.block.Block
|
import net.minecraft.block.Block
|
||||||
import org.apache.logging.log4j.Logger
|
import org.apache.logging.log4j.Logger
|
||||||
@@ -90,6 +90,8 @@ class MultipartProxy_serverImpl {
|
|||||||
TileChunkLoadHook.init()
|
TileChunkLoadHook.init()
|
||||||
|
|
||||||
MultipartCompatiblity.load()
|
MultipartCompatiblity.load()
|
||||||
|
if (Loader.isModLoaded("cubicchunks"))
|
||||||
|
CubicChunksCompat.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
def onTileClassBuilt(t: Class[_ <: TileEntity]) {
|
def onTileClassBuilt(t: Class[_ <: TileEntity]) {
|
||||||
|
|||||||
Reference in new issue
Block a user