Merge branch 'master-MC1.7.10' of github.com:MightyPirates/OpenComputers into master-MC1.8

Conflicts:
	src/main/scala/li/cil/oc/common/launch/TransformerLoader.scala
This commit is contained in:
Florian Nücke 2015-10-13 22:20:39 +02:00
commit 5f134db132
48 changed files with 493 additions and 19 deletions

View File

@ -0,0 +1,12 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json",
"traits/powerAcceptor.json"
],
"nbt": {
"blacklist": [
"oc:adapter.blocks"
]
}
}]

View File

@ -0,0 +1,12 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json",
"traits/powerAcceptor.json"
],
"nbt": {
"blacklist": [
"oc:remaining"
]
}
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["traits/environment.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["traits/environment.json"]
}]

View File

@ -0,0 +1,9 @@
[{
"includes": [
"traits/computer.json",
"traits/inventory.json",
"traits/powerAcceptor.json",
"traits/redstone.json",
"traits/rotatable.json"
]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["case.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["case.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["case.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["case.json"]
}]

View File

@ -0,0 +1,16 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json",
"traits/powerAcceptor.json",
"traits/redstone.json",
"traits/rotatable.json"
],
"nbt": {
"blacklist": [
"chargeSpeed",
"hasPower",
"invertSignal"
]
}
}]

View File

@ -0,0 +1,14 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json",
"traits/powerAcceptor.json"
],
"nbt": {
"blacklist": [
"oc:buffer",
"oc:queue",
"oc:total"
]
}
}]

View File

@ -0,0 +1,7 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json",
"traits/rotatable.json"
]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["traits/environment.json"]
}]

View File

@ -0,0 +1,7 @@
[{
"includes": [
"traits/environment.json",
"traits/externalData.json",
"traits/rotatable.json"
]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["hologram.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["hologram.json"]
}]

View File

@ -0,0 +1,8 @@
[{
"includes": ["traits/rotatable.json"],
"nbt": {
"blacklist": [
"oc:keyboard"
]
}
}]

View File

@ -0,0 +1,18 @@
[{
"includes": [
"traits/computer.json",
"traits/hub.json",
"traits/inventory.json",
"traits/powerAcceptor.json",
"traits/redstone.json",
"traits/rotatable.json"
],
"nbt": {
"blacklist": [
"oc:info",
"oc:snooper",
"oc:componentNodes",
"oc:outputs"
]
}
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["traits/environment.json"]
}]

View File

@ -0,0 +1,6 @@
[{
"includes": [
"traits/environment.json",
"traits/redstone.json"
]
}]

View File

@ -0,0 +1,6 @@
[{
"includes": [
"traits/environment.json",
"traits/powerAcceptor.json"
]
}]

View File

@ -0,0 +1,7 @@
[{
"nbt": {
"blacklist": [
"oc:connector"
]
}
}]

View File

@ -0,0 +1,16 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json"
],
"nbt": {
"blacklist": [
"oc:active",
"oc:amountInk",
"oc:amountMaterial",
"oc:limit",
"oc:remaining",
"oc:total"
]
}
}]

View File

@ -0,0 +1,7 @@
[{
"includes": [
"traits/environment.json",
"traits/inventory.json",
"traits/rotatable.json"
]
}]

View File

@ -0,0 +1,8 @@
[{
"includes": ["traits/redstone.json"],
"nbt": {
"blacklist": [
"oc:redstone/node"
]
}
}]

View File

@ -0,0 +1,12 @@
[{
"includes": [
"traits/hub.json",
"traits/inventory.json",
"traits/powerAcceptor.json"
],
"nbt": {
"blacklist": [
"oc:componentNodes"
]
}
}]

View File

@ -0,0 +1,24 @@
[{
"includes": [
"traits/computer.json",
"traits/environment.json",
"traits/inventory.json",
"traits/redstone.json",
"traits/rotatable.json"
],
"nbt": {
"blacklist": [
"display",
"oc:components",
"oc:containers",
"oc:lightColor",
"oc:owner",
"oc:ownerUuid",
"oc:robot",
"oc:robotEnergy",
"oc:selectedSlot",
"oc:selectedTank",
"oc:storedEnergy"
]
}
}]

View File

