mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-21 20:52:21 +00:00
Update Forge name mappings
Add untested sorted raytrace.
This commit is contained in:
1 parent
686789acfd
commit
ae970734fc
5 files changed
+33
-12
No files matched your search
@@ -44,9 +44,9 @@ object DefaultContent
|
||||
createAndRegister(blockEmerald)
|
||||
createAndRegister(blockRedstone)
|
||||
createAndRegister(blockNetherQuartz)
|
||||
createAndRegister(field_111039_cA, 0 to 15)
|
||||
createAndRegister(field_111032_cD)
|
||||
createAndRegister(field_111034_cE)
|
||||
createAndRegister(stainedClay, 0 to 15)
|
||||
createAndRegister(hardenedClay)
|
||||
createAndRegister(coalBlock)
|
||||
registerMaterial(new GrassMicroMaterial, grass.getUnlocalizedName)
|
||||
registerMaterial(new TopMicroMaterial(mycelium), mycelium.getUnlocalizedName)
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ class MicroblockProxy_serverImpl
|
||||
sawIron = createSaw(config, "sawIron", 2)
|
||||
sawDiamond = createSaw(config, "sawDiamond", 3)
|
||||
stoneRod = new Item(config.getTag("stoneRod.id").getIntValue(nextItemID))
|
||||
.setUnlocalizedName("microblock:stoneRod").func_111206_d("microblock:stoneRod")
|
||||
.setUnlocalizedName("microblock:stoneRod").setTextureName("microblock:stoneRod")
|
||||
|
||||
OreDictionary.registerOre("stoneRod", stoneRod)
|
||||
MinecraftForge.EVENT_BUS.register(MicroblockEventHandler)
|
||||
|
||||
@@ -28,6 +28,7 @@ import codechicken.lib.render.TextureUtils
|
||||
import net.minecraft.world.IBlockAccess
|
||||
import codechicken.lib.raytracer.ExtendedMOP
|
||||
import scala.collection.JavaConversions._
|
||||
import java.util.Collections
|
||||
import codechicken.multipart.scalatraits.TTileChangeTile
|
||||
|
||||
object BlockMultipart
|
||||
@@ -82,16 +83,36 @@ trait BlockMultipart extends Block
|
||||
|
||||
override def collisionRayTrace(world:World, x:Int, y:Int, z:Int, start:Vec3, end:Vec3):MovingObjectPosition =
|
||||
{
|
||||
val boxes:LinkedList[IndexedCuboid6] = new LinkedList;
|
||||
val tile = getTile(world, x, y, z)
|
||||
if(tile == null)
|
||||
return null
|
||||
|
||||
return RayTracer.instance.rayTraceCuboids(new Vector3(start), new Vector3(end),
|
||||
getRayTraceCuboids(tile), new BlockCoord(x, y, z), this)
|
||||
}
|
||||
|
||||
def getRayTraceCuboids(tile:TileMultipart):LinkedList[IndexedCuboid6] = {
|
||||
val boxes:LinkedList[IndexedCuboid6] = new LinkedList
|
||||
|
||||
for(i <- 0 until tile.partList.size)
|
||||
tile.partList(i).getSubParts.foreach(c =>
|
||||
boxes.add(new IndexedCuboid6((i, c.data), c.copy.add(new Vector3(x, y, z)))))
|
||||
|
||||
return RayTracer.instance.rayTraceCuboids(new Vector3(start), new Vector3(end), boxes, new BlockCoord(x, y, z), this)
|
||||
tile.partList(i).getSubParts.foreach{ c =>
|
||||
boxes.add(new IndexedCuboid6((i, c.data), c.copy.add(new Vector3(tile.xCoord, tile.yCoord, tile.zCoord))))
|
||||
}
|
||||
|
||||
return boxes
|
||||
}
|
||||
|
||||
def rayTraceAll(world:World, x:Int, y:Int, z:Int, start:Vec3, end:Vec3):Iterable[ExtendedMOP] =
|
||||
{
|
||||
val tile = getTile(world, x, y, z)
|
||||
if(tile == null)
|
||||
return Seq()
|
||||
|
||||
val list = new LinkedList[ExtendedMOP]()
|
||||
RayTracer.instance.rayTraceCuboids(new Vector3(start), new Vector3(end),
|
||||
getRayTraceCuboids(tile), new BlockCoord(x, y, z), this, list)
|
||||
Collections.sort(list)
|
||||
return list
|
||||
}
|
||||
|
||||
override def removeBlockByPlayer(world:World, player:EntityPlayer, x:Int, y:Int, z:Int):Boolean =
|
||||
@@ -206,7 +227,7 @@ trait BlockMultipart extends Block
|
||||
{
|
||||
val n = getUnlocalizedName();
|
||||
val icon = TextureUtils.getBlankIcon(16, register);
|
||||
func_111022_d(icon.getIconName)
|
||||
setTextureName(icon.getIconName)
|
||||
super.registerIcons(register)
|
||||
}
|
||||
|
||||
|
||||
@@ -182,7 +182,7 @@ class TileMultipart extends TileEntity
|
||||
|
||||
def markDirty()
|
||||
{
|
||||
worldObj.updateTileEntityChunkAndDoNothing(xCoord, yCoord, zCoord, this)
|
||||
worldObj.markTileEntityChunkModified(xCoord, yCoord, zCoord, this)
|
||||
}
|
||||
|
||||
def isSolid(side:Int):Boolean =
|
||||
|
||||
+1
-1
@@ -3,5 +3,5 @@
|
||||
"file": "CodeChickenLib-universal-@MCVERSION@-@[email protected]",
|
||||
"dev": "CodeChickenLib-dev-@MCVERSION@-@[email protected]",
|
||||
"class": "codechicken.lib.asm.ASMHelper",
|
||||
"version": "1.0.0.24"
|
||||
"version": "1.0.0.28"
|
||||
}
|
||||
Reference in new issue
Block a user