cleanup & formatting
This commit is contained in:
parent
d12fa0319c
commit
46acce1582
30 changed files with 39 additions and 40 deletions
|
@ -6,16 +6,16 @@ import dark.api.al.coding.args.ArgumentData;
|
||||||
|
|
||||||
/** The IUseable inteface is used by the ArmBot so that it may interact with Tile Entities. onUse
|
/** The IUseable inteface is used by the ArmBot so that it may interact with Tile Entities. onUse
|
||||||
* will be called on the block an ArmBot is touching whenever the USE command is run on it.
|
* will be called on the block an ArmBot is touching whenever the USE command is run on it.
|
||||||
*
|
*
|
||||||
* @author Briman0094 */
|
* @author Briman0094 */
|
||||||
public interface IArmbotUseable
|
public interface IArmbotUseable
|
||||||
{
|
{
|
||||||
|
|
||||||
/** Called when the ArmBot command "USE" is run. This is called on any IUseable the ArmBot is
|
/** Called when the ArmBot command "USE" is run. This is called on any IUseable the ArmBot is
|
||||||
* touching.
|
* touching.
|
||||||
*
|
*
|
||||||
* @param armbot - The Armbot instance.
|
* @param armbot - The Armbot instance.
|
||||||
*
|
*
|
||||||
* @return true if the use was completed correctly */
|
* @return true if the use was completed correctly */
|
||||||
public boolean onUse(IArmbot armbot, List<ArgumentData> list);
|
public boolean onUse(IArmbot armbot, List<ArgumentData> list);
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ import universalelectricity.core.vector.Vector2;
|
||||||
/** Flow chart style program. Each command in the program needs to have a stored location so it can
|
/** Flow chart style program. Each command in the program needs to have a stored location so it can
|
||||||
* be saved and loaded with its correct connections. Though the location only need to be a simple
|
* be saved and loaded with its correct connections. Though the location only need to be a simple
|
||||||
* Column and row based system.
|
* Column and row based system.
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @author DarkGuardsman */
|
||||||
public interface IProgram extends Cloneable
|
public interface IProgram extends Cloneable
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,12 +6,12 @@ import java.util.List;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
/** Used to both register task and fake machines for the encoder to use to create new programs.
|
/** Used to both register task and fake machines for the encoder to use to create new programs.
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @author DarkGuardsman */
|
||||||
public class TaskRegistry
|
public class TaskRegistry
|
||||||
{
|
{
|
||||||
/** A class of all available commands.
|
/** A class of all available commands.
|
||||||
*
|
*
|
||||||
* String - Command name. Command - The actual command class. */
|
* String - Command name. Command - The actual command class. */
|
||||||
private static final HashMap<String, ITask> COMMANDS = new HashMap();
|
private static final HashMap<String, ITask> COMMANDS = new HashMap();
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ public class TaskRegistry
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Do not edit the return or you will change the behavior of all machine that use this list
|
/** Do not edit the return or you will change the behavior of all machine that use this list
|
||||||
*
|
*
|
||||||
* @return The list of registered sudo machines for the encoder to check against */
|
* @return The list of registered sudo machines for the encoder to check against */
|
||||||
public static HashMap<String, IArmbot> getSudoMachines()
|
public static HashMap<String, IArmbot> getSudoMachines()
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@ import dark.api.save.ISaveObj;
|
||||||
import dark.api.save.NBTFileHelper;
|
import dark.api.save.NBTFileHelper;
|
||||||
|
|
||||||
/** Used to store arguments in a way that can be easier to read, limit, and understand
|
/** Used to store arguments in a way that can be easier to read, limit, and understand
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @author DarkGuardsman */
|
||||||
public class ArgumentData implements ISaveObj
|
public class ArgumentData implements ISaveObj
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ public class ArgumentData implements ISaveObj
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the value
|
/** Sets the value
|
||||||
*
|
*
|
||||||
* @return true if the value was accepted */
|
* @return true if the value was accepted */
|
||||||
public boolean setData(Object object)
|
public boolean setData(Object object)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@ import universalelectricity.core.electricity.ElectricityDisplay;
|
||||||
|
|
||||||
/** Used to create argument data for the encoder. Should only be used if the value needs to be
|
/** Used to create argument data for the encoder. Should only be used if the value needs to be
|
||||||
* clearly limited inside the encoder display.
|
* clearly limited inside the encoder display.
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @author DarkGuardsman */
|
||||||
public class ArgumentDoubleData extends ArgumentData
|
public class ArgumentDoubleData extends ArgumentData
|
||||||
{
|
{
|
||||||
|
|
|
@ -5,7 +5,7 @@ import universalelectricity.core.electricity.ElectricityDisplay;
|
||||||
|
|
||||||
/** Used to create argument data for the encoder. Should only be used if the value needs to be
|
/** Used to create argument data for the encoder. Should only be used if the value needs to be
|
||||||
* clearly limited inside the encoder display.
|
* clearly limited inside the encoder display.
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @author DarkGuardsman */
|
||||||
public class ArgumentFloatData extends ArgumentData
|
public class ArgumentFloatData extends ArgumentData
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraft.util.MathHelper;
|
||||||
|
|
||||||
/** Used to create argument data for the encoder. Should only be used if the value needs to be
|
/** Used to create argument data for the encoder. Should only be used if the value needs to be
|
||||||
* clearly limited inside the encoder display.
|
* clearly limited inside the encoder display.
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @author DarkGuardsman */
|
||||||
public class ArgumentIntData extends ArgumentData
|
public class ArgumentIntData extends ArgumentData
|
||||||
{
|
{
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class BlockArmbot extends BlockAssembly
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
||||||
{
|
{
|
||||||
|
|
|
@ -156,7 +156,7 @@ public class Program implements IProgram
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Move all tasks at the row and in the direction given.
|
/** Move all tasks at the row and in the direction given.
|
||||||
*
|
*
|
||||||
* @param row - row number or Y value of the position from the task
|
* @param row - row number or Y value of the position from the task
|
||||||
* @param up - true will move all the tasks up one, false will move all the tasks down one */
|
* @param up - true will move all the tasks up one, false will move all the tasks down one */
|
||||||
public void moveAll(int row, boolean up)
|
public void moveAll(int row, boolean up)
|
||||||
|
|
|
@ -197,6 +197,7 @@ public abstract class TaskBase implements ITask
|
||||||
return this.UV;
|
return this.UV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void getToolTips(List<String> list)
|
public void getToolTips(List<String> list)
|
||||||
{
|
{
|
||||||
list.add(this.getMethodName());
|
list.add(this.getMethodName());
|
||||||
|
|
|
@ -18,7 +18,7 @@ import dark.assembly.armbot.TaskBaseProcess;
|
||||||
import dark.core.helpers.ItemWorldHelper;
|
import dark.core.helpers.ItemWorldHelper;
|
||||||
|
|
||||||
/** Used by arms to break a specific block in a position.
|
/** Used by arms to break a specific block in a position.
|
||||||
*
|
*
|
||||||
* @author Calclavia */
|
* @author Calclavia */
|
||||||
public class TaskBreak extends TaskBaseArmbot
|
public class TaskBreak extends TaskBaseArmbot
|
||||||
{
|
{
|
||||||
|
@ -88,6 +88,4 @@ public class TaskBreak extends TaskBaseArmbot
|
||||||
return nbt;
|
return nbt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@ import dark.api.al.coding.IArmbot;
|
||||||
import dark.assembly.armbot.TaskBaseArmbot;
|
import dark.assembly.armbot.TaskBaseArmbot;
|
||||||
|
|
||||||
/** Prefab for grab based commands
|
/** Prefab for grab based commands
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @author DarkGuardsman */
|
||||||
public abstract class TaskGrabPrefab extends TaskBaseArmbot
|
public abstract class TaskGrabPrefab extends TaskBaseArmbot
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,7 +14,7 @@ import dark.assembly.armbot.TaskBaseProcess;
|
||||||
import dark.core.helpers.MathHelper;
|
import dark.core.helpers.MathHelper;
|
||||||
|
|
||||||
/** Rotates an armbot by a set amount
|
/** Rotates an armbot by a set amount
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @author DarkGuardsman */
|
||||||
public class TaskRotateBy extends TaskBaseArmbot
|
public class TaskRotateBy extends TaskBaseArmbot
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,7 +14,7 @@ import dark.assembly.armbot.TaskBaseProcess;
|
||||||
import dark.core.helpers.MathHelper;
|
import dark.core.helpers.MathHelper;
|
||||||
|
|
||||||
/** Rotates the armbot to a specific direction. If not specified, it will turn right.
|
/** Rotates the armbot to a specific direction. If not specified, it will turn right.
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @author DarkGuardsman */
|
||||||
public class TaskRotateTo extends TaskBaseArmbot
|
public class TaskRotateTo extends TaskBaseArmbot
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package dark.assembly.client.gui;
|
package dark.assembly.client.gui;
|
||||||
|
|
||||||
/** Used to reference icons in the gui coder sheet
|
/** Used to reference icons in the gui coder sheet
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @author DarkGuardsman */
|
||||||
public enum EnumTaskIcon
|
public enum EnumTaskIcon
|
||||||
{
|
{
|
||||||
|
|
|
@ -218,8 +218,8 @@ public class GuiEditTask extends GuiBase implements IMessageBoxDialog
|
||||||
protected void drawForegroundLayer(int var2, int var3, float var1)
|
protected void drawForegroundLayer(int var2, int var3, float var1)
|
||||||
{
|
{
|
||||||
this.fontRenderer.drawString("Edit Task", (int) (this.guiSize.intX() / 2 - 7 * 2.5), 5, 4210752);
|
this.fontRenderer.drawString("Edit Task", (int) (this.guiSize.intX() / 2 - 7 * 2.5), 5, 4210752);
|
||||||
this.fontRenderer.drawString("Task: " + "\u00a77" + this.task.getMethodName(), (int) ((this.guiSize.intX() / 2) - 70), 20, 4210752);
|
this.fontRenderer.drawString("Task: " + "\u00a77" + this.task.getMethodName(), ((this.guiSize.intX() / 2) - 70), 20, 4210752);
|
||||||
this.fontRenderer.drawString("----Task Arguments---- ", (int) ((this.guiSize.intX() / 2) - 70), 50, 4210752);
|
this.fontRenderer.drawString("----Task Arguments---- ", ((this.guiSize.intX() / 2) - 70), 50, 4210752);
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if (task.getArgs() != null)
|
if (task.getArgs() != null)
|
||||||
|
@ -227,14 +227,14 @@ public class GuiEditTask extends GuiBase implements IMessageBoxDialog
|
||||||
for (ArgumentData arg : task.getArgs())
|
for (ArgumentData arg : task.getArgs())
|
||||||
{
|
{
|
||||||
i++;
|
i++;
|
||||||
this.fontRenderer.drawString(arg.getName() + ":", (int) ((this.guiSize.intX() / 2) - 70), 45 + (i * this.ySpacing), 4210752);
|
this.fontRenderer.drawString(arg.getName() + ":", ((this.guiSize.intX() / 2) - 70), 45 + (i * this.ySpacing), 4210752);
|
||||||
this.fontRenderer.drawString(arg.warning(), (int) ((this.guiSize.intX() / 2) + 11), 45 + (i * this.ySpacing), 4210752);
|
this.fontRenderer.drawString(arg.warning(), ((this.guiSize.intX() / 2) + 11), 45 + (i * this.ySpacing), 4210752);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this.fontRenderer.drawString("\u00a77" + " No editable args ", (int) ((this.guiSize.intX() / 2) - 70), 70, 4210752);
|
this.fontRenderer.drawString("\u00a77" + " No editable args ", ((this.guiSize.intX() / 2) - 70), 70, 4210752);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,7 +166,7 @@ public class GuiEncoderCoder extends GuiEncoderBase
|
||||||
{
|
{
|
||||||
this.helpMessage = "";
|
this.helpMessage = "";
|
||||||
}
|
}
|
||||||
this.fontRenderer.drawString(this.helpMessage, (int) (this.xSize / 2 - 82), 150, 4210752);
|
this.fontRenderer.drawString(this.helpMessage, (this.xSize / 2 - 82), 150, 4210752);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,6 @@ public class GuiEncoderInventory extends GuiEncoderBase
|
||||||
|
|
||||||
int containerWidth = (this.width - this.xSize) / 2;
|
int containerWidth = (this.width - this.xSize) / 2;
|
||||||
int containerHeight = (this.height - this.ySize) / 2;
|
int containerHeight = (this.height - this.ySize) / 2;
|
||||||
this.drawTexturedModalRect(containerWidth, containerHeight-10, 0, 0, this.xSize, this.ySize);
|
this.drawTexturedModalRect(containerWidth, containerHeight - 10, 0, 0, this.xSize, this.ySize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ import dark.assembly.machine.encoder.TileEntityEncoder;
|
||||||
import dark.core.interfaces.IScroll;
|
import dark.core.interfaces.IScroll;
|
||||||
|
|
||||||
/** Not a gui itself but a component used to display task as a box inside of a gui
|
/** Not a gui itself but a component used to display task as a box inside of a gui
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @author DarkGuardsman */
|
||||||
public class GuiTaskList extends Gui implements IScroll
|
public class GuiTaskList extends Gui implements IScroll
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,10 +31,10 @@ public class RenderCrate extends TileEntitySpecialRenderer
|
||||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8)
|
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float var8)
|
||||||
{
|
{
|
||||||
Vector3 vec = new Vector3(x, y, z);
|
Vector3 vec = new Vector3(x, y, z);
|
||||||
double distance = vec.distance(new Vector3(0, 0, 0));
|
double distance = vec.distance(new Vector3(0, 0, 0));
|
||||||
if (tileEntity instanceof TileEntityCrate)
|
if (tileEntity instanceof TileEntityCrate)
|
||||||
{
|
{
|
||||||
|
|
||||||
TileEntityCrate tileCrate = (TileEntityCrate) tileEntity;
|
TileEntityCrate tileCrate = (TileEntityCrate) tileEntity;
|
||||||
|
|
||||||
RenderItem renderItem = ((RenderItem) RenderManager.instance.getEntityClassRenderObject(EntityItem.class));
|
RenderItem renderItem = ((RenderItem) RenderManager.instance.getEntityClassRenderObject(EntityItem.class));
|
||||||
|
|
|
@ -151,7 +151,7 @@ public class BlockImprinter extends BlockAssembly
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
||||||
{
|
{
|
||||||
|
|
|
@ -193,7 +193,7 @@ public class TileEntityImprinter extends TileEntityAdvanced implements ISidedInv
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Construct an InventoryCrafting Matrix on the fly.
|
/** Construct an InventoryCrafting Matrix on the fly.
|
||||||
*
|
*
|
||||||
* @return */
|
* @return */
|
||||||
public InventoryCrafting getCraftingMatrix()
|
public InventoryCrafting getCraftingMatrix()
|
||||||
{
|
{
|
||||||
|
|
|
@ -180,7 +180,7 @@ public class BlockDetector extends BlockImprintable
|
||||||
{
|
{
|
||||||
return isProvidingStrongPower(world, x, y, z, direction);
|
return isProvidingStrongPower(world, x, y, z, direction);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
||||||
{
|
{
|
||||||
|
|
|
@ -87,7 +87,7 @@ public class BlockManipulator extends BlockImprintable
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,6 +29,7 @@ public class BlockRejector extends BlockImprintable
|
||||||
{
|
{
|
||||||
super(new BlockBuildData(BlockRejector.class, "rejector", UniversalElectricity.machine));
|
super(new BlockBuildData(BlockRejector.class, "rejector", UniversalElectricity.machine));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@ import dark.core.prefab.tilenetwork.NetworkTileEntities;
|
||||||
|
|
||||||
/** A class to be inherited by all machines on the assembly line. This class acts as a single peace
|
/** A class to be inherited by all machines on the assembly line. This class acts as a single peace
|
||||||
* in a network of similar tiles allowing all to share power from one or more sources
|
* in a network of similar tiles allowing all to share power from one or more sources
|
||||||
*
|
*
|
||||||
* @author DarkGuardsman */
|
* @author DarkGuardsman */
|
||||||
public abstract class TileEntityAssembly extends TileEntityEnergyMachine implements INetworkEnergyPart
|
public abstract class TileEntityAssembly extends TileEntityEnergyMachine implements INetworkEnergyPart
|
||||||
{
|
{
|
||||||
|
|
|
@ -257,7 +257,7 @@ public class BlockConveyor extends BlockAssembly
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void getClientTileEntityRenderers(List<Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer>> list)
|
public void getClientTileEntityRenderers(List<Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer>> list)
|
||||||
|
|
|
@ -337,7 +337,7 @@ public class BlockConveyorBelt extends BlockAssembly
|
||||||
{
|
{
|
||||||
list.add(new Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer>(TileEntityConveyorBelt.class, new RenderConveyorBelt()));
|
list.add(new Pair<Class<? extends TileEntity>, TileEntitySpecialRenderer>(TileEntityConveyorBelt.class, new RenderConveyorBelt()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
||||||
{
|
{
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class BlockEncoder extends BlockAssembly
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
public void getTileEntities(int blockID, Set<Pair<String, Class<? extends TileEntity>>> list)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,7 +16,6 @@ import dark.core.interfaces.IInvBox;
|
||||||
import dark.core.network.PacketHandler;
|
import dark.core.network.PacketHandler;
|
||||||
import dark.core.prefab.invgui.InvChest;
|
import dark.core.prefab.invgui.InvChest;
|
||||||
import dark.core.prefab.machine.TileEntityEnergyMachine;
|
import dark.core.prefab.machine.TileEntityEnergyMachine;
|
||||||
import dark.core.prefab.machine.TileEntityMachine.SimplePacketTypes;
|
|
||||||
|
|
||||||
/** Basic A -> B recipe processor machine designed mainly to handle ore blocks
|
/** Basic A -> B recipe processor machine designed mainly to handle ore blocks
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue