From e43add1d320a66f38870c886d13ac9f43867cff9 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 6 Sep 2015 17:57:25 +1000 Subject: [PATCH] Client should switch to block on the hotbar if it is the same as the new held block rather than duplicating it, fixes #58. --- ClassicalSharp/Game/Game.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ClassicalSharp/Game/Game.cs b/ClassicalSharp/Game/Game.cs index d82707b28..ff86d6945 100644 --- a/ClassicalSharp/Game/Game.cs +++ b/ClassicalSharp/Game/Game.cs @@ -73,6 +73,13 @@ namespace ClassicalSharp { AddChat( "&e/client: &cThe server has forbidden you from changing your held block." ); return; } + for( int i = 0; i < BlocksHotbar.Length; i++ ) { + if( BlocksHotbar[i] == value ) { + hotbarIndex = i; + RaiseHeldBlockChanged(); + return; + } + } BlocksHotbar[hotbarIndex] = value; RaiseHeldBlockChanged(); }