Skip to content

Commit

Permalink
Merge branch 'master' into feature/sign-command-editor
Browse files Browse the repository at this point in the history
  • Loading branch information
vLuckyyy committed Jan 23, 2025
2 parents aa76ccb + 046c0df commit 2c16d2b
Show file tree
Hide file tree
Showing 151 changed files with 1,882 additions and 785 deletions.
8 changes: 4 additions & 4 deletions .github/HOW_USE_DI.md → .github/HOW_USE_TO_DI.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public class UserCommand {
#### 7. Subscriber
```java
@Controller // <- marks a class that will be registered as an event subscriber.
public class UserSubscriber implements Subscriber {
public class UserSubscriber {

private final UserService exampleService;

Expand All @@ -126,12 +126,12 @@ public class UserSubscriber implements Subscriber {
}
```

#### 8. BeanSetup
BeanSetup is a class that allows you to register beans in the bean container.
#### 8. Setup
Setup is an annotation that allows you to register beans in the bean container.
It is used to register dependencies that are cannot be registered in the bean container using annotations. e.g. MiniMessage, AdventureProvider, HikariDataSource, etc.
```java

@BeanSetup // <- marks a class that will be registered as a bean holder.
@Setup // <- marks a class that will be registered as a bean holder.
public class UserBeanSetup {

@Bean // <- marks a method that will be registered as a bean. (dependency)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
steps:
- name: Checkout
uses: actions/[email protected].1
uses: actions/[email protected].2
- name: 'Set up JDK ${{ matrix.java }}'
uses: actions/[email protected]
with:
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ EternalCore is your ultimate companion for enhancing your Minecraft server exper

## :information_source: Information

- EternalCore fully supports Minecraft's latest minor versions starting from each major version, starting from 1.17 onward, e.g. `1.17.1`, `1.18.2`, `1.19.4`, `1.20.6`, `1.21.1`.
- Requires **Java 17 or later** to work properly. For older versions of Java, this may affect the functionality of the plugin.
- EternalCore fully supports Minecraft's latest minor versions starting from each major version, starting from 1.17 onward, e.g. `1.17.1`, `1.18.2`, `1.19.4`, `1.20.6`, `1.21.4`.
- Requires **Java 21 or later** to work properly. For older versions of Java, this may affect the functionality of the plugin.
- If you have any questions, perhaps you will find a solution to them in our [documentation](https://docs.eternalcode.pl/eternalcore/introduction.html), you can also ask us about it on [discord](https://discord.gg/FQ7jmGBd6c).

## :hammer_and_wrench: Development Builds
Expand Down Expand Up @@ -80,15 +80,15 @@ For Maven projects use:

For Gradle projects use:
```kts
compileOnly("com.eternalcode:eternalcore-api:1.4.0")
compileOnly("com.eternalcode:eternalcore-api:1.5.2")
```

For Maven projects use:
```xml
<dependency>
<groupId>com.eternalcode</groupId>
<artifactId>eternalcore-api</artifactId>
<version>1.4.0</version>
<version>1.5.2</version>
<scope>provided</scope>
</dependency>
```
Expand All @@ -97,7 +97,7 @@ For Maven projects use:

## :building_construction: Building

To build EternalCore, follow these steps (Make sure you have **JDK 17 or higher**):
To build EternalCore, follow these steps (Make sure you have **JDK 21 or higher**):

```shell
./gradlew clean eternalcore-plugin:shadowJar
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

dependencies {
implementation("net.kyori:blossom:1.3.1")
implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.3")
implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.5")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.0")
implementation("net.minecrell:plugin-yml:0.6.0")
}
Expand Down
25 changes: 12 additions & 13 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
object Versions {

const val SPIGOT_API = "1.19.4-R0.1-SNAPSHOT"
const val PAPER_API = "1.19.4-R0.1-SNAPSHOT"
const val SPIGOT_API = "1.21.3-R0.1-SNAPSHOT"
const val PAPER_API = "1.21.3-R0.1-SNAPSHOT"

const val ETERNALCODE_COMMONS = "1.1.5"
const val MULTIFICATION = "1.2.1"

const val JETBRAINS_ANNOTATIONS = "26.0.1"
const val PLACEHOLDER_API = "2.11.6"
const val LOMBOK = "1.18.34"
const val LOMBOK = "1.18.36"
const val GIT_CHECK = "1.0.0"

const val PAPERLIB = "1.0.8"
const val ADVENTURE_PLATFORM = "4.3.4"
const val ADVENTURE_TEXT_MINIMESSAGE = "4.18.0-SNAPSHOT"
const val ADVENTURE_TEXT_MINIMESSAGE = "4.18.0"
const val ADVENTURE_PLATFORM_FACET = "4.3.4"
const val CDN_CONFIGS = "1.14.5"
const val CDN_CONFIGS = "1.14.6"

const val MARIA_DB = "3.5.1"
const val POSTGRESQL = "42.7.4"
const val POSTGRESQL = "42.7.5"
const val H2 = "2.3.232"
const val ORMLITE = "6.1"
const val HIKARI_CP = "6.2.1"
Expand All @@ -33,21 +33,20 @@ object Versions {
const val PANDA_UTILITIES = "0.5.3-alpha"
const val APACHE_COMMONS = "2.18.0"

const val TRIUMPH_GUI = "3.1.10"
const val TRIUMPH_GUI = "3.1.11"

const val BSTATS = "3.1.0"
const val PIXEL_WIDTH = "1.1.0"

const val CAFFEINE = "3.1.8"
const val CAFFEINE = "3.2.0"

const val SPOTIFY_COMPLETABLE_FUTURES = "0.3.6"

// tests
const val EXPRESSIBLE_JUNIT = "1.3.6"
const val GROOVY_ALL = "3.0.22"
const val JUNIT_JUPITER_API = "5.11.2"
const val JUNIT_JUPITER_PARAMS = "5.11.2"
const val JUNIT_JUPITER_ENGINE = "5.11.2"
const val GROOVY_ALL = "3.0.23"
const val JUNIT_JUPITER_API = "5.11.4"
const val JUNIT_JUPITER_PARAMS = "5.11.4"
const val JUNIT_JUPITER_ENGINE = "5.11.4"
const val MOCKITO_CORE = "5.15.2"

}
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/eternalcode-java.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = "com.eternalcode"
version = "1.4.0"
version = "1.5.2"

checkstyle {
toolVersion = "10.21.1"
Expand Down Expand Up @@ -35,5 +35,5 @@ java {
tasks.withType<JavaCompile>() {
options.compilerArgs = listOf("-Xlint:deprecation", "-parameters")
options.encoding = "UTF-8"
options.release = 17
options.release = 21
}
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/eternalcore-publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = "com.eternalcode"
version = "1.4.0"
version = "1.5.2"

java {
withSourcesJar()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void onHomeTeleport(HomeTeleportEvent event) {

player.sendMessage("Teleporting to home...");

if (player.hasPotionEffect(PotionEffectType.SLOW)) {
if (player.hasPotionEffect(PotionEffectType.SLOWNESS)) {
player.sendMessage("You are slowed down!");
player.teleport(player.getWorld().getSpawnLocation());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ public class Delay<T> {

private final Supplier<Duration> delaySettings;

@Deprecated
public Delay(DelaySettings delaySettings) {
this((Supplier<Duration>) () -> delaySettings.delay());
}

public Delay(Supplier<Duration> delayProvider) {
this.delaySettings = delayProvider;

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package com.eternalcode.core.feature.butcher;

import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

public class ButcherEntityRemoveEvent extends Event implements Cancellable {

private static final HandlerList HANDLER_LIST = new HandlerList();

private boolean cancelled;
private final Entity entity;

public ButcherEntityRemoveEvent(Entity entity) {
this.entity = entity;
}

@Override
public boolean isCancelled() {
return cancelled;
}

@Override
public void setCancelled(boolean cancelled) {
this.cancelled = cancelled;
}

public Entity getEntity() {
return entity;
}

@Override
public HandlerList getHandlers() {
return HANDLER_LIST;
}

public static HandlerList getHandlerList() {
return HANDLER_LIST;
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.eternalcode.core.feature.language;

import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
import java.util.Objects;
import java.util.Set;

public class Language {

Expand All @@ -13,35 +14,37 @@ public class Language {
public static final Language DEFAULT = Language.fromLocale(Locale.ROOT);

private final String lang;
private final List<String> aliases;
private final Set<String> aliases;

public Language(String lang, List<String> aliases) {
this.lang = lang;
this.aliases = new ArrayList<>(aliases);
this.aliases = new LinkedHashSet<>(aliases);
}

public String getLang() {
return this.lang;
}

public List<String> getAliases() {
return Collections.unmodifiableList(this.aliases);
public Set<String> getAliases() {
return Collections.unmodifiableSet(this.aliases);
}

public boolean isEquals(Language other) {
if (this.lang.equals(other.lang)) {
return true;
}

for (String alias : this.aliases) {
if (alias.equals(other.lang)) {
return true;
}
if (this.lang.startsWith(other.lang) || other.lang.startsWith(this.lang)) {
return true;
}

for (String otherAlias : other.aliases) {
if (alias.equals(otherAlias)) {
return true;
}
if (this.aliases.contains(other.lang)) {
return true;
}

for (String otherAlias : other.aliases) {
if (this.aliases.contains(otherAlias)) {
return true;
}
}

Expand Down Expand Up @@ -71,7 +74,7 @@ public static Language fromLocale(Locale locale) {
}

public Locale toLocale() {
return new Locale(this.lang);
return Locale.of(this.lang);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.eternalcode.core.feature.language;

import java.util.UUID;

public interface LanguageProvider {

Language getDefaultLanguage(UUID player);

}
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
package com.eternalcode.core.feature.language;

import java.util.Locale;
import org.bukkit.entity.Player;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;

public interface LanguageService {

Locale getPlayerLanguage(Player player);
void setDefaultProvider(LanguageProvider defaultProvider);

LanguageProvider getDefaultProvider();

CompletableFuture<Language> getLanguage(UUID playerUniqueId);

Language getLanguageNow(UUID playerUniqueId);

CompletableFuture<Void> setLanguage(UUID playerUniqueId, Language language);

CompletableFuture<Void> setDefaultLanguage(UUID playerUniqueId);

void setPlayerLanguage(Player player, Locale locale);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,26 @@

import org.bukkit.Location;

import java.util.List;
import org.bukkit.permissions.Permissible;

public interface Warp {

Location getLocation();

String getName();

List<String> getPermissions();

default boolean hasPermissions(Permissible permissible) {
List<String> permissions = this.getPermissions();
if (permissions.isEmpty()) {
return true;
}

return permissions
.stream()
.anyMatch(permission -> permissible.hasPermission(permission));
}

}
Loading

0 comments on commit 2c16d2b

Please sign in to comment.