mirror of
https://github.com/GTNewHorizons/bdlib.git
synced 2026-11-26 15:02:55 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a78467232 | ||
|
|
561833db33 | ||
|
|
0e345e6675 | ||
|
|
e78e565ec8 | ||
|
|
573330efd3 |
No files matched your search
+3
-2
@@ -21,7 +21,7 @@ buildscript {
|
|||||||
apply plugin: 'scala'
|
apply plugin: 'scala'
|
||||||
apply plugin: 'forge'
|
apply plugin: 'forge'
|
||||||
|
|
||||||
version = "1.6.0"
|
version = "1.6.2"
|
||||||
|
|
||||||
if (project.hasProperty('buildnum')) {
|
if (project.hasProperty('buildnum')) {
|
||||||
project.version = project.version + '.' + project.buildnum
|
project.version = project.version + '.' + project.buildnum
|
||||||
@@ -70,7 +70,8 @@ task sourceJar(type: Jar) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
task deobfJar(type: Jar) {
|
task deobfJar(type: Jar) {
|
||||||
from sourceSets.main.output.classesDir
|
from sourceSets.main.output
|
||||||
|
duplicatesStrategy "exclude"
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import java.text.DecimalFormat
|
|||||||
object DecFormat {
|
object DecFormat {
|
||||||
val thousandsFmt = new DecimalFormat("#,##0")
|
val thousandsFmt = new DecimalFormat("#,##0")
|
||||||
val dec2Fmt = new DecimalFormat("#,##0.00")
|
val dec2Fmt = new DecimalFormat("#,##0.00")
|
||||||
|
val dec1Fmt = new DecimalFormat("#,##0.0")
|
||||||
|
|
||||||
def round(x: Double) = thousandsFmt.format(x)
|
def round(x: Double) = thousandsFmt.format(x)
|
||||||
def round(x: Float) = thousandsFmt.format(x)
|
def round(x: Float) = thousandsFmt.format(x)
|
||||||
@@ -22,4 +23,8 @@ object DecFormat {
|
|||||||
def dec2(x: Double) = dec2Fmt.format(x)
|
def dec2(x: Double) = dec2Fmt.format(x)
|
||||||
def dec2(x: Float) = dec2Fmt.format(x)
|
def dec2(x: Float) = dec2Fmt.format(x)
|
||||||
def dec2(x: Int) = dec2Fmt.format(x)
|
def dec2(x: Int) = dec2Fmt.format(x)
|
||||||
|
|
||||||
|
def short(x: Double) = if (x > 10) thousandsFmt.format(x) else if (x > 1) dec1Fmt.format(x) else dec2Fmt.format(x)
|
||||||
|
def short(x: Float) = if (x > 10) thousandsFmt.format(x) else if (x > 1) dec1Fmt.format(x) else dec2Fmt.format(x)
|
||||||
|
def short(x: Int) = if (x > 10) thousandsFmt.format(x) else if (x > 1) dec1Fmt.format(x) else dec2Fmt.format(x)
|
||||||
}
|
}
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
|
|
||||||
package net.bdew.lib.multiblock.data
|
package net.bdew.lib.multiblock.data
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.{Side, SideOnly}
|
||||||
import net.bdew.lib.gui.Texture
|
import net.bdew.lib.gui.Texture
|
||||||
|
|
||||||
abstract class SlotSet(val outputConfigId: String) {
|
abstract class SlotSet(val outputConfigId: String) {
|
||||||
@@ -16,13 +17,19 @@ abstract class SlotSet(val outputConfigId: String) {
|
|||||||
|
|
||||||
var slotMap = Map.empty[String, Slot]
|
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
|
slotMap += id -> this
|
||||||
def next = order(this)
|
def next = order(this)
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
def texture = textures(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
def default: Slot
|
def default: Slot
|
||||||
val order: Map[Slot, Slot]
|
val order: Map[Slot, Slot]
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
def textures: Map[Slot, Texture]
|
||||||
|
|
||||||
def get(id: String) = slotMap(id)
|
def get(id: String) = slotMap(id)
|
||||||
}
|
}
|
||||||
@@ -56,7 +56,7 @@ class DataSlotResource(val name: String, val parent: TileDataSlots, initCapacity
|
|||||||
if (onlyRound) canDrain = canDrain.floor
|
if (onlyRound) canDrain = canDrain.floor
|
||||||
if (doDrain) execWithChangeNotify {
|
if (doDrain) execWithChangeNotify {
|
||||||
resource =
|
resource =
|
||||||
if (canDrain == res.amount)
|
if (res.amount - canDrain < 0.000001)
|
||||||
None
|
None
|
||||||
else
|
else
|
||||||
Some(Resource(res.kind, res.amount - canDrain))
|
Some(Resource(res.kind, res.amount - canDrain))
|
||||||
@@ -68,7 +68,7 @@ class DataSlotResource(val name: String, val parent: TileDataSlots, initCapacity
|
|||||||
def fillFluid(resource: FluidStack, doFill: Boolean): Int = rawFill(Resource.from(resource), onlyRound = true, doFill).toInt
|
def fillFluid(resource: FluidStack, doFill: Boolean): Int = rawFill(Resource.from(resource), onlyRound = true, doFill).toInt
|
||||||
def drainFluid(maxDrain: Int, doDrain: Boolean): FluidStack = {
|
def drainFluid(maxDrain: Int, doDrain: Boolean): FluidStack = {
|
||||||
(for {
|
(for {
|
||||||
res <- rawDrain(maxDrain, true, doDrain)
|
res <- rawDrain(maxDrain, true, false)
|
||||||
rKind <- Misc.asInstanceOpt(res.kind, classOf[FluidResource])
|
rKind <- Misc.asInstanceOpt(res.kind, classOf[FluidResource])
|
||||||
} yield {
|
} yield {
|
||||||
if (doDrain)
|
if (doDrain)
|
||||||
|
|||||||
Reference in new issue
Block a user