Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
fix #6
Browse files Browse the repository at this point in the history
  • Loading branch information
dskprt committed Apr 2, 2021
1 parent 42a83f9 commit be70066
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions nylium.Core/Tags/Tag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static void Initialize() {
}
}

blockTags.Add(new Tag(new Identifier("minecraft", name), ids));
blockTags.Add(new Tag(new Identifier(name), ids));
break;
case "items":
ids = new int[tag.Value.values.Length];
Expand All @@ -66,20 +66,30 @@ public static void Initialize() {
}
}

itemTags.Add(new Tag(new Identifier("minecraft", name), ids));
itemTags.Add(new Tag(new Identifier(name), ids));
break;
case "fluids":
ids = new int[tag.Value.values.Length];

for(int i = 0; i < tag.Value.values.Length; i++) {
int id = Blocks.Block.GetBlockProtocolId((string) tag.Value.values[i]);

if(id != -1) {
ids[i] = id;
int id = 0;
string namedId = tag.Value.values[i];

// dumped from the vanilla server
if(namedId == "minecraft:flowing_water") {
id = 1;
} else if(namedId == "minecraft:flowing_lava") {
id = 3;
} else if(namedId == "minecraft:water") {
id = 2;
} else if(namedId == "minecraft:lava") {
id = 4;
}

ids[i] = id;
}

fluidTags.Add(new Tag(new Identifier("minecraft", name), ids));
fluidTags.Add(new Tag(new Identifier(name), ids));
break;
case "entity_types":
ids = new int[tag.Value.values.Length];
Expand All @@ -92,7 +102,7 @@ public static void Initialize() {
}
}

entityTags.Add(new Tag(new Identifier("minecraft", name), ids));
entityTags.Add(new Tag(new Identifier(name), ids));
break;
}
}
Expand Down

0 comments on commit be70066

Please sign in to comment.