mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
Some more adjustments for 1.8.
This commit is contained in:
parent
8c13372194
commit
7366d8d07a
Before Width: | Height: | Size: 535 B After Width: | Height: | Size: 535 B |
Before Width: | Height: | Size: 423 B After Width: | Height: | Size: 423 B |
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 157 B |
@ -144,7 +144,8 @@ object Textures {
|
||||
val Cable = L("cable")
|
||||
val CableCap = L("cableCap")
|
||||
val GenericTop = L("generic_top", load = false)
|
||||
val NetSplitter = L("netSplitter")
|
||||
val NetSplitterSide = L("netSplitter_side")
|
||||
val NetSplitterTop = L("netSplitter_top")
|
||||
val RackFront = L("serverRack_front", load = false)
|
||||
val RackSide = L("serverRack_side", load = false)
|
||||
|
||||
|
@ -29,6 +29,8 @@ import scala.collection.mutable
|
||||
object ModelInitialization {
|
||||
final val CableBlockLocation = new ModelResourceLocation(Settings.resourceDomain + ":" + Constants.BlockName.Cable, "normal")
|
||||
final val CableItemLocation = new ModelResourceLocation(Settings.resourceDomain + ":" + Constants.BlockName.Cable, "inventory")
|
||||
final val NetSplitterBlockLocation = new ModelResourceLocation(Settings.resourceDomain + ":" + Constants.BlockName.NetSplitter, "normal")
|
||||
final val NetSplitterItemLocation = new ModelResourceLocation(Settings.resourceDomain + ":" + Constants.BlockName.NetSplitter, "inventory")
|
||||
final val PrintBlockLocation = new ModelResourceLocation(Settings.resourceDomain + ":" + Constants.BlockName.Print, "normal")
|
||||
final val PrintItemLocation = new ModelResourceLocation(Settings.resourceDomain + ":" + Constants.BlockName.Print, "inventory")
|
||||
final val RobotBlockLocation = new ModelResourceLocation(Settings.resourceDomain + ":" + Constants.BlockName.Robot, "normal")
|
||||
@ -45,6 +47,7 @@ object ModelInitialization {
|
||||
MinecraftForge.EVENT_BUS.register(this)
|
||||
|
||||
registerModel(Constants.BlockName.Cable, CableBlockLocation, CableItemLocation)
|
||||
registerModel(Constants.BlockName.NetSplitter, NetSplitterBlockLocation, NetSplitterItemLocation)
|
||||
registerModel(Constants.BlockName.Print, PrintBlockLocation, PrintItemLocation)
|
||||
registerModel(Constants.BlockName.Robot, RobotBlockLocation, RobotItemLocation)
|
||||
registerModel(Constants.BlockName.RobotAfterimage, RobotAfterimageBlockLocation, RobotAfterimageItemLocation)
|
||||
@ -137,6 +140,8 @@ object ModelInitialization {
|
||||
|
||||
registry.putObject(CableBlockLocation, CableModel)
|
||||
registry.putObject(CableItemLocation, CableModel)
|
||||
registry.putObject(NetSplitterBlockLocation, NetSplitterModel)
|
||||
registry.putObject(NetSplitterItemLocation, NetSplitterModel)
|
||||
registry.putObject(PrintBlockLocation, PrintModel)
|
||||
registry.putObject(PrintItemLocation, PrintModel)
|
||||
registry.putObject(RobotBlockLocation, RobotModel)
|
||||
|
@ -23,7 +23,14 @@ object NetSplitterModel extends SmartBlockModelBase with ISmartItemModel {
|
||||
|
||||
override def handleItemState(stack: ItemStack) = new ItemModel(stack)
|
||||
|
||||
protected def splitterTexture = Array.fill(6)(Textures.getSprite(Textures.Block.NetSplitter))
|
||||
protected def splitterTexture = Array(
|
||||
Textures.getSprite(Textures.Block.NetSplitterTop),
|
||||
Textures.getSprite(Textures.Block.NetSplitterTop),
|
||||
Textures.getSprite(Textures.Block.NetSplitterSide),
|
||||
Textures.getSprite(Textures.Block.NetSplitterSide),
|
||||
Textures.getSprite(Textures.Block.NetSplitterSide),
|
||||
Textures.getSprite(Textures.Block.NetSplitterSide)
|
||||
)
|
||||
|
||||
protected final val BaseModel = {
|
||||
val faces = mutable.ArrayBuffer.empty[BakedQuad]
|
||||
|
@ -16,20 +16,22 @@ object NetSplitterRenderer extends TileEntitySpecialRenderer {
|
||||
|
||||
val splitter = tileEntity.asInstanceOf[tileentity.NetSplitter]
|
||||
if (splitter.openSides.contains(!splitter.isInverted)) {
|
||||
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS)
|
||||
|
||||
RenderState.disableLighting()
|
||||
RenderState.pushAttrib()
|
||||
RenderState.disableEntityLighting()
|
||||
RenderState.makeItBlend()
|
||||
|
||||
GL11.glPushMatrix()
|
||||
RenderState.pushMatrix()
|
||||
|
||||
GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5)
|
||||
GL11.glScaled(1.0025, -1.0025, 1.0025)
|
||||
GL11.glTranslatef(-0.5f, -0.5f, -0.5f)
|
||||
|
||||
bindTexture(TextureMap.locationBlocksTexture)
|
||||
|
||||
val t = Tessellator.getInstance
|
||||
val r = t.getWorldRenderer
|
||||
|
||||
Textures.Block.bind()
|
||||
r.startDrawingQuads()
|
||||
|
||||
val sideActivity = Textures.getSprite(Textures.Block.NetSplitterOn)
|
||||
@ -78,10 +80,10 @@ object NetSplitterRenderer extends TileEntitySpecialRenderer {
|
||||
|
||||
t.draw()
|
||||
|
||||
RenderState.enableLighting()
|
||||
RenderState.enableEntityLighting()
|
||||
|
||||
GL11.glPopMatrix()
|
||||
GL11.glPopAttrib()
|
||||
RenderState.popMatrix()
|
||||
RenderState.popAttrib()
|
||||
}
|
||||
|
||||
RenderState.checkError(getClass.getName + ".renderTileEntityAt: leaving")
|
||||
|
Loading…
x
Reference in New Issue
Block a user