Lv20 で解禁される「しもべ」管理。

49Fields
1Constructors
150Methods
2638Lines
Package
com.example.rankingplugin.level
Source
level/LevelServantService.java
Kind
class
Roles
イベント駆動DB / 永続化非同期 / スケジューラサービス層
このクラスにも章立て解説を追加しています。 自動抽出の一覧だけでなく、下の『重点クラスの詳細解説』で読む順番・内部サブシステム・変更時の注意点まで追えます。 全クラス章立てガイドを見る
サブシステム横断ガイドもあります。 このクラスを含む上位の流れは こちらの処理遷移図ページ から読むと把握しやすいです。

クラス説明

Lv20 で解禁される「しもべ」管理。
Citizens がある場合は PLAYER NPC を優先し、ない場合は内部Mob + フェイクプレイヤー表示で動作する。

責務と見どころ

重点クラスの詳細解説

しもべ機能の本体で、召喚・追従・戦闘・見た目・装備 GUI・保存・Citizens 互換・Protocol 補助が一つに集まっています。プレイヤー体験に直結するため説明を厚くする価値が高いクラスです。

最初に追う読む順番

  1. start
    tick 処理と初期テーブル確認がどこで始まるかを確認します。
  2. summonFor
    召喚直後にどの実体を作り、どのセッションへ登録するかを掴みます。
  3. maintainBehaviour
    毎 tick の制御ループ本体で、追従・戦闘・補助行動の核です。
  4. maintainCitizensBehaviour
    Citizens を使う場合の経路が別にあるため、NPC あり環境の挙動差はここを見ます。
  5. maintainManualPlayerBehaviour
    内部 Mob + 見た目合成の経路はこちらです。Fallback 実装の要です。
  6. resolveAssistOrNearestTarget
    攻撃対象の決定がどう行われるかを追えます。
  7. refreshAppearance
    見た目が壊れた時は skin/head/visual 反映の中心になります。
  8. renderEquipmentMenu
    プレイヤーが触る GUI の入口です。
  9. applyLoadoutToServant
    装備変更が実体へどう反映されるかを追います。
  10. shutdown
    tick 停止とサウンド/見た目の掃除の出口です。

内部サブシステムの地図

追従・戦闘 AI

通常追従と戦闘状態の遷移を毎 tick で維持します。Citizens 経由か手動制御かで分岐するため、両経路の存在を意識して読むと理解しやすいです。

体力・属性・音の補助制御

最大体力再計算や遅延再試行、死亡音抑制など、表に見えづらいが壊れると違和感が大きい補助層です。

代表フロー詳解

ログアウト・死亡時の掃除

  1. onQuit / onKick / onServantDeath
  2. removeServant
  3. destroyVisual
  4. clearPendingVitals
  5. clearAssistTarget

しもべは実体・見た目・補助状態の三層を持つため、掃除漏れが最も起きやすいです。オーナー不在時の残骸はここを見てください。

変更時の注意点

外部接点

主な永続化テーブル

SQL 文字列から抽出できた主要テーブルです。スキーマ変更時の確認用です。

level_servant_profileslevel_servant_loadoutskin_mode

フィールド

VisibilityTypeName役割
privateStringDEFAULT_MODE_SELFDEFAULT_MODE_SELF の状態を保持します。
privateStringDEFAULT_MODE_NAMEDEFAULT_MODE_NAME の状態を保持します。
privateStringDEFAULT_MODE_URLDEFAULT_MODE_URL の状態を保持します。
privatePluginpluginプラグイン本体参照です。
privateDataSourcedsDB 接続元を保持します。
privateLevelingServicelevelingleveling の状態を保持します。
privateLevelServantPlayerNpcBridgenpcBridgenpcBridge の状態を保持します。
privateLevelServantCitizensBridgecitizensBridgecitizensBridge の状態を保持します。
privateScoreServicescoreService関連サービスへの参照です。
privateNamespacedKeyservantKeyservantKey の状態を保持します。
privateNamespacedKeyownerKeyownerKey の状態を保持します。
privateMap<UUID, UUID>activeServantsactiveServants の状態を保持します。
privateMap<UUID, ServantSession>sessionssessions の状態を保持します。
privateMap<UUID, SkinPref>skinCacheキャッシュまたは直近計算結果を保持します。
privateMap<UUID, ServantLoadout>loadoutCacheキャッシュまたは直近計算結果を保持します。
privateMap<UUID, Object>resolvedProfileCacheキャッシュまたは直近計算結果を保持します。
privateMap<UUID, VisualState>visualStatesvisualStates の状態を保持します。
privateMap<UUID, Long>nextAutoEatAtnextAutoEatAt の状態を保持します。
privateMap<UUID, LevelServantCitizensBridge.SpawnedNpc>citizensHandlescitizensHandles の状態を保持します。
privateMap<UUID, UUID>assistTargetsassistTargets の状態を保持します。
privateMap<UUID, Long>assistTargetUntilassistTargetUntil の状態を保持します。
privateMap<UUID, Long>nextManualAttackAtnextManualAttackAt の状態を保持します。
privateMap<UUID, Long>nextFollowTeleportAtnextFollowTeleportAt の状態を保持します。
privateMap<UUID, Long>nextNavigateAtnextNavigateAt の状態を保持します。
privateMap<UUID, Vector>followOffsetsfollowOffsets の状態を保持します。
privateMap<UUID, Long>nextServantScoreScrubAtnextServantScoreScrubAt の状態を保持します。
privateMap<UUID, ServantMode>servantModesservantModes の状態を保持します。
privateMap<UUID, ServantBrain>servantBrainsservantBrains の状態を保持します。
privateSet<UUID>resolvingSkinresolvingSkin の状態を保持します。
privateBukkitTasktickTask非同期処理やスケジューラ制御に使うハンドルです。
privateObjectprotocolSoundMuteBridgeprotocolSoundMuteBridge の状態を保持します。
privateMap<UUID, Long>soundFallbackCooldownsoundFallbackCooldown の状態を保持します。
privatebooleanprotocolSoundMuteHookActiveprotocolSoundMuteHookActive の状態を保持します。
privatelongnextOrphanSweepAtnextOrphanSweepAt の状態を保持します。
privateMap<UUID, Double>pendingVitalTargetspendingVitalTargets の状態を保持します。
privateMap<UUID, Long>pendingVitalRetryUntilpendingVitalRetryUntil の状態を保持します。
privateMap<UUID, Long>nextPendingVitalRetryAtnextPendingVitalRetryAt の状態を保持します。
privatebooleanenabledenabled の状態を保持します。
privateintunlockLevelunlockLevel の状態を保持します。
privatedoublefollowTeleportDistancefollowTeleportDistance の状態を保持します。
privatedoubletargetRangetargetRange の状態を保持します。
privatedoubleprotectRadiusprotectRadius の状態を保持します。
privatedoublebaseHealthbaseHealth の状態を保持します。
privatedoublehealthPerLevelhealthPerLevel の状態を保持します。
privatedoublebaseDamagebaseDamage の状態を保持します。
privatedoubledamagePerLeveldamagePerLevel の状態を保持します。
privatedoublebaseArmorbaseArmor の状態を保持します。
privatedoublearmorPer20LevelsarmorPer20Levels の状態を保持します。
privatebooleanhideArmorVisualshideArmorVisuals の状態を保持します。

コンストラクタ / 初期化

Signature説明主要呼び出し
public LevelServantService(Plugin plugin, DataSource ds, LevelingService leveling)依存オブジェクトや初期状態を受け取り、このクラスの動作を開始できる状態へ組み立てます。getScoreService → getConfig → getBoolean → max → getInt → getDouble

