mirror of
https://github.com/GTNewHorizons/bdlib.git
synced 2026-11-22 13:09:45 +00:00
TileModule.getCoreAs reworked for better type safety
This commit is contained in:
1 parent
d9cc8ace82
commit
58125ee291
1 file changed
+3
-2
@@ -20,8 +20,9 @@ trait TileModule extends TileDataSlots {
|
||||
val kind: String
|
||||
val connected = new DataSlotPos("connected", this).setUpdate(UpdateKind.WORLD, UpdateKind.SAVE, UpdateKind.RENDER)
|
||||
|
||||
def getCoreAs[T: ClassTag] = connected flatMap (_.getTile[TileController with T](getWorldObj))
|
||||
def getCore = connected flatMap (_.getTile[TileController](getWorldObj))
|
||||
def getCoreAs[T <: TileController : ClassTag] = connected flatMap (_.getTile[T](getWorldObj))
|
||||
|
||||
def getCore = getCoreAs[TileController]
|
||||
|
||||
lazy val mypos = BlockRef(xCoord, yCoord, zCoord)
|
||||
|
||||
|
||||
Reference in new issue
Block a user