Skip to content

Instantly share code, notes, and snippets.

//Check for RedProtect
Plugin rp = getServer().getPluginManager().getPlugin("RedProtect");
if (rp instanceof RedProtect){
getLogger().info(I18nSupport.getInternationalisedString("Startup - RedProtect detected"));
redProtectPlugin = (RedProtect) rp;
foundRegionProvider = true;
redProtectPlugin.getAPI().addFlag("structurebox", false, true);
getServer().getPluginManager().registerEvent(
BlockPlaceEvent.class,
new br.net.fabiozumbi12.RedProtect.Bukkit.listeners.BlockListener(),
[21:16:15 INFO]: [RedProtect] Enabling RedProtect v7.7.2
[21:16:15 INFO]: [RedProtect] Server version: 1.15.2-R0.1-SNAPSHOT
[21:16:15 INFO]: [RedProtect] All configurations loaded!
[21:16:15 INFO]: [RedProtect] Language file loaded - Using: NO-NO
[21:16:15 INFO]: [RedProtect] Registering commands...
[21:16:15 INFO]: [RedProtect] Registering listeners...
[21:16:15 INFO]: [RedProtect] Essentials found. Hooked.
[21:16:15 INFO]: [RedProtect] WorldEdit found. Hooked.
[21:16:15 INFO]: [RedProtect] WorldGuard version 6 found. Hooked.
[21:16:15 INFO]: [RedProtect] Factions found. Hooked.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>NationCraftGUI</artifactId>
<groupId>io.github.eirikh1996</groupId>
<version>parent</version>
</parent>
<modelVersion>4.0.0</modelVersion>
public CommandResult execute(CommandSource src, CommandContext args) throws CommandException {
if (!(src instanceof Player)) {
src.sendMessage(Text.of(COMMAND_PREFIX + I18nSupport.getInternationalisedString("Command - Must be player")));
return CommandResult.empty();
}
String arg = args.<String>getOne(Text.of()).get();
final Player player = (Player) src;
@NotNull final WorldEditHandler weHandler = StructureBoxes.getInstance().getWorldEditHandler();
@Nullable Clipboard clipboard = weHandler.loadClipboardFromSchematic(StructureBoxes.getInstance().getWorldEditPlugin().getWorld(player.getLocation().getExtent()), arg);
if (clipboard == null) {