2016-10-16 15:19:57 -04:00
|
|
|
package WayofTime.bloodmagic.alchemyArray;
|
|
|
|
|
2017-08-15 21:30:48 -07:00
|
|
|
import WayofTime.bloodmagic.api.alchemyCrafting.AlchemyArrayEffect;
|
|
|
|
import WayofTime.bloodmagic.api.iface.IAlchemyArray;
|
2016-10-16 15:19:57 -04:00
|
|
|
import net.minecraft.block.state.IBlockState;
|
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
|
|
import net.minecraft.nbt.NBTTagCompound;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
2017-08-15 21:30:48 -07:00
|
|
|
public class AlchemyArrayEffectBounce extends AlchemyArrayEffect {
|
|
|
|
public AlchemyArrayEffectBounce(String key) {
|
2016-10-16 15:19:57 -04:00
|
|
|
super(key);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public boolean update(TileEntity tile, int ticksActive) {
|
2016-10-16 15:19:57 -04:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public void onEntityCollidedWithBlock(IAlchemyArray array, World world, BlockPos pos, IBlockState state, Entity entity) {
|
|
|
|
if (entity.isSneaking()) {
|
2016-10-16 15:19:57 -04:00
|
|
|
return;
|
2017-08-15 21:30:48 -07:00
|
|
|
} else if (entity.motionY < 0.0D) {
|
2016-10-16 15:19:57 -04:00
|
|
|
entity.motionY = -entity.motionY;
|
|
|
|
|
2017-08-15 21:30:48 -07:00
|
|
|
if (!(entity instanceof EntityLivingBase)) {
|
2016-10-16 15:19:57 -04:00
|
|
|
entity.motionY *= 0.8D;
|
|
|
|
}
|
|
|
|
|
|
|
|
entity.fallDistance = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public void writeToNBT(NBTTagCompound tag) {
|
2016-10-16 15:19:57 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public void readFromNBT(NBTTagCompound tag) {
|
2016-10-16 15:19:57 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-15 21:30:48 -07:00
|
|
|
public AlchemyArrayEffect getNewCopy() {
|
2016-10-16 15:19:57 -04:00
|
|
|
return new AlchemyArrayEffectBounce(key);
|
|
|
|
}
|
|
|
|
}
|