CoopBlock

public class CoopBlock implements Component

Class CoopBlock. Provides coopblock functionality for the Hytale server.

java.lang.Object > CoopBlock

Field Summary

coopAssetId

protected String coopAssetId

Field coopAssetId.

residents

protected List residents

Field residents.

itemContainer

protected ItemContainer itemContainer

Field itemContainer.

remainder

final ArrayList remainder

Field remainder.

coopAsset

final FarmingCoopAsset coopAsset

Field coopAsset.

npcComponent

final NPCEntity npcComponent

Field npcComponent.

uuidComponent

final UUIDComponent uuidComponent

Field uuidComponent.

persistentRef

final PersistentRef persistentRef

Field persistentRef.

metadata

final CapturedNPCMetadata metadata

Field metadata.

residentRecord

final CoopResident residentRecord

Field residentRecord.

tagSetPlugin

final TagSetPlugin.TagSetLookup tagSetPlugin

Field tagSetPlugin.

acceptedNpcGroupIndexes

final int[] acceptedNpcGroupIndexes

Field acceptedNpcGroupIndexes.

currentTime

final Instant currentTime

Field currentTime.

random

final ThreadLocalRandom random

Field random.

generatedItemDrops

final List generatedItemDrops

Field generatedItemDrops.

lastProduced

final Instant lastProduced

Field lastProduced.

residentMeta

final CapturedNPCMetadata residentMeta

Field residentMeta.

npcRoleIndex

final int npcRoleIndex

Field npcRoleIndex.

npcName

final String npcName

Field npcName.

npcDropListName

final String npcDropListName

Field npcDropListName.

dropListAsset

final ItemDropList dropListAsset

Field dropListAsset.

harvestDiff

final Duration harvestDiff

Field harvestDiff.

hoursSinceLastHarvest

final long hoursSinceLastHarvest

Field hoursSinceLastHarvest.

produceCount

final int produceCount

Field produceCount.

configuredItemDrops

final List configuredItemDrops

Field configuredItemDrops.

container

final ItemDropContainer container

Field container.

drops

final List drops

Field drops.

obj

final ThreadLocalRandom obj

Field obj.

amount

final int amount

Field amount.

npcModule

final NPCPlugin npcModule

Field npcModule.

radiansPerSpawn

final float radiansPerSpawn

Field radiansPerSpawn.

spawningContext

final SpawningContext spawningContext

Field spawningContext.

residentDeployed

final boolean residentDeployed

Field residentDeployed.

residentEntityId

final PersistentRef residentEntityId

Field residentEntityId.

residentSpawnLocation

final Vector3d residentSpawnLocation

Field residentSpawnLocation.

roleBuilder

final Builder roleBuilder

Field roleBuilder.

npcRef

final Ref npcRef

Field npcRef.

coopResidentComponent

final CoopResidentComponent coopResidentComponent

Field coopResidentComponent.

residentsToRemove

final ArrayList residentsToRemove

Field residentsToRemove.

deployed

final boolean deployed

Field deployed.

entityUuid

final PersistentRef entityUuid

Field entityUuid.

entityRef

final Ref entityRef

Field entityRef.

deathComponent

final DeathComponent deathComponent

Field deathComponent.

roamTimeRange

final IntRange roamTimeRange

Field roamTimeRange.

gameHour

final int gameHour

Field gameHour.

gameTime

final Instant gameTime

Field gameTime.

gameDateTime

final LocalDateTime gameDateTime

Field gameDateTime.

minutes

final int minutes

Field minutes.

minTime

final int minTime

Field minTime.

maxTime

final int maxTime

Field maxTime.

location

final Vector3i location

Field location.

dropPosition

final Vector3d dropPosition

Field dropPosition.

itemEntityHolders

final Holder[] itemEntityHolders

Field itemEntityHolders.

ref

final Ref ref

Field ref.

deployedToWorld

protected boolean deployedToWorld

Field deployedToWorld.

Method Detail

getComponentType

public CoopBlock> getComponentType ()

Method getComponentType.

CoopBlock

public public CoopBlock ()

Method CoopBlock.

getCoopAsset

