Task renaming

This commit is contained in:
DarkGuardsman 2013-10-18 21:04:40 -04:00
parent 04b1712f54
commit 932dbe8b7e
16 changed files with 57 additions and 78 deletions

View file

@ -66,7 +66,7 @@ public class GrabDictionary
} }
/** gets the name of the Entity /** gets the name of the Entity
* *
* @return "" if null */ * @return "" if null */
public String getName() public String getName()
{ {
@ -78,7 +78,7 @@ public class GrabDictionary
} }
/** gets the Entity Class /** gets the Entity Class
* *
* @return Entity.class if null */ * @return Entity.class if null */
public Class<? extends Entity> getEntityClass() public Class<? extends Entity> getEntityClass()
{ {
@ -107,27 +107,5 @@ public class GrabDictionary
} }
} }
static
{
registerGrabableEntity("chicken", EntityChicken.class);
registerGrabableEntity("cow", EntityCow.class);
registerGrabableEntity("sheep", EntitySheep.class);
registerGrabableEntity("pig", EntityPig.class);
registerGrabableEntity("player", EntityPlayer.class);
registerGrabableEntity("zombie", EntityZombie.class);
registerGrabableEntity("zomb", EntityZombie.class);
registerGrabableEntity("skeleton", EntitySkeleton.class);
registerGrabableEntity("skel", EntitySkeleton.class);
registerGrabableEntity("animal", EntityAnimal.class);
registerGrabableEntity("monster", EntityMob.class);
registerGrabableEntity("mob", EntityMob.class);
registerGrabableEntity("creeper", EntityCreeper.class);
registerGrabableEntity("spider", EntitySpider.class);
registerGrabableEntity("slime", EntitySlime.class);
registerGrabableEntity("items", EntityItem.class);
registerGrabableEntity("all", Entity.class);
registerGrabableEntity("everything", Entity.class);
registerGrabableEntity("boat", EntityBoat.class);
registerGrabableEntity("cart", EntityMinecart.class);
}
} }

View file