メソッド索引

NameVisibilityKind説明
LevelServantServicepublicコンストラクタ依存オブジェクトや初期状態を受け取り、このクラスの動作を開始できる状態へ組み立てます。
ensureTablespublicメソッド必要なテーブル・状態・前提条件が揃っているかを確認し、不足分を補います。
startpublicメソッド初期化と各種登録を行い、機能を有効化します。
shutdownpublicメソッド動作中の処理やリソースを安全に停止・解放します。
handleLevelUppublicメソッド入力やリクエストを受けて、検証・処理・応答までをまとめて担当します。
summonForpublicメソッドsummonFor の主要処理を担当します。
dismisspublicメソッドdismiss の主要処理を担当します。
describeSkinpublicメソッドdescribeSkin の主要処理を担当します。
sendInfopublicメソッドsendInfo の主要処理を担当します。
openEquipmentGuipublicメソッドopenEquipmentGui の主要処理を担当します。
getScoringOwnerFromLastDamagepublicメソッド必要な状態を取得し、呼び出し側で利用しやすい形へ返します。
isTrackedServantpublicメソッド条件判定を行い、後続処理の分岐に使える真偽値を返します。
getOwnerIdIfServantpublicメソッド必要な状態を取得し、呼び出し側で利用しやすい形へ返します。
resolveOwnerIdForPotentialServantpublicメソッドresolveOwnerIdForPotentialServant の主要処理を担当します。
resolveOwnerIdByServantEntityUuidpublicメソッドresolveOwnerIdByServantEntityUuid の主要処理を担当します。
setSkinSelfpublicメソッドsetSkinSelf の主要処理を担当します。
setSkinByNamepublicメソッドsetSkinByName の主要処理を担当します。
setSkinByUrlpublicメソッドsetSkinByUrl の主要処理を担当します。
tickprivateメソッドtick の主要処理を担当します。
maintainBehaviourprivateメソッドmaintainBehaviour の主要処理を担当します。
maintainCitizensBehaviourprivateメソッドmaintainCitizensBehaviour の主要処理を担当します。
maintainManualPlayerBehaviourprivateメソッドmaintainManualPlayerBehaviour の主要処理を担当します。
isOwnerMovingprivateメソッド条件判定を行い、後続処理の分岐に使える真偽値を返します。
updateOwnerMotionStateprivateメソッド状態を永続化または更新し、最新状態へ反映します。
resolveStateMachineTargetprivateメソッドresolveStateMachineTarget の主要処理を担当します。
engageCitizensTargetprivateメソッドengageCitizensTarget の主要処理を担当します。
maintainFollowStateprivateメソッドmaintainFollowState の主要処理を担当します。
clearCombatStateprivateメソッドclearCombatState の主要処理を担当します。
desiredTrailOffsetprivateメソッドdesiredTrailOffset の主要処理を担当します。
desiredIdleOffsetprivateメソッドdesiredIdleOffset の主要処理を担当します。
stableFollowAnchorprivateメソッドstableFollowAnchor の主要処理を担当します。
brakeServantprivateメソッドbrakeServant の主要処理を担当します。
maybeScrubServantScoreprivateメソッドmaybeScrubServantScore の主要処理を担当します。
canEngageTargetprivateメソッド条件判定を行い、後続処理の分岐に使える真偽値を返します。
hasDirectSightprivateメソッド条件判定を行い、後続処理の分岐に使える真偽値を返します。
isEffectivelyInvisibleprivateメソッド条件判定を行い、後続処理の分岐に使える真偽値を返します。
configureHuskServantprivateメソッドconfigureHuskServant の主要処理を担当します。
configureCommonServantprivateメソッドconfigureCommonServant の主要処理を担当します。
ensureServantMarkersprivateメソッド必要なテーブル・状態・前提条件が揃っているかを確認し、不足分を補います。
refreshStatsprivateメソッドrefreshStats の主要処理を担当します。
currentMaxHealthprivateメソッドcurrentMaxHealth の主要処理を担当します。
applyPlayerSpecificVitalsprivateメソッドapplyPlayerSpecificVitals の主要処理を担当します。
trySetPlayerMaxHealthDirectprivateメソッドtrySetPlayerMaxHealthDirect の主要処理を担当します。
trySetPlayerHealthDirectprivateメソッドtrySetPlayerHealthDirect の主要処理を担当します。
scheduleDelayedPlayerVitalRetryprivateメソッドscheduleDelayedPlayerVitalRetry の主要処理を担当します。
queuePendingVitalsprivateメソッドqueuePendingVitals の主要処理を担当します。
clearPendingVitalsprivateメソッドclearPendingVitals の主要処理を担当します。
maintainPendingVitalsprivateメソッドmaintainPendingVitals の主要処理を担当します。
forceServantVitalsNowprivateメソッドforceServantVitalsNow の主要処理を担当します。
scheduleSpawnVitalsBootstrapprivateメソッドscheduleSpawnVitalsBootstrap の主要処理を担当します。
maxHealthForSpentSpprivateメソッドmaxHealthForSpentSp の主要処理を担当します。
maxHealthForSessionprivateメソッドmaxHealthForSession の主要処理を担当します。
servantCombatBonusprivateメソッドservantCombatBonus の主要処理を担当します。
servantAttackDamageprivateメソッドservantAttackDamage の主要処理を担当します。
servantAttackDamageprivateメソッドservantAttackDamage の主要処理を担当します。
servantArmorprivateメソッドservantArmor の主要処理を担当します。
setAttributeBaseprivateメソッドsetAttributeBase の主要処理を担当します。
equipFallbackAppearanceprivateメソッドequipFallbackAppearance の主要処理を担当します。
clearFallbackAppearanceprivateメソッドclearFallbackAppearance の主要処理を担当します。
makeLeatherArmorprivateメソッドmakeLeatherArmor の主要処理を担当します。
colorForOwnerprivateメソッドcolorForOwner の主要処理を担当します。
buildSkinHeadprivateメソッド表示用または出力用のデータを組み立てます。
refreshAppearanceprivateメソッドrefreshAppearance の主要処理を担当します。
resolveSkinAsyncprivateメソッドresolveSkinAsync の主要処理を担当します。
resolveSkinUrlAsyncprivateメソッドresolveSkinUrlAsync の主要処理を担当します。
createProfileByNameprivateメソッドcreateProfileByName の主要処理を担当します。
getProfileForOwnerprivateメソッド必要な状態を取得し、呼び出し側で利用しやすい形へ返します。
updateProfileIfPossibleprivateメソッド状態を永続化または更新し、最新状態へ反映します。
applyResolvedProfileprivateメソッドapplyResolvedProfile の主要処理を担当します。
getActiveServantprivateメソッド必要な状態を取得し、呼び出し側で利用しやすい形へ返します。
attachOrRefreshVisualprivateメソッドattachOrRefreshVisual の主要処理を担当します。
syncVisualprivateメソッドsyncVisual の主要処理を担当します。
applyVisualRotationprivateメソッドapplyVisualRotation の主要処理を担当します。
computeDesiredPoseprivateメソッドcomputeDesiredPose の主要処理を担当します。
lookAtprivateメソッドlookAt の主要処理を担当します。
vectorPoseprivateメソッドvectorPose の主要処理を担当します。
smoothYawprivateメソッドsmoothYaw の主要処理を担当します。
smoothPitchprivateメソッドsmoothPitch の主要処理を担当します。
wrapDegreesprivateメソッドwrapDegrees の主要処理を担当します。
clampPitchprivateメソッドclampPitch の主要処理を担当します。
playSwingprivateメソッドplaySwing の主要処理を担当します。
playHurtReactionprivateメソッドplayHurtReaction の主要処理を担当します。
destroyVisualprivateメソッドdestroyVisual の主要処理を担当します。
isTrackedServantEntityIdpackageメソッド条件判定を行い、後続処理の分岐に使える真偽値を返します。
setupOptionalProtocolSoundMuteHookprivateメソッド初期化と各種登録を行い、機能を有効化します。
teardownOptionalProtocolSoundMuteHookprivateメソッドteardownOptionalProtocolSoundMuteHook の主要処理を担当します。
maybeStopLeakedServantSoundsprivateメソッドmaybeStopLeakedServantSounds の主要処理を担当します。
stopServantSoundNearprivateメソッド動作中の処理やリソースを安全に停止・解放します。
stopServantSoundForprivateメソッド動作中の処理やリソースを安全に停止・解放します。
invokeStopSoundprivateメソッドinvokeStopSound の主要処理を担当します。
suppressServantDeathSoundprivateメソッドsuppressServantDeathSound の主要処理を担当します。
removeServantprivateメソッド対象データや登録状態を削除・解除します。
isServantprivateメソッド条件判定を行い、後続処理の分岐に使える真偽値を返します。
getOwnerIdprivateメソッド必要な状態を取得し、呼び出し側で利用しやすい形へ返します。
findNearestTargetprivateメソッド必要な状態を取得し、呼び出し側で利用しやすい形へ返します。
isValidTargetprivateメソッド条件判定を行い、後続処理の分岐に使える真偽値を返します。
isBossTypeprivateメソッド条件判定を行い、後続処理の分岐に使える真偽値を返します。
pushTargetFromOwnerContextprivateメソッドpushTargetFromOwnerContext の主要処理を担当します。
teleportNearOwnerprivateメソッドteleportNearOwner の主要処理を担当します。
pickDirectFollowTeleportLocationprivateメソッドpickDirectFollowTeleportLocation の主要処理を担当します。
followAnchorprivateメソッドfollowAnchor の主要処理を担当します。
findSpawnLocationNearprivateメソッド必要な状態を取得し、呼び出し側で利用しやすい形へ返します。
isSafeStandingLocationprivateメソッド条件判定を行い、後続処理の分岐に使える真偽値を返します。
trySpawnCitizensServantprivateメソッドtrySpawnCitizensServant の主要処理を担当します。
effectiveSkinNameprivateメソッドeffectiveSkinName の主要処理を担当します。
setAssistTargetprivateメソッドsetAssistTarget の主要処理を担当します。
clearAssistTargetprivateメソッドclearAssistTarget の主要処理を担当します。
resolveAssistOrNearestTargetprivateメソッドresolveAssistOrNearestTarget の主要処理を担当します。
moveServantTowardsprivateメソッドmoveServantTowards の主要処理を担当します。
faceTargetprivateメソッドfaceTarget の主要処理を担当します。
faceAlongVelocityIfNeededprivateメソッドfaceAlongVelocityIfNeeded の主要処理を担当します。
maybeAutoEatprivateメソッドmaybeAutoEat の主要処理を担当します。
healAmountForFoodprivateメソッドhealAmountForFood の主要処理を担当します。
getLoadoutprivateメソッド必要な状態を取得し、呼び出し側で利用しやすい形へ返します。
saveLoadoutprivateメソッド状態を永続化または更新し、最新状態へ反映します。
serializeItemprivateメソッドserializeItem の主要処理を担当します。
deserializeItemprivateメソッドdeserializeItem の主要処理を担当します。
renderEquipmentMenuprivateメソッド表示用または出力用のデータを組み立てます。
namedItemprivateメソッドnamedItem の主要処理を担当します。
cloneOrNullprivateメソッドcloneOrNull の主要処理を担当します。
preferredSlotForShiftprivateメソッドpreferredSlotForShift の主要処理を担当します。
isAllowedForSlotprivateメソッド条件判定を行い、後続処理の分岐に使える真偽値を返します。
applyLoadoutToServantprivateメソッドapplyLoadoutToServant の主要処理を担当します。
resolveSkinOwnerprivateメソッドresolveSkinOwner の主要処理を担当します。
safeSetDropChanceprivateメソッドsafeSetDropChance の主要処理を担当します。
equipmentArmorBonusprivateメソッドequipmentArmorBonus の主要処理を担当します。
shieldArmorBonusprivateメソッドshieldArmorBonus の主要処理を担当します。
armorValueprivateメソッドarmorValue の主要処理を担当します。
weaponDamageBonusprivateメソッドweaponDamageBonus の主要処理を担当します。
decrementOneprivateメソッドdecrementOne の主要処理を担当します。
equipmentSnapshotFromprivateメソッドequipmentSnapshotFrom の主要処理を担当します。
equipmentSnapshotForOwnerprivateメソッドequipmentSnapshotForOwner の主要処理を担当します。
createSkinDataFromTextureUrlprivateメソッドcreateSkinDataFromTextureUrl の主要処理を担当します。
cleanupOrphanedServantsRuntimeprivateメソッドcleanupOrphanedServantsRuntime の主要処理を担当します。
cleanupStaleServantsOnStartupprivateメソッドcleanupStaleServantsOnStartup の主要処理を担当します。
getSkinPrefprivateメソッド必要な状態を取得し、呼び出し側で利用しやすい形へ返します。
saveSkinPrefprivateメソッド状態を永続化または更新し、最新状態へ反映します。
uuidToBytesprivateメソッドuuidToBytes の主要処理を担当します。
playerDamagerprivateメソッドplayerDamager の主要処理を担当します。
livingDamagerprivateメソッドlivingDamager の主要処理を担当します。
servantDamagerprivateメソッドservantDamager の主要処理を担当します。
onJoinpublicイベント処理イベント発生時の分岐と後続処理を担当します。
onQuitpublicイベント処理イベント発生時の分岐と後続処理を担当します。
onKickpublicイベント処理イベント発生時の分岐と後続処理を担当します。
onServantTargetpublicイベント処理イベント発生時の分岐と後続処理を担当します。
onDamagepublicイベント処理イベント発生時の分岐と後続処理を担当します。
onServantDeathpublicイベント処理イベント発生時の分岐と後続処理を担当します。
onServantEquipmentClickpublicイベント処理イベント発生時の分岐と後続処理を担当します。
onServantEquipmentDragpublicイベント処理イベント発生時の分岐と後続処理を担当します。
onServantEquipmentClosepublicイベント処理イベント発生時の分岐と後続処理を担当します。

