Compare commits

...
4 Commits
Author SHA1 Message Date
bdew 9b0ed5b0b5 Merge remote-tracking branch 'remotes/origin/mc172' into mc1710 2014-07-15 14:02:45 +03:00
bdew cd85553fa1 Bump forge to recommended 1180 2014-07-14 10:26:52 +03:00
bdew bbe994c28c Added DataSlotGameProfile 2014-07-14 10:26:34 +03:00
bdew 79e308941d Update to 1.7.10 2014-07-08 11:36:18 +03:00
8 changed files with 38 additions and 10 deletions

No files matched your search

+3 -3
View File
@@ -21,7 +21,7 @@ buildscript {
apply plugin: 'scala'
apply plugin: 'forge'
version = "1.3.0"
version = "1.4.0"
if (project.hasProperty('buildnum')) {
project.version = project.version + '.' + project.buildnum
@@ -31,10 +31,10 @@ if (project.hasProperty('buildnum')) {
group = "net.bdew"
archivesBaseName = "bdlib"
ext.versuffix = "mc172"
ext.versuffix = "mc1710"
minecraft {
version = "1.7.2-10.12.2.1126"
version = "1.7.10-10.13.0.1180"
replace("BDLIB_VER", project.version)
}
Binary file not shown.
+2 -2
View File
@@ -1,6 +1,6 @@
#Thu Nov 28 11:30:59 IST 2013
#Wed Jul 02 15:54:47 CDT 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
+2 -2
View File
@@ -52,10 +52,10 @@ class CommandDumpRegistry extends CommandBase {
dumpWriter.write(FluidRegistry.getRegisteredFluids.map(_._1).toList.sorted.mkString("\n"))
dumpWriter.write("\n\n")
CommandBase.notifyAdmins(sender, "Registry dumped to " + dumpFile.getCanonicalPath)
CommandBase.func_152373_a(sender, this, "Registry dumped to " + dumpFile.getCanonicalPath)
} catch {
case e: Throwable =>
CommandBase.notifyAdmins(sender, "Failed to save registry dump: " + e)
CommandBase.func_152373_a(sender, this, "Failed to save registry dump: " + e)
BdLib.logErrorException("Failed to save registry dump", e)
} finally {
dumpWriter.close()
+1 -1
View File
@@ -28,7 +28,7 @@ class Event2[T, R] extends EventBase[(T, R) => Unit] {
}
object Event {
def apply(t: Unit) = new Event0
def apply() = new Event0
def apply[T] = new Event1[T]
def apply[T, R] = new Event2[T, R]
}
@@ -0,0 +1,27 @@
package net.bdew.lib.data
import java.util.UUID
import com.mojang.authlib.GameProfile
import net.bdew.lib.data.base.{DataSlotVal, TileDataSlots, UpdateKind}
import net.minecraft.nbt.NBTTagCompound
import org.apache.commons.lang3.StringUtils
case class DataSlotGameProfile(name: String, parent: TileDataSlots) extends DataSlotVal[GameProfile] {
override var cval: GameProfile = null
override def load(t: NBTTagCompound, kind: UpdateKind.Value) = {
cval = if (t.hasKey(name + "_uid") || t.hasKey(name + "_name")) {
val uid = if (t.hasKey(name + "_uid")) UUID.fromString(t.getString(name + "_uid")) else null
val uname = if (t.hasKey(name + "_name")) t.getString(name + "_name") else null
new GameProfile(uid, uname)
} else null
}
override def save(t: NBTTagCompound, kind: UpdateKind.Value) = {
if (cval != null) {
Option(cval.getId) map (id => t.setString(name + "_uid", id.toString))
Option(cval.getName) filterNot (name => StringUtils.isBlank(name)) map (name => t.setString(name + "_name", name))
}
}
}
+2 -1
View File
@@ -47,7 +47,8 @@ class Sprite(val resource: ResourceLocation, r: Rect, scale: Int = 256) extends
}
class ScaledResourceLocation(path: String, val scale: Int = 256) extends ResourceLocation(path) {
def this(domain: String, path: String, scale: Int = 256) = this(domain + ":" + path, scale)
def this(domain: String, path: String, scale: Int) = this(domain + ":" + path, scale)
def this(domain: String, path: String) = this(domain + ":" + path, 256)
}
object Texture {
@@ -21,7 +21,7 @@ class WidgetFluidGauge(val rect: Rect, overlay: Texture, dslot: DataSlotTankBase
override def handleTooltip(p: Point, tip: mutable.MutableList[String]) {
if (dslot.getFluid != null) {
tip += dslot.getFluid.getFluid.getLocalizedName
tip += dslot.getFluid.getFluid.getLocalizedName(dslot.getFluid)
tip += "%s/%s mB".format(formater.format(dslot.getFluidAmount), formater.format(dslot.getCapacity))
} else {
tip += Misc.toLocal("bdlib.label.empty")