Skip to content

Commit

Permalink
Merge pull request #161 from IvanMishin1/staging
Browse files Browse the repository at this point in the history
  • Loading branch information
Seggan authored Jul 10, 2024
2 parents c598c22 + c665454 commit 55169ef
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 <range>");
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<Set<BlockPosition>> filled = Util.floodFill(p.getLocation(), Integer.parseInt(strings[0]));
Optional<Set<BlockPosition>> filled = Util.floodFill(p.getLocation(), range);

if (filled.isPresent()) {
p.sendMessage("Sealed");
} else {
Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 55169ef

Please sign in to comment.