Civcraft / Citadel

Do not open issues here; open them on the maintained fork @ DevotedMC
https://github.com/DevotedMC/Citadel
BSD 3-Clause "New" or "Revised" License
6 stars 23 forks source link

Fix for reinforced sand falling #137

Closed suirad closed 8 years ago

suirad commented 8 years ago

Addresses Civcraft/Citadel#83

This pull makes citadel monitor blockphysics events. It checks if a block is affected by gravity(sand,gravel,anvil) then checks its reinforcement and cancels physics if the block is reinforced. This keeps reinforced sand from falling. It also fixes the weird glitchy-ness with reinforced gravity affected blocks disappearing or falling.

Before patch:

After patch:

CivcraftBot commented 8 years ago

Can one of the admins verify this patch? Type 'ok to test' to test.

ttk2 commented 8 years ago

that's one way to handle it I guess, is the goal to prevent reinforcement of air?

rourke750 commented 8 years ago

No the goal was to stop reinforced blocks from just falling. Merging.

suirad commented 8 years ago

@ttk2, just to give you a clear image of what's going here. When a block is placed or broken, it sends a blockphysics event to the 4 immediate blocks around it. When sand(/gravel/anvils) get that event, that is what causes them to try and fall if they are suspended unsupported. When that happens it removes the block and spawns a falling entity block.

What this change does is it watches for that event, and if the block.hasgravity(it can fall) it checks if it is reinforced, and if so cancels the event. Now citadel properly keeps these types of blocks from having weird behavior like becoming invisible or being tricked into falling(i was able to do it by placing unreinforced sand on top of floating reinforced sand) On Oct 16, 2015 6:24 AM, "rourke750" notifications@github.com wrote:

Merged #137 https://github.com/Civcraft/Citadel/pull/137.

— Reply to this email directly or view it on GitHub https://github.com/Civcraft/Citadel/pull/137#event-437117044.