From 3ebd9c26149dcba70ada7bf7f0eef8b68bb5864b Mon Sep 17 00:00:00 2001 From: Ceikry Date: Mon, 15 Mar 2021 17:26:39 -0500 Subject: [PATCH] Separated normal remove_head and hat keys/flags --- Server/data/configs/item_configs.json | 26 +++++++++---------- .../player/link/appearance/Appearance.java | 5 +++- .../game/system/config/ItemConfigParser.kt | 7 +++-- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Server/data/configs/item_configs.json b/Server/data/configs/item_configs.json index bbc2dea02..ca9a3a5fb 100644 --- a/Server/data/configs/item_configs.json +++ b/Server/data/configs/item_configs.json @@ -28531,7 +28531,7 @@ "ge_buy_limit": "2", "archery_ticket_price": "0", "durability": null, - "remove_head": true + "hat": true }, { "id": "2634", @@ -28555,7 +28555,7 @@ "ge_buy_limit": "2", "archery_ticket_price": "0", "durability": null, - "remove_head": true + "hat": true }, { "id": "2636", @@ -28579,7 +28579,7 @@ "ge_buy_limit": "2", "archery_ticket_price": "0", "durability": null, - "remove_head": true + "hat": true }, { "id": "2638", @@ -28603,7 +28603,7 @@ "ge_buy_limit": "2", "archery_ticket_price": "0", "durability": null, - "remove_head": true + "hat": true }, { "id": "2640", @@ -28627,7 +28627,7 @@ "ge_buy_limit": "2", "archery_ticket_price": "0", "durability": null, - "remove_head": true + "hat": true }, { "id": "2642", @@ -28651,7 +28651,7 @@ "ge_buy_limit": "2", "archery_ticket_price": "0", "durability": null, - "remove_head": true + "hat": true }, { "id": "2644", @@ -61923,7 +61923,7 @@ "ge_buy_limit": "100", "archery_ticket_price": "0", "durability": null, - "remove_head": true + "hat": true }, { "id": "6383", @@ -97042,7 +97042,7 @@ "equipment_slot": "0", "archery_ticket_price": "0", "durability": null, - "remove_head": true + "hat": true }, { "id": "10694", @@ -97056,7 +97056,7 @@ "equipment_slot": "0", "archery_ticket_price": "0", "durability": null, - "remove_head": true + "hat": true }, { "id": "10695", @@ -97070,7 +97070,7 @@ "equipment_slot": "0", "archery_ticket_price": "0", "durability": null, - "remove_head": true + "hat": true }, { "id": "10696", @@ -128312,7 +128312,7 @@ "bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0", "archery_ticket_price": "0", "durability": null, - "remove_head": true + "hat": true }, { "id": "13812", @@ -128329,7 +128329,7 @@ "bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0", "archery_ticket_price": "0", "durability": null, - "remove_head": true + "hat": true }, { "id": "13813", @@ -128346,7 +128346,7 @@ "bonuses": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0", "archery_ticket_price": "0", "durability": null, - "remove_head": true + "hat": true }, { "id": "13814", diff --git a/Server/src/main/java/core/game/node/entity/player/link/appearance/Appearance.java b/Server/src/main/java/core/game/node/entity/player/link/appearance/Appearance.java index 396f718e8..c58eb2073 100644 --- a/Server/src/main/java/core/game/node/entity/player/link/appearance/Appearance.java +++ b/Server/src/main/java/core/game/node/entity/player/link/appearance/Appearance.java @@ -303,10 +303,13 @@ public final class Appearance { drawClothes(7, getLegs().getLook()); } if ((hat != null && hat.getDefinition().getConfiguration(ItemConfigParser.REMOVE_HEAD, false)) || castleWarsHood) { - flagHatClipping(); + clearBodyPart(8); } else { drawClothes(8, getHair().getLook()); } + if((hat != null && hat.getDefinition().getConfiguration(ItemConfigParser.IS_HAT,false))){ + flagHatClipping(); + } if (hands != null) { drawItem(9, hands); } else { diff --git a/Server/src/main/kotlin/rs09/game/system/config/ItemConfigParser.kt b/Server/src/main/kotlin/rs09/game/system/config/ItemConfigParser.kt index e781e8764..4fcd1e381 100644 --- a/Server/src/main/kotlin/rs09/game/system/config/ItemConfigParser.kt +++ b/Server/src/main/kotlin/rs09/game/system/config/ItemConfigParser.kt @@ -1,14 +1,14 @@ package rs09.game.system.config -import rs09.ServerConstants import core.cache.def.impl.ItemDefinition import core.game.node.entity.impl.Animator import core.game.node.entity.player.link.audio.Audio -import rs09.game.system.SystemLogger import core.game.world.update.flag.context.Animation import org.json.simple.JSONArray import org.json.simple.JSONObject import org.json.simple.parser.JSONParser +import rs09.ServerConstants +import rs09.game.system.SystemLogger import java.io.FileReader class ItemConfigParser { @@ -93,6 +93,8 @@ class ItemConfigParser { */ const val REMOVE_HEAD = "remove_head" + const val IS_HAT = "hat" + /** * The remove beard item configuration key. */ @@ -256,6 +258,7 @@ class ItemConfigParser { "remove_sleeves", "remove_beard", "remove_head", + "hat", "destroy", "lendable", "tradeable" -> configs.put(it.key.toString(),it.value.toString().toBoolean())