Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freezer III fix and sealed command update #161

Merged
merged 8 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading