Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #162 from Crazy-Crew/ver/1.3
Browse files Browse the repository at this point in the history
A kitchen sink
  • Loading branch information
ryderbelserion committed Nov 27, 2023
2 parents e508750 + 5233dd8 commit d3a724a
Show file tree
Hide file tree
Showing 33 changed files with 4,188 additions and 77 deletions.
28 changes: 15 additions & 13 deletions .gitignore
@@ -1,20 +1,22 @@
build
.gradle
.idea

core/.gradle
core/build
buildSrc/.gradle
buildSrc/build

fabric/.gradle
fabric/build
common/.gradle
common/build

paper/.gradle
paper/build
jars

build

buildSrc/build
buildSrc/.gradle
paper/build
paper/.gradle

.vscode/
core/bin/
paper/bin/
paper/run
!paper/run/config
!paper/run/spigot.yml
!paper/run/bukkit.yml
!paper/run/eula.txt
!paper/run/server.properties
!paper/run/plugins
22 changes: 22 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,22 @@
# Contributing to CrazyCrates
Contributions to the project are always welcome, Pull Requests do have some guidelines before being approved.

## You should always create the fork as a personal repository not in an organization.
Any pull request made by a fork in an organization prevents modifications. Everyone has their own way of doing things and rather asking you to change that. A personal fork lets com change the things
that we have a tick about.

If you do not use a personal fork, We have to manually merge your pull request which means it's marked as closed instead of merged.

## Requirements
* `git`
* Java 17 ( Adoptium is recommended )

Pull Requests must be labeled properly according to if it's a bug fix, a new feature or enhancements to the code base.
* `git checkout -b fix/your_fix`
* `git checkout -b feature/your_feature`
* `git checkout -b quality/your_enhancement`
* Commit your changes using `git commit -m 'your commit'`
* Push to your branch using `git push`
* Open a pull request to the `main` branch on our repository to add your change.

You must explain what your pull request is changing and if needed, Supply a video of your change as Pull Requests are a way to get feedback.
22 changes: 13 additions & 9 deletions README.md
@@ -1,8 +1,8 @@
<br />

