Fix breaking custom blocks causing error from recent commits

also reduce skeleton size a little bit
This commit is contained in:
UnknownShadow200 2018-02-06 23:17:25 +11:00
parent 5e77df62b3
commit 9707aac835
2 changed files with 6 additions and 4 deletions

View File

@ -21,6 +21,7 @@ using System.IO;
using MCGalaxy.Blocks; using MCGalaxy.Blocks;
using MCGalaxy.Commands; using MCGalaxy.Commands;
using MCGalaxy.Events.GroupEvents; using MCGalaxy.Events.GroupEvents;
using BlockID = System.UInt16;
namespace MCGalaxy { namespace MCGalaxy {
/// <summary> This is the group object, where ranks and their data are stored </summary> /// <summary> This is the group object, where ranks and their data are stored </summary>
@ -54,7 +55,7 @@ namespace MCGalaxy {
public PlayerList Players; public PlayerList Players;
public List<Command> Commands; public List<Command> Commands;
public bool[] Blocks = new bool[256]; public bool[] Blocks = new bool[Block.ExtendedCount];
public Group() { } public Group() { }
private Group(LevelPermission perm, int maxB, int maxUn, string name, char colCode) { private Group(LevelPermission perm, int maxB, int maxUn, string name, char colCode) {
@ -73,8 +74,9 @@ namespace MCGalaxy {
} }
public void SetUsableBlocks() { public void SetUsableBlocks() {
for (int i = 0; i < Blocks.Length; i++) for (int i = 0; i < Blocks.Length; i++) {
Blocks[i] = BlockPerms.UsableBy(Permission, (byte)i); Blocks[i] = BlockPerms.UsableBy(Permission, (BlockID)i);
}
} }
public bool CanExecute(Command cmd) { return Commands.Contains(cmd); } public bool CanExecute(Command cmd) { return Commands.Contains(cmd); }

View File

@ -140,7 +140,7 @@ namespace MCGalaxy.Maths {
if (model.CaselessEq("head")) return new Vec3S32(31, 31, 31); if (model.CaselessEq("head")) return new Vec3S32(31, 31, 31);
if (model.CaselessEq("pig")) return new Vec3S32(28, 28, 28); if (model.CaselessEq("pig")) return new Vec3S32(28, 28, 28);
if (model.CaselessEq("sheep")) return new Vec3S32(20, 40, 20); if (model.CaselessEq("sheep")) return new Vec3S32(20, 40, 20);
if (model.CaselessEq("skeleton")) return new Vec3S32(16, 60, 16); if (model.CaselessEq("skeleton")) return new Vec3S32(16, 56, 16);
if (model.CaselessEq("spider")) return new Vec3S32(30, 24, 30); if (model.CaselessEq("spider")) return new Vec3S32(30, 24, 30);
return new Vec3S32(18, 56, 18); // default humanoid size return new Vec3S32(18, 56, 18); // default humanoid size