And the award for first mod integration goes to: NEI!

This commit is contained in:
Florian Nücke 2015-01-03 02:57:38 +01:00
parent a804769abd
commit b3facc363e
37 changed files with 20 additions and 1147 deletions

View File

@ -61,15 +61,15 @@ runServer {
}
repositories {
maven {
name = "chickenbones"
url = "http://chickenbones.net/maven/"
}
/*
maven {
name = "bc"
url = "http://mod-buildcraft.com/"
}
maven {
name = "chickenbones"
url = "http://chickenbones.net/maven/"
}
maven {
name = "ic2, forestry"
url = "http://maven.ic2.player.to/"
@ -138,13 +138,14 @@ configurations {
}
dependencies {
provided "codechicken:CodeChickenCore:${config.minecraft.version}-${config.ccc.version}:dev"
provided "codechicken:CodeChickenLib:${config.minecraft.version}-${config.ccl.version}:dev"
provided "codechicken:NotEnoughItems:${config.minecraft.version}-${config.nei.version}:dev"
/*
provided "api:rotarycraft:${config.rotc.version}"
provided "appeng:appliedenergistics2:${config.ae2.version}:dev"
provided "codechicken:CodeChickenLib:${config.minecraft.version}-${config.ccl.version}:dev"
provided "codechicken:EnderStorage:${config.minecraft.version}-${config.es.version}:dev"
provided "codechicken:ForgeMultipart:${config.minecraft.version}-${config.fmp.version}:dev"
provided "codechicken:NotEnoughItems:${config.minecraft.version}-${config.nei.version}:dev"
provided "codechicken:WR-CBE:${config.minecraft.version}-${config.wrcbe.version}:dev"
provided "com.gregoriust.gregtech:gregtech_${config.minecraft.version}:${config.gt.version}:dev"
provided "com.mod-buildcraft:buildcraft:${config.bc.version}:dev"
@ -171,7 +172,7 @@ dependencies {
}
idea.module.scopes.PROVIDED.plus += configurations.provided
eclipse.classpath.plusConfigurations += configurations.provided
// eclipse.classpath.plusConfigurations += configurations.provided
sourceSets {
main {
@ -187,7 +188,6 @@ sourceSets {
exclude 'li/cil/oc/integration/ic2/**'
exclude 'li/cil/oc/integration/mfr/**'
exclude 'li/cil/oc/integration/mystcraft/**'
exclude 'li/cil/oc/integration/nei/**'
exclude 'li/cil/oc/integration/railcraft/**'
exclude 'li/cil/oc/integration/stargatetech2/**'
exclude 'li/cil/oc/integration/tcon/**'

View File

@ -8,7 +8,8 @@ ae2.version=rv1-stable-1
bc.version=6.1.8
cc.cf=2216/236
cc.version=1.65
ccl.version=1.1.1.104
ccc.version=1.0.5.34
ccl.version=1.1.2.115
cofhlib.cf=2212/893
cofhlib.version=[1.7.10]1.0.0B6-dev-26
eio.cf=2219/296
@ -24,7 +25,7 @@ mekanism.build=118
mekanism.version=7.1.1
mfr.cf=2213/46
mfr.version=[1.7.10]2.8.0RC3-dev-591
nei.version=1.0.3.57
nei.version=1.0.5.82
projred.version=4.5.8.59
rc.cf=2219/321
rc.version=1.7.10-9.4.0.0

View File

@ -1,6 +1,6 @@
#Wed Jul 02 15:54:47 CDT 2014
#Sat Jan 03 02:25:42 CET 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-1.12-bin.zip

2
gradlew.bat vendored
View File

@ -9,7 +9,7 @@
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=-Xmx1G -XX:MaxPermSize=256M
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.

View File

@ -1,15 +0,0 @@
package lordfokas.stargatetech2.api;
import lordfokas.stargatetech2.api.bus.IBusDevice;
import lordfokas.stargatetech2.api.bus.IBusDriver;
import lordfokas.stargatetech2.api.bus.IBusInterface;
/**
* A factory for private classes that implement
* interfaces from the public API.
*
* @author LordFokas
*/
public interface IFactory {
public IBusInterface getIBusInterface(IBusDevice device, IBusDriver driver);
}

View File

@ -1,34 +0,0 @@
package lordfokas.stargatetech2.api;
import java.util.Collection;
import net.minecraft.item.ItemStack;
/**
* The way to get ItemStacks added to the game by StargateTech 2
*
* @author LordFokas
*/
public interface IStackManager {
/**
* Used to fetch an ItemStack by it's name, with a default size of 1.
*
* @param stack The stack we want to fetch.
* @return The stack, or null if none was found.
*/
public ItemStack get(String stack);
/**
* Used to fetch an ItemStack by it's name with a given size.
*
* @param stack The stack we want to fetch.
* @param size The size the stack comes with. Must be in the range 1 - 64.
* @return The stack, or null if none was found.
*/
public ItemStack get(String stack, int size);
/**
* @return A list with the names of all the existing stacks.
*/
public Collection<String> getAllStacks();
}

View File

@ -1,33 +0,0 @@
package lordfokas.stargatetech2.api;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.fluids.Fluid;
import lordfokas.stargatetech2.api.stargate.IStargateNetwork;
import lordfokas.stargatetech2.api.stargate.IStargatePlacer;
public interface IStargateTechAPI {
/**
* @return The Fluid instance corresponding to Ionized Particles.
*/
public Fluid getIonizedParticlesFluidInstance();
/**
* @return The creative inventory tab used by StargateTech 2.
*/
public CreativeTabs getStargateTab();
/**
* @return The IStargateNetwork singleton instance.
*/
public IStargateNetwork getStargateNetwork();
/**
* @return The IStargatePlacer singleton instance, a.k.a Seeding Ship for the fans.
*/
public IStargatePlacer getSeedingShip();
/**
* @return The current IFactory instance.
*/
public IFactory getFactory();
}

View File

@ -1,27 +0,0 @@
package lordfokas.stargatetech2.api;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;
/**
* Implemented by blocks that run special actions when clicked with a TabletPC in hand.
* The default action in StargateTech2 is opening a special GUI.
*
* @author LordFokas
*/
public interface ITabletAccess {
/**
* Make the block run a special action when activated with a TabletPC.
* This method is only called on the client side.
* Implementations requiring server side should use packets.
*
* @param player The player activating the block.
* @param world The world the block is in.
* @param x The block's X coordinate.
* @param y The block's Y coordinate.
* @param z The block's Z coordinate.
* @return True if a special action was executed, false otherwise.
*/
public boolean onTabletAccess(EntityPlayer player, World world, int x, int y, int z);
}

View File

@ -1,16 +0,0 @@
package lordfokas.stargatetech2.api;
public abstract class StargateTechAPI implements IStargateTechAPI {
protected static IStargateTechAPI apiInstance;
/**
* StargateTech's API is abstract, and it's implementation is not visible in the API package.
* All available methods in IStargateTechAPI are implemented elsewhere.
* This method allows you to retrieve an instance of that implementation.
*
* @return a concrete implementation of IStargateTechAPI
*/
public static IStargateTechAPI api(){
return apiInstance;
}
}

View File

@ -1,40 +0,0 @@
package lordfokas.stargatetech2.api.bus;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraft.world.World;
public class BusEvent extends Event{
public final World world;
public final int x, y, z;
protected BusEvent(World world, int x, int y, int z){
this.world = world;
this.x = x;
this.y = y;
this.z = z;
}
/**
* Fire this event on Forge's BUS_EVENT to add the IBusDevice
* in this location to a bus network, if any is available.
*
* @author LordFokas
*/
public static final class AddToNetwork extends BusEvent{
public AddToNetwork(World world, int x, int y, int z) {
super(world, x, y, z);
}
}
/**
* Fire this event on Forge's BUS_EVENT to remove the IBusDevice
* in this location from any connected bus networks.
*
* @author LordFokas
*/
public static final class RemoveFromNetwork extends BusEvent{
public RemoveFromNetwork(World world, int x, int y, int z) {
super(world, x, y, z);
}
}
}

View File

@ -1,93 +0,0 @@
package lordfokas.stargatetech2.api.bus;
import java.util.LinkedList;
public abstract class BusPacket<R>{
private LinkedList<R> responses;
private final short sender;
private final short target;
private final boolean hasLIP;
/**
* @param sender The address of the Device that is sending this packet.
* @param target The address of the Device(s) that should receive this packet.
* @param hasLIP Whether or not this packet supports being converted to a plain text (LIP) format.
*/
protected BusPacket(short sender, short target, boolean hasLIP){
this.responses = new LinkedList();
this.sender = sender;
this.target = target;
this.hasLIP = hasLIP;
}
/**
* @return The address of the device that sent this packet.
*/
public final short getSender(){
return sender;
}
/**
* @return The address of the device(s) that should receive this packet.
*/
public final short getTarget(){
return target;
}
/**
* @return The ID of the protocol this packet corresponds to.
*/
public final int getProtocolID(){
return BusProtocols.getProtocolID(this.getClass());
}
/**
* @return A plain text (LIP) version of this packet, if it has one.
*/
public final BusPacketLIP getPlainText(){
if(this instanceof BusPacketLIP){
return (BusPacketLIP) this;
}else if(hasLIP){
BusPacketLIP lip = new BusPacketLIP(sender, target);
fillPlainText(lip);
lip.finish();
return lip;
}
return null;
}
/**
* Used by subclasses to convert themselves to plain text format.
*
* @param lip The Lazy Intercom Protocol (LIP) packet we're filling with our data.
*/
protected abstract void fillPlainText(BusPacketLIP lip);
/**
* @return Whether or not this packet supports conversion to the LIP format.
*/
public final boolean hasPlainText(){
return hasLIP;
}
/**
* Adds a response to this packet that to give the sender some feedback.
* The object type depends on the packet subclass.
*
* Note that clients converting the packet to LIP format
* lose the ability to send feedback.
*
* @param response The response to add.
*/
public final void addResponse(R response){
if(response == null) throw new IllegalArgumentException("A Response cannot be null!");
responses.add(response);
}
/**
* @return All the responses other clients added to this packet.
*/
public final LinkedList<R> getResponses(){
return new LinkedList<R>(responses);
}
}

View File

@ -1,112 +0,0 @@
package lordfokas.stargatetech2.api.bus;
import java.util.ArrayList;
import java.util.Hashtable;
/**
* LIP - Lazy Intercom Protocol<br>
* <br>
* Baptized by sciguyryan (often found in #ThermalExpansion and #StargateTech on esper.net's IRC),
* this is the universal plain text format used in the Abstract Bus.<br>
* <br>
* Any packet can choose to be convertible to this format, allowing for any class anywhere to
* read data from a packet which has an unknown and / or private class by asking it to convert to
* a text format. This removes all the problems with type casting and such.
*
* @author LordFokas
*/
public final class BusPacketLIP extends BusPacket<String> {
private boolean isEditable = true;
private LIPMetadata metadata = null;
private Hashtable<String, String> data = new Hashtable();
/**
* Defines optional metadata that helps sorting this packet out / figuring out what to do with this.
* The fact this is a plain text protocol makes the possibilities so vague it'd be impossible to
* guess what kind of data this packet carries.
*
* @author LordFokas
*/
public static final class LIPMetadata{
public final String modID;
public final String deviceName;
public final String playerName;
/**
* Example: new LIPMetadata("StargateTech2", "shieldEmitter", "LordFokas");
*
* @param modID The ID of the mod that generated this packet. PLEASE do fill this one.
* @param deviceName The name (or a unique identifier) of the type of machine that generated this.
* @param playerName The name of the player that made this packet be generated, if any.
*/
public LIPMetadata(String modID, String deviceName, String playerName){
this.modID = modID;
this.deviceName = deviceName;
this.playerName = playerName;
}
}
public BusPacketLIP(short sender, short target) {
super(sender, target, true);
}
/**
* @param metadata The LIPMetadata object to set to this packet.
*/
public void setMetadata(LIPMetadata metadata){
if(isEditable && this.metadata == null){
this.metadata = metadata;
}
}
/**
* @return The LIPMetadata object on this object. May be null.
*/
public LIPMetadata getMetadata(){
return metadata;
}
@Override // We don't need this. At all.
protected void fillPlainText(BusPacketLIP lip){}
/**
* Finish creating this packet.
* As soon as you call this, it can no longer be modified.
*/
public void finish(){
isEditable = false;
}
/**
* @return A list of all the keys for the data on this packet.
*/
public ArrayList<String> getEntryList(){
ArrayList<String> entries = new ArrayList();
entries.addAll(data.keySet());
return entries;
}
/**
* Add a new entry to this packet.
* If the key already exists the entry is ignored.
*
* @param key The key under which to send the data.
* @param val The data to send.
*/
public void set(String key, String val){
if(isEditable && !data.containsKey(key)){
data.put(key.toLowerCase(), val);
}
}
/**
* Get the value stored under that key, if any.
* Case Insensitive.
*
* @param key The key under which the data is stored.
* @return The data stored under that key, if any, null otherwise.
*/
public String get(String key){
return data.get(key.toLowerCase());
}
}

View File

@ -1,39 +0,0 @@
package lordfokas.stargatetech2.api.bus;
import java.util.LinkedList;
public final class BusPacketNetScan extends BusPacket<Void> {
private LinkedList<Device> devices = new LinkedList();
public BusPacketNetScan(short target) {
super((short)0xFFFF, target, false);
}
// We're not using this
@Override protected void fillPlainText(BusPacketLIP lip){}
public void addDevice(Device device){
devices.add(device);
}
public LinkedList<Device> getDevices(){
return new LinkedList<Device>(devices);
}
public static final class Device{
public final String description, name;
public final short address;
public final boolean enabled;
public final int x, y, z;
public Device(String desc, String name, short address, boolean enabled, int x, int y, int z){
this.description = desc;
this.name = name;
this.address = address;
this.enabled = enabled;
this.x = x;
this.y = y;
this.z = z;
}
}
}

View File

@ -1,38 +0,0 @@
package lordfokas.stargatetech2.api.bus;
import java.util.ArrayList;
public final class BusProtocols {
private static final ArrayList<Class<? extends BusPacket>> protocols = new ArrayList();
/**
* Add a protocol to the list, if it doesn't exist yet.
*
* @param packetClass the class of the packet corresponding to the protocol we're adding.
* @return the id of the protocol we just added.
*/
public static final int addProtocol(Class<? extends BusPacket> packetClass){
if(!protocols.contains(packetClass)){
protocols.add(packetClass);
}
return protocols.indexOf(packetClass);
}
/**
* Gives you the id of the protocol correspondig to a given packet class.
*
* @param packetClass the class of the packet for which we want to know the protocol ID.
* @return the ID of the protocol corresponding to the packet class.
*/
public static final int getProtocolID(Class<? extends BusPacket> packetClass){
return protocols.indexOf(packetClass);
}
private BusProtocols(){}
// A list of all the protocols implemented by StargateTech 2
public static final int PROTOCOL_LIP = addProtocol(BusPacketLIP.class);
public static final int PROTOCOL_NETSCAN = addProtocol(BusPacketNetScan.class);
}

View File

@ -1,41 +0,0 @@
package lordfokas.stargatetech2.api.bus;
import net.minecraft.world.World;
/**
* To be implemented by Tile Entities that wish
* to access the Abstract Bus.
*
* @author LordFokas
*/
public interface IBusDevice {
/**
* Returns the IBusInterfaces that exist on that
* side of the Tile Entity. It may be multiple
* values or null.
*
* @param side The side of the block that is being queried.
* @return This side's IBusInterface, if any.
*/
public IBusInterface[] getInterfaces(int side);
/**
* @return This device's worldObj.
*/
public World getWorld();
/**
* @return This device's X Coordinate.
*/
public int getXCoord();
/**
* @return This device's Y Coordinate.
*/
public int getYCoord();
/**
* @return This device's Z Coordinate.
*/
public int getZCoord();
}

View File

@ -1,65 +0,0 @@
package lordfokas.stargatetech2.api.bus;
/**
* This provides a level of abstraction over the IBusInterface.
* Implement to your own liking.
*
* @author LordFokas
*/
public interface IBusDriver {
/**
* Used to check if this device should receive a specific
* packet type from this sender. If true is returned,
* handlePacket() is called afterwards.
*
* @param sender The Bus address of the packet's sender.
* @param protocolID The unique ID of this packet type.
* @param hasLIP whether the packet can be converted to the LIP format or not.
* @return Whether the device will accept this packet or not.
*/
public boolean canHandlePacket(short sender, int protocolID, boolean hasLIP);
/**
* Called by the network to have this device handle a packet.
*
* @param packet The packet to be handled.
*/
public void handlePacket(BusPacket packet);
/**
* Used to make the IBusDriver give all packets in its send
* queue, one by one, to the IBusInterface so that it can
* send them accross the network.
*
* @return The next BusPacket in the queue, if any, null otherise.
*/
public BusPacket getNextPacketToSend();
/**
* Called by the hardware representation (IBusInterface)
* to check if it's active or not.
* Inactive interfaces cannot send or receive packets.
*
* @return Whether this interface is active or not.
*/
public boolean isInterfaceEnabled();
/**
* Called by this Driver's Interface to check it's own address.
*
* @return The address of this IBusDriver's IBusInterface.
*/
public short getInterfaceAddress();
/**
* @return this driver's short name.<br>
* Should be readable and indicate what kind of device it is.<br>
* <b>Example:</b> Shield Controller
*/
public String getShortName();
/**
* @return a short description of what this device is.
*/
public String getDescription();
}

View File

@ -1,35 +0,0 @@
package lordfokas.stargatetech2.api.bus;
import net.minecraft.nbt.NBTTagCompound;
/**
* <b>DO NOT IMPLEMENT THIS INTERFACE!</b> To get an instance use
* <i>StargateTechAPI.api().getFactory().getIBusInterface()</i>;
*
* @author LordFokas
*/
public interface IBusInterface {
/**
* Makes the IBusInterface call its IBusDriver's
* getNextPacketToSend() method repeatedly until it returns
* null. Every packet returned by that method will be sent
* across the network.
*/
public void sendAllPackets();
/**
* Serialize this object.
*
* @param nbt The tag compound where this object's data is.
* @param tag The name of the tag under which this object's data is stored.
*/
public void writeToNBT(NBTTagCompound nbt, String tag);
/**
* Unserialize this object.
*
* @param nbt The tag compound where this object's data is.
* @param tag The name of the tag under which this object's data is stored.
*/
public void readFromNBT(NBTTagCompound nbt, String tag);
}

View File

@ -1,82 +0,0 @@
package lordfokas.stargatetech2.api.stargate;
public class Address {
private Symbol[] symbols;
public static Address create(Symbol[] symbols){
try{
boolean used[] = new boolean[40];
if(symbols.length < 7) throw new Exception("Address too short: " + symbols.length);
if(symbols.length > 9) throw new Exception("Address too long: " + symbols.length);
for(int i = 0; i < used.length; i++){
used[i] = (i == 0);
}
for(Symbol symbol : symbols){
if(symbol == null || symbol == Symbol.VOID){
throw new Exception("Invalid Symbol.");
}
if(used[symbol.ordinal()]){
throw new Exception("Repeated Symbol.");
}
used[symbol.ordinal()] = true;
}
return new Address(symbols);
}catch(Exception e){
return null;
}
}
private Address(Symbol[] symbols){
this.symbols = symbols;
}
public int length(){
return symbols.length;
}
public Symbol getSymbol(int symbol){
if(symbol >= 0 && symbol < length()){
return symbols[symbol];
}else{
return Symbol.VOID;
}
}
@Override
public String toString(){
StringBuilder sb = new StringBuilder();
sb.append(getSymbol(0).toString());
sb.append(getSymbol(1).toString().toLowerCase());
sb.append(getSymbol(2).toString().toLowerCase());
sb.append(" ");
sb.append(getSymbol(3).toString());
sb.append(getSymbol(4).toString().toLowerCase());
sb.append(getSymbol(5).toString().toLowerCase());
sb.append(" ");
sb.append(getSymbol(6).toString());
sb.append(getSymbol(7).toString().toLowerCase());
sb.append(getSymbol(8).toString().toLowerCase());
return sb.toString();
}
@Override
public boolean equals(Object o){
if(o instanceof Address){
Address a = (Address) o;
if(a.length() == length()){
for(int i = 0; i < length(); i++){
if(symbols[i] != a.symbols[i]){
return false;
}
}
return true;
}
}
return false;
}
@Override
public int hashCode(){
return length();
}
}

View File

@ -1,22 +0,0 @@
package lordfokas.stargatetech2.api.stargate;
public enum DialError{
// Dialing Errors
SOURCE_ADDRESS_NOT_FOUND,
TARGET_ADDRESS_NOT_FOUND,
SOURCE_WORLD_NOT_FOUND,
TARGET_WORLD_NOT_FOUND,
CANNOT_DIAL_SAME_WORLD,
FAILED_CHUNKLOADING_SOURCE,
FAILED_CHUNKLOADING_TARGET,
SOURCE_GATE_NOT_FOUND,
TARGET_GATE_NOT_FOUND,
NOT_ENOUGH_POWER,
TARGET_GATE_BUSY,
SOURCE_GATE_BUSY,
// Logic
DIALING_EVENT_CANCELED,
SUCCESSFULLY_DIALED,
UNKNOWN_LOGIC_ERROR;
}

View File

@ -1,37 +0,0 @@
package lordfokas.stargatetech2.api.stargate;
import cpw.mods.fml.common.eventhandler.Cancelable;
public abstract class DialEvent extends StargateEvent {
public final Address sourceAddress;
public final Address destAddress;
public final int duration;
public DialEvent(Address src, Address dst, int dur) {
sourceAddress = src;
destAddress = dst;
duration = dur;
}
@Cancelable
public static class Pre extends DialEvent {
public Pre(Address src, Address dst, int dur) {
super(src, dst, dur);
}
}
public static class Success extends DialEvent {
public Success(Address src, Address dst, int dur) {
super(src, dst, dur);
}
}
public static class Error extends DialEvent {
public final DialError error;
public Error(Address src, Address dst, DialError error) {
super(src, dst, -1);
this.error = error;
}
}
}

View File

@ -1,21 +0,0 @@
package lordfokas.stargatetech2.api.stargate;
public interface IDynamicWorldLoader {
/**
* @param address The address we're creating a new world for.
* @return Whether or not this loader will create a new world for this non-existing address.
*/
public boolean willCreateWorldFor(Address address);
/**
* Actually create a new world for this address.
* <b>This world must not exist already!</b>
* Do not forget to use the seedingShip to place a stargate on this world, or the pending
* wormhole will not connect.
*
* @param address The address we're creating a new world for.
* @param seedingShip The IStargatePlacer we'll use to place our stargate.
*/
public void loadWorldFor(Address address, IStargatePlacer seedingShip);
}

View File

@ -1,80 +0,0 @@
package lordfokas.stargatetech2.api.stargate;
import net.minecraft.world.World;
public interface IStargateNetwork {
/**
* @return Whether the Stargate Network is loaded (working) or not.
*/
public boolean isLoaded();
/**
* @param address The string representation of an address. (e.g. "Proclarush Taonas At")
* @return an address object if the string is a valid address, null otherwise.
*/
public Address parseAddress(String address);
/**
* Checks if a given address exists in the network or not.
* (i.e., if this address maps to a physical Stargate)
*
* @param address the address we want to check.
* @return whether the address exists or not.
*/
public boolean addressExists(Address address);
/**
* Returns the address of the Stargate in a specific location if it exists or null otherwise.
*
* @param world The world the target Stargate is in.
* @param x The target Stargate's X coordinate.
* @param y The target Stargate's Y coordinate.
* @param z The target Stargate's Z coordinate.
* @return The Stargate's address, or null if the location doesn't contain a Stargate.
*/
public Address getAddressOf(World world, int x, int y, int z);
/**
* Returns the address of the Stargate nearest to the specified location, or null if there is no gate within the specified radius
* @param world The world the target Stargate is in.
* @param x The target Stargate's X coordinate.
* @param y The target Stargate's Y coordinate.
* @param z The target Stargate's Z coordinate.
* @param radius The maximum radius to look for a Stargate. Use -1 to search the whole world.
* @return The Stargate's address, or null if no Stargate was found
*/
public Address findNearestStargate(World world, int x, int y, int z, int radius);
/**
* Register a new IDynamicWorldLoader.
*
* @param dwl The IDynamicWorldLoader to register.
*/
public void registerDynamicWorldLoader(IDynamicWorldLoader dwl);
/**
* Unregister a known IDynamicWorldLoader.
*
* @param dwl The IDynamicWorldLoader to unregister.
*/
public void unregisterDynamicWorldLoader(IDynamicWorldLoader dwl);
/**
* Reserve an address prefix for your DWL.
* If a Stargate attempts to dial a world with that prefix,
* your DWL is given exclusivity in generating that world.
*
* @param dwl Your IDynamicWorldLoader
* @param prefix And array of exactly 3 non-null and non-void symbols representing a dimension.
* @return whether or not the prefix has been successfully reserved.
*/
public boolean reserveDimensionPrefix(IDynamicWorldLoader dwl, Symbol[] prefix);
/**
* Checks if the specified prefix is associated with a dimension or reserved by a {@link IDynamicWorldLoader}.
*
* @param prefix An array of exactly 3 non-null and non-void symbols representing a dimension.
* @return Whether or not the prefix is either used or reserved.
*/
public boolean prefixExists(Symbol[] prefix);
}

View File

@ -1,17 +0,0 @@
package lordfokas.stargatetech2.api.stargate;
import net.minecraft.world.World;
public interface IStargatePlacer {
/**
* Attempts to place a Stargate in the givel location.
*
* @param w Our world.
* @param x The stargate base's (bottom center block) X coord.
* @param y The stargate base's (bottom center block) Y coord.
* @param z The stargate base's (bottom center block) Z coord.
* @param facing The direction the stargate should be facing. Should be a value in [0 - 3].
* @return Whether the Stargate was placed or not.
*/
public boolean placeStargate(World w, int x, int y, int z, int facing);
}

View File

@ -1,16 +0,0 @@
package lordfokas.stargatetech2.api.stargate;
/**
* Represents a Stargate ring.
* Stargate "base" blocks contain the ring, so they implement this as well.
*
* All you can get from the Stargate ring is the address.
*
* @author LordFokas
*/
public interface ITileStargate {
/**
* @return This Stargate's address. null values are possible on the client side.
*/
public Address getAddress();
}

View File

@ -1,30 +0,0 @@
package lordfokas.stargatetech2.api.stargate;
/**
* Represents a Stargate base block (the block that supports the stargate).
*
* It contains all the important logic in the Stargate,
* like dialing, Iris control and power usage.
*
* Because the ring is inside the block that supports it, it is possible to
* call the same methods you can call on a ring.
*
* @see ITileStargate
*
* @author LordFokas
*/
public interface ITileStargateBase extends ITileStargate{
public enum DialMethod{
MANUAL, // Dialing Computers
AUTO // DHDs
}
/**
* Used to try making the Stargate dial an address.
*
* @param address The address this Stargate should dial.
* @param timeout How many seconds the connection will last. (1 - 38; default: 38);
* @return whether the dialing sequence started (true) or failed (false).
*/
public DialError dial(Address address, int timeout, DialMethod method);
}

View File

@ -1,38 +0,0 @@
package lordfokas.stargatetech2.api.stargate;
import cpw.mods.fml.common.eventhandler.Cancelable;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraft.world.World;
public abstract class StargateEvent extends Event {
private static abstract class PhysicalGateEvent extends StargateEvent {
public final Address address;
public final World world;
public final int xCoord;
public final int yCoord;
public final int zCoord;
public PhysicalGateEvent(Address addr, World world, int x, int y, int z) {
this.xCoord = x;
this.yCoord = y;
this.zCoord = z;
this.world = world;
this.address = addr;
}
}
@Cancelable
public static class StargateWrenched extends PhysicalGateEvent {
public StargateWrenched(Address addr, World world, int x, int y, int z) {
super(addr, world, x, y, z);
}
}
public static class StargateDestroyed extends PhysicalGateEvent {
public StargateDestroyed(Address addr, World world, int x, int y, int z) {
super(addr, world, x, y, z);
}
}
}

View File

@ -1,63 +0,0 @@
package lordfokas.stargatetech2.api.stargate;
public enum Symbol {
VOID(""),
AT ("At"), // 1
AL ("Al"), // 2
CLA ("Cla"), // 3
UR ("Ur"), // 4
ON ("On"), // 5
DEH ("Deh"), // 6
EC ("Ec"), // 7
MIG ("Mig"), // 8
AM ("Am"), // 9
RUM ("Rum"), // 10
AR ("Ar"), // 11
VA ("Va"), // 12
COR ("Cor"), // 13
PRA ("Pra"), // 14
OM ("Om"), // 15
ET ("Et"), // 16
AS ("As"), // 17
US ("Us"), // 18
GON ("Gon"), // 19
ORM ("Orm"), // 20
EM ("Em"), // 21
AC ("Ac"), // 22
OTH ("Oth"), // 23
LOS ("Los"), // 24
LAN ("Lan"), // 25
EST ("Est"), // 26
CRO ("Cro"), // 27
SIL ("Sil"), // 28
TA ("Ta"), // 29
BREI("Brei"), // 30
RUSH("Rush"), // 31
ERP ("Erp"), // 32
SET ("Set"), // 33
ULF ("Ulf"), // 34
PRO ("Pro"), // 35
SAL ("Sal"), // 36
TIS ("Tis"), // 37
MAC ("Mac"), // 38
IRT ("Irt"); // 39
private String name;
private Symbol(String name){
this.name = name;
}
public static Symbol get(int s){
if(s >= 0 && s <= 39){
return values()[s];
}else{
return VOID;
}
}
@Override
public String toString(){
return name;
}
}

View File

@ -1,28 +0,0 @@
package lordfokas.stargatetech2.api.world;
import net.minecraft.world.World;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.Event.HasResult;
@HasResult
public class EventWorldGen extends Event {
public final World world;
public final int chunkX;
public final int chunkZ;
public final GenType type;
public EventWorldGen(World world, int cX, int cZ, GenType type) {
this.world = world;
this.chunkX = cX;
this.chunkZ = cZ;
this.type = type;
}
public static enum GenType {
STARGATE,
LOOT_POD,
VEIN_NAQUADAH;
}
}

@ -1 +0,0 @@
Subproject commit 774135f441fd56f295d82069b251ee7e1e084869

View File

@ -21,20 +21,6 @@ class RobotAfterimage extends SimpleBlock with traits.SpecialBlock {
setCreativeTab(null)
NEI.hide(this)
// TODO remove
// private var icon: IIcon = _
//
// // ----------------------------------------------------------------------- //
//
// @SideOnly(Side.CLIENT)
// override def getIcon(side: EnumFacing, metadata: Int) = icon
//
// @SideOnly(Side.CLIENT)
// override def registerBlockIcons(iconRegister: IIconRegister) {
// super.registerBlockIcons(iconRegister)
// icon = iconRegister.getAtlasSprite(Settings.resourceDomain + ":GenericTop")
// }
override def shouldSideBeRendered(world: IBlockAccess, pos: BlockPos, side: EnumFacing) = false
override def isBlockSolid(world: IBlockAccess, pos: BlockPos, side: EnumFacing) = false

View File

@ -39,18 +39,6 @@ class RobotProxy extends RedstoneAware with traits.SpecialBlock {
// ----------------------------------------------------------------------- //
// TODO remove
// private var icon: IIcon = _
//
// @SideOnly(Side.CLIENT)
// override def registerBlockIcons(iconRegister: IIconRegister) {
// super.registerBlockIcons(iconRegister)
// icon = iconRegister.getAtlasSprite(Settings.resourceDomain + ":GenericTop")
// }
//
// @SideOnly(Side.CLIENT)
// override def getIcon(side: EnumFacing, metadata: Int) = icon
override def shouldSideBeRendered(world: IBlockAccess, pos: BlockPos, side: EnumFacing) = false
override def isBlockSolid(world: IBlockAccess, pos: BlockPos, side: EnumFacing) = false

View File

@ -169,35 +169,5 @@ class Delegator extends Item {
case _ => super.onUpdate(stack, world, player, slot, selected)
}
// TODO remove
// @SideOnly(Side.CLIENT)
// override def getIcon(stack: ItemStack, pass: Int) =
// subItem(stack) match {
// case Some(subItem) => subItem.icon(stack, pass) match {
// case Some(icon) => icon
// case _ => super.getIcon(stack, pass)
// }
// case _ => super.getIcon(stack, pass)
// }
//
// @SideOnly(Side.CLIENT)
// override def getIconIndex(stack: ItemStack) = getIcon(stack, 0)
//
// @SideOnly(Side.CLIENT)
// override def getIconFromDamage(damage: Int): IIcon =
// subItem(damage) match {
// case Some(subItem) => subItem.icon match {
// case Some(icon) => icon
// case _ => super.getIconFromDamage(damage)
// }
// case _ => super.getIconFromDamage(damage)
// }
//
// @SideOnly(Side.CLIENT)
// override def registerIcons(iconRegister: IIconRegister) {
// super.getAtlasSprites(iconRegister)
// subItems.foreach(_.getAtlasSprites(iconRegister))
// }
override def toString = getUnlocalizedName
}

View File

@ -21,22 +21,4 @@ class FloppyDisk(val parent: Delegator) extends Delegate {
}
super.tooltipLines(stack, player, tooltip, advanced)
}
// TODO remove
// val icons = Array.fill[Icon](16)(null)
//
// @SideOnly(Side.CLIENT)
// override def icon(stack: ItemStack, pass: Int) =
// if (stack.hasTagCompound && stack.getTagCompound.hasKey(Settings.namespace + "color"))
// Some(icons(stack.getTagCompound.getInteger(Settings.namespace + "color") max 0 min 15))
// else
// Some(icons(8))
//
// override def registerIcons(iconRegister: IconRegister) {
// val baseTextureName = Settings.resourceDomain + ":" + unlocalizedName + "_"
// Color.dyes.zipWithIndex.foreach {
// case (color, index) =>
// icons(index) = iconRegister.getAtlasSprite(baseTextureName + color)
// }
// }
}

