Skip to content

2.0.0 - Multi-platform support (fabric / spigot probably) #17

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
61 changes: 61 additions & 0 deletions autotreechop-spigot/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
plugins {
id 'java-library'
id 'com.gradleup.shadow'
id 'xyz.jpenilla.run-paper'
}

dependencies {
// Depend on the core module
implementation project(':core')

// Spigot-specific dependencies
compileOnly "io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT"
compileOnly "org.spigotmc:spigot-api:1.20-R0.1-SNAPSHOT"
implementation "com.jeff_media:SpigotUpdateChecker:3.0.4"
compileOnly 'me.clip:placeholderapi:2.11.5'
implementation "de.cubbossa:TinyTranslations-bukkit:4.5.0"
compileOnly files("${rootProject.projectDir}/libs/Residence5.1.4.3.jar")
compileOnly "com.github.angeschossen:LandsAPI:6.44.0"
compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.9'
compileOnly "com.github.GriefPrevention:GriefPrevention:16.18.4"
}

processResources {
def props = [version: version]
inputs.properties props
filteringCharset 'UTF-8'
filesMatching('plugin.yml') {
expand props
}
}

shadowJar {
archiveBaseName.set('AutoTreeChop-Spigot')
archiveClassifier.set('')
configurations = [project.configurations.runtimeClasspath]
minimize()

relocate 'com.jeff_media.updatechecker', 'org.milkteamc.autotreechop.libs.updatechecker'
relocate 'de.cubbossa.tinytranslations', 'org.milkteamc.autotreechop.libs.tinytranslations'
relocate 'com.zaxxer.hikari', 'org.milkteamc.autotreechop.libs.hikari'

// Add the license file to the JAR
from("${rootProject.projectDir}/LICENSE") {
into 'META-INF'
}
}

jar {
archiveBaseName.set('AutoTreeChop-Spigot')
archiveClassifier.set('original')
}

tasks.build {
dependsOn("shadowJar")
}

runPaper {
minecraftVersion("1.21.4")
}

runPaper.folia.registerTask()
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.milkteamc.autotreechop;
package org.milkteamc.autotreechop.spigot;

import com.jeff_media.updatechecker.UpdateCheckSource;
import com.jeff_media.updatechecker.UpdateChecker;
Expand All @@ -20,14 +20,16 @@
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.milkteamc.autotreechop.hooks.GriefPreventionHook;
import org.milkteamc.autotreechop.hooks.LandsHook;
import org.milkteamc.autotreechop.hooks.ResidenceHook;
import org.milkteamc.autotreechop.hooks.WorldGuardHook;
import org.milkteamc.autotreechop.utils.CooldownManager;
import org.milkteamc.autotreechop.utils.EffectUtils;
import org.milkteamc.autotreechop.utils.PermissionUtils;
import org.milkteamc.autotreechop.utils.TreeChopUtils;
import org.milkteamc.autotreechop.spigot.hooks.GriefPreventionHook;
import org.milkteamc.autotreechop.spigot.hooks.LandsHook;
import org.milkteamc.autotreechop.spigot.hooks.ResidenceHook;
import org.milkteamc.autotreechop.spigot.hooks.WorldGuardHook;
import org.milkteamc.autotreechop.spigot.command.Command;
import org.milkteamc.autotreechop.spigot.command.TabCompleter;
import org.milkteamc.autotreechop.spigot.utils.CooldownManager;
import org.milkteamc.autotreechop.spigot.utils.EffectUtils;
import org.milkteamc.autotreechop.spigot.utils.PermissionUtils;
import org.milkteamc.autotreechop.spigot.utils.TreeChopUtils;

