diff --git a/src/codechicken/microblock/CornerMicroblock.scala b/src/codechicken/microblock/CornerMicroblock.scala index f79f5e3..bbec95a 100644 --- a/src/codechicken/microblock/CornerMicroblock.scala +++ b/src/codechicken/microblock/CornerMicroblock.scala @@ -38,13 +38,13 @@ object CornerMicroClass extends MicroblockClass def create(client:Boolean) = if(client) - new CornerMicroblockClient + new CornerMicroblock with CommonMicroblockClient else new CornerMicroblock def create(size:Int, slot:Int, material:Int, client:Boolean) = if(client) - new CornerMicroblockClient(size, slot, material) + new CornerMicroblock(size, slot, material)with CommonMicroblockClient else new CornerMicroblock(size, slot, material) @@ -53,11 +53,6 @@ object CornerMicroClass extends MicroblockClass def getResistanceFactor = 1 } -class CornerMicroblockClient(shape$:Byte = 0, material$:Int = 0) extends CornerMicroblock(shape$, material$) with CommonMicroblockClient -{ - def this(size:Int, slot:Int, material:Int) = this((size<<4|(slot-7)).toByte, material) -} - class CornerMicroblock(shape$:Byte = 0, material$:Int = 0) extends CommonMicroblock(shape$, material$) { def this(size:Int, slot:Int, material:Int) = this((size<<4|(slot-7)).toByte, material) diff --git a/src/codechicken/microblock/EdgeMicroblock.scala b/src/codechicken/microblock/EdgeMicroblock.scala index bbb993c..7886564 100644 --- a/src/codechicken/microblock/EdgeMicroblock.scala +++ b/src/codechicken/microblock/EdgeMicroblock.scala @@ -88,13 +88,13 @@ object EdgeMicroClass extends MicroblockClass def create(client:Boolean) = if(client) - new EdgeMicroblockClient + new EdgeMicroblock with CommonMicroblockClient else new EdgeMicroblock def create(size:Int, slot:Int, material:Int, client:Boolean) = if(client) - new EdgeMicroblockClient(size, slot, material) + new EdgeMicroblock(size, slot, material) with CommonMicroblockClient else new EdgeMicroblock(size, slot, material) @@ -114,11 +114,6 @@ class EdgeMicroblock(shape$:Byte = 0, material$:Int = 0) extends CommonMicrobloc override def getSlot = getShape+15 } -class EdgeMicroblockClient(shape$:Byte = 0, material$:Int = 0) extends EdgeMicroblock(shape$, material$) with CommonMicroblockClient -{ - def this(size:Int, slot:Int, material:Int) = this((size<<4|(slot-15)).toByte, material) -} - object PostMicroClass { var aBounds:Array[Cuboid6] = new Array(256) @@ -138,13 +133,13 @@ object PostMicroClass def create(client:Boolean) = if(client) - new PostMicroblockClient + new PostMicroblock with PostMicroblockClient else new PostMicroblock def create(size:Int, slot:Int, material:Int, client:Boolean) = if(client) - new PostMicroblockClient(size, slot, material) + new PostMicroblock(size, slot, material) with PostMicroblockClient else new PostMicroblock(size, slot, material) @@ -153,13 +148,11 @@ object PostMicroClass def getResistanceFactor = 0.5F } -class PostMicroblockClient(shape$:Byte = 0, material$:Int = 0) extends PostMicroblock(shape$, material$) with MicroblockClient +trait PostMicroblockClient extends PostMicroblock with MicroblockClient { var renderBounds1:Cuboid6 = _ var renderBounds2:Cuboid6 = _ - def this(size:Int, orient:Int, material:Int) = this((size<<4|orient).toByte, material) - override def render(pos:Vector3, pass:Int) { val mat = getIMaterial diff --git a/src/codechicken/microblock/FaceMicroblock.scala b/src/codechicken/microblock/FaceMicroblock.scala index d78aa95..1cc4d20 100644 --- a/src/codechicken/microblock/FaceMicroblock.scala +++ b/src/codechicken/microblock/FaceMicroblock.scala @@ -40,13 +40,13 @@ object FaceMicroClass extends MicroblockClass def create(client:Boolean) = if(client) - new FaceMicroblockClient + new FaceMicroblock with FaceMicroblockClient else new FaceMicroblock def create(size:Int, slot:Int, material:Int, client:Boolean) = if(client) - new FaceMicroblockClient(size, slot, material) + new FaceMicroblock(size, slot, material) with FaceMicroblockClient else new FaceMicroblock(size, slot, material) @@ -55,10 +55,8 @@ object FaceMicroClass extends MicroblockClass def getResistanceFactor = 1 } -class FaceMicroblockClient(shape$:Byte = 0, material$:Int = 0) extends FaceMicroblock(shape$, material$) with CommonMicroblockClient +trait FaceMicroblockClient extends CommonMicroblockClient { - def this(size:Int, shape:Int, material:Int) = this((size<<4|shape).toByte, material) - override def render(pos:Vector3, pass:Int) { if(pass < 0) MicroblockRender.renderCuboid(pos, getIMaterial, pass, getBounds, 0) diff --git a/src/codechicken/microblock/HollowMicroblock.scala b/src/codechicken/microblock/HollowMicroblock.scala index dc5ac49..99dc542 100644 --- a/src/codechicken/microblock/HollowMicroblock.scala +++ b/src/codechicken/microblock/HollowMicroblock.scala @@ -56,13 +56,13 @@ object HollowMicroClass extends MicroblockClass def create(client: Boolean) = if (client) - new HollowMicroblockClient + new HollowMicroblock with HollowMicroblockClient else new HollowMicroblock def create(size: Int, slot: Int, material: Int, client: Boolean) = if (client) - new HollowMicroblockClient(size, slot, material) + new HollowMicroblock(size, slot, material) with HollowMicroblockClient else new HollowMicroblock(size, slot, material) @@ -71,12 +71,10 @@ object HollowMicroClass extends MicroblockClass def getResistanceFactor = 1 } -class HollowMicroblockClient(shape$: Byte = 0, material$: Int = 0) extends HollowMicroblock(shape$, material$) with CommonMicroblockClient +trait HollowMicroblockClient extends HollowMicroblock with CommonMicroblockClient { renderMask |= 8 << 8 - def this(size: Int, shape: Int, material: Int) = this((size << 4 | shape).toByte, material) - override def recalcBounds() { super.recalcBounds() renderMask = renderMask & 0xFF | getHollowSize << 8