View File

@ -24,9 +24,6 @@ import org.lwjgl.input
class SimpleItem extends Item {
setCreativeTab(CreativeTab)
// TODO remove
// iconString = Settings.resourceDomain + ":" + getClass.getSimpleName
def createItemStack(amount: Int = 1) = new ItemStack(this, amount)
override def isBookEnchantable(stack: ItemStack, book: ItemStack) = false

View File

@ -47,25 +47,6 @@ class Tablet(val parent: Delegator) extends Delegate {
override def maxStackSize = 1
// TODO remove
// private var iconOn: Option[Icon] = None
// private var iconOff: Option[Icon] = None
//
// @SideOnly(Side.CLIENT)
// override def icon(stack: ItemStack, pass: Int) = {
// if (stack.hasTagCompound) {
// val data = new ItemUtils.TabletData(stack)
// if (data.isRunning) iconOn else iconOff
// } else super.icon(stack, pass)
// }
//
// override def registerIcons(iconRegister: IconRegister) = {
// super.getAtlasSprites(iconRegister)
//
// iconOn = Option(iconRegister.getAtlasSprite(Settings.resourceDomain + ":TabletOn"))
// iconOff = Option(iconRegister.getAtlasSprite(Settings.resourceDomain + ":TabletOff"))
// }
// ----------------------------------------------------------------------- //
override def isDamageable = true

View File

@ -5,8 +5,8 @@ import codechicken.nei.api.API
import codechicken.nei.api.IConfigureNEI
import codechicken.nei.config.OptionToggleButton
import codechicken.nei.guihook.GuiContainerManager
import cpw.mods.fml.relauncher.Side
import cpw.mods.fml.relauncher.SideOnly
import net.minecraftforge.fml.relauncher.Side
import net.minecraftforge.fml.relauncher.SideOnly
import li.cil.oc.integration.util.NEI
import net.minecraft.item.ItemStack

View File

@ -1,9 +1,6 @@
package li.cil.oc.integration.util
/* TODO NEI
import codechicken.nei.LayoutManager
*/
import li.cil.oc.integration.Mods
import net.minecraft.block.Block
import net.minecraft.client.gui.inventory.GuiContainer
@ -14,26 +11,20 @@ import scala.collection.mutable
object NEI {
val hiddenBlocks = mutable.Set.empty[Block]
def isInputFocused = false
/* TODO NEI
def isInputFocused =
Mods.NotEnoughItems.isAvailable && (try isInputFocused0 catch {
case _: Throwable => false
})
private def isInputFocused0 = LayoutManager.getInputFocused != null
*/
def hoveredStack(container: GuiContainer, mouseX: Int, mouseY: Int): Option[ItemStack] = None
/* TODO NEI
def hoveredStack(container: GuiContainer, mouseX: Int, mouseY: Int): Option[ItemStack] =
if (Mods.NotEnoughItems.isAvailable) try Option(hoveredStack0(container, mouseX, mouseY)) catch {
case t: Throwable => None
}
else None
private def hoveredStack0(container: GuiContainer, mouseX: Int, mouseY: Int) = LayoutManager.instance.getStackUnderMouse(container, mouseX, mouseY)
*/
def hide(block: Block): Unit = if (Mods.NotEnoughItems.isAvailable) hiddenBlocks += block
}