mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
now i know how megan feels
This commit is contained in:
parent
8a59eb9dbc
commit
31c55c7cfa
@ -2,6 +2,7 @@ package com.hbm.entity.logic;
|
|||||||
|
|
||||||
import com.hbm.config.MobConfig;
|
import com.hbm.config.MobConfig;
|
||||||
import com.hbm.entity.mob.EntityGlyphid;
|
import com.hbm.entity.mob.EntityGlyphid;
|
||||||
|
import static com.hbm.entity.mob.EntityGlyphid.*;
|
||||||
import com.hbm.entity.mob.EntityGlyphidNuclear;
|
import com.hbm.entity.mob.EntityGlyphidNuclear;
|
||||||
import com.hbm.entity.mob.EntityGlyphidScout;
|
import com.hbm.entity.mob.EntityGlyphidScout;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
@ -9,131 +10,125 @@ import net.minecraft.entity.Entity;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.chunk.Chunk;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
public class EntityWaypoint extends Entity {
|
public class EntityWaypoint extends Entity {
|
||||||
public EntityWaypoint(World world) {
|
public EntityWaypoint(World world) {
|
||||||
super(world);
|
super(world);
|
||||||
this.isImmuneToFire = true;
|
this.isImmuneToFire = true;
|
||||||
this.noClip = true;
|
this.noClip = true;
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
protected void entityInit() {
|
|
||||||
this.dataWatcher.addObject(10, 0);
|
|
||||||
//this.dataWatcher.addObject(11, 0);
|
|
||||||
|
|
||||||
}
|
@Override
|
||||||
public int maxAge = 2400;
|
protected void entityInit() {
|
||||||
public int radius = 3;
|
this.dataWatcher.addObject(10, 0);
|
||||||
public boolean highPriority = false;
|
// this.dataWatcher.addObject(11, 0);
|
||||||
protected EntityWaypoint additional;
|
|
||||||
public void setHighPriority(){
|
|
||||||
highPriority = true;
|
|
||||||
}
|
|
||||||
public int getWaypointType(){
|
|
||||||
return this.dataWatcher.getWatchableObjectInt(10);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAdditionalWaypoint(EntityWaypoint waypoint){
|
}
|
||||||
additional = waypoint;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setWaypointType(int waypointType) {
|
public int maxAge = 2400;
|
||||||
this.dataWatcher.updateObject(10, waypointType);
|
public int radius = 3;
|
||||||
}
|
public boolean highPriority = false;
|
||||||
boolean hasSpawned = false;
|
protected EntityWaypoint additional;
|
||||||
public int getColor(){
|
|
||||||
switch(getWaypointType()){
|
|
||||||
|
|
||||||
case 1: return 0x5FA6E8;
|
public void setHighPriority() {
|
||||||
|
highPriority = true;
|
||||||
|
}
|
||||||
|
|
||||||
case 2:
|
public int getWaypointType() {
|
||||||
case 3:
|
return this.dataWatcher.getWatchableObjectInt(10);
|
||||||
return 0x127766;
|
}
|
||||||
|
|
||||||
default: return 0x566573;
|
public void setAdditionalWaypoint(EntityWaypoint waypoint) {
|
||||||
}
|
additional = waypoint;
|
||||||
}
|
}
|
||||||
AxisAlignedBB bb;
|
|
||||||
@Override
|
|
||||||
public void onEntityUpdate() {
|
|
||||||
if (ticksExisted >= maxAge) {
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
|
|
||||||
bb = AxisAlignedBB.getBoundingBox(
|
public void setWaypointType(int waypointType) {
|
||||||
this.posX - radius,
|
this.dataWatcher.updateObject(10, waypointType);
|
||||||
this.posY - radius,
|
}
|
||||||
this.posZ - radius,
|
|
||||||
this.posX + radius,
|
|
||||||
this.posY + radius,
|
|
||||||
this.posZ + radius);
|
|
||||||
|
|
||||||
if (!worldObj.isRemote) {
|
boolean hasSpawned = false;
|
||||||
|
|
||||||
if (ticksExisted % 40 == 0) {
|
public int getColor() {
|
||||||
|
switch(getWaypointType()) {
|
||||||
|
|
||||||
List<Entity> targets = worldObj.getEntitiesWithinAABBExcludingEntity(this, bb);
|
case TASK_RETREAT_FOR_REINFORCEMENTS: return 0x5FA6E8;
|
||||||
|
case TASK_BUILD_HIVE:
|
||||||
|
case TASK_INITIATE_RETREAT: return 0x127766;
|
||||||
|
default: return 0x566573;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (Entity e : targets) {
|
AxisAlignedBB bb;
|
||||||
if (e instanceof EntityGlyphid) {
|
|
||||||
|
|
||||||
EntityGlyphid bug = ((EntityGlyphid) e);
|
@Override
|
||||||
|
public void onEntityUpdate() {
|
||||||
|
if(ticksExisted >= maxAge) {
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
|
||||||
if (additional != null && !hasSpawned) {
|
bb = AxisAlignedBB.getBoundingBox(this.posX, this.posY, this.posZ, this.posX, this.posY, this.posZ).expand(radius, radius, radius);
|
||||||
worldObj.spawnEntityInWorld(additional);
|
|
||||||
hasSpawned = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean exceptions = bug.getWaypoint() != this
|
if(!worldObj.isRemote) {
|
||||||
|| e instanceof EntityGlyphidScout
|
|
||||||
|| e instanceof EntityGlyphidNuclear;
|
|
||||||
|
|
||||||
if(!exceptions)
|
if(ticksExisted % 40 == 0) {
|
||||||
bug.setCurrentTask(getWaypointType(), additional);
|
|
||||||
|
|
||||||
if (getWaypointType() == 2) {
|
List<Entity> targets = worldObj.getEntitiesWithinAABBExcludingEntity(this, bb);
|
||||||
if (e instanceof EntityGlyphidScout)
|
|
||||||
setDead();
|
|
||||||
} else {
|
|
||||||
setDead();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
for(Entity e : targets) {
|
||||||
}
|
if(e instanceof EntityGlyphid) {
|
||||||
}
|
|
||||||
} else if(MobConfig.waypointDebug) {
|
|
||||||
|
|
||||||
double x = bb.minX + (rand.nextDouble() - 0.5) * (bb.maxX - bb.minX);
|
EntityGlyphid bug = ((EntityGlyphid) e);
|
||||||
double y = bb.minY + rand.nextDouble() * (bb.maxY - bb.minY);
|
|
||||||
double z = bb.minZ + (rand.nextDouble() - 0.5) * (bb.maxZ - bb.minZ);
|
|
||||||
|
|
||||||
NBTTagCompound fx = new NBTTagCompound();
|
if(additional != null && !hasSpawned) {
|
||||||
fx.setString("type", "tower");
|
worldObj.spawnEntityInWorld(additional);
|
||||||
fx.setFloat("lift", 0.5F);
|
hasSpawned = true;
|
||||||
fx.setFloat("base", 0.75F);
|
}
|
||||||
fx.setFloat("max", 2F);
|
|
||||||
fx.setInteger("life", 50 + worldObj.rand.nextInt(10));
|
|
||||||
fx.setInteger("color", getColor());
|
|
||||||
fx.setDouble("posX", x);
|
|
||||||
fx.setDouble("posY", y);
|
|
||||||
fx.setDouble("posZ", z);
|
|
||||||
MainRegistry.proxy.effectNT(fx);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
boolean exceptions = bug.getWaypoint() != this || e instanceof EntityGlyphidScout || e instanceof EntityGlyphidNuclear;
|
||||||
|
|
||||||
|
if(!exceptions)
|
||||||
|
bug.setCurrentTask(getWaypointType(), additional);
|
||||||
|
|
||||||
@Override
|
if(getWaypointType() == TASK_BUILD_HIVE) {
|
||||||
protected void readEntityFromNBT(NBTTagCompound nbt) {
|
if(e instanceof EntityGlyphidScout)
|
||||||
this.setWaypointType(nbt.getInteger("type"));
|
setDead();
|
||||||
}
|
} else {
|
||||||
|
setDead();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
}
|
||||||
protected void writeEntityToNBT(NBTTagCompound nbt) {
|
}
|
||||||
nbt.setInteger("type", getWaypointType());
|
}
|
||||||
}
|
} else if(MobConfig.waypointDebug) {
|
||||||
|
|
||||||
|
double x = bb.minX + (rand.nextDouble() - 0.5) * (bb.maxX - bb.minX);
|
||||||
|
double y = bb.minY + rand.nextDouble() * (bb.maxY - bb.minY);
|
||||||
|
double z = bb.minZ + (rand.nextDouble() - 0.5) * (bb.maxZ - bb.minZ);
|
||||||
|
|
||||||
|
NBTTagCompound fx = new NBTTagCompound();
|
||||||
|
fx.setString("type", "tower");
|
||||||
|
fx.setFloat("lift", 0.5F);
|
||||||
|
fx.setFloat("base", 0.75F);
|
||||||
|
fx.setFloat("max", 2F);
|
||||||
|
fx.setInteger("life", 50 + worldObj.rand.nextInt(10));
|
||||||
|
fx.setInteger("color", getColor());
|
||||||
|
fx.setDouble("posX", x);
|
||||||
|
fx.setDouble("posY", y);
|
||||||
|
fx.setDouble("posZ", z);
|
||||||
|
MainRegistry.proxy.effectNT(fx);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void readEntityFromNBT(NBTTagCompound nbt) {
|
||||||
|
this.setWaypointType(nbt.getInteger("type"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void writeEntityToNBT(NBTTagCompound nbt) {
|
||||||
|
nbt.setInteger("type", getWaypointType());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@ public class EntityGlyphid extends EntityMob {
|
|||||||
public int taskZ;
|
public int taskZ;
|
||||||
|
|
||||||
//used for digging, bigger glyphids have a longer reach
|
//used for digging, bigger glyphids have a longer reach
|
||||||
public int blastSize = Math.min((int) (3 * (getScale()))/2, 5);
|
public int blastSize = Math.min((int) (3 * (getScale())) / 2, 5);
|
||||||
public int blastResToDig = Math.min((int) (50 * (getScale() * 2)), 150);
|
public int blastResToDig = Math.min((int) (50 * (getScale() * 2)), 150);
|
||||||
public boolean shouldDig;
|
public boolean shouldDig;
|
||||||
|
|
||||||
@ -73,10 +73,12 @@ public class EntityGlyphid extends EntityMob {
|
|||||||
public static final int TASK_FOLLOW = 4;
|
public static final int TASK_FOLLOW = 4;
|
||||||
/** Causes nuclear glyphids to immediately self-destruct, also signaling nearby scouts to retreat */
|
/** Causes nuclear glyphids to immediately self-destruct, also signaling nearby scouts to retreat */
|
||||||
public static final int TASK_TERRAFORM = 5;
|
public static final int TASK_TERRAFORM = 5;
|
||||||
/** Id any task other than IDLE is interrupted by an obstacle, initiates digging behavior which is also communicated to nearby glyohids */
|
/** If any task other than IDLE is interrupted by an obstacle, initiates digging behavior which is also communicated to nearby glyohids */
|
||||||
public static final int TASK_DIG = 6;
|
public static final int TASK_DIG = 6;
|
||||||
|
|
||||||
EntityWaypoint taskWaypoint = null;
|
protected boolean hasWaypoint = false;
|
||||||
|
/** Yeah, fuck, whatever, anything goes now */
|
||||||
|
protected EntityWaypoint taskWaypoint = null;
|
||||||
|
|
||||||
public EntityGlyphid(World world) {
|
public EntityGlyphid(World world) {
|
||||||
super(world);
|
super(world);
|
||||||
@ -125,7 +127,7 @@ public class EntityGlyphid extends EntityMob {
|
|||||||
if(getCurrentTask() == TASK_FOLLOW){
|
if(getCurrentTask() == TASK_FOLLOW){
|
||||||
|
|
||||||
//incase the waypoint somehow doesn't exist and it got this task anyway
|
//incase the waypoint somehow doesn't exist and it got this task anyway
|
||||||
if(isAtDestination() && taskX == TASK_IDLE) {
|
if(isAtDestination() && !hasWaypoint) {
|
||||||
setCurrentTask(TASK_IDLE, null);
|
setCurrentTask(TASK_IDLE, null);
|
||||||
}
|
}
|
||||||
//the task cannot be 6 outside of rampant, so this is a non issue p much
|
//the task cannot be 6 outside of rampant, so this is a non issue p much
|
||||||
@ -201,7 +203,7 @@ public class EntityGlyphid extends EntityMob {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (taskX != TASK_IDLE) {
|
if(hasWaypoint) {
|
||||||
if(MobConfig.rampantDig) {
|
if(MobConfig.rampantDig) {
|
||||||
|
|
||||||
MovingObjectPosition obstacle = findWaypointObstruction();
|
MovingObjectPosition obstacle = findWaypointObstruction();
|
||||||
@ -292,8 +294,6 @@ public class EntityGlyphid extends EntityMob {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(source.isFireDamage()) {
|
if(source.isFireDamage()) {
|
||||||
//you might be thinking, why would fire damage be nerfed?
|
|
||||||
//thing is, it bypasses glyphid chitin, making it unbelievably powerful, so this was the most reasonable solution
|
|
||||||
amount *= 0.7F;
|
amount *= 0.7F;
|
||||||
} else if(source.getDamageType().equals("player")) {
|
} else if(source.getDamageType().equals("player")) {
|
||||||
amount *= 1.5F;
|
amount *= 1.5F;
|
||||||
@ -423,8 +423,9 @@ public class EntityGlyphid extends EntityMob {
|
|||||||
* @param waypoint The waypoint for the task, can be null
|
* @param waypoint The waypoint for the task, can be null
|
||||||
*/
|
*/
|
||||||
public void setCurrentTask(int task, @Nullable EntityWaypoint waypoint){
|
public void setCurrentTask(int task, @Nullable EntityWaypoint waypoint){
|
||||||
currentTask = task;
|
this.currentTask = task;
|
||||||
taskWaypoint = waypoint;
|
this.taskWaypoint = waypoint;
|
||||||
|
this.hasWaypoint = waypoint != null;
|
||||||
if (taskWaypoint != null) {
|
if (taskWaypoint != null) {
|
||||||
|
|
||||||
taskX = (int) taskWaypoint.posX;
|
taskX = (int) taskWaypoint.posX;
|
||||||
@ -448,50 +449,44 @@ public class EntityGlyphid extends EntityMob {
|
|||||||
|
|
||||||
switch(task){
|
switch(task){
|
||||||
|
|
||||||
//call for reinforcements
|
case TASK_RETREAT_FOR_REINFORCEMENTS:
|
||||||
case TASK_RETREAT_FOR_REINFORCEMENTS: if(taskWaypoint != null){
|
if(taskWaypoint != null) {
|
||||||
communicate(TASK_FOLLOW, taskWaypoint);
|
communicate(TASK_FOLLOW, taskWaypoint);
|
||||||
setCurrentTask(TASK_FOLLOW, taskWaypoint);
|
setCurrentTask(TASK_FOLLOW, taskWaypoint);
|
||||||
} break;
|
}
|
||||||
|
|
||||||
//expand the hive, used by the scout
|
|
||||||
//case 2: expandHive(null);
|
|
||||||
|
|
||||||
//retreat
|
|
||||||
case TASK_INITIATE_RETREAT:
|
|
||||||
|
|
||||||
if (!worldObj.isRemote && taskWaypoint == null) {
|
|
||||||
|
|
||||||
//Then, Come back later
|
|
||||||
EntityWaypoint additional = new EntityWaypoint(worldObj);
|
|
||||||
additional.setLocationAndAngles(posX, posY, posZ, 0 , 0);
|
|
||||||
|
|
||||||
//First, go home and get reinforcements
|
|
||||||
EntityWaypoint home = new EntityWaypoint(worldObj);
|
|
||||||
home.setWaypointType(TASK_RETREAT_FOR_REINFORCEMENTS);
|
|
||||||
home.setAdditionalWaypoint(additional);
|
|
||||||
home.setHighPriority();
|
|
||||||
home.setLocationAndAngles(homeX, homeY, homeZ, 0, 0);
|
|
||||||
worldObj.spawnEntityInWorld(home);
|
|
||||||
|
|
||||||
this.taskWaypoint = home;
|
|
||||||
communicate(TASK_FOLLOW, home);
|
|
||||||
setCurrentTask(TASK_FOLLOW, taskWaypoint);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//the fourth task (case 4) is to just follow the waypoint path
|
case TASK_INITIATE_RETREAT:
|
||||||
//fifth task is used only in the scout and big man johnson, for terraforming
|
|
||||||
|
if(!worldObj.isRemote && taskWaypoint == null) {
|
||||||
|
|
||||||
|
// Then, Come back later
|
||||||
|
EntityWaypoint additional = new EntityWaypoint(worldObj);
|
||||||
|
additional.setLocationAndAngles(posX, posY, posZ, 0, 0);
|
||||||
|
|
||||||
|
// First, go home and get reinforcements
|
||||||
|
EntityWaypoint home = new EntityWaypoint(worldObj);
|
||||||
|
home.setWaypointType(TASK_RETREAT_FOR_REINFORCEMENTS);
|
||||||
|
home.setAdditionalWaypoint(additional);
|
||||||
|
home.setHighPriority();
|
||||||
|
home.setLocationAndAngles(homeX, homeY, homeZ, 0, 0);
|
||||||
|
worldObj.spawnEntityInWorld(home);
|
||||||
|
|
||||||
|
this.taskWaypoint = home;
|
||||||
|
communicate(TASK_FOLLOW, home);
|
||||||
|
setCurrentTask(TASK_FOLLOW, taskWaypoint);
|
||||||
|
|
||||||
//dig
|
|
||||||
case TASK_DIG:
|
|
||||||
shouldDig = true;
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default: break;
|
break;
|
||||||
|
|
||||||
|
case TASK_DIG:
|
||||||
|
shouldDig = true;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -500,19 +495,12 @@ public class EntityGlyphid extends EntityMob {
|
|||||||
/** Copies tasks and waypoint to nearby glyphids. Does not work on glyphid scouts */
|
/** Copies tasks and waypoint to nearby glyphids. Does not work on glyphid scouts */
|
||||||
public void communicate(int task, @Nullable EntityWaypoint waypoint) {
|
public void communicate(int task, @Nullable EntityWaypoint waypoint) {
|
||||||
int radius = waypoint != null ? waypoint.radius : 4;
|
int radius = waypoint != null ? waypoint.radius : 4;
|
||||||
|
AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(this.posX, this.posY, this.posZ, this.posX, this.posY, this.posZ).expand(radius, radius, radius);
|
||||||
AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(
|
|
||||||
this.posX - radius,
|
|
||||||
this.posY - radius,
|
|
||||||
this.posZ - radius,
|
|
||||||
this.posX + radius,
|
|
||||||
this.posY + radius,
|
|
||||||
this.posZ + radius);
|
|
||||||
|
|
||||||
List<Entity> bugs = worldObj.getEntitiesWithinAABBExcludingEntity(this, bb);
|
List<Entity> bugs = worldObj.getEntitiesWithinAABBExcludingEntity(this, bb);
|
||||||
for (Entity e: bugs){
|
for(Entity e : bugs) {
|
||||||
if(e instanceof EntityGlyphid && !(e instanceof EntityGlyphidScout)){
|
if(e instanceof EntityGlyphid && !(e instanceof EntityGlyphidScout)) {
|
||||||
if(((EntityGlyphid) e).getCurrentTask() != task){
|
if(((EntityGlyphid) e).getCurrentTask() != task) {
|
||||||
((EntityGlyphid) e).setCurrentTask(task, waypoint);
|
((EntityGlyphid) e).setCurrentTask(task, waypoint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -580,6 +568,7 @@ public class EntityGlyphid extends EntityMob {
|
|||||||
nbt.setInteger("homeY", homeY);
|
nbt.setInteger("homeY", homeY);
|
||||||
nbt.setInteger("homeZ", homeZ);
|
nbt.setInteger("homeZ", homeZ);
|
||||||
|
|
||||||
|
nbt.setBoolean("hasWaypoint", hasWaypoint);
|
||||||
nbt.setInteger("taskX", taskX);
|
nbt.setInteger("taskX", taskX);
|
||||||
nbt.setInteger("taskY", taskY);
|
nbt.setInteger("taskY", taskY);
|
||||||
nbt.setInteger("taskZ", taskZ);
|
nbt.setInteger("taskZ", taskZ);
|
||||||
@ -597,6 +586,7 @@ public class EntityGlyphid extends EntityMob {
|
|||||||
this.homeY = nbt.getInteger("homeY");
|
this.homeY = nbt.getInteger("homeY");
|
||||||
this.homeZ = nbt.getInteger("homeZ");
|
this.homeZ = nbt.getInteger("homeZ");
|
||||||
|
|
||||||
|
this.hasWaypoint = nbt.getBoolean("hasWaypoint");
|
||||||
this.taskX = nbt.getInteger("taskX");
|
this.taskX = nbt.getInteger("taskX");
|
||||||
this.taskY = nbt.getInteger("taskY");
|
this.taskY = nbt.getInteger("taskY");
|
||||||
this.taskZ = nbt.getInteger("taskZ");
|
this.taskZ = nbt.getInteger("taskZ");
|
||||||
|
|||||||
@ -135,13 +135,7 @@ public class EntityGlyphidNuclear extends EntityGlyphid {
|
|||||||
|
|
||||||
if(deathTicks == 90){
|
if(deathTicks == 90){
|
||||||
int radius = 8;
|
int radius = 8;
|
||||||
AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(
|
AxisAlignedBB bb = AxisAlignedBB.getBoundingBox(this.posX, this.posY, this.posZ, this.posX, this.posY, this.posZ).expand(radius, radius, radius);
|
||||||
this.posX - radius,
|
|
||||||
this.posY - radius,
|
|
||||||
this.posZ - radius,
|
|
||||||
this.posX + radius,
|
|
||||||
this.posY + radius,
|
|
||||||
this.posZ + radius);
|
|
||||||
|
|
||||||
List<Entity> bugs = worldObj.getEntitiesWithinAABBExcludingEntity(this, bb);
|
List<Entity> bugs = worldObj.getEntitiesWithinAABBExcludingEntity(this, bb);
|
||||||
for (Entity e: bugs){
|
for (Entity e: bugs){
|
||||||
|
|||||||
@ -74,9 +74,7 @@ public class EntityGlyphidScout extends EntityGlyphid {
|
|||||||
|
|
||||||
if(MobConfig.rampantGlyphidGuidance && PollutionHandler.targetCoords != null){
|
if(MobConfig.rampantGlyphidGuidance && PollutionHandler.targetCoords != null){
|
||||||
if(!hasTarget) {
|
if(!hasTarget) {
|
||||||
Vec3 dirVec = playerBaseDirFinder(
|
Vec3 dirVec = playerBaseDirFinder(Vec3.createVectorHelper(posX, posY, posZ), getPlayerTargetDirection());
|
||||||
Vec3.createVectorHelper(posX, posY, posZ),
|
|
||||||
PollutionHandler.targetCoords);
|
|
||||||
|
|
||||||
EntityWaypoint target = new EntityWaypoint(worldObj);
|
EntityWaypoint target = new EntityWaypoint(worldObj);
|
||||||
target.setLocationAndAngles(dirVec.xCoord, dirVec.yCoord, dirVec.zCoord, 0, 0);
|
target.setLocationAndAngles(dirVec.xCoord, dirVec.yCoord, dirVec.zCoord, 0, 0);
|
||||||
@ -157,7 +155,7 @@ public class EntityGlyphidScout extends EntityGlyphid {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns true if the position is far enough away from other hives. Also resets the task if unsuccessful. */
|
/** Returns true if the position is far enough away from other hives. Also resets the task if unsuccessful. */
|
||||||
public boolean canBuildHiveHere() {
|
public boolean canBuildHiveHere() {
|
||||||
int length = useLargeHive ? 16 : 8;
|
int length = useLargeHive ? 16 : 8;
|
||||||
@ -308,5 +306,9 @@ public class EntityGlyphidScout extends EntityGlyphid {
|
|||||||
currentLocation.zCoord + dirVec.zCoord * 10
|
currentLocation.zCoord + dirVec.zCoord * 10
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO: replace that with some actual directions
|
||||||
|
protected Vec3 getPlayerTargetDirection() {
|
||||||
|
return PollutionHandler.targetCoords;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user