The fun begins.

This commit is contained in:
Ryder Belserion 2023-01-07 02:27:10 -05:00
parent 4aa13288cd
commit 0c8b1552cf
No known key found for this signature in database
GPG Key ID: E4441092436053A7
38 changed files with 658 additions and 171 deletions

View File

@ -1,3 +0,0 @@
{
"java.home": "C:/Program Files/Eclipse Adoptium/jdk-17.0.4.101-hotspot/bin"
}

View File

@ -14,7 +14,7 @@ A clear and concise description of what the bug is.
- Minecraft Server Version: [e.g. 1.19] - Minecraft Server Version: [e.g. 1.19]
- Plugin Version: [e.g. 1.11.6-SNAPSHOT] - Plugin Version: [e.g. 1.11.6-SNAPSHOT]
*Do **NOT** say Latest use `/version crazycrates` in the console. *Do **NOT** say Latest use `/version crazyauctions` in the console.
**Pastebin any errors in console** **Pastebin any errors in console**
Link: https://mclo.gs/ Link: https://mclo.gs/

View File

@ -1,26 +0,0 @@
# Set to true to add reviewers to PRs
addReviewers: true
# Set to 'author' to add PR's author as an assignee
addAssignees: author
# A list of reviewers to be added to PRs (GitHub username)
reviewers:
- RyderBelserion
# A number of reviewers added to the PR
# Set 0 to add all the reviewers (default: 0)
numberOfReviewers: 1
# A list of assignees, overrides reviewers if set
assignees:
- RyderBelserion
# A number of assignees to add to the PRs
# Set to 0 to add all the assignees.
# Uses numberOfReviewers if unset.
numberOfAssignees: 0
# A list of keywords to be skipped the process if PR's title include it
skipKeywords:
- wip

View File

@ -1,14 +1,18 @@
name: Auto Assign name: Auto Assign
on: on:
issues: issues:
types: [opened] types: [opened, edited, labeled, unlabeled]
pull_request: pull_request:
types: [opened] types: [opened, edited, labeled, unlabeled]
jobs: jobs:
run: run:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: wow-actions/auto-assign@v1 - uses: wow-actions/auto-assign@v2
with: with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CONFIG_FILE: .github/auto-assign.yml reviewers: |
RyderBelserion
assignees: RyderBelserion

7
.gitignore vendored
View File

@ -1,3 +1,6 @@
.idea
.gradle .gradle
build .idea
build-logic/build
common/build
paper/build

View File

@ -1,6 +1,6 @@
<br /> <br />
[![CrazyAuctions](https://github.com/RyderBelserion/Assets/blob/main/crazycrew/old/banners/CrazyAuctions.png?raw=true)](https://www.spigotmc.org/resources/crazy-crates.17599/) [![crazyauctions](https://raw.githubusercontent.com/RyderBelserion/Assets/main/crazycrew/old/banners/CrazyAuctions.png)](https://modrinth.com/plugin/crazyauctions)
<div align="center"> <div align="center">
@ -12,12 +12,12 @@
[![Contact][discord-shield]][discord-url] [![Contact][discord-shield]][discord-url]
![CodeFactor][codefactor-shield] ![CodeFactor][codefactor-shield]
<a href="/#"><img src="https://raw.githubusercontent.com/intergrav/devins-badges/v2/assets/cozy/unsupported/spigot_64h.png" height="50"></a> ![Spigot](https://cdn.jsdelivr.net/gh/intergrav/devins-badges/assets/compact/unsupported/spigot_vector.svg)
<a href="/#"><img src="https://raw.githubusercontent.com/intergrav/devins-badges/v2/assets/cozy/supported/paper_64h.png" height="50"></a> ![Paper](https://cdn.jsdelivr.net/gh/intergrav/devins-badges/assets/compact/supported/paper_vector.svg)
<a href="/#"><img src="https://raw.githubusercontent.com/intergrav/devins-badges/v2/assets/cozy/supported/purpur_64h.png" height="50"></a> ![Purpur](https://cdn.jsdelivr.net/gh/intergrav/devins-badges/assets/compact/supported/purpur_vector.svg)
<p align="center"> <p align="center">
A simple auctions plugin where you can sell your items and bid on other items! A crates plugin that offers quality crates with ease!
<br /> <br />
<a href="https://github.com/Crazy-Crew/CrazyAuctions/wiki"><strong>Explore the docs »</strong></a> <a href="https://github.com/Crazy-Crew/CrazyAuctions/wiki"><strong>Explore the docs »</strong></a>
<br /> <br />
@ -49,11 +49,12 @@
</details> </details>
## Downloads ## Downloads
#### Stable Builds https://modrinth.com/plugin/CrazyAuctions
https://modrinth.com/plugin/crazyauctions ( Soon )
#### Beta Builds ## Snapshot Builds
https://ci.badbones69.com/view/Beta/job/CrazyAuctions-Beta/ ### Get the latest changes before marked as release.
All snapshot builds will be labeled with Beta on Modrinth.<br>
> https://modrinth.com/plugin/CrazyAuctions/versions
## Getting Started ## Getting Started
@ -63,7 +64,7 @@ How to get started with contributing / maintaining your own version of CrazyAuct
A list of things necessary to make sure you can build CrazyAuctions properly. A list of things necessary to make sure you can build CrazyAuctions properly.
* Intellij IDEA * Intellij IDEA
* https://www.jetbrains.com/idea/download/ * > https://www.jetbrains.com/idea/download/
* Gradle * Gradle
### Installation ### Installation
@ -75,12 +76,14 @@ A list of things necessary to make sure you can build CrazyAuctions properly.
2. Open the repository using Intellij IDEA & wait until it finishes downloading/indexing. 2. Open the repository using Intellij IDEA & wait until it finishes downloading/indexing.
3. Run the shadowJar task. 3. Run the shadowJar task.
```gradle ```gradle
./gradlew shadowJar or gradle shadowJar ./gradlew shadowJar
``` ```
## Roadmap ## Roadmap
Check our public [trello board](https://trello.com/b/bzQ5TwXo) for our current plans, any bugs and general tracking of the project progress. ~~Check our public [trello board](https://trello.com/b/bzQ5TwXo) for our current plans, any bugs and general tracking of the project progress.~~ We don't have one.
Step #1) Have something actually working.
## Contributing ## Contributing
@ -88,24 +91,24 @@ Check our public [trello board](https://trello.com/b/bzQ5TwXo) for our current p
2. Create your Feature Branch (`git checkout -b feature/yourfeature`) 2. Create your Feature Branch (`git checkout -b feature/yourfeature`)
3. Commit your Changes (`git commit -m 'your amazing feature.'`) 3. Commit your Changes (`git commit -m 'your amazing feature.'`)
4. Push to the Branch (`git push`) 4. Push to the Branch (`git push`)
5. Open a Pull Request 5. Open a Pull Request to add your feature/fix to the dev branch.
## License ## License
Distributed under the MIT License. See [`LICENSE`](/LICENSE) for more information. Distributed under the MIT License. See [`LICENSE`](/LICENSE) for more information.
[discord-shield]: https://img.shields.io/discord/182615261403283459.svg?style=for-the-badge [discord-shield]: https://img.shields.io/discord/182615261403283459.svg?style=flat&logo=appveyor
[discord-url]: https://discord.gg/crazycrew [discord-url]: https://discord.gg/crazycrew
[contributors-shield]: https://img.shields.io/github/contributors/Crazy-Crew/CrazyAuctions.svg?style=for-the-badge [contributors-shield]: https://img.shields.io/github/contributors/Crazy-Crew/CrazyAuctions.svg?style=flat&logo=appveyor
[contributors-url]: https://github.com/Crazy-Crew/CrazyAuctions/graphs/contributors [contributors-url]: https://github.com/Crazy-Crew/CrazyAuctions/graphs/contributors
[forks-shield]: https://img.shields.io/github/forks/Crazy-Crew/CrazyAuctions.svg?style=for-the-badge [forks-shield]: https://img.shields.io/github/forks/Crazy-Crew/CrazyAuctions.svg?style=flat&logo=appveyor
[forks-url]: https://github.com/Crazy-Crew/CrazyAuctions/network/members [forks-url]: https://github.com/Crazy-Crew/CrazyAuctions/network/members
[stars-shield]: https://img.shields.io/github/stars/Crazy-Crew/CrazyAuctions.svg?style=for-the-badge [stars-shield]: https://img.shields.io/github/stars/Crazy-Crew/CrazyAuctions.svg?style=flat&logo=appveyor
[stars-url]: https://github.com/Crazy-Crew/CrazyAuctions/stargazers [stars-url]: https://github.com/Crazy-Crew/CrazyAuctions/stargazers
[issues-shield]: https://img.shields.io/github/issues/Crazy-Crew/CrazyAuctions.svg?style=for-the-badge [issues-shield]: https://img.shields.io/github/issues/Crazy-Crew/CrazyAuctions.svg?style=flat&logo=appveyor
[issues-url]: https://github.com/Crazy-Crew/CrazyAuctions/issues [issues-url]: https://github.com/Crazy-Crew/CrazyAuctions/issues
[license-shield]: https://img.shields.io/github/license/Crazy-Crew/CrazyAuctions.svg?style=for-the-badge [license-shield]: https://img.shields.io/github/license/Crazy-Crew/CrazyAuctions.svg?style=flat&logo=appveyor
[license-url]: https://github.com/Crazy-Crew/CrazyAuctions/blob/master/LICENSE.MD [license-url]: https://github.com/Crazy-Crew/CrazyAuctions/blob/master/LICENSE
[codefactor-shield]: https://img.shields.io/codefactor/grade/github/crazy-crew/CrazyAuctions/main?style=for-the-badge [codefactor-shield]: https://img.shields.io/codefactor/grade/github/crazy-crew/CrazyAuctions/main?style=flat&logo=appveyor

View File

@ -0,0 +1,11 @@
plugins {
`kotlin-dsl`
}
repositories {
gradlePluginPortal()
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.21")
}

View File

@ -0,0 +1,5 @@
@file:Suppress("UnstableApiUsage")
dependencyResolutionManagement {
repositories.gradlePluginPortal()
}

View File

@ -0,0 +1,27 @@
plugins {
`java-library`
}
repositories {
maven("https://repo.triumphteam.dev/snapshots/")
maven("https://repo.crazycrew.us/libraries/")
maven("https://repo.crazycrew.us/plugins/")
maven("https://libraries.minecraft.net/")
maven("https://jitpack.io/")
mavenCentral()
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(17))
}
tasks {
compileJava {
options.release.set(17)
}
}

View File

@ -0,0 +1,45 @@
plugins {
id("crazyauctions-common")
}
project.version = "${extra["plugin_version"]}"
project.group = "${extra["plugin_group"]}.CrazyAuctions"
project.description = "Auction your items off in style!"
repositories {
/**
* PAPI Team
*/
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
/**
* NBT Team
*/
maven("https://repo.codemc.org/repository/maven-public/")
/**
* Paper Team
*/
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
implementation(project(":common"))
implementation("dev.triumphteam", "triumph-cmd-bukkit", "2.0.0-SNAPSHOT")
implementation("com.ryderbelserion.ithildin", "ithildin-core", "0.0.1")
implementation("org.bstats", "bstats-bukkit", "3.0.0")
compileOnly("io.papermc.paper", "paper-api", "${project.extra["minecraft_version"]}-R0.1-SNAPSHOT")
compileOnly("com.github.decentsoftware-eu", "decentholograms", "2.7.8")
compileOnly("com.github.MilkBowl", "VaultAPI", "1.7")
compileOnly("me.clip", "placeholderapi", "2.11.2") {
exclude(group = "org.spigotmc", module = "spigot")
exclude(group = "org.bukkit", module = "bukkit")
}
}

View File

@ -1,50 +1 @@
plugins { rootProject.group = "${extra["plugin_group"]}"
kotlin("jvm") version "1.7.20"
id("com.github.johnrengelman.shadow") version "7.1.2"
}
val buildNumber: String? = System.getenv("BUILD_NUMBER")
val jenkinsVersion = "0.0.1-b$buildNumber"
group = "com.badbones69.crazyauctions"
version = "0.0.1"
description = "A simple auctions plugin where you can sell your items and bid on other items!"
repositories {
mavenCentral()
/**
* Paper Team
*/
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
implementation(kotlin("stdlib", "1.7.20"))
compileOnly(libs.paper)
}
tasks {
shadowJar {
if (buildNumber != null) {
archiveFileName.set("${rootProject.name}-[v${jenkinsVersion}].jar")
} else {
archiveFileName.set("${rootProject.name}-[v${rootProject.version}].jar")
}
//listOf(
// ""
//).onEach {
// relocate(it, "${group}.libs.$it")
//}
}
compileKotlin {
kotlinOptions {
jvmTarget = "17"
}
}
}

7
common/build.gradle.kts Normal file
View File

@ -0,0 +1,7 @@
plugins {
id("crazyauctions-common")
}
dependencies {
compileOnly("com.ryderbelserion.ithildin", "ithildin-core", "0.0.1")
}

View File

@ -0,0 +1,19 @@
package com.badbones69.crazyauctions;
import com.badbones69.crazyauctions.configuration.Config;
import com.badbones69.crazyauctions.configuration.Locale;
import com.ryderbelserion.ithildin.core.IthildinCore;
public class Builder {
public static void start() {
Config.handle(IthildinCore.api().getDirectory());
Locale.handle(IthildinCore.api().getDirectory().resolve("locale"));
if (Config.VERBOSE) System.out.println("Yay!");
}
public static void stop() {
}
}

View File

@ -0,0 +1,34 @@
package com.badbones69.crazyauctions.configuration;
import com.ryderbelserion.ithildin.core.configs.AbstractYaml;
import java.nio.file.Path;
public class Config extends AbstractYaml {
private static final Config CONFIG = new Config();
@Key("settings.language-file")
@Comment("""
The language file to use from the locale folder.
Supported languages are English(en).""")
public static String LANGUAGE_FILE = "locale-en.yml";
@Key("settings.verbose")
@Comment("Whether you want to have verbose logging enabled.")
public static boolean VERBOSE = true;
@Key("settings.metrics")
@Comment("Whether you want metrics to be enabled.")
public static boolean METRICS = true;
@Key("settings.updater")
@Comment("""
Sends you update notifications for when an update is available!
You either need crazyauctions.command.admin.help or have /op
""")
public static boolean UPDATER = true;
public static void handle(Path directory) {
CONFIG.handle(directory.resolve("config.yml"), Config.class);
}
}

View File

@ -0,0 +1,30 @@
package com.badbones69.crazyauctions.configuration;
import com.ryderbelserion.ithildin.core.configs.AbstractYaml;
import com.ryderbelserion.ithildin.core.utils.FileUtils;
import java.nio.file.Path;
public class Locale extends AbstractYaml {
private static final Locale LOCALE = new Locale();
@Key("prefix.command")
@Comment("Change how the prefix for commands will look!")
public static String COMMAND_PREFIX = "<gray>[<gradient:#da184d:#b8c9e6>CrazyAuctions</gradient>]</gray>";
@Key("prefix.console")
@Comment("Change how the prefix for console will look!")
public static String CONSOLE_PREFIX = "<gray>[<gradient:#da184d:#b8c9e6>CrazyAuctions</gradient>]</gray>";
@Key("misc.unknown-command")
public static String UNKNOWN_COMMAND = "<red>This command is not known.</red>";
@Key("misc.config-reload")
public static String CONFIG_RELOAD = "<red>You have reloaded the plugin.</red>";
public static void handle(Path directory) {
FileUtils.extract("/locale/", directory, false);
LOCALE.handle(directory.resolve(Config.LANGUAGE_FILE), Locale.class);
}
}

8
gradle.properties Normal file
View File

@ -0,0 +1,8 @@
org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=false
minecraft_version=1.19.3
plugin_version=1.2.18
plugin_group=com.badbones69.crazyauctions

View File

@ -1,24 +0,0 @@
[versions]
# Paper Team
paper = "1.19.2-R0.1-SNAPSHOT"
# Bukkit
bukkit-bstats = "3.0.0"
# Placeholders
placeholder-api = "2.11.2"
# Misc Libraries
vault-api = "1.7"
[libraries]
# Paper Team
paper = { module = "io.papermc.paper:paper-api", version.ref = "paper" }
# Bukkit
bukkit-bstats = { module = "org.bstats:bstats-bukkit", version.ref = "bukkit-bstats" }
# Misc Libraries
vault-api = { module = "com.github.MilkBowl:VaultAPI", version.ref = "vault-api" }

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

96
paper/build.gradle.kts Normal file
View File

@ -0,0 +1,96 @@
plugins {
id("crazyauctions-paper")
id("com.modrinth.minotaur") version "2.6.0"
id("com.github.johnrengelman.shadow") version "7.1.2"
`maven-publish`
}
val buildVersion = "${project.version}-SNAPSHOT"
val isSnapshot = true
tasks {
shadowJar {
if (isSnapshot) {
archiveFileName.set("${rootProject.name}-${buildVersion}.jar")
} else {
archiveFileName.set("${rootProject.name}-${project.version}.jar")
}
listOf(
"org.bstats",
"dev.triumphteam.cmd"
).forEach {
relocate(it, "${rootProject.group}.plugin.lib.$it")
}
}
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set("crazyauctions")
if (isSnapshot) {
versionName.set("${rootProject.name} $buildVersion")
versionNumber.set(buildVersion)
versionType.set("beta")
} else {
versionName.set("${rootProject.name} ${project.version}")
versionNumber.set("${project.version}")
versionType.set("release")
}
uploadFile.set(shadowJar.get())
autoAddDependsOn.set(true)
gameVersions.addAll(listOf("1.18", "1.18.1", "1.18.2", "1.19", "1.19.1", "1.19.2", "1.19.3"))
loaders.addAll(listOf("paper", "purpur"))
//<h3>The first release for CrazyAuctions on Modrinth! 🎉🎉🎉🎉🎉<h3><br> If we want a header.
changelog.set("""
<h2>Changes:</h2>
<p>N/A</p>
<h2>Bug Fixes:</h2>
<p>N/A</p>
""".trimIndent())
}
processResources {
filesMatching("plugin.yml") {
expand(
"name" to rootProject.name,
"group" to project.group,
"version" to if (isSnapshot) buildVersion else project.version,
"description" to project.description
)
}
}
}
publishing {
val mavenExt: String = if (isSnapshot) "snapshots" else "releases"
repositories {
maven("https://repo.crazycrew.us/$mavenExt") {
name = "crazycrew"
//credentials(PasswordCredentials::class)
credentials {
username = System.getenv("REPOSITORY_USERNAME")
password = System.getenv("REPOSITORY_PASSWORD")
}
}
}
publications {
create<MavenPublication>("maven") {
groupId = "${extra["plugin_group"]}"
artifactId = rootProject.name.toLowerCase()
version = if (isSnapshot) buildVersion else "${project.version}"
from(components["java"])
}
}
}

View File

@ -0,0 +1,95 @@
package com.badbones69.crazyauctions;
import com.badbones69.crazyauctions.command.PaperConsole;
import com.badbones69.crazyauctions.player.PaperPlayerListener;
import com.badbones69.crazyauctions.player.PaperPlayerRegistry;
import com.ryderbelserion.ithildin.core.Console;
import com.ryderbelserion.ithildin.core.IthildinCore;
import com.ryderbelserion.ithildin.core.utils.LoggerUtils;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
import java.lang.reflect.Field;
import java.nio.file.Path;
public class CrazyAuctions extends JavaPlugin implements IthildinCore {
private static CrazyAuctions plugin;
private final PaperConsole paperConsole;
private PaperPlayerRegistry paperPlayerRegistry;
public CrazyAuctions() {
super();
try {
Field api = Provider.class.getDeclaredField("api");
api.setAccessible(true);
api.set(null, this);
} catch (Exception exception) {
exception.printStackTrace();
getServer().getPluginManager().disablePlugin(this);
}
plugin = this;
paperConsole = new PaperConsole();
LoggerUtils.setLoggerName(plugin.getName());
Builder.start();
}
@Override
public void onEnable() {
// Do whatever else.
// Register listeners.
PaperPlayerListener paperPlayerListener = new PaperPlayerListener();
getServer().getPluginManager().registerEvents(paperPlayerListener, this);
// Set up registries.
this.paperPlayerRegistry = new PaperPlayerRegistry();
}
@Override
public void onDisable() {
// Stop the plugin.
Builder.stop();
}
@Override
public @NotNull String getCurrentVersion() {
return getDescription().getVersion();
}
@Override
public @NotNull Path getDirectory() {
return getDataFolder().toPath();
}
@Override
public @NotNull Path getStorage() {
return getDirectory().resolve("storage");
}
public @NotNull Path getUserData() {
return getStorage().resolve("userdata");
}
@Override
public @NotNull Console getConsole() {
return this.paperConsole;
}
@Override
public @NotNull PaperPlayerRegistry getPlayerRegistry() {
return this.paperPlayerRegistry;
}
public @NotNull static CrazyAuctions getPlugin() {
return plugin;
}
}

View File

@ -0,0 +1,5 @@
package com.badbones69.crazyauctions.api.economy;
public class Currency {
}

View File

@ -0,0 +1,5 @@
package com.badbones69.crazyauctions.api.support;
public enum PluginSupport {
}

View File

@ -0,0 +1,45 @@
package com.badbones69.crazyauctions.command;
import com.ryderbelserion.ithildin.core.Console;
import net.kyori.adventure.audience.MessageType;
import net.kyori.adventure.identity.Identity;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.command.ConsoleCommandSender;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Objects;
public class PaperConsole extends Console {
private final ConsoleCommandSender consoleCommandSender;
public PaperConsole() {
this.consoleCommandSender = Bukkit.getConsoleSender();
}
@Override
public void sendMessage(@NotNull Identity source, @NotNull Component message, @NotNull MessageType type) {
this.consoleCommandSender.sendMessage(source, message, type);
}
@Override
public boolean equals(@Nullable Object instance) {
if (this == instance) return true;
if (instance == null) return false;
if (this.getClass() != instance.getClass()) return false;
PaperConsole other = (PaperConsole) instance;
return getKey() == other.getKey() && this.consoleCommandSender == other.consoleCommandSender;
}
@Override
public int hashCode() {
return Objects.hash(getKey(), this.consoleCommandSender);
}
@Override
public String toString() {
return "PaperConsole{" + "key=" + getKey() + ",console=" + this.consoleCommandSender.getName() + "}";
}
}

View File

@ -0,0 +1,5 @@
package com.badbones69.crazyauctions.command.types;
public class AuctionCommand {
}

View File

@ -0,0 +1,5 @@
package com.badbones69.crazyauctions.guis;
public class AuctionGUI {
}

View File

@ -0,0 +1,53 @@
package com.badbones69.crazyauctions.player;
import com.ryderbelserion.ithildin.core.player.PlayerObject;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Objects;
import java.util.UUID;
public class PaperPlayer extends PlayerObject {
private final Player player;
public PaperPlayer(@NotNull Player player) {
super(createKey(player.getUniqueId()));
this.player = player;
}
public Player getPlayer() {
return this.player;
}
@Override
public String getName() {
return this.player.getName();
}
@Override
public UUID getIdentity() {
return this.player.getUniqueId();
}
@Override
public boolean equals(@Nullable Object instance) {
if (this == instance) return true;
if (instance == null) return false;
if (this.getClass() != instance.getClass()) return false;
PaperPlayer other = (PaperPlayer) instance;
return getKey() == other.getKey() && this.player == other.player;
}
@Override
public int hashCode() {
return Objects.hash(getKey(), this.player);
}
@Override
public String toString() {
return "PaperPlayer{" + "key=" + getKey() + ",player=" + getPlayer().getUniqueId() + "}";
}
}

View File

@ -0,0 +1,35 @@
package com.badbones69.crazyauctions.player;
import com.badbones69.crazyauctions.CrazyAuctions;
import com.ryderbelserion.ithildin.core.IthildinCore;
import com.ryderbelserion.ithildin.core.player.PlayerListener;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
public class PaperPlayerListener implements PlayerListener, Listener {
private final CrazyAuctions plugin = CrazyAuctions.getPlugin();
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onJoinEvent(PlayerJoinEvent event) {
PaperPlayerRegistry registry = (PaperPlayerRegistry) IthildinCore.api().getPlayerRegistry();
// Add the player to the registry.
String message = "<red> " + event.getPlayer().getName() + "</red> <yellow>has joined.</yellow>";
onConnect(registry.addPlayer(event.getPlayer()), message, "<red>[" + plugin.getName() + "]</red>");
}
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerQuit(PlayerQuitEvent event) {
PaperPlayerRegistry registry = (PaperPlayerRegistry) IthildinCore.api().getPlayerRegistry();
// Remove the player from the registry.
String message = "<red> " + event.getPlayer().getName() + "</red> <yellow>has left.</yellow>";
onDisconnect(registry.removePlayer(event.getPlayer()), message, "<red>[" + plugin.getName() + "]</red>");
}
}

View File

@ -0,0 +1,25 @@
package com.badbones69.crazyauctions.player;
import com.ryderbelserion.ithildin.core.player.PlayerObject;
import com.ryderbelserion.ithildin.core.player.PlayerRegistry;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class PaperPlayerRegistry extends PlayerRegistry {
@Nullable
public PlayerObject addPlayer(@NotNull Player player) {
return register(new PaperPlayer(player));
}
@Nullable
public PlayerObject removePlayer(@NotNull Player player) {
PlayerObject checkPlayer = get(player.getUniqueId());
return checkPlayer == null ? null : unregister(checkPlayer);
}
public PlayerObject get(@NotNull Player player) {
return get(player.getUniqueId());
}
}

View File

@ -0,0 +1,26 @@
package com.badbones69.crazyauctions.player;
import com.ryderbelserion.ithildin.core.IthildinCore;
import com.ryderbelserion.ithildin.core.Sender;
import com.ryderbelserion.ithildin.core.registry.keys.Key;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
public abstract class PaperSender extends Sender {
public PaperSender(@NotNull Key key) {
super(key);
}
public static Sender getSender(CommandSender sender) {
if (sender instanceof Player player) return IthildinCore.api().getPlayerRegistry().get(player.getUniqueId());
return IthildinCore.api().getConsole();
}
public static CommandSender getSender(Sender sender) {
return Bukkit.getConsoleSender();
}
}

View File

@ -0,0 +1,11 @@
settings:
# The language file to use from the locale folder.
# Supported languages are English(en).
language-file: "locale-en.yml"
# Whether you want to have verbose logging enabled.
verbose: true
# Whether you want metrics to be enabled.
metrics: true
# Sends you update notifications for when an update is available!
# You either need crazyauctions.command.admin.help or have /op
updater: true

View File

@ -0,0 +1,9 @@
prefix:
# Change how the prefix for commands will look!
command: '<gray>[<gradient:#da184d:#b8c9e6>CrazyAuctions</gradient>]</gray>'
# Change how the prefix for console will look!
console: '<gray>[<gradient:##da184d:#b8c9e6>CrazyAuctions</gradient>]</gray>'
misc:
unknown-command: '<red>This command is not known.</red>'
config-reload: '<red>You have reloaded the plugin.</red>'

View File

@ -1,16 +1,16 @@
name: "CrazyAuctions" name: "CrazyAuctions"
main: "${group}.CrazyAuctions" main: "${group}"
authors: [BadBones69, RyderBelserion] authors: [BadBones69, RyderBelserion]
version: ${version} version: ${version}
api-version: "1.19" api-version: "1.18"
description: ${description} description: ${description}
softdepend: [Vault] softdepend: [Vault, PlaceholderAPI]
website: https://modrinth.com/plugin/crazyauctions website: https://modrinth.com/plugin/crazyauctions
commands: commands:
crazyauctions: crazyauctions:
description: Opens the main menu for CrazyAuctions. description: The base command for Crazy Auctions

View File

@ -1,3 +1,14 @@
rootProject.name = "CrazyAuctions" rootProject.name = "CrazyAuctions"
enableFeaturePreview("VERSION_CATALOGS") dependencyResolutionManagement {
includeBuild("build-logic")
}
pluginManagement {
repositories {
gradlePluginPortal()
maven("https://papermc.io/repo/repository/maven-public/")
}
}
include("paper", "common")

View File

@ -1,18 +0,0 @@
package com.badbones69.crazyauctions
import org.bukkit.plugin.java.JavaPlugin
class CrazyAuctions : JavaPlugin() {
private val plugin = this;
override fun onEnable() {
}
override fun onDisable() {
}
fun getPlugin() = plugin
}

View File

@ -1,5 +0,0 @@
package com.badbones69.crazyauctions.api
class CrazyManager {
}

View File

@ -1,5 +0,0 @@
package com.badbones69.crazyauctions.api
class FileManager {
}

View File

@ -1,5 +0,0 @@
package com.badbones69.crazyauctions.commands
class BaseCommand {
}