Run formatter
This commit is contained in:
parent
61c44a831b
commit
08258fd6ef
606 changed files with 13464 additions and 22975 deletions
|
@ -1,5 +1,7 @@
|
|||
package WayofTime.bloodmagic.entity.projectile;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.meteor.MeteorRegistry;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntityThrowable;
|
||||
|
@ -11,27 +13,20 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.registry.IThrowableEntity;
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import WayofTime.bloodmagic.meteor.MeteorRegistry;
|
||||
|
||||
public class EntityMeteor extends EntityThrowable implements IThrowableEntity
|
||||
{
|
||||
public class EntityMeteor extends EntityThrowable implements IThrowableEntity {
|
||||
public ItemStack meteorStack = ItemStack.EMPTY;
|
||||
protected int ticksInAir = 0;
|
||||
protected int maxTicksInAir = 600;
|
||||
|
||||
protected double radiusModifier = 1;
|
||||
protected double explosionModifier = 1;
|
||||
protected double fillerChance = 0;
|
||||
|
||||
public ItemStack meteorStack = ItemStack.EMPTY;
|
||||
|
||||
public EntityMeteor(World world)
|
||||
{
|
||||
public EntityMeteor(World world) {
|
||||
super(world);
|
||||
}
|
||||
|
||||
public EntityMeteor(World world, double x, double y, double z, double velX, double velY, double velZ, double radiusModifier, double explosionModifier, double fillerChance)
|
||||
{
|
||||
public EntityMeteor(World world, double x, double y, double z, double velX, double velY, double velZ, double radiusModifier, double explosionModifier, double fillerChance) {
|
||||
super(world);
|
||||
this.setSize(1F, 1F);
|
||||
this.setPosition(x, y, z);
|
||||
|
@ -44,39 +39,31 @@ public class EntityMeteor extends EntityThrowable implements IThrowableEntity
|
|||
}
|
||||
|
||||
@Override
|
||||
protected float getGravityVelocity()
|
||||
{
|
||||
protected float getGravityVelocity() {
|
||||
return 0.03F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate()
|
||||
{
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
if (this.ticksExisted > this.maxTicksInAir)
|
||||
{
|
||||
if (this.ticksExisted > this.maxTicksInAir) {
|
||||
setDead();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(RayTraceResult mop)
|
||||
{
|
||||
if (mop.typeOfHit == RayTraceResult.Type.ENTITY && mop.entityHit != null)
|
||||
{
|
||||
protected void onImpact(RayTraceResult mop) {
|
||||
if (mop.typeOfHit == RayTraceResult.Type.ENTITY && mop.entityHit != null) {
|
||||
this.onImpact(mop.entityHit);
|
||||
} else if (mop.typeOfHit == RayTraceResult.Type.BLOCK)
|
||||
{
|
||||
} else if (mop.typeOfHit == RayTraceResult.Type.BLOCK) {
|
||||
generateMeteor(mop.getBlockPos());
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
protected void onImpact(Entity mop)
|
||||
{
|
||||
if (mop instanceof EntityLivingBase)
|
||||
{
|
||||
protected void onImpact(Entity mop) {
|
||||
if (mop instanceof EntityLivingBase) {
|
||||
doDamage(100, mop);
|
||||
}
|
||||
|
||||
|
@ -86,24 +73,20 @@ public class EntityMeteor extends EntityThrowable implements IThrowableEntity
|
|||
this.setDead();
|
||||
}
|
||||
|
||||
protected void doDamage(int i, Entity mop)
|
||||
{
|
||||
protected void doDamage(int i, Entity mop) {
|
||||
mop.attackEntityFrom(this.getDamageSource(), i);
|
||||
}
|
||||
|
||||
public void generateMeteor(BlockPos pos)
|
||||
{
|
||||
public void generateMeteor(BlockPos pos) {
|
||||
MeteorRegistry.generateMeteorForItem(meteorStack, getEntityWorld(), pos, Blocks.STONE.getDefaultState(), radiusModifier, explosionModifier, fillerChance);
|
||||
}
|
||||
|
||||
public DamageSource getDamageSource()
|
||||
{
|
||||
public DamageSource getDamageSource() {
|
||||
return DamageSource.ANVIL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeEntityToNBT(NBTTagCompound nbt)
|
||||
{
|
||||
public void writeEntityToNBT(NBTTagCompound nbt) {
|
||||
super.writeEntityToNBT(nbt);
|
||||
nbt.setInteger(Constants.NBT.PROJECTILE_TICKS_IN_AIR, ticksInAir);
|
||||
nbt.setInteger(Constants.NBT.PROJECTILE_MAX_TICKS_IN_AIR, maxTicksInAir);
|
||||
|
@ -117,8 +100,7 @@ public class EntityMeteor extends EntityThrowable implements IThrowableEntity
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readEntityFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
public void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
super.readEntityFromNBT(nbt);
|
||||
ticksInAir = nbt.getInteger(Constants.NBT.PROJECTILE_TICKS_IN_AIR);
|
||||
maxTicksInAir = nbt.getInteger(Constants.NBT.PROJECTILE_MAX_TICKS_IN_AIR);
|
||||
|
@ -132,20 +114,17 @@ public class EntityMeteor extends EntityThrowable implements IThrowableEntity
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean canTriggerWalking()
|
||||
{
|
||||
protected boolean canTriggerWalking() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeCollidedWith()
|
||||
{
|
||||
public boolean canBeCollidedWith() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setThrower(Entity entity)
|
||||
{
|
||||
public void setThrower(Entity entity) {
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue