Skip to content

Commit

Permalink
Merge branch 'master-MC1.7.10' of github.com:MightyPirates/OpenComput…
Browse files Browse the repository at this point in the history
…ers into OC1.6-MC1.7.10
  • Loading branch information
fnuecke committed Mar 12, 2016
2 parents ce081cf + 6b073bf commit 7bceabc
Show file tree
Hide file tree
Showing 521 changed files with 24,820 additions and 64,014 deletions.
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ Thanks a lot!

-------------------------------------------------------------------------------

The font used for screens and for monospace text in manual is unscii, made by
viznut, and was further expanded by asie. For more information, please see:

https://github.com/asiekierka/unscii-asie

-------------------------------------------------------------------------------

Assets from other sources:
HDD access samples based on this sample from freesound.org:
https://www.freesound.org/people/artykris/sounds/117401/
371 changes: 0 additions & 371 deletions LICENSE-unifont

This file was deleted.

Binary file modified assets/blocks.psd
Binary file not shown.
Binary file modified assets/items.psd
Binary file not shown.
9 changes: 7 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ repositories {
name 'ProjectRed'
url 'http://files.projectredwiki.com/maven/'
}
maven {
ivy {
name 'ColoredLightCore'
url "http://coloredlightscore.us.to/maven/clc/"
artifactPattern "http://coloredlightscore.us.to:8080/job/ColoredLightsCore%20v1.7.10/${config.coloredlights.build}/artifact/build/libs/[module]-[revision]-[classifier].[ext]"
}
ivy {
name "BuildCraft"
Expand Down Expand Up @@ -167,6 +167,10 @@ repositories {
name 'ExtraCells'
artifactPattern "http://addons-origin.cursecdn.com/files/${config.ec.cf}/[module]-[revision].[ext]"
}
ivy {
name 'ThaumicEnergistics'
artifactPattern "http://addons-origin.cursecdn.com/files/${config.thaumicenergistics.cf}/[module]-[revision].[ext]"
}
}

configurations {
Expand Down Expand Up @@ -213,6 +217,7 @@ dependencies {
provided name: 'Railcraft', version: config.rc.version, ext: 'jar'
provided name: 'BloodMagic', version: config.bloodmagic.version, ext: 'jar'
provided name: 'ExtraCells', version: config.ec.version, ext: 'jar'
provided name: 'ThaumicEnergistics', version: config.thaumicenergistics.version, ext: 'jar'

compile 'com.google.code.findbugs:jsr305:1.3.9' // Annotations used by google libs.

Expand Down
7 changes: 5 additions & 2 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
minecraft.version=1.7.10
forge.version=10.13.4.1448-1.7.10

oc.version=1.5.22
oc.subversion=
oc.version=1.6.0
oc.subversion=dev

ae2.version=rv2-beta-26
bc.version=7.0.9
Expand All @@ -15,6 +15,7 @@ ccl.version=1.1.1.104
cofhlib.cf=2230/207
cofhlib.version=[1.7.10]1.0.0RC7-127
coloredlights.version=1.3.7.35
coloredlights.build=35
ec.cf=2242/839
ec.version=deobf-1.7.10-2.2.73b129
eio.cf=2219/296
Expand All @@ -39,6 +40,8 @@ rc.cf=2219/321
rc.version=1.7.10-9.4.0.0
redlogic.version=59.0.3
rotc.version=V5c
thaumicenergistics.cf=2277/520
thaumicenergistics.version=1.0.0.1-RV2
tis3d.version=MC1.7.10-0.7.1.53
tmech.version=75.0afb56c
re.version=3.0.0.342
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/li/cil/oc/api/API.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
public class API {
public static final String ID_OWNER = "OpenComputers|Core";
public static final String VERSION = "5.6.4";
public static final String VERSION = "6.0.0-alpha";

// ----------------------------------------------------------------------- //

Expand Down
123 changes: 117 additions & 6 deletions src/main/java/li/cil/oc/api/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

import li.cil.oc.api.driver.Block;
import li.cil.oc.api.driver.Converter;
import li.cil.oc.api.driver.EnvironmentHost;
import li.cil.oc.api.driver.EnvironmentProvider;
import li.cil.oc.api.driver.InventoryProvider;
import li.cil.oc.api.driver.Item;
import li.cil.oc.api.driver.SidedBlock;
import li.cil.oc.api.network.EnvironmentHost;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

import java.util.Collection;

Expand All @@ -23,7 +29,7 @@
* at that time. Only start calling these methods in the init phase or later.
*
* @see Network
* @see Block
* @see SidedBlock
* @see Item
*/
public final class Driver {
Expand All @@ -38,12 +44,31 @@ public final class Driver {
* phases.
*
* @param driver the driver to register.
* @deprecated Use {@link SidedBlock} instead.
*/
@Deprecated // TODO Remove in OC 1.7
public static void add(final Block driver) {
if (API.driver != null)
API.driver.add(driver);
}

/**
* Registers a new side-aware block driver.
* <p/>
* Whenever the neighboring blocks of an Adapter block change, it checks if
* there exists a driver for the changed block, and if it is configured to
* interface that block type connects it to the component network.
* <p/>
* This must be called in the init phase, <em>not</em> the pre- or post-init
* phases.
*
* @param driver the driver to register.
*/
public static void add(final SidedBlock driver) {
if (API.driver != null)
API.driver.add(driver);
}

/**
* Registers a new item driver.
* <p/>
Expand Down Expand Up @@ -76,6 +101,34 @@ public static void add(final Converter converter) {
API.driver.add(converter);
}

/**
* Register a new environment provider.
* <p/>
* Environment providers are used for mapping item stacks to the type of
* environment that will be created by the stack, either by it being
* placed in the world and acting as a block component, or by being
* placed in an component inventory and created by the item's driver.
*
* @param provider the provider to register.
*/
public static void add(final EnvironmentProvider provider) {
if (API.driver != null)
API.driver.add(provider);
}

/**
* Register a new inventory provider.
* <p/>
* Inventory providers are used for accessing item inventories using
* the inventory controller upgrade, for example.
*
* @param provider the provider to register.
*/
public static void add(final InventoryProvider provider) {
if (API.driver != null)
API.driver.add(provider);
}

/**
* Looks up a driver for the block at the specified position in the
* specified world.
Expand All @@ -90,13 +143,37 @@ public static void add(final Converter converter) {
* @param y the Y coordinate of the block.
* @param z the Z coordinate of the block.
* @return a driver for the block, or <tt>null</tt> if there is none.
* @deprecated Use {@link #driverFor(World, int, int, int, ForgeDirection)},
* passing <tt>UNKNOWN</tt> if the side is to be ignored.
*/
@Deprecated // TODO Remove in OC 1.7
public static Block driverFor(World world, int x, int y, int z) {
if (API.driver != null)
return API.driver.driverFor(world, x, y, z);
return null;
}

/**
* Looks up a driver for the block at the specified position in the
* specified world.
* <p/>
* Note that several drivers for a single block can exist. Because of this
* block drivers are always encapsulated in a 'compound' driver, which is
* what will be returned here. In other words, you should will <em>not</em>
* get actual instances of drivers registered via {@link #add(li.cil.oc.api.driver.Block)}.
*
* @param world the world containing the block.
* @param x the X coordinate of the block.
* @param y the Y coordinate of the block.
* @param z the Z coordinate of the block.
* @return a driver for the block, or <tt>null</tt> if there is none.
*/
public static SidedBlock driverFor(World world, int x, int y, int z, ForgeDirection side) {
if (API.driver != null)
return API.driver.driverFor(world, x, y, z, side);
return null;
}

/**
* Looks up a driver for the specified item stack.
* <p/>
Expand Down Expand Up @@ -133,12 +210,47 @@ public static Item driverFor(ItemStack stack) {
return null;
}

/**
* Looks up the environment associated with the specified item stack.
* <p/>
* This will use the registered {@link EnvironmentProvider}s to find
* an environment type for the specified item stack. If none can be
* found, returns <tt>null</tt>.
*
* @param stack the item stack to get the environment type for.
* @return the type of environment associated with the stack, or <tt>null</tt>.
*/
public static Class<?> environmentFor(ItemStack stack) {
if (API.driver != null)
return API.driver.environmentFor(stack);
return null;
}

/**
* Get an inventory implementation providing access to an item inventory.
* <p/>
* This will use the registered {@link InventoryProvider}s to find an
* inventory implementation providing access to the specified stack.
* If none can be found, returns <tt>null</tt>.
* <p/>
* Note that the specified <tt>player</tt> may be null, but will usually
* be the <em>fake player</em> of the agent making use of this API.
*
* @param stack the item stack to get the inventory access for.
* @param player the player holding the item. May be <tt>null</tt>.
* @return the inventory implementation interfacing the stack, or <tt>null</tt>.
*/
public static IInventory inventoryFor(ItemStack stack, EntityPlayer player) {
if (API.driver != null)
return API.driver.inventoryFor(stack, player);
return null;
}

/**
* Get a list of all registered block drivers.
* <p/>
* This is intended to allow checking for particular drivers using more
* customized logic, and in particular to check for drivers with the
* {@link li.cil.oc.api.driver.EnvironmentAware} interface.
* customized logic.
* <p/>
* The returned collection is read-only.
*
Expand All @@ -154,8 +266,7 @@ public static Collection<Block> blockDrivers() {
* Get a list of all registered item drivers.
* <p/>
* This is intended to allow checking for particular drivers using more
* customized logic, and in particular to check for drivers with the
* {@link li.cil.oc.api.driver.EnvironmentAware} interface.
* customized logic.
* <p/>
* The returned collection is read-only.
*
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/li/cil/oc/api/FileSystem.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package li.cil.oc.api;

import li.cil.oc.api.driver.EnvironmentHost;
import li.cil.oc.api.network.EnvironmentHost;
import li.cil.oc.api.fs.Label;
import li.cil.oc.api.network.ManagedEnvironment;

Expand Down
12 changes: 12 additions & 0 deletions src/main/java/li/cil/oc/api/Machine.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ public static Collection<Class<? extends Architecture>> architectures() {
return Collections.emptyList();
}

/**
* Get the name of the specified architecture.
*
* @param architecture the architecture to get the name for.
* @return the name of the specified architecture.
*/
public static String getArchitectureName(Class<? extends Architecture> architecture) {
if (API.machine != null)
return API.machine.getArchitectureName(architecture);
return null;
}

/**
* Creates a new machine for the specified host.
* <p/>
Expand Down
46 changes: 8 additions & 38 deletions src/main/java/li/cil/oc/api/component/Keyboard.java
Original file line number Diff line number Diff line change
@@ -1,47 +1,17 @@
package li.cil.oc.api.component;

import li.cil.oc.api.Persistable;
import li.cil.oc.api.network.Environment;
import net.minecraft.entity.player.EntityPlayer;

/**
* This interface is implemented by the keyboard component, to allow more
* flexible use of it.
* <p/>
* You can obtain an instance of the keyboard component via the item driver
* of the keyboard block, for example:
* <pre>
* final ItemStack stack = li.cil.oc.api.Items.get("keyboard").createItemStack(1);
* final Keyboard keyboard = (Keyboard) li.cil.oc.api.Driver.driverFor(stack).createEnvironment(stack, this);
* </pre>
* <em>Not meant to be implemented.</em>
*
* @deprecated Use li.cil.oc.api.internal.Keyboard instead.
*/
public interface Keyboard extends Environment, Persistable {
/**
* Sets a custom usability override.
* <p/>
* Instead of the default check, which is based on the component's owner's
* position, the specified callback will be queried for usability checks
* instead.
* <p/>
* Pass <tt>null</tt> here to unset a previously set override.
*
* @param callback the usability checker to use.
*/
void setUsableOverride(UsabilityChecker callback);

@Deprecated
public interface Keyboard extends li.cil.oc.api.internal.Keyboard {
/**
* Contract interface that has to implemented for usability check overrides.
* <em>Not meant to be implemented.</em>
*
* @see #setUsableOverride(li.cil.oc.api.component.Keyboard.UsabilityChecker)
* @deprecated Use li.cil.oc.api.internal.Keyboard.UsabilityChecker instead.
*/
interface UsabilityChecker {
/**
* Whether the specified keyboard is usable by the specified player.
*
* @param keyboard the keyboard to check for.
* @param player the player to check for.
* @return whether the keyboard is usable by the player.
*/
boolean isUsableByPlayer(Keyboard keyboard, EntityPlayer player);
interface UsabilityChecker extends li.cil.oc.api.internal.Keyboard.UsabilityChecker {
}
}
25 changes: 25 additions & 0 deletions src/main/java/li/cil/oc/api/component/RackBusConnectable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package li.cil.oc.api.component;

import li.cil.oc.api.network.Environment;
import li.cil.oc.api.network.Packet;

/**
* Use this interface on environments that may receive network messages from a
* bus in a rack.
* <p/>
* Specifically, this is checked on environments in servers installed in racks.
* The server will collect the first three environments of components in it
* implement this interface, and provide their nodes to the rack via the
* {@link RackMountable#getConnectableAt(int)} method. This in turn will allow them
* to be 'connected' to the buses, so that they can receive network messages
* arriving on the respective side of the rack.
*/
public interface RackBusConnectable extends Environment {
/**
* Called to inject a network packet that arrived on the bus this
* environment is connected to in the hosting rack.
*
* @param packet the packet to handle.
*/
void receivePacket(Packet packet);
}
Loading

0 comments on commit 7bceabc

Please sign in to comment.