Package dev.deepcore.challenge.preview
Class PreviewRuntimeService
java.lang.Object
dev.deepcore.challenge.preview.PreviewRuntimeService
Provides runtime helpers for preview scaling, transforms, and sounds.
-
Constructor Summary
ConstructorsConstructorDescriptionPreviewRuntimeService(org.bukkit.plugin.java.JavaPlugin plugin) Creates a preview runtime service. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyPreviewTransform(org.bukkit.entity.BlockDisplay display, double blockScale, float rotationRadians, double yOffset) Applies scale, rotation, and vertical offset transform to a preview display.doubleReturns the configured preview block scale within safe clamped bounds.intReturns the configured preview spin interpolation tick interval.voidplayPreviewConstructionCompleteSound(org.bukkit.Location previewAnchor) Plays completion sounds when the preview construction finishes.voidplayPreviewConstructionTickSounds(org.bukkit.Location previewAnchor, int spawnedThisTick) Plays per-tick construction sounds for nearby active lobby viewers.voidplayPreviewDestroyStartSound(org.bukkit.Location previewAnchor) Plays the destroy-start sound cue for nearby lobby viewers.
-
Constructor Details
-
PreviewRuntimeService
public PreviewRuntimeService(org.bukkit.plugin.java.JavaPlugin plugin) Creates a preview runtime service.- Parameters:
plugin- plugin instance used for config-backed runtime behavior
-
-
Method Details
-
getPreviewBlockScale
public double getPreviewBlockScale()Returns the configured preview block scale within safe clamped bounds.- Returns:
- clamped preview block scale factor
-
getPreviewSpinUpdateTicks
public int getPreviewSpinUpdateTicks()Returns the configured preview spin interpolation tick interval.- Returns:
- clamped interpolation tick interval used for preview spin updates
-
playPreviewConstructionTickSounds
public void playPreviewConstructionTickSounds(org.bukkit.Location previewAnchor, int spawnedThisTick) Plays per-tick construction sounds for nearby active lobby viewers.- Parameters:
previewAnchor- anchor location used for proximity filtering and sound playbackspawnedThisTick- number of blocks spawned this tick
-
playPreviewConstructionCompleteSound
public void playPreviewConstructionCompleteSound(org.bukkit.Location previewAnchor) Plays completion sounds when the preview construction finishes.- Parameters:
previewAnchor- anchor location used for proximity filtering and sound playback
-
playPreviewDestroyStartSound
public void playPreviewDestroyStartSound(org.bukkit.Location previewAnchor) Plays the destroy-start sound cue for nearby lobby viewers.- Parameters:
previewAnchor- anchor location used for proximity filtering and sound playback
-
applyPreviewTransform
public void applyPreviewTransform(org.bukkit.entity.BlockDisplay display, double blockScale, float rotationRadians, double yOffset) Applies scale, rotation, and vertical offset transform to a preview display.- Parameters:
display- block display entity to transformblockScale- base block scale valuerotationRadians- yaw rotation in radiansyOffset- vertical offset from anchor origin
-