Updated subs and add bc item loading
This commit is contained in:
parent
e5445d75d1
commit
2827565c7a
2 changed files with 54 additions and 7 deletions
|
@ -1,16 +1,24 @@
|
|||
package dark.library;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import basiccomponents.common.BasicComponents;
|
||||
import java.io.File;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import universalelectricity.core.UniversalElectricity;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import basiccomponents.common.BasicComponents;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import dark.library.effects.FXBeam;
|
||||
|
||||
public class DarkMain
|
||||
{
|
||||
private static boolean isInit = false;
|
||||
|
||||
|
||||
public static boolean runPowerLess = true;
|
||||
/* RESOURCE FILE PATHS */
|
||||
public static final String RESOURCE_PATH = "/mods/dark/";
|
||||
public static final String TEXTURE_DIRECTORY = RESOURCE_PATH + "textures/";
|
||||
|
@ -20,6 +28,10 @@ public class DarkMain
|
|||
public static final String MODEL_TEXTURE_DIRECTORY = TEXTURE_DIRECTORY + "models/";
|
||||
public static final String TEXTURE_NAME_PREFIX = "dark:";
|
||||
|
||||
public static final Configuration CONFIGURATION = new Configuration(new File(Loader.instance().getConfigDir(), "Dark/General.cfg"));
|
||||
|
||||
public static final Logger LOGGER = Logger.getLogger("Dark-Lib");
|
||||
|
||||
public static void renderBeam(World world, Vector3 position, Vector3 target, Color color, int age)
|
||||
{
|
||||
if (world.isRemote)
|
||||
|
@ -32,12 +44,42 @@ public class DarkMain
|
|||
{
|
||||
if (world.isRemote)
|
||||
{
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXBeam(world, position, target, Color.DARK_GRAY, DarkMain.TEXTURE_DIRECTORY + "traceStream.png", 5,true));
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(new FXBeam(world, position, target, Color.DARK_GRAY, DarkMain.TEXTURE_DIRECTORY + "traceStream.png", 5, true));
|
||||
}
|
||||
}
|
||||
|
||||
public void forceLoadBCItems(Object mod, String channel)
|
||||
|
||||
public static void forceLoadBCItems(Object mod, String channel)
|
||||
{
|
||||
BasicComponents.register(mod, channel);
|
||||
|
||||
if (!isInit)
|
||||
{
|
||||
// UniversalElectricity.CONFIGURATION.load();
|
||||
BasicComponents.requestItem("ingotCopper", 0);
|
||||
BasicComponents.requestItem("ingotTin", 0);
|
||||
|
||||
BasicComponents.requestBlock("oreCopper", 0);
|
||||
BasicComponents.requestBlock("oreTin", 0);
|
||||
|
||||
BasicComponents.requestItem("ingotSteel", 0);
|
||||
BasicComponents.requestItem("dustSteel", 0);
|
||||
BasicComponents.requestItem("plateSteel", 0);
|
||||
|
||||
BasicComponents.requestItem("ingotBronze", 0);
|
||||
BasicComponents.requestItem("dustBronze", 0);
|
||||
BasicComponents.requestItem("plateBronze", 0);
|
||||
|
||||
BasicComponents.requestBlock("copperWire", 0);
|
||||
|
||||
BasicComponents.requestItem("circuitBasic", 0);
|
||||
BasicComponents.requestItem("circuitAdvanced", 0);
|
||||
BasicComponents.requestItem("circuitElite", 0);
|
||||
|
||||
BasicComponents.requestItem("motor", 0);
|
||||
BasicComponents.registerInfiniteBattery(0);
|
||||
BasicComponents.registerBattery(0);
|
||||
|
||||
isInit = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ import com.google.common.io.ByteArrayDataInput;
|
|||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import dark.library.DarkMain;
|
||||
import dark.library.access.AccessLevel;
|
||||
import dark.library.access.UserAccess;
|
||||
import dark.library.access.interfaces.ISpecialAccess;
|
||||
|
@ -62,9 +63,13 @@ public abstract class TileEntityTerminal extends TileEntityUniversalRunnable imp
|
|||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
|
||||
if (DarkMain.runPowerLess)
|
||||
{
|
||||
this.wattsReceived += this.getRequest().getWatts();
|
||||
}
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
|
||||
if (this.playersUsing > 0)
|
||||
{
|
||||
if (this.ticks % 5 == 0)
|
||||
|
@ -207,7 +212,7 @@ public abstract class TileEntityTerminal extends TileEntityUniversalRunnable imp
|
|||
|
||||
public boolean canUserAccess(String username)
|
||||
{
|
||||
return(this.getUserAccess(username).ordinal() > AccessLevel.BASIC.ordinal());
|
||||
return (this.getUserAccess(username).ordinal() > AccessLevel.BASIC.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue