Compare commits

...
4 changed files with 9 additions and 1 deletions
+2
View File
@@ -19,10 +19,12 @@
- Fix occasional crash on retrieving revived fossils
- Fixed a compatibility issue with World Game Rules which caused some log spam in specific cases.
- Fixed improper validation of Pokémon when performing a trade.
- Fixed kicking players from world when a Pokémon learns multiple moves at once.
### Developer
### Molang & Datapacks
### Localization
- Updated translations for:
@@ -145,6 +145,7 @@ import net.minecraft.world.entity.item.ItemEntity
import net.minecraft.world.entity.monster.Monster
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.enchantment.EnchantmentHelper
import net.minecraft.world.level.ClipContext
import net.minecraft.world.level.GameType
import net.minecraft.world.level.Level
@@ -42,6 +42,10 @@ class BenchedMoves : Iterable<BenchedMove> {
update()
}
fun clone(): BenchedMoves {
return BenchedMoves().loadFromNBT(saveToNBT(ListTag()))
}
fun doThenEmit(action: () -> Unit) {
doWithoutEmitting(action)
update()
@@ -13,7 +13,8 @@ import com.cobblemon.mod.common.pokemon.Pokemon
import com.cobblemon.mod.common.util.cobblemonResource
import net.minecraft.network.RegistryFriendlyByteBuf
class BenchedMovesUpdatePacket(pokemon: () -> Pokemon?, value: BenchedMoves): SingleUpdatePacket<BenchedMoves, BenchedMovesUpdatePacket>(pokemon, value) {
class BenchedMovesUpdatePacket(pokemon: () -> Pokemon?, value: BenchedMoves):
SingleUpdatePacket<BenchedMoves, BenchedMovesUpdatePacket>(pokemon, value.clone()) {
override val id = ID
override fun encodeValue(buffer: RegistryFriendlyByteBuf) {
this.value.saveToBuffer(buffer)