Remove part layer api in favor of capabilities (#355)
This commit is contained in:
@@ -35,32 +35,6 @@ import net.minecraft.world.World;
|
||||
|
||||
public interface IPartHelper
|
||||
{
|
||||
/**
|
||||
* Register a new layer with the part layer system, this allows you to write an in between between tile entities and
|
||||
* parts.
|
||||
*
|
||||
* AE By Default includes,
|
||||
*
|
||||
* 1. ISidedInventory ( and by extension IInventory. )
|
||||
*
|
||||
* 2. IFluidHandler Forge Fluids
|
||||
*
|
||||
* 3. IPowerEmitter BC Power output.
|
||||
*
|
||||
* 4. IPowerReceptor BC Power input.
|
||||
*
|
||||
* 5. IEnergySink IC2 Power input.
|
||||
*
|
||||
* 6. IEnergySource IC2 Power output.
|
||||
*
|
||||
* 7. IPipeConnection BC Pipe Connections
|
||||
*
|
||||
* As long as a valid layer is registered for a interface you can simply implement that interface on a part get
|
||||
* implement it.
|
||||
*
|
||||
* @return true on success, false on failure, usually a error will be logged as well.
|
||||
*/
|
||||
boolean registerNewLayer( String string, String layerInterface );
|
||||
|
||||
/**
|
||||
* use in use item, to try and place a IBusItem
|
||||
|
||||
@@ -151,7 +151,7 @@ public interface IPartHost extends ICustomCableConnection
|
||||
void markForSave();
|
||||
|
||||
/**
|
||||
* part of the {@link LayerBase}
|
||||
* called when parts are added or removed
|
||||
*/
|
||||
void partChanged();
|
||||
|
||||
@@ -169,11 +169,6 @@ public interface IPartHost extends ICustomCableConnection
|
||||
*/
|
||||
boolean isEmpty();
|
||||
|
||||
/**
|
||||
* @return a mutable list of flags you can adjust to track state.
|
||||
*/
|
||||
Set<LayerFlags> getLayerFlags();
|
||||
|
||||
/**
|
||||
* remove host from world...
|
||||
*/
|
||||
@@ -191,4 +186,4 @@ public interface IPartHost extends ICustomCableConnection
|
||||
*/
|
||||
boolean isInWorld();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
*
|
||||
* 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:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package appeng.api.parts;
|
||||
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
||||
import appeng.api.util.AEPartLocation;
|
||||
|
||||
|
||||
/**
|
||||
* All Layers must extends this, this get part implementation is provided to interface with the parts, however a real
|
||||
* implementation will be used at runtime.
|
||||
*
|
||||
* TODO: Consider removing and replacing with capabilities.
|
||||
*/
|
||||
public abstract class LayerBase extends TileEntity // implements IPartHost
|
||||
{
|
||||
|
||||
/**
|
||||
* Grants access for the layer to the parts of the host.
|
||||
*
|
||||
* This Method looks silly, that is because its not used at runtime, a real implementation will be used instead.
|
||||
*
|
||||
* @param side side of part
|
||||
*
|
||||
* @return the part for the requested side.
|
||||
*/
|
||||
public IPart getPart( final AEPartLocation side )
|
||||
{
|
||||
return null; // place holder.
|
||||
}
|
||||
|
||||
/**
|
||||
* Grants access for the layer to the parts of the host.
|
||||
*
|
||||
* This Method looks silly, that is because its not used at runtime, a real implementation will be used instead.
|
||||
*
|
||||
* @param side side of part
|
||||
*
|
||||
* @return the part for the requested side.
|
||||
*/
|
||||
public IPart getPart( final EnumFacing side )
|
||||
{
|
||||
return null; // place holder.
|
||||
}
|
||||
|
||||
/**
|
||||
* called when the parts change in the container, YOU MUST CALL super.PartChanged();
|
||||
*/
|
||||
public void notifyNeighbors()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* called when the parts change in the container, YOU MUST CALL super.PartChanged();
|
||||
*/
|
||||
public void partChanged()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @return a mutable list of flags you can adjust to track state.
|
||||
*/
|
||||
public Set<LayerFlags> getLayerFlags()
|
||||
{
|
||||
return null; // place holder.
|
||||
}
|
||||
|
||||
public void markForSave()
|
||||
{
|
||||
// something!
|
||||
}
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* The MIT License (MIT)
|
||||
*
|
||||
* Copyright (c) 2013 AlgorithmX2
|
||||
*
|
||||
* 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:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package appeng.api.parts;
|
||||
|
||||
|
||||
/**
|
||||
* TODO: Consider removing and replacing with capabilities.
|
||||
*/
|
||||
public enum LayerFlags
|
||||
{
|
||||
|
||||
IC2_ENET
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user