Initial 1.11.2 update
This commit is contained in:
@@ -25,38 +25,39 @@ public class EntityBlackHole extends EntityMagicConstruct {
|
||||
this.width = 6.0f;
|
||||
this.height = 3.0f;
|
||||
randomiser = new int[30];
|
||||
for(int i=0; i<randomiser.length; i++){
|
||||
for(int i = 0; i < randomiser.length; i++){
|
||||
randomiser[i] = this.rand.nextInt(10);
|
||||
}
|
||||
randomiser2 = new int[30];
|
||||
for(int i=0; i<randomiser2.length; i++){
|
||||
for(int i = 0; i < randomiser2.length; i++){
|
||||
randomiser2[i] = this.rand.nextInt(10);
|
||||
}
|
||||
}
|
||||
|
||||
public EntityBlackHole(World world, double x, double y, double z, EntityLivingBase caster, int lifetime, float damageMultiplier) {
|
||||
public EntityBlackHole(World world, double x, double y, double z, EntityLivingBase caster, int lifetime,
|
||||
float damageMultiplier){
|
||||
super(world, x, y, z, caster, lifetime, damageMultiplier);
|
||||
this.width = 6.0f;
|
||||
this.height = 3.0f;
|
||||
randomiser = new int[30];
|
||||
for(int i=0; i<randomiser.length; i++){
|
||||
for(int i = 0; i < randomiser.length; i++){
|
||||
randomiser[i] = this.rand.nextInt(10);
|
||||
}
|
||||
randomiser2 = new int[30];
|
||||
for(int i=0; i<randomiser2.length; i++){
|
||||
for(int i = 0; i < randomiser2.length; i++){
|
||||
randomiser2[i] = this.rand.nextInt(10);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound) {
|
||||
protected void readEntityFromNBT(NBTTagCompound nbttagcompound){
|
||||
super.readEntityFromNBT(nbttagcompound);
|
||||
randomiser = nbttagcompound.getIntArray("randomiser");
|
||||
randomiser2 = nbttagcompound.getIntArray("randomiser2");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound) {
|
||||
protected void writeEntityToNBT(NBTTagCompound nbttagcompound){
|
||||
super.writeEntityToNBT(nbttagcompound);
|
||||
nbttagcompound.setIntArray("randomiser", randomiser);
|
||||
nbttagcompound.setIntArray("randomiser2", randomiser2);
|
||||
@@ -66,13 +67,18 @@ public class EntityBlackHole extends EntityMagicConstruct {
|
||||
|
||||
super.onUpdate();
|
||||
|
||||
//System.out.println("Client side: " + this.worldObj.isRemote + ", Caster: " + this.caster);
|
||||
// System.out.println("Client side: " + this.world.isRemote + ", Caster: " + this.caster);
|
||||
|
||||
// Particle effect. Finishes 40 ticks before the end so the particles disappear at the same time.
|
||||
if(this.ticksExisted + 40 < this.lifetime){
|
||||
for (int i=0; i<5; i++){
|
||||
//this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - 0.75D, this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, (this.rand.nextDouble() - 0.5D) * 2.0D, -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
|
||||
this.worldObj.spawnParticle(EnumParticleTypes.PORTAL, this.posX, this.posY, this.posZ, (this.rand.nextDouble() - 0.5D) * 4.0D, (this.rand.nextDouble() - 0.5D) * 4.0D - 1, (this.rand.nextDouble() - 0.5D) * 4.0D);
|
||||
for(int i = 0; i < 5; i++){
|
||||
// this.world.spawnParticle(EnumParticleTypes.PORTAL, this.posX + (this.rand.nextDouble() - 0.5D) *
|
||||
// (double)this.width, this.posY + this.rand.nextDouble() * (double)this.height - 0.75D, this.posZ +
|
||||
// (this.rand.nextDouble() - 0.5D) * (double)this.width, (this.rand.nextDouble() - 0.5D) * 2.0D,
|
||||
// -this.rand.nextDouble(), (this.rand.nextDouble() - 0.5D) * 2.0D);
|
||||
this.world.spawnParticle(EnumParticleTypes.PORTAL, this.posX, this.posY, this.posZ,
|
||||
(this.rand.nextDouble() - 0.5D) * 4.0D, (this.rand.nextDouble() - 0.5D) * 4.0D - 1,
|
||||
(this.rand.nextDouble() - 0.5D) * 4.0D);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,9 +88,10 @@ public class EntityBlackHole extends EntityMagicConstruct {
|
||||
this.playSound(SoundEvents.BLOCK_PORTAL_AMBIENT, 1.5f, 1.0f);
|
||||
}
|
||||
|
||||
List<EntityLivingBase> targets = WizardryUtilities.getEntitiesWithinRadius(6.0d, this.posX, this.posY, this.posZ, this.worldObj);
|
||||
List<EntityLivingBase> targets = WizardryUtilities.getEntitiesWithinRadius(6.0d, this.posX, this.posY,
|
||||
this.posZ, this.world);
|
||||
|
||||
if(!this.worldObj.isRemote){
|
||||
if(!this.world.isRemote){
|
||||
|
||||
for(EntityLivingBase target : targets){
|
||||
|
||||
@@ -92,21 +99,21 @@ public class EntityBlackHole extends EntityMagicConstruct {
|
||||
|
||||
// Sucks the target in
|
||||
if(this.posX > target.posX && target.motionX < 1){
|
||||
target.motionX+=0.1;
|
||||
target.motionX += 0.1;
|
||||
}else if(this.posX < target.posX && target.motionX > -1){
|
||||
target.motionX-=0.1;
|
||||
target.motionX -= 0.1;
|
||||
}
|
||||
|
||||
if(this.posY > target.posY && target.motionY < 1){
|
||||
target.motionY+=0.1;
|
||||
target.motionY += 0.1;
|
||||
}else if(this.posY < target.posY && target.motionY > -1){
|
||||
target.motionY-=0.1;
|
||||
target.motionY -= 0.1;
|
||||
}
|
||||
|
||||
if(this.posZ > target.posZ && target.motionZ < 1){
|
||||
target.motionZ+=0.1;
|
||||
target.motionZ += 0.1;
|
||||
}else if(this.posZ < target.posZ && target.motionZ > -1){
|
||||
target.motionZ-=0.1;
|
||||
target.motionZ -= 0.1;
|
||||
}
|
||||
|
||||
// Player motion is handled on that player's client so needs packets
|
||||
@@ -117,9 +124,11 @@ public class EntityBlackHole extends EntityMagicConstruct {
|
||||
if(this.getDistanceToEntity(target) <= 2){
|
||||
// Damages the target if it is close enough
|
||||
if(this.getCaster() != null){
|
||||
target.attackEntityFrom(MagicDamage.causeIndirectMagicDamage(this, getCaster(), DamageType.MAGIC), 2*damageMultiplier);
|
||||
target.attackEntityFrom(
|
||||
MagicDamage.causeIndirectMagicDamage(this, getCaster(), DamageType.MAGIC),
|
||||
2 * damageMultiplier);
|
||||
}else{
|
||||
target.attackEntityFrom(DamageSource.magic, 2*damageMultiplier);
|
||||
target.attackEntityFrom(DamageSource.MAGIC, 2 * damageMultiplier);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,8 +139,7 @@ public class EntityBlackHole extends EntityMagicConstruct {
|
||||
/**
|
||||
* Checks using a Vec3dd to determine if this entity is within range of that vector to be rendered. Args: Vec3dD
|
||||
*/
|
||||
public boolean isInRangeToRenderVec3dD(Vec3d par1Vec3d)
|
||||
{
|
||||
public boolean isInRangeToRenderVec3dD(Vec3d par1Vec3d){
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user