<div align="center">
[![crazyauctions](https://raw.githubusercontent.com/RyderBelserion/Assets/main/crazycrew/webp/CrazyAuctionsBanner.webp)](https://modrinth.com/plugin/crazyauctions)

[![CrazyAuctions](https://raw.githubusercontent.com/RyderBelserion/Assets/main/crazycrew/webp/CrazyAuctionsBanner.webp)](https://modrinth.com/plugin/crazyauctions)
<div align="center">

[![Contributors][contributors-shield]][contributors-url]
[![Forks][forks-shield]][forks-url]
Expand All @@ -16,14 +16,14 @@
![Purpur](https://cdn.jsdelivr.net/gh/intergrav/devins-badges/assets/compact/supported/purpur_vector.svg)

<p align="center">
A crates plugin that offers quality crates with ease!
Auction off your items in style!
<br />
<a href="https://docs.crazycrew.us/CrazyAuctions/home"><strong>Explore the docs »</strong></a>
<a href="https://github.com/Crazy-Crew/CrazyAuctions/wiki"><strong>Explore the docs »</strong></a>
<br />
<br />
<a href="https://github.com/Crazy-Crew/CrazyAuctions/issues">Report Bug</a>
·
<a href="https://github.com/Crazy-Crew/CrazyAuctions/discussions/categories/features">Request Feature</a>
<a href="https://github.com/Crazy-Crew/CrazyAuctions/discussions/categories/feature-requests">Request Feature</a>
·
<a href="https://discord.gg/badbones-s-live-chat-182615261403283459">Get Support</a>
</p>
Expand All @@ -47,8 +47,12 @@
</ol>
</details>

### Resource Page
<a href="https://modrinth.com/plugin/crazyzuctions">![Modrinth](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/compact/available/modrinth_46h.png)</a>
## Resource Page

### Beta Builds
All beta builds will be on Modrinth marked as beta.<br>

<a href="https://modrinth.com/plugin/crazyauctions">![Modrinth](https://raw.githubusercontent.com/intergrav/devins-badges/v3/assets/cozy/available/modrinth_64h.png)</a>

## Getting Started

Expand All @@ -75,15 +79,15 @@ A list of things necessary to make sure you can build CrazyAuctions properly.

## 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/CcPYmsBt) for our current plans, any bugs and general tracking of the project progress.

## Contributing

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/yourfeature`)
3. Commit your Changes (`git commit -m 'your amazing feature.'`)
4. Push to the Branch (`git push`)
5. Open a Pull Request to the `main` branch to add your feature/fix.
5. Open a Pull Request to the dev branch to add your feature/fix.

## License

Expand Down
91 changes: 42 additions & 49 deletions build.gradle
@@ -1,71 +1,64 @@
plugins {
id 'java-library'
}

defaultTasks 'build'

def combineJars = tasks.register("combineJars", org.gradle.jvm.tasks.Jar) {
mustRunAfter build
alias(libs.plugins.paperweight)
alias(libs.plugins.shadowjar)

duplicatesStrategy = DuplicatesStrategy.EXCLUDE
alias(libs.plugins.runpaper)
}

from(files(subprojects.findAll { it.name != 'webmap' }.collect {
it.layout.buildDirectory.file("libs/${rootProject.name}-${it.name}-${it.version}.jar").get()
}).filter { it.name != 'MANIFEST.MF' }.collect { if (it.isDirectory()) it else zipTree(it) })
project.group = "${rootProject.group}.paper"
project.version = rootProject.version

doLast {
File dir = new File(rootDir, "jars")
base {
archivesName = "${rootProject.name}-${project.name}"
}

if (dir.exists()) dir.delete()
dependencies {
implementation(libs.metrics)

dir.mkdirs()
compileOnly(libs.vault)

copy {
from(layout.buildDirectory.file("libs/${rootProject.name}-${rootProject.version}.jar"))
into(dir)
}
}
paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:$minecraftVersion-R0.1-SNAPSHOT")
}

assemble {
subprojects.forEach { project -> dependsOn ":${project.name}:build" }
tasks {
runServer {
jvmArgs("-Dnet.kyori.ansi.colorLevel=truecolor")

finalizedBy combineJars
}

subprojects {
apply plugin: 'java-library'
minecraftVersion(minecraftVersion)
}

repositories {
maven { url = 'https://repo.crazycrew.us/releases' }
assemble {
dependsOn(reobfJar)
}

maven { url = 'https://jitpack.io' }
shadowJar {
mergeServiceFiles()

mavenCentral()
}
exclude("META-INF/**")

if (name == "paper") {
repositories {
maven { url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/' }
List.of(
"org.bstats"
).forEach {
relocate(it, "libs.$it")
}
}

compileJava {
options.encoding = 'UTF-8'
options.release.set(17)
}
processResources {
Map<String, String> props = new HashMap<>()

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
props.put("name", rootProject.name)
props.put("version", "$rootProject.version")
props.put("group", "$project.group")
props.put("description", rootProject.description)

javadoc {
options.encoding = 'UTF-8'
}
props.put("apiVersion", apiVersion)
props.put("authors", authors)
props.put("website", website)

processResources {
filteringCharset = 'UTF-8'
inputs.properties(props)

filesMatching("plugin.yml") {
expand(props)
}
}
}
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Expand Up @@ -18,7 +18,7 @@ minimessage = { module = "net.kyori:adventure-text-minimessage", version.ref = "
cluster_paper = { module = "com.ryderbelserion.cluster.paper:cluster-paper", version.ref = "cluster_version" }
cluster_api = { module = "com.ryderbelserion.cluster.api:cluster-api", version.ref = "cluster_version" }

nbtapi = { module = "de.tr7zw:item-nbt-api", version = "2.12.0" }
vault = { module = "com.github.MilkBowl:VaultAPI", version = "1.7.1" }

triumph_cmds = { module = "dev.triumphteam:triumph-cmd-bukkit", version = "2.0.0-SNAPSHOT" }

Expand Down
12 changes: 11 additions & 1 deletion paper/build.gradle
Expand Up @@ -13,6 +13,10 @@ base {
}

dependencies {
implementation(libs.metrics)

compileOnly(libs.vault)

paperweightDevelopmentBundle("io.papermc.paper:dev-bundle:$minecraftVersion-R0.1-SNAPSHOT")
}

Expand All @@ -31,6 +35,12 @@ tasks {
mergeServiceFiles()

exclude("META-INF/**")

List.of(
"org.bstats"
).forEach {
relocate(it, "libs.$it")
}
}

processResources {
Expand All @@ -47,7 +57,7 @@ tasks {

inputs.properties(props)

filesMatching("paper-plugin.yml") {
filesMatching("plugin.yml") {
expand(props)
}
}
Expand Down
@@ -1,8 +1,22 @@
package com.badbones69.crazyauctions.paper;

import com.badbones69.crazyauctions.paper.api.CrazyManager;
import com.badbones69.crazyauctions.paper.api.FileManager;
import com.badbones69.crazyauctions.paper.api.enums.Messages;
import com.badbones69.crazyauctions.paper.api.support.PluginSupport;
import com.badbones69.crazyauctions.paper.api.support.metrics.MetricsWrapper;
import com.badbones69.crazyauctions.paper.commands.AuctionCommand;
import com.badbones69.crazyauctions.paper.commands.AuctionTab;
import com.badbones69.crazyauctions.paper.controllers.GuiListener;
import com.badbones69.crazyauctions.paper.controllers.MarcoListener;
import com.badbones69.crazyauctions.paper.currency.VaultSupport;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.PluginCommand;
import org.bukkit.command.TabCompleter;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;
import java.util.Timer;
import java.util.TimerTask;

public class CrazyAuctions extends JavaPlugin {

Expand All @@ -13,15 +27,85 @@ public static CrazyAuctions get() {

private Timer timer;

private FileManager fileManager;
private CrazyManager crazyManager;

private VaultSupport support;

@Override
public void onEnable() {
// Instantiate timer
this.timer = new Timer();

this.fileManager = new FileManager();
this.crazyManager = new CrazyManager();

this.fileManager.setup();
this.crazyManager.load();

getServer().getPluginManager().registerEvents(new GuiListener(), this);
getServer().getPluginManager().registerEvents(new MarcoListener(), this);

registerCommand(getCommand("crazyauctions"), new AuctionTab(), new AuctionCommand());

// Run a task every 5 seconds to update auctions.
TimerTask task = new TimerTask() {
@Override
public void run() {
Methods.updateAuction();
}
};

this.timer.scheduleAtFixedRate(task, 20L, 5000L);

// Add new messages.
Messages.addMissingMessages();

// Enable vault support if enabled.
if (PluginSupport.VAULT.isPluginEnabled()) {
this.support = new VaultSupport();
support.loadVault();
}

// Create bstats instance.
MetricsWrapper wrapper = new MetricsWrapper();
wrapper.start();
}

private void registerCommand(PluginCommand pluginCommand, TabCompleter tabCompleter, CommandExecutor commandExecutor) {
if (pluginCommand != null) {
pluginCommand.setExecutor(commandExecutor);

if (tabCompleter != null) pluginCommand.setTabCompleter(tabCompleter);
}
}

@Override
public void onDisable() {
// Cancel all timers.
if (this.timer != null) this.timer.cancel();
if (timer != null) timer.cancel();

this.crazyManager.unload();
}

@NotNull
public Timer getTimer() {
return this.timer;
}

public VaultSupport getSupport() {
return this.support;
}

@NotNull
public CrazyManager getCrazyManager() {
return this.crazyManager;
}

@NotNull
public FileManager getFileManager() {
return this.fileManager;
}

public boolean isLogging() {
return true;
}
}

0 comments on commit d3a724a

Please sign in to comment.