mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-12 16:37:38 +00:00
48 lines
1.5 KiB
Scala
48 lines
1.5 KiB
Scala
package codechicken.microblock
|
|
|
|
import codechicken.core.lighting.CCRBModel
|
|
import net.minecraft.util.MovingObjectPosition
|
|
import net.minecraft.world.World
|
|
import codechicken.core.vec.BlockCoord
|
|
import codechicken.core.vec.Vector3
|
|
import codechicken.core.render.CCModel
|
|
import codechicken.multipart.TMultiPart
|
|
import net.minecraft.entity.player.EntityPlayer
|
|
import codechicken.multipart.TileMultipart
|
|
import cpw.mods.fml.relauncher.SideOnly
|
|
import cpw.mods.fml.relauncher.Side
|
|
|
|
trait MicroblockClass
|
|
{
|
|
var classID:Int = _
|
|
|
|
def getDisplayName(size:Int):String
|
|
|
|
def itemSizes() = Seq(1, 2, 4)
|
|
|
|
def itemSlot() = 3
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
def renderHighlight(world:World, player:EntityPlayer, hit:MovingObjectPosition, size:Int, material:Int):Boolean =
|
|
{
|
|
placementProperties.placementGrid.render(new Vector3(hit.hitVec), hit.sideHit)
|
|
|
|
val placement = MicroblockPlacement(world, player, hit, size, material, !player.capabilities.isCreativeMode, placementProperties)
|
|
if(placement != null)
|
|
CommonMicroblock.renderHighlight(world, placement.pos, placement.part.asInstanceOf[MicroblockClient])
|
|
|
|
return true
|
|
}
|
|
|
|
def getName():String
|
|
|
|
def create(client:Boolean):CommonMicroblock
|
|
|
|
def create(size:Int, slot:Int, material:Int, client:Boolean):CommonMicroblock
|
|
|
|
def sizeToVolume(size:Int) = size
|
|
|
|
def placementProperties():PlacementProperties
|
|
|
|
def register(id:Int) = MicroblockClassRegistry.registerMicroClass(this, id)
|
|
} |