|
4 | 4 | import dev.xpple.betterconfig.api.BetterConfigAPI; |
5 | 5 | import dev.xpple.betterconfig.api.Config; |
6 | 6 | import dev.xpple.betterconfig.api.ModConfig; |
| 7 | +import com.github.cubiomes.Cubiomes; |
7 | 8 | import dev.xpple.seedmapper.SeedMapper; |
8 | 9 | import dev.xpple.seedmapper.command.arguments.SeedResolutionArgument; |
9 | 10 | import dev.xpple.seedmapper.render.RenderManager; |
@@ -151,6 +152,51 @@ private static void setWorldBorder(int worldBorder) { |
151 | 152 | WorldBorder = Math.max(0, worldBorder); |
152 | 153 | } |
153 | 154 |
|
| 155 | + @Config(comment = "getWorldBorderOverworldComment", setter = @Config.Setter("setWorldBorderOverworld")) |
| 156 | + public static int WorldBorderOverworld = 0; |
| 157 | + |
| 158 | + private static Component getWorldBorderOverworldComment() { |
| 159 | + return Component.translatable("config.worldBorder.overworld.comment"); |
| 160 | + } |
| 161 | + |
| 162 | + private static void setWorldBorderOverworld(int worldBorder) { |
| 163 | + WorldBorderOverworld = Math.max(0, worldBorder); |
| 164 | + } |
| 165 | + |
| 166 | + @Config(comment = "getWorldBorderNetherComment", setter = @Config.Setter("setWorldBorderNether")) |
| 167 | + public static int WorldBorderNether = 0; |
| 168 | + |
| 169 | + private static Component getWorldBorderNetherComment() { |
| 170 | + return Component.translatable("config.worldBorder.nether.comment"); |
| 171 | + } |
| 172 | + |
| 173 | + private static void setWorldBorderNether(int worldBorder) { |
| 174 | + WorldBorderNether = Math.max(0, worldBorder); |
| 175 | + } |
| 176 | + |
| 177 | + @Config(comment = "getWorldBorderEndComment", setter = @Config.Setter("setWorldBorderEnd")) |
| 178 | + public static int WorldBorderEnd = 0; |
| 179 | + |
| 180 | + private static Component getWorldBorderEndComment() { |
| 181 | + return Component.translatable("config.worldBorder.end.comment"); |
| 182 | + } |
| 183 | + |
| 184 | + private static void setWorldBorderEnd(int worldBorder) { |
| 185 | + WorldBorderEnd = Math.max(0, worldBorder); |
| 186 | + } |
| 187 | + |
| 188 | + public static int getWorldBorderForDimension(int dimension) { |
| 189 | + int globalDimension = 0; |
| 190 | + if (dimension == Cubiomes.DIM_OVERWORLD()) { |
| 191 | + globalDimension = WorldBorderOverworld; |
| 192 | + } else if (dimension == Cubiomes.DIM_NETHER()) { |
| 193 | + globalDimension = WorldBorderNether; |
| 194 | + } else if (dimension == Cubiomes.DIM_END()) { |
| 195 | + globalDimension = WorldBorderEnd; |
| 196 | + } |
| 197 | + return globalDimension > 0 ? globalDimension : WorldBorder; |
| 198 | + } |
| 199 | + |
154 | 200 | private static double clampSeedMapZoom(double pixelsPerBiome) { |
155 | 201 | double min = Math.max(SeedMapScreen.MIN_PIXELS_PER_BIOME, SeedMapMinPixelsPerBiome); |
156 | 202 | return Math.clamp(pixelsPerBiome, min, SeedMapScreen.MAX_PIXELS_PER_BIOME); |
|
0 commit comments