Skip to content

Commit 845d2cc

Browse files
authored
Feature: Allow all server addresses (#320)
1 parent 61227a7 commit 845d2cc

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright 2026 Lambda
3+
*
4+
* This program is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
package com.lambda.mixin.network;
19+
20+
import net.minecraft.client.network.Address;
21+
import net.minecraft.client.network.BlockListChecker;
22+
import net.minecraft.client.network.ServerAddress;
23+
import org.spongepowered.asm.mixin.Mixin;
24+
import org.spongepowered.asm.mixin.injection.At;
25+
import org.spongepowered.asm.mixin.injection.Inject;
26+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
27+
28+
@Mixin(BlockListChecker.class)
29+
public interface BlockListCheckerMixin {
30+
@Inject(method = "create", at = @At("HEAD"), cancellable = true)
31+
private static void onCreate(CallbackInfoReturnable<BlockListChecker> cir) {
32+
cir.setReturnValue(new BlockListChecker() {
33+
@Override
34+
public boolean isAllowed(Address address) {
35+
return true;
36+
}
37+
38+
@Override
39+
public boolean isAllowed(ServerAddress address) {
40+
return true;
41+
}
42+
});
43+
}
44+
}

src/main/resources/lambda.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"input.MouseMixin",
2323
"items.BlockItemMixin",
2424
"items.FilledMapItemMixin",
25+
"network.BlockListCheckerMixin",
2526
"network.ClientCommonNetworkHandlerMixin",
2627
"network.ClientConnectionMixin",
2728
"network.ClientLoginNetworkMixin",

0 commit comments

Comments
 (0)