メソッド詳細

LevelServantService

コンストラクタpublic
public LevelServantService(Plugin plugin, DataSource ds, LevelingService leveling)

依存オブジェクトや初期状態を受け取り、このクラスの動作を開始できる状態へ組み立てます。

引数

throws

なし

主要な呼び出し順

getScoreServicegetConfiggetBooleanmaxgetIntgetDouble

ensureTables

メソッドpublic
public void ensureTables()

必要なテーブル・状態・前提条件が揃っているかを確認し、不足分を補います。

引数

throws

なし

主要な呼び出し順

level_servant_profileslevel_servant_loadoutgetConnectionprepareStatementexecutegetLoggerwarninggetMessage

start

メソッドpublic
public void start()

初期化と各種登録を行い、機能を有効化します。

引数

throws

なし

主要な呼び出し順

getLoggerinfocleanupStaleServantsOnStartupgetSchedulerrunTaskLatercancelrunTaskTimersetupOptionalProtocolSoundMuteHook

shutdown

メソッドpublic
public void shutdown()

動作中の処理やリソースを安全に停止・解放します。

引数

throws

なし

主要な呼び出し順

cancelkeySetremoveServantclearteardownOptionalProtocolSoundMuteHook

handleLevelUp

メソッドpublic
public void handleLevelUp(Player player, int oldLevel, int newLevel)

