Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ import org.bukkit.persistence.PersistentDataType

class EntityClick : Listener {

private val selectedPart = mutableMapOf<EntityType, StandPart>()
private val selectPart = mutableMapOf<EntityType, EntiPart>()
private val selectedPart = mutableMapOf<Pair<UUID, EntityType>, StandPart>()
private val selectPart = mutableMapOf<Pair<UUID, EntityType>, EntiPart>()

companion object {
val currentStep = mutableMapOf<UUID, Double>()
Expand Down Expand Up @@ -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}")
}
}
Expand Down Expand Up @@ -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 =
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ 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 =
ItemStack(Material.POTION).apply {
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 =
Expand Down Expand Up @@ -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<String>()
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
Expand Down
Loading