mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 04:32:50 -04:00
Properly support air as a custom block
This commit is contained in:
parent
12496aa19f
commit
f657da8021
@ -293,7 +293,7 @@ namespace MCGalaxy
|
||||
//public const byte Door_Dirt_air = 226; // unused in core
|
||||
//public const byte Door_Grass_air = 227; // unused in core
|
||||
//public const byte Door_Blue_air = 228; // unused in core
|
||||
//public const byte Door_Bookshelf_air = 229;// unused in core
|
||||
//public const byte Door_Bookshelf_air = 229; // unused in core
|
||||
|
||||
public const byte Train = 230;
|
||||
|
||||
|
@ -120,8 +120,7 @@ namespace MCGalaxy {
|
||||
public static void LoadGlobal() {
|
||||
BlockDefinition[] oldDefs = GlobalDefs;
|
||||
GlobalDefs = Load(true, null);
|
||||
GlobalDefs[Block.Air] = DefaultSet.MakeCustomBlock(Block.Air);
|
||||
GlobalDefs[Block.Air].Name = "Air fallback";
|
||||
GlobalDefs[Block.Air] = null;
|
||||
|
||||
try {
|
||||
if (File.Exists(GlobalPath)) {
|
||||
@ -266,7 +265,7 @@ namespace MCGalaxy {
|
||||
|
||||
internal static void SendLevelCustomBlocks(Player pl) {
|
||||
BlockDefinition[] defs = pl.level.CustomBlockDefs;
|
||||
for (int i = 1; i < defs.Length; i++) {
|
||||
for (int i = 0; i < defs.Length; i++) {
|
||||
BlockDefinition def = defs[i];
|
||||
if (def != null) pl.Send(def.MakeDefinePacket(pl));
|
||||
}
|
||||
@ -274,7 +273,7 @@ namespace MCGalaxy {
|
||||
|
||||
internal static void SendLevelInventoryOrder(Player pl) {
|
||||
BlockDefinition[] defs = pl.level.CustomBlockDefs;
|
||||
for (int i = 1; i < defs.Length; i++) {
|
||||
for (int i = 0; i < defs.Length; i++) {
|
||||
BlockDefinition def = defs[i];
|
||||
if (def != null && def.InventoryOrder >= 0) {
|
||||
pl.Send(Packet.SetInventoryOrder((byte)i, (byte)def.InventoryOrder));
|
||||
|
@ -167,7 +167,7 @@ namespace MCGalaxy.Commands.CPE {
|
||||
BlockDefinition[] defs = global ? BlockDefinition.GlobalDefs : p.level.CustomBlockDefs;
|
||||
List<BlockDefinition> defsInScope = new List<BlockDefinition>();
|
||||
|
||||
for (int i = 1; i < Block.Count; i++) {
|
||||
for (int i = 0; i < Block.Count; i++) {
|
||||
BlockDefinition def = defs[i];
|
||||
ExtBlock block = ExtBlock.FromRaw((byte)i);
|
||||
|
||||
|
@ -236,7 +236,7 @@ namespace MCGalaxy {
|
||||
|
||||
void RemoveOldLevelCustomBlocks(Level oldLevel) {
|
||||
BlockDefinition[] defs = oldLevel.CustomBlockDefs;
|
||||
for (int i = 1; i < defs.Length; i++) {
|
||||
for (int i = 0; i < defs.Length; i++) {
|
||||
BlockDefinition def = defs[i];
|
||||
if (def == BlockDefinition.GlobalDefs[i]) continue;
|
||||
Send(Packet.UndefineBlock((byte)i));
|
||||
|
Loading…
x
Reference in New Issue
Block a user