Class CircleCastEnv
java.lang.Object
at.petrak.hexcasting.api.casting.eval.CastingEnvironment
at.petrak.hexcasting.api.casting.eval.env.CircleCastEnv
-
Nested Class Summary
Nested classes/interfaces inherited from class at.petrak.hexcasting.api.casting.eval.CastingEnvironment
CastingEnvironment.HeldItemInfo, CastingEnvironment.StackDiscoveryMode -
Field Summary
FieldsFields inherited from class at.petrak.hexcasting.api.casting.eval.CastingEnvironment
componentMap, world -
Constructor Summary
ConstructorsConstructorDescriptionCircleCastEnv(net.minecraft.server.level.ServerLevel world, CircleExecutionState execState) -
Method Summary
Modifier and TypeMethodDescriptionlongextractMediaEnvironment(long cost, boolean simulate) Attempt to extract the given amount of media.@Nullable net.minecraft.server.level.ServerPlayerGet the caster.@Nullable net.minecraft.world.entity.LivingEntityGets the caster.net.minecraft.world.InteractionHand@Nullable BlockEntityAbstractImpetusGet an interface used to do mishapsprotected List<CastingEnvironment.HeldItemInfo>Get the primary/secondary item stacks this env can use (i.e.protected List<net.minecraft.world.item.ItemStack>Get all the item stacks this env can use.booleanhasEditPermissionsAtEnvironment(net.minecraft.core.BlockPos pos) Return whether the caster can edit blocks at the given permission (i.e.booleanReturn whether this env can cast great spells.booleanisVecInRangeEnvironment(net.minecraft.world.phys.Vec3 vec) Get if the vec is close enough, to the player or sentinel ...net.minecraft.world.phys.Vec3voidpostExecution(at.petrak.hexcasting.api.casting.eval.CastResult result) Do whatever you like after a pattern is executed.voidprecheckAction(PatternShapeMatch match) If something about this ARE itself is invalid, mishap.voidprintMessage(net.minecraft.network.chat.Component message) voidproduceParticles(at.petrak.hexcasting.api.casting.ParticleSpray particles, FrozenPigment pigment) booleanreplaceItem(Predicate<net.minecraft.world.item.ItemStack> stackOk, net.minecraft.world.item.ItemStack replaceWith, @Nullable net.minecraft.world.InteractionHand hand) Attempt to replace the first stack found which matches the predicate with the stack to replace with.@Nullable FrozenPigmentsetPigment(@Nullable FrozenPigment pigment) Methods inherited from class at.petrak.hexcasting.api.casting.eval.CastingEnvironment
actionKey, addCreateEventListener, addCreateEventListener, addExtension, assertEntityInRange, assertPosInRange, assertPosInRangeForEditing, assertVecInRange, assertVecInWorld, canEditBlockAt, extractMedia, getExtension, getHeldItemToOperateOn, getOtherHand, getPrimaryStacksForPlayer, getUsableStacksForPlayer, getWorld, hasEditPermissionsAt, isCreativeMode, isEntityInRange, isEntityInRange, isVecInAmbit, isVecInRange, isVecInWorld, maxOpCount, postCast, queryForMatchingStack, removeExtension, replaceItemForPlayer, triggerCreateEvent, withdrawItem
-
Field Details
-
execState
-
-
Constructor Details
-
CircleCastEnv
-
-
Method Details
-
getCastingEntity
@Nullable public @Nullable net.minecraft.world.entity.LivingEntity getCastingEntity()Description copied from class:CastingEnvironmentGets the caster. Can be null ifCastingEnvironment.getCaster()is also null- Specified by:
getCastingEntityin classCastingEnvironment- Returns:
- the entity casting
-
getCaster
@Nullable public @Nullable net.minecraft.server.level.ServerPlayer getCaster()Description copied from class:CastingEnvironmentGet the caster. Might be null!Implementations should NOT rely on this in general, use the methods on this class instead. This is mostly for spells (flight, etc)
- Overrides:
getCasterin classCastingEnvironment
-
getImpetus
-
circleState
-
getMishapEnvironment
Description copied from class:CastingEnvironmentGet an interface used to do mishaps- Specified by:
getMishapEnvironmentin classCastingEnvironment
-
precheckAction
public void precheckAction(PatternShapeMatch match) throws at.petrak.hexcasting.api.casting.mishaps.Mishap Description copied from class:CastingEnvironmentIf something about this ARE itself is invalid, mishap.This is used for stuff like requiring enlightenment and pattern denylists
- Overrides:
precheckActionin classCastingEnvironment- Throws:
at.petrak.hexcasting.api.casting.mishaps.Mishap
-
postExecution
public void postExecution(at.petrak.hexcasting.api.casting.eval.CastResult result) Description copied from class:CastingEnvironmentDo whatever you like after a pattern is executed.- Overrides:
postExecutionin classCastingEnvironment
-
mishapSprayPos
public net.minecraft.world.phys.Vec3 mishapSprayPos()- Specified by:
mishapSprayPosin classCastingEnvironment
-
extractMediaEnvironment
public long extractMediaEnvironment(long cost, boolean simulate) Description copied from class:CastingEnvironmentAttempt to extract the given amount of media. Returns the amount of media left in the cost.If there was enough media found, it will return less or equal to zero; if there wasn't, it will be positive.
- Specified by:
extractMediaEnvironmentin classCastingEnvironment
-
isVecInRangeEnvironment
public boolean isVecInRangeEnvironment(net.minecraft.world.phys.Vec3 vec) Description copied from class:CastingEnvironmentGet if the vec is close enough, to the player or sentinel ...Doesn't take into account being out of the world.
- Specified by:
isVecInRangeEnvironmentin classCastingEnvironment
-
isEnlightened
public boolean isEnlightened()Description copied from class:CastingEnvironmentReturn whether this env can cast great spells.- Overrides:
isEnlightenedin classCastingEnvironment
-
hasEditPermissionsAtEnvironment
public boolean hasEditPermissionsAtEnvironment(net.minecraft.core.BlockPos pos) Description copied from class:CastingEnvironmentReturn whether the caster can edit blocks at the given permission (i.e. not adventure mode, etc.)- Specified by:
hasEditPermissionsAtEnvironmentin classCastingEnvironment
-
getCastingHand
public net.minecraft.world.InteractionHand getCastingHand()- Specified by:
getCastingHandin classCastingEnvironment
-
getUsableStacks
protected List<net.minecraft.world.item.ItemStack> getUsableStacks(CastingEnvironment.StackDiscoveryMode mode) Description copied from class:CastingEnvironmentGet all the item stacks this env can use.- Specified by:
getUsableStacksin classCastingEnvironment
-
getPrimaryStacks
Description copied from class:CastingEnvironmentGet the primary/secondary item stacks this env can use (i.e. main hand and offhand for the player).- Specified by:
getPrimaryStacksin classCastingEnvironment
-
replaceItem
public boolean replaceItem(Predicate<net.minecraft.world.item.ItemStack> stackOk, net.minecraft.world.item.ItemStack replaceWith, @Nullable @Nullable net.minecraft.world.InteractionHand hand) Description copied from class:CastingEnvironmentAttempt to replace the first stack found which matches the predicate with the stack to replace with.- Specified by:
replaceItemin classCastingEnvironment- Returns:
- whether it was successful.
-
getPigment
- Specified by:
getPigmentin classCastingEnvironment
-
setPigment
- Specified by:
setPigmentin classCastingEnvironment
-
produceParticles
public void produceParticles(at.petrak.hexcasting.api.casting.ParticleSpray particles, FrozenPigment pigment) - Specified by:
produceParticlesin classCastingEnvironment
-
printMessage
public void printMessage(net.minecraft.network.chat.Component message) - Specified by:
printMessagein classCastingEnvironment
-