public interface IAuraChunk
extends net.minecraftforge.common.capabilities.ICapabilityProvider, net.minecraftforge.common.util.INBTSerializable<net.minecraft.nbt.NBTTagCompound>
Chunk. To get an instance for a chunk, use getAuraChunk(World, BlockPos).
It is not intended for API users to create custom implementation of this class.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_AURA
The default amount of Aura that a chunk has stored
|
| Modifier and Type | Method and Description |
|---|---|
int |
drainAura(net.minecraft.util.math.BlockPos pos,
int amount)
Convenience version of
drainAura(BlockPos, int, boolean,
boolean) with aimForZero and simulate set to false, as this is the most
likely behavior you will want. |
int |
drainAura(net.minecraft.util.math.BlockPos pos,
int amount,
boolean aimForZero,
boolean simulate)
Drains the given amount of Aura from the given position.
|
static IAuraChunk |
getAuraChunk(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos)
This method is used to get information about the Aura in any given chunk.
|
static int |
getAuraInArea(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
int radius)
Convenience method that adds up all of the aura from each drain spot from
getSpotsInArea(World, BlockPos, int, BiConsumer) and
conveniently returns it. |
int |
getDrainSpot(net.minecraft.util.math.BlockPos pos) |
static net.minecraft.util.math.BlockPos |
getHighestSpot(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
int radius,
net.minecraft.util.math.BlockPos defaultSpot)
This method returns the position of the highest drain spot (meaning the
one that has the most Aura stored) in the given area.
|
static net.minecraft.util.math.BlockPos |
getLowestSpot(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
int radius,
net.minecraft.util.math.BlockPos defaultSpot)
This method returns the position of the lowest drain spot (meaning the
one that has the least Aura stored) in the given area.
|
void |
getSpotsInArea(net.minecraft.util.math.BlockPos pos,
int radius,
java.util.function.BiConsumer<net.minecraft.util.math.BlockPos,java.lang.Integer> consumer) |
static void |
getSpotsInArea(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
int radius,
java.util.function.BiConsumer<net.minecraft.util.math.BlockPos,java.lang.Integer> consumer)
This method uses the supplied consumer to iterate over all the drain
spots, represented as a position and the number of Aura in them, in any
given area.
|
IAuraType |
getType() |
void |
markDirty() |
int |
storeAura(net.minecraft.util.math.BlockPos pos,
int amount)
Convenience version of
storeAura(BlockPos, int, boolean,
boolean) with aimForZero set to true and simulate set to false, as this
is the most likely behavior you will want. |
int |
storeAura(net.minecraft.util.math.BlockPos pos,
int amount,
boolean aimForZero,
boolean simulate)
Stores the given amount of Aura at the given position.
|
static int |
triangulateAuraInArea(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
int radius)
Convenience method that adds up all of the aura from each drain spot from
getSpotsInArea(World, BlockPos, int, BiConsumer), but multiplies
their amount by the percentual distance to the supplied position. |
static final int DEFAULT_AURA
static IAuraChunk getAuraChunk(net.minecraft.world.World world, net.minecraft.util.math.BlockPos pos)
world - The worldpos - A position that the chunk containsIAuraChunk instance belonging to the chunkstatic void getSpotsInArea(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
int radius,
java.util.function.BiConsumer<net.minecraft.util.math.BlockPos,java.lang.Integer> consumer)
Notice that this is different from getSpotsInArea(BlockPos, int,
BiConsumer) because this method iterates over several chunks while the
former only uses the current aura chunk instance. Most of the time, you
will want to use this method.
world - The worldpos - The center positionradius - The radius around the center to search for spots inconsumer - A consumer that gets given the position and amount of
aura in each drain spot foundstatic int getAuraInArea(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
int radius)
getSpotsInArea(World, BlockPos, int, BiConsumer) and
conveniently returns it. For a better visual display with a more gradual
increase, use triangulateAuraInArea(World, BlockPos, int).world - The worldpos - The center positionradius - The radius around the center to search for spots instatic int triangulateAuraInArea(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
int radius)
getSpotsInArea(World, BlockPos, int, BiConsumer), but multiplies
their amount by the percentual distance to the supplied position. This
will cause for a lot more gradual of an increase and decrease of Aura
when moving closer to actual spots. This should be used for visual
purposes as it is more performance intensive than getAuraInArea(World, BlockPos, int).world - The worldpos - The center positionradius - The radius around the center to search for spots instatic net.minecraft.util.math.BlockPos getLowestSpot(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
int radius,
net.minecraft.util.math.BlockPos defaultSpot)
world - The worldpos - The center positionradius - The radius around the center to search for spots indefaultSpot - A position that will be used to create a new drain
spot when none are foundstatic net.minecraft.util.math.BlockPos getHighestSpot(net.minecraft.world.World world,
net.minecraft.util.math.BlockPos pos,
int radius,
net.minecraft.util.math.BlockPos defaultSpot)
world - The worldpos - The center positionradius - The radius around the center to search for spots indefaultSpot - A position that will be used to create a new drain
spot when none are foundvoid getSpotsInArea(net.minecraft.util.math.BlockPos pos,
int radius,
java.util.function.BiConsumer<net.minecraft.util.math.BlockPos,java.lang.Integer> consumer)
int drainAura(net.minecraft.util.math.BlockPos pos,
int amount,
boolean aimForZero,
boolean simulate)
pos - The positionamount - The amount to drainaimForZero - If true, and draining the given amount would make the
level go from positive to negative, an amount will be
drained instead that will cause the spot's amount to be
0.int drainAura(net.minecraft.util.math.BlockPos pos,
int amount)
drainAura(BlockPos, int, boolean,
boolean) with aimForZero and simulate set to false, as this is the most
likely behavior you will want. Notice that storeAura(BlockPos,
int) has aimForZero set to true.int storeAura(net.minecraft.util.math.BlockPos pos,
int amount,
boolean aimForZero,
boolean simulate)
pos - The positionamount - The amount to storeaimForZero - If true, and storing the given amount would make the
level go from negative to positive, an amount will be
stored instead that will cause the spot's amount to be
0.int storeAura(net.minecraft.util.math.BlockPos pos,
int amount)
storeAura(BlockPos, int, boolean,
boolean) with aimForZero set to true and simulate set to false, as this
is the most likely behavior you will want. Notice that drainAura(BlockPos, int) has aimForZero set to false.int getDrainSpot(net.minecraft.util.math.BlockPos pos)
IAuraType getType()
void markDirty()