public FarmingCoopAsset getCoopAsset ()

Method getCoopAsset.

tryPutResident

public boolean tryPutResident (final CapturedNPCMetadata metadata, final WorldTimeResource worldTimeResource)

Method tryPutResident.

Parameters:
final CapturedNPCMetadata metadata
final WorldTimeResource worldTimeResource

CoopResident

public new CoopResident (metadata, null, worldTimeResource.getGameTime()

Method CoopResident.

Parameters:
metadata metadata
null null
worldTimeResource.getGameTime( worldTimeResource.getGameTime(

tryPutWildResidentFromWild

public boolean tryPutWildResidentFromWild (final Store store, final Ref entityRef, final WorldTimeResource worldTimeResource, final Vector3i coopLocation)

Method tryPutWildResidentFromWild.

Parameters:
final Store store
final Ref entityRef
final WorldTimeResource worldTimeResource
final Vector3i coopLocation

getCoopAcceptsNPCGroup

public boolean getCoopAcceptsNPCGroup (final int npcRoleIndex)

Method getCoopAcceptsNPCGroup.

Parameters:
final int npcRoleIndex

generateProduceToInventory

public void generateProduceToInventory (final WorldTimeResource worldTimeResource)

Method generateProduceToInventory.

Parameters:
final WorldTimeResource worldTimeResource

ItemStack

public new ItemStack (drop.getItemId()

Method ItemStack.

Parameters:
drop.getItemId( drop.getItemId(

gatherProduceFromInventory

public void gatherProduceFromInventory (final ItemContainer playerInventory)

Method gatherProduceFromInventory.

Parameters:
final ItemContainer playerInventory

ensureSpawnResidentsInWorld

public void ensureSpawnResidentsInWorld (final World world, final Store store, final Vector3d coopLocation, final Vector3d spawnOffset)

Method ensureSpawnResidentsInWorld.

Parameters:
final World world
final Store store
final Vector3d coopLocation
final Vector3d spawnOffset

Vector3d

public new Vector3d ()

Method Vector3d.

ensureNoResidentsInWorld

public void ensureNoResidentsInWorld (final Store store)

Method ensureNoResidentsInWorld.

Parameters:
final Store store

shouldResidentsBeInCoop

public boolean shouldResidentsBeInCoop (final WorldTimeResource worldTimeResource)

Method shouldResidentsBeInCoop.

Parameters:
final WorldTimeResource worldTimeResource

getNextScheduledTick

public Instant getNextScheduledTick (final WorldTimeResource worldTimeResource)

Method getNextScheduledTick.

Parameters:
final WorldTimeResource worldTimeResource

if

public else if (gameHour > maxTime)

Method if.

Parameters:
gameHour > maxTime

handleResidentDespawn

public void handleResidentDespawn (final UUID entityUuid)

Method handleResidentDespawn.

Parameters:
final UUID entityUuid

handleBlockBroken

public void handleBlockBroken (final World world, final WorldTimeResource worldTimeResource, final Store store, final int blockX, final int blockY, final int blockZ)

Method handleBlockBroken.

Parameters:
final World world
final WorldTimeResource worldTimeResource
final Store store
final int blockX
final int blockY
final int blockZ

hasProduce

public boolean hasProduce ()

Method hasProduce.

clone

public Component clone ()

Method clone.

getMetadata

public CapturedNPCMetadata getMetadata ()

Method getMetadata.

getPersistentRef

public PersistentRef getPersistentRef ()

Method getPersistentRef.

setPersistentRef

public void setPersistentRef (@NullableDecl final PersistentRef persistentRef)

Method setPersistentRef.

Parameters:
@NullableDecl final PersistentRef persistentRef

getDeployedToWorld

public boolean getDeployedToWorld ()

Method getDeployedToWorld.

setDeployedToWorld

public void setDeployedToWorld (final boolean deployedToWorld)

Method setDeployedToWorld.

Parameters:
final boolean deployedToWorld

getLastProduced

public Instant getLastProduced ()

Method getLastProduced.

setLastProduced

public void setLastProduced (final Instant lastProduced)

Method setLastProduced.

Parameters:
final Instant lastProduced