Cuberite Forum
Hook Question - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Plugins (https://forum.cuberite.org/forum-1.html)
+--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html)
+--- Thread: Hook Question (/thread-669.html)

Pages: 1 2 3 4 5


RE: Hook Question - xoft - 11-23-2013

FakeTruth, even with the best optimizations there are situations that you won't handle well. Even the vanilla client has troubles with some things. I remember when I was toying with the terrain generator, that I accidentally generated terrain that had too many block faces exposed to air - think "20% stone to 80% air dithering". The client would halt and finally, after half an hour, crash.

Your optimization could be broken in the same way - an alternating pattern of cobble, mossy cobble and air.

I'm not saying that it's normal, I'm just saying that there are cases that you won't be able to handle well. The question is, is anyone gonna get into such a situation? And if so, is there a better solution?


RE: Hook Question - FakeTruth - 11-23-2013

So what if there's gonna be a situation like that, the server's not gonna blow up just because it's storing a bit of data. Besides, this pattern will disappear sooner or later because all cobblestone will become mossy.
And yes I know the client has trouble with things, it's ridiculous, they should fix that stuff. When you say "even" you make it sound like the Minecraft client is a genius piece of software architectureTongue


RE: Hook Question - tonibm19 - 12-31-2013

One question about OnBlockToPickups hook.
When a player breaks sugarcane/cacti, all blocks above are digged and a pickup it's spawned, would this be a natural reason (no Digger) or would there be a digger?


RE: Hook Question - NiLSPACE - 12-31-2013

I think it would be a natural reason.


RE: Hook Question - tonibm19 - 12-31-2013

Could you add an OnFished hook? I'd like to add fisherman job to Jobs.
Something like
function OnFished(Player, Result)
Result would be the item player got fishing.


RE: Hook Question - xoft - 12-31-2013

Nice idea. Make it a set of two - OnFishing(Player, ResultItem) that is fired just as the player decided to reel in and could override the result, and OnFished(Player, ResultItem) that is fired as a notification only after the catch has been decided.


RE: Hook Question - NiLSPACE - 12-31-2013

I'll implent it tomorrow if I have time.

I was bored so I did it today ;( Sorry Smile


RE: Hook Question - NiLSPACE - 01-02-2014

The OnPlayerFished and OnPlayerFishing is implented.


RE: Hook Question - tonibm19 - 02-03-2014

What about an OnPlayerTick hook? Like OnPlayerMoving, but called every tick.


RE: Hook Question - xoft - 02-03-2014

You have OnWorldTick() and cWorld::ForEachPlayer()