入力やリクエストを受けて、検証・処理・応答までをまとめて担当します。

引数

throws

なし

主要な呼び出し順

sendMessagegetActiveServantgetUniqueIdrefreshStats

summonFor

メソッドpublic
public boolean summonFor(Player p, boolean manual)

summonFor の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

sendMessagegetLevelgetUniqueIdgetActiveServantspendAllSpfindSpawnLocationNeargetLocationtrySpawnCitizensServant

dismiss

メソッドpublic
public void dismiss(Player p)

dismiss の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getActiveServantgetUniqueIdsendMessageremoveServant

describeSkin

メソッドpublic
public String describeSkin(UUID ownerId)

describeSkin の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getSkinPrefequalsIgnoreCasemodevalueisBlanklengthsubstring

sendInfo

メソッドpublic
public void sendInfo(Player p)

sendInfo の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getLevelgetUniqueIdsendMessagedescribeSkingetSpgetActiveServantmaxexpiresAtMs

openEquipmentGui

メソッドpublic
public void openEquipmentGui(Player p)

openEquipmentGui の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

sendMessagegetLevelgetUniqueIdcreateInventoryrenderEquipmentMenuopenInventory

getScoringOwnerFromLastDamage

メソッドpublic
public UUID getScoringOwnerFromLastDamage(LivingEntity victim)

必要な状態を取得し、呼び出し側で利用しやすい形へ返します。

引数

throws

なし

主要な呼び出し順

getLastDamageCauseservantDamagergetOwnerId

isTrackedServant

メソッドpublic
public boolean isTrackedServant(LivingEntity entity)

条件判定を行い、後続処理の分岐に使える真偽値を返します。

引数

throws

なし

主要な呼び出し順

isServant

getOwnerIdIfServant

メソッドpublic
public UUID getOwnerIdIfServant(LivingEntity entity)

必要な状態を取得し、呼び出し側で利用しやすい形へ返します。

引数

throws

なし

主要な呼び出し順

isServantgetOwnerId

resolveOwnerIdForPotentialServant

メソッドpublic
public UUID resolveOwnerIdForPotentialServant(Player player)

resolveOwnerIdForPotentialServant の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getOwnerIdIfServanthasMetadataentrySetgetValueentitygetEntityIdensureServantMarkersgetKey

resolveOwnerIdByServantEntityUuid

メソッドpublic
public UUID resolveOwnerIdByServantEntityUuid(UUID entityUuid)

resolveOwnerIdByServantEntityUuid の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

entrySetequalsgetValuegetKey

setSkinSelf

メソッドpublic
public boolean setSkinSelf(Player p)

setSkinSelf の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

saveSkinPrefgetUniqueIdremoverefreshAppearancesendMessage

setSkinByName

メソッドpublic
public boolean setSkinByName(Player p, String name)

setSkinByName の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

trimstartsWithsetSkinByUrlmatchessendMessagesaveSkinPrefgetUniqueIdremove

setSkinByUrl

メソッドpublic
public boolean setSkinByUrl(Player p, String url)

setSkinByUrl の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

trimstartsWithsendMessagesaveSkinPrefgetUniqueIdcreateSkinDataFromTextureUrlremoveresolveSkinUrlAsync

tick

メソッドprivate
private void tick()

tick の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

currentTimeMilliscleanupOrphanedServantsRuntimekeySetgetPlayergetActiveServantisOnlineremoveServantexpiresAtMs

maintainBehaviour

メソッドprivate
private void maintainBehaviour(Player owner, LivingEntity servant, long now)

maintainBehaviour の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getUniqueIdmaintainCitizensBehaviourgetWorldequalsteleportgetLocationdistanceSquaredteleportNearOwner

maintainCitizensBehaviour

メソッドprivate
private void maintainCitizensBehaviour(Player owner, LivingEntity servant, LevelServantCitizensBridge.SpawnedNpc citizens, long now)

maintainCitizensBehaviour の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getWorldequalscancelNavigationpickDirectFollowTeleportLocationteleportgetLocationgetUniqueIdcomputeIfAbsent

maintainManualPlayerBehaviour

メソッドprivate
private void maintainManualPlayerBehaviour(Player owner, LivingEntity servant, long now)

maintainManualPlayerBehaviour の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getUniqueIdcomputeIfAbsentinitialupdateOwnerMotionStateresolveStateMachineTargetgetLocationdistanceSquaredmoveServantTowards

isOwnerMoving

メソッドprivate
private boolean isOwnerMoving(Player owner)

条件判定を行い、後続処理の分岐に使える真偽値を返します。

引数

throws

なし

主要な呼び出し順

getVelocityclonesetYlengthSquared

updateOwnerMotionState

メソッドprivate
private boolean updateOwnerMotionState(Player owner, LivingEntity servant, ServantBrain brain, long now)

状態を永続化または更新し、最新状態へ反映します。

引数

throws

なし

主要な呼び出し順

isOwnerMovinggetLocationgetWorlddistanceSquareddesiredTrailOffsettoVectorsubtractsetY

resolveStateMachineTarget

メソッドprivate
private LivingEntity resolveStateMachineTarget(Player owner, LivingEntity servant, ServantBrain brain, long now)

resolveStateMachineTarget の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getEntitycanEngageTargetresolveAssistOrNearestTargetclearCombatStategetUniqueId

engageCitizensTarget

メソッドprivate
private void engageCitizensTarget(Player owner, LivingEntity servant, LevelServantCitizensBridge.SpawnedNpc citizens, ServantBrain brain, LivingEntity target, long now)

engageCitizensTarget の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getUniqueIdgetLocationdistanceSquaredcanEngageTargetclearCombatStatecancelNavigationfaceTargetgetOrDefault

maintainFollowState

メソッドprivate
private void maintainFollowState(Player owner, LivingEntity servant, LevelServantCitizensBridge.SpawnedNpc citizens, ServantBrain brain, Location anchor, boolean ownerMoving, long now)

maintainFollowState の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getUniqueIdgetLocationdistanceSquaredgetOrDefaultteleportNearOwnercancelNavigationnavigateToLocationbrakeServant

clearCombatState

メソッドprivate
private void clearCombatState(UUID ownerId, ServantBrain brain)

clearCombatState の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

clearAssistTarget

desiredTrailOffset

メソッドprivate
private Vector desiredTrailOffset(Player owner)

desiredTrailOffset の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getLocationgetVelocityclonesetYlengthSquaredgetDirectionnormalizegetUniqueId

desiredIdleOffset

メソッドprivate
private Vector desiredIdleOffset(Player owner)

desiredIdleOffset の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getLocationgetDirectionclonesetYlengthSquarednormalizegetUniqueIdhashCode

stableFollowAnchor

メソッドprivate
private Location stableFollowAnchor(Player owner, LivingEntity servant, ServantBrain brain, boolean ownerMoving)

stableFollowAnchor の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

desiredTrailOffsetclonedesiredIdleOffsetsetYlengthSquaredgetUniqueIdgetLocationsetYaw

brakeServant

メソッドprivate
private void brakeServant(LivingEntity servant, double factor)

brakeServant の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getVelocityclonesetVelocitymultiplymaxmin

maybeScrubServantScore

メソッドprivate
private void maybeScrubServantScore(LivingEntity servant, long now)

maybeScrubServantScore の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getUniqueIdgetOrDefaultsaveScoregetName

canEngageTarget

メソッドprivate
private boolean canEngageTarget(Player owner, LivingEntity servant, LivingEntity target)

条件判定を行い、後続処理の分岐に使える真偽値を返します。

引数

throws

なし

主要な呼び出し順

isValidTargetgetWorldequalsgetLocationdistanceSquaredabsgetYhasDirectSight

hasDirectSight

メソッドprivate
private boolean hasDirectSight(LivingEntity observer, LivingEntity target, double maxDistance)

条件判定を行い、後続処理の分岐に使える真偽値を返します。

引数

throws

なし

主要な呼び出し順

getWorldequalsisEffectivelyInvisiblehasLineOfSightgetEyeLocationgetLocationclonemax

isEffectivelyInvisible

メソッドprivate
private boolean isEffectivelyInvisible(LivingEntity target)

条件判定を行い、後続処理の分岐に使える真偽値を返します。

引数

throws

なし

主要な呼び出し順

isInvisiblegetPotionEffectgetGameMode

configureHuskServant

メソッドprivate
private void configureHuskServant(Husk servant, Player owner)

configureHuskServant の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

setAdultsetCanPickupItemsconfigureCommonServant

configureCommonServant

メソッドprivate
private void configureCommonServant(LivingEntity servant, Player owner)

configureCommonServant の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

setRemoveWhenFarAwaysetPersistentsetSilentsetCollidablesetCustomNameVisibleensureServantMarkersgetUniqueIdapplyLoadoutToServant

ensureServantMarkers

メソッドprivate
private void ensureServantMarkers(LivingEntity servant, UUID ownerId)

必要なテーブル・状態・前提条件が揃っているかを確認し、不足分を補います。

引数

throws

なし

主要な呼び出し順

addScoreboardTagsetSilentsetCollidablesetPersistentgetPersistentDataContainertoString

refreshStats

メソッドprivate
private void refreshStats(LivingEntity servant, Player owner)

refreshStats の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getLevelgetUniqueIdgetLoadoutmaxHealthForSessioncurrentMaxHealthmaxgetHealthabs

currentMaxHealth

メソッドprivate
private double currentMaxHealth(LivingEntity servant)

currentMaxHealth の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getAttributemaxgetValuegetHealth

applyPlayerSpecificVitals

メソッドprivate
private void applyPlayerSpecificVitals(UUID ownerId, Player playerEntity, double maxHealth, double newHealth)

applyPlayerSpecificVitals の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

applyMaxHealthgetAttributesetBaseValuetrySetPlayerMaxHealthDirectsetHealthScaledsetHealthScalemaxmin

trySetPlayerMaxHealthDirect

メソッドprivate
private void trySetPlayerMaxHealthDirect(Player playerEntity, double maxHealth)

trySetPlayerMaxHealthDirect の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getClassgetMethodinvoke

trySetPlayerHealthDirect

メソッドprivate
private boolean trySetPlayerHealthDirect(Player playerEntity, double health)

trySetPlayerHealthDirect の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

setHealthmaxcurrentMaxHealthmin

scheduleDelayedPlayerVitalRetry

メソッドprivate
private void scheduleDelayedPlayerVitalRetry(UUID ownerId, double targetHealth, long delayTicks)

scheduleDelayedPlayerVitalRetry の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getSchedulerrunTaskLatergetActiveServantisValidmaxHealthForSessionapplyMaxHealthgetAttributesetBaseValue

queuePendingVitals

メソッドprivate
private void queuePendingVitals(UUID ownerId, double targetHealth, long retryUntilMs)

queuePendingVitals の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

max

clearPendingVitals

メソッドprivate
private void clearPendingVitals(UUID ownerId)

clearPendingVitals の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

remove

maintainPendingVitals

メソッドprivate
private void maintainPendingVitals(UUID ownerId, LivingEntity servant, long now)

maintainPendingVitals の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

clearPendingVitalsmaxHealthForSessioncurrentMaxHealthgetHealthmingetOrDefaultmaxforceServantVitalsNow

forceServantVitalsNow

メソッドprivate
private void forceServantVitalsNow(UUID ownerId, LivingEntity servant, double maxHealth, double health)

forceServantVitalsNow の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

setAttributeBasemaxminapplyPlayerSpecificVitalssetHealth

scheduleSpawnVitalsBootstrap

メソッドprivate
private void scheduleSpawnVitalsBootstrap(UUID ownerId, UUID servantId)

scheduleSpawnVitalsBootstrap の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getSchedulerrunTaskLatergetActiveServantgetUniqueIdequalsmaxHealthForSessionforceServantVitalsNow

maxHealthForSpentSp

メソッドprivate
private double maxHealthForSpentSp(int spentSp)

maxHealthForSpentSp の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

max

maxHealthForSession

メソッドprivate
private double maxHealthForSession(ServantSession session)

maxHealthForSession の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

maxmaxHealthForSpentSpspentSp

servantCombatBonus

メソッドprivate
private int servantCombatBonus(ServantSession session)

servantCombatBonus の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

spentSp

servantAttackDamage

メソッドprivate
private double servantAttackDamage(UUID ownerId)

servantAttackDamage の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getLoadout

servantAttackDamage

メソッドprivate
private double servantAttackDamage(UUID ownerId, ServantLoadout loadout, ServantSession session)

servantAttackDamage の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

weaponDamageBonusmainHandservantCombatBonusmax

servantArmor

メソッドprivate
private double servantArmor(UUID ownerId, ServantLoadout loadout, ServantSession session)

servantArmor の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

equipmentArmorBonusservantCombatBonusmax

setAttributeBase

メソッドprivate
private void setAttributeBase(LivingEntity entity, Attribute attribute, double value)

setAttributeBase の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getAttributesetBaseValue

equipFallbackAppearance

メソッドprivate
private void equipFallbackAppearance(LivingEntity servant, UUID ownerId, String ownerName)

equipFallbackAppearance の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getEquipmentsetHelmetbuildSkinHeadsetHelmetDropChancesetChestplatemakeLeatherArmorsetLeggingssetBoots

clearFallbackAppearance

メソッドprivate
private void clearFallbackAppearance(LivingEntity servant)

clearFallbackAppearance の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getEquipmentsetHelmetsetChestplatesetLeggingssetBootssetItemInMainHandsetItemInOffHand

makeLeatherArmor

メソッドprivate
private ItemStack makeLeatherArmor(Material type, UUID ownerId, String name)

makeLeatherArmor の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getItemMetasetColorcolorForOwnersetDisplayNamesetItemMeta

colorForOwner

メソッドprivate
private Color colorForOwner(UUID ownerId)

colorForOwner の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

abshashCodefromRGBmin

buildSkinHead

メソッドprivate
private ItemStack buildSkinHead(UUID ownerId, String ownerName)

表示用または出力用のデータを組み立てます。

引数

throws

なし

主要な呼び出し順

getItemMetagetSkinPrefapplyResolvedProfileequalsIgnoreCasemodevalueisBlanksetOwningPlayer

refreshAppearance

メソッドprivate
private void refreshAppearance(UUID ownerId)

refreshAppearance の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getPlayergetActiveServantgetSkinPrefgetProfileForOwnerrefreshSkinresolveSkinOwnereffectiveSkinNameapplyEquipment

resolveSkinAsync

メソッドprivate
private void resolveSkinAsync(UUID ownerId, String skinName)

resolveSkinAsync の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getSchedulerrunTaskAsynchronouslycreateProfileByNameupdateProfileIfPossiblerunTaskrefreshAppearancegetLoggerfine

resolveSkinUrlAsync

メソッドprivate
private void resolveSkinUrlAsync(UUID ownerId, String url)

resolveSkinUrlAsync の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

isBlankgetSchedulerrunTaskAsynchronouslygenerateSkinDataFromUrlrunTaskrefreshAppearancegetLoggerfine

createProfileByName

メソッドprivate
private Object createProfileByName(String name)

createProfileByName の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getMethodsgetNameequalsgetParameterCountgetParameterTypesinvokerandomUUIDgetServer

getProfileForOwner

メソッドprivate
private Object getProfileForOwner(Player owner, SkinPref pref)

必要な状態を取得し、呼び出し側で利用しやすい形へ返します。

引数

throws

なし

主要な呼び出し順

equalsIgnoreCasemodevalueisBlankgetUniqueIdcreateSkinDataFromTextureUrlresolveSkinUrlAsyncgetPlayerExact

updateProfileIfPossible

メソッドprivate
private Object updateProfileIfPossible(Object profile)

状態を永続化または更新し、最新状態へ反映します。

引数

throws

なし

主要な呼び出し順

getClassgetMethodinvokejoin

applyResolvedProfile

メソッドprivate
private void applyResolvedProfile(SkullMeta meta, Object profile)

applyResolvedProfile の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getClassgetMethodsgetNameequalsgetParameterCountgetParameterTypesisInstanceisAssignableFrom

getActiveServant

メソッドprivate
private LivingEntity getActiveServant(UUID ownerId)

必要な状態を取得し、呼び出し側で利用しやすい形へ返します。

引数

throws

なし

主要な呼び出し順

entityisValidensureServantMarkersgetUniqueIdgetEntityremoveisServant

attachOrRefreshVisual

メソッドprivate
private void attachOrRefreshVisual(Player owner, LivingEntity servant)

attachOrRefreshVisual の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getUniqueIdgetSkinPrefgetProfileForOwnerapplyEquipmentequipmentSnapshotForOwnergetNamerefreshSkinresolveSkinOwner

syncVisual

メソッドprivate
private void syncVisual(Player owner, LivingEntity servant)

syncVisual の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getUniqueIdgetLocationclonecomputeIfAbsentgetYawresolveAssistOrNearestTargetisNavigatingisValidTarget

applyVisualRotation

メソッドprivate
private void applyVisualRotation(Player owner, LivingEntity servant, Location visualLoc, boolean snap)

applyVisualRotation の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

computeDesiredPosecomputeIfAbsentgetUniqueIdgetYawgetPitchyawsmoothYawinCombat

computeDesiredPose

メソッドprivate
private VisualPose computeDesiredPose(Player owner, LivingEntity servant)

computeDesiredPose の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getTargetisValidTargetlookAtgetEyeLocationgetVelocitylengthSquaredvectorPosegetLocation

lookAt

メソッドprivate
private VisualPose lookAt(Location from, Location to, boolean inCombat)

lookAt の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

toVectorsubtractlengthSquaredgetYawgetPitchvectorPose

vectorPose

メソッドprivate
private VisualPose vectorPose(Vector v, boolean inCombat)

vectorPose の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

clonelengthSquarednormalizetoDegreesatan2getXgetZclampPitch

smoothYaw

メソッドprivate
private float smoothYaw(float current, float target, float factor)

smoothYaw の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

wrapDegreesmaxmin

smoothPitch

メソッドprivate
private float smoothPitch(float current, float target, float factor)

smoothPitch の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

maxminclampPitch

wrapDegrees

メソッドprivate
private float wrapDegrees(float angle)

wrapDegrees の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

目立つ内部呼び出しは抽出されませんでした。

clampPitch

メソッドprivate
private float clampPitch(float pitch)

clampPitch の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

maxmin

playSwing

メソッドprivate
private void playSwing(UUID ownerId)

playSwing の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

swingMainArmvisualHandlecomputeIfAbsentcurrentTimeMillis

playHurtReaction

メソッドprivate
private void playHurtReaction(UUID ownerId, Entity attacker, LivingEntity servant)

playHurtReaction の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getLocationgetYawlookAtgetEyeLocationyawvisualHandlecomputeIfAbsent

destroyVisual

メソッドprivate
private void destroyVisual(LevelServantPlayerNpcBridge.VisualHandle handle)

destroyVisual の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

destroy

isTrackedServantEntityId

メソッドpackage
boolean isTrackedServantEntityId(int entityId)

条件判定を行い、後続処理の分岐に使える真偽値を返します。

引数

throws

なし

主要な呼び出し順

valuesgetEntityisValidgetEntityIdisServant

setupOptionalProtocolSoundMuteHook

メソッドprivate
private void setupOptionalProtocolSoundMuteHook()

初期化と各種登録を行い、機能を有効化します。

引数

throws

なし

主要な呼び出し順

teardownOptionalProtocolSoundMuteHookgetServergetPluginManagergetPluginisEnabledforNamegetConstructornewInstance

teardownOptionalProtocolSoundMuteHook

メソッドprivate
private void teardownOptionalProtocolSoundMuteHook()

teardownOptionalProtocolSoundMuteHook の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getClassgetMethodinvoke

maybeStopLeakedServantSounds

メソッドprivate
private void maybeStopLeakedServantSounds(UUID ownerId, LivingEntity servant, long now)

maybeStopLeakedServantSounds の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

containsKeyisValidgetOrDefaultstopServantSoundNear

stopServantSoundNear

メソッドprivate
private void stopServantSoundNear(LivingEntity servant)

動作中の処理やリソースを安全に停止・解放します。

引数

throws

なし

主要な呼び出し順

isValidgetWorldgetLocationgetPlayersisOnlinedistanceSquaredstopServantSoundFor

stopServantSoundFor

メソッドprivate
private void stopServantSoundFor(Player viewer)

動作中の処理やリソースを安全に停止・解放します。

引数

throws

なし

主要な呼び出し順

invokeStopSound

invokeStopSound

メソッドprivate
) private void invokeStopSound(Player viewer, String namespacedKey)

invokeStopSound の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

isBlankgetClassgetMethodinvokeforNamevalueOfasSubclasssubstring

suppressServantDeathSound

メソッドprivate
private void suppressServantDeathSound(EntityDeathEvent e)

suppressServantDeathSound の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getClassgetMethodinvoke

removeServant

メソッドprivate
private void removeServant(UUID ownerId, boolean removeEntity)

対象データや登録状態を削除・解除します。

引数

throws

なし

主要な呼び出し順

removedestroyVisualvisualHandleclearPendingVitalsentitysaveScoregetNamedestroy

isServant

メソッドprivate
private boolean isServant(Entity entity)

条件判定を行い、後続処理の分岐に使える真偽値を返します。

引数

throws

なし

主要な呼び出し順

getPersistentDataContainerhasgetScoreboardTagscontainsentrySetgetValueentitygetUniqueId

getOwnerId

メソッドprivate
private UUID getOwnerId(Entity entity)

必要な状態を取得し、呼び出し側で利用しやすい形へ返します。

引数

throws

なし

主要な呼び出し順

getPersistentDataContainerisBlankfromStringentrySetgetValueentitygetUniqueIdequals

findNearestTarget

メソッドprivate
private LivingEntity findNearestTarget(Player owner, LivingEntity servant, Location center, double range)

必要な状態を取得し、呼び出し側で利用しやすい形へ返します。

引数

throws

なし

主要な呼び出し順

getWorldgetNearbyEntitiescanEngageTargetgetLocationdistanceSquared

isValidTarget

メソッドprivate
private boolean isValidTarget(Player owner, LivingEntity target)

条件判定を行い、後続処理の分岐に使える真偽値を返します。

引数

throws

なし

主要な呼び出し順

isValidisDeadisOnlinegetWorldequalsisServantisEffectivelyInvisibleisBossType

isBossType

メソッドprivate
private boolean isBossType(EntityType type)

条件判定を行い、後続処理の分岐に使える真偽値を返します。

引数

throws

なし

主要な呼び出し順

目立つ内部呼び出しは抽出されませんでした。

pushTargetFromOwnerContext

メソッドprivate
private void pushTargetFromOwnerContext(Player owner, LivingEntity servant)

pushTargetFromOwnerContext の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

findNearestTargetgetLocationsetAssistTargetgetUniqueIdsetTarget

teleportNearOwner

メソッドprivate
private void teleportNearOwner(LivingEntity servant, Player owner)

teleportNearOwner の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

followAnchorisOwnerMovingisSafeStandingLocationgetLocationclonegetDirectionsetYlengthSquared

pickDirectFollowTeleportLocation

メソッドprivate
private Location pickDirectFollowTeleportLocation(Player owner, LivingEntity servant)

pickDirectFollowTeleportLocation の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getLocationcloneisSafeStandingLocationfindSpawnLocationNear

followAnchor

メソッドprivate
private Location followAnchor(Player owner, LivingEntity servant, boolean ownerMoving)

followAnchor の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getUniqueIdstableFollowAnchorgetLocationclonedesiredTrailOffsetdesiredIdleOffsetsetYawgetYaw

findSpawnLocationNear

メソッドprivate
private Location findSpawnLocationNear(Player p)

必要な状態を取得し、呼び出し側で利用しやすい形へ返します。

引数

throws

なし

主要な呼び出し順

getLocationclonegetWorldisSafeStandingLocation

isSafeStandingLocation

メソッドprivate
private boolean isSafeStandingLocation(Location loc)

条件判定を行い、後続処理の分岐に使える真偽値を返します。

引数

throws

なし

主要な呼び出し順

getBlockgetTypecloneisAirisSolid

trySpawnCitizensServant

メソッドprivate
private LevelServantCitizensBridge.SpawnedNpc trySpawnCitizensServant(Player owner, Location spawnLoc)

trySpawnCitizensServant の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

isAvailableeffectiveSkinNamegetNamelengthsubstringgetSkinPrefgetUniqueIdgetProfileForOwner

effectiveSkinName

メソッドprivate
private String effectiveSkinName(Player owner)

effectiveSkinName の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getSkinPrefgetUniqueIdequalsIgnoreCasemodevalueisBlanktrimgetName

setAssistTarget

メソッドprivate
private void setAssistTarget(UUID ownerId, LivingEntity target)

setAssistTarget の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getUniqueIdcurrentTimeMillis

clearAssistTarget

メソッドprivate
private void clearAssistTarget(UUID ownerId)

clearAssistTarget の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

remove

resolveAssistOrNearestTarget

メソッドprivate
private LivingEntity resolveAssistOrNearestTarget(Player owner, LivingEntity servant)

resolveAssistOrNearestTarget の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getUniqueIdgetOrDefaultcurrentTimeMillisgetEntityisValidTargetgetLocationdistanceSquaredclearAssistTarget

moveServantTowards

メソッドprivate
private void moveServantTowards(LivingEntity servant, Location target, double strength)

moveServantTowards の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

toVectorsubtractgetLocationgetYsetYlengthSquarednormalizemultiply

faceTarget

メソッドprivate
private void faceTarget(LivingEntity servant, LivingEntity target)

faceTarget の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

lookAtgetEyeLocationsetRotationyawpitch

faceAlongVelocityIfNeeded

メソッドprivate
private void faceAlongVelocityIfNeeded(LivingEntity servant, Location loc)

faceAlongVelocityIfNeeded の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getVelocitylengthSquaredvectorPosesetYawyawsetPitchpitch

maybeAutoEat

メソッドprivate
private void maybeAutoEat(Player owner, LivingEntity servant, long now)

maybeAutoEat の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getLoadoutgetUniqueIdfoodgetTypeisAirisEdiblemaxHealthForSessionmax

healAmountForFood

メソッドprivate
private double healAmountForFood(ItemStack food)

healAmountForFood の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getTypeisAirnamecontains

getLoadout

メソッドprivate
private ServantLoadout getLoadout(UUID ownerId)

必要な状態を取得し、呼び出し側で利用しやすい形へ返します。

引数

throws

なし

主要な呼び出し順

copygetConnectionprepareStatementsetBytesuuidToBytesexecuteQuerynextbyKey

saveLoadout

メソッドprivate
private void saveLoadout(UUID ownerId, ServantLoadout loadout)

状態を永続化または更新し、最新状態へ反映します。

引数

throws

なし

主要な呼び出し順

copygetConnectionprepareStatementlevel_servant_loadoutsetBytesuuidToBytesexecuteUpdatevalues

serializeItem

メソッドprivate
private String serializeItem(ItemStack item) throws IOException

serializeItem の主要処理を担当します。

引数

throws

IOException

主要な呼び出し順

getTypeisAirwriteObjectgetEncoderencodeToStringtoByteArray

deserializeItem

メソッドprivate
private ItemStack deserializeItem(String raw)

deserializeItem の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

isBlankgetDecoderdecodereadObjectgetLoggerwarninggetMessage

renderEquipmentMenu

メソッドprivate
private void renderEquipmentMenu(Inventory inv, UUID ownerId)

表示用または出力用のデータを組み立てます。

引数

throws

なし

主要な呼び出し順

clearnamedItememptyListgetSizesetItemgetLoadoutcloneOrNullhelmet

namedItem

メソッドprivate
private ItemStack namedItem(Material type, String name, List<String> lore)

namedItem の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getItemMetasetDisplayNameisEmptysetLoreaddItemFlagsvaluessetItemMeta

cloneOrNull

メソッドprivate
private ItemStack cloneOrNull(ItemStack item)

cloneOrNull の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

clone

preferredSlotForShift

メソッドprivate
private ServantSlot preferredSlotForShift(ItemStack item)

preferredSlotForShift の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getTypeisAirisEdiblenameendsWithcontains

isAllowedForSlot

メソッドprivate
private boolean isAllowedForSlot(ServantSlot slot, ItemStack item)

条件判定を行い、後続処理の分岐に使える真偽値を返します。

引数

throws

なし

主要な呼び出し順

getTypeisAirnameendsWithisEdible

applyLoadoutToServant

メソッドprivate
private void applyLoadoutToServant(LivingEntity servant, UUID ownerId, String ownerName)

applyLoadoutToServant の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getLoadouthelmetbuildSkinHeadchestlegsbootsgetTypeisAir

resolveSkinOwner

メソッドprivate
private Player resolveSkinOwner(Player owner, SkinPref pref)

resolveSkinOwner の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

equalsIgnoreCasemodevalueisBlankgetPlayerExacttrim

safeSetDropChance

メソッドprivate
private void safeSetDropChance(EntityEquipment eq, String method, float value)

safeSetDropChance の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getClassgetMethodinvoke

equipmentArmorBonus

メソッドprivate
private double equipmentArmorBonus(ServantLoadout loadout)

equipmentArmorBonus の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

