[2.41] Explosive deconstruction of active shield may drop shield blocks that if placed can only be removed using creative mode
Aedda opened this issue ยท 15 comments
I created a 9x9x9 room of Shield Template blocks, spawned Wither inside and vacated to test strength. Initial Wither explosion destroyed most of shield...
I actually retested this and it appears random, sometimes no Shield Blocks drop, sometimes the majority are Shield Blocks.
Didn't mean to close this, sorry.
Once placed the shield blocks can be walked through but other blocks cannot be placed in that area until removed.
Ok. Apparently I have to do something else to make the shield blocks really indistructable. I will look into this. Thanks for reporting.
Can you show me a screenshot of your setup and the resulting damage? Also are you use the shield projector itself wasn't destroyed through the blast? You did activate the shield and it had power? The shield block is set to indestructable so the wither should not have been able to destroy it.
I hope I did you one better, 30 second video of the entire process.
I did about 7 takes... the first time only small areas of the Shield were destroyed but the Wither managed to escape through one, the Generator was immediately next to the front corner and was destroyed in the initial blast. In the later tests I spaced the Generator away, in the remaining 6 tests the Shield was almost or completely destroyed. Changing the Cloaking block had no effect on the result of each test.
Earlier I also tried using the Sequencer to turn off the Generator for 1 tick in 64 to refresh the shield but the Wither phased through within that one tick.
Please let me know if I can be of any further assistance.
Ok, fixed it. In the latest dev build (https://drone.io/github.com/McJty/RFTools/files) you can find a version of rftools that is wither proof. Tested it myself :-)
I asked RWTema about this since his Compressed Cobblestone in Extra Utilities withstands the Wither on the higher end and this is what he said, hope this helps!
RWTema- Aedda: You have to override BOTH canEntityDestroy() and onBlockExploded() in the Block class
I just ran a few tests. Overall a huge improvement, however... I ran 4 tests, in the first a single errant projectile got loose somehow and took out the generator I was standing near, once that happened it quickly carved a hole in the side and came out. This did not occur in the following 3 tests.
One thing to note however is the initial bug is still there, as the Wither fires projectiles it destroys Shield blocks momentarily, causing them to drop their item in the world. After a single test I have 629 Shield Blocks in my inventory. I reran the test with only RFTools, Thermal Foundation/Expansion, CoFHLib, and CoFHCore to ensure a mod was not interacting with it.
You wouldn't prevent the projectiles, those are part of the fun of having a shield anyway. You want to prevent the drops caused by the damage.
My modfoo is a bit rusty but taking from the examples provided by the vanilla blocks you want your Shield Block (the one in the world when the shield is active) to do the following...
In the getItemDropped method, return null.
In dropBlockAsItemWithChance, pass the arguments given to super.dropBlockAsItemWithChance
In the quanityDropped method, return 0.
And I think that should do it, the first two methods may be redundant given the third but should not hurt.
You can refer to BlockGlass, BlockRedstone, BlockMobSpawner, BlockGlowstone, BlockGrass, and BlockLeaves for direct examples.
Ok. I was in creative so it actually didn't shoot fireballs at me. I will try to test that. However, I did what RWTema suggested so not sure what else I should do to prevent the explosive fireballs.
strangely enough I cannot reproduce the problem so I'll just fix it blindly in a moment.