Fantasy World Manager に関する管理・集約処理を担当します。

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

クラス説明

クラス直前の Javadoc は見つかりませんでした。ソースとメソッド構成から責務を補完しています。

責務と見どころ

重点クラスの詳細解説

Fantasy ワールドの生成器兼プリセット投入器で、ワールド初期化、ジョブキュー、進捗管理、大規模地形/街区構築、ミニゲーム prefab 配置が一体化しています。

最初に追う読む順番

  1. init
    ワールド生成と初期構成の入口です。
  2. configureWorld
    ルールや border など世界設定を確認します。
  3. scheduleInitialSetpieces
    初期オブジェクト配置の出発点です。
  4. scheduleExpansion
    外周へ拡張する流れの中心です。
  5. newJob
    大きな生成タスクをどうジョブ化するかの要です。
  6. enqueueWithProgress
    実ジョブへ小タスクを積む共通入口です。
  7. startProgressTicker
    進捗表示の更新方法を把握できます。
  8. scheduleConcentricCityLayers
    街区生成の代表的な大仕事です。
  9. runPresetAll
    全部入りプリセットのオーケストレーションです。
  10. scheduleMinigamePrefabs
    ミニゲーム施設の配置を追えます。

内部サブシステムの地図

代表フロー詳解

ミニゲーム施設の投入

  1. scheduleMinigamePrefabsWithArenas
  2. findEmptySpot / findFirstClearDisk
  3. 各 build*Task
  4. whenTaskFinished

空き地探索をしてから prefab を置くため、雑に座標固定していません。施設が重なる問題は空き地判定側を見ます。

変更時の注意点

フィールド

VisibilityTypeName役割
publicStringWORLD_NAMEWORLD_NAME の状態を保持します。
privateJavaPluginpluginプラグイン本体参照です。
privateBuildSchedulerschedulerscheduler の状態を保持します。
privateWorldworldworld の状態を保持します。
privateLocationhubLochubLoc の状態を保持します。
privateintcurrentGroundYcurrentGroundY の状態を保持します。
privateLocationhubSpawnLochubSpawnLoc の状態を保持します。
privateLocationreturnPadLocreturnPadLoc の状態を保持します。
privateFantasyReturnServicereturnSvcreturnSvc の状態を保持します。
privatejava.util.Map<Integer, GenerationJob>jobsjobs の状態を保持します。
privateintnextJobIdnextJobId の状態を保持します。
privateBukkitTaskprogressTickerprogressTicker の状態を保持します。
privateintMAX_RADIUSMAX_RADIUS の状態を保持します。
privateintinnerClearRinnerClearR の状態を保持します。
privateFootprintMapfootprintsfootprints の状態を保持します。
privateintSCATTER_NEAR_MINSCATTER_NEAR_MIN の状態を保持します。

コンストラクタ / 初期化

Signature説明主要呼び出し
public FantasyWorldManager(JavaPlugin plugin)依存オブジェクトや初期状態を受け取り、このクラスの動作を開始できる状態へ組み立てます。getServer → getPluginManager → registerEvents → getCommand → setExecutor → setTabCompleter

メソッド索引

NameVisibilityKind説明
FantasyWorldManagerpublicコンストラクタ依存オブジェクトや初期状態を受け取り、このクラスの動作を開始できる状態へ組み立てます。
setBorderRadiusprivateメソッドsetBorderRadius の主要処理を担当します。
initpublicメソッド初期化と各種登録を行い、機能を有効化します。
buildReturnPadprivateメソッド表示用または出力用のデータを組み立てます。
fantasyHubSpawnprivateメソッドfantasyHubSpawn の主要処理を担当します。
configureWorldprivateメソッドconfigureWorld の主要処理を担当します。
ensureHubPlatformprivateメソッド必要なテーブル・状態・前提条件が揃っているかを確認し、不足分を補います。
scheduleInitialSetpiecesprivateメソッドscheduleInitialSetpieces の主要処理を担当します。
scheduleExpansionprivateメソッドscheduleExpansion の主要処理を担当します。
scheduleExpansionprivateメソッドscheduleExpansion の主要処理を担当します。
spawnInRingprivateメソッドrMin~rMax のリング帯に n 個散布(dist は r^0.
topCenterprivateメソッドtopCenter の主要処理を担当します。
newJobprivateメソッド新しいジョブを作成して管理下に置く
whenJobFinishedprivateメソッドwhenJobFinished の主要処理を担当します。
whenTaskFinishedprivateメソッドwhenTaskFinished の主要処理を担当します。
enqueueWithProgressprivateメソッドenqueueWithProgress の主要処理を担当します。
enqueueWithProgressprivateメソッド進捗を加味してタスクを投入(weight は“作業量”の目安)
enqueueMilestonedprivateメソッドenqueueMilestoned の主要処理を担当します。
enqueueMilestonedRetprivateメソッドenqueueMilestonedRet の主要処理を担当します。
scheduleConcentricCityLayersprivateメソッド同心円レイヤー:リング道路 + 家の塊をリング毎に配置し、最後に放射道路を敷く
startProgressTickerprivateメソッド40tickごとに全ジョブの%をログ/チャットへ出す
currentBorderRadiusprivateメソッドcurrentBorderRadius の主要処理を担当します。
runPresetCityprivateメソッドrunPresetCity の主要処理を担当します。
runPresetAllprivateメソッドrunPresetAll の主要処理を担当します。
buildPondGroundTaskprivateメソッド表示用または出力用のデータを組み立てます。
buildPondCurbRingTaskprivateメソッド表示用または出力用のデータを組み立てます。
buildTreeBasePadTaskprivateメソッド表示用または出力用のデータを組み立てます。
patchGroundUnderBasinsprivateメソッドpatchGroundUnderBasins の主要処理を担当します。
onCommandpublicメソッドonCommand の主要処理を担当します。
scheduleMinigamePrefabsWithArenasprivateメソッドscheduleMinigamePrefabsWithArenas の主要処理を担当します。
buildParkourPrefabTaskprivateメソッド表示用または出力用のデータを組み立てます。
findFirstClearDiskprivateメソッド近場から円形エリアが“空”の地点を探索して返す。
isDiskAirAboveprivateメソッドy 高さの円盤 r の上が高さ h まで“空気”(AIR/LIGHTなど無害ブロックのみ)なら true
onTabCompletepublicメソッドonTabComplete の主要処理を担当します。
prefixFilterprivateメソッドprefixFilter の主要処理を担当します。
scheduleMinigamePrefabsprivateメソッドscheduleMinigamePrefabs の主要処理を担当します。
findEmptySpotprivateメソッド必要な状態を取得し、呼び出し側で利用しやすい形へ返します。
isRectClearprivateメソッド条件判定を行い、後続処理の分岐に使える真偽値を返します。
buildGomokuBoardTaskprivateメソッド表示用または出力用のデータを組み立てます。
buildMoleWhackTaskprivateメソッド表示用または出力用のデータを組み立てます。
buildMemoryTilesTaskprivateメソッド表示用または出力用のデータを組み立てます。
buildTetraPitTaskprivateメソッド表示用または出力用のデータを組み立てます。
buildArcheryPrefabTaskprivateメソッド表示用または出力用のデータを組み立てます。
buildElytraRingsPrefabTaskprivateメソッド表示用または出力用のデータを組み立てます。
buildKothPrefabTaskprivateメソッド表示用または出力用のデータを組み立てます。
buildMobRushPrefabTaskprivateメソッド表示用または出力用のデータを組み立てます。

メソッド詳細

FantasyWorldManager

コンストラクタpublic
public FantasyWorldManager(JavaPlugin plugin)

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

引数

throws

なし

主要な呼び出し順

getServergetPluginManagerregisterEventsgetCommandsetExecutorsetTabCompletergetLoggerwarning

setBorderRadius

メソッドprivate
private void setBorderRadius(int radius)

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

引数

throws

なし

主要な呼び出し順

getWorldBordersetCentersetSizemax

init

メソッドpublic
public void init()

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

引数

throws

なし

主要な呼び出し順

environmenttypegeneratorcreateWorldconfigureWorldensureHubPlatformclonesetSpawnLocation

buildReturnPad

メソッドprivate
private Location buildReturnPad(World w, int y)

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

引数

throws

なし

主要な呼び出し順

getBlockXgetBlockZgetBlockAtsetType

fantasyHubSpawn

メソッドprivate
private Location fantasyHubSpawn()

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

引数

throws

なし

主要な呼び出し順

clonegetSpawnLocationgetWorlds

configureWorld

メソッドprivatestatic
private static void configureWorld(World w)

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

引数

throws

なし

主要な呼び出し順

setAutoSavesetGameRulesetTimesetStormsetThunderingsetDifficultygetWorldBordersetCenter

ensureHubPlatform

メソッドprivatestatic
private static Location ensureHubPlatform(World w, int y)

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

引数

throws

なし

主要な呼び出し順

getSpawnLocationgetBlockXgetBlockZabsgetBlockAtsetType

scheduleInitialSetpieces

メソッドprivate
private void scheduleInitialSetpieces()

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

引数

throws

なし

主要な呼び出し順

cloneenqueue

scheduleExpansion

メソッドprivate
private void scheduleExpansion(int radius, int count)

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

引数

throws

なし

主要な呼び出し順

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

scheduleExpansion

メソッドprivate
private void scheduleExpansion(int radius, int count, GenerationJob job)

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

引数

throws

なし

主要な呼び出し順

roundmaxspawnInRing

spawnInRing

メソッドprivate
private void spawnInRing(java.util.Random r, int rMin, int rMax, int n, GenerationJob job)

rMin~rMax のリング帯に n 個散布(dist は r^0.

引数

throws

なし

主要な呼び出し順

nextDoublepowgetBlockXroundcosgetBlockZsingetBlockY

topCenter

メソッドprivatestatic
private static Location topCenter(World w, int bx, int by, int bz, float yaw, float pitch)

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

引数

throws

なし

主要な呼び出し順

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

newJob

メソッドprivate
private GenerationJob newJob(String label, CommandSender reply)

新しいジョブを作成して管理下に置く

引数

throws

なし

主要な呼び出し順

startProgressTicker

whenJobFinished

メソッドprivate
private void whenJobFinished(GenerationJob job, Runnable next)

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

引数

throws

なし

主要な呼び出し順

rungetSchedulerrunTaskcancelrunTaskTimer

whenTaskFinished

メソッドprivate
private void whenTaskFinished(BuildScheduler.BuildTask task, Runnable next)

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

引数

throws

なし

主要な呼び出し順

runisDonegetSchedulerrunTaskcancelrunTaskTimer

enqueueWithProgress

メソッドprivate
private void enqueueWithProgress(GenerationJob job, int weight, BuildScheduler.BuildTask task)

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

引数

throws

なし

主要な呼び出し順

maxaddAndGetenqueuestepisDone

enqueueWithProgress

メソッドprivate
private void enqueueWithProgress(GenerationJob job, int weight, Runnable submitter)

進捗を加味してタスクを投入(weight は“作業量”の目安)

引数

throws

なし

主要な呼び出し順

maxaddAndGetrun

enqueueMilestoned

メソッドprivate
private void enqueueMilestoned(GenerationJob job, int weightPerMilestone, String label, long estimatedTotal, int milestoneBlocks, BuildScheduler.BuildTask rawTask, CommandSender notify)

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

引数

throws

なし

主要な呼び出し順

maxminenqueueWithProgress

enqueueMilestonedRet

メソッドprivate
private MilestonedTask enqueueMilestonedRet( GenerationJob job, int weightPerMilestone, String label, long estimatedTotal, int milestoneBlocks, BuildScheduler.BuildTask rawTask, CommandSender notify)

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

引数

throws

なし

主要な呼び出し順

maxminenqueueWithProgress

scheduleConcentricCityLayers

メソッドprivate
private void scheduleConcentricCityLayers(int usableR, int y, GenerationJob job, CommandSender reply)

同心円レイヤー:リング道路 + 家の塊をリング毎に配置し、最後に放射道路を敷く

引数

throws

なし

主要な呼び出し順

clonemaxroundenqueueMilestonedenqueueWithProgresscossinmin

startProgressTicker

メソッドprivate
private void startProgressTicker()

40tickごとに全ジョブの%をログ/チャットへ出す

引数

throws

なし

主要な呼び出し順

runisEmptycancelvaluesmaxmingetLoggerinfo

currentBorderRadius

メソッドprivate
private int currentBorderRadius()

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

引数

throws

なし

主要な呼び出し順

getWorldBorderfloorgetSize

runPresetCity

メソッドprivate
private void runPresetCity(int radius, int y, Long seedOverride, CommandSender reply)

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

引数

throws

なし

主要な呼び出し順

getSeedcurrentBorderRadiusmaxminsendMessagenewJobexactCellCountenqueueMilestoned

runPresetAll

メソッドprivate
private GenerationJob runPresetAll(int radius, int y, Integer countOverride, Long seedOverride, CommandSender reply)

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

引数

throws

なし

主要な呼び出し順

getSeedcurrentBorderRadiusmaxminsendMessagenewJobclearreserveDisk

buildPondGroundTask

メソッドprivate
private BuildScheduler.BuildTask buildPondGroundTask(Location c, int baseY, int r, int thickness, Material floor)

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

引数

throws

なし

主要な呼び出し順

getWorldgetBlockXgetBlockZmax

buildPondCurbRingTask

メソッドprivate
private BuildScheduler.BuildTask buildPondCurbRingTask(Location c, int r, Material curb)

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

引数

throws

なし

主要な呼び出し順

getWorldgetBlockXgetBlockZgetBlockYmax

buildTreeBasePadTask

メソッドprivate
private BuildScheduler.BuildTask buildTreeBasePadTask(Location c, int y, int radius)

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

引数

throws

なし

主要な呼び出し順

getBlockXgetBlockZgetBlockAtgetType

patchGroundUnderBasins

メソッドprivate
private BuildScheduler.BuildTask patchGroundUnderBasins(Location center, int y, int searchR, Material fill, int lookUpHeight)

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

引数

throws

なし

主要な呼び出し順

getBlockXgetBlockZgetBlockAtgetTypenameendsWith

onCommand

メソッドpublic
public boolean onCommand(CommandSender s, Command cmd, String label, String[] args)

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

引数

throws

なし

主要な呼び出し順

teleportToFantasiafantasyHubSpawnsendTitleplaySoundtoLowerCasehasPermissionsendMessageclear

scheduleMinigamePrefabsWithArenas

メソッドprivate
private void scheduleMinigamePrefabsWithArenas(int radius, int groundY, GenerationJob job)

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

引数

throws

なし

主要な呼び出し順

enqueueWithProgressbuildParkourPrefabTaskclonebuildArcheryPrefabTaskbuildElytraRingsPrefabTaskbuildKothPrefabTaskbuildMobRushPrefabTaskbuildGomokuBoardTask

buildParkourPrefabTask

メソッドprivate
private BuildScheduler.BuildTask buildParkourPrefabTask(org.bukkit.Location c, int y)

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

引数

throws

なし

主要な呼び出し順

getWorldgetBlockXgetBlockZgetDataFolderexistsmkdirsgetNamesave

findFirstClearDisk

メソッドprivate
private Location findFirstClearDisk(Location centerYFixed, int r, int from, int to, int ringStep, int angleStepDeg)

近場から円形エリアが“空”の地点を探索して返す。

引数

throws

なし

主要な呼び出し順

getWorldgetBlockYtoRadiansgetBlockXroundcosgetBlockZsin

isDiskAirAbove

メソッドprivate
private boolean isDiskAirAbove(World w, int cx, int y, int cz, int r, int h)

y 高さの円盤 r の上が高さ h まで“空気”(AIR/LIGHTなど無害ブロックのみ)なら true

引数

throws

なし

主要な呼び出し順

getBlockAtgetType

onTabComplete

メソッドpublic
public List<String> onTabComplete(CommandSender s, Command cmd, String alias, String[] args)

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

引数

throws

なし

主要な呼び出し順

getNameequalsIgnoreCaseprefixFiltertoLowerCasevalueOfgetBlockYgetSeed

prefixFilter

メソッドprivatestatic
private static java.util.List<String> prefixFilter(java.util.Collection<String> src, String token)

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

引数

throws

なし

主要な呼び出し順

isEmptytoLowerCasestartsWith

scheduleMinigamePrefabs

メソッドprivate
private void scheduleMinigamePrefabs(int radius, int groundY, GenerationJob job)

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

引数

throws

なし

主要な呼び出し順

enqueueWithProgressclonebuildGomokuBoardTaskbuildMoleWhackTaskbuildMemoryTilesTaskbuildTetraPitTaskbuildArcheryPrefabTaskbuildElytraRingsPrefabTask

findEmptySpot

メソッドprivate
private org.bukkit.Location findEmptySpot(int radius, int groundY, int w, int d, int hClear)

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

引数

throws

なし

主要な呼び出し順

ceilsqrtmaxtoRadiansgetBlockXroundcosgetBlockZ

isRectClear

メソッドprivate
private boolean isRectClear(World w, int x1, int z1, int x2, int z2, int y, int hClear)

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

引数

throws

なし

主要な呼び出し順

minmaxgetBlockAtgetType

buildGomokuBoardTask

メソッドprivate
private BuildScheduler.BuildTask buildGomokuBoardTask(org.bukkit.Location c, int y)

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

引数

throws

なし

主要な呼び出し順

getBlockXgetBlockZ

buildMoleWhackTask

メソッドprivate
private BuildScheduler.BuildTask buildMoleWhackTask(org.bukkit.Location c, int y)

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

引数

throws

なし

主要な呼び出し順

getBlockXgetBlockZabs

buildMemoryTilesTask

メソッドprivate
private BuildScheduler.BuildTask buildMemoryTilesTask(org.bukkit.Location c, int y)

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

引数

throws

なし

主要な呼び出し順

getBlockXgetBlockZ

buildTetraPitTask

メソッドprivate
private BuildScheduler.BuildTask buildTetraPitTask(org.bukkit.Location c, int y)

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

引数

throws

なし

主要な呼び出し順

getBlockXgetBlockZ

buildArcheryPrefabTask

メソッドprivate
private BuildScheduler.BuildTask buildArcheryPrefabTask(org.bukkit.Location c, int y)

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

引数

throws

なし

主要な呼び出し順

getBlockXgetBlockZgetWorldgetDataFolderexistsmkdirsgetNamesave

buildElytraRingsPrefabTask

メソッドprivate
private BuildScheduler.BuildTask buildElytraRingsPrefabTask(org.bukkit.Location c, int y)

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

引数

throws

なし

主要な呼び出し順

getBlockXgetBlockZgetWorldtoRadiansroundsincosgetDataFolder

buildKothPrefabTask

メソッドprivate
private BuildScheduler.BuildTask buildKothPrefabTask(org.bukkit.Location c, int y)

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

引数

throws

なし

主要な呼び出し順

getBlockXgetBlockZgetWorldgetDataFolderexistsmkdirsgetNamesave

buildMobRushPrefabTask

メソッドprivate
private BuildScheduler.BuildTask buildMobRushPrefabTask(org.bukkit.Location c, int y)

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

引数

throws

なし

主要な呼び出し順

getBlockXgetBlockZgetWorldgetDataFolderexistsmkdirsgetNamesave

代表的な処理フロー

  1. 初期化フロー
    FantasyWorldManager → getServer → getPluginManager → registerEvents → getCommand → setExecutor
    依存オブジェクトや初期状態を受け取り、このクラスの動作を開始できる状態へ組み立てます。
  2. onCommand フロー
    onCommand → teleportToFantasia → fantasyHubSpawn → sendTitle → playSound → toLowerCase
    onCommand の主要処理を担当します。
  3. onTabComplete フロー
    onTabComplete → getName → equalsIgnoreCase → prefixFilter → toLowerCase → valueOf
    onTabComplete の主要処理を担当します。
  4. startProgressTicker フロー
    startProgressTicker → run → isEmpty → cancel → values → max
    40tickごとに全ジョブの%をログ/チャットへ出す
  5. init フロー
    init → environment → type → generator → createWorld → configureWorld
    初期化と各種登録を行い、機能を有効化します。
  6. buildArcheryPrefabTask フロー
    buildArcheryPrefabTask → getBlockX → getBlockZ → getWorld → getDataFolder → exists
    表示用または出力用のデータを組み立てます。

外部との接点

Web ルート

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

SQL / テーブル

テーブル名の抽出はありませんでした。

関連クラス

補足