mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-17 21:55:12 +00:00
@@ -14,12 +14,8 @@ import java.util.Map;
|
||||
* as a proxy for all network objects. Whilst the node may change networks, an element's node should remain constant
|
||||
* for its lifespan.
|
||||
*
|
||||
* Elements are generally tied to a block or tile entity in world. One should either register an {@link IWiredProvider}
|
||||
* or implement {@link IWiredElementTile} on your tile entity.
|
||||
*
|
||||
* @see IWiredProvider
|
||||
* @see ComputerCraftAPI#registerWiredProvider(IWiredProvider)
|
||||
* @see IWiredElementTile
|
||||
* Elements are generally tied to a block or tile entity in world. In such as case, one should provide the
|
||||
* {@link IWiredElement} capability for the appropriate sides.
|
||||
*/
|
||||
public interface IWiredElement extends IWiredSender
|
||||
{
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package dan200.computercraft.api.network.wired;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* A {@link net.minecraft.tileentity.TileEntity} which provides a {@link IWiredElement}. This acts
|
||||
* as a simpler alternative to a full-blown {@link IWiredProvider}.
|
||||
*/
|
||||
public interface IWiredElementTile
|
||||
{
|
||||
/**
|
||||
* Get the wired element of this tile for a given side.
|
||||
*
|
||||
* @param side The side to get the network element from.
|
||||
* @return A network element, or {@code null} if there is no element here.
|
||||
*/
|
||||
@Nullable
|
||||
IWiredElement getWiredElement( @Nonnull EnumFacing side );
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
package dan200.computercraft.api.network.wired;
|
||||
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Fetch or create an {@link IWiredElement} for a block at a given position.
|
||||
*
|
||||
* @see dan200.computercraft.api.ComputerCraftAPI#registerWiredProvider(IWiredProvider)
|
||||
* @see IWiredElementTile
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface IWiredProvider
|
||||
{
|
||||
/**
|
||||
* Extract a wired network element from a block location.
|
||||
*
|
||||
* @param world The world the block is in.
|
||||
* @param pos The position the block is at.
|
||||
* @param side The side to get the network element from.
|
||||
* @return A network element, or {@code null} if there is not an element here you'd like to handle.
|
||||
*/
|
||||
@Nullable
|
||||
IWiredElement getElement( @Nonnull IBlockAccess world, @Nonnull BlockPos pos, @Nonnull EnumFacing side );
|
||||
}
|
||||
Reference in New Issue
Block a user