cleanup, refactors, hopefully fix for all boundingbox issues

This commit is contained in:
2023-04-30 02:05:08 +02:00
parent 7229da78e2
commit c86519d7a3
14 changed files with 83 additions and 45 deletions
@@ -10,7 +10,6 @@ import org.bukkit.block.data.BlockData;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.util.BoundingBox;
import org.bukkit.util.StringUtil;
import org.jetbrains.annotations.NotNull;
@@ -52,12 +51,12 @@ public class SetCommand extends Command {
}
BlockData blockData = material.createBlockData();
BEPlayer bePlayer = BEPlayer.getByPlayer(player);
BoundingBox selection = bePlayer.getSelection();
Selection selection = bePlayer.getSelection();
if (selection == null) {
player.sendMessage(Component.text("You need to select 2 points to do this"));
return true;
}
BlockEditAPI.runOperation(new Selection(selection, bePlayer.getSelectionWorld()), 1, new SetOperation(blockData));
BlockEditAPI.runOperation(selection, 1, new SetOperation(blockData));
}
return true;
}