Refactored SlotSet to prevent textures being initialized on dedicated servers (bdew/generators#23)

This commit is contained in:
bdew committed 2015-02-08 23:39:37 +02:00
1 parent 0e345e6675
commit 561833db33
2 files changed
+9 -2

No files matched your search

+1 -1
View File
@@ -21,7 +21,7 @@ buildscript {
apply plugin: 'scala'
apply plugin: 'forge'
version = "1.6.1"
version = "1.6.2"
if (project.hasProperty('buildnum')) {
project.version = project.version + '.' + project.buildnum
@@ -9,6 +9,7 @@
package net.bdew.lib.multiblock.data
import cpw.mods.fml.relauncher.{Side, SideOnly}
import net.bdew.lib.gui.Texture
abstract class SlotSet(val outputConfigId: String) {
@@ -16,13 +17,19 @@ abstract class SlotSet(val outputConfigId: String) {
var slotMap = Map.empty[String, Slot]
case class Slot(id: String, name: String, texture: Texture) {
case class Slot(id: String, name: String) {
slotMap += id -> this
def next = order(this)
@SideOnly(Side.CLIENT)
def texture = textures(this)
}
def default: Slot
val order: Map[Slot, Slot]
@SideOnly(Side.CLIENT)
def textures: Map[Slot, Texture]
def get(id: String) = slotMap(id)
}