Package com.ldtteam.structurize.client
Class BlueprintHandler
java.lang.Object
com.ldtteam.structurize.client.BlueprintHandler
The Blueprint render handler on the client side.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intHow often should cache cleanup happenstatic final intHow long are cache entries valid -
Method Summary
Modifier and TypeMethodDescriptionvoidCleans entries that are older than CACHE_EVICT_TIME.voidClear all entries.voiddraw(BlueprintPreviewData previewData, net.minecraft.core.BlockPos pos, net.neoforged.neoforge.client.event.RenderLevelStageEvent ctx) Draw a blueprint at given pos.voiddrawAtListOfPositions(BlueprintPreviewData previewData, Collection<net.minecraft.core.BlockPos> points, net.neoforged.neoforge.client.event.RenderLevelStageEvent ctx) Draw a blueprint at list of given pos.static BlueprintHandlerGet the static instance.List<net.minecraft.world.entity.Entity> getOptionalEntitiesForBlueprint(BlueprintPreviewData previewData)
-
Field Details
-
CACHE_EXPIRE_SECONDS
public static final int CACHE_EXPIRE_SECONDSHow long are cache entries valid- See Also:
-
CACHE_EXPIRE_CHECK_SECONDS
public static final int CACHE_EXPIRE_CHECK_SECONDSHow often should cache cleanup happen- See Also:
-
-
Method Details
-
getInstance
Get the static instance.- Returns:
- a static instance of this class.
-
draw
public void draw(BlueprintPreviewData previewData, net.minecraft.core.BlockPos pos, net.neoforged.neoforge.client.event.RenderLevelStageEvent ctx) Draw a blueprint at given pos.- Parameters:
previewData- the blueprint and context to draw.pos- position to render atctx- rendering event
-
cleanCache
public void cleanCache()Cleans entries that are older than CACHE_EVICT_TIME. -
clearCache
public void clearCache()Clear all entries. -
drawAtListOfPositions
public void drawAtListOfPositions(BlueprintPreviewData previewData, Collection<net.minecraft.core.BlockPos> points, net.neoforged.neoforge.client.event.RenderLevelStageEvent ctx) Draw a blueprint at list of given pos.- Parameters:
previewData- the blueprint and context to draw.points- list of positions to render atctx- rendering event
-
getOptionalEntitiesForBlueprint
public List<net.minecraft.world.entity.Entity> getOptionalEntitiesForBlueprint(BlueprintPreviewData previewData) - Returns:
- list of entities for instantiated renderer (potentially immediately invalid), else empty list
-