PrefabEditSessionManager

public class PrefabEditSessionManager

Class PrefabEditSessionManager. Provides prefabeditsessionmanager functionality for the Hytale server.

java.lang.Object > PrefabEditSessionManager

Field Summary

eventRegistry

final EventRegistry eventRegistry

Field eventRegistry.

playerRef

final Ref playerRef

Field playerRef.

store

final Store store

Field store.

world

final World world

Field world.

uuidComponent

final UUIDComponent uuidComponent

Field uuidComponent.

playerUUID

final UUID playerUUID

Field playerUUID.

movementStatesComponent

final MovementStatesComponent movementStatesComponent

Field movementStatesComponent.

movementStates

final MovementStates movementStates

Field movementStates.

playerComponent

final Player playerComponent

Field playerComponent.

playerRefComponent

final PlayerRef playerRefComponent

Field playerRefComponent.

inventory

final Inventory inventory

Field inventory.

hotbar

final ItemContainer hotbar

Field hotbar.

hotbarSize

final int hotbarSize

Field hotbarSize.

itemStack

final ItemStack itemStack

Field itemStack.

itemStack2

final ItemStack itemStack2

Field itemStack2.

playerHolder

final Holder playerHolder

Field playerHolder.

prefabEditorCreationContext

final PrefabEditorCreationContext prefabEditorCreationContext

Field prefabEditorCreationContext.

playerUuid

final UUID playerUuid

Field playerUuid.

loadingState

final PrefabLoadingState loadingState

Field loadingState.

phase

final PrefabLoadingState.Phase phase

Field phase.

now

final long now

Field now.

sourceWorld

final World sourceWorld

Field sourceWorld.

config

final WorldConfig config

Field config.

enableTicking

final boolean enableTicking

Field enableTicking.

worldName

final String worldName

Field worldName.

transformComponent

final TransformComponent transformComponent

Field transformComponent.

transform

final Transform transform

Field transform.

prefabEditSession

final PrefabEditSession prefabEditSession

Field prefabEditSession.

spawnPoint

final Vector3i spawnPoint

Field spawnPoint.

spawnProvider

final GlobalSpawnProvider spawnProvider

Field spawnProvider.

o

final Object o

Field o.

teleport

final Teleport teleport

Field teleport.

teleportComponent

final Teleport teleportComponent

Field teleportComponent.

environment

final Environment environment

Field environment.

forecast

final IWeightedMap forecast

Field forecast.

bestWeatherId

final String[] bestWeatherId

Field bestWeatherId.

highestWeight

final double[] highestWeight

Field highestWeight.

parsed

final Color parsed

Field parsed.

yLevelForFlatWorldExclusive

final int yLevelForFlatWorldExclusive

Field yLevelForFlatWorldExclusive.

topLayer

final FlatWorldGenProvider.Layer topLayer

Field topLayer.

airLayer

final FlatWorldGenProvider.Layer airLayer

Field airLayer.

bottomLayer

final FlatWorldGenProvider.Layer bottomLayer

Field bottomLayer.

pastePosition

final Vector3i pastePosition

Field pastePosition.

anchorPosition

final Vector3i anchorPosition

Field anchorPosition.

worldTimeResource

final WorldTimeResource worldTimeResource

Field worldTimeResource.

initializationFutures

final CompletableFuture[] initializationFutures

Field initializationFutures.

prefabPath

final Path prefabPath

Field prefabPath.

prefabLoadingFuture

final CompletableFuture prefabLoadingFuture

Field prefabLoadingFuture.

pathForCallback

final Path pathForCallback

Field pathForCallback.

prefabAccessors

final List prefabAccessors

Field prefabAccessors.

prefabAccessor

final IPrefabBuffer prefabAccessor

Field prefabAccessor.

prefabHeight

final int prefabHeight

Field prefabHeight.

yLevelToPastePrefabsAt

final int yLevelToPastePrefabsAt

Field yLevelToPastePrefabsAt.

yLevelToPastePrefabsAt2

final int yLevelToPastePrefabsAt2

Field yLevelToPastePrefabsAt2.

prefabAccessors2

final List prefabAccessors2

Field prefabAccessors2.

rowGroupIndices

final int[] rowGroupIndices

Field rowGroupIndices.

rowDepths

final IntArrayList rowDepths

Field rowDepths.

prefabAccessor2

final IPrefabBuffer prefabAccessor2

Field prefabAccessor2.

rowGroup

final int rowGroup

Field rowGroup.

rowStarts

final int[] rowStarts

Field rowStarts.

prefabAccessor3

final IPrefabBuffer prefabAccessor3

Field prefabAccessor3.

prefabPath2

final Path prefabPath2

Field prefabPath2.

rowGroup2

final int rowGroup2

Field rowGroup2.

rowOffset

final int rowOffset

Field rowOffset.

prefabXSize

final int prefabXSize

Field prefabXSize.

prefabZSize

final int prefabZSize

Field prefabZSize.

xPos

final int xPos

Field xPos.

zPos

final int zPos

Field zPos.

xPos2

final int xPos2

Field xPos2.

zPos2

final int zPos2

Field zPos2.

minPoint

final Vector3i minPoint

Field minPoint.

maxPoint

final Vector3i maxPoint

Field maxPoint.

rowGroups

final int[] rowGroups

Field rowGroups.

rowSplitMode

final PrefabRowSplitMode rowSplitMode

Field rowSplitMode.

prefabPaths

final List prefabPaths

Field prefabPaths.

unprocessedPaths

final List unprocessedPaths

Field unprocessedPaths.

rootPath

final Path rootPath

Field rootPath.

resolvedPath

final Path resolvedPath

Field resolvedPath.

parentDir

final Path parentDir

Field parentDir.

group

final Integer group

Field group.

finalReturnWorld

final World finalReturnWorld

Field finalReturnWorld.

finalReturnLocation

final Transform finalReturnLocation

Field finalReturnLocation.

worldToRemove

final World worldToRemove

Field worldToRemove.

prefabsBeingEditedInEditSession

final Collection prefabsBeingEditedInEditSession

Field prefabsBeingEditedInEditSession.

session

final PrefabEditSession session

Field session.

prefabsInSession

final Collection prefabsInSession

Field prefabsInSession.

Method Detail

PrefabEditSessionManager

public public PrefabEditSessionManager (@Nonnull final JavaPlugin plugin)

Method PrefabEditSessionManager.

Parameters:
@Nonnull final JavaPlugin plugin

onPlayerReady

private void onPlayerReady (@Nonnull final PlayerReadyEvent event)

Method onPlayerReady.

Parameters:
@Nonnull final PlayerReadyEvent event

SavedMovementStates

public new SavedMovementStates (true)

Method SavedMovementStates.

Parameters:
true true

givePrefabSelectorTool

private void givePrefabSelectorTool (@Nonnull final Player playerComponent, @Nonnull final PlayerRef playerRef)

Method givePrefabSelectorTool.

Parameters:
@Nonnull final Player playerComponent
@Nonnull final PlayerRef playerRef

SetActiveSlot

