Client should switch to block on the hotbar if it is the same as the new held block rather than duplicating it, fixes #58.

This commit is contained in:
UnknownShadow200 2015-09-06 17:57:25 +10:00
parent 6df70aa383
commit e43add1d32

View File

@ -73,6 +73,13 @@ namespace ClassicalSharp {
AddChat( "&e/client: &cThe server has forbidden you from changing your held block." ); AddChat( "&e/client: &cThe server has forbidden you from changing your held block." );
return; return;
} }
for( int i = 0; i < BlocksHotbar.Length; i++ ) {
if( BlocksHotbar[i] == value ) {
hotbarIndex = i;
RaiseHeldBlockChanged();
return;
}
}
BlocksHotbar[hotbarIndex] = value; BlocksHotbar[hotbarIndex] = value;
RaiseHeldBlockChanged(); RaiseHeldBlockChanged();
} }