Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- getComponentType()
- getBench()
- getProcessingBench()
- getOutputContainer()
- getInputContainer()
- getFuelContainer()
- getFuelTime()
- getProcessingSlots()
- getProcessingFuelSlots()
- getLastTickGameTime()
- setLastTickGameTime(Instant)
- setLastConsumedFuelTotal(int)
- clearCurrentRecipe()
- initializeBenchConfig(BlockType)
- setupSlots(World, BenchBlock, BlockModule.BlockStateInfo, int, int, int, BlockType, int)
- isActive()
- setActive(boolean, BenchBlock, BlockModule.BlockStateInfo)
- updateFuelValues(Map)
- getItemContainer()
- getRecipe()
- getInputProgress()
- setInputProgress(float)
- dropFuelItems(List)
- getRecipeTimeSeconds(int)
- advanceProcessing(float, Store, BenchBlock, BlockModule.BlockStateInfo, int, int, int, BlockType, int)
- consumeFuelForDuration(float, Store, int, int, int, BlockType, int)
- sendProgress(float, Map)
- sendProcessingSlots(Map)
- sendProcessingFuelSlots(Map)
- setBlockInteractionState(String, BlockType, ChunkStore, Ref, int, int, int)
- playSound(int, ComponentAccessor, BlockType, int, int, int, int)
- checkForRecipeUpdate(BenchBlock)
- clone()
Class ProcessingBenchBlock
java.lang.Object
com.hypixel.hytale.builtin.crafting.component.ProcessingBenchBlock
- All Implemented Interfaces:
Component<ChunkStore>, Cloneable
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BuilderCodec<ProcessingBenchBlock> static final booleanIt's possible to have an item that has more resources than we require per item, this flag will force that we only take the exact amount that we need no more, no less.static final HytaleLoggerstatic final Stringstatic final StringFields inherited from interface Component
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintadvanceProcessing(float dt, Store<EntityStore> entityStore, BenchBlock benchBlock, BlockModule.BlockStateInfo blockStateInfo, int blockX, int blockY, int blockZ, BlockType blockType, int rotationIndex) Analytical processing: computes the maximum number of recipe completions possible given the available time, fuel, input, and output capacity, then applies them in batch.voidcheckForRecipeUpdate(BenchBlock benchBlock) voidclone()voidconsumeFuelForDuration(float duration, Store<EntityStore> entityStore, int blockX, int blockY, int blockZ, BlockType blockType, int rotationIndex) Consumes fuel items to cover the requested duration.voiddropFuelItems(List<ItemStack> itemStacks) getBench()static ComponentType<ChunkStore, ProcessingBenchBlock> floatfloatit.unimi.dsi.fastutil.shorts.ShortSetit.unimi.dsi.fastutil.shorts.ShortSetfloatgetRecipeTimeSeconds(int tierLevel) booleaninitializeBenchConfig(BlockType blockType) Sets the bench config fields from the block type.booleanisActive()voidplaySound(int soundEventIndex, ComponentAccessor<EntityStore> componentAccessor, BlockType blockType, int rotationIndex, int blockX, int blockY, int blockZ) voidsendProcessingFuelSlots(Map<UUID, BenchWindow> windows) voidsendProcessingSlots(Map<UUID, BenchWindow> windows) voidsendProgress(float progress, Map<UUID, BenchWindow> windows) booleansetActive(boolean active, BenchBlock benchBlock, BlockModule.BlockStateInfo blockStateInfo) Changes the active state of this processor.voidsetBlockInteractionState(String state, BlockType blockType, ChunkStore chunkStore, Ref<ChunkStore> sectionRef, int blockX, int blockY, int blockZ) voidsetInputProgress(float inputProgress) voidsetLastConsumedFuelTotal(int lastConsumedFuelTotal) voidsetLastTickGameTime(Instant lastTickGameTime) voidsetupSlots(World world, BenchBlock benchBlock, BlockModule.BlockStateInfo blockStateInfo, int blockX, int blockY, int blockZ, BlockType blockType, int rotationIndex) voidupdateFuelValues(Map<UUID, BenchWindow> windows) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Component
cloneSerializable
-
Field Details
-
LOGGER
-
EXACT_RESOURCE_AMOUNTS
public static final boolean EXACT_RESOURCE_AMOUNTSIt's possible to have an item that has more resources than we require per item, this flag will force that we only take the exact amount that we need no more, no less.- See Also:
-
CODEC
-
PROCESSING
- See Also:
-
PROCESS_COMPLETED
- See Also:
-
-
Constructor Details
-
ProcessingBenchBlock
public ProcessingBenchBlock()
-
-
Method Details
-
getComponentType
-
getBench
-
getProcessingBench
-
getOutputContainer
-
getInputContainer
-
getFuelContainer
-
getFuelTime
public float getFuelTime() -
getProcessingSlots
@Nonnull public it.unimi.dsi.fastutil.shorts.ShortSet getProcessingSlots() -
getProcessingFuelSlots
@Nonnull public it.unimi.dsi.fastutil.shorts.ShortSet getProcessingFuelSlots() -
getLastTickGameTime
-
setLastTickGameTime
-
setLastConsumedFuelTotal
public void setLastConsumedFuelTotal(int lastConsumedFuelTotal) -
clearCurrentRecipe
public void clearCurrentRecipe() -
initializeBenchConfig
Sets the bench config fields from the block type. Must be called before setupSlots or tick.- Returns:
- true if the config was successfully set, false if the block type has no valid processing bench.
-
setupSlots
public void setupSlots(@Nonnull World world, @Nonnull BenchBlock benchBlock, @Nonnull BlockModule.BlockStateInfo blockStateInfo, int blockX, int blockY, int blockZ, @Nonnull BlockType blockType, int rotationIndex) -
isActive
public boolean isActive() -
setActive
public boolean setActive(boolean active, @Nonnull BenchBlock benchBlock, @Nullable BlockModule.BlockStateInfo blockStateInfo) Changes the active state of this processor.- Parameters:
benchBlock- the companion BenchBlock (for windows and tier level)blockStateInfo- the block state info for marking dirty, or null if unavailable- Returns:
- whether the value changed
-
updateFuelValues
-
getItemContainer
-
getRecipe
-
getInputProgress
public float getInputProgress() -
setInputProgress
public void setInputProgress(float inputProgress) -
dropFuelItems
-
getRecipeTimeSeconds
public float getRecipeTimeSeconds(int tierLevel) -
advanceProcessing
public int advanceProcessing(float dt, @Nonnull Store<EntityStore> entityStore, @Nonnull BenchBlock benchBlock, @Nonnull BlockModule.BlockStateInfo blockStateInfo, int blockX, int blockY, int blockZ, @Nonnull BlockType blockType, int rotationIndex) Analytical processing: computes the maximum number of recipe completions possible given the available time, fuel, input, and output capacity, then applies them in batch. Works for any dt -- small (normal tick) or large (offline catch-up).- Returns:
- the number of recipe completions performed.
-
consumeFuelForDuration
public void consumeFuelForDuration(float duration, @Nonnull Store<EntityStore> entityStore, int blockX, int blockY, int blockZ, @Nonnull BlockType blockType, int rotationIndex) Consumes fuel items to cover the requested duration. Only removes what is needed; existingfuelTimeis used first. -
sendProgress
-
sendProcessingSlots
-
sendProcessingFuelSlots
-
setBlockInteractionState
public void setBlockInteractionState(@Nonnull String state, @Nonnull BlockType blockType, @Nonnull ChunkStore chunkStore, @Nonnull Ref<ChunkStore> sectionRef, int blockX, int blockY, int blockZ) -
playSound
public void playSound(int soundEventIndex, @Nonnull ComponentAccessor<EntityStore> componentAccessor, @Nonnull BlockType blockType, int rotationIndex, int blockX, int blockY, int blockZ) -
checkForRecipeUpdate
-
clone
- Specified by:
clonein interfaceComponent<ChunkStore>- Returns:
- a clone instance of the original component instance.
-