diff --git a/README.md b/README.md index 4abcf1024..55aa30dcf 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Extending --------- You can implement your own item and block components using [the public API](https://github.com/MightyPirates/OpenComputers/tree/master/src/main/java/li/cil/oc/api), which unlike the rest of the mod is in plain Java, so you don't have to know or learn Scala. -Note that to get the OC JARs working in your development environment you'll want to run [BON](https://github.com/immibis/bearded-octo-nemesis) over it, first (I'll see when I find the time to make Jenkins produce a deobfed artifact), unless you don't need the class transformer (i.e. you don't use the `SimpleComponent` interface). +Use the deobfuscated artifact from one of the [Jenkins builds](http://ci.cil.li/) in your development environment and OpenComputers *should* work without problems. If it doesn't please let me know. If you have any questions about the API or how to add OC support to your mod, please don't hesitate to ask, either on the Forums or on IRC! @@ -26,7 +26,7 @@ Building ======== Java ---- -You'll need a Forge development environment set up with support for Scala. There are no dependencies other than the bundled APIs. +Just run `gradlew build`! Natives ------- diff --git a/src/main/resources/assets/opencomputers/lua/rom/bin/edit.lua b/src/main/resources/assets/opencomputers/lua/rom/bin/edit.lua index 27e4e35b8..c1ea896fb 100644 --- a/src/main/resources/assets/opencomputers/lua/rom/bin/edit.lua +++ b/src/main/resources/assets/opencomputers/lua/rom/bin/edit.lua @@ -21,9 +21,14 @@ local filename = shell.resolve(args[1]) local readonly = options.r or fs.get(filename) == nil or fs.get(filename).isReadOnly() -if fs.isDirectory(filename) or readonly and not fs.exists(filename) then - io.stderr:write("file not found") - return +if not fs.exists(filename) then + if fs.isDirectory(filename) then + io.stderr:write("file is a directory") + return + elseif readonly then + io.stderr:write("file system is read only") + return + end end term.clear() diff --git a/src/main/scala/li/cil/oc/common/item/Analyzer.scala b/src/main/scala/li/cil/oc/common/item/Analyzer.scala index b68ae779a..4d16f5c93 100644 --- a/src/main/scala/li/cil/oc/common/item/Analyzer.scala +++ b/src/main/scala/li/cil/oc/common/item/Analyzer.scala @@ -44,7 +44,7 @@ class Analyzer(val parent: Delegator) extends Delegate { } } - private def analyzeNodes(nodes: Array[Node], player: EntityPlayerMP) = if (nodes != null) for (node <- nodes) { + private def analyzeNodes(nodes: Array[Node], player: EntityPlayerMP) = if (nodes != null) for (node <- nodes if node != null) { node match { case connector: Connector => if (connector.localBufferSize > 0) { diff --git a/src/main/scala/li/cil/oc/common/tileentity/Hologram.scala b/src/main/scala/li/cil/oc/common/tileentity/Hologram.scala index f7e3a4845..d2e795e04 100644 --- a/src/main/scala/li/cil/oc/common/tileentity/Hologram.scala +++ b/src/main/scala/li/cil/oc/common/tileentity/Hologram.scala @@ -7,8 +7,9 @@ import li.cil.oc.{Settings, api} import net.minecraft.nbt.NBTTagCompound import net.minecraft.util.AxisAlignedBB import net.minecraftforge.common.util.ForgeDirection +import net.minecraft.entity.player.EntityPlayer -class Hologram extends Environment with SidedEnvironment { +class Hologram extends Environment with SidedEnvironment with Analyzable { val node = api.Network.newNode(this, Visibility.Network). withComponent("hologram"). withConnector(). @@ -65,6 +66,8 @@ class Hologram extends Environment with SidedEnvironment { override def sidedNode(side: ForgeDirection) = if (side == ForgeDirection.DOWN) node else null + override def onAnalyze(player: EntityPlayer, side: Int, hitX: Float, hitY: Float, hitZ: Float) = Array(node) + // ----------------------------------------------------------------------- // @Callback(doc = """function() -- Clears the hologram.""")