shadowmage45 / AncientWarfare

Updated Ancient Warfare mod for Minecraft 1.5.2+
http://ancientwarfare.wikispaces.com/
Other
10 stars 8 forks source link

Vehicles will allow players to Glitch to blocks above the vehicles #12

Closed TechStack closed 10 years ago

TechStack commented 10 years ago

If you are under a platform(blocks) riding on a battering ram or other vehicles and exit them you will get placed on top of the platform. This allows the player to get to places they normally should not be allowed to get to.

Its only important if world protection is in place because in a normal game they could just stack up or dig through the blocks anyway.

shadowmage45 commented 10 years ago

I'm using the vanilla dismount code for dismounting from vehicles. Does the same or similar happen with minecarts/horses/etc when dismounting?

(I will attempt to test this later if I have time)

If necessary I could write my own custom dismount code to force placement of the player on the same (or only 1 higher/lower) Y level as the vehicle that is being dismounted.

TechStack commented 10 years ago

I'll have to check vanilla also, It's really the height of the vehicles that cause an advantage. a block above a player in a minecart would mean the players head was inside the block but with the high tall vehicles you get placed way above the players head position. We even had problems with the server thinking players were "Flying" when exiting a battering ram and it would auto kick them :o (MCPC+ server)

And like I mentioned its only when some type of block protection scheme is also in place to prevent players from stack jumping up or breaking the platform that it would be a concern.

Thanks for looking into this & all the other issues we have found :)

shadowmage45 commented 10 years ago

I've been trying to find a way around the 'flying' kick/disconnect for awhile, but it seems that they way MC handles detection of 'flying' is a bit borked. (I could always force-set the server/clients to enable flying...but that is not exactly the route I want to go).

Essentially anytime a player goes X ticks or more without touching the ground, it triggers a flying check. I'll probably have to look into the code a bit and do some hacks to reset whatever variable is being checked for the flying check anytime a player is on (or colliding with) a vehicle.

As to fixing the dismount code, I have an idea that may help (setting player position to ground level before triggering dismount), but will need to do some testing on it first to see if it even works :)

shadowmage45 commented 10 years ago

I'm taking a look over the mount/dismount code, and it unfortunately does not look like there is much that I can do about solving this problem (aside from somehow reworking all of my vehicle models to place the seat on the ground and repositioning the player appropriately).

It comes down to the mount/dismount code being handled from the EntityPlayer class, and not in my vehicles' code at all. I would have to coremod/ASM/patch some bytecode to make it work, and it would be flaky/unlreliable at best.

I will leave this open for bit while I investigate a few other possibilities -- it might be possible that I can catch the sneak/dismount activation before the server does the dismount and handle it manually, and/or I might be able to disable the vanilla dismount mechanics somehow....