Updated SGT2 API.

This commit is contained in:
Florian Nücke 2014-10-31 00:17:01 +01:00
parent 342b4f7f14
commit 24e81bf2be
31 changed files with 82 additions and 50 deletions

View File

@ -1,8 +1,8 @@
package stargatetech2.api;
package lordfokas.stargatetech2.api;
import stargatetech2.api.bus.IBusDevice;
import stargatetech2.api.bus.IBusDriver;
import stargatetech2.api.bus.IBusInterface;
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

View File

@ -1,4 +1,4 @@
package stargatetech2.api;
package lordfokas.stargatetech2.api;
import java.util.Collection;

View File

@ -1,9 +1,9 @@
package stargatetech2.api;
package lordfokas.stargatetech2.api;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraftforge.fluids.Fluid;
import stargatetech2.api.stargate.IStargateNetwork;
import stargatetech2.api.stargate.IStargatePlacer;
import lordfokas.stargatetech2.api.stargate.IStargateNetwork;
import lordfokas.stargatetech2.api.stargate.IStargatePlacer;
public interface IStargateTechAPI {
/**
@ -30,9 +30,4 @@ public interface IStargateTechAPI {
* @return The current IFactory instance.
*/
public IFactory getFactory();
/**
* @return The current IStackManager instance.
*/
public IStackManager getStackManager();
}

View File

@ -1,4 +1,4 @@
package stargatetech2.api;
package lordfokas.stargatetech2.api;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.world.World;

View File

