From 2e324c90c671985f41d64dc5a707b1a4a079a902 Mon Sep 17 00:00:00 2001 From: ankokun Date: Sat, 28 Mar 2026 00:33:59 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../me/ankokunsan/entityPose/EntityClick.kt | 21 +++++++++++-------- .../entityPose/commands/EntityScale.kt | 4 ++-- .../entityPose/commands/Entityinfo.kt | 8 +++---- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/EntityClick.kt b/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/EntityClick.kt index fc1b9a0c..31fa5ada 100644 --- a/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/EntityClick.kt +++ b/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/EntityClick.kt @@ -40,8 +40,8 @@ import org.bukkit.persistence.PersistentDataType class EntityClick : Listener { - private val selectedPart = mutableMapOf() - private val selectPart = mutableMapOf() + private val selectedPart = mutableMapOf,StandPart>() + private val selectPart = mutableMapOf, EntiPart>() companion object { val currentStep = mutableMapOf() @@ -87,23 +87,23 @@ class EntityClick : Listener { AirBlock.airblockplace(player) event.isCancelled = true - val type = target.type + val key = player.uniqueId to target.type if (target is ArmorStand) { - val current = selectedPart[type] ?: StandPart.Z + val current = selectedPart[key] ?: StandPart.Z val next = if (player.isSneaking) current.prev() else current.next() - selectedPart[type] = next + selectedPart[key] = next actionBar(player, "現在の選択部位→ ${next.display}") } else if (target is LivingEntity) { if (target.hasAI()) { player.sendMessage("§6[EntityPose] §cこのエンティティはAIが有効です") return } - val current = selectPart[type] ?: EntiPart.HAN + val current = selectPart[key] ?: EntiPart.HAN val next1 = if (player.isSneaking) current.prev() else current.next() - selectPart[type] = next1 + selectPart[key] = next1 actionBar(player, "現在の選択→ ${next1.display}") } } @@ -633,13 +633,14 @@ class EntityClick : Listener { } event.isCancelled = true entity.isPersistent = true + val key = player.uniqueId to entity.type val step = currentStep[player.uniqueId] ?: 1.0 val delta = (if (player.isSneaking) -step else step).toFloat() val step2 = currentZah[player.uniqueId] ?: 1.0 val move1 = if (player.isSneaking) -step2 else step2 if (entity is ArmorStand) { - val part = selectedPart[entity.type] ?: return + val part = selectedPart[key] ?: return val rad = Math.toRadians(delta.toDouble()) val selected = activeselection[player.uniqueId] val ismoveMode = @@ -794,7 +795,7 @@ class EntityClick : Listener { } if (entity is LivingEntity) { - val part1 = selectPart[entity.type] ?: return + val part1 = selectPart[key] ?: return val selected1 = activeselection[player.uniqueId] val ismoveMode1 = part1 == EntiPart.X || part1 == EntiPart.Y || part1 == EntiPart.Z || part1 == EntiPart.ALL @@ -884,6 +885,8 @@ class EntityClick : Listener { selection.remove(uuid) activeselection.remove(uuid) } + selectedPart.keys.removeIf { it.first == uuid } + selectPart.keys.removeIf { it.first == uuid } } private fun formatDeg(value: Double): String { diff --git a/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/commands/EntityScale.kt b/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/commands/EntityScale.kt index 30b356d7..57b8bba0 100644 --- a/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/commands/EntityScale.kt +++ b/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/commands/EntityScale.kt @@ -64,12 +64,12 @@ class EntityScale : CommandExecutor { attribute.baseValue = roundedScale } } - player.sendMessage("§6[EntityPose] §a範囲選択されているエンティティのサイズを $roundedScale に設定しました") + player.sendMessage("§6[EntityPose] §a範囲選択されているエンティティのスケールを $roundedScale に設定しました") } else { val attribute = livingEntity.getAttribute(Attribute.SCALE) if (attribute != null) { attribute.baseValue = roundedScale - player.sendMessage("§6[EntityPose] §a視線の先にあるエンティティのサイズを $roundedScale に設定しました") + player.sendMessage("§6[EntityPose] §a視線の先にあるエンティティのスケールを $roundedScale に設定しました") } } return true diff --git a/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/commands/Entityinfo.kt b/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/commands/Entityinfo.kt index a65688e6..9f63b1a3 100644 --- a/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/commands/Entityinfo.kt +++ b/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/commands/Entityinfo.kt @@ -140,7 +140,7 @@ class Entityinfo : CommandExecutor, TabCompleter { val meta = itemMeta as? PotionMeta ?: return@apply meta.color = Color.YELLOW val scale = (target as? LivingEntity)?.getAttribute(Attribute.SCALE)?.baseValue ?: 1.0 - meta.setDisplayName("§fサイズ設定(大きくするほう): $scale") + meta.setDisplayName("§fスケール設定(大きくするほう): $scale") itemMeta = meta } val scaleItem2 = @@ -148,7 +148,7 @@ class Entityinfo : CommandExecutor, TabCompleter { val meta = itemMeta as? PotionMeta ?: return@apply meta.color = Color.YELLOW val scale = (target as? LivingEntity)?.getAttribute(Attribute.SCALE)?.baseValue ?: 1.0 - meta.setDisplayName("§fサイズ設定(小さくするほう): $scale") + meta.setDisplayName("§fスケール設定(小さくするほう): $scale") itemMeta = meta } val lockitem = @@ -235,9 +235,9 @@ class Entityinfo : CommandExecutor, TabCompleter { ItemStack(Material.POTION).apply { // LEGACYを消す val meta = itemMeta as? PotionMeta ?: return@apply meta.color = Color.YELLOW - meta.setDisplayName("§fサイズ設定(大きくするほう)") + meta.setDisplayName("§fスケール設定(大きくするほう)") val lorelist = mutableListOf() - lorelist.add("§7----- 現在のサイズ一覧 -----") + lorelist.add("§7----- 現在のスケール一覧 -----") targets.take(6).forEach { target -> val scale = (target as? LivingEntity)?.getAttribute(Attribute.SCALE)?.baseValue ?: 1.0 val typeName = target.type.name From 8502952a911df0b3dcbcecd48c6bebfbf8ceed5c Mon Sep 17 00:00:00 2001 From: ankokun Date: Sat, 28 Mar 2026 00:34:14 +0900 Subject: [PATCH 2/2] format --- .../src/main/kotlin/me/ankokunsan/entityPose/EntityClick.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/EntityClick.kt b/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/EntityClick.kt index 31fa5ada..16814140 100644 --- a/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/EntityClick.kt +++ b/plugins/EntityPose/src/main/kotlin/me/ankokunsan/entityPose/EntityClick.kt @@ -40,8 +40,8 @@ import org.bukkit.persistence.PersistentDataType class EntityClick : Listener { - private val selectedPart = mutableMapOf,StandPart>() - private val selectPart = mutableMapOf, EntiPart>() + private val selectedPart = mutableMapOf, StandPart>() + private val selectPart = mutableMapOf, EntiPart>() companion object { val currentStep = mutableMapOf()