2016-01-05 04:47:35 +01:00
|
|
|
package de.ellpeck.actuallyadditions.api.lens;
|
|
|
|
|
2016-01-05 14:57:50 +01:00
|
|
|
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
|
2020-09-07 16:24:04 +02:00
|
|
|
import net.minecraft.block.BlockState;
|
|
|
|
import net.minecraft.util.Direction;
|
2016-03-18 23:47:22 +01:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
2016-01-05 04:47:35 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This is the base class for a Reconstructor Lens Type (NOT THE ITEM!)
|
|
|
|
*/
|
2019-05-02 09:10:29 +02:00
|
|
|
public abstract class Lens {
|
2016-01-05 04:47:35 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Invokes the lens type's behavior on a block
|
2016-02-01 17:49:55 +01:00
|
|
|
*
|
2016-01-05 04:47:35 +01:00
|
|
|
* @param hitBlock The block that was hit
|
2016-02-01 17:49:55 +01:00
|
|
|
* @param tile The tile the lens was invoked from
|
2016-01-05 04:47:35 +01:00
|
|
|
* @return If the Reconstructor should stop continuing (return false if you want it to go through blocks)
|
|
|
|
*/
|
2020-09-07 16:24:04 +02:00
|
|
|
public abstract boolean invoke(BlockState hitState, BlockPos hitBlock, IAtomicReconstructor tile);
|
2016-01-05 04:47:35 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the color in an array of 3 float values that are r, g, b
|
|
|
|
*/
|
|
|
|
public abstract float[] getColor();
|
|
|
|
|
|
|
|
/**
|
2016-03-18 23:47:22 +01:00
|
|
|
* Gets the maximum distance the beam goes with this lens
|
2016-01-05 04:47:35 +01:00
|
|
|
*/
|
|
|
|
public abstract int getDistance();
|
|
|
|
|
2016-07-20 09:49:19 +02:00
|
|
|
/**
|
|
|
|
* @return If the lens can be invoked at the current time
|
|
|
|
*/
|
2020-09-07 16:24:04 +02:00
|
|
|
public boolean canInvoke(IAtomicReconstructor tile, Direction sideToShootTo, int energyUsePerShot) {
|
2016-07-20 09:49:19 +02:00
|
|
|
return true;
|
|
|
|
}
|
2016-01-05 04:47:35 +01:00
|
|
|
}
|