public new SetActiveSlot (-1, (byte)

Method SetActiveSlot.

Parameters:
-1 -1
(byte (byte

ItemStack

public new ItemStack ("EditorTool_PrefabEditing_SelectPrefab")

Method ItemStack.

Parameters:
"EditorTool_PrefabEditing_SelectPrefab" "EditorTool_PrefabEditing_SelectPrefab"

onPlayerAddedToWorld

public void onPlayerAddedToWorld (@Nonnull final AddPlayerToWorldEvent event)

Method onPlayerAddedToWorld.

Parameters:
@Nonnull final AddPlayerToWorldEvent event

updatePathOfLoadedPrefab

public void updatePathOfLoadedPrefab (@Nonnull final Path oldPath, @Nonnull final Path newPath)

Method updatePathOfLoadedPrefab.

Parameters:
@Nonnull final Path oldPath
@Nonnull final Path newPath

isEditingAPrefab

public boolean isEditingAPrefab (@Nonnull final UUID playerUUID)

Method isEditingAPrefab.

Parameters:
@Nonnull final UUID playerUUID

getPrefabEditSession

public PrefabEditSession getPrefabEditSession (@Nonnull final UUID playerUUID)

Method getPrefabEditSession.

Parameters:
@Nonnull final UUID playerUUID

getActiveEditSessions

public PrefabEditSession> getActiveEditSessions ()

Method getActiveEditSessions.

populateActiveEditSession

public void populateActiveEditSession (@Nonnull final UUID playerUuid, @Nonnull final PrefabEditSession editSession)

Method populateActiveEditSession.

Parameters:
@Nonnull final UUID playerUuid
@Nonnull final PrefabEditSession editSession

populatePrefabsBeingEdited

public void populatePrefabsBeingEdited (@Nonnull final Path prefabPath)

Method populatePrefabsBeingEdited.

Parameters:
@Nonnull final Path prefabPath

scheduleAnchorEntityRecreation

public void scheduleAnchorEntityRecreation (@Nonnull final PrefabEditSession editSession)

Method scheduleAnchorEntityRecreation.

Parameters:
@Nonnull final PrefabEditSession editSession

hasInProgressLoading

public boolean hasInProgressLoading (@Nonnull final UUID playerUuid)

Method hasInProgressLoading.

Parameters:
@Nonnull final UUID playerUuid

cancelLoading

public void cancelLoading (@Nonnull final UUID playerUuid)

Method cancelLoading.

Parameters:
@Nonnull final UUID playerUuid

isLoadingCancelled

public boolean isLoadingCancelled (@Nonnull final UUID playerUuid)

Method isLoadingCancelled.

Parameters:
@Nonnull final UUID playerUuid

clearLoadingState

public void clearLoadingState (@Nonnull final UUID playerUuid)

Method clearLoadingState.

Parameters:
@Nonnull final UUID playerUuid

createEditSessionForNewPrefab

public CompletableFuture createEditSessionForNewPrefab (@Nonnull final Ref ref, @Nonnull final Player editor, @Nonnull final PrefabEditorCreationSettings settings, @Nonnull final ComponentAccessor componentAccessor)

Method createEditSessionForNewPrefab.

Parameters:
@Nonnull final Ref ref
@Nonnull final Player editor
@Nonnull final PrefabEditorCreationSettings settings
@Nonnull final ComponentAccessor componentAccessor

loadPrefabAndCreateEditSession

public CompletableFuture loadPrefabAndCreateEditSession (@Nonnull final Ref ref, @Nonnull final Player editor, @Nonnull final PrefabEditorCreationSettings settings, @Nonnull final ComponentAccessor componentAccessor)

Method loadPrefabAndCreateEditSession.

Parameters:
@Nonnull final Ref ref
@Nonnull final Player editor
@Nonnull final PrefabEditorCreationSettings settings
@Nonnull final ComponentAccessor componentAccessor

notifyProgress

private void notifyProgress (@Nullable final Consumer progressCallback, @Nonnull final PrefabLoadingState loadingState)

Method notifyProgress.

Parameters:
@Nullable final Consumer progressCallback
@Nonnull final PrefabLoadingState loadingState

createEditSession

private CompletableFuture createEditSession (@Nonnull final Ref ref, @Nonnull final PrefabEditorCreationContext context, final boolean createNewPrefab, @Nonnull final ComponentAccessor componentAccessor)

Method createEditSession.

Parameters:
@Nonnull final Ref ref
@Nonnull final PrefabEditorCreationContext context
final boolean createNewPrefab
@Nonnull final ComponentAccessor componentAccessor

PrefabEditSession

public new PrefabEditSession (worldName, playerUUID, sourceWorld.getWorldConfig()

Method PrefabEditSession.

Parameters:
worldName worldName
playerUUID playerUUID
sourceWorld.getWorldConfig( sourceWorld.getWorldConfig(

GlobalSpawnProvider

public new GlobalSpawnProvider (new Transform(spawnPoint)

Method GlobalSpawnProvider.

Parameters:
new Transform(spawnPoint

Teleport

public new Teleport (targetWorld, new Transform(spawnPoint)

Method Teleport.

Parameters:
targetWorld targetWorld
new Transform(spawnPoint

getWorldCreatingFuture

private CompletableFuture getWorldCreatingFuture (@Nonnull final PrefabEditorCreationContext context, @Nonnull final WorldConfig config)

Method getWorldCreatingFuture.

Parameters:
@Nonnull final PrefabEditorCreationContext context
@Nonnull final WorldConfig config

getWorldName

private String getWorldName (@Nonnull final PrefabEditorCreationContext context)

Method getWorldName.

Parameters:
@Nonnull final PrefabEditorCreationContext context

getWeatherFromEnvironment

private String getWeatherFromEnvironment (@Nullable final String environmentId)

Method getWeatherFromEnvironment.

Parameters:
@Nullable final String environmentId

getSavePath

private Path getSavePath (@Nonnull final PrefabEditorCreationContext context)

Method getSavePath.

Parameters:
@Nonnull final PrefabEditorCreationContext context

applyWorldGenWorldConfig

private void applyWorldGenWorldConfig (@Nonnull final PrefabEditorCreationContext context, final int yLevelToPastePrefabsAt, @Nonnull final WorldConfig worldConfig)

Method applyWorldGenWorldConfig.

Parameters:
@Nonnull final PrefabEditorCreationContext context
final int yLevelToPastePrefabsAt
@Nonnull final WorldConfig worldConfig

FlatWorldGenProvider

public new FlatWorldGenProvider (tint, new FlatWorldGenProvider.Layer[] { airLayer, topLayer, bottomLayer })

Method FlatWorldGenProvider.

Parameters:
tint tint
new FlatWorldGenProvider.Layer[] { airLayer
topLayer topLayer
bottomLayer }

VoidWorldGenProvider

public new VoidWorldGenProvider (tint, environment)

Method VoidWorldGenProvider.

Parameters:
tint tint
environment environment

getPrefabCreatingCompletableFuture

private CompletableFuture getPrefabCreatingCompletableFuture (@Nonnull final PrefabEditorCreationContext context, @Nonnull final PrefabEditSession editSession, @Nonnull final WorldConfig worldConfig)

Method getPrefabCreatingCompletableFuture.

Parameters:
@Nonnull final PrefabEditorCreationContext context
@Nonnull final PrefabEditSession editSession
@Nonnull final WorldConfig worldConfig

Vector3i

public new Vector3i (0, context.getPasteLevelGoal()

Method Vector3i.

Parameters:
0 0
context.getPasteLevelGoal( context.getPasteLevelGoal(

getPrefabLoadingCompletableFuture

private CompletableFuture getPrefabLoadingCompletableFuture (@Nonnull final PrefabEditorCreationContext context, @Nonnull final PrefabEditSession editSession, @Nonnull final WorldConfig worldConfig, @Nullable final PrefabLoadingState loadingState, @Nullable final Consumer progressCallback, @Nonnull final UUID playerUuid)

Method getPrefabLoadingCompletableFuture.

Parameters:
@Nonnull final PrefabEditorCreationContext context
@Nonnull final PrefabEditSession editSession
@Nonnull final WorldConfig worldConfig
@Nullable final PrefabLoadingState loadingState
@Nullable final Consumer progressCallback
@Nonnull final UUID playerUuid

Tri

public new Tri (prefabAccessors, yLevelToPastePrefabsAt, this.getWorldCreatingFuture(context, worldConfig)

Method Tri.

Parameters:
prefabAccessors prefabAccessors
yLevelToPastePrefabsAt yLevelToPastePrefabsAt
this.getWorldCreatingFuture(context this.getWorldCreatingFuture(context
worldConfig worldConfig

FastRandom

public new FastRandom ()

Method FastRandom.

calculateRowGroups

private int[] calculateRowGroups (@Nonnull final PrefabEditorCreationContext context, final int prefabCount)

Method calculateRowGroups.

Parameters:
@Nonnull final PrefabEditorCreationContext context
final int prefabCount

if

public else if (!prefabPath.equals(resolvedPath)

Method if.

Parameters:
!prefabPath.equals(resolvedPath !prefabPath.equals(resolvedPath

getAmountOfBlocksBelowPrefab

private int getAmountOfBlocksBelowPrefab (final int prefabHeight, final int desiredYLevel)

Method getAmountOfBlocksBelowPrefab.

Parameters:
final int prefabHeight
final int desiredYLevel

exitEditSession

public CompletableFuture exitEditSession (@Nonnull final Ref ref, @Nonnull final World world, @Nonnull final PlayerRef playerRef, @Nonnull final ComponentAccessor componentAccessor)

Method exitEditSession.

Parameters:
@Nonnull final Ref ref
@Nonnull final World world
@Nonnull final PlayerRef playerRef
@Nonnull final ComponentAccessor componentAccessor

cleanupCancelledSession

public CompletableFuture cleanupCancelledSession (@Nonnull final UUID playerUuid, @Nonnull final String worldName, @Nullable final Consumer progressCallback)

Method cleanupCancelledSession.

Parameters:
@Nonnull final UUID playerUuid
@Nonnull final String worldName
@Nullable final Consumer progressCallback

getPrefabBuffer

private CompletableFuture getPrefabBuffer (@Nonnull final CommandSender sender, @Nonnull final Path path)

Method getPrefabBuffer.

Parameters:
@Nonnull final CommandSender sender
@Nonnull final Path path

Color

public new Color ((byte)

Method Color.

Parameters:
(byte (byte