armorValuehelmetchestlegsbootsshieldArmorBonusoffHand

shieldArmorBonus

メソッドprivate
private double shieldArmorBonus(ItemStack offHand)

shieldArmorBonus の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getTypeisAir

armorValue

メソッドprivate
private double armorValue(ItemStack item, ServantSlot slot)

armorValue の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getTypeisAirnamecontains

weaponDamageBonus

メソッドprivate
private double weaponDamageBonus(ItemStack item)

weaponDamageBonus の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getTypeisAirnameendsWithstartsWithcontainsgetEnchantmentLevel

decrementOne

メソッドprivate
private ItemStack decrementOne(ItemStack stack)

decrementOne の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getTypeisAirclonegetAmountsetAmount

equipmentSnapshotFrom

メソッドprivate
private LevelServantPlayerNpcBridge.EquipmentSnapshot equipmentSnapshotFrom(LivingEntity servant)

equipmentSnapshotFrom の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

cloneOrNullgetInventorygetItemInMainHandgetItemInOffHandgetBootsgetLeggingsgetChestplategetHelmet

equipmentSnapshotForOwner

メソッドprivate
private LevelServantPlayerNpcBridge.EquipmentSnapshot equipmentSnapshotForOwner(UUID ownerId, String ownerName, boolean playerModel)

equipmentSnapshotForOwner の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getLoadoutbuildSkinHeadhelmetgetTypeisAircloneOrNullchestmakeLeatherArmor

createSkinDataFromTextureUrl

メソッドprivate
private LevelServantSkinData createSkinDataFromTextureUrl(String url)

createSkinDataFromTextureUrl の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

isBlanktrimstartsWithreplacegetEncoderencodeToStringgetByteslastIndexOf

cleanupOrphanedServantsRuntime

メソッドprivate
private void cleanupOrphanedServantsRuntime()

cleanupOrphanedServantsRuntime の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

valuesentitygetUniqueIdgetWorldsgetEntitiesgetPersistentDataContainerhasgetScoreboardTags

cleanupStaleServantsOnStartup

メソッドprivate
private void cleanupStaleServantsOnStartup()

cleanupStaleServantsOnStartup の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

valuesentitygetUniqueIdgetWorldsgetEntitiesgetPersistentDataContainerhasgetScoreboardTags

getSkinPref

メソッドprivate
private SkinPref getSkinPref(UUID ownerId)

必要な状態を取得し、呼び出し側で利用しやすい形へ返します。

引数

throws

なし

主要な呼び出し順

getConnectionprepareStatementsetBytesuuidToBytesexecuteQuerynextofNullablegetString

saveSkinPref

メソッドprivate
private void saveSkinPref(UUID ownerId, SkinPref pref)

状態を永続化または更新し、最新状態へ反映します。

引数

throws

なし

主要な呼び出し順

getConnectionprepareStatementlevel_servant_profilessetBytesuuidToBytessetStringmodevalue

uuidToBytes

メソッドprivate
private byte[] uuidToBytes(UUID uuid)

uuidToBytes の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

allocateputLonggetMostSignificantBitsgetLeastSignificantBitsarray

playerDamager

メソッドprivate
private Player playerDamager(EntityDamageByEntityEvent e)

playerDamager の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getDamagergetShooter

livingDamager

メソッドprivate
private LivingEntity livingDamager(EntityDamageByEntityEvent e)

livingDamager の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getDamagergetShooter

servantDamager

メソッドprivate
private LivingEntity servantDamager(EntityDamageByEntityEvent e)

servantDamager の主要処理を担当します。

引数

throws

なし

主要な呼び出し順

getDamagerisServantgetShooter

onJoin

イベント処理public
public void onJoin(PlayerJoinEvent e)

イベント発生時の分岐と後続処理を担当します。

引数

throws

なし

主要な呼び出し順

getPlayergetSchedulerrunTaskLatervaluesgetActiveServantownerIdgetLocationgetYaw

onQuit

イベント処理public
public void onQuit(PlayerQuitEvent e)

イベント発生時の分岐と後続処理を担当します。

引数

throws

なし

主要な呼び出し順

removeServantgetPlayergetUniqueId

onKick

イベント処理public
public void onKick(PlayerKickEvent e)

イベント発生時の分岐と後続処理を担当します。

引数

throws

なし

主要な呼び出し順

removeServantgetPlayergetUniqueId

onServantTarget

イベント処理public
public void onServantTarget(EntityTargetLivingEntityEvent e)

イベント発生時の分岐と後続処理を担当します。

引数

throws

なし

主要な呼び出し順

isServantgetEntitygetOwnerIdgetPlayersetCancelledsetTargetcanEngageTargetgetTarget

onDamage

イベント処理public
public void onDamage(EntityDamageByEntityEvent e)

イベント発生時の分岐と後続処理を担当します。

引数

throws

なし

主要な呼び出し順

playerDamagerservantDamagerisServantgetEntitysetCancelledgetOwnerIdgetPlayerisValidTarget

onServantDeath

イベント処理public
public void onServantDeath(EntityDeathEvent e)

イベント発生時の分岐と後続処理を担当します。

引数

throws

なし

主要な呼び出し順

isServantgetEntitygetDropsclearsetDroppedExpsuppressServantDeathSoundgetOwnerIdremoveServant

onServantEquipmentClick

イベント処理public
public void onServantEquipmentClick(InventoryClickEvent e)

イベント発生時の分岐と後続処理を担当します。

引数

throws

なし

主要な呼び出し順

getWhoClickedgetViewgetTopInventorygetHoldergetUniqueIdequalsownerIdsetCancelled

onServantEquipmentDrag

イベント処理public
public void onServantEquipmentDrag(InventoryDragEvent e)

イベント発生時の分岐と後続処理を担当します。

引数

throws

なし

主要な呼び出し順

getViewgetTopInventorygetHoldergetRawSlotsgetSizebyInventorySlotisAllowedForSlotgetOldCursor

onServantEquipmentClose

イベント処理public
public void onServantEquipmentClose(InventoryCloseEvent e)

イベント発生時の分岐と後続処理を担当します。

引数

throws

なし

主要な呼び出し順

getInventorygetHoldervaluescloneOrNullgetItemisAllowedForSlotgetTypeisAir

代表的な処理フロー

  1. 初期化フロー
    LevelServantService → getScoreService → getConfig → getBoolean → max → getInt
    依存オブジェクトや初期状態を受け取り、このクラスの動作を開始できる状態へ組み立てます。
  2. onDamage フロー
    onDamage → playerDamager → servantDamager → isServant → getEntity → setCancelled
    イベント発生時の分岐と後続処理を担当します。
  3. onJoin フロー
    onJoin → getPlayer → getScheduler → runTaskLater → values → getActiveServant
    イベント発生時の分岐と後続処理を担当します。
  4. onServantDeath フロー
    onServantDeath → isServant → getEntity → getDrops → clear → setDroppedExp
    イベント発生時の分岐と後続処理を担当します。
  5. onServantEquipmentClick フロー
    onServantEquipmentClick → getWhoClicked → getView → getTopInventory → getHolder → getUniqueId
    イベント発生時の分岐と後続処理を担当します。
  6. onServantEquipmentClose フロー
    onServantEquipmentClose → getInventory → getHolder → values → cloneOrNull → getItem
    イベント発生時の分岐と後続処理を担当します。

外部との接点

Web ルート

このクラス内に目立つ Web ルート定義は見つかりませんでした。

SQL / テーブル

level_servant_profilesCURRENT_TIMESTAMPlevel_servant_loadoutskin_mode

関連クラス

補足