02-01-2014, 05:17 PM
(This post was last modified: 02-01-2014, 06:36 PM by daniel0916.)
But this aren't random enchantments or?
Enchanting
|
02-01-2014, 05:17 PM
(This post was last modified: 02-01-2014, 06:36 PM by daniel0916.)
But this aren't random enchantments or?
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.
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. 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
(This post was last modified: 04-09-2014, 12:43 AM by daniel0916.)
04-12-2014, 10:48 PM
Currently i'm working on the bookshelves checking.
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?
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() Thanks given by: daniel0916
04-12-2014, 11:06 PM
Now i have this code:
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. |
« Next Oldest | Next Newest »
|