1
0

Fix cmake not adding Werror on clang, and _lots_ of warnings (#4963)

* Fix cmake not adding Werror on clang, and _lots_ of warnings

* WIP: Build fixes

* Cannot make intermediate blockhandler instance

* Tiger's changes

* Fix BitIndex check

* Handle invalid NextState values in cMultiVersionProtocol

Co-authored-by: Tiger Wang <ziwei.tiger@outlook.com>
This commit is contained in:
peterbell10
2020-10-05 11:27:14 +01:00
committed by GitHub
parent 23021dd828
commit a9031b6bae
144 changed files with 886 additions and 862 deletions

View File

@@ -315,7 +315,9 @@ void cProtocol_1_13::HandlePacketSetBeaconEffect(cByteBuffer & a_ByteBuffer)
{
HANDLE_READ(a_ByteBuffer, ReadVarInt32, UInt32, Effect1);
HANDLE_READ(a_ByteBuffer, ReadVarInt32, UInt32, Effect2);
m_Client->HandleBeaconSelection(Effect1, Effect2);
m_Client->HandleBeaconSelection(
static_cast<int>(Effect1), static_cast<int>(Effect2)
);
}
@@ -655,7 +657,7 @@ bool cProtocol_1_13::ReadItem(cByteBuffer & a_ByteBuffer, cItem & a_Item, size_t
return true;
}
const auto Translated = GetItemFromProtocolID(ItemID);
const auto Translated = GetItemFromProtocolID(ToUnsigned(ItemID));
a_Item.m_ItemType = Translated.first;
a_Item.m_ItemDamage = Translated.second;
@@ -698,7 +700,7 @@ void cProtocol_1_13::WriteItem(cPacketizer & a_Pkt, const cItem & a_Item)
}
// Normal item
a_Pkt.WriteBEInt16(GetProtocolItemType(a_Item.m_ItemType, a_Item.m_ItemDamage));
a_Pkt.WriteBEInt16(static_cast<Int16>(GetProtocolItemType(a_Item.m_ItemType, a_Item.m_ItemDamage)));
a_Pkt.WriteBEInt8(a_Item.m_ItemCount);
// TODO: NBT