Class BlockEntityAbstractImpetus
java.lang.Object
net.minecraft.world.level.block.entity.BlockEntity
at.petrak.hexcasting.api.block.HexBlockEntity
at.petrak.hexcasting.api.casting.circles.BlockEntityAbstractImpetus
- All Implemented Interfaces:
net.minecraft.world.Clearable,net.minecraft.world.Container,net.minecraft.world.WorldlyContainer
- Direct Known Subclasses:
BlockEntityLookingImpetus,BlockEntityRedstoneImpetus,BlockEntityRightClickImpetus
public abstract class BlockEntityAbstractImpetus
extends HexBlockEntity
implements net.minecraft.world.WorldlyContainer
Default impl for an impetus, not tecnically necessary but I'm exposing it for ease of use
This does assume a great deal so you might have to re-implement a lot of this yourself if you wanna do something wild and new
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected @Nullable net.minecraft.world.item.ItemStackprotected @Nullable net.minecraft.network.chat.Componentprotected @Nullable CircleExecutionStateprotected longprotected @Nullable FrozenPigmentstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class net.minecraft.world.level.block.entity.BlockEntity
level, remove, worldPositionFields inherited from interface net.minecraft.world.Container
DEFAULT_DISTANCE_LIMIT, LARGE_MAX_STACK_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionBlockEntityAbstractImpetus(net.minecraft.world.level.block.entity.BlockEntityType<?> pType, net.minecraft.core.BlockPos pWorldPosition, net.minecraft.world.level.block.state.BlockState pBlockState) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyScryingLensOverlay(List<com.mojang.datafixers.util.Pair<net.minecraft.world.item.ItemStack, net.minecraft.network.chat.Component>> lines, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player observer, net.minecraft.world.level.Level world, net.minecraft.core.Direction hitFace) booleancanPlaceItem(int index, net.minecraft.world.item.ItemStack stack) booleancanPlaceItemThroughFace(int index, net.minecraft.world.item.ItemStack stack, @Nullable net.minecraft.core.Direction dir) booleancanTakeItemThroughFace(int var1, net.minecraft.world.item.ItemStack var2, net.minecraft.core.Direction var3) voidvoidvoidlongextractMediaFromInsertedItem(net.minecraft.world.item.ItemStack stack, boolean simulate) protected static net.minecraft.world.phys.AABBint@Nullable net.minecraft.network.chat.Component@Nullable CircleExecutionStateONLY CALL THIS WHEN YOU KNOW THE WORLD EXISTS AND ON THE SERVER, lazy-loads itnet.minecraft.world.item.ItemStackgetItem(int index) longgetMedia()int[]getSlotsForFace(net.minecraft.core.Direction var1) net.minecraft.core.DirectionvoidinsertMedia(net.minecraft.world.item.ItemStack stack) booleanisEmpty()protected voidloadModData(net.minecraft.nbt.CompoundTag tag) voidpostDisplay(net.minecraft.network.chat.Component error, net.minecraft.world.item.ItemStack display) voidpostMishap(net.minecraft.network.chat.Component mishapDisplay) voidpostNoExits(net.minecraft.core.BlockPos pos) voidpostPrint(net.minecraft.network.chat.Component printDisplay) longnet.minecraft.world.item.ItemStackremoveItem(int index, int count) net.minecraft.world.item.ItemStackremoveItemNoUpdate(int index) protected voidsaveModData(net.minecraft.nbt.CompoundTag tag) protected intsemitoneFromScale(int note) voidvoidsetItem(int index, net.minecraft.world.item.ItemStack stack) voidsetMedia(long media) @Nullable FrozenPigmentsetPigment(@Nullable FrozenPigment pigment) voidstartExecution(@Nullable net.minecraft.server.level.ServerPlayer player) booleanstillValid(net.minecraft.world.entity.player.Player player) voidMethods inherited from class at.petrak.hexcasting.api.block.HexBlockEntity
getUpdatePacket, getUpdateTag, load, saveAdditional, syncMethods inherited from class net.minecraft.world.level.block.entity.BlockEntity
addEntityType, clearRemoved, fillCrashReportCategory, getBlockPos, getBlockState, getLevel, getPosFromTag, getType, hasLevel, isRemoved, loadStatic, onlyOpCanSetNbt, saveToItem, saveWithFullMetadata, saveWithId, saveWithoutMetadata, setBlockState, setChanged, setChanged, setLevel, setRemoved, triggerEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.world.Container
canTakeItem, countItem, getMaxStackSize, hasAnyMatching, hasAnyOf, setChanged, startOpen, stopOpen
-
Field Details
-
TAG_EXECUTION_STATE
- See Also:
-
TAG_MEDIA
- See Also:
-
TAG_ERROR_MSG
- See Also:
-
TAG_ERROR_DISPLAY
- See Also:
-
TAG_PIGMENT
- See Also:
-
executionState
-
media
protected long media -
displayMsg
@Nullable protected @Nullable net.minecraft.network.chat.Component displayMsg -
displayItem
@Nullable protected @Nullable net.minecraft.world.item.ItemStack displayItem -
pigment
-
-
Constructor Details
-
BlockEntityAbstractImpetus
public BlockEntityAbstractImpetus(net.minecraft.world.level.block.entity.BlockEntityType<?> pType, net.minecraft.core.BlockPos pWorldPosition, net.minecraft.world.level.block.state.BlockState pBlockState)
-
-
Method Details
-
getStartDirection
public net.minecraft.core.Direction getStartDirection() -
getDisplayMsg
@Nullable public @Nullable net.minecraft.network.chat.Component getDisplayMsg() -
clearDisplay
public void clearDisplay() -
postDisplay
public void postDisplay(net.minecraft.network.chat.Component error, net.minecraft.world.item.ItemStack display) -
postMishap
public void postMishap(net.minecraft.network.chat.Component mishapDisplay) -
postPrint
public void postPrint(net.minecraft.network.chat.Component printDisplay) -
postNoExits
public void postNoExits(net.minecraft.core.BlockPos pos) -
tickExecution
public void tickExecution() -
endExecution
public void endExecution() -
getExecutionState
ONLY CALL THIS WHEN YOU KNOW THE WORLD EXISTS AND ON THE SERVER, lazy-loads it -
startExecution
public void startExecution(@Nullable @Nullable net.minecraft.server.level.ServerPlayer player) -
getBounds
@Contract(pure=true) protected static net.minecraft.world.phys.AABB getBounds(List<net.minecraft.core.BlockPos> poses) -
getMedia
public long getMedia() -
setMedia
public void setMedia(long media) -
extractMediaFromInsertedItem
public long extractMediaFromInsertedItem(net.minecraft.world.item.ItemStack stack, boolean simulate) -
insertMedia
public void insertMedia(net.minecraft.world.item.ItemStack stack) -
setInfiniteMedia
public void setInfiniteMedia() -
remainingMediaCapacity
public long remainingMediaCapacity() -
getPigment
-
setPigment
-
saveModData
protected void saveModData(net.minecraft.nbt.CompoundTag tag) - Specified by:
saveModDatain classHexBlockEntity
-
loadModData
protected void loadModData(net.minecraft.nbt.CompoundTag tag) - Specified by:
loadModDatain classHexBlockEntity
-
applyScryingLensOverlay
public void applyScryingLensOverlay(List<com.mojang.datafixers.util.Pair<net.minecraft.world.item.ItemStack, net.minecraft.network.chat.Component>> lines, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player observer, net.minecraft.world.level.Level world, net.minecraft.core.Direction hitFace) -
semitoneFromScale
protected int semitoneFromScale(int note) -
getSlotsForFace
public int[] getSlotsForFace(net.minecraft.core.Direction var1) - Specified by:
getSlotsForFacein interfacenet.minecraft.world.WorldlyContainer
-
canPlaceItemThroughFace
public boolean canPlaceItemThroughFace(int index, net.minecraft.world.item.ItemStack stack, @Nullable @Nullable net.minecraft.core.Direction dir) - Specified by:
canPlaceItemThroughFacein interfacenet.minecraft.world.WorldlyContainer
-
canTakeItemThroughFace
public boolean canTakeItemThroughFace(int var1, net.minecraft.world.item.ItemStack var2, net.minecraft.core.Direction var3) - Specified by:
canTakeItemThroughFacein interfacenet.minecraft.world.WorldlyContainer
-
getContainerSize
public int getContainerSize()- Specified by:
getContainerSizein interfacenet.minecraft.world.Container
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfacenet.minecraft.world.Container
-
getItem
public net.minecraft.world.item.ItemStack getItem(int index) - Specified by:
getItemin interfacenet.minecraft.world.Container
-
removeItem
public net.minecraft.world.item.ItemStack removeItem(int index, int count) - Specified by:
removeItemin interfacenet.minecraft.world.Container
-
removeItemNoUpdate
public net.minecraft.world.item.ItemStack removeItemNoUpdate(int index) - Specified by:
removeItemNoUpdatein interfacenet.minecraft.world.Container
-
setItem
public void setItem(int index, net.minecraft.world.item.ItemStack stack) - Specified by:
setItemin interfacenet.minecraft.world.Container
-
stillValid
public boolean stillValid(net.minecraft.world.entity.player.Player player) - Specified by:
stillValidin interfacenet.minecraft.world.Container
-
clearContent
public void clearContent()- Specified by:
clearContentin interfacenet.minecraft.world.Clearable
-
canPlaceItem
public boolean canPlaceItem(int index, net.minecraft.world.item.ItemStack stack) - Specified by:
canPlaceItemin interfacenet.minecraft.world.Container
-