DiabloDrops icon indicating copy to clipboard operation
DiabloDrops copied to clipboard

Probable bug with RuinGenerateEvent

Open TfT-02 opened this issue 11 years ago • 6 comments

When listening to RuinGenerateEvent to edit the loot inside the chests, I encountered some trouble. So I added some debug messages and I noticed how: event.getChest().getType() returns Material.AIR, I'd expect that it would return Material.CHEST

So it would appear that event.getChest() is getting the wrong block.

Using Jenkins dev build: https://diabloplugins.ci.cloudbees.com/job/DiabloDrops/7/

TfT-02 avatar Mar 10 '13 22:03 TfT-02

After doing more tests, I noticed that the coordinates are actually correct. Does this event get called before the chest gets generated?

TfT-02 avatar Mar 11 '13 22:03 TfT-02

It does get called before the chest is generated.

ToppleTheNun avatar Mar 12 '13 17:03 ToppleTheNun

Is that intentional? Would it be possible to fire the event after the chest is generated?

TfT-02 avatar Mar 12 '13 18:03 TfT-02

I suggest that you run a task after catching the generation that will then mess with the contents of the chest, using BukkitScheduler.

ToppleTheNun avatar Mar 13 '13 22:03 ToppleTheNun

That would be a possible solution, yes. Though I still think it is weird how event.getChest() does not return the chest.

TfT-02 avatar Mar 13 '13 22:03 TfT-02

Yeah, it is weird.

ToppleTheNun avatar Mar 13 '13 23:03 ToppleTheNun