Fix anvil inventory sometimes not updating & version up

This commit is contained in:
alexcrea 2024-04-08 17:46:20 +02:00
parent 33c90e1541
commit 57cd58657d
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
4 changed files with 10 additions and 3 deletions

View file

@ -53,4 +53,4 @@ Default configuration can be found on following links:
- [unit_repair_item.yml](https://github.com/alexcrea/CustomAnvil/blob/master/src/main/resources/unit_repair_item.yml)
---
### Know issue:
- On anvil recipe that do not exist in vanilla, trying to rename an item may make the result item disappear.
There is non known issue, if you find one please report the issue.

View file

@ -4,7 +4,7 @@ plugins {
}
group = "xyz.alexcrea"
version = "1.4.0a"
version = "1.4.1a"
repositories {
mavenCentral()

View file

@ -276,6 +276,8 @@ class AnvilEventListener : Listener {
event.view.setProperty(REPAIR_COST, newXp)
inventory.setItem(ANVIL_OUTPUT_SLOT, resultItem)
player.updateInventory()
}
}
@ -536,6 +538,11 @@ class AnvilEventListener : Listener {
inventory.repairCost = finalAnvilCost
event.view.setProperty(REPAIR_COST, finalAnvilCost)
val player = event.view.player
if(player is Player){
player.updateInventory()
}
})
}

View file

@ -1,7 +1,7 @@
main: io.delilaheve.CustomAnvil
name: CustomAnvil
prefix: "Custom Anvil"
version: 1.4.0a
version: 1.4.1a
description: Allow to customise anvil mechanics
api-version: 1.18
load: POSTWORLD