-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add EnvRestriction And InternalOf Annotations
Change AdvancedItemSettings
- Loading branch information
1 parent
194ecd1
commit 295a095
Showing
20 changed files
with
121 additions
and
4 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
src/main/java/com/mmodding/mmodding_lib/ducks/AbstractBlockSettingsDuckInterface.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
2 changes: 2 additions & 0 deletions
2
src/main/java/com/mmodding/mmodding_lib/ducks/BlockEntityTypeDuckInterface.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
3 changes: 3 additions & 0 deletions
3
src/main/java/com/mmodding/mmodding_lib/ducks/ChunkNoiseSamplerDuckInterface.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
3 changes: 3 additions & 0 deletions
3
src/main/java/com/mmodding/mmodding_lib/ducks/ClientWorldDuckInterface.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
3 changes: 3 additions & 0 deletions
3
src/main/java/com/mmodding/mmodding_lib/ducks/FallingBlockEntityDuckInterface.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
3 changes: 3 additions & 0 deletions
3
src/main/java/com/mmodding/mmodding_lib/ducks/FlowableFluidDuckInterface.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
2 changes: 2 additions & 0 deletions
2
src/main/java/com/mmodding/mmodding_lib/ducks/GeneratorOptionsDuckInterface.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
3 changes: 3 additions & 0 deletions
3
src/main/java/com/mmodding/mmodding_lib/ducks/LivingEntityDuckInterface.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
3 changes: 3 additions & 0 deletions
3
src/main/java/com/mmodding/mmodding_lib/ducks/NetherPortalBlockDuckInterface.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
2 changes: 2 additions & 0 deletions
2
src/main/java/com/mmodding/mmodding_lib/ducks/QuiltEntityTypeBuilderDuckInterface.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
3 changes: 3 additions & 0 deletions
3
src/main/java/com/mmodding/mmodding_lib/ducks/ServerPlayerDuckInterface.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
2 changes: 2 additions & 0 deletions
2
src/main/java/com/mmodding/mmodding_lib/ducks/ServerWorldDuckInterface.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
2 changes: 2 additions & 0 deletions
2
src/main/java/com/mmodding/mmodding_lib/library/glint/GlintPackView.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
55 changes: 55 additions & 0 deletions
55
src/main/java/com/mmodding/mmodding_lib/library/utils/EnvRestriction.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,55 @@ | ||
package com.mmodding.mmodding_lib.library.utils; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Applies an environment restriction to the element used. | ||
* If the side is not the same as the current one it will crash. | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.TYPE, ElementType.TYPE_USE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.PACKAGE}) | ||
public @interface EnvRestriction { | ||
|
||
Side side() default Side.COMMON; | ||
|
||
enum Side { | ||
|
||
/** | ||
* Means that the annotated member should be only used by the client thread. | ||
*/ | ||
CLIENT_THREAD, | ||
|
||
/** | ||
* Means that the annotated member should be only used on the client side. | ||
*/ | ||
CLIENT_COMMON, | ||
|
||
/** | ||
* Means that the annotated member can be used an all sides. This is the default value. | ||
*/ | ||
COMMON, | ||
|
||
/** | ||
* Means that the annotated member should be only used on the server side. (Integrated or Dedicated, we don't really care). | ||
*/ | ||
SERVER_COMMON, | ||
|
||
/** | ||
* Means that the annotated member should be only used by the server thread. | ||
*/ | ||
SERVER_THREAD, | ||
|
||
/** | ||
* Means that the annotated member should be only used by an integrated server thread. | ||
*/ | ||
INTEGRATED_SERVER_THREAD, | ||
|
||
/** | ||
* Means that the annotated member should be only used by a dedicated server thread. | ||
*/ | ||
DEDICATED_SERVER_THREAD | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/mmodding/mmodding_lib/library/utils/InternalOf.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.mmodding.mmodding_lib.library.utils; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* This annotation represents a class, a method or a field which is | ||
*/ | ||
@Retention(RetentionPolicy.CLASS) | ||
@Target({ElementType.TYPE, ElementType.TYPE_USE, ElementType.FIELD, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.PACKAGE}) | ||
public @interface InternalOf { | ||
|
||
Class<?>[] targets(); | ||
} |
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