From 9c5a3fa33849b15d2a898f18cb49fa2e6e06aed0 Mon Sep 17 00:00:00 2001 From: Anshuman Mishra Date: Tue, 21 Apr 2026 10:56:12 +0530 Subject: [PATCH 1/3] Update block_registry.go --- server/world/block_registry.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/world/block_registry.go b/server/world/block_registry.go index 0ae81844bc..7c52cb018a 100644 --- a/server/world/block_registry.go +++ b/server/world/block_registry.go @@ -183,7 +183,7 @@ func (br *BlockRegistryImpl) RegisterBlockState(s BlockState) { } h := stateHash{name: s.Name, properties: hashProperties(s.Properties)} if _, ok := br.stateRuntimeIDs[h]; ok { - panic(fmt.Sprintf("cannot register the same state twice (%+v)", s)) + return } if _, ok := br.blockProperties[s.Name]; !ok { br.blockProperties[s.Name] = s.Properties @@ -229,7 +229,7 @@ func (br *BlockRegistryImpl) Finalize() { br.airRID = rid } if _, ok := br.stateRuntimeIDs[h]; ok { - panic(fmt.Sprintf("cannot register the same state twice (%s %+v)", name, properties)) + return } br.stateRuntimeIDs[h] = rid From 47ae154878ef9732db26b191ef99c5e571e2c76e Mon Sep 17 00:00:00 2001 From: Anshuman Mishra Date: Tue, 21 Apr 2026 10:57:42 +0530 Subject: [PATCH 2/3] Update block_registry.go --- server/world/block_registry.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/world/block_registry.go b/server/world/block_registry.go index 7c52cb018a..05f6d6ed0c 100644 --- a/server/world/block_registry.go +++ b/server/world/block_registry.go @@ -183,7 +183,7 @@ func (br *BlockRegistryImpl) RegisterBlockState(s BlockState) { } h := stateHash{name: s.Name, properties: hashProperties(s.Properties)} if _, ok := br.stateRuntimeIDs[h]; ok { - return + continue } if _, ok := br.blockProperties[s.Name]; !ok { br.blockProperties[s.Name] = s.Properties From 17e5d1e2a1f7b974033f2034610af2b8568aa469 Mon Sep 17 00:00:00 2001 From: Anshuman Mishra Date: Tue, 12 May 2026 20:58:36 +0530 Subject: [PATCH 3/3] Update block_registry.go --- server/world/block_registry.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/world/block_registry.go b/server/world/block_registry.go index 05f6d6ed0c..cfbcb838d8 100644 --- a/server/world/block_registry.go +++ b/server/world/block_registry.go @@ -175,15 +175,16 @@ func (br *BlockRegistryImpl) RegisterBlock(b Block) { } } -// RegisterBlockState registers a blockStates to the states slice. The function panics if the properties the -// blockState hold are invalid or if the blockState was already registered. +// RegisterBlockState registers a block state in the registry. +// Duplicate states are ignored so malformed custom block entries from a remote server +// do not crash the proxy during login. func (br *BlockRegistryImpl) RegisterBlockState(s BlockState) { if br.finalized { panic("BlockRegistry.RegisterBlockState called on finalized BlockRegistry") } h := stateHash{name: s.Name, properties: hashProperties(s.Properties)} if _, ok := br.stateRuntimeIDs[h]; ok { - continue + return } if _, ok := br.blockProperties[s.Name]; !ok { br.blockProperties[s.Name] = s.Properties @@ -229,7 +230,7 @@ func (br *BlockRegistryImpl) Finalize() { br.airRID = rid } if _, ok := br.stateRuntimeIDs[h]; ok { - return + continue } br.stateRuntimeIDs[h] = rid