|
8 | 8 | import net.minecraft.server.network.ServerPlayerEntity; |
9 | 9 | import net.minecraft.server.world.ServerWorld; |
10 | 10 | import net.minecraft.text.*; |
11 | | -import net.minecraft.util.Formatting; |
12 | 11 | import net.minecraft.util.math.*; |
13 | 12 | import net.set.spawn.mod.*; |
14 | 13 | import net.set.spawn.mod.interfaces.MinecraftServerExtended; |
@@ -73,12 +72,23 @@ private int setSpawn( |
73 | 72 | return originalResult; |
74 | 73 | } |
75 | 74 |
|
| 75 | + @Dynamic |
76 | 76 | @ModifyExpressionValue( |
77 | 77 | method = "moveToSpawn", |
78 | | - at = @At( |
79 | | - value = "INVOKE", |
80 | | - target = "Lnet/minecraft/server/network/SpawnLocating;findOverworldSpawn(Lnet/minecraft/server/world/ServerWorld;IIZ)Lnet/minecraft/util/math/BlockPos;" |
81 | | - ) |
| 78 | + at = { |
| 79 | + @At( |
| 80 | + value = "INVOKE", |
| 81 | + target = "Lnet/minecraft/server/network/SpawnLocating;findOverworldSpawn(Lnet/minecraft/server/world/ServerWorld;IIZ)Lnet/minecraft/util/math/BlockPos;" |
| 82 | + ), |
| 83 | + @At( |
| 84 | + value = "INVOKE", |
| 85 | + // Dimension#getTopSpawningBlockPosition |
| 86 | + target = "Lnet/minecraft/class_2869;method_12444(IIZ)Lnet/minecraft/class_2338;", |
| 87 | + remap = false |
| 88 | + ) |
| 89 | + }, |
| 90 | + require = 1, |
| 91 | + allow = 1 |
82 | 92 | ) |
83 | 93 | private BlockPos captureIfHasGrassBlock( |
84 | 94 | BlockPos blockPos, |
@@ -154,7 +164,8 @@ private void sendErrorMessage(CallbackInfo ci) { |
154 | 164 | @Inject(method = "method_14235(Lnet/minecraft/class_1703;)V", at = @At("TAIL"), require = 0, remap = false) |
155 | 165 | private void sendErrorMessage2(CallbackInfo ci) { |
156 | 166 | if (this.setSpawnError != null) { |
157 | | - this.sendMessage(new LiteralText(this.setSpawnError + " This run is not verifiable.").formatted(Formatting.RED), false); |
| 167 | + // sorry the code is bad. it is the only way. |
| 168 | + this.sendMessage(new LiteralText("§c" + this.setSpawnError + " This run is not verifiable."), false); |
158 | 169 | this.setSpawnError = null; |
159 | 170 | } |
160 | 171 | } |
|
0 commit comments