mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-19 04:06:43 -04:00
Merge branch 'master' of github.com:MightyPirates/OpenComputers into master-MC1.7.10
This commit is contained in:
commit
e15f411fbe
@ -1,10 +1,8 @@
|
|||||||
package li.cil.oc.api.driver;
|
package li.cil.oc.api.driver;
|
||||||
|
|
||||||
import li.cil.oc.api.network.ManagedEnvironment;
|
import li.cil.oc.api.network.ManagedEnvironment;
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for item component drivers.
|
* Interface for item component drivers.
|
||||||
@ -72,7 +70,11 @@ public interface Item {
|
|||||||
*
|
*
|
||||||
* @param stack the item stack to get the slot type for.
|
* @param stack the item stack to get the slot type for.
|
||||||
* @return the slot type of the specified item.
|
* @return the slot type of the specified item.
|
||||||
|
* @deprecated This will be replaced in 1.4, where slot types will then be
|
||||||
|
* referred to by name (using Strings) instead, to make this system more
|
||||||
|
* flexible (not requiring an API change for each new slot type, e.g.).
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
Slot slot(ItemStack stack);
|
Slot slot(ItemStack stack);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5,12 +5,7 @@ package li.cil.oc.api.driver;
|
|||||||
* <p/>
|
* <p/>
|
||||||
* This is used to determine which item components may go into which slots in
|
* This is used to determine which item components may go into which slots in
|
||||||
* a computer's or robot's inventory.
|
* a computer's or robot's inventory.
|
||||||
*
|
|
||||||
* @deprecated This will be removed in 1.4, where slot types will then be
|
|
||||||
* referred to by name (using strings) instead, to make this system more
|
|
||||||
* flexible (not requiring an API change for each new slot type, e.g.).
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
public enum Slot {
|
public enum Slot {
|
||||||
/**
|
/**
|
||||||
* Invalid slot type.
|
* Invalid slot type.
|
||||||
|
@ -21,7 +21,11 @@ public interface UpgradeContainer extends Item {
|
|||||||
*
|
*
|
||||||
* @param stack the item stack to get the provided slot type for.
|
* @param stack the item stack to get the provided slot type for.
|
||||||
* @return the slot type provided by that dynamic slot upgrade.
|
* @return the slot type provided by that dynamic slot upgrade.
|
||||||
|
* @deprecated This will be replaced in 1.4, where slot types will then be
|
||||||
|
* referred to by name (using Strings) instead, to make this system more
|
||||||
|
* flexible (not requiring an API change for each new slot type, e.g.).
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
Slot providedSlot(ItemStack stack);
|
Slot providedSlot(ItemStack stack);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -37,5 +37,5 @@
|
|||||||
@cpw.mods.fml.common.API(
|
@cpw.mods.fml.common.API(
|
||||||
owner = "OpenComputers|Core",
|
owner = "OpenComputers|Core",
|
||||||
provides = "OpenComputersAPI",
|
provides = "OpenComputersAPI",
|
||||||
apiVersion = "2.0.1")
|
apiVersion = "2.0.2")
|
||||||
package li.cil.oc.api;
|
package li.cil.oc.api;
|
@ -48,7 +48,7 @@ class Server(val rack: tileentity.ServerRack, val number: Int) extends Owner {
|
|||||||
case _ => 0
|
case _ => 0
|
||||||
}))
|
}))
|
||||||
|
|
||||||
lazy val maxComponents = inventory.items.foldLeft(0)((sum, stack) => sum + (stack match {
|
lazy val maxComponents = if (!hasCPU) 0 else inventory.items.foldLeft(0)((sum, stack) => sum + (stack match {
|
||||||
case Some(item) => Option(Driver.driverFor(item)) match {
|
case Some(item) => Option(Driver.driverFor(item)) match {
|
||||||
case Some(driver: driver.Processor) => driver.supportedComponents(item)
|
case Some(driver: driver.Processor) => driver.supportedComponents(item)
|
||||||
case _ => 0
|
case _ => 0
|
||||||
|
@ -93,7 +93,7 @@ object LuaStateFactory {
|
|||||||
|
|
||||||
// Try to find a working lib.
|
// Try to find a working lib.
|
||||||
for (library <- libNames if !haveNativeLibrary) {
|
for (library <- libNames if !haveNativeLibrary) {
|
||||||
OpenComputers.log.debug(s"Trying native library '$library'...")
|
OpenComputers.log.trace(s"Trying native library '$library'...")
|
||||||
val libraryUrl = classOf[Machine].getResource(libPath + library)
|
val libraryUrl = classOf[Machine].getResource(libPath + library)
|
||||||
if (libraryUrl != null) {
|
if (libraryUrl != null) {
|
||||||
// Create a temporary file.
|
// Create a temporary file.
|
||||||
@ -179,7 +179,7 @@ object LuaStateFactory {
|
|||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
case _: Throwable =>
|
case _: Throwable =>
|
||||||
OpenComputers.log.debug(s"Could not load native library '${file.getName}'.")
|
OpenComputers.log.trace(s"Could not load native library '${file.getName}'.")
|
||||||
file.delete()
|
file.delete()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user