Skip to content

Commit

Permalink
Add 1.20.6 support (#704)
Browse files Browse the repository at this point in the history
## Additions:
* Added missing messages to the `messages.yml`
  * Ability to customize the output of /crazycrates list
* Support for PlaceholderAPI in lores/displaynames for keys
* You no longer have to include `https://textures.minecraft.net/texture/` when using custom heads.
  * You can simply use `1ee3126ff2c343da525eef2b93272b9fed36273d0ea08c2616b80009948ad57e` in the `Player` field.
  * You can find an example in the `examples/crates` directory!
* Added a warning if trying to add AIR to a crate using `/crates additem`

## Breaking Changes:
### Permissions:
* Command / General Permissions have been updated!
  * You can find a list of permissions @ https://docs.crazycrew.us/docs/1.20.6/plugins/crazycrates/commands/permissions
  * They will not change again, but they are easier to type.

### In-game editor:
* All previous iterations of the in-game editor **do not** work anymore. All added prizes using the old methods WILL not work.
  * You **must** update all your prizes as a lot of the internals have changed for **1.20.5-1.20.6**

### Item IDS
* All items ids used for potions, materials, blocks, trim materials/patterns and sounds etc. have all been changed.
  * A list of sounds: https://minecraft.wiki/w/Sounds.json#Java_Edition_values, **Custom Sounds from resource packs are also supported!**
* Enchantments instead of `PROTECTION_ENVIRONMENTAL` and `DAMAGE_ALL`, It would be `protection` and `sharpness`
  * <details>
    <summary>List of Enchantments</summary>

    * protection
    * fire_protection
    * feather_falling
    * blast_protection
    * projectile_protection
    * respiration
    * aqua_affinity
    * thorns
    * depth_strider
    * frost_walker
    * binding_curse
    * sharpness
    * smite
    * bane_of_arthropods
    * knockback
    * fire_aspect
    * looting
    * sweeping_edge
    * efficiency
    * silk_touch
    * unbreaking
    * fortune
    * power
    * punch
    * flame
    * infinity
    * luck_of_the_sea
    * lure
    * loyalty
    * impaling
    * riptide
    * channeling
    * multishot
    * quick_charge
    * piercing
    * mending
    * vanishing_curse
    * soul_speed
    * swift_sneak
  </details>

* You can find a list of updated trim materials/patterns below!
  * https://docs.crazycrew.us/docs/1.20.6/plugins/crazycrates/guides/prizes/items/armor-trim

## Other:
* [Feature Requests](https://github.com/Crazy-Crew/CrazyCrates/discussions/categories/features)
* [Bug Reports](https://github.com/Crazy-Crew/CrazyCrates/issues)
  • Loading branch information
ryderbelserion committed May 16, 2024
1 parent ca900e5 commit 8e19c5c
Show file tree
Hide file tree
Showing 143 changed files with 5,910 additions and 6,998 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 21
check-latest: true

- name: Gradle Properties Import.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ jobs:
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
java-version: 21
check-latest: true

- name: Gradle Properties Import.
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ build
buildSrc/.gradle
buildSrc/build

common/.gradle
common/build

api/.gradle
api/build

publish/build
publish/.gradle

paper/.gradle
paper/build

Expand Down
73 changes: 66 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,72 @@
## Additions:
* Added bstats back to avoid blimps in the bstats page.
* If you wish to disable `bstats`, You can use the provided `bStats` to turn it off entirely. There is no need to provide a per plugin toggle as if you don't want it in one plugin, you don't want it in any of them.
* Added missing messages to the `messages.yml`
* Ability to customize the output of /crazycrates list
* Support for PlaceholderAPI in lores/displaynames for keys
* You no longer have to include `https://textures.minecraft.net/texture/` when using custom heads.
* You can simply use `1ee3126ff2c343da525eef2b93272b9fed36273d0ea08c2616b80009948ad57e` in the `Player` field.
* You can find an example in the `examples/crates` directory!
* Added a warning if trying to add AIR to a crate using `/crates additem`

## Fixes:
* Fixed an issue with an immutable error when doing /crates additem on a prize already existing.
## Breaking Changes:
### Permissions:
* Command / General Permissions have been updated!
* You can find a list of permissions @ https://docs.crazycrew.us/docs/1.20.6/plugins/crazycrates/commands/permissions
* They will not change again, but they are easier to type.

## Minor:
* Updated outdated commands in default files.
* Removed unused or commented out code
### In-game editor:
* All previous iterations of the in-game editor **do not** work anymore. All added prizes using the old methods WILL not work.
* You **must** update all your prizes as a lot of the internals have changed for **1.20.5-1.20.6**

### Item IDS
* All items ids used for potions, materials, blocks, trim materials/patterns and sounds etc. have all been changed.
* A list of sounds: https://minecraft.wiki/w/Sounds.json#Java_Edition_values, **Custom Sounds from resource packs are also supported!**
* Enchantments instead of `PROTECTION_ENVIRONMENTAL` and `DAMAGE_ALL`, It would be `protection` and `sharpness`
* <details>
<summary>List of Enchantments</summary>

* protection
* fire_protection
* feather_falling
* blast_protection
* projectile_protection
* respiration
* aqua_affinity
* thorns
* depth_strider
* frost_walker
* binding_curse
* sharpness
* smite
* bane_of_arthropods
* knockback
* fire_aspect
* looting
* sweeping_edge
* efficiency
* silk_touch
* unbreaking
* fortune
* power
* punch
* flame
* infinity
* luck_of_the_sea
* lure
* loyalty
* impaling
* riptide
* channeling
* multishot
* quick_charge
* piercing
* mending
* vanishing_curse
* soul_speed
* swift_sneak
</details>

* You can find a list of updated trim materials/patterns below!
* https://docs.crazycrew.us/docs/1.20.6/plugins/crazycrates/guides/prizes/items/armor-trim

## Other:
* [Feature Requests](https://github.com/Crazy-Crew/CrazyCrates/discussions/categories/features)
Expand Down
24 changes: 14 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ 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 )
* `git`
* Java 21 ( Adoptium or Corretto 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 `dev` branch on our repository to add your change.
### 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`

### What's next?
* The branch you open the pull request to depends on the scope of your change.
* Anything considered a "fix" or "internal" clean up that will not cripple a server or vastly change the experience of a server can be sent as a pull request to the `main` branch
* We try to follow semver so once the pull request is deemed ready to merge, The version will be bumped from 1.0.0 -> 1.0.1 as an example.

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.

Expand All @@ -29,4 +33,4 @@ Adding new methods is perfectly fine as it won't break current plugins depending
Under no circumstance is existing methods suppose to have a change to the variables in the methods. You can change anything inside the method.
* i.e. UUID cannot become Player in `getKeys`, You should create a new method and deprecate the old one.

If trying to expose internal hashmap's or arraylists using the API, Return an unmodifiable version of the map/arraylists
If trying to expose internal hashmap's or arraylists using the API, Return an unmodifiable version of the map/arraylists
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2016-2023 CrazyCrew
Copyright (c) 2016-2024 CrazyCrew

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
25 changes: 16 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,34 @@ A list of things necessary to make sure you can build CrazyCrates properly.
* Intellij IDEA
* > https://www.jetbrains.com/idea/download/
* Gradle
* Java 21

### Installation
1. Clone the repo
```sh
git clone https://github.com/Crazy-Crew/CrazyCrates.git
```
2. Open the repository using Intellij IDEA & wait until it finishes downloading/indexing.
3. Run the clean assemble task.
3. Run the assemble task.
```gradle
./gradlew clean assemble
./gradlew assemble
```
4. Open the `jars` directory in your root folder.
5. Profit!

## Roadmap
Check our public [trello board](https://trello.com/b/bzQ5TwXo) 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 `dev` branch to add your feature/fix.
## Support the Developers
Ryder Belserion on:
* [Github Sponsors](https://github.com/sponsors/ryderbelserion)
* [Kofi](https://ko-fi.com/ryderbelserion)

TDL on:
* [Kofi](https://ko-fi.com/truedarklord)

BadBones on:
* [Paypal](https://www.paypal.me/joewojcik/)

## License
Distributed under the MIT License. See [`LICENSE`](/LICENSE) for more information.
Expand All @@ -98,4 +105,4 @@ Distributed under the MIT License. See [`LICENSE`](/LICENSE) for more informatio
[license-shield]: https://img.shields.io/github/license/Crazy-Crew/CrazyCrates.svg?style=flat&logo=appveyor
[license-url]: https://github.com/Crazy-Crew/CrazyCrates/blob/master/LICENSE

[codefactor-shield]: https://img.shields.io/codefactor/grade/github/crazy-crew/crazycrates/main?style=flat&logo=appveyor
[codefactor-shield]: https://img.shields.io/codefactor/grade/github/crazy-crew/crazycrates/main?style=flat&logo=appveyor
77 changes: 57 additions & 20 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
plugins {
id("io.github.goooler.shadow")

`root-plugin`
`java-plugin`
}

project.group = "us.crazycrew.crazycrates"
project.version = "1.0-snapshot"

repositories {
maven("https://repo.papermc.io/repository/maven-public/")
}
project.version = "0.5"

dependencies {
compileOnly("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")

compileOnly(libs.config.me)

compileOnly(libs.vital)
compileOnly("net.kyori", "adventure-api", "4.17.0")
}

java {
withSourcesJar()
withJavadocJar()
}
val javaComponent: SoftwareComponent = components["java"]

tasks {
val sourcesJar by creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}

val javadocJar by creating(Jar::class) {
dependsOn.add(javadoc)
archiveClassifier.set("javadoc")
from(javadoc)
}

publishing {
repositories {
maven {
url = uri("https://repo.crazycrew.us/snapshots")
url = uri("https://repo.crazycrew.us/releases")

credentials {
this.username = System.getenv("gradle_username")
Expand All @@ -39,11 +39,48 @@ tasks {

publications {
create<MavenPublication>("maven") {
group = project.group
artifactId = project.name
version = "${project.version}"
artifactId = "api"

artifact(shadowJar)
from(javaComponent)

artifact(sourcesJar)
artifact(javadocJar)

versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}

pom {
name.set("CrazyCrates API")
description.set("The official API of CrazyCrates")
url.set("https://modrinth.com/plugin/crazycrates")

licenses {
licenses {
name.set("MIT")
url.set("https://opensource.org/licenses/MIT")
}
}

developers {
developer {
id.set("ryderbelserion")
name.set("Ryder Belserion")
email.set("no-reply@ryderbelserion.com")
}
}

scm {
connection.set("scm:git:git://github.com/Crazy-Crew/CrazyCrates")
developerConnection.set("scm:git:ssh://github.com/Crazy-Crew/CrazyCrates")
url.set("https://github.com/Crazy-Crew/CrazyCrates")
}
}
}
}
}
Expand Down
24 changes: 19 additions & 5 deletions api/src/main/java/us/crazycrew/crazycrates/CratesProvider.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
package us.crazycrew.crazycrates;

import org.jetbrains.annotations.ApiStatus;
import us.crazycrew.crazycrates.platform.Server;
import org.jetbrains.annotations.NotNull;
import us.crazycrew.crazycrates.platform.IServer;

/**
* A class used to initialize the api so other plugins can use it.
*
* @author Ryder Belserion
* @version 1.0-snapshot
* @version 0.5
* @since 0.4
*/
public class CratesProvider {

private static Server instance;
private static IServer instance;

public static Server get() {
/**
* @return {@link IServer}
* @since 0.4
*/
public static IServer get() {
if (instance == null) {
throw new IllegalStateException("CrazyCrates API is not loaded.");
}
Expand All @@ -26,13 +32,21 @@ private CratesProvider() {
throw new UnsupportedOperationException("This class cannot be instantiated");
}

/**
* Creates {@link IServer} instance.
*
* @param instance the {@link IServer} instance
*/
@ApiStatus.Internal
public static void register(Server instance) {
public static void register(@NotNull final IServer instance) {
if (CratesProvider.instance != null) return;

CratesProvider.instance = instance;
}

/**
* Unregisters {@link IServer} instance.
*/
@ApiStatus.Internal
public static void unregister() {
CratesProvider.instance = null;
Expand Down

0 comments on commit 8e19c5c

Please sign in to comment.