@ -0,0 +1,14 @@
[{
"includes": [
"traits/environment.json",
"traits/externalData.json",
"traits/redstone.json",
"traits/rotatable.json"
],
"nbt": {
"blacklist": [
"oc:hasPower",
"oc:hadRedstoneInput"
]
}
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["screen.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["screen.json"]
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["screen.json"]
}]

View File

@ -0,0 +1,15 @@
[{
"includes": [
"traits/hub.json",
"traits/inventory.json",
"traits/powerAcceptor.json",
"traits/redstone.json",
"traits/rotatable.json"
],
"nbt": {
"blacklist": [
"oc:servers",
"oc:terminals"
]
}
}]

View File

@ -0,0 +1,7 @@
[{
"nbt": {
"blacklist": [
"oc:computer"
]
}
}]

View File

@ -0,0 +1,8 @@
[{
"nbt": {
"blacklist": [
"node",
"oc:node"
]
}
}]

View File

@ -0,0 +1,9 @@
[{
"nbt": {
"blacklist": [
"chunkX",
"chunkZ",
"dimension"
]
}
}]

View File

@ -0,0 +1,8 @@
[{
"nbt": {
"blacklist": [
"oc:plugs",
"oc:queue"
]
}
}]

View File

@ -0,0 +1,8 @@
[{
"ignoreInventoryContents": true,
"nbt": {
"blacklist": [
"oc:items"
]
}
}]

View File

@ -0,0 +1,9 @@
[{
"nbt": {
"blacklist": [
"oc:ae2power",
"oc:ic2power",
"oc:ic2cpower"
]
}
}]

View File

@ -0,0 +1,11 @@
[{
"nbt": {
"blacklist": [
"oc:rs.input",
"oc:rs.output",
"oc:rs.bundledInput",
"oc:rs.bundledOutput",
"oc:rs.rednetInput"
]
}
}]

View File

@ -0,0 +1,7 @@
[{
"rotation": {
"type": "nbtField",
"tag": "oc:yaw",
"format": "ForgeDirection"
}
}]

View File

@ -0,0 +1,3 @@
[{
"includes": ["traits/environment.json"]
}]

View File

@ -0,0 +1,7 @@
[{
"includes": [
"traits/environment.json",
"traits/redstone.json",
"traits/rotatable.json"
]
}]

View File

@ -0,0 +1,133 @@
local shell = require("shell")
local fs = require("filesystem")
local args, options, reason = shell.parse(...)
if #args == 0 then
args[1] = '.'
end
local TRY=[[
Try 'du --help' for more information.]]
local VERSION=[[
du (OpenOS bin) 1.0
Written by payonel, patterned after GNU coreutils du]]
local HELP=[[
Usage: du [OPTION]... [FILE]...
Summarize disk usage of each FILE, recursively for directories.
-h, --human-readable print sizes in human readable format (e.g., 1K 234M 2G)
-s, --summarize display only a total for each argument
--help display this help and exit
--version output version information and exit]]
local function writeline(value, pipe)
pipe = pipe or io.stdout
pipe:write(value)
pipe:write('\n')
end
if options.help then
writeline(HELP)
return true
end
if options.version then
writeline(VERSION)
return true
end
local function addTrailingSlash(path)
if path:sub(-1) ~= '/' then
return path .. '/'
else
return path
end
end
local function opCheck(shortName, longName)
local enabled = options[shortName] or options[longName]
options[shortName] = nil
options[longName] = nil
return enabled
end
local bHuman = opCheck('h', 'human-readable')
local bSummary = opCheck('s', 'summarize')
if (next(options)) then
for op,v in pairs(options) do
io.stderr:write(string.format("du: invalid option -- '%s'\n", op))
end
writeline(TRY, io.stderr)
return false
end
local function formatSize(size)
if not bHuman then
return tostring(size)
end
local sizes = {"", "K", "M", "G"}
local unit = 1
local power = options.si and 1000 or 1024
while size > power and unit < #sizes do
unit = unit + 1
size = size / power
end
return math.floor(size * 10) / 10 .. sizes[unit]
end
local function printSize(size, rpath)
local displaySize = formatSize(size)
writeline(string.format("%s%s", string.format("%-12s", displaySize), rpath))
end
local function visitor(rpath)
local subtotal = 0
local dirs = 0
local spath = shell.resolve(rpath)
if (fs.isDirectory(spath)) then
local list_result = fs.list(spath)
for list_item in list_result do
local vtotal, vdirs = visitor(addTrailingSlash(rpath) .. list_item)
subtotal = subtotal + vtotal
dirs = dirs + vdirs
end
if (dirs == 0) then -- no child dirs
if (not bSummary) then
printSize(subtotal, rpath)
end
end
elseif (not fs.isLink(spath)) then
subtotal = fs.size(spath)
end
return subtotal, dirs
end
for i,arg in ipairs(args) do
local path = shell.resolve(arg)
if (not fs.exists(path)) then
writeline(string.format("%s does not exist", arg), io.stderr)
else
if (fs.isDirectory(path)) then
local total = visitor(arg)
if (bSummary) then
printSize(total, arg)
end
elseif (fs.isLink(path)) then
printSize(0, arg)
else
printSize(fs.size(path), arg)
end
end
end
return true

View File

@ -53,7 +53,7 @@ object Sound {
// Set in init event.
var manager: SoundManager = _
def soundSystem = manager.sndSystem
def soundSystem = if (manager != null) manager.sndSystem else null
private def updateVolume() {
val volume =

View File

@ -0,0 +1,19 @@
package li.cil.oc.common.launch
import com.google.common.eventbus.EventBus
import net.minecraftforge.fml.common.DummyModContainer
import net.minecraftforge.fml.common.LoadController
import net.minecraftforge.fml.common.ModMetadata
class CoreModContainer extends DummyModContainer({
val md = new ModMetadata()
md.authorList.add("Sangar")
md.modId = "OpenComputers|Core"
md.version = "@VERSION@"
md.name = "OpenComputers (Core)"
md.url = "http://oc.cil.li/"
md.description = "OC core mod used for class transformer and as API owner to avoid cyclic dependencies."
md
}) {
override def registerBus(bus: EventBus, controller: LoadController) = true
}

View File

@ -2,32 +2,17 @@ package li.cil.oc.common.launch
import java.util
import com.google.common.eventbus.EventBus
import li.cil.oc.common.asm.ClassTransformer
import net.minecraftforge.fml.common.DummyModContainer
import net.minecraftforge.fml.common.LoadController
import net.minecraftforge.fml.common.ModMetadata
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.MCVersion
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions
@TransformerExclusions(Array("li.cil.oc.common.asm"))
@MCVersion("1.8")
class TransformerLoader extends DummyModContainer({
val md = new ModMetadata()
md.authorList.add("Sangar")
md.modId = "OpenComputers|Core"
md.version = "@VERSION@"
md.name = "OpenComputers (Core)"
md.url = "http://oc.cil.li/"
md.description = "OC core mod used for class transformer and as API owner to avoid cyclic dependencies."
md
}) with IFMLLoadingPlugin {
class TransformerLoader extends IFMLLoadingPlugin {
val instance = this
override def getModContainerClass = getClass.getName
override def registerBus(bus: EventBus, controller: LoadController) = true
override def getModContainerClass = "li.cil.oc.common.launch.CoreModContainer"
override def getASMTransformerClass = Array(classOf[ClassTransformer].getName)

View File

@ -2,6 +2,7 @@ package li.cil.oc.integration.buildcraft.recipes
import java.util
import buildcraft.api.recipes.BuildcraftRecipeRegistry
import buildcraft.api.recipes.IProgrammingRecipe
import li.cil.oc.Constants
import li.cil.oc.OpenComputers
@ -15,6 +16,8 @@ import scala.collection.convert.WrapAsJava._
import scala.collection.mutable
object LootDiskProgrammableRecipe extends IProgrammingRecipe {
def register() = BuildcraftRecipeRegistry.programmingTable.addRecipe(LootDiskProgrammableRecipe)
override def getId: String = OpenComputers.ID + ":loot_disk"
override def getOptions(width: Int, height: Int): util.List[ItemStack] = {

View File

@ -7,6 +7,6 @@ object ModBuildCraftRecipes extends ModProxy {
override def getMod = Mods.BuildCraftTiles
override def initialize(): Unit = {
buildcraft.api.recipes.BuildcraftRecipeRegistry.programmingTable.addRecipe(LootDiskProgrammableRecipe)
LootDiskProgrammableRecipe.register()
}
}