02-01-2014, 05:17 PM
02-01-2014, 08:36 PM
No indeed,
In your code you are checking what kind of armor or weapon it is right ?
Based on that + what option they chose, you should set a enchantment + level that suits it. or multiple enchants of course.
You will have to code that yourself though.
In your code you are checking what kind of armor or weapon it is right ?
Based on that + what option they chose, you should set a enchantment + level that suits it. or multiple enchants of course.
You will have to code that yourself though.
04-08-2014, 04:35 AM
I'm working now on Enchanting..
I added the Enchantment-Slot-Level generating but without bookshelf checking.
Now i will check the amount of bookshelves und i have a problem.
Have anyone a better idea to get the position of the enchantment table?
I added the Enchantment-Slot-Level generating but without bookshelf checking.
Now i will check the amount of bookshelves und i have a problem.
m_ParentWindow.GetOwner()->GetBlockPos(x, y, z);When i will call this method mc-server crash.
Have anyone a better idea to get the position of the enchantment table?
04-08-2014, 04:39 AM
I think you should wait until 1.8
04-08-2014, 04:48 AM
Well, a crash needs a bug report, almost always. Why not report it on GitHub?
04-09-2014, 12:23 AM
(04-08-2014, 04:48 AM)bearbin Wrote: [ -> ]Well, a crash needs a bug report, almost always. Why not report it on GitHub?
I hadn't time yesterday. I will make it later...
04-12-2014, 10:48 PM
Currently i'm working on the bookshelves checking.
What is wrong? PosX etc.. are the Enchantment Table Position.
cBlockArea Area; Area.Read(a_Player.GetWorld(), PosX - 2, PosX + 2, PosY, PosY + 1, PosZ - 2, PosZ + 2); for (int x = 0; x < 7; x++) { for (int y = 0; y < 2; y++) { for (int z = 0; z < 7; z++) { LOG(Printf("%i", Area.GetBlockType(x, y, z)).c_str()); if (Area.GetBlockType(x, y, z) == E_BLOCK_BOOKCASE) { LOG("BookShelf"); } } } }
What is wrong? PosX etc.. are the Enchantment Table Position.
04-12-2014, 10:53 PM
Well.. What's the problem? What is it supposed to do?
04-12-2014, 10:55 PM
LOG(Printf("%i", Area.GetBlockType(x, y, z)).c_str());
Don't need to go this difficult, this is enough (LOG() functions work the same as printf):
LOG("%i", Area.GetBlockType(x, y, z));
Your problem probably is that you're using non-relative GetBlockType(). You should use the relative-coord version: GetRelBlockType()
Don't need to go this difficult, this is enough (LOG() functions work the same as printf):
LOG("%i", Area.GetBlockType(x, y, z));
Your problem probably is that you're using non-relative GetBlockType(). You should use the relative-coord version: GetRelBlockType()
04-12-2014, 11:06 PM
Now i have this code:
Output:
http://pastebin.com/3EFuU6a0
But the ID's aren't right. 137 = command block. But there isn't a command block.
cBlockArea Area; Area.Read(a_Player.GetWorld(), PosX - 2, PosX + 2, PosY, PosY + 1, PosZ - 2, PosZ + 2); for (int x = 0; x < 7; x++) { for (int y = 0; y < 2; y++) { for (int z = 0; z < 7; z++) { LOG("%i", Area.GetRelBlockType(x, y, z)); if (Area.GetRelBlockType(x, y, z) == E_BLOCK_BOOKCASE) { LOG("BookShelf"); } } } }
Output:
http://pastebin.com/3EFuU6a0
But the ID's aren't right. 137 = command block. But there isn't a command block.