diff --git a/src/main/java/io/github/addoncommunity/galactifun/api/universe/attributes/atmosphere/Gas.java b/src/main/java/io/github/addoncommunity/galactifun/api/universe/attributes/atmosphere/Gas.java index 32d971a3..e1b5ecb1 100644 --- a/src/main/java/io/github/addoncommunity/galactifun/api/universe/attributes/atmosphere/Gas.java +++ b/src/main/java/io/github/addoncommunity/galactifun/api/universe/attributes/atmosphere/Gas.java @@ -47,6 +47,9 @@ public enum Gas { if (SlimefunItems.FREEZER_2.getItem() instanceof Freezer freezer) { freezer.registerRecipe(10, NITROGEN.item(), SlimefunItems.REACTOR_COOLANT_CELL.asQuantity(4)); } + if (SlimefunItems.FREEZER_3.getItem() instanceof Freezer freezer) { + freezer.registerRecipe(7, NITROGEN.item(), SlimefunItems.REACTOR_COOLANT_CELL.asQuantity(4)); + } if (SlimefunItems.COMBUSTION_REACTOR.getItem() instanceof CombustionGenerator generator) { generator.registerFuel(new MachineFuel(15, HYDROGEN.item())); diff --git a/src/main/java/io/github/addoncommunity/galactifun/core/commands/SealedCommand.java b/src/main/java/io/github/addoncommunity/galactifun/core/commands/SealedCommand.java index 0114746a..8a87976c 100644 --- a/src/main/java/io/github/addoncommunity/galactifun/core/commands/SealedCommand.java +++ b/src/main/java/io/github/addoncommunity/galactifun/core/commands/SealedCommand.java @@ -6,6 +6,9 @@ import javax.annotation.Nonnull; +import io.github.addoncommunity.galactifun.Galactifun; + +import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -22,10 +25,28 @@ public SealedCommand() { @Override public void execute(@Nonnull CommandSender commandSender, @Nonnull String[] strings) { if (!(commandSender instanceof Player p)) return; - if (strings.length != 1) return; + if (strings.length != 1) { + p.sendMessage(ChatColor.RED + "Usage: /galactifun sealed "); + return; + } + + int range; + + try { + range = Integer.parseInt(strings[0]); + } catch (NumberFormatException e) { + p.sendMessage(ChatColor.RED + "Range must be an integer between 1 and " + Galactifun.instance().getConfig().getInt("other.sealed-command-max-range")); + return; + } + + if (range < 1 || range > Galactifun.instance().getConfig().getInt("other.sealed-command-max-range")) { + p.sendMessage(ChatColor.RED + "Range must be an integer between 1 and " + Galactifun.instance().getConfig().getInt("other.sealed-command-max-range")); + return; + } double time = System.nanoTime(); - Optional> filled = Util.floodFill(p.getLocation(), Integer.parseInt(strings[0])); + Optional> filled = Util.floodFill(p.getLocation(), range); + if (filled.isPresent()) { p.sendMessage("Sealed"); } else { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 8a0d2504..a5a16b81 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -37,8 +37,10 @@ rockets: - Not going home other: + # The range that the automatic door checks for players auto-door-range: 2 + # Blocks prohibited to be used by the automatic door auto-door-banned-types: - BEDROCK @@ -47,3 +49,7 @@ other: - COMMAND_BLOCK - END_PORTAL - STRUCTURE_BLOCK + + # Max range for sealed command. High values may impact performance, low values may miss sealed areas. + # More info: https://github.com/Slimefun-Addon-Community/Galactifun/wiki/Sealing#Range + sealed-command-max-range: 300000