Closed CoderCow closed 11 years ago
Sounds useful, if the code's okay. On Oct 4, 2012 9:21 AM, "CoderCow" notifications@github.com wrote:
Added hooks: NpcHooks.UseDoor NpcHooks.TriggerPressurePlate ProjectileHooks.TriggerPressurePlate
I need those hooks to fully integrate my Advanced Circuits plugin into
Terraria Server and would be thankful if you could merge these in.
You can merge this Pull Request by running:
git pull https://github.com/CoderCow/TerrariaAPI-Server master
Or view, comment on, or merge it at:
https://github.com/Deathmax/TerrariaAPI-Server/pull/12 Commit Summary
- Added hooks:
File Changes
- A Hooks/Classes/NpcUseDoorEventArgs.cs (29)
- A Hooks/Classes/TriggerPressurePlateEventArgs.cs (37)
- M Hooks/NpcHooks.cs (36)
- M Hooks/ProjectileHooks.cs (19)
- M Terraria/Collision.cs (24)
- M Terraria/NPC.cs (80)
- M Terraria/Player.cs (2)
- M Terraria/Projectile.cs (2)
- M TerrariaAPI-Server.csproj (335)
Patch Links
- https://github.com/Deathmax/TerrariaAPI-Server/pull/12.patch
https://github.com/Deathmax/TerrariaAPI-Server/pull/12.diff
— Reply to this email directly or view it on GitHubhttps://github.com/Deathmax/TerrariaAPI-Server/pull/12.
I also did some ingame testing and NPCs (friendly or mobs) walking over pressure plates as well as boulders that fall onto or roll over them raise the respective event.
NpcHooks.UseDoor is raised as a friendly NPC is about to open or close a door, same for mobs when they are about to open a door after they punched it several times. Though, if a mob punched a door several times but the door is unable to open because it is blocked, the event is spammed for each game frame as long as the npc stays close to that door. This should not be a big issue but I don't see a simple solution for that.
If it becomes troublesome, we could always duplicate the first part of WorldGen.OpenDoor to check to see if the door is blocked to cut down on the event spam...
Yes, good idea.
So I guess we'll wait on that?
Updated and works fine.
Should we API version this?
Probably be wise :\
I'm sorry for all the delay, I guess? As the API version was already ticked in the meantime, this seems to be out of question now.
Added hooks: NpcHooks.UseDoor NpcHooks.TriggerPressurePlate ProjectileHooks.TriggerPressurePlate
I need these hooks to fully integrate my Advanced Circuits plugin into Terraria Server and would be thankful if you could merge these in.