mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-06 16:37:38 +01:00
Fix TagsPacket
This commit is contained in:
parent
9dffc7658c
commit
f3f854feaa
@ -37,8 +37,6 @@ import net.minestom.server.event.item.PickupExperienceEvent;
|
|||||||
import net.minestom.server.event.player.*;
|
import net.minestom.server.event.player.*;
|
||||||
import net.minestom.server.instance.Chunk;
|
import net.minestom.server.instance.Chunk;
|
||||||
import net.minestom.server.instance.Instance;
|
import net.minestom.server.instance.Instance;
|
||||||
import net.minestom.server.message.ChatMessageType;
|
|
||||||
import net.minestom.server.message.ChatPosition;
|
|
||||||
import net.minestom.server.inventory.Inventory;
|
import net.minestom.server.inventory.Inventory;
|
||||||
import net.minestom.server.inventory.PlayerInventory;
|
import net.minestom.server.inventory.PlayerInventory;
|
||||||
import net.minestom.server.item.ItemStack;
|
import net.minestom.server.item.ItemStack;
|
||||||
@ -293,7 +291,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
|||||||
|
|
||||||
// Tags
|
// Tags
|
||||||
// FIXME
|
// FIXME
|
||||||
//this.playerConnection.sendPacket(TagsPacket.getRequiredTagsPacket());
|
this.playerConnection.sendPacket(TagsPacket.getRequiredTagsPacket());
|
||||||
|
|
||||||
// Some client update
|
// Some client update
|
||||||
this.playerConnection.sendPacket(getPropertiesPacket()); // Send default properties
|
this.playerConnection.sendPacket(getPropertiesPacket()); // Send default properties
|
||||||
|
@ -53,9 +53,10 @@ public class TagsPacket implements ServerPacket {
|
|||||||
writer.writeVarInt(values.size());
|
writer.writeVarInt(values.size());
|
||||||
// entries
|
// entries
|
||||||
for (NamespaceID name : values) {
|
for (NamespaceID name : values) {
|
||||||
Block b = Registries.getBlock(name);
|
Block b = Block.fromNamespaceId(name);
|
||||||
if (b == Block.AIR && !name.toString().equals("minecraft:air")) {
|
if (b == null) {
|
||||||
writer.writeVarInt(-1);
|
writer.writeVarInt(-1);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
writer.writeVarInt(b.getId());
|
writer.writeVarInt(b.getId());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user