Fix player saves for players who used coal on the conveyer belt before bf-fixes.
This commit is contained in:
@@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user