mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
misc fix
This commit is contained in:
parent
603cc10696
commit
c33b962043
@ -16,6 +16,7 @@ import net.minecraft.entity.monster.EntityMob;
|
|||||||
import net.minecraft.entity.passive.EntityVillager;
|
import net.minecraft.entity.passive.EntityVillager;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.EnumDifficulty;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class EntityUndeadSoldier extends EntityMob {
|
public class EntityUndeadSoldier extends EntityMob {
|
||||||
@ -111,6 +112,11 @@ public class EntityUndeadSoldier extends EntityMob {
|
|||||||
return EnumCreatureAttribute.UNDEAD;
|
return EnumCreatureAttribute.UNDEAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean getCanSpawnHere() {
|
||||||
|
return this.worldObj.difficultySetting != EnumDifficulty.PEACEFUL && this.worldObj.checkNoEntityCollision(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() && !this.worldObj.isAnyLiquid(this.boundingBox);
|
||||||
|
}
|
||||||
|
|
||||||
@Override protected void dropFewItems(boolean player, int loot) { }
|
@Override protected void dropFewItems(boolean player, int loot) { }
|
||||||
@Override protected void dropEquipment(boolean player, int loot) { }
|
@Override protected void dropEquipment(boolean player, int loot) { }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,19 +40,25 @@ public class DungeonSpawnerActions {
|
|||||||
int y = tile.yCoord;
|
int y = tile.yCoord;
|
||||||
int z = tile.zCoord;
|
int z = tile.zCoord;
|
||||||
if (tile.phase == 1 || tile.phase == 2) {
|
if (tile.phase == 1 || tile.phase == 2) {
|
||||||
|
tile.player = world.getClosestPlayer(x,y,z, 25);
|
||||||
if (tile.timer == 0) {
|
if (tile.timer == 0) {
|
||||||
Vec3NT vec = new Vec3NT(10, 0, 0);
|
Vec3NT vec = new Vec3NT(20, 0, 0);
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
|
|
||||||
|
if(vec.xCoord > 8) vec.xCoord += world.rand.nextInt(10) - 5;
|
||||||
|
|
||||||
EntityUndeadSoldier mob = new EntityUndeadSoldier(world);
|
EntityUndeadSoldier mob = new EntityUndeadSoldier(world);
|
||||||
for (int j = 0; j < 7; j++) {
|
for (int j = 0; j < 7; j++) {
|
||||||
mob.setPositionAndRotation(x + 0.5 + vec.xCoord, y - 5, z + 0.5 + vec.zCoord, i * 36F, 0);
|
mob.setPositionAndRotation(x + 0.5 + vec.xCoord, world.getHeightValue((int) (x + 0.5 + vec.xCoord),(int) (z + 0.5 + vec.zCoord)), z + 0.5 + vec.zCoord, i * 36F, 0);
|
||||||
if (mob.getCanSpawnHere()) {
|
if (mob.getCanSpawnHere()) {
|
||||||
mob.onSpawnWithEgg(null);
|
mob.onSpawnWithEgg(null);
|
||||||
|
if(tile.player != null){
|
||||||
|
mob.setTarget(tile.player);
|
||||||
|
}
|
||||||
world.spawnEntityInWorld(mob);
|
world.spawnEntityInWorld(mob);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
vec.rotateAroundYDeg(36D);
|
vec.rotateAroundYDeg(36D);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,13 +32,15 @@ public class DungeonSpawnerConditions {
|
|||||||
int x = tile.xCoord;
|
int x = tile.xCoord;
|
||||||
int y = tile.yCoord;
|
int y = tile.yCoord;
|
||||||
int z = tile.zCoord;
|
int z = tile.zCoord;
|
||||||
|
|
||||||
|
boolean aoeCheck = !world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y - 2, z + 1).expand(10, 10, 10)).isEmpty();
|
||||||
if(tile.phase == 0) {
|
if(tile.phase == 0) {
|
||||||
if(world.getTotalWorldTime() % 20 != 0) return false;
|
if(world.getTotalWorldTime() % 20 != 0) return false;
|
||||||
return !world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y - 2, z + 1).expand(20, 10, 20)).isEmpty();
|
return aoeCheck;
|
||||||
}
|
}
|
||||||
if(tile.phase < 3) {
|
if(tile.phase < 3) {
|
||||||
if(world.getTotalWorldTime() % 20 != 0 || tile.timer < 60) return false;
|
if(world.getTotalWorldTime() % 20 != 0 || tile.timer < 60) return false;
|
||||||
return world.getEntitiesWithinAABB(EntityUndeadSoldier.class, AxisAlignedBB.getBoundingBox(x, y, z, x - 2, y + 1, z + 1).expand(50, 20, 50)).isEmpty();
|
return world.getEntitiesWithinAABB(EntityUndeadSoldier.class, AxisAlignedBB.getBoundingBox(x, y, z, x - 2, y + 1, z + 1).expand(50, 20, 50)).isEmpty() && aoeCheck;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user