diff --git a/assets/items.psd b/assets/items.psd index 084bc15bfe..75f167bfa4 100644 Binary files a/assets/items.psd and b/assets/items.psd differ diff --git a/build.properties b/build.properties index bfdc33c8c6..0384425f6e 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ minecraft.version=1.7.10 forge.version=10.13.4.1448-1.7.10 -oc.version=1.6.1 +oc.version=1.6.2 oc.subversion= ae2.version=rv2-beta-26 diff --git a/libs/OpenComputers-JNLua.jar b/libs/OpenComputers-JNLua.jar index f3abfe1f4e..f06a8f722a 100644 Binary files a/libs/OpenComputers-JNLua.jar and b/libs/OpenComputers-JNLua.jar differ diff --git a/libs/OpenComputers-LuaJ.jar b/libs/OpenComputers-LuaJ.jar index 70c315e47d..1d2cc019b4 100644 Binary files a/libs/OpenComputers-LuaJ.jar and b/libs/OpenComputers-LuaJ.jar differ diff --git a/src/main/java/li/cil/oc/api/Items.java b/src/main/java/li/cil/oc/api/Items.java index 7a0d5657ed..9018aba67b 100644 --- a/src/main/java/li/cil/oc/api/Items.java +++ b/src/main/java/li/cil/oc/api/Items.java @@ -58,6 +58,8 @@ public static ItemInfo get(ItemStack stack) { *

* To use some directory in your mod JAR as the directory provided by the * loot disk, use {@link FileSystem#fromClass} in your callable. + *

+ * Call this in the init phase or later, not in pre-init. * * @param name the label and identifier to use for the loot disk. * @param color the color of the disk, as a Minecraft color (so 0-15, @@ -65,13 +67,47 @@ public static ItemInfo get(ItemStack stack) { * @param factory the callable to call for creating file system instances. * @return an item stack representing the registered loot disk, to allow * adding a recipe for your loot disk, for example. + * @deprecated use {@link #registerFloppy(String, int, Callable, boolean)} instead. */ + @Deprecated public static ItemStack registerFloppy(String name, int color, Callable factory) { if (API.items != null) return API.items.registerFloppy(name, color, factory); return null; } + /** + * Register a single loot floppy disk. + *

+ * The disk will be listed in the creative tab of OpenComputers. + *

+ * The specified factory callable will be used to generate a new file + * system when the loot disk is used as a component. The specified name + * will be used as the label for the loot disk, as well as the identifier + * to select the corresponding factory method, so choose wisely. + *

+ * To use some directory in your mod JAR as the directory provided by the + * loot disk, use {@link FileSystem#fromClass} in your callable. + *

+ * If doRecipeCycling is true, the floppy disk will be + * included in the floppy disk recipe cycle if that is enabled. + *

+ * Call this in the init phase or later, not in pre-init. + * + * @param name the label and identifier to use for the loot disk. + * @param color the color of the disk, as a Minecraft color (so 0-15, + * with 0 being black, 1 red and so on). + * @param factory the callable to call for creating file system instances. + * @param doRecipeCycling whether to include this floppy disk in floppy disk cycling. + * @return an item stack representing the registered loot disk, to allow + * adding a recipe for your loot disk, for example. + */ + public static ItemStack registerFloppy(String name, int color, Callable factory, boolean doRecipeCycling) { + if (API.items != null) + return API.items.registerFloppy(name, color, factory, doRecipeCycling); + return null; + } + /** * Register a single custom EEPROM. *

diff --git a/src/main/java/li/cil/oc/api/detail/ItemAPI.java b/src/main/java/li/cil/oc/api/detail/ItemAPI.java index 0de2b2f3d8..e1917a3062 100644 --- a/src/main/java/li/cil/oc/api/detail/ItemAPI.java +++ b/src/main/java/li/cil/oc/api/detail/ItemAPI.java @@ -51,9 +51,39 @@ public interface ItemAPI { * @param factory the callable to call for creating file system instances. * @return an item stack representing the registered loot disk, to allow * adding a recipe for your loot disk, for example. + * @deprecated use {@link #registerFloppy(String, int, Callable, boolean)} instead. */ + @Deprecated ItemStack registerFloppy(String name, int color, Callable factory); + /** + * Register a single loot floppy disk. + *

+ * The disk will be listed in the creative tab of OpenComputers. + *

+ * The specified factory callable will be used to generate a new file + * system when the loot disk is used as a component. The specified name + * will be used as the label for the loot disk, as well as the identifier + * to select the corresponding factory method, so choose wisely. + *

+ * To use some directory in your mod JAR as the directory provided by the + * loot disk, use {@link FileSystem#fromClass} in your callable. + *

+ * If doRecipeCycling is true, the floppy disk will be + * included in the floppy disk recipe cycle if that is enabled. + *

+ * Call this in the init phase or later, not in pre-init. + * + * @param name the label and identifier to use for the loot disk. + * @param color the color of the disk, as a Minecraft color (so 0-15, + * with 0 being black, 1 red and so on). + * @param factory the callable to call for creating file system instances. + * @param doRecipeCycling whether to include this floppy disk in floppy disk cycling. + * @return an item stack representing the registered loot disk, to allow + * adding a recipe for your loot disk, for example. + */ + ItemStack registerFloppy(String name, int color, Callable factory, boolean doRecipeCycling); + /** * Register a single custom EEPROM. *

diff --git a/src/main/java/li/cil/oc/api/network/Network.java b/src/main/java/li/cil/oc/api/network/Network.java index 3d76f0014f..e1d6fa8931 100644 --- a/src/main/java/li/cil/oc/api/network/Network.java +++ b/src/main/java/li/cil/oc/api/network/Network.java @@ -103,7 +103,7 @@ public interface Network { Iterable nodes(); /** - * The list of addressed nodes in the network visible to the specified node. + * The list of addressed nodes in the network reachable by the specified node. *

* This does not include nodes with a visibility of None * or a visibility of Neighbors when there is no direct connection diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index bd8ef92c1b..9c834010e2 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -807,6 +807,10 @@ opencomputers { # Energy consumed when reconfiguring nanomachines. nanomachinesReconfigure: 5000 + + # Energy consumed by a MFU per tick while connected. + # Similarly to `wirelessCostPerRange`, this is multiplied with the distance to the bound block. + mfuRelay: 1 } # The rate at which different blocks accept external power. All of these @@ -1345,6 +1349,9 @@ opencomputers { # The maximum range between the drone/robot and a villager for a trade to # be performed by the trading upgrade tradingRange: 8.0 + + # Radius the MFU is able to operate in + mfuRange: 3 } # Settings for mod integration (the mod previously known as OpenComponents). diff --git a/src/main/resources/assets/opencomputers/doc/en_US/block/adapter.md b/src/main/resources/assets/opencomputers/doc/en_US/block/adapter.md index 8df3e7188d..4e6bb63710 100644 --- a/src/main/resources/assets/opencomputers/doc/en_US/block/adapter.md +++ b/src/main/resources/assets/opencomputers/doc/en_US/block/adapter.md @@ -5,3 +5,4 @@ The adapter allows [computers](../general/computer.md) to interact with blocks from vanilla Minecraft or other mods. Supported blocks adjacent to the adapter will show up as components in [computers](../general/computer.md) connected to the adapter. In addition to this, the adapter provides a slot for a few select upgrades. For example, the [inventory controller upgrade](../item/inventoryControllerUpgrade.md) allows computers to query more information from an inventory adjacent to the adapter, similar to when the upgrade is installed in a device (such as a [robot](robot.md) or [drone](../item/drone.md)), and a [tank controller upgrade](../item/tankControllerUpgrade.md) provides similar functionality for fluid tanks next to the adapter. +Furthermore, you can insert a bound [MFU](../item/mfu.md) to interact with blocks a few spaces away. diff --git a/src/main/resources/assets/opencomputers/doc/en_US/item/debugCard.md b/src/main/resources/assets/opencomputers/doc/en_US/item/debugCard.md index 624803cac7..aa35df5a79 100644 --- a/src/main/resources/assets/opencomputers/doc/en_US/item/debugCard.md +++ b/src/main/resources/assets/opencomputers/doc/en_US/item/debugCard.md @@ -5,3 +5,5 @@ The debug card is a creative-only item that was originally only intended to make debugging things easier, by automating some processes. It has since gotten a bunch more functionality, making it quite useful for custom map-making. Note that you can use sneak-activate while holding the card to bind it to you or unbind it, meaning `runCommand` will be performed using your permission levels instead of the default OpenComputers ones. + +A debug card can receive messages similar to a [linked card](linkedCard.md), firing a `debug_message` event. You can send such a message using either another debug card's `sendDebugMessage` or the Minecraft command `/oc_sendDebugMessage` (or `/oc_sdbg`). diff --git a/src/main/resources/assets/opencomputers/doc/en_US/item/index.md b/src/main/resources/assets/opencomputers/doc/en_US/item/index.md index 8fc6a20292..f0eb3a2981 100644 --- a/src/main/resources/assets/opencomputers/doc/en_US/item/index.md +++ b/src/main/resources/assets/opencomputers/doc/en_US/item/index.md @@ -43,6 +43,7 @@ Keep in mind that some of these may not be available, depending on the recipe se * [Inventory Controller](inventoryControllerUpgrade.md) * [Inventory Upgrade](inventoryUpgrade.md) * [Leash Upgrade](leashUpgrade.md) +* [MFU](mfu.md) * [Navigation Upgrade](navigationUpgrade.md) * [Piston Upgrade](pistonUpgrade.md) * [Sign Upgrade](signUpgrade.md) diff --git a/src/main/resources/assets/opencomputers/doc/en_US/item/inventoryControllerUpgrade.md b/src/main/resources/assets/opencomputers/doc/en_US/item/inventoryControllerUpgrade.md index c5f8edbae7..8cad6000e1 100644 --- a/src/main/resources/assets/opencomputers/doc/en_US/item/inventoryControllerUpgrade.md +++ b/src/main/resources/assets/opencomputers/doc/en_US/item/inventoryControllerUpgrade.md @@ -5,3 +5,5 @@ The inventory controller upgrade provides extended inventory interaction to [robots](../block/robot.md) and [drones](drone.md). It allows the device to explicitly target slots in external inventories when dropping or sucking items. It also allows devices to read detailed information about item stacks. Lastly it provides [robots](../block/robot.md) with a means to change their equipped tool without external help. This upgrade can also be placed in [adapters](../block/adapter.md), where it provides similar inspection methods for inventories adjacent to the [adapter](../block/adapter.md) as it does to the [robot](../block/robot.md). It does not allow the [adapter](../block/adapter.md) to move items into or out of inventories, however. This feature is only available to [robots](../block/robot.md) and [drones](drone.md). + +See also: [Transposers](../block/transposer.md) diff --git a/src/main/resources/assets/opencomputers/doc/en_US/item/mfu.md b/src/main/resources/assets/opencomputers/doc/en_US/item/mfu.md new file mode 100644 index 0000000000..e288f6653b --- /dev/null +++ b/src/main/resources/assets/opencomputers/doc/en_US/item/mfu.md @@ -0,0 +1,7 @@ +# MFU + +![You will never know the true meaning of this acronym.](oredict:oc:mfu) + +This upgrade acts as a remote [adapter](../block/adapter.md). Click while sneaking onto any side of any block to bind it to a specific position. Then, place it into an adapter nearby (the range is very limited) and it will act as if the adapter was placed right next to the specific side you bound it to! + +Keep in mind that keeping the remote adapter connection active uses energy. diff --git a/src/main/resources/assets/opencomputers/doc/en_US/item/tankControllerUpgrade.md b/src/main/resources/assets/opencomputers/doc/en_US/item/tankControllerUpgrade.md index 9f041919ed..57bbda9b72 100644 --- a/src/main/resources/assets/opencomputers/doc/en_US/item/tankControllerUpgrade.md +++ b/src/main/resources/assets/opencomputers/doc/en_US/item/tankControllerUpgrade.md @@ -5,3 +5,5 @@ The tank controller upgrade is to fluid tanks what the [inventory controller upgrade](inventoryControllerUpgrade.md) is to normal inventories. It allows devices to query more detailed information about tanks inside and next to them. This upgrade can also be installed in [adapters](../block/adapter.md), allowing [computers](../general/computer.md) connected to the [adapter](../block/adapter.md) to query information about the tanks adjacent to the [adapter](../block/adapter.md). + +See also: [Transposers](../block/transposer.md) diff --git a/src/main/resources/assets/opencomputers/lang/de_DE.lang b/src/main/resources/assets/opencomputers/lang/de_DE.lang index 03d61ba851..f3405864c2 100644 --- a/src/main/resources/assets/opencomputers/lang/de_DE.lang +++ b/src/main/resources/assets/opencomputers/lang/de_DE.lang @@ -23,12 +23,14 @@ tile.oc.hologram2.name=Hologrammprojektor (Stufe 2) tile.oc.keyboard.name=Tastatur tile.oc.microcontroller.name=Mikrocontroller tile.oc.motionSensor.name=Bewegungsmelder +tile.oc.netSplitter.name=Net Splitter tile.oc.powerConverter.name=Leistungswandler tile.oc.powerDistributor.name=Stromverteiler tile.oc.print.name=3D-Druck tile.oc.printer.name=3D-Drucker tile.oc.raid.name=Raid tile.oc.redstone.name=Redstone-I/O +tile.oc.relay.name=Relais tile.oc.robot.name=Roboter tile.oc.robotAfterimage.name=Roboter tile.oc.screen1.name=Bildschirm (Stufe 1) @@ -36,7 +38,7 @@ tile.oc.screen2.name=Bildschirm (Stufe 2) tile.oc.screen3.name=Bildschirm (Stufe 3) tile.oc.rack.name=Serverschrank tile.oc.switch.name=Switch -tile.oc.netSplitter.name=Net Splitter +tile.oc.transposer.name=Transposer tile.oc.waypoint.name=Wegpunkt # Items @@ -65,7 +67,9 @@ item.oc.DataCard1.name=Datenkarte (Stufe 2) item.oc.DataCard2.name=Datenkarte (Stufe 3) item.oc.DebugCard.name=Debug-Karte item.oc.Debugger.name=Netzwerk-Debugger +item.oc.DiamondChip.name=Diamantsplitter item.oc.Disk.name=Platte +item.oc.DiskDriveMountable.name=Diskettenlaufwerk item.oc.Drone.name=Drohne item.oc.DroneCase0.name=Drohnengehäuse (Stufe 1) item.oc.DroneCase1.name=Drohnengehäuse (Stufe 2) @@ -98,6 +102,7 @@ item.oc.Microchip2.name=Microchip (Stufe 3) item.oc.MicrocontrollerCase0.name=Mikrocontroller-Gehäuse (Stufe 1) item.oc.MicrocontrollerCase1.name=Mikrocontroller-Gehäuse (Stufe 2) item.oc.MicrocontrollerCase3.name=Mikrocontroller-Gehäuse (Kreativ) +item.oc.Nanomachines.name=Nanomaschinen item.oc.NetworkCard.name=Netzwerkkarte item.oc.NumPad.name=Ziffernblock item.oc.Present.name=Ein kleines Etwas... @@ -114,6 +119,7 @@ item.oc.TabletCase0.name=Tablet-Gehäuse (Stufe 1) item.oc.TabletCase1.name=Tablet-Gehäuse (Stufe 2) item.oc.TabletCase3.name=Tablet-Gehäuse (Kreativ) item.oc.Terminal.name=Fernbedienung +item.oc.TerminalServer.name=Terminalserver item.oc.TexturePicker.name=Textur-Leser item.oc.Transistor.name=Transistor item.oc.UpgradeAngel.name=Schwebe-Upgrade @@ -138,6 +144,7 @@ item.oc.UpgradeHover1.name=Schwebe-Upgrade (Stufe 2) item.oc.UpgradeInventory.name=Inventar-Upgrade item.oc.UpgradeInventoryController.name=Inventarbedienungs-Upgrade item.oc.UpgradeLeash.name=Leinen-Upgrade +item.oc.UpgradeMF.name=MFU item.oc.UpgradeNavigation.name=Navigations-Upgrade item.oc.UpgradePiston.name=Kolben-Upgrade item.oc.UpgradeSign.name=Schild-I/O-Upgrade @@ -235,6 +242,7 @@ oc:container.Disassembler=Recycler oc:container.DiskDrive=Diskettenlaufwerk oc:container.Printer=Drucker oc:container.Raid=Raid +oc:container.Relay=Relais oc:container.Server=Server oc:container.Rack=Serverschrank oc:container.Switch=Switch @@ -271,10 +279,12 @@ oc:tooltip.DataCard1=Stellt einige komplexe Algorithmen wie Hash-Funktionen und oc:tooltip.DataCard2=Stellt einige komplexe Algorithmen wie Hash-Funktionen und deflate/inflate bereit. oc:tooltip.DebugCard=Kreativ-Modus-Gegenstand, erlaubt es die Welt zu manipulieren um das Testen zu erleichtern. Verwendung auf eigene Gefahr. oc:tooltip.Debugger=Erlaubt, Informationen über OCs internes Netzwerk auszugeben. Nur verwenden, wenn von einem Entwickler dazu aufgefordert. +oc:tooltip.DiamondChip=Ein kleines Stück eines einst wunderschönen Diamanten. Er wird niemals wieder so sein, wie er war. oc:tooltip.Disassembler=Zerlegt Gegenstände in ihre Einzelteile. §lWarnung§7: zurückgewonnene Gegenstände haben eine %s%%-ige Chance beim Extrahieren kaputt zu gehen! oc:tooltip.Disk=Sehr einfaches Speichermedium, das verwendet werden kann, um Disketten und Festplatten zu fertigen. oc:tooltip.DiskDrive.CC=ComputerCraft-Disketten werden §aauch unterstützt§7. oc:tooltip.DiskDrive=Erlaubt es, Disketten zu lesen und zu beschreiben. Kann in Robotern installiert werden, um später Disketten einlegen zu können. +oc:tooltip.DiskDriveMountable=Funktioniert genauso wie ein normales Diskettenlaufwerk, wird aber in einem Serverschrank installiert. oc:tooltip.DiskUsage=Festplattennutzung: %s/%s Byte oc:tooltip.DiskModeManaged=Modus: Managed oc:tooltip.DiskModeUnmanaged=Modus: Unmanaged @@ -303,6 +313,7 @@ oc:tooltip.Microchip=Tritt auch unter dem Alias Integrierter Schaltkreis auf. Ke oc:tooltip.Microcontroller=Mikrocontroller sind einfachst-mögliche Computer. Sie sind dazu gedacht, für Spezialfälle verwendet zu werden, bei denen sie einfach das Programm auf dem in ihnen eingebauten EEPROM ausführen. oc:tooltip.MicrocontrollerCase=Dieses Gehäuse wird verwendet, um Mikrocontroller in der Elektronik-Werkbank zu bauen. Platziere es in eine solche und füge weitere Komponenten hinzu, um einen Mikrocontroller zu erstellen. oc:tooltip.MotionSensor=Kann Bewegungen sich in der Nähe befindender Lebewesen erkennen. Benötigt eine klare Sichtlinie. +oc:tooltip.Nanomachines=Kontrolleinheit und eine Menge Nanomaschinen zur Einnahme, sofern du dich traust. oc:tooltip.NetworkCard=Erlaubt es Computern, die über mehrere Blöcke miteinander verbunden sind (z.B. Kabel), mittels Netzwerknachrichten zu kommunizieren. oc:tooltip.PowerAcceptor=Energiewandelgeschwindigkeit: §f%s/t§7 oc:tooltip.PowerConverter.BuildCraft=§fBuildCraft MJ§7: §a%s:%s§7 @@ -328,6 +339,7 @@ oc:tooltip.RedstoneCard.RedNet=§fRedNet§7 wird §aunterstützt§7. oc:tooltip.RedstoneCard.WirelessCBE=§fWireless Redstone (ChickenBones)§7 wird §aunterstützt§7. oc:tooltip.RedstoneCard.WirelessSV=§fWireless Redstone (SlimeVoid)§7 wird §aunterstützt§7. oc:tooltip.RedstoneCard=Erlaubt das Lesen und Ausgeben von Redstonesignalen um den Computer oder Roboter herum. +oc:tooltip.Relay=Erlaubt es, mehrere Netzwerke miteinander zu verbinden. Leitet ausschließlich Netzwerknachrichten weiter, Komponenten "hinter" dem Switch sind nicht sichtbar. Nützlich, um Netzwerke zu trennen, jedoch nach wie vor Kommunikation zwischen den Netzwerken zu erlauben, z.b. mittels Netzwerkkarten. oc:tooltip.Robot=Im Gegensatz zu normalen Computern können sich Roboter in der Welt bewegen und ähnlich wie Spieler mit der Welt interagieren. Sie können jedoch §onicht§r§7 mit externen Komponenten interagieren! # The underscore makes sure this isn't hidden with the rest of the tooltip. oc:tooltip.Robot_Level=§fStufe§7: §a%s§7. @@ -340,11 +352,13 @@ oc:tooltip.Switch=Erlaubt es, mehrere Netzwerke miteinander zu verbinden. Leitet oc:tooltip.Tablet=Ein Tablet-PC, für Lua unterwegs. Kann durch Sneak-Aktivierung zwangsgestoppt werden. oc:tooltip.TabletCase=Einfaches Gehäuse für Tablet-PCs. Kann in der Elektronik-Werkbank mit Komponenten bestückt werden, um einen Tablet-PC zu fertigen. oc:tooltip.Terminal=Erlaubt es, einen Server aus der Ferne zu steuern, so lange man sich in Reichweite des Servers befindet. Verhält sich wie Bildschirm und Tastatur in einem. Kann mit Shift-Rechtsklick an einen Server in einem Serverschrank gebunden werden. +oc:tooltip.TerminalServer=Das Rückgrat für Fernzugriff. Fernbedienungen können hiermit verbunden werden. Enthält virtuelle Tastatur und Bildschirm. oc:tooltip.TexturePicker=Dieses Werkzeug erlaubt es, eine Zeichenkette anzuzeigen, die die Oberfläche eines Blocks beschreibt und in Form-Definitionen für 3D-Drucker verwendet werden kann. Definiv keine Texturnamen, oh nein. Nix da. oc:tooltip.Tier=§8Stufe %s oc:tooltip.NetSplitter=Kann Netzwerke dynamisch verbinden. Die Konnektivität jeder Seite kann umgeschaltet werden, in dem man "Professionelle Wartungsarbeiten" mit einem Schraubenschlüssel durchführt. Sie kann auch mit einem Redstone-Signal an entsprechenden Seiten invertiert werden. oc:tooltip.TooLong=Halte [§f%s§7] gedrückt für mehr Infos. oc:tooltip.Transistor=Elementarer Baustein der meisten Computerkomponenten. Nicht zu verwechseln mit Steinelementaren. +oc:tooltip.Transposer=Ermöglicht automatischen Transfer von Items und Flüssigkeiten zwischen angrenzenden Blöcken. oc:tooltip.UpgradeAngel=Erlaubt es Robotern, Blöcke in die Luft zu setzen, selbst wenn kein Referenzblock daneben existiert. oc:tooltip.UpgradeBattery=Erhöht die Energiespeicherkapazität eines Roboters, was ihm erlaubt, länger zu arbeiten, ohne erneut aufgeladen werden zu müssen.[nl] Kapazität: §f%s§7 oc:tooltip.UpgradeChunkloader=Wenn sich im Wald ein Roboter bewegt, und niemand da ist, ihn zu sehen, bewegt er sich dann wirklich? Dieses Upgrade stellt sicher, dass dem so ist. Es hält den Chunk, in dem sich der Roboter befindet, geladen, verbraucht jedoch Energie, während es aktiv ist. @@ -357,6 +371,9 @@ oc:tooltip.UpgradeGenerator=Kann verwendet werden, um unterwegs Energie aus Bren oc:tooltip.UpgradeHover=Erlaubt Robotern höher zu fliegen, ohne an Wänden klettern zu müssen.[nl] Maximalhöhe: §f%s§7 oc:tooltip.UpgradeInventory=Dieses Upgrade gibt Robotern ein internes Inventar. Ohne ein solches Upgrade können Roboter keine Gegenstände verwahren. oc:tooltip.UpgradeInventoryController=Dieses Upgrade erlaubt es dem Roboter, präziser mit externen Inventaren zu interagieren, und erlaubt es ihm, das angelegte Werkzeug mit einem Gegenstand in seinem Inventar auszutauschen. +oc:tooltip.UpgradeMF=Erlaubt es Adaptern, mit Blöcken zu interagieren, die etwas weiter weg sind. +oc:tooltip.UpgradeMF.Linked=§fVerbindung hergestellt§7 +oc:tooltip.UpgradeMF.Unlinked=§fKeine Verbindung§7 oc:tooltip.UpgradeLeash=Erlaubt es manchen Geräten, wie etwa Drohnen, B- *getuschel* Verzeihung. Mir wurde soeben zugetragen, dass es tatsächlich dazu verwendet werden kann, Tiere an die Leine zu legen. Sogar viele Viecher. oc:tooltip.UpgradeNavigation=Erlaubt es Robotern, ihre Position und Ausrichtung zu bestimmen. Die Position ist relativ zur Mitte der Karte, die in diesem Upgrade verbaut wurde. oc:tooltip.UpgradePiston=Dieses Upgrade erlaubt es zu drängeln. Es macht es möglich Blöcke zu verschieben, ähnlich dem Kolben. Es kann jedoch §lkeine§7 Entities bewegen. @@ -444,6 +461,15 @@ achievement.oc.transistor.desc=Jetzt kannst du dir den Soundtrack anhören. achievement.oc.wirelessNetworkCard=Das WLAN - Unendliche Weiten achievement.oc.wirelessNetworkCard.desc=Netzwerke, die nie ein Paket zuvor gesehen hat. +# Death messages. Note that the number of entries here must match the number +# set in the actual damage source in code. +death.attack.oc.nanomachinesOverload.1=%s ist zu gierig geworden. +death.attack.oc.nanomachinesOverload.2=%s erlitt einen Nervenzusammenbruch. +death.attack.oc.nanomachinesOverload.3=Die Nanomaschinen von %s gerieten wohl außer Kontrolle. Ups. +death.attack.oc.nanomachinesHungry.1=%s wurde von Nanomaschinen verspeist. +death.attack.oc.nanomachinesHungry.2=%s hat wohl seine Nanomaschinen nicht gefüttert. +death.attack.oc.nanomachinesHungry.3=%s wurde verdaut. + # NEI Integration nei.options.inventory.oredict=OreDictionary-Namen anzeigen nei.options.inventory.oredict.true=True diff --git a/src/main/resources/assets/opencomputers/lang/en_US.lang b/src/main/resources/assets/opencomputers/lang/en_US.lang index 9fa64316ed..e938d2ce9e 100644 --- a/src/main/resources/assets/opencomputers/lang/en_US.lang +++ b/src/main/resources/assets/opencomputers/lang/en_US.lang @@ -144,6 +144,7 @@ item.oc.UpgradeHover1.name=Hover Upgrade (Tier 2) item.oc.UpgradeInventory.name=Inventory Upgrade item.oc.UpgradeInventoryController.name=Inventory Controller Upgrade item.oc.UpgradeLeash.name=Leash Upgrade +item.oc.UpgradeMF.name=MFU item.oc.UpgradeNavigation.name=Navigation Upgrade item.oc.UpgradePiston.name=Piston Upgrade item.oc.UpgradeSign.name=Sign I/O Upgrade @@ -370,6 +371,9 @@ oc:tooltip.UpgradeGenerator=Can be used to generate energy from fuel on the go. oc:tooltip.UpgradeHover=This upgrade allows robots to fly higher above the ground without having to climb walls.[nl] Maximum height: §f%s§7 oc:tooltip.UpgradeInventory=This upgrade provides inventory space to a robot or drone. Without one of these, they will not be able to store items internally. oc:tooltip.UpgradeInventoryController=This upgrade allows robots and drones more control in how it interacts with external inventories, and allows robots to swap their equipped tool with an item in their inventory. +oc:tooltip.UpgradeMF=Allows adapters to access blocks they are not adjacent to. +oc:tooltip.UpgradeMF.Linked=§fConnection established§7 +oc:tooltip.UpgradeMF.Unlinked=§fNo connection§7 oc:tooltip.UpgradeLeash=Allows some devices, such as drones, to bind Isaa- excuse me... *chatter* My apologies. I'm just being told this is actually used to put animals on a leash. Multiple animals, even. Odd. oc:tooltip.UpgradeNavigation=Can be used to determine the position and orientation of a device. The position is relative to the center of the map that was used to craft this upgrade. oc:tooltip.UpgradePiston=This upgrade is very pushy. It allows moving blocks, similar to when using a piston. It does §lnot§7 move entities, however. diff --git a/src/main/resources/assets/opencomputers/loot/openos/bin/cd.lua b/src/main/resources/assets/opencomputers/loot/openos/bin/cd.lua index e5666c120c..44236919a8 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/bin/cd.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/bin/cd.lua @@ -41,7 +41,7 @@ path = resolved local oldpwd = shell.getWorkingDirectory() local result, reason = shell.setWorkingDirectory(path) if not result then - io.stderr:write("cd: ",reason) + io.stderr:write("cd: ", path, ": ", reason) return 1 else os.setenv("OLDPWD", oldpwd) diff --git a/src/main/resources/assets/opencomputers/loot/openos/bin/cp.lua b/src/main/resources/assets/opencomputers/loot/openos/bin/cp.lua index 6d5aaad175..a69e4c1a61 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/bin/cp.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/bin/cp.lua @@ -1,9 +1,9 @@ -local fs = require("filesystem") local shell = require("shell") -local computer = require("computer") +local transfer = require("tools/transfer") local args, options = shell.parse(...) -if #args < 2 then +options.h = options.h or options.help +if #args < 2 or options.h then io.write("Usage: cp [-inrv] \n") io.write(" -i: prompt before overwrite (overrides -n option).\n") io.write(" -n: do not overwrite an existing file.\n") @@ -13,161 +13,20 @@ if #args < 2 then io.write(" -P: preserve attributes, e.g. symbolic links.\n") io.write(" -v: verbose output.\n") io.write(" -x: stay on original source file system.\n") - return 1 + return not not options.h end -local exit_code = nil -options.P = options.P or options.r - -local function status(from, to) - if options.v then - io.write(from .. " -> " .. to .. "\n") - end - os.sleep(0) -- allow interrupting -end - -local result, reason - -local function prompt(message) - io.write(message .. " [Y/n] ") - local result = io.read() - if not result then -- closed pipe - os.exit(1) - end - return result and (result == "" or result:sub(1, 1):lower() == "y") -end - -local function areEqual(path1, path2) - local f1 = io.open(path1, "rb") - if not f1 then - return nil, "could not open `" .. path1 .. "' for update test" - end - local f2 = io.open(path2, "rb") - if not f2 then - f1:close() - return nil, "could not open `" .. path2 .. "' for update test" - end - local result = true - local chunkSize = 4 * 1024 - repeat - local s1, s2 = f1:read(chunkSize), f2:read(chunkSize) - if s1 ~= s2 then - result = false - break - end - until not s1 or not s2 - f1:close() - f2:close() - return result -end - -local mounts = {} -for dev,path in fs.mounts() do - mounts[fs.canonical(path)] = dev -end - -local function recurse(fromPath, toPath, origin) - local isLink, target = fs.isLink(fromPath) - local toIsLink, toLinkTarget = fs.isLink(toPath) - local same_path = fs.canonical(isLink and target or fromPath) == fs.canonical(toIsLink and toLinkTarget or toPath) - local same_link = isLink and toIsLink and same_path - local toExists = fs.exists(toPath) - - if isLink and options.P and not (toExists and same_path and not toIsLink) then - if toExists and options.n then - return true - end - fs.remove(toPath) - if toExists and options.v then - io.write(string.format("removed '%s'\n", toPath)) - end - status(fromPath, toPath) - return fs.link(target, toPath) - elseif fs.isDirectory(fromPath) then - if not options.r then - io.write("omitting directory `" .. fromPath .. "'\n") - exit_code = 1 - return true - end - if fs.exists(toPath) and not fs.isDirectory(toPath) then - -- my real cp always does this, even with -f, -n or -i. - return nil, "cannot overwrite non-directory `" .. toPath .. "' with directory `" .. fromPath .. "'" - end - if options.x and origin and mounts[fs.canonical(fromPath)] then - return true - end - if fs.get(fromPath) == fs.get(toPath) and (fs.canonical(toPath).."/"):find(fs.canonical(fromPath).."/",1,true) then - return nil, "cannot copy a directory, `" .. fromPath .. "', into itself, `" .. toPath .. "'" - end - if not fs.exists(toPath) then - status(fromPath, toPath) - fs.makeDirectory(toPath) - end - for file in fs.list(fromPath) do - local result, reason = recurse(fs.concat(fromPath, file), fs.concat(toPath, file), origin or fs.get(fromPath)) - if not result then - return nil, reason - end - end - return true - elseif fs.exists(fromPath) then - if toExists then - if same_path then - return nil, "`" .. fromPath .. "' and `" .. toPath .. "' are the same file" - end - - if options.n then - return true - end - - -- if target is link, we are updating the target - if toIsLink then - toPath = toLinkTarget - end - - if options.u and not fs.isDirectory(toPath) and areEqual(fromPath, toPath) then - return true - end - - if options.i then - if not prompt("overwrite `" .. toPath .. "'?") then - return true - end - end - - if fs.isDirectory(toPath) then - return nil, "cannot overwrite directory `" .. toPath .. "' with non-directory" - end - - fs.remove(toPath) - end - status(fromPath, toPath) - return fs.copy(fromPath, toPath) - else - return nil, "`" .. fromPath .. "': No such file or directory" - end -end - -local to = shell.resolve(args[#args]) - -for i = 1, #args - 1 do - local arg = args[i] - local fromPath = shell.resolve(arg) - -- a "contents of" copy is where src path ends in . or .. - -- a source path ending with . is not sufficient - could be the source filename - local contents_of = arg:match("%.$") and not fromPath:match("%.$") - local toPath = to - -- we do not append fromPath name to toPath in case of contents_of copy - if not contents_of and fs.isDirectory(toPath) then - toPath = fs.concat(toPath, fs.name(fromPath)) - end - result, reason = recurse(fromPath, toPath) - if not result then - if reason then - io.stderr:write(reason..'\n') - end - return 1 - end -end - -return exit_code +-- clean options for copy (as opposed to move) +options = +{ + cmd = "cp", + i = options.i, + n = options.n, + r = options.r, + u = options.u, + P = options.P, + v = options.v, + x = options.x, +} + +return transfer.batch(args, options) diff --git a/src/main/resources/assets/opencomputers/loot/openos/bin/df.lua b/src/main/resources/assets/opencomputers/loot/openos/bin/df.lua index 41e1d73daa..d7b6184cb9 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/bin/df.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/bin/df.lua @@ -23,7 +23,9 @@ end local mounts = {} if #args == 0 then for proxy, path in fs.mounts() do - mounts[path] = proxy + if not mounts[proxy] or mounts[proxy]:len() > path:len() then + mounts[proxy] = path + end end else for i = 1, #args do @@ -31,13 +33,13 @@ else if not proxy then io.stderr:write(args[i], ": no such file or directory\n") else - mounts[path] = proxy + mounts[proxy] = path end end end local result = {{"Filesystem", "Used", "Available", "Use%", "Mounted on"}} -for path, proxy in pairs(mounts) do +for proxy, path in pairs(mounts) do local label = proxy.getLabel() or proxy.address local used, total = proxy.spaceUsed(), proxy.spaceTotal() local available, percent diff --git a/src/main/resources/assets/opencomputers/loot/openos/bin/edit.lua b/src/main/resources/assets/opencomputers/loot/openos/bin/edit.lua index 9a5becea9a..a5f9cbe3df 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/bin/edit.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/bin/edit.lua @@ -20,14 +20,12 @@ local filename = shell.resolve(args[1]) local readonly = options.r or fs.get(filename) == nil or fs.get(filename).isReadOnly() -if not fs.exists(filename) then - if fs.isDirectory(filename) then - io.stderr:write("file is a directory\n") - return 1 - elseif readonly then - io.stderr:write("file system is read only\n") - return 1 - end +if fs.isDirectory(filename) then + io.stderr:write("file is a directory\n") + return 1 +elseif not fs.exists(filename) and readonly then + io.stderr:write("file system is read only\n") + return 1 end local function loadConfig() diff --git a/src/main/resources/assets/opencomputers/loot/openos/bin/grep.lua b/src/main/resources/assets/opencomputers/loot/openos/bin/grep.lua index 7ec81a96e0..3c66033c11 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/bin/grep.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/bin/grep.lua @@ -195,7 +195,7 @@ local function readLines() meta.label = file local file, reason = resolve(file) if fs.exists(file) then - curHand = io.open(file, 'r') + curHand, reason = io.open(file, 'r') if not curHand then local msg = string.format("failed to read from %s: %s", meta.label, reason) stderr:write("grep: ",msg,"\n") @@ -265,7 +265,7 @@ local function test(m,p) if max_matches == 0 then os.exit(1) end any_hit_ec = 0 m.hits, hit_value = m.hits + hit_value, 0 - if max_matches == m.hits or f_only or no_only then + if f_only or no_only then m.close = true end if flush or quiet then return end @@ -294,6 +294,9 @@ local function test(m,p) elseif p:find("^^") and not plain then p="^$" end end if not empty_line then write("\n") end + if max_matches ~= math.huge and max_matches >= m.hits then + m.close = true + end end for meta,status in readLines() do if not meta then diff --git a/src/main/resources/assets/opencomputers/loot/openos/bin/head.lua b/src/main/resources/assets/opencomputers/loot/openos/bin/head.lua index ea731f89ba..99dfa2166b 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/bin/head.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/bin/head.lua @@ -2,22 +2,25 @@ local shell = require("shell") local fs = require("filesystem") local args, options = shell.parse(...) +local error_code = 0 local function pop(key, convert) local result = options[key] options[key] = nil if result and convert then - local c = convert(result) + local c = tonumber(result) if not c then - error('invalid ' .. key .. ': could not convert ' .. result) + io.stderr:write(string.format("use --%s=n where n is a number\n", key)) + options.help = true + error_code = 1 end result = c end return result end -local bytes = pop('bytes', tonumber) -local lines = pop('lines', tonumber) +local bytes = pop('bytes', true) +local lines = pop('lines', true) local quiet = {pop('q'), pop('quiet'), pop('silent')} quiet = quiet[1] or quiet[2] or quiet[3] local verbose = {pop('v'), pop('verbose')} @@ -33,13 +36,14 @@ if help or next(options) then local invalid_key = next(options) if invalid_key then invalid_key = string.format('invalid option: %s\n', invalid_key) + error_code = 1 else invalid_key = '' end print(invalid_key .. [[Usage: head [--lines=n] file Print the first 10 lines of each FILE to stdout. For more info run: man head]]) - os.exit() + os.exit(error_code) end if #args == 0 then diff --git a/src/main/resources/assets/opencomputers/loot/openos/bin/install.lua b/src/main/resources/assets/opencomputers/loot/openos/bin/install.lua index 60ab9cb53c..1b9176d519 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/bin/install.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/bin/install.lua @@ -13,9 +13,10 @@ do end if not options then return end +local write = io.write if computer.freeMemory() < 50000 then - print("Low memory, collecting garbage") + write("Low memory, collecting garbage\n") for i=1,20 do os.sleep(0) end end @@ -26,7 +27,6 @@ if ec ~= nil and ec ~= 0 then return ec end -local write = io.write write("Installation complete!\n") if options.setlabel then diff --git a/src/main/resources/assets/opencomputers/loot/openos/bin/label.lua b/src/main/resources/assets/opencomputers/loot/openos/bin/label.lua index 7ecf77c023..25cf958f2b 100644 --- a/src/main/resources/assets/opencomputers/loot/openos/bin/label.lua +++ b/src/main/resources/assets/opencomputers/loot/openos/bin/label.lua @@ -1,26 +1,43 @@ -local fs = require("filesystem") local shell = require("shell") +local devfs = require("devfs") +local comp = require("component") local args, options = shell.parse(...) if #args < 1 then - io.write("Usage: label [-a] [

- * This will try to remove items of the same type as the specified item stack - * up to the number of the stack's size for all slots in the specified inventory. - *

- * This uses the extractFromInventorySlot method, and therefore - * handles special cases such as sided inventories and stack size limits. - */ + * Extracts an item stack from an inventory. + *

+ * This will try to remove items of the same type as the specified item stack + * up to the number of the stack's size for all slots in the specified inventory. + *

+ * This uses the extractFromInventorySlot method, and therefore + * handles special cases such as sided inventories and stack size limits. + */ def extractFromInventory(stack: ItemStack, inventory: IInventory, side: ForgeDirection, simulate: Boolean = false) = { val range = inventory match { case sided: ISidedInventory => sided.getAccessibleSlotsFromSide(side.ordinal).toIterable @@ -362,7 +362,7 @@ object InventoryUtils { /** * Utility method for spawning an item stack in the world. */ - def spawnStackInWorld(position: BlockPosition, stack: ItemStack, direction: Option[ForgeDirection] = None): EntityItem = position.world match { + def spawnStackInWorld(position: BlockPosition, stack: ItemStack, direction: Option[ForgeDirection] = None, validator: Option[EntityItem => Boolean] = None): EntityItem = position.world match { case Some(world) if stack != null && stack.stackSize > 0 => val rng = world.rand val (ox, oy, oz) = direction.fold((0, 0, 0))(d => (d.offsetX, d.offsetY, d.offsetZ)) @@ -376,8 +376,11 @@ object InventoryUtils { entity.motionY = 0.0125 * (rng.nextDouble - 0.5) + oy * 0.08 + (ox + oz) * 0.03 entity.motionZ = 0.0125 * (rng.nextDouble - 0.5) + oz * 0.03 entity.delayBeforeCanPickup = 15 - world.spawnEntityInWorld(entity) - entity + if (validator.fold(true)(_(entity))) { + world.spawnEntityInWorld(entity) + entity + } + else null case _ => null } }