import java.io.File;
import java.util.*;
Expand Down Expand Up @@ -129,11 +131,11 @@ public void onEnable() {
getServer().getPluginManager().registerEvents(this, this);

// Register command and tab completer
org.milkteamc.autotreechop.command.Command command = new org.milkteamc.autotreechop.command.Command(this);
Command command = new Command(this);
getCommand("autotreechop").setExecutor(command);
getCommand("atc").setExecutor(command);
getCommand("autotreechop").setTabCompleter(new org.milkteamc.autotreechop.command.TabCompleter());
getCommand("atc").setTabCompleter(new org.milkteamc.autotreechop.command.TabCompleter());
getCommand("autotreechop").setTabCompleter(new TabCompleter());
getCommand("atc").setTabCompleter(new TabCompleter());

translations = BukkitTinyTranslations.application(this);
translations.setMessageStorage(new PropertiesMessageStorage(new File(getDataFolder(), "/lang/")));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.milkteamc.autotreechop;
package org.milkteamc.autotreechop.spigot;

import org.bukkit.entity.Player;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.milkteamc.autotreechop;
package org.milkteamc.autotreechop.spigot;

import me.clip.placeholderapi.expansion.PlaceholderExpansion;
import org.bukkit.entity.Player;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.milkteamc.autotreechop;
package org.milkteamc.autotreechop.spigot;

import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
* Violations will result in a ban of your plugin and account from bStats.
*/
package org.milkteamc.autotreechop;
package org.milkteamc.autotreechop.spigot;

import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.milkteamc.autotreechop;
package org.milkteamc.autotreechop.spigot;

import com.zaxxer.hikari.HikariConfig;
import com.zaxxer.hikari.HikariDataSource;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package org.milkteamc.autotreechop.command;
package org.milkteamc.autotreechop.spigot.command;

import de.cubbossa.tinytranslations.BukkitTinyTranslations;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.milkteamc.autotreechop.AutoTreeChop;
import org.milkteamc.autotreechop.Config;
import org.milkteamc.autotreechop.PlayerConfig;
import org.milkteamc.autotreechop.spigot.AutoTreeChop;
import org.milkteamc.autotreechop.spigot.Config;
import org.milkteamc.autotreechop.spigot.PlayerConfig;

import java.util.UUID;

import static org.milkteamc.autotreechop.AutoTreeChop.*;
import static org.milkteamc.autotreechop.spigot.AutoTreeChop.*;

public class Command implements CommandExecutor {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// TabCompleter Class
package org.milkteamc.autotreechop.command;
package org.milkteamc.autotreechop.spigot.command;

import org.bukkit.Bukkit;
import org.bukkit.command.Command;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.milkteamc.autotreechop.hooks;
package org.milkteamc.autotreechop.spigot.hooks;

import me.ryanhamshire.GriefPrevention.Claim;
import me.ryanhamshire.GriefPrevention.ClaimPermission;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.milkteamc.autotreechop.hooks;
package org.milkteamc.autotreechop.spigot.hooks;

import me.angeschossen.lands.api.LandsIntegration;
import me.angeschossen.lands.api.land.LandWorld;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.milkteamc.autotreechop.hooks;
package org.milkteamc.autotreechop.spigot.hooks;

import com.bekvon.bukkit.residence.api.ResidenceApi;
import com.bekvon.bukkit.residence.containers.Flags;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.milkteamc.autotreechop.hooks;
package org.milkteamc.autotreechop.spigot.hooks;

import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldguard.LocalPlayer;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.milkteamc.autotreechop.utils;
package org.milkteamc.autotreechop.spigot.utils;

import org.bukkit.entity.Player;
import org.milkteamc.autotreechop.AutoTreeChop;
import org.milkteamc.autotreechop.Config;
import org.milkteamc.autotreechop.spigot.AutoTreeChop;
import org.milkteamc.autotreechop.spigot.Config;

import java.util.HashMap;
import java.util.UUID;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.milkteamc.autotreechop.utils;
package org.milkteamc.autotreechop.spigot.utils;

import de.cubbossa.tinytranslations.Message;
import org.bukkit.Color;
import org.bukkit.Particle;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;

import static org.milkteamc.autotreechop.AutoTreeChop.sendMessage;
import static org.milkteamc.autotreechop.spigot.AutoTreeChop.sendMessage;

public class EffectUtils {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.milkteamc.autotreechop.utils;
package org.milkteamc.autotreechop.spigot.utils;

import org.bukkit.entity.Player;
import org.milkteamc.autotreechop.Config;
import org.milkteamc.autotreechop.PlayerConfig;
import org.milkteamc.autotreechop.spigot.Config;
import org.milkteamc.autotreechop.spigot.PlayerConfig;

public class PermissionUtils {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.milkteamc.autotreechop.utils;
package org.milkteamc.autotreechop.spigot.utils;

import org.bukkit.Bukkit;
import org.bukkit.Location;
Expand All @@ -9,17 +9,17 @@
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.milkteamc.autotreechop.AutoTreeChop;
import org.milkteamc.autotreechop.Config;
import org.milkteamc.autotreechop.PlayerConfig;
import org.milkteamc.autotreechop.hooks.GriefPreventionHook;
import org.milkteamc.autotreechop.hooks.LandsHook;
import org.milkteamc.autotreechop.hooks.ResidenceHook;
import org.milkteamc.autotreechop.hooks.WorldGuardHook;
import org.milkteamc.autotreechop.spigot.AutoTreeChop;
import org.milkteamc.autotreechop.spigot.Config;
import org.milkteamc.autotreechop.spigot.PlayerConfig;
import org.milkteamc.autotreechop.spigot.hooks.GriefPreventionHook;
import org.milkteamc.autotreechop.spigot.hooks.LandsHook;
import org.milkteamc.autotreechop.spigot.hooks.ResidenceHook;
import org.milkteamc.autotreechop.spigot.hooks.WorldGuardHook;

import java.util.Set;

import static org.milkteamc.autotreechop.AutoTreeChop.sendMessage;
import static org.milkteamc.autotreechop.spigot.AutoTreeChop.sendMessage;

public class TreeChopUtils {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: AutoTreeChop
version: '${version}'
main: org.milkteamc.autotreechop.AutoTreeChop
main: org.milkteamc.autotreechop.spigot.AutoTreeChop
api-version: 1.17
author: Maoyue
description: A auto tree chopping plugin for milkteamc
Expand Down
Loading