-
Content Count
1511 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Everything posted by hydroflame
-
hi, i came accross this weird bug where cancelled event wouldn't be processed before the next event and the 2nd event wouldn't be properly processed. the code is really simple (the one needed to reproduce the bug anyway): @ForgeSubscribe public void cancelAllBlockPlaced(PlayerInteractEvent event){ if(event.action == event.Action.RIGHT_CLICK_BLOCK){ event.setCanceled(true); } } so basicly this should stop ALL block from behing placed (as well as removing the possibility of using crafting table and other GUI block but that's not the point) but this code appears to be skipped when the players spam right click to place blocks example: p = player [] = empty block p[][][][] p[][][c][] when the player right click once on block 'c', the event is canceled correctly (nice ) when the player spam r click the ground (not too fast), it makes a block appear and dissapear . finally, when the player right click at a fast enough speed, he can place a block on the canceled block (before it dissapear) and permanently place a new block ex: before: p[][][] p[][][] click 1: p[][][][] p[][][c][] click 2 (shortly after click 1): p[][][][] p[][c][c][] after forge cancel event 1: p[][][][] p[][c][][] anybody know why it does this and an easy way to fix this (beside adding the event to a thread and look if all event were canceled succefully/correctly)? thx in advance