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

This commit is contained in:
Florian Nücke 2014-08-13 16:50:59 +02:00
commit e15f411fbe
6 changed files with 12 additions and 11 deletions

View File

@ -1,10 +1,8 @@
package li.cil.oc.api.driver;
import li.cil.oc.api.network.ManagedEnvironment;
import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
/**
* Interface for item component drivers.
@ -72,7 +70,11 @@ public interface Item {
*
* @param stack the item stack to get the slot type for.
* @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);
/**

View File

@ -5,12 +5,7 @@ package li.cil.oc.api.driver;
* <p/>
* This is used to determine which item components may go into which slots in
* 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 {
/**
* Invalid slot type.

View File

@ -21,7 +21,11 @@ public interface UpgradeContainer extends Item {
*
* @param stack the item stack to get the provided slot type for.
* @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);
/**

View File

@ -37,5 +37,5 @@
@cpw.mods.fml.common.API(
owner = "OpenComputers|Core",
provides = "OpenComputersAPI",
apiVersion = "2.0.1")
apiVersion = "2.0.2")
package li.cil.oc.api;

View File

@ -48,7 +48,7 @@ class Server(val rack: tileentity.ServerRack, val number: Int) extends Owner {
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(driver: driver.Processor) => driver.supportedComponents(item)
case _ => 0

View File

@ -93,7 +93,7 @@ object LuaStateFactory {
// Try to find a working lib.
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)
if (libraryUrl != null) {
// Create a temporary file.
@ -179,7 +179,7 @@ object LuaStateFactory {
}
catch {
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()
}
}