Add Darthfish command.

This commit is contained in:
Business Goose 2022-05-04 18:09:42 +01:00
parent 84edae26f5
commit ba4e122c5a
No known key found for this signature in database
GPG Key ID: 77DCA801362E9645
1 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,47 @@
package dev.plex.command.impl;
import com.google.common.base.Splitter;
import dev.plex.command.PlexCommand;
import dev.plex.command.annotation.CommandParameters;
import dev.plex.command.annotation.CommandPermissions;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.rank.enums.Rank;
import dev.plex.util.PlexUtils;
import java.util.ArrayList;
import java.util.List;
import net.kyori.adventure.inventory.Book;
import net.kyori.adventure.text.Component;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@CommandParameters(name = "totalfreedommod", usage = "/<command> [reload]", description = "Shows information about TotalFreedomMod or reloads it", aliases = "tfm")
@CommandPermissions(level = Rank.OP, permission = "plex.tfm", source = RequiredCommandSource.ANY)
public class TFMCMD extends PlexCommand
{
@Override
protected Component execute(@NotNull CommandSender sender, @Nullable Player playerSender, @NotNull String[] args)
{
if (playerSender != null)
{
String simpy = "It's not about credit or discredit, it's about copyright of TFM. Looking at Plex's source code, it looks like a bunch of copy-pasted source code from TFM and Aero (utility plugin). You just put it under a different license and pretended it's yours. You can't simpy do that. You have to remove all parts which infringe on the TFM license (as per the TFM repository) and the Aero License (as per the Aero repository) or otherwise comply to the license requirements.";
List<String> pages = Splitter.fixedLength(256).splitToList(simpy);
List<Component> pageComponents = new ArrayList<>();
for (String page : pages)
{
pageComponents.add(PlexUtils.mmDeserialize("<rainbow>" + page + "</rainbow>"));
}
playerSender.openBook(Book.builder()
.title(Component.text("TFM License"))
.author(Component.text("Prozza"))
.pages(pageComponents));
}
return PlexUtils.mmDeserialize("<rainbow>It's not about credit or discredit, it's about copyright of TFM.<br>Looking at Plex's source code, it looks like a bunch of copy-pasted source code from TFM and Aero (utility plugin). You just put it under a different license and pretended it's yours.<br>You can't simpy do that. You have to remove all parts which infringe on the TFM license (as per the TFM repository) and the Aero License (as per the Aero repository) or otherwise comply to the license requirements.</rainbow>");
}
}