Compare commits

...
Author SHA1 Message Date
whatsy 3c19da86b9 chore: code cleanup 2026-11-25 12:21:22 -05:00
whatsy 8415d65678 Merge branch 'main' into pc-multiselect 2026-11-24 18:56:55 -05:00
Hiroku 99e72339db Remove rogue println, closes #2147 2026-11-08 10:32:42 +10:00
Hiroku 10c9931d2c Merge branch 'weight-tweak-tweak' into 'main'
add `spawnable_position` to weight rule component's "weight" expression

Closes #2145

See merge request cable-mc/cobblemon!2521
2026-11-07 08:20:09 +00:00
Hiroku 0e55165570 Merge branch 'main' into 'main'
Main - fixs #2142, unown name issue.

See merge request cable-mc/cobblemon!2523
2026-11-07 08:19:02 +00:00
Matthew Baerg b6b87621a5 Update file CHANGELOG.md 2026-11-07 04:42:37 +00:00
Matthew Baerg 71b01d562b Update file CHANGELOG.md 2026-11-07 04:39:00 +00:00
Matthew Baerg 21eb66e69b Update file unown.json 2026-11-07 03:31:36 +00:00
Matthew Baerg 8b04e57a1d Update file unown.json 2026-11-07 02:35:21 +00:00
Hiroku 1ff3b7ee96 Updated molang dep for some library fixes 2026-11-07 12:07:03 +10:00
spacky 8a2d6096e3 update changelog 2026-11-03 09:02:01 -08:00
spacky 2645b5e375 add spawnable_position to weight rule component's "weight" expression 2026-11-03 08:03:14 -08:00
Polymeta 99e0a26d7b Merge branch 'compat-improvements' into 'main'
teeny fixes to compat

See merge request cable-mc/cobblemon!2520
2026-11-02 09:17:39 +00:00
dhi_holo 71753df513 Leftovers
Also a slight fix to the order in changelog
2026-11-02 13:30:23 +10:00
dhi_holo 729f080f6e Merge branch 'main' into compat-improvements 2026-11-02 13:26:43 +10:00
dhi_holo 13eb57afb1 category fix
Fixing one recipe category I missed teehee
2026-11-02 13:23:42 +10:00
Jackson Bowes 72b6cb06ff Merge branch 'soon-to-be-implemented-steps' into 'main'
Implementing some steps

See merge request cable-mc/cobblemon!2519
2026-11-01 08:15:06 -06:00
Jackson Bowes 74a57eb972 Merge branch 'sterr/move-sound-implementation' into 'main'
Added sounds to Gigaton Hammer and Pyro Ball

See merge request cable-mc/cobblemon!2518
2026-11-01 08:14:14 -06:00
Sterrezo 7246c7f8e6 Update CHANGELOG.md 2026-11-01 13:22:32 +01:00
Sterrezo cd05f741ae Merge branch 'main' into soon-to-be-implemented-steps 2026-11-01 13:21:23 +01:00
Sterrezo 00222d929d Added sounds to Gigaton Hammer and Pyro Ball 2026-11-01 13:18:22 +01:00
Polymeta b8f4637cb3 Merge branch 'feat/power-ride-training' into 'main'
power bracer ride stat training

See merge request cable-mc/cobblemon!2503
2026-10-31 12:33:22 +00:00
Ronak Chavva 9f572250f5 fix(*): modularization 2026-10-31 06:59:37 -05:00
Ronak Chavva 0927d6fa43 fix(*): enum change, configurable item stat 2026-10-31 06:26:45 -05:00
Ronak Chavva a293b3d71f changelog additions 2026-10-31 05:09:36 -05:00
Ronak Chavva 162b1cc68f Merge branch 'main' of https://gitlab.com/ronakch8/cobblemon into feat/power-ride-training 2026-10-31 05:07:29 -05:00
whatsy 54b52e81de Merge branch 'main' into pc-multiselect 2026-10-30 20:55:21 -04:00
whatsy ec4dea23fc fix flashing 2026-10-26 16:11:26 -04:00
whatsy ed2ad46832 pc health bar display toggle 2026-10-26 15:31:48 -04:00
Ronak Chavva 066a6b56f7 Merge branch 'main' of https://gitlab.com/ronakch8/cobblemon into feat/power-ride-training 2026-10-23 18:13:32 -05:00
Ronak Chavva 7687833add mapping rewrite 2026-10-22 21:35:48 -05:00
Ronak Chavva cb9ba82fcc holding power bracer while riding, 1 to all 5 stats 2026-10-22 03:11:14 -05:00
whatsy 48ff865c55 cleanup 2026-10-17 19:33:20 -04:00
whatsy e0abdb900d im running out of commit message ideas 2026-10-13 22:58:32 -04:00
whatsy 1b74c2906d Merge remote-tracking branch 'origin/pc-multiselect' into pc-multiselect
# Conflicts:
#	common/src/main/kotlin/com/cobblemon/mod/common/client/gui/pc/PCGUI.kt
#	common/src/main/kotlin/com/cobblemon/mod/common/client/gui/pc/StorageWidget.kt
2026-10-13 20:12:50 -04:00
whatsy d3a616e308 tweaks + bugfixes 2026-10-13 14:14:26 -04:00
whatsy 9a06463871 mass release 2026-10-13 10:56:45 -04:00
whatsy 46b5a046ed highlight selected slots 2026-10-13 10:56:45 -04:00
whatsy ab811ead56 you can now batch move pokemon in the pc 2026-10-13 10:56:45 -04:00
whatsy 09a549ffcd implement draggable selection box in PC GUI 2026-10-13 10:56:45 -04:00
whatsy b393293025 mass release 2026-10-13 10:52:35 -04:00
whatsy 68a760a595 highlight selected slots 2026-10-10 18:18:24 -04:00
whatsy ae7bc6e681 you can now batch move pokemon in the pc 2026-10-09 22:57:48 -04:00
whatsy ed007fe429 implement draggable selection box in PC GUI 2026-10-09 20:51:04 -04:00
Sterrezo 4221993f7d Added stepsounds to Mr. Mime 2026-10-03 14:39:21 +02:00
Sterrezo a616c25c8c Added stepsounds to Parasect 2026-09-30 14:45:00 +02:00
Sterrezo 6ce4bf5673 Added stepsounds to Rhyhorn 2026-09-30 14:34:07 +02:00
Sterrezo 1b652ba99f Added stepsounds to Rhydron 2026-09-30 14:01:50 +02:00
Sterrezo 11b59df386 Added stepsounds to Dewgong 2026-09-28 20:20:16 +02:00
Sterrezo ac2b068bf3 Added stepsounds to Blastoise 2026-09-28 14:06:42 +02:00
Sterrezo 8e8f346e52 Added stepsounds keyframes to Venusaur 2026-09-28 13:47:47 +02:00
63 changed files with 1652 additions and 798 deletions

No files matched your search

+28
View File
@@ -2,21 +2,49 @@
## [1.8.5 (MONTH xth, 2026)](#1-8-5) ## [1.8.5 (MONTH xth, 2026)](#1-8-5)
### Additions ### Additions
- You can now drag to select multiple Pokémon inside the PC menu.
### Pokémon Added
#### Generation 4
#### Generation 5
#### Generation 6
#### Generation 7
#### Generation 8
#### Generation 9
### Model updates for the following Pokémon
### Animation updates for the following Pokémon
- Added the `healersSetSpawn` gamerule. When enabled, using a healing machine will set your spawnpoint. - Added the `healersSetSpawn` gamerule. When enabled, using a healing machine will set your spawnpoint.
- A Pokémon holding a Power item now gains 1 point in the corresponding riding stat every two minutes while being ridden. The interval is configurable, and can be disabled with `-1`.
- Added sounds to Gigaton Hammer and Pyro Ball
- Added stepsounds to Venusaur, Blastoise, Dewgong, Rhydon, Rhyhorn, Parasect and Mr. Mime.
### Changes ### Changes
- Amethyst now grows from Typegem core blocks like typegems do - Amethyst now grows from Typegem core blocks like typegems do
- Updated the recipe category for the Create compatibility EXP Candy recipe
- Added No Man's Lands' Honeyed Apple to the Leaves Leftovers tag
- Updated Unown's punctuation form names from `!` and `?` to `Exclamation` and `Question`, changing their visible form labels in tooltips and mod integrations.
### Fixes ### Fixes
- Fixed Ponigiri food values for AppleSkin integration - Fixed Ponigiri food values for AppleSkin integration
- Fixed errors emitted by typos in Parched Peat bog structure files - Fixed errors emitted by typos in Parched Peat bog structure files
- Fixed Unown punctuation forms (? and !) resolving to duplicate Showdown IDs and colliding in form displays.
### Developer ### Developer
- Fixed JsonArray to MoValue conversion not working properly.
### Molang & Datapacks ### Molang & Datapacks
- `q.is_standing_on_blocks` now properly checks for non-full blocks like slabs, Mud or Soul Sand - `q.is_standing_on_blocks` now properly checks for non-full blocks like slabs, Mud or Soul Sand
- Added Molang functions to play footstep sounds based on the corresponding surface. These are intended to be used by Pokémon animations. - Added Molang functions to play footstep sounds based on the corresponding surface. These are intended to be used by Pokémon animations.
- Pokémon can now have their Minecraft footstep sounds silenced in their poser. This doesn't affect emitting game events. - Pokémon can now have their Minecraft footstep sounds silenced in their poser. This doesn't affect emitting game events.
- Fixed the Molang coalescing operator not working the way you'd expect a coalesce operator to.
- Added `v.spawnable_position` to the weight spawn rule component's "weight" expression
### Particles ### Particles
@@ -566,6 +566,7 @@ object CobblemonNetwork {
list.add(PacketRegisterInfo(SwapPartyPokemonPacket.ID, SwapPartyPokemonPacket::decode, SwapPartyPokemonHandler)) list.add(PacketRegisterInfo(SwapPartyPokemonPacket.ID, SwapPartyPokemonPacket::decode, SwapPartyPokemonHandler))
list.add(PacketRegisterInfo(MovePCPokemonPacket.ID, MovePCPokemonPacket::decode, MovePCPokemonHandler)) list.add(PacketRegisterInfo(MovePCPokemonPacket.ID, MovePCPokemonPacket::decode, MovePCPokemonHandler))
list.add(PacketRegisterInfo(MovePCPokemonBatchPacket.ID, MovePCPokemonBatchPacket::decode, MovePCPokemonBatchHandler))
list.add(PacketRegisterInfo(MovePartyPokemonPacket.ID, MovePartyPokemonPacket::decode, MovePartyPokemonHandler)) list.add(PacketRegisterInfo(MovePartyPokemonPacket.ID, MovePartyPokemonPacket::decode, MovePartyPokemonHandler))
list.add(PacketRegisterInfo(SwapPCPartyPokemonPacket.ID, SwapPCPartyPokemonPacket::decode, SwapPCPartyPokemonHandler)) list.add(PacketRegisterInfo(SwapPCPartyPokemonPacket.ID, SwapPCPartyPokemonPacket::decode, SwapPCPartyPokemonHandler))
@@ -9,9 +9,12 @@
package com.cobblemon.mod.common.api.riding.stats package com.cobblemon.mod.common.api.riding.stats
import com.cobblemon.mod.common.api.cooking.Flavour import com.cobblemon.mod.common.api.cooking.Flavour
import com.cobblemon.mod.common.api.tags.CobblemonItemTags
import com.cobblemon.mod.common.util.lang import com.cobblemon.mod.common.util.lang
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import net.minecraft.network.chat.MutableComponent import net.minecraft.network.chat.MutableComponent
import net.minecraft.tags.TagKey
import net.minecraft.world.item.Item
/** /**
* A stat that is used for riding Pokémon. The exact implementation of each of these depends on the [com.cobblemon.mod.common.api.riding.controller.RideController]. * A stat that is used for riding Pokémon. The exact implementation of each of these depends on the [com.cobblemon.mod.common.api.riding.controller.RideController].
@@ -20,13 +23,14 @@ import net.minecraft.network.chat.MutableComponent
* @since February 17th, 2025 * @since February 17th, 2025
*/ */
enum class RidingStat( enum class RidingStat(
val flavour: Flavour val flavour: Flavour,
val powerItem: TagKey<Item>
) { ) {
ACCELERATION(Flavour.SPICY), ACCELERATION(Flavour.SPICY, CobblemonItemTags.POWER_BRACER),
SKILL(Flavour.DRY), SKILL(Flavour.DRY, CobblemonItemTags.POWER_BELT),
SPEED(Flavour.SWEET), SPEED(Flavour.SWEET, CobblemonItemTags.POWER_ANKLET),
STAMINA(Flavour.SOUR), STAMINA(Flavour.SOUR, CobblemonItemTags.POWER_WEIGHT),
JUMP(Flavour.BITTER); JUMP(Flavour.BITTER, CobblemonItemTags.POWER_BAND);
companion object { companion object {
fun getByName(name: String) = RidingStat.entries.firstOrNull { it.name.equals(name, ignoreCase = true) } fun getByName(name: String) = RidingStat.entries.firstOrNull { it.name.equals(name, ignoreCase = true) }
@@ -41,6 +41,7 @@ class WeightTweakRuleComponent : SpawnRuleComponent {
return if (spawnDetailSelector.selects(detail) && spawnablePositionSelector.selects(spawnablePosition)) { return if (spawnDetailSelector.selects(detail) && spawnablePositionSelector.selects(spawnablePosition)) {
runtime.environment.setSimpleVariable("spawn", detail.struct) runtime.environment.setSimpleVariable("spawn", detail.struct)
runtime.environment.setSimpleVariable("spawn_detail", detail.struct) runtime.environment.setSimpleVariable("spawn_detail", detail.struct)
runtime.environment.setSimpleVariable("spawnable_position", spawnablePosition.getOrSetupStruct())
runtime.environment.setSimpleVariable("weight", DoubleValue(weight.toDouble())) runtime.environment.setSimpleVariable("weight", DoubleValue(weight.toDouble()))
runtime.resolveFloat(this.weight) runtime.resolveFloat(this.weight)
} else { } else {
@@ -29,6 +29,7 @@ import com.cobblemon.mod.common.net.messages.client.storage.pc.InitializePCPacke
import com.cobblemon.mod.common.net.messages.client.storage.pc.MoveClientPCPokemonPacket import com.cobblemon.mod.common.net.messages.client.storage.pc.MoveClientPCPokemonPacket
import com.cobblemon.mod.common.net.messages.client.storage.pc.SetPCPokemonPacket import com.cobblemon.mod.common.net.messages.client.storage.pc.SetPCPokemonPacket
import com.cobblemon.mod.common.net.messages.client.storage.pc.wallpaper.UnlockPCBoxWallpaperPacket import com.cobblemon.mod.common.net.messages.client.storage.pc.wallpaper.UnlockPCBoxWallpaperPacket
import com.cobblemon.mod.common.net.messages.server.storage.pc.MovePCPokemonBatchPacket
import com.cobblemon.mod.common.pokemon.Pokemon import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.DataKeys import com.cobblemon.mod.common.util.DataKeys
import com.cobblemon.mod.common.util.asTranslated import com.cobblemon.mod.common.util.asTranslated
@@ -270,6 +271,31 @@ open class PCStore(
} }
} }
fun moveBatch(moves: List<Triple<UUID, PCPosition, PCPosition>>): Boolean {
if (moves.isEmpty() || moves.size > MovePCPokemonBatchPacket.MAX_MOVES) return false
if (moves.map { it.second }.toSet().size != moves.size ||
moves.map { it.third }.toSet().size != moves.size ||
moves.map { it.first }.toSet().size != moves.size
) return false
if (moves.any { (_, source, target) -> !isValidPosition(source) || !isValidPosition(target) }) return false
val sourcePositions = moves.mapTo(mutableSetOf()) { it.second }
val pokemonMoves = moves.map { (pokemonID, source, target) ->
val pokemon = get(source)?.takeIf { it.uuid == pokemonID } ?: return false
Triple(source, target, pokemon)
}
if (pokemonMoves.any { (_, target, _) -> get(target) != null && target !in sourcePositions }) return false
pokemonMoves.forEach { (source, target, pokemon) ->
setAtPosition(source, null)
setAtPosition(target, pokemon)
sendPacketToObservers(RemoveClientPokemonPacket(this, pokemon.uuid))
sendPacketToObservers(SetPCPokemonPacket(uuid, target) { pokemon })
}
pcChangeObservable.emit(Unit)
return true
}
override fun loadPositionFromNBT(nbt: CompoundTag): StoreCoordinates<PCPosition> { override fun loadPositionFromNBT(nbt: CompoundTag): StoreCoordinates<PCPosition> {
return StoreCoordinates(this, PCPosition(nbt.getShort(DataKeys.STORE_BOX).toInt(), nbt.getByte(DataKeys.STORE_SLOT).toInt())) return StoreCoordinates(this, PCPosition(nbt.getShort(DataKeys.STORE_BOX).toInt(), nbt.getByte(DataKeys.STORE_SLOT).toInt()))
} }
@@ -169,7 +169,6 @@ class TypeGemCoreBlock(properties: Properties) : Block(properties) {
if (fullClusterCount == 0) { if (fullClusterCount == 0) {
if (gemCount < Cobblemon.config.typeGemMinGrowth && clusters.isNotEmpty()) { if (gemCount < Cobblemon.config.typeGemMinGrowth && clusters.isNotEmpty()) {
println("Force set a cluster to FULL at size $gemCount")
val randomCluster = clusters.random() val randomCluster = clusters.random()
level.setBlockAndUpdate(randomCluster.second, randomCluster.first.setValue(GROWTH_TYPE, GrowthType.FULL)) level.setBlockAndUpdate(randomCluster.second, randomCluster.first.setValue(GROWTH_TYPE, GrowthType.FULL))
} }
@@ -111,6 +111,7 @@ object CobblemonClient {
val battleOverlay: BattleOverlay by lazy { BattleOverlay() } val battleOverlay: BattleOverlay by lazy { BattleOverlay() }
val pokedexUsageContext: PokedexUsageContext by lazy { PokedexUsageContext() } val pokedexUsageContext: PokedexUsageContext by lazy { PokedexUsageContext() }
val rideControlsOverlay: RideControlsOverlay by lazy { RideControlsOverlay() } val rideControlsOverlay: RideControlsOverlay by lazy { RideControlsOverlay() }
var pcHealthToggle: Boolean = false
fun onLogin() { fun onLogin() {
clientPlayerData = ClientGeneralPlayerData() clientPlayerData = ClientGeneralPlayerData()
@@ -29,7 +29,7 @@ class BoxStorageSlot(
val grabbedSlot = parent.grabbedSlot val grabbedSlot = parent.grabbedSlot
return if (grabbedSlot == null) { return if (grabbedSlot == null) {
true getPokemon().let { it == null || !parent.isInMultiSelection(it, position) }
} else { } else {
grabbedSlot.getPokemon() != getPokemon() grabbedSlot.getPokemon() != getPokemon()
} }
@@ -50,6 +50,8 @@ import net.minecraft.network.chat.Component
import net.minecraft.sounds.SoundEvent import net.minecraft.sounds.SoundEvent
import kotlin.isInitialized import kotlin.isInitialized
import net.minecraft.resources.ResourceLocation import net.minecraft.resources.ResourceLocation
import net.minecraft.util.FastColor
import org.lwjgl.glfw.GLFW
class PCGUI( class PCGUI(
val pc: ClientPC, val pc: ClientPC,
@@ -98,6 +100,8 @@ class PCGUI(
private val buttonWallpaperResource = cobblemonResource("textures/gui/pc/pc_button_set_wallpaper.png") private val buttonWallpaperResource = cobblemonResource("textures/gui/pc/pc_button_set_wallpaper.png")
private val buttonInfoArrow = cobblemonResource("textures/gui/pc/info_arrow.png") private val buttonInfoArrow = cobblemonResource("textures/gui/pc/info_arrow.png")
private val buttonHealthToggleResource = cobblemonResource("textures/gui/pc/pc_button_toggle_health.png")
private val topSpacerResource = cobblemonResource("textures/gui/pc/pc_spacer_top.png") private val topSpacerResource = cobblemonResource("textures/gui/pc/pc_spacer_top.png")
private val bottomSpacerResource = cobblemonResource("textures/gui/pc/pc_spacer_bottom.png") private val bottomSpacerResource = cobblemonResource("textures/gui/pc/pc_spacer_bottom.png")
private val rightSpacerResource = cobblemonResource("textures/gui/pc/pc_spacer_right.png") private val rightSpacerResource = cobblemonResource("textures/gui/pc/pc_spacer_right.png")
@@ -129,6 +133,55 @@ class PCGUI(
var selectPointerOffsetIncrement = false var selectPointerOffsetIncrement = false
var displayOptions = false var displayOptions = false
private var dragStartX: Int? = null
private var dragStartY: Int? = null
private var dragEndX: Int? = null
private var dragEndY: Int? = null
private var selectionDragActive = false
data class SelectionArea(val left: Int, val top: Int, val right: Int, val bottom: Int)
private data class BoxGridBounds(val left: Int, val top: Int, val right: Int, val bottom: Int) {
fun contains(x: Int, y: Int) = x in left..< right && y >= top && y < bottom
}
private fun getBoxGridBounds(): BoxGridBounds {
val left = storageWidget.x
val top = storageWidget.y
return BoxGridBounds(
left,
top,
left + StorageWidget.SCREEN_WIDTH,
top + StorageWidget.SCREEN_HEIGHT
)
}
fun getSelectionArea(): SelectionArea? {
if (!selectionDragActive) return null
val startX = dragStartX ?: return null
val startY = dragStartY ?: return null
val endX = dragEndX ?: return null
val endY = dragEndY ?: return null
val bounds = getBoxGridBounds()
if (!bounds.contains(startX, startY)) return null
val columns = 6
val rows = 5
val slotPitch = StorageSlot.SIZE + StorageWidget.BOX_SLOT_PADDING
val gridLeft = bounds.left + StorageWidget.BOX_SLOT_START_OFFSET_X
val gridTop = bounds.top + StorageWidget.BOX_SLOT_START_OFFSET_Y + if (displayOptions) 5 else 0
val startColumn = ((startX - gridLeft) / slotPitch).coerceIn(0, columns - 1)
val endColumn = (((endX.coerceIn(bounds.left, bounds.right - 1)) - gridLeft) / slotPitch).coerceIn(0, columns - 1)
val startRow = ((startY - gridTop) / slotPitch).coerceIn(0, rows - 1)
val endRow = (((endY.coerceIn(bounds.top, bounds.bottom - 1)) - gridTop) / slotPitch).coerceIn(0, rows - 1)
return SelectionArea(
gridLeft + minOf(startColumn, endColumn) * slotPitch, // left
gridTop + minOf(startRow, endRow) * slotPitch, // top
gridLeft + (maxOf(startColumn, endColumn) * slotPitch) + StorageSlot.SIZE, // right
gridTop + (maxOf(startRow, endRow) * slotPitch) + StorageSlot.SIZE // bottom
)
}
override fun renderBlurredBackground(delta: Float) {} override fun renderBlurredBackground(delta: Float) {}
override fun renderMenuBackground(context: GuiGraphics) {} override fun renderMenuBackground(context: GuiGraphics) {}
@@ -219,7 +272,6 @@ class PCGUI(
storageWidget.setupStorageSlots() storageWidget.setupStorageSlots()
for (button in optionButtons) { for (button in optionButtons) {
button.visible = displayOptions button.visible = displayOptions
button.highlighted = false
} }
}.also { it.highlighted = displayOptions } }.also { it.highlighted = displayOptions }
) )
@@ -250,12 +302,28 @@ class PCGUI(
configuration.showParty = isVisible configuration.showParty = isVisible
wallpaperWidget.visible = !isVisible wallpaperWidget.visible = !isVisible
(it as IconButton).highlighted = !isVisible (it as IconButton).highlighted = !isVisible
if (!unseenWallpapers.isEmpty()) MarkPCBoxWallpapersSeenPacket(unseenWallpapers).sendToServer() if (unseenWallpapers.isNotEmpty()) MarkPCBoxWallpapersSeenPacket(unseenWallpapers).sendToServer()
}.also { }.also {
it.visible = displayOptions it.visible = displayOptions
optionButtons.add(it) optionButtons.add(it)
}) })
val healthButton = this.addRenderableWidget(IconButton(
pX = x + 230,
pY = y + 31,
buttonWidth = 20,
buttonHeight = 20,
resource = buttonHealthToggleResource,
label = "toggle_health_bars",
) {
CobblemonClient.pcHealthToggle = !CobblemonClient.pcHealthToggle
(it as IconButton).highlighted = CobblemonClient.pcHealthToggle
}.also {
it.visible = displayOptions
optionButtons.add(it)
})
healthButton.highlighted = CobblemonClient.pcHealthToggle
PokemonSortMode.entries.forEachIndexed { index, sortType -> PokemonSortMode.entries.forEachIndexed { index, sortType ->
val typeName = sortType.name.lowercase() val typeName = sortType.name.lowercase()
this.addRenderableWidget(IconButton( this.addRenderableWidget(IconButton(
@@ -315,6 +383,20 @@ class PCGUI(
super.init() super.init()
} }
private fun renderSelectionBox(context: GuiGraphics, area: SelectionArea) {
context.pose().pushPose()
context.pose().translate(0.0, 0.0, 1500.0)
val borderColor = FastColor.ARGB32.color(255, 205, 212, 255)
val bgColor = FastColor.ARGB32.color(75, 133, 183, 230)
val thickness = 1
context.fill(area.left, area.top, area.right, area.bottom, bgColor)
context.fill(area.left, area.top, area.right, area.top + thickness, borderColor)
context.fill(area.left, area.bottom - thickness, area.right, area.bottom, borderColor)
context.fill(area.left, area.top, area.left + thickness, area.bottom, borderColor)
context.fill(area.right - thickness, area.top, area.right, area.bottom, borderColor)
context.pose().popPose()
}
override fun render(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) { override fun render(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) {
val matrices = context.pose() val matrices = context.pose()
renderBackground(context, mouseX, mouseY, delta) renderBackground(context, mouseX, mouseY, delta)
@@ -455,6 +537,20 @@ class PCGUI(
shadow = true shadow = true
) )
// var dexNo = pokemon.species.nationalPokedexNumber.toString()
// while (dexNo.length < 4) {
// dexNo = "0$dexNo"
// }
// drawScaledText(
// context = context,
// font = CobblemonResources.DEFAULT_LARGE,
// text = Component.literal(dexNo).bold(),
// x = x + 38,
// y = y + 1.5,
// shadow = true,
// scale = 0.85f
// )
drawScaledText( drawScaledText(
context = context, context = context,
font = CobblemonResources.DEFAULT_LARGE, font = CobblemonResources.DEFAULT_LARGE,
@@ -685,12 +781,14 @@ class PCGUI(
scale = SCALE scale = SCALE
) )
if (!optionButtons.isEmpty() && displayOptions) { if (optionButtons.isNotEmpty() && displayOptions) {
for (button in optionButtons) button.showAlt = hasShiftDown() for (button in optionButtons) button.showAlt = hasShiftDown()
} }
super.render(context, mouseX, mouseY, delta) super.render(context, mouseX, mouseY, delta)
getSelectionArea()?.let { renderSelectionBox(context, it) }
// Item Tooltip // Item Tooltip
if (pokemon != null) { if (pokemon != null) {
val displayedItem = if (showCosmeticItem) pokemon.cosmeticItem else pokemon.heldItemNoCopy() val displayedItem = if (showCosmeticItem) pokemon.cosmeticItem else pokemon.heldItemNoCopy()
@@ -712,6 +810,20 @@ class PCGUI(
} }
override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean { override fun mouseClicked(mouseX: Double, mouseY: Double, button: Int): Boolean {
storageWidget.clearPendingStorageSlotClick()
selectionDragActive = false
val clickX = mouseX.toInt()
val clickY = mouseY.toInt()
if (storageWidget.multiSelection == null && button == 0 &&
getBoxGridBounds().contains(clickX, clickY) &&
storageWidget.pastureWidget == null) {
dragStartX = clickX
dragStartY = clickY
} else {
dragStartX = null
dragStartY = null
}
// Trigger child component function as they will need to check the entire screen click area // Trigger child component function as they will need to check the entire screen click area
if (::boxNameWidget.isInitialized) boxNameWidget.mouseClicked(mouseX, mouseY, button) if (::boxNameWidget.isInitialized) boxNameWidget.mouseClicked(mouseX, mouseY, button)
return super.mouseClicked(mouseX, mouseY, button) return super.mouseClicked(mouseX, mouseY, button)
@@ -740,9 +852,43 @@ class PCGUI(
storageWidget.pastureWidget?.let { pasture -> storageWidget.pastureWidget?.let { pasture ->
if (pasture.pastureScrollList.isHovered) pasture.pastureScrollList.mouseDragged(mouseX, mouseY, button, deltaX, deltaY) if (pasture.pastureScrollList.isHovered) pasture.pastureScrollList.mouseDragged(mouseX, mouseY, button, deltaX, deltaY)
} }
if (button == 0 && storageWidget.pastureWidget == null) {
val startX = dragStartX
val startY = dragStartY
if (startX != null && startY != null) {
val offsetX = mouseX - startX
val offsetY = mouseY - startY
if (offsetX * offsetX + offsetY * offsetY >= 25.0) {
selectionDragActive = true
storageWidget.clearPendingStorageSlotClick()
dragEndX = mouseX.toInt()
dragEndY = mouseY.toInt()
}
}
}
return super.mouseDragged(mouseX, mouseY, button, deltaX, deltaY) return super.mouseDragged(mouseX, mouseY, button, deltaX, deltaY)
} }
override fun mouseReleased(mouseX: Double, mouseY: Double, button: Int): Boolean {
val handled = super.mouseReleased(mouseX, mouseY, button)
if (button == GLFW.GLFW_MOUSE_BUTTON_LEFT) {
if (selectionDragActive) {
dragEndX = mouseX.toInt()
dragEndY = mouseY.toInt()
storageWidget.updateSelection()
storageWidget.clearPendingStorageSlotClick()
} else {
storageWidget.completePendingStorageSlotClick(mouseX, mouseY)
}
}
dragStartX = null
dragStartY = null
dragEndX = null
dragEndY = null
selectionDragActive = false
return handled
}
override fun keyPressed(keyCode: Int, scanCode: Int, modifiers: Int): Boolean { override fun keyPressed(keyCode: Int, scanCode: Int, modifiers: Int): Boolean {
val boxNameFocused = this::boxNameWidget.isInitialized && boxNameWidget.isFocused val boxNameFocused = this::boxNameWidget.isInitialized && boxNameWidget.isFocused
val filterFocused = this::filterWidget.isInitialized && filterWidget.isFocused val filterFocused = this::filterWidget.isInitialized && filterWidget.isFocused
@@ -0,0 +1,37 @@
package com.cobblemon.mod.common.client.gui.pc
import com.cobblemon.mod.common.pokemon.Pokemon
data class PCMultiSelection(
private val grid: MutableList<MutableList<Pokemon?>> = mutableListOf(),
val sourceBox: Int = 0,
val sourceColumn: Int = 0,
val sourceRow: Int = 0
) {
fun getHorizontalSize(): Int = grid.firstOrNull()?.size ?: 0
fun getVerticalSize(): Int = grid.size
constructor(horizontalSize: Int, verticalSize: Int, sourceBox: Int, sourceColumn: Int, sourceRow: Int) : this(
MutableList(verticalSize) { MutableList<Pokemon?>(horizontalSize) { null } },
sourceBox,
sourceColumn,
sourceRow
)
fun getPokemon(x: Int, y: Int): Pokemon? {
return grid[y][x]
}
fun setPokemon(x: Int, y: Int, pokemon: Pokemon?) {
grid[y][x] = pokemon
}
fun pokemonEntries(): List<Triple<Int, Int, Pokemon>> {
return grid.flatMapIndexed { y, row ->
row.mapIndexedNotNull { x, pokemon -> pokemon?.let { Triple(x, y, it) } }
}
}
fun getPokemonCount(): Int = pokemonEntries().size
}
@@ -45,11 +45,13 @@ class ReleaseButton(
vOffset = if (isHovered(mouseX.toDouble(), mouseY.toDouble())) HEIGHT else 0, vOffset = if (isHovered(mouseX.toDouble(), mouseY.toDouble())) HEIGHT else 0,
textureHeight = HEIGHT * 2 textureHeight = HEIGHT * 2
) )
val pokemonCount = parent.multiSelection?.getPokemonCount() ?: 0
drawScaledText( drawScaledText(
context = context, context = context,
font = CobblemonResources.DEFAULT_LARGE, font = CobblemonResources.DEFAULT_LARGE,
text = lang("ui.pc.release").bold(), text = if (pokemonCount > 1)
{ lang("ui.pc.release_all").bold() } else { lang("ui.pc.release").bold() },
x = x + (WIDTH / 2), x = x + (WIDTH / 2),
y = y + 3.5, y = y + 3.5,
centered = true, centered = true,
@@ -10,10 +10,11 @@ package com.cobblemon.mod.common.client.gui.pc
import com.cobblemon.mod.common.Cobblemon import com.cobblemon.mod.common.Cobblemon
import com.cobblemon.mod.common.api.gui.blitk import com.cobblemon.mod.common.api.gui.blitk
import com.cobblemon.mod.common.client.CobblemonClient
import com.cobblemon.mod.common.client.gui.CobblemonRenderable import com.cobblemon.mod.common.client.gui.CobblemonRenderable
import com.cobblemon.mod.common.client.gui.PokemonGUIAnimationStyle
import com.cobblemon.mod.common.client.gui.drawProfilePokemon import com.cobblemon.mod.common.client.gui.drawProfilePokemon
import com.cobblemon.mod.common.client.gui.pasture.PasturePCGUIConfiguration import com.cobblemon.mod.common.client.gui.pasture.PasturePCGUIConfiguration
import com.cobblemon.mod.common.client.gui.PokemonGUIAnimationStyle
import com.cobblemon.mod.common.client.render.drawScaledText import com.cobblemon.mod.common.client.render.drawScaledText
import com.cobblemon.mod.common.client.render.models.blockbench.FloatingState import com.cobblemon.mod.common.client.render.models.blockbench.FloatingState
import com.cobblemon.mod.common.client.render.renderScaledGuiItemIcon import com.cobblemon.mod.common.client.render.renderScaledGuiItemIcon
@@ -22,13 +23,19 @@ import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.cobblemonResource import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.lang import com.cobblemon.mod.common.util.lang
import com.cobblemon.mod.common.util.math.fromEulerXYZDegrees import com.cobblemon.mod.common.util.math.fromEulerXYZDegrees
import juuxel.adorn.util.Colors
import net.minecraft.client.Minecraft import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiGraphics import net.minecraft.client.gui.GuiGraphics
import net.minecraft.client.gui.components.Button import net.minecraft.client.gui.components.Button
import net.minecraft.client.renderer.RenderType
import net.minecraft.client.sounds.SoundManager import net.minecraft.client.sounds.SoundManager
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import net.minecraft.util.Mth
import org.joml.Quaternionf import org.joml.Quaternionf
import org.joml.Vector3f import org.joml.Vector3f
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.roundToInt
open class StorageSlot( open class StorageSlot(
x: Int, y: Int, x: Int, y: Int,
@@ -54,9 +61,17 @@ open class StorageSlot(
} }
override fun renderWidget(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) { override fun renderWidget(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) {
val selectionArea = parent.pcGui.getSelectionArea()
if (selectionArea != null && parent.getSelectedPokemon(selectionArea).contains(this)) {
val highlightColor = 0x40FFFFFF
context.fill(x + 1, y, x + (SIZE - 1), y + SIZE, highlightColor)
context.fill(x, y + 1, x + 1, y + (SIZE - 1), highlightColor)
context.fill(x + SIZE - 1, y + 1, x + SIZE, y + (SIZE - 1), highlightColor)
}
if (shouldRender()) { if (shouldRender()) {
renderSlot(context, x, y, delta) renderSlot(context, x, y, delta)
} }
} }
fun renderSlot(context: GuiGraphics, posX: Int, posY: Int, partialTicks: Float) { fun renderSlot(context: GuiGraphics, posX: Int, posY: Int, partialTicks: Float) {
@@ -130,6 +145,23 @@ open class StorageSlot(
matrixStack = matrices matrixStack = matrices
) )
} }
// Pokemon health
// Taken from vanilla durability rendering
val currentHealth = pokemon.currentHealth
val maxHealth = pokemon.maxHealth.toFloat()
if (currentHealth < maxHealth && CobblemonClient.pcHealthToggle) {
val damageValue = maxHealth - currentHealth
val f = max(0.0f, (maxHealth - (maxHealth - currentHealth)) / maxHealth)
val color = Mth.hsvToRgb(f / 3.0f, 1.0f, 1.0f)
val totalWidth = 12
val width = (totalWidth - damageValue * totalWidth / pokemon.maxHealth.toFloat()).roundToInt();
val k = posX + 1
val l = posY + 6
val bgColor = if (this is PartyStorageSlot) Colors.BLACK else 0xFF3E3E3E.toInt()
context.fill(RenderType.guiOverlay(), k, l, k + totalWidth, l + 1, bgColor)
context.fill(RenderType.guiOverlay(), k, l, k + width, l + 1, color or bgColor)
}
matrices.popPose() matrices.popPose()
} }
@@ -11,7 +11,6 @@ package com.cobblemon.mod.common.client.gui.pc
import com.cobblemon.mod.common.CobblemonNetwork import com.cobblemon.mod.common.CobblemonNetwork
import com.cobblemon.mod.common.CobblemonSounds import com.cobblemon.mod.common.CobblemonSounds
import com.cobblemon.mod.common.api.gui.blitk import com.cobblemon.mod.common.api.gui.blitk
import com.cobblemon.mod.common.api.storage.StorePosition
import com.cobblemon.mod.common.api.storage.party.PartyPosition import com.cobblemon.mod.common.api.storage.party.PartyPosition
import com.cobblemon.mod.common.api.storage.pc.PCPosition import com.cobblemon.mod.common.api.storage.pc.PCPosition
import com.cobblemon.mod.common.api.text.bold import com.cobblemon.mod.common.api.text.bold
@@ -39,8 +38,9 @@ import net.minecraft.client.gui.components.Button
import net.minecraft.client.gui.screens.Screen import net.minecraft.client.gui.screens.Screen
import net.minecraft.client.resources.sounds.SimpleSoundInstance import net.minecraft.client.resources.sounds.SimpleSoundInstance
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import net.minecraft.resources.ResourceLocation
import net.minecraft.sounds.SoundEvent import net.minecraft.sounds.SoundEvent
import java.util.UUID
import com.cobblemon.mod.common.net.messages.server.storage.pc.MovePCPokemonBatchPacket.PCPokemonMove
class StorageWidget( class StorageWidget(
pX: Int, pY: Int, pX: Int, pY: Int,
@@ -77,9 +77,14 @@ class StorageWidget(
var displayConfirmRelease = false var displayConfirmRelease = false
var screenLoaded = false var screenLoaded = false
var selectedPosition: StorePosition? = null var selectedPosition: PartyPosition? = null
var grabbedSlot: GrabbedStorageSlot? = null var grabbedSlot: GrabbedStorageSlot? = null
var multiSelection: PCMultiSelection? = null
private val multiGrabbedSlots = mutableMapOf<UUID, GrabbedStorageSlot>()
private var pendingStorageSlotClick: Button? = null
private var movePending = false
var box = 0 var box = 0
set(value) { set(value) {
field = field =
@@ -113,16 +118,22 @@ class StorageWidget(
subKey = "ui.generic.yes", subKey = "ui.generic.yes",
onPress = { onPress = {
if (canDeleteSelected() && displayConfirmRelease) { if (canDeleteSelected() && displayConfirmRelease) {
val position = selectedPosition ?: return@ReleaseConfirmButton val selection = multiSelection
val pokemon = getSelectedPokemon() ?: return@ReleaseConfirmButton if (selection != null) {
selection.pokemonEntries().forEach { (column, row, pokemon) ->
val position = PCPosition(
selection.sourceBox,
(selection.sourceRow + row) * 6 + selection.sourceColumn + column
)
CobblemonNetwork.sendToServer(ReleasePCPokemonPacket(pokemon.uuid, position))
}
} else {
val position = selectedPosition ?: return@ReleaseConfirmButton
val pokemon = getSelectedPokemon() ?: return@ReleaseConfirmButton
val packet = when (position) { CobblemonNetwork.sendToServer(ReleasePartyPokemonPacket(pokemon.uuid, position))
is PartyPosition -> ReleasePartyPokemonPacket(pokemon.uuid, position)
is PCPosition -> ReleasePCPokemonPacket(pokemon.uuid, position)
else -> return@ReleaseConfirmButton
} }
CobblemonNetwork.sendToServer(packet)
playSound(CobblemonSounds.PC_RELEASE) playSound(CobblemonSounds.PC_RELEASE)
resetSelected() resetSelected()
displayConfirmRelease = false displayConfirmRelease = false
@@ -149,9 +160,8 @@ class StorageWidget(
} }
fun canDeleteSelected(): Boolean { fun canDeleteSelected(): Boolean {
return !(selectedPosition is PartyPosition && party.filterNotNull().size <= 1) multiSelection?.let { return it.pokemonEntries().isNotEmpty() }
&& selectedPosition != null return party.filterNotNull().size > 1 && selectedPosition != null && grabbedSlot != null
&& grabbedSlot != null
} }
fun setupStorageSlots() { fun setupStorageSlots() {
@@ -170,7 +180,7 @@ class StorageWidget(
parent = this, parent = this,
pc = pc, pc = pc,
position = PCPosition(box, index), position = PCPosition(box, index),
onPress = { this.onStorageSlotClicked(it) } onPress = { pendingStorageSlotClick = it }
).also { widget -> ).also { widget ->
this.addWidget(widget) this.addWidget(widget)
this.boxSlots.add(widget) this.boxSlots.add(widget)
@@ -200,7 +210,7 @@ class StorageWidget(
parent = this, parent = this,
party = party, party = party,
position = PartyPosition(partyIndex), position = PartyPosition(partyIndex),
onPress = { this.onStorageSlotClicked(it) } onPress = { pendingStorageSlotClick = it }
).also { widget -> ).also { widget ->
this.addWidget(widget) this.addWidget(widget)
this.partySlots.add(widget) this.partySlots.add(widget)
@@ -210,14 +220,118 @@ class StorageWidget(
private fun getSelectedPokemon(): Pokemon? { private fun getSelectedPokemon(): Pokemon? {
val selectedPosition = this.selectedPosition ?: return null val selectedPosition = this.selectedPosition ?: return null
return when (selectedPosition) { return party.get(selectedPosition)
is PCPosition -> pc.get(selectedPosition) }
is PartyPosition -> party.get(selectedPosition)
else -> null fun getSelectedPokemon(area: PCGUI.SelectionArea): List<BoxStorageSlot> {
return boxSlots.filter { slot ->
slot.x < area.right && slot.x + StorageSlot.SIZE > area.left &&
slot.y < area.bottom && slot.y + StorageSlot.SIZE > area.top &&
slot.getPokemon()?.let(pcGui.search::passes) == true
} }
} }
fun clearPendingStorageSlotClick() {
pendingStorageSlotClick = null
}
fun completePendingStorageSlotClick(mouseX: Double, mouseY: Double) {
val button = pendingStorageSlotClick ?: return
pendingStorageSlotClick = null
if (button.isMouseOver(mouseX, mouseY)) {
onStorageSlotClicked(button)
}
}
fun updateSelection() {
val area = pcGui.getSelectionArea()
if (area == null) {
multiSelection = null
return
}
selectedPosition = null
grabbedSlot = null
pcGui.setPreviewPokemon(null)
val selectedSlots = getSelectedPokemon(area)
if (selectedSlots.isEmpty()) {
multiSelection = null
return
}
val minColumn = selectedSlots.minOf { it.position.slot % 6 }
val maxColumn = selectedSlots.maxOf { it.position.slot % 6 }
val minRow = selectedSlots.minOf { it.position.slot / 6 }
val maxRow = selectedSlots.maxOf { it.position.slot / 6 }
val selection = PCMultiSelection(maxColumn - minColumn + 1, maxRow - minRow + 1, box, minColumn, minRow)
selectedSlots.forEach { slot ->
val pokemon = slot.getPokemon() ?: return@forEach
val slotIndex = slot.position.slot
val column = slotIndex % 6
val row = slotIndex / 6
if (column in minColumn..maxColumn && row in minRow..maxRow) {
selection.setPokemon(column - minColumn, row - minRow, pokemon)
}
}
playSound(CobblemonSounds.PC_GRAB)
multiSelection = selection
}
private fun moveMultiSelectionTo(destination: PCPosition): Boolean {
val selection = multiSelection ?: return false
val width = selection.getHorizontalSize()
val height = selection.getVerticalSize()
val destinationColumn = destination.slot % 6
val destinationRow = destination.slot / 6
if (destinationColumn + width > 6 || destinationRow + height > 5) return false
val moves = mutableListOf<PCPokemonMove>()
val selectedSources = mutableSetOf<PCPosition>()
repeat(height) { row ->
repeat(width) { column ->
val pokemon = selection.getPokemon(column, row) ?: return@repeat
val source = PCPosition(selection.sourceBox, (selection.sourceRow + row) * 6 + selection.sourceColumn + column)
val target = PCPosition(destination.box, (destinationRow + row) * 6 + destinationColumn + column)
selectedSources.add(source)
moves.add(PCPokemonMove(pokemon.uuid, source, target))
}
}
if (moves.isEmpty()) return false
repeat(height) { row ->
repeat(width) { column ->
if (selection.getPokemon(column, row) == null) return@repeat
val target = PCPosition(destination.box, (destinationRow + row) * 6 + destinationColumn + column)
val displacedPokemon = pc.get(target) ?: return@repeat
if (target in selectedSources) return@repeat
val displacedSource = PCPosition(
selection.sourceBox,
(selection.sourceRow + row) * 6 + selection.sourceColumn + column
)
if (pc.get(displacedSource) != null && displacedSource !in selectedSources) return false
moves.add(PCPokemonMove(displacedPokemon.uuid, target, displacedSource))
}
}
if (moves.map { it.newPosition }.toSet().size != moves.size) return false
MovePCPokemonBatchPacket(moves).sendToServer()
return true
}
fun isInMultiSelection(pokemon: Pokemon, position: PCPosition): Boolean {
val selection = multiSelection ?: return false
return selection.sourceBox == position.box && selection.pokemonEntries().any { it.third == pokemon }
}
override fun renderWidget(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) { override fun renderWidget(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) {
updatePendingMove()
val matrices = context.pose() val matrices = context.pose()
// Party Label // Party Label
if (pcGui.configuration.showParty) { if (pcGui.configuration.showParty) {
@@ -240,11 +354,14 @@ class StorageWidget(
shadow = true shadow = true
) )
val pokemonCount = multiSelection?.getPokemonCount() ?: 0
if (canDeleteSelected() && displayConfirmRelease) { if (canDeleteSelected() && displayConfirmRelease) {
drawScaledText( drawScaledText(
context = context, context = context,
font = CobblemonResources.DEFAULT_LARGE, font = CobblemonResources.DEFAULT_LARGE,
text = lang("ui.pc.release").bold(), text = if (pokemonCount > 1)
{ lang("ui.pc.release_all").bold() } else { lang("ui.pc.release").bold() },
x = x + 223, x = x + 223,
y = y + 119, y = y + 119,
centered = true centered = true
@@ -308,6 +425,7 @@ class StorageWidget(
slot.render(context, mouseX, mouseY, delta) slot.render(context, mouseX, mouseY, delta)
val pokemon = slot.getPokemon() val pokemon = slot.getPokemon()
if (grabbedSlot == null && slot.isHovered(mouseX, mouseY) if (grabbedSlot == null && slot.isHovered(mouseX, mouseY)
&& multiSelection == null
&& pokemon != null && pokemon != pcGui.previewPokemon && pokemon != null && pokemon != pcGui.previewPokemon
) { ) {
pcGui.setPreviewPokemon(pokemon, pcGui.isPreviewInParty ?: false) pcGui.setPreviewPokemon(pokemon, pcGui.isPreviewInParty ?: false)
@@ -324,6 +442,7 @@ class StorageWidget(
slot.render(context, mouseX, mouseY, delta) slot.render(context, mouseX, mouseY, delta)
val pokemon = slot.getPokemon() val pokemon = slot.getPokemon()
if (grabbedSlot == null && slot.isHovered(mouseX, mouseY) if (grabbedSlot == null && slot.isHovered(mouseX, mouseY)
&& multiSelection == null
&& pokemon != null && pokemon != pcGui.previewPokemon && pokemon != null && pokemon != pcGui.previewPokemon
) { ) {
pcGui.setPreviewPokemon(pokemon, pcGui.isPreviewInParty ?: true) pcGui.setPreviewPokemon(pokemon, pcGui.isPreviewInParty ?: true)
@@ -335,10 +454,32 @@ class StorageWidget(
pastureWidget?.render(context, mouseX, mouseY, delta) pastureWidget?.render(context, mouseX, mouseY, delta)
matrices.pushPose() matrices.pushPose()
matrices.translate(0.0, 0.0, 1000.0) matrices.translate(0.0, 0.0, 1000.0)
grabbedSlot?.render(context, mouseX, mouseY, delta) renderSelectedPokemon(context, mouseX, mouseY, delta)
matrices.popPose() matrices.popPose()
} }
private fun renderSelectedPokemon(context: GuiGraphics, mouseX: Int, mouseY: Int, delta: Float) {
if (movePending) return
val selection = multiSelection
if (selection == null) {
grabbedSlot?.render(context, mouseX, mouseY, delta)
return
}
val slotOffset = StorageSlot.SIZE + BOX_SLOT_PADDING
selection.pokemonEntries().forEach { (column, row, pokemon) ->
val grabbed = multiGrabbedSlots.getOrPut(pokemon.uuid) {
GrabbedStorageSlot(0, 0, this, pokemon)
}
grabbed.render(
context,
mouseX + column * slotOffset,
mouseY + row * slotOffset,
delta
)
}
}
override fun mouseClicked(pMouseX: Double, pMouseY: Double, pButton: Int): Boolean { override fun mouseClicked(pMouseX: Double, pMouseY: Double, pButton: Int): Boolean {
if (displayConfirmRelease) { if (displayConfirmRelease) {
if (releaseYesButton.isHovered(pMouseX, pMouseY)) releaseYesButton.mouseClicked(pMouseX, pMouseY, pButton) if (releaseYesButton.isHovered(pMouseX, pMouseY)) releaseYesButton.mouseClicked(pMouseX, pMouseY, pButton)
@@ -371,23 +512,55 @@ class StorageWidget(
else -> return else -> return
} }
val clickedPokemon = when (clickedPosition) {
is PCPosition -> pc.get(clickedPosition)
is PartyPosition -> party.get(clickedPosition)
else -> null
}
multiSelection?.let { selection ->
when (clickedPosition) {
is PCPosition -> {
if (clickedPosition.box == selection.sourceBox &&
clickedPosition.slot == selection.sourceRow * 6 + selection.sourceColumn
) {
resetSelected()
} else if (moveMultiSelectionTo(clickedPosition)) {
playSound(CobblemonSounds.PC_DROP)
movePending = true
}
}
is PartyPosition -> {
val selectedPokemon = selection.pokemonEntries().singleOrNull() ?: return
val (column, row, pokemon) = selectedPokemon
val source = PCPosition(
selection.sourceBox,
(selection.sourceRow + row) * 6 + selection.sourceColumn + column
)
if (pc.get(source) !== pokemon) return
val packet = clickedPokemon?.let {
SwapPCPartyPokemonPacket(it.uuid, clickedPosition, pokemon.uuid, source)
} ?: MovePCPokemonToPartyPacket(pokemon.uuid, source, clickedPosition)
packet.sendToServer()
playSound(CobblemonSounds.PC_DROP)
movePending = true
}
else -> Unit
}
return
}
// Reset release confirmation // Reset release confirmation
displayConfirmRelease = false displayConfirmRelease = false
// Clicking on itself, so unselect position // Clicking on itself, so unselect position
if (this.selectedPosition != null && this.selectedPosition == clickedPosition) { if (selectedPosition == clickedPosition) {
if (grabbedSlot != null) playSound(CobblemonSounds.PC_DROP) if (grabbedSlot != null) playSound(CobblemonSounds.PC_DROP)
resetSelected() resetSelected()
return return
} }
// Check for selecting a Pokémon // Check for selecting a Pokémon
val clickedPokemon = when(button) {
is BoxStorageSlot -> pc.get(clickedPosition as PCPosition)
is PartyStorageSlot -> party.get(clickedPosition as PartyPosition)
else -> null
}
val selectOverride = pcGui.configuration.selectOverride val selectOverride = pcGui.configuration.selectOverride
if (selectOverride != null) { if (selectOverride != null) {
selectOverride(pcGui, clickedPosition, clickedPokemon) selectOverride(pcGui, clickedPosition, clickedPokemon)
@@ -420,59 +593,47 @@ class StorageWidget(
} }
} }
this.selectedPosition = clickedPosition if (clickedPosition is PCPosition) {
this.pcGui.setPreviewPokemon(clickedPokemon, pcGui.isPreviewInParty ?: false) val column = clickedPosition.slot % 6
grabbedSlot = GrabbedStorageSlot( val row = clickedPosition.slot / 6
x = button.x, multiSelection = PCMultiSelection(1, 1, clickedPosition.box, column, row).also {
y = button.y, it.setPokemon(0, 0, clickedPokemon)
parent = this, }
pokemon = clickedPokemon playSound(CobblemonSounds.PC_GRAB)
) return
playSound(CobblemonSounds.PC_GRAB) } else if (clickedPosition is PartyPosition) {
this.selectedPosition = clickedPosition
this.pcGui.setPreviewPokemon(clickedPokemon, pcGui.isPreviewInParty ?: false)
grabbedSlot = GrabbedStorageSlot(
x = button.x,
y = button.y,
parent = this,
pokemon = clickedPokemon
)
playSound(CobblemonSounds.PC_GRAB)
}
} }
} else { } else {
// Handle movement within the Box val sourcePosition = selectedPosition ?: return
val selectedPokemon = when(this.selectedPosition) { val selectedPokemon = party.get(sourcePosition) ?: return
is PCPosition -> pc.get(this.selectedPosition as PCPosition)
is PartyPosition -> party.get(this.selectedPosition as PartyPosition)
else -> null
} ?: return
// Box to Box
if (this.selectedPosition is PCPosition && clickedPosition is PCPosition) {
val packet = clickedPokemon?.let { SwapPCPokemonPacket(it.uuid, clickedPosition, selectedPokemon.uuid, this.selectedPosition as PCPosition) }
?: MovePCPokemonPacket(selectedPokemon.uuid, selectedPosition as PCPosition, clickedPosition)
packet.sendToServer()
playSound(CobblemonSounds.PC_DROP)
resetSelected()
}
// Box to Party
else if (this.selectedPosition is PCPosition && clickedPosition is PartyPosition) {
val packet = clickedPokemon?.let { SwapPCPartyPokemonPacket(clickedPokemon.uuid, clickedPosition, selectedPokemon.uuid, this.selectedPosition as PCPosition) }
?: MovePCPokemonToPartyPacket(selectedPokemon.uuid, this.selectedPosition as PCPosition, clickedPosition)
packet.sendToServer()
playSound(CobblemonSounds.PC_DROP)
resetSelected()
}
// Party to Box // Party to Box
else if (this.selectedPosition is PartyPosition && clickedPosition is PCPosition) { if (clickedPosition is PCPosition) {
if (ServerSettings.preventCompletePartyDeposit && this.party.filterNotNull().size == 1 && clickedPokemon == null) { if (ServerSettings.preventCompletePartyDeposit && this.party.filterNotNull().size == 1 && clickedPokemon == null) {
return return
} }
val packet = clickedPokemon?.let { SwapPCPartyPokemonPacket(selectedPokemon.uuid, this.selectedPosition as PartyPosition, clickedPokemon.uuid, clickedPosition) } val packet = clickedPokemon?.let { SwapPCPartyPokemonPacket(selectedPokemon.uuid, sourcePosition, clickedPokemon.uuid, clickedPosition) }
?: MovePartyPokemonToPCPacket(selectedPokemon.uuid, this.selectedPosition as PartyPosition, clickedPosition) ?: MovePartyPokemonToPCPacket(selectedPokemon.uuid, sourcePosition, clickedPosition)
packet.sendToServer() packet.sendToServer()
playSound(CobblemonSounds.PC_DROP) playSound(CobblemonSounds.PC_DROP)
resetSelected() movePending = true
} }
// Party to Party // Party to Party
else if (this.selectedPosition is PartyPosition && clickedPosition is PartyPosition) { else if (clickedPosition is PartyPosition) {
val packet = clickedPokemon?.let { SwapPartyPokemonPacket(it.uuid, clickedPosition, selectedPokemon.uuid, this.selectedPosition as PartyPosition) } val packet = clickedPokemon?.let { SwapPartyPokemonPacket(it.uuid, clickedPosition, selectedPokemon.uuid, sourcePosition) }
?: MovePartyPokemonPacket(selectedPokemon.uuid, selectedPosition as PartyPosition, clickedPosition) ?: MovePartyPokemonPacket(selectedPokemon.uuid, sourcePosition, clickedPosition)
packet.sendToServer() packet.sendToServer()
playSound(CobblemonSounds.PC_DROP) playSound(CobblemonSounds.PC_DROP)
resetSelected() movePending = true
} }
} }
} }
@@ -480,6 +641,36 @@ class StorageWidget(
fun resetSelected() { fun resetSelected() {
selectedPosition = null selectedPosition = null
grabbedSlot = null grabbedSlot = null
multiSelection = null
multiGrabbedSlots.clear()
pcGui.setPreviewPokemon(null) pcGui.setPreviewPokemon(null)
} }
// annoyingly complex solution, but server/client desync causes flashing when moving pokemon. this should fix it
// if you can think of a simpler solution, feel free to implement it
private fun updatePendingMove() {
if (!movePending) return
val selection = multiSelection
if (selection != null) {
val updated = selection.pokemonEntries().any { (column, row, pokemon) ->
val source = PCPosition(selection.sourceBox, (selection.sourceRow + row) * 6 + selection.sourceColumn + column)
pc.get(source)?.uuid != pokemon.uuid
}
if (updated) {
movePending = false
resetSelected()
}
return
}
val source = selectedPosition
val pokemon = grabbedSlot?.getPokemon()
if (source != null && pokemon != null) {
if (party.get(source)?.uuid != pokemon.uuid) {
movePending = false
resetSelected()
}
}
}
} }
@@ -47,6 +47,10 @@ class CobblemonConfig {
@IntConstraint(min = 0, max = 1000) @IntConstraint(min = 0, max = 1000)
var maxPokemonFriendship = 255 var maxPokemonFriendship = 255
@CobblemonConfigField(Category.Pokemon, lang = "power_item_ride_stat_gain_interval_seconds", SERVER)
@IntConstraint(min = -1, max = Int.MAX_VALUE)
var powerItemRideStatGainIntervalSeconds = 120
@CobblemonConfigField(Category.Pokemon, lang = "announce_drop_items", SERVER) @CobblemonConfigField(Category.Pokemon, lang = "announce_drop_items", SERVER)
var announceDropItems = true var announceDropItems = true
@CobblemonConfigField(Category.Pokemon, lang = "default_drop_item_method", SERVER) @CobblemonConfigField(Category.Pokemon, lang = "default_drop_item_method", SERVER)
@@ -22,6 +22,7 @@ import com.cobblemon.mod.common.api.molang.ObjectValue
import com.cobblemon.mod.common.api.pokemon.PokemonProperties import com.cobblemon.mod.common.api.pokemon.PokemonProperties
import com.cobblemon.mod.common.api.pokemon.feature.TickingSpeciesFeature import com.cobblemon.mod.common.api.pokemon.feature.TickingSpeciesFeature
import com.cobblemon.mod.common.api.pokemon.status.Statuses import com.cobblemon.mod.common.api.pokemon.status.Statuses
import com.cobblemon.mod.common.api.riding.stats.RidingStat
import com.cobblemon.mod.common.api.spawning.fishing.FishingSpawnCause.Companion.DROPS_REROLL_ASPECT import com.cobblemon.mod.common.api.spawning.fishing.FishingSpawnCause.Companion.DROPS_REROLL_ASPECT
import com.cobblemon.mod.common.api.tags.CobblemonItemTags import com.cobblemon.mod.common.api.tags.CobblemonItemTags
import com.cobblemon.mod.common.battles.BattleRegistry import com.cobblemon.mod.common.battles.BattleRegistry
@@ -46,10 +47,15 @@ import kotlin.math.*
/** Handles purely server logic for a Pokémon */ /** Handles purely server logic for a Pokémon */
class PokemonServerDelegate : PokemonSideDelegate { class PokemonServerDelegate : PokemonSideDelegate {
companion object {
private const val RIDE_STAT_GAIN_AMOUNT = 1F
}
lateinit var entity: PokemonEntity lateinit var entity: PokemonEntity
var acknowledgedHPValue = -1 var acknowledgedHPValue = -1
var acknowledgedLevel = -1 var acknowledgedLevel = -1
val passengerOffsets = mutableMapOf<Int, Vec3>() val passengerOffsets = mutableMapOf<Int, Vec3>()
private var rideStatGainAnchor: Vec3? = null
/** Mocked properties exposed to the client [PokemonEntity]. */ /** Mocked properties exposed to the client [PokemonEntity]. */
private val mock: PokemonProperties? private val mock: PokemonProperties?
@@ -355,9 +361,30 @@ class PokemonServerDelegate : PokemonSideDelegate {
} }
} }
val rideStatGainIntervalSeconds = Cobblemon.config.powerItemRideStatGainIntervalSeconds
if (rideStatGainIntervalSeconds > 0) {
val rideStatGainIntervalTicks = rideStatGainIntervalSeconds * 20L
if (entity.level().gameTime % rideStatGainIntervalTicks == 0L) {
trainRideStats()
}
}
updateTrackedValues() updateTrackedValues()
} }
private fun trainRideStats() {
val position = entity.position()
val anchor = rideStatGainAnchor
rideStatGainAnchor = position
if (anchor == null || anchor == position || entity.passengers.isEmpty()) return
val heldItem = entity.pokemon.heldItemNoCopy()
if (heldItem.isEmpty) return
val stat = RidingStat.entries.firstOrNull { heldItem.`is`(it.powerItem) } ?: return
entity.pokemon.addRideBoost(stat, RIDE_STAT_GAIN_AMOUNT)
}
fun updateShownItem() { fun updateShownItem() {
val trackedShownItem = when { val trackedShownItem = when {
// Show Hand Item if Held item is hidden // Show Hand Item if Held item is hidden
@@ -0,0 +1,55 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://www.mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.net.messages.server.storage.pc
import com.cobblemon.mod.common.api.net.NetworkPacket
import com.cobblemon.mod.common.api.storage.pc.PCPosition
import com.cobblemon.mod.common.util.cobblemonResource
import com.cobblemon.mod.common.util.readPCPosition
import com.cobblemon.mod.common.util.writePCPosition
import java.util.UUID
import net.minecraft.network.RegistryFriendlyByteBuf
class MovePCPokemonBatchPacket(val moves: List<PCPokemonMove>) : NetworkPacket<MovePCPokemonBatchPacket> {
override val id = ID
data class PCPokemonMove(
val pokemonID: UUID,
val oldPosition: PCPosition,
val newPosition: PCPosition
)
override fun encode(buffer: RegistryFriendlyByteBuf) {
buffer.writeVarInt(moves.size)
moves.forEach { move ->
buffer.writeUUID(move.pokemonID)
buffer.writePCPosition(move.oldPosition)
buffer.writePCPosition(move.newPosition)
}
}
companion object {
val ID = cobblemonResource("move_pc_pokemon_batch")
const val MAX_MOVES = 60
fun decode(buffer: RegistryFriendlyByteBuf): MovePCPokemonBatchPacket {
val size = buffer.readVarInt()
require(size in 1..MAX_MOVES) { "Invalid batch PC move size: $size" }
return MovePCPokemonBatchPacket(
List(size) {
PCPokemonMove(
pokemonID = buffer.readUUID(),
oldPosition = buffer.readPCPosition(),
newPosition = buffer.readPCPosition()
)
}
)
}
}
}
@@ -0,0 +1,23 @@
/*
* Copyright (C) 2023 Cobblemon Contributors
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://www.mozilla.org/MPL/2.0/.
*/
package com.cobblemon.mod.common.net.serverhandling.storage.pc
import com.cobblemon.mod.common.api.net.ServerNetworkPacketHandler
import com.cobblemon.mod.common.api.storage.pc.link.PCLinkManager
import com.cobblemon.mod.common.net.messages.client.storage.pc.ClosePCPacket
import com.cobblemon.mod.common.net.messages.server.storage.pc.MovePCPokemonBatchPacket
import net.minecraft.server.MinecraftServer
import net.minecraft.server.level.ServerPlayer
object MovePCPokemonBatchHandler : ServerNetworkPacketHandler<MovePCPokemonBatchPacket> {
override fun handle(packet: MovePCPokemonBatchPacket, server: MinecraftServer, player: ServerPlayer) {
val pc = PCLinkManager.getPC(player) ?: return run { ClosePCPacket(null).sendToPlayer(player) }
pc.moveBatch(packet.moves.map { Triple(it.pokemonID, it.oldPosition, it.newPosition) })
}
}
@@ -456,6 +456,12 @@
"cannon_left": { "cannon_left": {
"position": [0, 0, 3] "position": [0, 0, 3]
} }
},
"timeline": {
"0.25": "q.run_molang('cobblemon:stepsound_standard_large');",
"1.25": "q.run_molang('cobblemon:stepsound_standard_large');",
"2.25": "q.run_molang('cobblemon:stepsound_standard_large');",
"3.25": "q.run_molang('cobblemon:stepsound_standard_large');"
} }
}, },
"animation.blastoise.ground_run": { "animation.blastoise.ground_run": {
@@ -83,6 +83,7 @@
}, },
"animation.parasect.ground_walk": { "animation.parasect.ground_walk": {
"loop": true, "loop": true,
"animation_length": 1,
"bones": { "bones": {
"body": { "body": {
"rotation": [0, 0, 0], "rotation": [0, 0, 0],
@@ -134,6 +135,12 @@
"locator_seat_1": { "locator_seat_1": {
"rotation": [7.5, 0, 0] "rotation": [7.5, 0, 0]
} }
},
"timeline": {
"0.0": "q.run_molang('cobblemon:stepsound_minecraft');",
"0.25": "q.run_molang('cobblemon:stepsound_minecraft');",
"0.5": "q.run_molang('cobblemon:stepsound_minecraft');",
"0.75": "q.run_molang('cobblemon:stepsound_minecraft');"
} }
}, },
"animation.parasect.ground_run": { "animation.parasect.ground_run": {
@@ -258,6 +265,10 @@
"rotation": ["5+Math.cos((query.anim_time) * 90 * 16 - 90) * 2", 0, 0], "rotation": ["5+Math.cos((query.anim_time) * 90 * 16 - 90) * 2", 0, 0],
"position": [0, "0+Math.cos((query.anim_time) * 90 * 32) * -0.2", -0.25] "position": [0, "0+Math.cos((query.anim_time) * 90 * 32) * -0.2", -0.25]
} }
},
"timeline": {
"0.0": "q.run_molang('cobblemon:stepsound_minecraft');",
"0.125": "q.run_molang('cobblemon:stepsound_minecraft');"
} }
}, },
"animation.parasect.ride_ground_run": { "animation.parasect.ride_ground_run": {
@@ -391,6 +391,10 @@
"0.7083": [0, 0, 0] "0.7083": [0, 0, 0]
} }
} }
},
"timeline": {
"0.0833": "q.run_molang('cobblemon:stepsound_standard_medium');",
"0.2917": "q.run_molang('cobblemon:stepsound_standard_medium');"
} }
}, },
"animation.dewgong.water_idle": { "animation.dewgong.water_idle": {
@@ -1071,6 +1071,16 @@
"head": { "head": {
"rotation": ["-0.8*math.cos(q.anim_time*90*8-120)", 0, "3*math.sin(q.anim_time*90*4+70)"] "rotation": ["-0.8*math.cos(q.anim_time*90*8-120)", 0, "3*math.sin(q.anim_time*90*4+70)"]
} }
},
"timeline": {
"0.0": "q.run_molang('cobblemon:stepsound_standard_large');",
"0.5": "q.run_molang('cobblemon:stepsound_standard_large');",
"1.0": "q.run_molang('cobblemon:stepsound_standard_large');",
"1.5": "q.run_molang('cobblemon:stepsound_standard_large');",
"2.0": "q.run_molang('cobblemon:stepsound_standard_large');",
"2.5": "q.run_molang('cobblemon:stepsound_standard_large');",
"3.0": "q.run_molang('cobblemon:stepsound_standard_large');",
"3.5": "q.run_molang('cobblemon:stepsound_standard_large');"
} }
}, },
"animation.rhyhorn.ride_ground_walk": { "animation.rhyhorn.ride_ground_walk": {
@@ -1917,6 +1927,16 @@
], ],
"position": [0, "0.4+0.6*math.cos(q.anim_time*90*8-120)", 0] "position": [0, "0.4+0.6*math.cos(q.anim_time*90*8-120)", 0]
} }
},
"timeline": {
"0.0": "q.run_molang('cobblemon:stepsound_standard_large');",
"0.375": "q.run_molang('cobblemon:stepsound_standard_medium');",
"0.5": "q.run_molang('cobblemon:stepsound_standard_large');",
"0.875": "q.run_molang('cobblemon:stepsound_standard_medium');",
"1.0": "q.run_molang('cobblemon:stepsound_standard_large');",
"1.375": "q.run_molang('cobblemon:stepsound_standard_medium');",
"1.5": "q.run_molang('cobblemon:stepsound_standard_large');",
"1.875": "q.run_molang('cobblemon:stepsound_standard_medium');"
} }
}, },
"animation.rhyhorn.ride_ground_run": { "animation.rhyhorn.ride_ground_run": {
@@ -329,6 +329,12 @@
"locator_seat_1": { "locator_seat_1": {
"rotation": [-15, 0, 0] "rotation": [-15, 0, 0]
} }
},
"timeline": {
"0.0": "q.run_molang('cobblemon:stepsound_standard_large');",
"1.0": "q.run_molang('cobblemon:stepsound_standard_large');",
"2.0": "q.run_molang('cobblemon:stepsound_standard_large');",
"3.0": "q.run_molang('cobblemon:stepsound_standard_large');"
} }
}, },
"animation.rhydon.ride_ground_walk": { "animation.rhydon.ride_ground_walk": {
@@ -807,6 +813,12 @@
"locator_seat_1": { "locator_seat_1": {
"rotation": [-15, 0, 0] "rotation": [-15, 0, 0]
} }
},
"timeline": {
"0.3333": "q.run_molang('cobblemon:stepsound_standard_large');",
"0.8333": "q.run_molang('cobblemon:stepsound_standard_large');",
"1.3333": "q.run_molang('cobblemon:stepsound_standard_large');",
"1.8333": "q.run_molang('cobblemon:stepsound_standard_large');"
} }
}, },
"animation.rhydon.ride_ground_run": { "animation.rhydon.ride_ground_run": {
@@ -391,6 +391,10 @@
"1.0": [0, 0, 0] "1.0": [0, 0, 0]
} }
} }
},
"timeline": {
"0.0833": "q.run_molang('cobblemon:stepsound_minecraft');",
"0.5833": "q.run_molang('cobblemon:stepsound_minecraft');"
} }
}, },
"animation.mr_mime.ground_run": { "animation.mr_mime.ground_run": {
@@ -1299,6 +1299,7 @@
"cobblemon.ui.pc.filter.tooltip": "Format: pikachu shiny held_item lvl=1...", "cobblemon.ui.pc.filter.tooltip": "Format: pikachu shiny held_item lvl=1...",
"cobblemon.ui.pc.options": "Options", "cobblemon.ui.pc.options": "Options",
"cobblemon.ui.pc.release": "Release", "cobblemon.ui.pc.release": "Release",
"cobblemon.ui.pc.release_all": "Release All",
"cobblemon.ui.sort.name": "Sort by name", "cobblemon.ui.sort.name": "Sort by name",
"cobblemon.ui.sort.level": "Sort by level", "cobblemon.ui.sort.level": "Sort by level",
"cobblemon.ui.sort.pokedex_number": "Sort by Pokédex number", "cobblemon.ui.sort.pokedex_number": "Sort by Pokédex number",
@@ -2434,6 +2435,8 @@
"cobblemon.config.ui.max_pokemon_level.tooltip": "The maximum level Pokémon can get to.", "cobblemon.config.ui.max_pokemon_level.tooltip": "The maximum level Pokémon can get to.",
"cobblemon.config.ui.max_pokemon_friendship": "Max Pokémon Friendship", "cobblemon.config.ui.max_pokemon_friendship": "Max Pokémon Friendship",
"cobblemon.config.ui.max_pokemon_friendship.tooltip": "The maximum friendship value.", "cobblemon.config.ui.max_pokemon_friendship.tooltip": "The maximum friendship value.",
"cobblemon.config.ui.power_item_ride_stat_gain_interval_seconds": "Power Item Riding Stat Training Interval (Seconds)",
"cobblemon.config.ui.power_item_ride_stat_gain_interval_seconds.tooltip": "Seconds between riding stat gains while riding a Pokémon holding a Power item. Defaults to 120 seconds. Set to -1 or 0 to disable; values below -1 are clamped to -1.",
"cobblemon.config.ui.announce_drop_items": "Announce Drop Items", "cobblemon.config.ui.announce_drop_items": "Announce Drop Items",
"cobblemon.config.ui.announce_drop_items.tooltip": "Whether to notify the Player of dropped items from defeating wild Pokémon.", "cobblemon.config.ui.announce_drop_items.tooltip": "Whether to notify the Player of dropped items from defeating wild Pokémon.",
"cobblemon.config.ui.default_drop_item_method": "Default Drop Item Method", "cobblemon.config.ui.default_drop_item_method": "Default Drop Item Method",
@@ -1653,6 +1653,18 @@
"move.horndrill.target_2": { "move.horndrill.target_2": {
"sounds": [ { "name": "cobblemon:move/horndrill/horndrill_target_2", "volume": 1.0 } ] "sounds": [ { "name": "cobblemon:move/horndrill/horndrill_target_2", "volume": 1.0 } ]
}, },
"move.gigatonhammer.actor": {
"sounds": [ { "name": "cobblemon:move/gigatonhammer/gigatonhammer_actor", "volume": 1.0 } ]
},
"move.gigatonhammer.target": {
"sounds": [ { "name": "cobblemon:move/gigatonhammer/gigatonhammer_target", "volume": 1.0 } ]
},
"move.pyroball.actor": {
"sounds": [ { "name": "cobblemon:move/pyroball/pyroball_actor", "volume": 1.0 } ]
},
"move.pyroball.target": {
"sounds": [ { "name": "cobblemon:move/pyroball/pyroball_target", "volume": 1.0 } ]
},
"impact.normal": { "impact.normal": {
"sounds": [ "sounds": [
{ "name": "cobblemon:move/impact_generic/impact_generic_fighting_1", "volume": 0.8 }, { "name": "cobblemon:move/impact_generic/impact_generic_fighting_1", "volume": 0.8 },
@@ -8672,6 +8684,9 @@
"pokemon.cinderace.cry": { "pokemon.cinderace.cry": {
"sounds": [ { "name": "cobblemon:pokemon/cinderace/cinderace_cry", "volume": 0.8 } ] "sounds": [ { "name": "cobblemon:pokemon/cinderace/cinderace_cry", "volume": 0.8 } ]
}, },
"pokemon.cinderace.pyroball": {
"sounds": [ { "name": "cobblemon:pokemon/cinderace/cinderace_pyroball", "volume": 0.5 } ]
},
"pokemon.sobble.cry": { "pokemon.sobble.cry": {
"sounds": [ { "name": "cobblemon:pokemon/sobble/sobble_cry", "volume": 0.8 } ] "sounds": [ { "name": "cobblemon:pokemon/sobble/sobble_cry", "volume": 0.8 } ]
}, },
Binary file not shown.

After

Width:  |  Height:  |  Size: 548 B

@@ -0,0 +1,35 @@
{
"timeline": [
{
"type": "add_holds",
"holds": ["effects"]
},
{
"type": "animation",
"animation": ["gigatonhammer"],
"delay": 0.3
},
{
"type": "entity_molang",
"entityCondition": "q.entity.is_user == true",
"expressions": ["q.sound('move.gigatonhammer.actor');"]
},
{
"type": "pause",
"pause": 1.1
},
{
"type": "entity_molang",
"entityCondition": "q.entity.is_user == false && q.missed(q.entity.uuid) == false",
"expressions": ["q.sound('move.gigatonhammer.target');"]
},
{
"type": "remove_holds",
"holds": ["effects"]
},
{
"type": "pause",
"pause": 1.5
}
]
}
@@ -3,11 +3,38 @@
{ {
"type": "add_holds", "type": "add_holds",
"holds": ["effects"] "holds": ["effects"]
}, },
{ {
"type": "animation", "type": "animation",
"animation": ["pyroball"], "animation": ["pyroball"]
"delay": 2.05 },
{
"type": "pause",
"pause" : 0.1
},
{
"type": "entity_molang",
"entityCondition": "q.entity.is_user == true",
"expressions": ["q.sound('move.pyroball.actor');"]
},
{
"type": "entity_molang",
"entityCondition": "q.entity.is_user == true",
"expressions": ["q.sound('pokemon.cinderace.pyroball');"]
},
{
"type": "pause",
"pause" : 1.875
},
{
"type": "entity_molang",
"entityCondition": "q.entity.is_user == false && q.missed(q.entity.uuid) == false",
"expressions": ["q.sound('move.pyroball.target');"]
},
{
"type": "pause",
"pause" : 0.175
}, },
{ {
"type": "entity_particles", "type": "entity_particles",
@@ -14,7 +14,7 @@
} }
], ],
"type": "cobblemon:cooking_pot_shapeless", "type": "cobblemon:cooking_pot_shapeless",
"category": "medicines", "category": "misc",
"ingredients": [ "ingredients": [
{ {
"item": "create:experience_nugget" "item": "create:experience_nugget"
@@ -6,6 +6,7 @@
"maleRatio": 0.875, "maleRatio": 0.875,
"height": 16, "height": 16,
"weight": 855, "weight": 855,
"silenceStepSounds": true,
"pokedex": [ "pokedex": [
"cobblemon.species.blastoise.desc" "cobblemon.species.blastoise.desc"
], ],
@@ -7,6 +7,7 @@
"maleRatio": 0.5, "maleRatio": 0.5,
"height": 17, "height": 17,
"weight": 1200, "weight": 1200,
"silenceStepSounds": true,
"pokedex": [ "pokedex": [
"cobblemon.species.dewgong.desc" "cobblemon.species.dewgong.desc"
], ],
@@ -7,6 +7,7 @@
"maleRatio": 0.5, "maleRatio": 0.5,
"height": 13, "height": 13,
"weight": 545, "weight": 545,
"silenceStepSounds": true,
"pokedex": [ "pokedex": [
"cobblemon.species.mrmime.desc" "cobblemon.species.mrmime.desc"
], ],
@@ -7,6 +7,7 @@
"maleRatio": 0.5, "maleRatio": 0.5,
"height": 10, "height": 10,
"weight": 295, "weight": 295,
"silenceStepSounds": true,
"pokedex": [ "pokedex": [
"cobblemon.species.parasect.desc" "cobblemon.species.parasect.desc"
], ],
@@ -7,6 +7,7 @@
"maleRatio": 0.5, "maleRatio": 0.5,
"height": 19, "height": 19,
"weight": 1200, "weight": 1200,
"silenceStepSounds": true,
"pokedex": [ "pokedex": [
"cobblemon.species.rhydon.desc" "cobblemon.species.rhydon.desc"
], ],
@@ -7,6 +7,7 @@
"maleRatio": 0.5, "maleRatio": 0.5,
"height": 10, "height": 10,
"weight": 1150, "weight": 1150,
"silenceStepSounds": true,
"pokedex": [ "pokedex": [
"cobblemon.species.rhyhorn.desc" "cobblemon.species.rhyhorn.desc"
], ],
@@ -7,6 +7,7 @@
"maleRatio": 0.875, "maleRatio": 0.875,
"height": 20, "height": 20,
"weight": 1000, "weight": 1000,
"silenceStepSounds": true,
"pokedex": [ "pokedex": [
"cobblemon.species.venusaur.desc" "cobblemon.species.venusaur.desc"
], ],
@@ -548,7 +548,7 @@
"battleOnly": false "battleOnly": false
}, },
{ {
"name": "!", "name": "Exclamation",
"primaryType": "psychic", "primaryType": "psychic",
"maleRatio": -1, "maleRatio": -1,
"height": 5, "height": 5,
@@ -563,7 +563,7 @@
"battleOnly": false "battleOnly": false
}, },
{ {
"name": "?", "name": "Question",
"primaryType": "psychic", "primaryType": "psychic",
"maleRatio": -1, "maleRatio": -1,
"height": 5, "height": 5,
@@ -6,6 +6,7 @@
"cobblemon:tart_apple", "cobblemon:tart_apple",
"cobblemon:syrupy_apple", "cobblemon:syrupy_apple",
"cobblemon:candied_apple", "cobblemon:candied_apple",
{ "id": "create:honeyed_apple","required": false } { "id": "create:honeyed_apple","required": false },
{ "id": "nomansland:honeyed_apple","required": false }
] ]
} }
Binary file not shown.
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>local.com.bedrockk</groupId>
<artifactId>molang</artifactId>
<version>1.1.12</version>
</project>
Binary file not shown.
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>local.com.bedrockk</groupId>
<artifactId>molang</artifactId>
<version>1.1.13</version>
</project>
Binary file not shown.
Binary file not shown.
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>local.com.bedrockk</groupId>
<artifactId>molang</artifactId>
<version>1.1.15</version>
</project>
Binary file not shown.
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>local.com.bedrockk</groupId>
<artifactId>molang</artifactId>
<version>1.1.16</version>
</project>
Binary file not shown.
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>local.com.bedrockk</groupId>
<artifactId>molang</artifactId>
<version>1.1.18</version>
</project>
Binary file not shown.
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>local.com.bedrockk</groupId>
<artifactId>molang</artifactId>
<version>1.1.19</version>
</project>
Binary file not shown.
@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>local.com.bedrockk</groupId>
<artifactId>molang</artifactId>
<version>1.1.20</version>
</project>
Binary file not shown.
@@ -4,5 +4,5 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>local.com.bedrockk</groupId> <groupId>local.com.bedrockk</groupId>
<artifactId>molang</artifactId> <artifactId>molang</artifactId>
<version>1.1.14</version> <version>1.1.21</version>
</project> </project>
+3 -3
View File
@@ -3,10 +3,10 @@
<groupId>local.com.bedrockk</groupId> <groupId>local.com.bedrockk</groupId>
<artifactId>molang</artifactId> <artifactId>molang</artifactId>
<versioning> <versioning>
<release>1.1.20</release> <release>1.1.21</release>
<versions> <versions>
<version>1.1.20</version> <version>1.1.21</version>
</versions> </versions>
<lastUpdated>20231949390007</lastUpdated> <lastUpdated>20231949390008</lastUpdated>
</versioning> </versioning>
</metadata> </metadata>
+1 -1
View File
@@ -14,7 +14,7 @@ architectury-plugin = "3.4-SNAPSHOT"
moddev = "1.0.11" moddev = "1.0.11"
# Common # Common
molang = "1.1.20" molang = "1.1.21"
jei-api = "19.22.1.316" jei-api = "19.22.1.316"
appleskin-api = "mc1.21-3.0.5" appleskin-api = "mc1.21-3.0.5"