Posts: 22
Threads: 3
Joined: Jun 2013
Thanks: 0
Given 2 thank(s) in 2 post(s)
06-21-2013, 04:08 AM
(This post was last modified: 06-21-2013, 04:26 AM by Stephen304.)
Hey, got VC2008 up and working
I took a bit of time and added the max stack cases for all the blocks that are defined. So far there seem to only be a couple blocks missing from the definitions, so I skipped those to leave the naming up to you guys.
Missing from BlockID.h are:
Item Frame
Empty Map
Nether Star
Iron/Gold/Diamond Horse Armour
Lead (Leash)
Mob Nametag
Other than those, everything else is properly added to the max stack thing.
https://dl.dropboxusercontent.com/u/3852...king.patch
Oh and btw the edits to BlockID.h are only notes on the missing items.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
I think blocks should be named only after they are released in the game, so the horse armor, leash and nametag will be better off left until the name settles
Patch committed as rev 1614.
Posts: 22
Threads: 3
Joined: Jun 2013
Thanks: 0
Given 2 thank(s) in 2 post(s)
06-21-2013, 07:18 AM
(This post was last modified: 06-21-2013, 09:43 AM by Stephen304.)
Well I found the part that checks if blocks are in range to pickup, and I think I fixed the bug where you can pickup blocks 1 block below you (in a 1 block deep trench). It's a really simple fix, and it seems to work fine. Take a look:
https://dl.dropboxusercontent.com/u/3852...ange.patch
http://www.mc-server.org/support/index.p...ask_id=396
I just added && DiffY > -0.6 so items a block below you don't get picked up but items half a block below still get picked up.
When experimenting, I found that "(*itr)->GetPosY()" doesn't indicate whether items are on a half slab. (When on level ground, Y=101, when on a slab, Y=101 still)
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
I think the problem is in a different thing. The Y coords are based at lowest entity points, so the distance from the pickup is measured to the player's feet. It might be better to measure distance to torso, at Y + 1, this should provide much better results and won't need the extra condition.
Posts: 22
Threads: 3
Joined: Jun 2013
Thanks: 0
Given 2 thank(s) in 2 post(s)
06-22-2013, 12:06 AM
(This post was last modified: 06-22-2013, 12:14 AM by Stephen304.)
(06-21-2013, 04:44 PM)xoft Wrote: I think the problem is in a different thing. The Y coords are based at lowest entity points, so the distance from the pickup is measured to the player's feet. It might be better to measure distance to torso, at Y + 1, this should provide much better results and won't need the extra condition.
That still wouldn't solve the problem as it's not a problem with the player but with the dropped items. The items have the same Y coordinate when they are on slabs as when they are on the ground instead of having a .5 Y coordinate.
In other words, the Y coordinates of items are always integers.
In addition, a problem is that a sphere is being used to test distance for pickup, so there will always need to be an extra clause unless the square distance method is revised because the player should be able to pick up at 1.5 blocks away horizontally, blocks 1.5 above the feet, and .6 blocks below the feet. So you see 2 of these are 1.5, so they are already consolidated in one condition. If you change the measurement from the middle of the torso, you will need 3 separate checks, because it will be 1.5 laterally, .5 up from the torso (if torso is 1 above the ground), and 1.6 below torso.
I tested this for a few hours. The items Y coordinates of items on the ground are definitely bugged, so even if we measure from the torso, the problem won't be solved.
Posts: 1,450
Threads: 53
Joined: Feb 2011
Thanks: 15
Given 120 thank(s) in 91 post(s)
No, it's because the MCServer physics have no support for half slabs, only full sized blocks
Posts: 22
Threads: 3
Joined: Jun 2013
Thanks: 0
Given 2 thank(s) in 2 post(s)
06-22-2013, 12:23 AM
(This post was last modified: 06-22-2013, 12:27 AM by Stephen304.)
(06-22-2013, 12:21 AM)FakeTruth Wrote: No, it's because the MCServer physics have no support for half slabs, only full sized blocks
That would explain the lack of half-coordinates for items. But I mean it is that that's causing the problem right? I don't think measuring from the torso will do much. The player's coordinates seem fine.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
Where did you get those numbers? Are they exact, or are they measured?
A simple solution would be to use an aspect ratio on the individual coords, so that the unit sphere matches the ellipsoid we need for the check.
Posts: 22
Threads: 3
Joined: Jun 2013
Thanks: 0
Given 2 thank(s) in 2 post(s)
(06-22-2013, 02:10 AM)xoft Wrote: Where did you get those numbers? Are they exact, or are they measured?
A simple solution would be to use an aspect ratio on the individual coords, so that the unit sphere matches the ellipsoid we need for the check.
I took (*itr)->GetPosY() and printed it to the server console, so it should be exact. It also explains the behavior I was seeing.
Posts: 6,485
Threads: 176
Joined: Jan 2012
Thanks: 131
Given 1075 thank(s) in 852 post(s)
I meant, how did you come up with the 1.5 and 0.6 blocks distances for collecting, did you test that on a vanilla server, or is it just a guess?
Measuring is always an approximation only, the exact numbers can be found only in the client sourcecode, if you manage to get MCP working
|