Hi all,
I've implemented a double door algorithm that opens neighbor doors based on facing, hinge sides etc. - simple stuff.
Currently, I'm using the RightClickBlock event to check if the player is opening a door. Code below:
@SubscribeEvent
public static void onRightClickBlock(PlayerInteractEvent.RightClickBlock event)
{
if(event.getSide() == LogicalSide.CLIENT)
return;
if(event.getWorld().getBlockState(event.getPos()).getBlock() instanceof DoorBlock)
{
// Logic to open adjacent doors...
}
}
However, the doors don't always open simultaneously - sometimes there's a small delay between opening the two doors, making the process look unclean.
Ideally, the doors should open exactly at the same time.
Is there a better approach, like a faster event I could listen to?
Thanks in advance!