BedWars1058 icon indicating copy to clipboard operation
BedWars1058 copied to clipboard

TNT and Fireball

Open DeusDrizzyy opened this issue 3 years ago • 9 comments

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:

  1. Create a protection around the bed in two layers: the first of wool and the second of glass.
  2. 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

DeusDrizzyy avatar Jan 14 '22 12:01 DeusDrizzyy

umm thats not normal Glass should protect down layers

xsorencoolx avatar Jan 14 '22 13:01 xsorencoolx

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".

DeusDrizzyy avatar Jan 19 '22 02:01 DeusDrizzyy

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: image

Tested where the glass protects the block: image

ajgeiss0702 avatar Feb 02 '22 06:02 ajgeiss0702

waw nice map ajgeiss

ghost avatar Feb 02 '22 13:02 ghost

waw nice map ajgeiss

Thanks, I spent a whole 5 minutes making it 😁

ajgeiss0702 avatar Feb 02 '22 14:02 ajgeiss0702

Lol, I laughed so hard that i farted by accident.

ghost avatar Feb 02 '22 14:02 ghost

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.

IIHERO4 avatar Mar 26 '22 19:03 IIHERO4

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())

IIHERO4 avatar Mar 30 '22 20:03 IIHERO4

I will be adding it and open a pull request tmrw

IIHERO4 avatar Mar 30 '22 20:03 IIHERO4

I forgot there was an open pr for that

andrei1058 avatar Jun 11 '23 10:06 andrei1058