@ -1,4 +1,4 @@
package stargatetech2.api;
package lordfokas.stargatetech2.api;
public abstract class StargateTechAPI implements IStargateTechAPI {
protected static IStargateTechAPI apiInstance;

View File

@ -1,7 +1,7 @@
package stargatetech2.api.bus;
package lordfokas.stargatetech2.api.bus;
import net.minecraft.world.World;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraft.world.World;
public class BusEvent extends Event{
public final World world;

View File

@ -1,4 +1,4 @@
package stargatetech2.api.bus;
package lordfokas.stargatetech2.api.bus;
import java.util.LinkedList;

View File

@ -1,4 +1,4 @@
package stargatetech2.api.bus;
package lordfokas.stargatetech2.api.bus;
import java.util.ArrayList;
import java.util.Hashtable;

View File

@ -1,4 +1,4 @@
package stargatetech2.api.bus;
package lordfokas.stargatetech2.api.bus;
import java.util.LinkedList;

View File

@ -1,4 +1,4 @@
package stargatetech2.api.bus;
package lordfokas.stargatetech2.api.bus;
import java.util.ArrayList;

View File

@ -1,4 +1,4 @@
package stargatetech2.api.bus;
package lordfokas.stargatetech2.api.bus;
import net.minecraft.world.World;

View File

@ -1,4 +1,4 @@
package stargatetech2.api.bus;
package lordfokas.stargatetech2.api.bus;
/**
* This provides a level of abstraction over the IBusInterface.

View File

@ -1,4 +1,4 @@
package stargatetech2.api.bus;
package lordfokas.stargatetech2.api.bus;
import net.minecraft.nbt.NBTTagCompound;

View File

@ -1,4 +1,4 @@
package stargatetech2.api.stargate;
package lordfokas.stargatetech2.api.stargate;
public class Address {
private Symbol[] symbols;

View File

@ -1,4 +1,4 @@
package stargatetech2.api.stargate;
package lordfokas.stargatetech2.api.stargate;
public enum DialError{
// Dialing Errors

View File

@ -1,10 +1,8 @@
package stargatetech2.api.stargate;
package lordfokas.stargatetech2.api.stargate;
import cpw.mods.fml.common.eventhandler.Cancelable;
import cpw.mods.fml.common.eventhandler.Event;
public abstract class DialEvent extends Event {
public abstract class DialEvent extends StargateEvent {
public final Address sourceAddress;
public final Address destAddress;
public final int duration;

View File

@ -1,4 +1,4 @@
package stargatetech2.api.stargate;
package lordfokas.stargatetech2.api.stargate;
public interface IDynamicWorldLoader {

View File

@ -1,4 +1,4 @@
package stargatetech2.api.stargate;
package lordfokas.stargatetech2.api.stargate;
import net.minecraft.world.World;

View File

@ -1,4 +1,4 @@
package stargatetech2.api.stargate;
package lordfokas.stargatetech2.api.stargate;
import net.minecraft.world.World;

View File

@ -1,4 +1,4 @@
package stargatetech2.api.stargate;
package lordfokas.stargatetech2.api.stargate;
/**
* Represents a Stargate ring.

View File

@ -1,4 +1,4 @@
package stargatetech2.api.stargate;
package lordfokas.stargatetech2.api.stargate;
/**
* Represents a Stargate base block (the block that supports the stargate).

View File

@ -0,0 +1,38 @@
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,4 +1,4 @@
package stargatetech2.api.stargate;
package lordfokas.stargatetech2.api.stargate;
public enum Symbol {
VOID(""),

View File

@ -1,9 +1,10 @@
package stargatetech2.api.world;
package lordfokas.stargatetech2.api.world;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraft.world.World;
import cpw.mods.fml.common.eventhandler.Event;
import cpw.mods.fml.common.eventhandler.Event.HasResult;
@Event.HasResult
@HasResult
public class EventWorldGen extends Event {
public final World world;

View File

@ -27,7 +27,7 @@ import net.minecraft.nbt.NBTTagString
import net.minecraftforge.common.util.Constants.NBT
import net.minecraftforge.common.util.ForgeDirection
import net.minecraftforge.event.world.WorldEvent
import stargatetech2.api.bus.IBusDevice
import lordfokas.stargatetech2.api.bus.IBusDevice
import scala.collection.mutable

View File

@ -10,9 +10,9 @@ import li.cil.oc.integration.util.StargateTech2
import li.cil.oc.server.component
import li.cil.oc.server.{PacketSender => ServerPacketSender}
import net.minecraft.nbt.NBTTagCompound
import stargatetech2.api.StargateTechAPI
import stargatetech2.api.bus.IBusDevice
import stargatetech2.api.bus.IBusInterface
import lordfokas.stargatetech2.api.StargateTechAPI
import lordfokas.stargatetech2.api.bus.IBusDevice
import lordfokas.stargatetech2.api.bus.IBusInterface
// IMPORTANT: for some reason that is beyond me we cannot implement the
// IBusDevice here directly, since we'll get an error if the interface is not

View File

@ -26,7 +26,7 @@ import net.minecraft.nbt.NBTTagCompound
import net.minecraft.nbt.NBTTagString
import net.minecraftforge.common.util.Constants.NBT
import net.minecraftforge.common.util.ForgeDirection
import stargatetech2.api.bus.IBusDevice
import lordfokas.stargatetech2.api.bus.IBusDevice
import scala.collection.mutable

View File

@ -3,7 +3,7 @@ package li.cil.oc.integration.stargatetech2
import java.util
import li.cil.oc.api
import stargatetech2.api.bus.BusPacketNetScan
import lordfokas.stargatetech2.api.bus.BusPacketNetScan
import scala.collection.convert.WrapAsScala._

View File

@ -9,7 +9,7 @@ import li.cil.oc.integration.Mods
import li.cil.oc.integration.opencomputers.Item
import li.cil.oc.server.component
import net.minecraft.item.ItemStack
import stargatetech2.api.bus.IBusDevice
import lordfokas.stargatetech2.api.bus.IBusDevice
object DriverAbstractBusCard extends Item with HostAware with EnvironmentAware {
override def worksWith(stack: ItemStack) =

View File

@ -2,8 +2,8 @@ package li.cil.oc.integration.util
import net.minecraft.world.World
import net.minecraftforge.common.MinecraftForge
import stargatetech2.api.bus.BusEvent.AddToNetwork
import stargatetech2.api.bus.BusEvent.RemoveFromNetwork
import lordfokas.stargatetech2.api.bus.BusEvent.AddToNetwork
import lordfokas.stargatetech2.api.bus.BusEvent.RemoveFromNetwork
object StargateTech2 {
def addDevice(world: World, x: Int, y: Int, z: Int) = MinecraftForge.EVENT_BUS.post(new AddToNetwork(world, x, y, z))

View File

@ -8,8 +8,8 @@ import li.cil.oc.api.machine.Context
import li.cil.oc.api.network._
import li.cil.oc.api.prefab
import net.minecraft.nbt.NBTTagCompound
import stargatetech2.api.StargateTechAPI
import stargatetech2.api.bus._
import lordfokas.stargatetech2.api.StargateTechAPI
import lordfokas.stargatetech2.api.bus._
import scala.collection.convert.WrapAsScala._