BedWars1058
BedWars1058 copied to clipboard
TNT and Fireball
Describe the bug: It is possible to break the protection of the bed with TNT or FireBall, even if it is "protected" by glass.
To Reproduce:
- Create a protection around the bed in two layers: the first of wool and the second of glass.
- Now just throw a TNT or FireBall towards the bed.
Expected behavior: The glass should protect the first layer of protection blocks (the wool, in this example), as stated.
Screenshots:
- TNT: https://i.imgur.com/gjiYIZJ.gif
- FireBall: https://i.imgur.com/eMpEz3R.gif
System:
- OS: Linux
- Server software: Spigot
- Server Version: 1.8.8
- Plugin Version: 21.12.1
umm thats not normal Glass should protect down layers
The fact that the blocks below the glass explode spoils the whole dynamics of the game as players only need to break the glass as TNT will COMPLETELY remove the protection from the bed. This makes it EXTREMELY easy to break the beds, and takes all the fun out of players having to break the protection to break the bed.
So yes, as xsorencoolx talk: "Glass must protect the down layers".
After testing, it looks like the issue only happens if it is not protected diagonally. So a workaround for now is to make sure its protected diagonally. Obviously this isnt ideal, ill look into fixing this at some point.
Tested that see the behavior described:
Tested where the glass protects the block:
waw nice map ajgeiss
waw nice map ajgeiss
Thanks, I spent a whole 5 minutes making it 😁
Lol, I laughed so hard that i farted by accident.
So after trying to improve the detection of blocks protected by the blast proof, a new concern appeared, that the tnt sometimes does nothing.
my guess is its due tnt or any explosives calculates its blast based on how much is eaten up by the blast which reduces intensity/range.
Now this issue can't be solved by just "improving blast proof glass", it needs a way of recalculating tnt blast with glass in mind. The only way i could think of is starting with a radius and simply expand it from the source and just check if the next block is a glass if it is then simply dont go in that direction and so on. A way to visualise this, put water above ground by 4 blocks and see how it expands when landing on the ground.
I honestly would like to do this, but i cant figure out the right way to do the expansion, this needs another look.
I finally got some time to work on this. I managed to get it work as intended with no side effects or problems i listed above. Ill be porting over into bw1058 NMS 1.8.8 for what i know and able test right now.
The Fix is as following: I simply copied what NMS do when creating an explosion and added ray tracing to check if the ray has any blast proof glass in it. and then on the exploding events i slapped the method to recalculate the blockList.
For Info on blast calculation: Wiki
NOTE I DID NOT IMPLEMENT THE MODEL BUT JUST COPIED IT FROM THE NMS (net.minecraft.server.v1_8_R3.Explosion#a()
)
I will be adding it and open a pull request tmrw
I forgot there was an open pr for that