Cuberite Forum
Countdown - 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: Countdown (/thread-1314.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13


RE: Countdown - daniel0916 - 01-13-2014

(01-13-2014, 02:40 AM)xoft Wrote: You know, you don't need to quote everything when it's right above your post, the forum then becomes a chaos of quotes inside quotes inside quotes. Consider this a conversation, and only quote if you want to react to something very specific and older in the conversation.

I modified the last post. Sorry.


RE: Countdown - xoft - 01-13-2014

Old habits die hard Smile

I don't quite understand your question. What with blocks with unknown type? You can just compare block types to numbers directly; but I believe we have (almost) all vanilla blocks defined - have a look at the $/src/BlockID.h file, there's a list of block types that the server understands in the Lua scripts.


RE: Countdown - daniel0916 - 01-13-2014




RE: Countdown - xoft - 01-13-2014

Cake and fire blocks need special handling, which is not yet implemented by MCServer. So the client sends a "break block" packet that specifies "interacting with the fire's north side", for example, and MCServer's default action to "breaking while interacting with the block's north side" is "dig the block north of the interacted blocks". Which means MCServer will actually try to dig the air block next to the fire - that's why you're getting "air" for the block's type. Cake is probably similar.

I don't think there's an easy way to fix this in a plugin. Should you wish to, you can add the proper handling to the fire block handler, thus eliminating this bug altogether.


RE: Countdown - daniel0916 - 01-13-2014




RE: Countdown - NiLSPACE - 01-13-2014

You can use "DeltaExperience" for that


RE: Countdown - daniel0916 - 01-13-2014

(01-13-2014, 04:27 AM)STR_Warrior Wrote: You can use "DeltaExperience" for that

How can i change between removing or adding experience?
So to delete all levels:
Player:DeltaExperience(Player:GetXpLevel());

And how can i create a item with a custom name to add this in the player inventory?


RE: Countdown - NiLSPACE - 01-13-2014

I think if you want to delete everything you have to use
Player:DeltaExperience(-Player:GetCurrentXp())
(not completely sure though)


RE: Countdown - daniel0916 - 01-13-2014

Do you know to edit the Item's name?
I saw the example code on the cItem site.


RE: Countdown - NiLSPACE - 01-13-2014

You mean custom names for items? No MCServer doesn't support that yet.