Expand InventoryOrder for 10 bit blocks

This commit is contained in:
UnknownShadow200 2018-03-09 09:06:29 +11:00
parent 8010538a05
commit e5d6b53832
2 changed files with 3 additions and 3 deletions

View File

@ -425,7 +425,7 @@ namespace MCGalaxy.Commands.CPE {
case "order": case "order":
int order = 0; 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; SendEditHelp(p, arg); return;
} }

View File

@ -353,10 +353,10 @@ namespace MCGalaxy.Network {
} }
public static byte[] SetInventoryOrder(BlockDefinition def, bool extBlocks) { 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; buffer[0] = Opcode.CpeSetInventoryOrder;
NetUtils.WriteBlock(def.BlockID, buffer, 1, extBlocks); 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; return buffer;
} }