2014-12-13 01:19:51 +01:00
|
|
|
/*
|
|
|
|
* The MIT License (MIT)
|
2015-02-03 12:04:13 +01:00
|
|
|
*
|
2014-12-13 01:19:51 +01:00
|
|
|
* Copyright (c) 2013 AlgorithmX2
|
2015-02-03 12:04:13 +01:00
|
|
|
*
|
2014-12-13 01:19:51 +01:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
|
|
* this software and associated documentation files (the "Software"), to deal in
|
|
|
|
* the Software without restriction, including without limitation the rights to
|
|
|
|
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
|
|
* the Software, and to permit persons to whom the Software is furnished to do so,
|
|
|
|
* subject to the following conditions:
|
2015-02-03 12:04:13 +01:00
|
|
|
*
|
2014-12-13 01:19:51 +01:00
|
|
|
* The above copyright notice and this permission notice shall be included in all
|
|
|
|
* copies or substantial portions of the Software.
|
2015-02-03 12:04:13 +01:00
|
|
|
*
|
2014-12-13 01:19:51 +01:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
|
|
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2014-12-04 13:00:54 +01:00
|
|
|
package appeng.api.implementations.parts;
|
|
|
|
|
2015-01-03 02:53:14 +01:00
|
|
|
|
|
|
|
import java.util.EnumSet;
|
|
|
|
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
2015-06-16 02:44:59 +02:00
|
|
|
import net.minecraft.util.EnumFacing;
|
2016-01-01 01:47:22 +01:00
|
|
|
|
2014-12-04 13:00:54 +01:00
|
|
|
import appeng.api.networking.IGridHost;
|
|
|
|
import appeng.api.parts.BusSupport;
|
|
|
|
import appeng.api.parts.IPart;
|
|
|
|
import appeng.api.parts.IPartHost;
|
|
|
|
import appeng.api.util.AECableType;
|
|
|
|
import appeng.api.util.AEColor;
|
2015-06-16 02:44:59 +02:00
|
|
|
import appeng.api.util.AEPartLocation;
|
2014-12-04 13:00:54 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2015-06-16 02:44:59 +02:00
|
|
|
* Implemented on the {@link IPart}s cable objects that can be placed at {@link AEPartLocation}.UNKNOWN in
|
2014-12-04 13:00:54 +01:00
|
|
|
* {@link IPartHost}s
|
|
|
|
*/
|
|
|
|
public interface IPartCable extends IPart, IGridHost
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* does this cable support buses?
|
|
|
|
*/
|
|
|
|
BusSupport supportsBuses();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the current color of the cable.
|
|
|
|
*/
|
|
|
|
AEColor getCableColor();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the Cable type.
|
|
|
|
*/
|
|
|
|
AECableType getCableConnectionType();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Change the color of the cable, this should cost a small amount of dye, or something.
|
2015-02-03 12:04:13 +01:00
|
|
|
*
|
2014-12-04 13:00:54 +01:00
|
|
|
* @param newColor new color
|
2015-01-03 02:53:14 +01:00
|
|
|
*
|
2014-12-04 13:00:54 +01:00
|
|
|
* @return if the color change was successful.
|
|
|
|
*/
|
2015-01-03 02:53:14 +01:00
|
|
|
boolean changeColor( AEColor newColor, EntityPlayer who );
|
2014-12-04 13:00:54 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Change sides on the cables node.
|
2015-04-03 08:54:31 +02:00
|
|
|
*
|
2014-12-04 13:00:54 +01:00
|
|
|
* Called by AE, do not invoke.
|
2015-02-03 12:04:13 +01:00
|
|
|
*
|
2014-12-04 13:00:54 +01:00
|
|
|
* @param sides sides of cable
|
|
|
|
*/
|
2015-06-16 02:44:59 +02:00
|
|
|
void setValidSides( EnumSet<EnumFacing> sides );
|
2014-12-04 13:00:54 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* used to tests if a cable connects to neighbors visually.
|
2015-02-03 12:04:13 +01:00
|
|
|
*
|
2014-12-04 13:00:54 +01:00
|
|
|
* @param side neighbor side
|
2015-01-03 02:53:14 +01:00
|
|
|
*
|
2014-12-04 13:00:54 +01:00
|
|
|
* @return true if this side is currently connects to an external block.
|
|
|
|
*/
|
2015-06-16 02:44:59 +02:00
|
|
|
boolean isConnected( EnumFacing side );
|
2016-08-19 22:45:27 +02:00
|
|
|
|
2014-12-04 13:00:54 +01:00
|
|
|
}
|