Merge remote-tracking branch 'origin/master' into TDK
This commit is contained in:
commit
4f35ce0331
13 changed files with 112 additions and 85 deletions
|
@ -54,7 +54,20 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
|
|||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
@Mod(modid = "WarpDrive", name = "WarpDrive", version = "1.2.7.0",
|
||||
dependencies = "required-after:IC2; after:ComputerCraft; after:OpenComputer; after:CCTurtle; after:gregtech_addon; required-after:AppliedEnergistics; after:AdvancedSolarPanel; after:AtomicScience; after:ICBM|Explosion; after:MFFS; after:GraviSuite; after:UndergroundBiomes; after:NetherOres")
|
||||
dependencies = "required-after:IC2;"
|
||||
+ " required-after:CoFHCore;"
|
||||
+ " after:ComputerCraft;"
|
||||
+ " after:OpenComputer;"
|
||||
+ " after:CCTurtle;"
|
||||
+ " after:gregtech_addon;"
|
||||
+ " required-after:AppliedEnergistics;"
|
||||
+ " after:AdvancedSolarPanel;"
|
||||
+ " after:AtomicScience;"
|
||||
+ " after:ICBM|Explosion;"
|
||||
+ " after:MFFS;"
|
||||
+ " after:GraviSuite;"
|
||||
+ " after:UndergroundBiomes;"
|
||||
+ " after:NetherOres")
|
||||
@NetworkMod(clientSideRequired = true, serverSideRequired = true, channels = {
|
||||
"WarpDriveBeam",
|
||||
"WarpDriveFreq",
|
||||
|
@ -126,7 +139,7 @@ public class WarpDrive implements LoadingCallback {
|
|||
public int overlayType = 0;
|
||||
public String debugMessage = "";
|
||||
|
||||
public static WarpDrivePeripheralHandler peripheralHandler = new WarpDrivePeripheralHandler();
|
||||
public static WarpDrivePeripheralHandler peripheralHandler = null;
|
||||
|
||||
public static String defHelpStr = "help(\"functionName\"): returns help for the function specified";
|
||||
public static String defEnergyStr = "getEnergyLevel(): returns currently contained energy, max contained energy";
|
||||
|
@ -352,8 +365,11 @@ public class WarpDrive implements LoadingCallback {
|
|||
MinecraftForge.EVENT_BUS.register(new CameraOverlay(Minecraft.getMinecraft()));
|
||||
}
|
||||
|
||||
if (WarpDriveConfig.isCCLoaded) {
|
||||
peripheralHandler = new WarpDrivePeripheralHandler();
|
||||
ComputerCraftAPI.registerPeripheralProvider(peripheralHandler);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
|
@ -562,7 +578,7 @@ public class WarpDrive implements LoadingCallback {
|
|||
|
||||
// top = advancedCircuit, floppy, advancedCircuit
|
||||
// middle = advancedCircuit, advancedMachine, advancedCircuit
|
||||
// bottom = advancedCircuit, flux crystal, advancedCircuit
|
||||
// bottom = advancedCircuit, fluix crystal, advancedCircuit
|
||||
GameRegistry.addRecipe(new ItemStack(protocolBlock), "coc", "cmc", "cfc",
|
||||
'm', WarpDriveConfig.getIC2Item("advancedMachine"),
|
||||
'c', WarpDriveConfig.getIC2Item("advancedCircuit"),
|
||||
|
|
|
@ -10,7 +10,7 @@ public class WarpDrivePeripheralHandler implements IPeripheralProvider {
|
|||
public IPeripheral getPeripheral(World world, int x, int y, int z, int side) {
|
||||
// WarpDrive.debugPrint("Checking Peripheral at " + x + ", " + y + ", " + z);
|
||||
TileEntity te = world.getBlockTileEntity(x, y, z);
|
||||
if(te instanceof IPeripheral) {
|
||||
if (te instanceof IPeripheral && ((IPeripheral) te).getType() != null) {
|
||||
return (IPeripheral)te;
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -62,7 +62,7 @@ public class WarpCoresRegistry {
|
|||
ArrayList<TileEntityReactor> res = new ArrayList<TileEntityReactor>(registry.size());
|
||||
removeDeadCores();
|
||||
|
||||
printRegistry();
|
||||
// printRegistry();
|
||||
int radius2 = radius * radius;
|
||||
for (TileEntityReactor core : registry) {
|
||||
double dX = core.xCoord - x;
|
||||
|
|
|
@ -28,6 +28,7 @@ public class TileEntityCamera extends WarpInterfacedTE {
|
|||
private int packetSendTicks = 20;
|
||||
|
||||
public TileEntityCamera() {
|
||||
super();
|
||||
peripheralName = "camera";
|
||||
methodsArray = new String[] {
|
||||
"freq"
|
||||
|
|
|
@ -45,6 +45,7 @@ public class TileEntityCloakingDeviceCore extends WarpEnergyTE {
|
|||
private int soundTicks = 0;
|
||||
|
||||
public TileEntityCloakingDeviceCore() {
|
||||
super();
|
||||
peripheralName = "cloakingdevicecore";
|
||||
methodsArray = new String[] {
|
||||
"tier", // set field tier to 1 or 2, return field tier
|
||||
|
|
|
@ -61,6 +61,7 @@ public class TileEntityLaser extends WarpInterfacedTE {
|
|||
private int packetSendTicks = 20;
|
||||
|
||||
public TileEntityLaser() {
|
||||
super();
|
||||
peripheralName = "laser";
|
||||
methodsArray = new String[] {
|
||||
"emitBeam", // 0
|
||||
|
|
|
@ -32,6 +32,7 @@ public class TileEntityLift extends WarpEnergyTE {
|
|||
private int tickCount = 0;
|
||||
|
||||
public TileEntityLift() {
|
||||
super();
|
||||
peripheralName = "warpdriveLaserLift";
|
||||
methodsArray = new String[] {
|
||||
"getEnergyLevel",
|
||||
|
@ -219,22 +220,22 @@ public class TileEntityLift extends WarpEnergyTE {
|
|||
// ComputerCraft IPeripheral methods implementation
|
||||
@Override
|
||||
@Optional.Method(modid = "ComputerCraft")
|
||||
public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] args) throws Exception {
|
||||
public Object[] callMethod(IComputerAccess computer, ILuaContext context, int method, Object[] arguments) throws Exception {
|
||||
String methodName = methodsArray[method];
|
||||
if (methodName.equals("getEnergyLevel")) {
|
||||
return getEnergyLevel();
|
||||
|
||||
} else if (methodName.equals("mode")) {
|
||||
return mode(args);
|
||||
return mode(arguments);
|
||||
|
||||
} else if (methodName.equals("active")) {
|
||||
if (args.length == 1) {
|
||||
computerEnabled = toBool(args[0]);
|
||||
if (arguments.length == 1) {
|
||||
computerEnabled = toBool(arguments);
|
||||
}
|
||||
return new Object[] { computerEnabled ? false : isEnabled };
|
||||
|
||||
} else if (methodName.equals("help")) {
|
||||
return new Object[] { helpStr(args) };
|
||||
return new Object[] { helpStr(arguments) };
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -65,14 +65,15 @@ public class TileEntityMiningLaser extends WarpInterfacedTE implements IGridMach
|
|||
private int layerOffset = 1;
|
||||
|
||||
public TileEntityMiningLaser() {
|
||||
super();
|
||||
peripheralName = "mininglaser";
|
||||
methodsArray = new String[] {
|
||||
"mine", //0
|
||||
"stop", //1
|
||||
"isMining", //2
|
||||
"quarry", //3
|
||||
"state", //4
|
||||
"offset" //5
|
||||
"mine",
|
||||
"stop",
|
||||
"isMining",
|
||||
"quarry",
|
||||
"state",
|
||||
"offset"
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -744,6 +745,7 @@ public class TileEntityMiningLaser extends WarpInterfacedTE implements IGridMach
|
|||
|
||||
// ComputerCraft IPeripheral methods implementation
|
||||
@Override
|
||||
@Optional.Method(modid = "ComputerCraft")
|
||||
public void attach(IComputerAccess computer) {
|
||||
super.attach(computer);
|
||||
if (WarpDriveConfig.G_LUA_SCRIPTS != WarpDriveConfig.LUA_SCRIPTS_NONE) {
|
||||
|
|
|
@ -25,6 +25,7 @@ public class TileEntityMonitor extends WarpInterfacedTE {
|
|||
private int packetSendTicks = 20;
|
||||
|
||||
public TileEntityMonitor() {
|
||||
super();
|
||||
peripheralName = "monitor";
|
||||
methodsArray = new String[] {
|
||||
"freq"
|
||||
|
|
|
@ -52,6 +52,7 @@ public class TileEntityProtocol extends WarpInterfacedTE {
|
|||
private TileEntityReactor core = null;
|
||||
|
||||
public TileEntityProtocol() {
|
||||
super();
|
||||
peripheralName = "warpcore";
|
||||
methodsArray = new String[] {
|
||||
"dim_positive",
|
||||
|
|
|
@ -22,6 +22,7 @@ public class TileEntityRadar extends WarpEnergyTE {
|
|||
private int cooldownTime = 0;
|
||||
|
||||
public TileEntityRadar() {
|
||||
super();
|
||||
peripheralName = "radar";
|
||||
methodsArray = new String[] {
|
||||
"scanRadius",
|
||||
|
@ -43,9 +44,8 @@ public class TileEntityRadar extends WarpEnergyTE {
|
|||
if (getBlockMetadata() == 2) {
|
||||
cooldownTime++;
|
||||
if (cooldownTime > (20 * ((scanRadius / 1000) + 1))) {
|
||||
WarpDrive.debugPrint("" + this + " Scanning over " + scanRadius + " radius...");
|
||||
results = WarpDrive.warpCores.searchWarpCoresInRadius(xCoord, yCoord, zCoord, scanRadius);
|
||||
WarpDrive.debugPrint("" + this + " Scan found " + results.size() + " results");
|
||||
// WarpDrive.debugPrint("" + this + " Scan found " + results.size() + " results in " + scanRadius + " radius...");
|
||||
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 1, 1 + 2);
|
||||
cooldownTime = 0;
|
||||
}
|
||||
|
@ -145,6 +145,7 @@ public class TileEntityRadar extends WarpEnergyTE {
|
|||
|
||||
// ComputerCraft IPeripheral methods implementation
|
||||
@Override
|
||||
@Optional.Method(modid = "ComputerCraft")
|
||||
public void attach(IComputerAccess computer) {
|
||||
super.attach(computer);
|
||||
if (WarpDriveConfig.G_LUA_SCRIPTS != WarpDriveConfig.LUA_SCRIPTS_NONE) {
|
||||
|
@ -161,6 +162,7 @@ public class TileEntityRadar extends WarpEnergyTE {
|
|||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = "ComputerCraft")
|
||||
public void detach(IComputerAccess computer) {
|
||||
super.detach(computer);
|
||||
// worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 0, 1 + 2);
|
||||
|
|
|
@ -48,6 +48,7 @@ public class TileEntityShipScanner extends WarpEnergyTE {
|
|||
private int targetX, targetY, targetZ;
|
||||
|
||||
public TileEntityShipScanner() {
|
||||
super();
|
||||
peripheralName = "shipscanner";
|
||||
methodsArray = new String[] {
|
||||
"scan",
|
||||
|
|
|
@ -34,7 +34,7 @@ public abstract class WarpInterfacedTE extends WarpTE implements IPeripheral, En
|
|||
}
|
||||
|
||||
// Common computer properties
|
||||
protected String peripheralName = "notImplemented";
|
||||
protected String peripheralName = null;
|
||||
protected String[] methodsArray = {};
|
||||
|
||||
// OpenComputer specific properties
|
||||
|
|
Loading…
Reference in a new issue