From a37de9fc31321587a2af21abdcee5cef47f843ea Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 19 Oct 2026 14:35:19 -0400 Subject: [PATCH] Read the item power grant from the cache template The BUCKET/POTION/SCROLL use path takes the first item_power_grant entry in file order from getItemPowerGrant() instead of the first key of the legacy HashMap. Offline parity (p15e.py, 7586 rows): 0 differences in the grant lists. The legacy HashMap order picks a different power on 664 templates, all RUNE folder runes with item_type RUNE, which take the RUNE case and never reach this path. Every ITEM-folder grant (scrolls, potions, bucket, rod, gift rings) has exactly one entry and no DEED has one, so the power and value used are unchanged. Co-Authored-By: Claude Opus 5.5 --- src/engine/net/client/handlers/ObjectActionMsgHandler.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/engine/net/client/handlers/ObjectActionMsgHandler.java b/src/engine/net/client/handlers/ObjectActionMsgHandler.java index ea2bceae..6d84c2fe 100644 --- a/src/engine/net/client/handlers/ObjectActionMsgHandler.java +++ b/src/engine/net/client/handlers/ObjectActionMsgHandler.java @@ -251,10 +251,9 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { } if (waterbucketBypass == false) { - String powerString = item.template.item_power_grant.keySet().iterator().next(); - PowersBase powerAction = PowersManager.powersBaseByIDString.get(powerString); - int powerValue = item.template.item_power_grant.get(powerString); - PowersManager.applyPower(player, target, Vector3fImmutable.ZERO, powerAction.getToken(), powerValue, true); + engine.parsers.objects.PowerGrant powerGrant = item.template.cacheTemplate.getItemPowerGrant().get(0); + PowersBase powerAction = PowersManager.powersBaseByIDString.get(powerGrant.power_type); + PowersManager.applyPower(player, target, Vector3fImmutable.ZERO, powerAction.getToken(), powerGrant.power_value, true); } itemMan.consume(item); } else //just remove the item at this point