-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master-MC1.7.10' of github.com:MightyPirates/OpenComput…
…ers into OC1.6-MC1.7.10
- Loading branch information
Showing
521 changed files
with
24,820 additions
and
64,014 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
25
src/main/java/li/cil/oc/api/component/RackBusConnectable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
Oops, something went wrong.