Open ybw0014 opened 2 years ago
I was already aware of this issue, however there is no event in Bukkit that can currently help solve this, at least as far as I know.
i believe this is fixed i havent actually checked but i do know that ghost blocks load differently then they used too and more seamlessly into the block itself
the issue that i posted about is still not fixed in the latest foxymachines build and maybe i got something to add it looks like when ever a explosion happen close to a ghost block it teleports randomly in the air or something but it kinda looks like the same thing that the dragon egg is doing when you hit it in survival that it randomly teleports somewhere maybe if this is disabled or something this kinda event then the ghost block issue will also be fixed just something i wanted to say but i dont know if this works
As I've said, I don't know how to fix this without a big performance impact, which I'd argue is does more harm than this harmless bug. Unless someone else is able to come up with a solution, or there are changes in bukkit, there is nothing I can do.
Can you use the entityexplosionevent? Get the entities it's damaging and if it is a ghost block prevent the damage. I do something similar in spirits unchained to stop some of the traits from damaging the player who used them and there is no real performance impact.
Just took a look, I use entitydamageevent and then check if the attacker has a key relating to the entity attacked. But I believe you could check if the entity from the event is a ghost block and then if it is, get the attacker and check if it's an instance of tnt or the other methods or creating explosions, or maybe another way entirely to check if it is explosion damage. And if so then cancel the event.
Looked into it a tad more and it looks like you could listen to the EntityDamageEvent, first I would check if the damage cause is either BlockExplosion, or EntityExplosion, if it is then check if the event's entity is a ghost block, if it is, cancel.
Haven't thought about it since they are invincible, but that might work. Will look into it later.
Still doesn't cancel the knockback, so unfortunately it doesn't work
Shucks
So this mean's that there is no possible way to fix this problem for ever?
Well no, there might be some way, just not one that we have thought of yet
You might just need to see if the velocity changes and set it to 0 each time
Description (Required)
Ghost blocks are falling blocks, and they can be pushed away by explosions. When they hit the ground, they turn into real blocks.
This is an issue forwarded from our fork (https://github.com/SlimefunGuguProject/FoxyMachines/issues/6)
Steps to reproduce the Issue (Required)
Place a ghost block, and push it with any kind of explosion.
The ghost block hits the ground and turn into real blocks.
Expected behavior (Required)
Explosions will not push ghost blocks.
Server Log / Error Report
Environment (Required)