@ -20,17 +20,17 @@ import dark.core.prefab.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 CommandBreak extends TaskBaseArmbot public class TaskBreak extends TaskBaseArmbot
{ {
protected int breakTicks = 30; protected int breakTicks = 30;
protected boolean keep = false; protected boolean keep = false;
public CommandBreak() public TaskBreak()
{ {
this("break"); this("break");
} }
public CommandBreak(String name) public TaskBreak(String name)
{ {
super(name); super(name);
this.breakTicks = 30; this.breakTicks = 30;
@ -71,7 +71,7 @@ public class CommandBreak extends TaskBaseArmbot
@Override @Override
public TaskBaseProcess clone() public TaskBaseProcess clone()
{ {
return new CommandBreak(); return new TaskBreak();
} }
@Override @Override

View file

@ -4,9 +4,9 @@ import dark.api.al.coding.IArmbot;
import dark.assembly.common.armbot.TaskBaseArmbot; import dark.assembly.common.armbot.TaskBaseArmbot;
import dark.assembly.common.armbot.TaskBaseProcess; import dark.assembly.common.armbot.TaskBaseProcess;
public class CommandDrop extends TaskBaseArmbot public class TaskDrop extends TaskBaseArmbot
{ {
public CommandDrop() public TaskDrop()
{ {
super("drop"); super("drop");
} }
@ -24,7 +24,7 @@ public class CommandDrop extends TaskBaseArmbot
@Override @Override
public TaskBaseProcess clone() public TaskBaseProcess clone()
{ {
return new CommandDrop(); return new TaskDrop();
} }
} }

View file

@ -20,7 +20,7 @@ import dark.api.al.coding.args.ArgumentFloatData;
import dark.assembly.common.armbot.TaskBaseArmbot; import dark.assembly.common.armbot.TaskBaseArmbot;
import dark.assembly.common.armbot.TaskBaseProcess; import dark.assembly.common.armbot.TaskBaseProcess;
public class CommandFire extends TaskBaseArmbot public class TaskFire extends TaskBaseArmbot
{ {
private static final float MIN_ACTUAL_PITCH = -80; private static final float MIN_ACTUAL_PITCH = -80;
@ -31,7 +31,7 @@ public class CommandFire extends TaskBaseArmbot
private float velocity; private float velocity;
private Vector3 finalVelocity; private Vector3 finalVelocity;
public CommandFire() public TaskFire()
{ {
super("throw"); super("throw");
this.defautlArguments.add(new ArgumentFloatData("velocity", 1.0f, 2.5f, 1.0f)); this.defautlArguments.add(new ArgumentFloatData("velocity", 1.0f, 2.5f, 1.0f));
@ -195,6 +195,6 @@ public class CommandFire extends TaskBaseArmbot
@Override @Override
public TaskBaseProcess clone() public TaskBaseProcess clone()
{ {
return new CommandFire(); return new TaskFire();
} }
} }

View file

@ -21,13 +21,13 @@ import dark.assembly.common.armbot.TaskBaseProcess;
import dark.assembly.common.machine.InvInteractionHelper; import dark.assembly.common.machine.InvInteractionHelper;
import dark.core.prefab.helpers.MathHelper; import dark.core.prefab.helpers.MathHelper;
public class CommandGive extends TaskBaseArmbot public class TaskGive extends TaskBaseArmbot
{ {
private ItemStack stack; private ItemStack stack;
private int ammount = -1; private int ammount = -1;
public CommandGive() public TaskGive()
{ {
super("give"); super("give");
this.defautlArguments.add(new ArgumentIntData("blockID", -1, Block.blocksList.length - 1, -1)); this.defautlArguments.add(new ArgumentIntData("blockID", -1, Block.blocksList.length - 1, -1));
@ -113,7 +113,7 @@ public class CommandGive extends TaskBaseArmbot
@Override @Override
public TaskBaseProcess clone() public TaskBaseProcess clone()
{ {
return new CommandGive(); return new TaskGive();
} }
@Override @Override

View file

@ -17,7 +17,7 @@ import dark.api.al.coding.args.ArgumentListData;
import dark.assembly.common.armbot.GrabDictionary; import dark.assembly.common.armbot.GrabDictionary;
import dark.assembly.common.armbot.TaskBaseProcess; import dark.assembly.common.armbot.TaskBaseProcess;
public class CommandGrabEntity extends CommandGrabPrefab public class TaskGrabEntity extends TaskGrabPrefab
{ {
/** If the grab command is specific to one entity this tell whether or not to grab the child /** If the grab command is specific to one entity this tell whether or not to grab the child
* version of that entity. */ * version of that entity. */
@ -26,7 +26,7 @@ public class CommandGrabEntity extends CommandGrabPrefab
private Class<? extends Entity> entityToInclude; private Class<? extends Entity> entityToInclude;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public CommandGrabEntity() public TaskGrabEntity()
{ {
super("Grab-Entity"); super("Grab-Entity");
this.defautlArguments.add(new ArgumentData("child", false)); this.defautlArguments.add(new ArgumentData("child", false));
@ -69,6 +69,7 @@ public class CommandGrabEntity extends CommandGrabPrefab
{ {
return ProcessReturn.DONE; return ProcessReturn.DONE;
} }
@SuppressWarnings("unchecked")
List<Entity> found = this.program.getMachine().getLocation().left().getEntitiesWithinAABB(entityToInclude, AxisAlignedBB.getBoundingBox(this.armPos.x - radius, this.armPos.y - radius, this.armPos.z - radius, this.armPos.x + radius, this.armPos.y + radius, this.armPos.z + radius)); List<Entity> found = this.program.getMachine().getLocation().left().getEntitiesWithinAABB(entityToInclude, AxisAlignedBB.getBoundingBox(this.armPos.x - radius, this.armPos.y - radius, this.armPos.z - radius, this.armPos.x + radius, this.armPos.y + radius, this.armPos.z + radius));
if (found != null && found.size() > 0) if (found != null && found.size() > 0)
@ -130,7 +131,7 @@ public class CommandGrabEntity extends CommandGrabPrefab
@Override @Override
public TaskBaseProcess clone() public TaskBaseProcess clone()
{ {
return new CommandGrabEntity(); return new TaskGrabEntity();
} }
} }

View file

@ -16,11 +16,11 @@ import dark.api.al.coding.IProgrammableMachine;
import dark.api.al.coding.args.ArgumentIntData; import dark.api.al.coding.args.ArgumentIntData;
import dark.assembly.common.armbot.TaskBaseProcess; import dark.assembly.common.armbot.TaskBaseProcess;
public class CommandGrabItem extends CommandGrabPrefab public class TaskGrabItem extends TaskGrabPrefab
{ {
ItemStack stack = null; ItemStack stack = null;
public CommandGrabItem() public TaskGrabItem()
{ {
super("Grab-Item"); super("Grab-Item");
this.defautlArguments.add(new ArgumentIntData("blockID", -1, Block.blocksList.length - 1, -1)); this.defautlArguments.add(new ArgumentIntData("blockID", -1, Block.blocksList.length - 1, -1));
@ -81,6 +81,6 @@ public class CommandGrabItem extends CommandGrabPrefab
@Override @Override
public TaskBaseProcess clone() public TaskBaseProcess clone()
{ {
return new CommandGrabItem(); return new TaskGrabItem();
} }
} }

View file

@ -12,13 +12,13 @@ import dark.assembly.common.armbot.TaskBaseArmbot;
/** Prefab for grab based commands /** Prefab for grab based commands
* *
* @author DarkGuardsman */ * @author DarkGuardsman */
public abstract class CommandGrabPrefab extends TaskBaseArmbot public abstract class TaskGrabPrefab extends TaskBaseArmbot
{ {
public static final float radius = 0.5f; public static final float radius = 0.5f;
protected Vector3 armPos; protected Vector3 armPos;
protected IBelt belt; protected IBelt belt;
public CommandGrabPrefab(String name) public TaskGrabPrefab(String name)
{ {
super(name); super(name);
} }

View file

@ -4,10 +4,10 @@ package dark.assembly.common.armbot.command;
/** Used by arms to break a specific block in a position. /** Used by arms to break a specific block in a position.
* *
* @author DarkGuardsman */ * @author DarkGuardsman */
public class CommandHarvest extends CommandBreak public class TaskHarvest extends TaskBreak
{ {
public CommandHarvest() public TaskHarvest()
{ {
super("Harvest"); super("Harvest");
} }

View file

@ -10,14 +10,14 @@ import dark.api.al.coding.IProgrammableMachine;
import dark.api.al.coding.args.ArgumentData; import dark.api.al.coding.args.ArgumentData;
import dark.assembly.common.armbot.TaskBaseProcess; import dark.assembly.common.armbot.TaskBaseProcess;
public class CommandIdle extends TaskBaseProcess public class TaskIdle extends TaskBaseProcess
{ {
/** The amount of time in which the machine will idle. */ /** The amount of time in which the machine will idle. */
public int idleTime = 80; public int idleTime = 80;
private int totalIdleTime = 80; private int totalIdleTime = 80;
public CommandIdle() public TaskIdle()
{ {
super("wait"); super("wait");
this.defautlArguments.add(new ArgumentData("idleTime", 20)); this.defautlArguments.add(new ArgumentData("idleTime", 20));
@ -78,7 +78,7 @@ public class CommandIdle extends TaskBaseProcess
@Override @Override
public TaskBaseProcess clone() public TaskBaseProcess clone()
{ {
return new CommandIdle(); return new TaskIdle();
} }
@Override @Override

View file

@ -14,11 +14,11 @@ import dark.assembly.common.armbot.TaskBaseProcess;
/** 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 CommandPlace extends TaskBaseArmbot public class TaskPlace extends TaskBaseArmbot
{ {
int PLACE_TIME = 30; int PLACE_TIME = 30;
public CommandPlace() public TaskPlace()
{ {
super("Place"); super("Place");
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
@ -95,6 +95,6 @@ public class CommandPlace extends TaskBaseArmbot
@Override @Override
public TaskBaseProcess clone() public TaskBaseProcess clone()
{ {
return new CommandPlace(); return new TaskPlace();
} }
} }

View file

@ -3,14 +3,14 @@ package dark.assembly.common.armbot.command;
import dark.assembly.common.armbot.TaskBaseArmbot; import dark.assembly.common.armbot.TaskBaseArmbot;
import dark.assembly.common.armbot.TaskBaseProcess; import dark.assembly.common.armbot.TaskBaseProcess;
public class CommandReturn extends TaskBaseArmbot public class TaskReturn extends TaskBaseArmbot
{ {
public static final float IDLE_ROTATION_PITCH = 0; public static final float IDLE_ROTATION_PITCH = 0;
public static final float IDLE_ROTATION_YAW = 0; public static final float IDLE_ROTATION_YAW = 0;
private CommandRotateTo rotateToCommand; private TaskRotateTo rotateToCommand;
public CommandReturn() public TaskReturn()
{ {
super("Return"); super("Return");
} }
@ -20,7 +20,7 @@ public class CommandReturn extends TaskBaseArmbot
{ {
if (this.rotateToCommand == null) if (this.rotateToCommand == null)
{ {
this.rotateToCommand = new CommandRotateTo(0, 0); this.rotateToCommand = new TaskRotateTo(0, 0);
this.rotateToCommand.onMethodCalled(); this.rotateToCommand.onMethodCalled();
} }
@ -42,7 +42,7 @@ public class CommandReturn extends TaskBaseArmbot
@Override @Override
public TaskBaseProcess clone() public TaskBaseProcess clone()
{ {
return new CommandReturn(); return new TaskReturn();
} }
} }

View file

@ -16,14 +16,14 @@ import dark.core.prefab.helpers.MathHelper;
/** Rotates an armbot by a set amount /** Rotates an armbot by a set amount
* *
* @author DarkGuardsman */ * @author DarkGuardsman */
public class CommandRotateBy extends TaskBaseArmbot public class TaskRotateBy extends TaskBaseArmbot
{ {
int targetRotationYaw = 0, targetRotationPitch = 0, deltaPitch = 0, deltaYaw = 0; int targetRotationYaw = 0, targetRotationPitch = 0, deltaPitch = 0, deltaYaw = 0;
private CommandRotateTo rotateToCommand; private TaskRotateTo rotateToCommand;
public CommandRotateBy() public TaskRotateBy()
{ {
super("RotateBy"); super("RotateBy");
this.defautlArguments.add(new ArgumentIntData("yaw", 0, 360, 0)); this.defautlArguments.add(new ArgumentIntData("yaw", 0, 360, 0));
@ -49,7 +49,7 @@ public class CommandRotateBy extends TaskBaseArmbot
{ {
if (this.rotateToCommand == null) if (this.rotateToCommand == null)
{ {
this.rotateToCommand = new CommandRotateTo(this.targetRotationYaw, this.targetRotationPitch); this.rotateToCommand = new TaskRotateTo(this.targetRotationYaw, this.targetRotationPitch);
this.rotateToCommand.onMethodCalled(); this.rotateToCommand.onMethodCalled();
} }
@ -57,7 +57,7 @@ public class CommandRotateBy extends TaskBaseArmbot
} }
@Override @Override
public CommandRotateBy load(NBTTagCompound taskCompound) public TaskRotateBy load(NBTTagCompound taskCompound)
{ {
super.loadProgress(taskCompound); super.loadProgress(taskCompound);
this.targetRotationPitch = taskCompound.getInteger("rotPitch"); this.targetRotationPitch = taskCompound.getInteger("rotPitch");
@ -83,6 +83,6 @@ public class CommandRotateBy extends TaskBaseArmbot
@Override @Override
public TaskBaseProcess clone() public TaskBaseProcess clone()
{ {
return new CommandRotateBy(); return new TaskRotateBy();
} }
} }

View file

@ -16,18 +16,18 @@ import dark.core.prefab.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 CommandRotateTo extends TaskBaseArmbot public class TaskRotateTo extends TaskBaseArmbot
{ {
int targetRotationYaw = 0, targetRotationPitch = 0, currentRotationYaw, currentRotationPitch; int targetRotationYaw = 0, targetRotationPitch = 0, currentRotationYaw, currentRotationPitch;
public CommandRotateTo() public TaskRotateTo()
{ {
super("RotateTo"); super("RotateTo");
this.defautlArguments.add(new ArgumentIntData("yaw", 0, 360, 0)); this.defautlArguments.add(new ArgumentIntData("yaw", 0, 360, 0));
this.defautlArguments.add(new ArgumentIntData("pitch", 0, 360, 0)); this.defautlArguments.add(new ArgumentIntData("pitch", 0, 360, 0));
} }
public CommandRotateTo(int yaw, int pitch) public TaskRotateTo(int yaw, int pitch)
{ {
super("RotateTo"); super("RotateTo");
this.defautlArguments.add(new ArgumentIntData("yaw", yaw, 360, 0)); this.defautlArguments.add(new ArgumentIntData("yaw", yaw, 360, 0));
@ -67,7 +67,7 @@ public class CommandRotateTo extends TaskBaseArmbot
} }
@Override @Override
public CommandRotateTo load(NBTTagCompound taskCompound) public TaskRotateTo load(NBTTagCompound taskCompound)
{ {
super.loadProgress(taskCompound); super.loadProgress(taskCompound);
this.targetRotationPitch = taskCompound.getInteger("rotPitch"); this.targetRotationPitch = taskCompound.getInteger("rotPitch");
@ -87,6 +87,6 @@ public class CommandRotateTo extends TaskBaseArmbot
@Override @Override
public TaskBaseProcess clone() public TaskBaseProcess clone()
{ {
return new CommandRotateTo(); return new TaskRotateTo();
} }
} }

View file

@ -21,13 +21,13 @@ import dark.assembly.common.armbot.TaskBaseProcess;
import dark.assembly.common.machine.InvInteractionHelper; import dark.assembly.common.machine.InvInteractionHelper;
import dark.core.prefab.helpers.MathHelper; import dark.core.prefab.helpers.MathHelper;
public class CommandTake extends TaskBaseArmbot public class TaskTake extends TaskBaseArmbot
{ {
protected ItemStack stack; protected ItemStack stack;
protected int ammount = -1; protected int ammount = -1;
public CommandTake() public TaskTake()
{ {
super("Take"); super("Take");
this.defautlArguments.add(new ArgumentIntData("blockID", -1, Block.blocksList.length - 1, -1)); this.defautlArguments.add(new ArgumentIntData("blockID", -1, Block.blocksList.length - 1, -1));
@ -86,7 +86,7 @@ public class CommandTake extends TaskBaseArmbot
} }
@Override @Override
public CommandTake load(NBTTagCompound taskCompound) public TaskTake load(NBTTagCompound taskCompound)
{ {
super.loadProgress(taskCompound); super.loadProgress(taskCompound);
this.stack = ItemStack.loadItemStackFromNBT(taskCompound.getCompoundTag("item")); this.stack = ItemStack.loadItemStackFromNBT(taskCompound.getCompoundTag("item"));
@ -109,6 +109,6 @@ public class CommandTake extends TaskBaseArmbot
@Override @Override
public TaskBaseProcess clone() public TaskBaseProcess clone()
{ {
return new CommandTake(); return new TaskTake();
} }
} }

View file

@ -16,12 +16,12 @@ import dark.api.al.coding.args.ArgumentIntData;
import dark.assembly.common.armbot.TaskBaseArmbot; import dark.assembly.common.armbot.TaskBaseArmbot;
import dark.assembly.common.armbot.TaskBaseProcess; import dark.assembly.common.armbot.TaskBaseProcess;
public class CommandUse extends TaskBaseArmbot public class TaskUse extends TaskBaseArmbot
{ {
protected int times, curTimes; protected int times, curTimes;
public CommandUse() public TaskUse()
{ {
super("use"); super("use");
this.defautlArguments.add(new ArgumentIntData("repeat", 1, Integer.MAX_VALUE, 1)); this.defautlArguments.add(new ArgumentIntData("repeat", 1, Integer.MAX_VALUE, 1));
@ -88,7 +88,7 @@ public class CommandUse extends TaskBaseArmbot
} }
@Override @Override
public CommandUse load(NBTTagCompound taskCompound) public TaskUse load(NBTTagCompound taskCompound)
{ {
super.loadProgress(taskCompound); super.loadProgress(taskCompound);
this.times = taskCompound.getInteger("useTimes"); this.times = taskCompound.getInteger("useTimes");
@ -122,6 +122,6 @@ public class CommandUse extends TaskBaseArmbot
@Override @Override
public TaskBaseProcess clone() public TaskBaseProcess clone()
{ {
return new CommandUse(); return new TaskUse();
} }
} }