From e5d6b53832fabf0481f3f1f666f657393ea023c7 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 9 Mar 2018 09:06:29 +1100 Subject: [PATCH] Expand InventoryOrder for 10 bit blocks --- MCGalaxy/Commands/CPE/CustomBlockCommand.cs | 2 +- MCGalaxy/Network/Packets/Packet.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MCGalaxy/Commands/CPE/CustomBlockCommand.cs b/MCGalaxy/Commands/CPE/CustomBlockCommand.cs index 512eaa146..c0b727aeb 100644 --- a/MCGalaxy/Commands/CPE/CustomBlockCommand.cs +++ b/MCGalaxy/Commands/CPE/CustomBlockCommand.cs @@ -425,7 +425,7 @@ namespace MCGalaxy.Commands.CPE { case "order": int order = 0; - if (!CommandParser.GetInt(p, value, "Inventory order", ref order, 1, 255)) { + if (!CommandParser.GetInt(p, value, "Inventory order", ref order, 1, Block.MaxRaw)) { SendEditHelp(p, arg); return; } diff --git a/MCGalaxy/Network/Packets/Packet.cs b/MCGalaxy/Network/Packets/Packet.cs index e7fbab74b..54e6a68a0 100644 --- a/MCGalaxy/Network/Packets/Packet.cs +++ b/MCGalaxy/Network/Packets/Packet.cs @@ -353,10 +353,10 @@ namespace MCGalaxy.Network { } public static byte[] SetInventoryOrder(BlockDefinition def, bool extBlocks) { - byte[] buffer = new byte[extBlocks ? 4 : 3]; + byte[] buffer = new byte[extBlocks ? 5 : 3]; buffer[0] = Opcode.CpeSetInventoryOrder; NetUtils.WriteBlock(def.BlockID, buffer, 1, extBlocks); - buffer[extBlocks ? 3 : 2] = (byte)def.InventoryOrder; + NetUtils.WriteBlock((BlockID)def.InventoryOrder, buffer, extBlocks ? 3 : 2, extBlocks); return buffer; }