Task renaming
This commit is contained in:
parent
04b1712f54
commit
932dbe8b7e
16 changed files with 57 additions and 78 deletions
|
@ -66,7 +66,7 @@ public class GrabDictionary
|
|||
}
|
||||
|
||||
/** gets the name of the Entity
|
||||
*
|
||||
*
|
||||
* @return "" if null */
|
||||
public String getName()
|
||||
{
|
||||
|
@ -78,7 +78,7 @@ public class GrabDictionary
|
|||
}
|
||||
|
||||
/** gets the Entity Class
|
||||
*
|
||||
*
|
||||
* @return Entity.class if null */
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -20,17 +20,17 @@ import dark.core.prefab.helpers.ItemWorldHelper;
|
|||
/** Used by arms to break a specific block in a position.
|
||||
*
|
||||
* @author Calclavia */
|
||||
public class CommandBreak extends TaskBaseArmbot
|
||||
public class TaskBreak extends TaskBaseArmbot
|
||||
{
|
||||
protected int breakTicks = 30;
|
||||
protected boolean keep = false;
|
||||
|
||||
public CommandBreak()
|
||||
public TaskBreak()
|
||||
{
|
||||
this("break");
|
||||
}
|
||||
|
||||
public CommandBreak(String name)
|
||||
public TaskBreak(String name)
|
||||
{
|
||||
super(name);
|
||||
this.breakTicks = 30;
|
||||
|
@ -71,7 +71,7 @@ public class CommandBreak extends TaskBaseArmbot
|
|||
@Override
|
||||
public TaskBaseProcess clone()
|
||||
{
|
||||
return new CommandBreak();
|
||||
return new TaskBreak();
|
||||
}
|
||||
|
||||
@Override
|
|
@ -4,9 +4,9 @@ import dark.api.al.coding.IArmbot;
|
|||
import dark.assembly.common.armbot.TaskBaseArmbot;
|
||||
import dark.assembly.common.armbot.TaskBaseProcess;
|
||||
|
||||
public class CommandDrop extends TaskBaseArmbot
|
||||
public class TaskDrop extends TaskBaseArmbot
|
||||
{
|
||||
public CommandDrop()
|
||||
public TaskDrop()
|
||||
{
|
||||
super("drop");
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public class CommandDrop extends TaskBaseArmbot
|
|||
@Override
|
||||
public TaskBaseProcess clone()
|
||||
{
|
||||
return new CommandDrop();
|
||||
return new TaskDrop();
|
||||
}
|
||||
|
||||
}
|
|
@ -20,7 +20,7 @@ import dark.api.al.coding.args.ArgumentFloatData;
|
|||
import dark.assembly.common.armbot.TaskBaseArmbot;
|
||||
import dark.assembly.common.armbot.TaskBaseProcess;
|
||||
|
||||
public class CommandFire extends TaskBaseArmbot
|
||||
public class TaskFire extends TaskBaseArmbot
|
||||
{
|
||||
|
||||
private static final float MIN_ACTUAL_PITCH = -80;
|
||||
|
@ -31,7 +31,7 @@ public class CommandFire extends TaskBaseArmbot
|
|||
private float velocity;
|
||||
private Vector3 finalVelocity;
|
||||
|
||||
public CommandFire()
|
||||
public TaskFire()
|
||||
{
|
||||
super("throw");
|
||||
this.defautlArguments.add(new ArgumentFloatData("velocity", 1.0f, 2.5f, 1.0f));
|
||||
|
@ -195,6 +195,6 @@ public class CommandFire extends TaskBaseArmbot
|
|||
@Override
|
||||
public TaskBaseProcess clone()
|
||||
{
|
||||
return new CommandFire();
|
||||
return new TaskFire();
|
||||
}
|
||||
}
|
|
@ -21,13 +21,13 @@ import dark.assembly.common.armbot.TaskBaseProcess;
|
|||
import dark.assembly.common.machine.InvInteractionHelper;
|
||||
import dark.core.prefab.helpers.MathHelper;
|
||||
|
||||
public class CommandGive extends TaskBaseArmbot
|
||||
public class TaskGive extends TaskBaseArmbot
|
||||
{
|
||||
|
||||
private ItemStack stack;
|
||||
private int ammount = -1;
|
||||
|
||||
public CommandGive()
|
||||
public TaskGive()
|
||||
{
|
||||
super("give");
|
||||
this.defautlArguments.add(new ArgumentIntData("blockID", -1, Block.blocksList.length - 1, -1));
|
||||
|
@ -113,7 +113,7 @@ public class CommandGive extends TaskBaseArmbot
|
|||
@Override
|
||||
public TaskBaseProcess clone()
|
||||
{
|
||||
return new CommandGive();
|
||||
return new TaskGive();
|
||||
}
|
||||
|
||||
@Override
|
|
@ -17,7 +17,7 @@ import dark.api.al.coding.args.ArgumentListData;
|
|||
import dark.assembly.common.armbot.GrabDictionary;
|
||||
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
|
||||
* version of that entity. */
|
||||
|
@ -26,7 +26,7 @@ public class CommandGrabEntity extends CommandGrabPrefab
|
|||
private Class<? extends Entity> entityToInclude;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public CommandGrabEntity()
|
||||
public TaskGrabEntity()
|
||||
{
|
||||
super("Grab-Entity");
|
||||
this.defautlArguments.add(new ArgumentData("child", false));
|
||||
|
@ -69,6 +69,7 @@ public class CommandGrabEntity extends CommandGrabPrefab
|
|||
{
|
||||
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));
|
||||
|
||||
if (found != null && found.size() > 0)
|
||||
|
@ -130,7 +131,7 @@ public class CommandGrabEntity extends CommandGrabPrefab
|
|||
@Override
|
||||
public TaskBaseProcess clone()
|
||||
{
|
||||
return new CommandGrabEntity();
|
||||
return new TaskGrabEntity();
|
||||
}
|
||||
|
||||
}
|
|
@ -16,11 +16,11 @@ import dark.api.al.coding.IProgrammableMachine;
|
|||
import dark.api.al.coding.args.ArgumentIntData;
|
||||
import dark.assembly.common.armbot.TaskBaseProcess;
|
||||
|
||||
public class CommandGrabItem extends CommandGrabPrefab
|
||||
public class TaskGrabItem extends TaskGrabPrefab
|
||||
{
|
||||
ItemStack stack = null;
|
||||
|
||||
public CommandGrabItem()
|
||||
public TaskGrabItem()
|
||||
{
|
||||
super("Grab-Item");
|
||||
this.defautlArguments.add(new ArgumentIntData("blockID", -1, Block.blocksList.length - 1, -1));
|
||||
|
@ -81,6 +81,6 @@ public class CommandGrabItem extends CommandGrabPrefab
|
|||
@Override
|
||||
public TaskBaseProcess clone()
|
||||
{
|
||||
return new CommandGrabItem();
|
||||
return new TaskGrabItem();
|
||||
}
|
||||
}
|
|
@ -12,13 +12,13 @@ import dark.assembly.common.armbot.TaskBaseArmbot;
|
|||
/** Prefab for grab based commands
|
||||
*
|
||||
* @author DarkGuardsman */
|
||||
public abstract class CommandGrabPrefab extends TaskBaseArmbot
|
||||
public abstract class TaskGrabPrefab extends TaskBaseArmbot
|
||||
{
|
||||
public static final float radius = 0.5f;
|
||||
protected Vector3 armPos;
|
||||
protected IBelt belt;
|
||||
|
||||
public CommandGrabPrefab(String name)
|
||||
public TaskGrabPrefab(String name)
|
||||
{
|
||||
super(name);
|
||||
}
|
|
@ -4,10 +4,10 @@ package dark.assembly.common.armbot.command;
|
|||
/** Used by arms to break a specific block in a position.
|
||||
*
|
||||
* @author DarkGuardsman */
|
||||
public class CommandHarvest extends CommandBreak
|
||||
public class TaskHarvest extends TaskBreak
|
||||
{
|
||||
|
||||
public CommandHarvest()
|
||||
public TaskHarvest()
|
||||
{
|
||||
super("Harvest");
|
||||
}
|
|
@ -10,14 +10,14 @@ import dark.api.al.coding.IProgrammableMachine;
|
|||
import dark.api.al.coding.args.ArgumentData;
|
||||
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. */
|
||||
public int idleTime = 80;
|
||||
private int totalIdleTime = 80;
|
||||
|
||||
public CommandIdle()
|
||||
public TaskIdle()
|
||||
{
|
||||
super("wait");
|
||||
this.defautlArguments.add(new ArgumentData("idleTime", 20));
|
||||
|
@ -78,7 +78,7 @@ public class CommandIdle extends TaskBaseProcess
|
|||
@Override
|
||||
public TaskBaseProcess clone()
|
||||
{
|
||||
return new CommandIdle();
|
||||
return new TaskIdle();
|
||||
}
|
||||
|
||||
@Override
|
|
@ -14,11 +14,11 @@ import dark.assembly.common.armbot.TaskBaseProcess;
|
|||
/** Used by arms to break a specific block in a position.
|
||||
*
|
||||
* @author Calclavia */
|
||||
public class CommandPlace extends TaskBaseArmbot
|
||||
public class TaskPlace extends TaskBaseArmbot
|
||||
{
|
||||
int PLACE_TIME = 30;
|
||||
|
||||
public CommandPlace()
|
||||
public TaskPlace()
|
||||
{
|
||||
super("Place");
|
||||
// TODO Auto-generated constructor stub
|
||||
|
@ -95,6 +95,6 @@ public class CommandPlace extends TaskBaseArmbot
|
|||
@Override
|
||||
public TaskBaseProcess clone()
|
||||
{
|
||||
return new CommandPlace();
|
||||
return new TaskPlace();
|
||||
}
|
||||
}
|
|
@ -3,14 +3,14 @@ package dark.assembly.common.armbot.command;
|
|||
import dark.assembly.common.armbot.TaskBaseArmbot;
|
||||
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_YAW = 0;
|
||||
|
||||
private CommandRotateTo rotateToCommand;
|
||||
private TaskRotateTo rotateToCommand;
|
||||
|
||||
public CommandReturn()
|
||||
public TaskReturn()
|
||||
{
|
||||
super("Return");
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ public class CommandReturn extends TaskBaseArmbot
|
|||
{
|
||||
if (this.rotateToCommand == null)
|
||||
{
|
||||
this.rotateToCommand = new CommandRotateTo(0, 0);
|
||||
this.rotateToCommand = new TaskRotateTo(0, 0);
|
||||
this.rotateToCommand.onMethodCalled();
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class CommandReturn extends TaskBaseArmbot
|
|||
@Override
|
||||
public TaskBaseProcess clone()
|
||||
{
|
||||
return new CommandReturn();
|
||||
return new TaskReturn();
|
||||
}
|
||||
|
||||
}
|
|
@ -16,14 +16,14 @@ import dark.core.prefab.helpers.MathHelper;
|
|||
/** Rotates an armbot by a set amount
|
||||
*
|
||||
* @author DarkGuardsman */
|
||||
public class CommandRotateBy extends TaskBaseArmbot
|
||||
public class TaskRotateBy extends TaskBaseArmbot
|
||||
{
|
||||
|
||||
int targetRotationYaw = 0, targetRotationPitch = 0, deltaPitch = 0, deltaYaw = 0;
|
||||
|
||||
private CommandRotateTo rotateToCommand;
|
||||
private TaskRotateTo rotateToCommand;
|
||||
|
||||
public CommandRotateBy()
|
||||
public TaskRotateBy()
|
||||
{
|
||||
super("RotateBy");
|
||||
this.defautlArguments.add(new ArgumentIntData("yaw", 0, 360, 0));
|
||||
|
@ -49,7 +49,7 @@ public class CommandRotateBy extends TaskBaseArmbot
|
|||
{
|
||||
if (this.rotateToCommand == null)
|
||||
{
|
||||
this.rotateToCommand = new CommandRotateTo(this.targetRotationYaw, this.targetRotationPitch);
|
||||
this.rotateToCommand = new TaskRotateTo(this.targetRotationYaw, this.targetRotationPitch);
|
||||
this.rotateToCommand.onMethodCalled();
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ public class CommandRotateBy extends TaskBaseArmbot
|
|||
}
|
||||
|
||||
@Override
|
||||
public CommandRotateBy load(NBTTagCompound taskCompound)
|
||||
public TaskRotateBy load(NBTTagCompound taskCompound)
|
||||
{
|
||||
super.loadProgress(taskCompound);
|
||||
this.targetRotationPitch = taskCompound.getInteger("rotPitch");
|
||||
|
@ -83,6 +83,6 @@ public class CommandRotateBy extends TaskBaseArmbot
|
|||
@Override
|
||||
public TaskBaseProcess clone()
|
||||
{
|
||||
return new CommandRotateBy();
|
||||
return new TaskRotateBy();
|
||||
}
|
||||
}
|
|
@ -16,18 +16,18 @@ import dark.core.prefab.helpers.MathHelper;
|
|||
/** Rotates the armbot to a specific direction. If not specified, it will turn right.
|
||||
*
|
||||
* @author DarkGuardsman */
|
||||
public class CommandRotateTo extends TaskBaseArmbot
|
||||
public class TaskRotateTo extends TaskBaseArmbot
|
||||
{
|
||||
int targetRotationYaw = 0, targetRotationPitch = 0, currentRotationYaw, currentRotationPitch;
|
||||
|
||||
public CommandRotateTo()
|
||||
public TaskRotateTo()
|
||||
{
|
||||
super("RotateTo");
|
||||
this.defautlArguments.add(new ArgumentIntData("yaw", 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");
|
||||
this.defautlArguments.add(new ArgumentIntData("yaw", yaw, 360, 0));
|
||||
|
@ -67,7 +67,7 @@ public class CommandRotateTo extends TaskBaseArmbot
|
|||
}
|
||||
|
||||
@Override
|
||||
public CommandRotateTo load(NBTTagCompound taskCompound)
|
||||
public TaskRotateTo load(NBTTagCompound taskCompound)
|
||||
{
|
||||
super.loadProgress(taskCompound);
|
||||
this.targetRotationPitch = taskCompound.getInteger("rotPitch");
|
||||
|
@ -87,6 +87,6 @@ public class CommandRotateTo extends TaskBaseArmbot
|
|||
@Override
|
||||
public TaskBaseProcess clone()
|
||||
{
|
||||
return new CommandRotateTo();
|
||||
return new TaskRotateTo();
|
||||
}
|
||||
}
|
|
@ -21,13 +21,13 @@ import dark.assembly.common.armbot.TaskBaseProcess;
|
|||
import dark.assembly.common.machine.InvInteractionHelper;
|
||||
import dark.core.prefab.helpers.MathHelper;
|
||||
|
||||
public class CommandTake extends TaskBaseArmbot
|
||||
public class TaskTake extends TaskBaseArmbot
|
||||
{
|
||||
|
||||
protected ItemStack stack;
|
||||
protected int ammount = -1;
|
||||
|
||||
public CommandTake()
|
||||
public TaskTake()
|
||||
{
|
||||
super("Take");
|
||||
this.defautlArguments.add(new ArgumentIntData("blockID", -1, Block.blocksList.length - 1, -1));
|
||||
|
@ -86,7 +86,7 @@ public class CommandTake extends TaskBaseArmbot
|
|||
}
|
||||
|
||||
@Override
|
||||
public CommandTake load(NBTTagCompound taskCompound)
|
||||
public TaskTake load(NBTTagCompound taskCompound)
|
||||
{
|
||||
super.loadProgress(taskCompound);
|
||||
this.stack = ItemStack.loadItemStackFromNBT(taskCompound.getCompoundTag("item"));
|
||||
|
@ -109,6 +109,6 @@ public class CommandTake extends TaskBaseArmbot
|
|||
@Override
|
||||
public TaskBaseProcess clone()
|
||||
{
|
||||
return new CommandTake();
|
||||
return new TaskTake();
|
||||
}
|
||||
}
|
|
@ -16,12 +16,12 @@ import dark.api.al.coding.args.ArgumentIntData;
|
|||
import dark.assembly.common.armbot.TaskBaseArmbot;
|
||||
import dark.assembly.common.armbot.TaskBaseProcess;
|
||||
|
||||
public class CommandUse extends TaskBaseArmbot
|
||||
public class TaskUse extends TaskBaseArmbot
|
||||
{
|
||||
|
||||
protected int times, curTimes;
|
||||
|
||||
public CommandUse()
|
||||
public TaskUse()
|
||||
{
|
||||
super("use");
|
||||
this.defautlArguments.add(new ArgumentIntData("repeat", 1, Integer.MAX_VALUE, 1));
|
||||
|
@ -88,7 +88,7 @@ public class CommandUse extends TaskBaseArmbot
|
|||
}
|
||||
|
||||
@Override
|
||||
public CommandUse load(NBTTagCompound taskCompound)
|
||||
public TaskUse load(NBTTagCompound taskCompound)
|
||||
{
|
||||
super.loadProgress(taskCompound);
|
||||
this.times = taskCompound.getInteger("useTimes");
|
||||
|
@ -122,6 +122,6 @@ public class CommandUse extends TaskBaseArmbot
|
|||
@Override
|
||||
public TaskBaseProcess clone()
|
||||
{
|
||||
return new CommandUse();
|
||||
return new TaskUse();
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue