mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-10 10:20:41 -07:00
Merge branch 'fix-blastcoal-saves' into 'master'
Fix player saves for players who used coal on the conveyer belt before bf-fixes. See merge request 2009scape/2009scape!380
This commit is contained in:
commit
fb4296debd
2 changed files with 11 additions and 2 deletions
|
|
@ -98,3 +98,4 @@
|
|||
- Can now travel on free charter boats without having money in inventory
|
||||
- Emerald and diamond bracelet enchants no longer produce noted items
|
||||
- Prevent furnace temperature from going negative and deduplicate bar handling.
|
||||
- Fix player saves for players who used coal on the conveyer belt before bf-fixes.
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ import rs09.game.system.SystemLogger
|
|||
import rs09.game.world.World
|
||||
import java.io.FileReader
|
||||
import java.util.*
|
||||
import core.game.node.item.Item;
|
||||
import org.rs09.consts.Items;
|
||||
|
||||
/**
|
||||
* Class used for parsing JSON player saves.
|
||||
|
|
@ -379,6 +381,7 @@ class PlayerSaveParser(val player: Player) {
|
|||
bBars?.let{player.blastBars.parse(it)}
|
||||
bOre?.let{player.blastOre.parse(bOre)}
|
||||
bCoal?.let{player.blastCoal.parse(bCoal)}
|
||||
migrateBlastCoal()
|
||||
player.location = rs09.JSONUtils.parseLocation(location)
|
||||
}
|
||||
|
||||
|
|
@ -409,5 +412,10 @@ class PlayerSaveParser(val player: Player) {
|
|||
player.settings.parse(settingsData)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
fun migrateBlastCoal() {
|
||||
val amount = player.blastOre.getAmount(Items.COAL_453)
|
||||
if(amount > 0 && player.blastOre.remove(Item(Items.COAL_453, amount))) {
|
||||
player.blastCoal.add(Item(Items.COAL_453, amount))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue