From 0401572b269d50499a0ae091b9acd474647c2c3e Mon Sep 17 00:00:00 2001 From: raven Date: Wed, 25 Mar 2026 10:37:41 -0500 Subject: custom block definitions --- server/server.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'server/server.go') diff --git a/server/server.go b/server/server.go index 5e3ffe9..00e7cef 100644 --- a/server/server.go +++ b/server/server.go @@ -23,12 +23,16 @@ var supportedExtensions = []string { "FullCP437", "CustomBlocks", "ExtPlayerList.2", + "BlockDefinitions", + "BlockDefinitionsExt.2", } var requiredExtensions = []string { "ExtEntityPositions", "EnvMapAspect.2", "CustomBlocks", "ExtPlayerList.2", + "BlockDefinitions", + "BlockDefinitionsExt.2", } type ServerInfo struct { @@ -543,14 +547,15 @@ func (cl *client) cpeHandshake(conn net.Conn, ext map[string]bool) bool { cl.disconnect("Missing required extension: " + req) } } - err = classic.WritePacket(conn, &classic.CustomBlocksSupportLevel { SupportLevel: 1, }) + // it doesn't matter what the client sends in response to this if cl.handleError(err) != nil { return false } - // it doesn't matter what the client sends in response to this + + cl.SendPackets(nil, getBlockDefPackets()) cl.extensions = ext return true -- cgit v1.2.3