Rebase the MessageHandler, MessageHandlerChain and MessageHandlerChainSet

Rebased several other pieces of code
This commit is contained in:
atomicint
2015-03-29 12:52:55 -04:00
parent 7f345fffac
commit 654a1a6dfd
71 changed files with 452 additions and 457 deletions
+7 -7
View File
@@ -25,8 +25,8 @@ module HerbloreMethod
end
end
# The ItemOnItemMessage handler for all Herblore-related functions.
on :message, :item_on_item do |ctx, player, message|
# The ItemOnItemMessage listener for all Herblore-related functions.
on :message, :item_on_item do |player, message|
primary = message.id
secondary = message.target_id
hash = HERBLORE_ITEM_ON_ITEM[primary]
@@ -41,25 +41,25 @@ on :message, :item_on_item do |ctx, player, message|
method = hash[secondary]
unless method.nil?
method.invoke(player, primary, secondary)
ctx.break_handler_chain
message.terminate
end
end
end
# The ItemOptionMessage handler for all Herblore-related functions.
on :message, :first_item_option do |ctx, player, message|
# The ItemOptionMessage listener for all Herblore-related functions.
on :message, :first_item_option do |player, message|
id = message.id
method = HERBLORE_ITEM[id]
unless method.nil?
method.invoke(player, id, message.slot)
ctx.break_handler_chain
message.terminate
end
method = DRINK_ITEM[id]
unless method.nil?
method.invoke(player, id, message.slot)
ctx.break_handler_chain
message.terminate
end
end
+1 -1
View File
@@ -223,7 +223,7 @@ class GrindingAction < Action
end
end
# Appends a ground ingredient to the ItemOnItemMessage handler interception.
# Appends a ground ingredient to the ItemOnItemMessage listener interception.
def append_ground(id, raw)
ground = GroundIngredient.new(id, raw)
append_herblore_item(ground, PESTLE_MORTAR, raw)