-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Support new sound serdes after bukkit api update. Drop java 17 support (WiP) * Fix some issues * Create universal old enum composer * Fix local publisher * @compatibility WiP * Use CompatibilityService * Fix * Improve dependency injector management * Update multification. * Prevent redundant delay marking when looping through items * Do not wrap Supplier in another Supplier Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Fixes * Fix potion effect * Fix SHORT_GRASS * Add Material.LEGACY_GRASS, * Rename HOW_USE_DI.md to HOW_USE_TO_DI.md --------- Co-authored-by: Rollczi <[email protected]> Co-authored-by: CitralFlo <[email protected]> Co-authored-by: Jakub Kędziora <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
- Loading branch information
1 parent
663b19c
commit 79f6ffc
Showing
67 changed files
with
487 additions
and
261 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
eternalcore-api/src/main/java/com/eternalcode/core/delay/DelaySettings.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
eternalcore-core/src/main/java/com/eternalcode/core/bridge/BridgeManagerInitializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
eternalcore-core/src/main/java/com/eternalcode/core/bridge/metrics/BStatsMetricsSetup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 3 additions & 4 deletions
7
eternalcore-core/src/main/java/com/eternalcode/core/bridge/skullapi/SkullAPISetup.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
eternalcore-core/src/main/java/com/eternalcode/core/compatibility/Compatibility.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.eternalcode.core.compatibility; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.TYPE) | ||
public @interface Compatibility { | ||
|
||
Version from() default @Version(minor = Integer.MIN_VALUE, patch = Integer.MIN_VALUE); | ||
|
||
Version to() default @Version(minor = Integer.MAX_VALUE, patch = Integer.MAX_VALUE); | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
eternalcore-core/src/main/java/com/eternalcode/core/compatibility/CompatibilityService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.eternalcode.core.compatibility; | ||
|
||
import io.papermc.lib.PaperLib; | ||
|
||
public class CompatibilityService { | ||
|
||
public boolean isCompatible(Class<?> type) { | ||
Compatibility compatibility = type.getAnnotation(Compatibility.class); | ||
if (compatibility == null) { | ||
return true; | ||
} | ||
|
||
Version from = compatibility.from(); | ||
Version to = compatibility.to(); | ||
|
||
int minor = PaperLib.getMinecraftVersion(); | ||
int patch = PaperLib.getMinecraftPatchVersion(); | ||
|
||
return isCompatibleFrom(from, minor, patch) && isCompatibleTo(to, minor, patch); | ||
} | ||
|
||
private boolean isCompatibleTo(Version to, int minor, int patch) { | ||
return minor < to.minor() || minor == to.minor() && patch <= to.patch(); | ||
} | ||
|
||
private boolean isCompatibleFrom(Version from, int minor, int patch) { | ||
return minor > from.minor() || minor == from.minor() && patch >= from.patch(); | ||
} | ||
|
||
} | ||
|
15 changes: 15 additions & 0 deletions
15
eternalcore-core/src/main/java/com/eternalcode/core/compatibility/Version.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.eternalcode.core.compatibility; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.FIELD) | ||
public @interface Version { | ||
|
||
int minor(); | ||
int patch(); | ||
|
||
} |
Oops, something went wrong.