test(annotations): New @RequireAnnotation
New annotation @RequireAnnotation can be used on annotations so that all classes with that specific annotation must also have another annotation. If this is not true, test will not pass. This annotation takes array of annotations.
This commit is contained in:
@ -7,6 +7,7 @@ import java.lang.annotation.ElementType;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@RequireAnnotation(BlockRegistry.class)
|
||||
public @interface BlockDropPercentage {
|
||||
int value();
|
||||
}
|
||||
|
@ -7,5 +7,6 @@ import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@RequireAnnotation(BlockRegistry.class)
|
||||
public @interface BreakableByWater {
|
||||
}
|
||||
|
@ -7,5 +7,6 @@ import java.lang.annotation.ElementType;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@RequireAnnotation(BlockRegistry.class)
|
||||
public @interface BreaksByPlace {
|
||||
}
|
||||
|
@ -7,5 +7,6 @@ import java.lang.annotation.ElementType;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@RequireAnnotation(BlockRegistry.class)
|
||||
public @interface BreaksFalling {
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import java.lang.annotation.*;
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@Repeatable(CustomDrops.class)
|
||||
@RequireAnnotation(BlockRegistry.class)
|
||||
public @interface CustomDrop {
|
||||
String tool();
|
||||
String drops();
|
||||
|
@ -7,6 +7,7 @@ import java.lang.annotation.ElementType;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@RequireAnnotation(ItemRegistry.class)
|
||||
public @interface Fuel {
|
||||
double value();
|
||||
}
|
||||
|
@ -7,5 +7,6 @@ import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@RequireAnnotation(BlockRegistry.class)
|
||||
public @interface PlaceOnSolid {
|
||||
}
|
||||
|
@ -7,5 +7,6 @@ import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@RequireAnnotation(BlockRegistry.class)
|
||||
public @interface PlaceOnSolidNoHandler {
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
package cz.jzitnik.game.annotations;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
@Target(ElementType.ANNOTATION_TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface RequireAnnotation {
|
||||
Class<? extends Annotation>[] value();
|
||||
}
|
@ -7,5 +7,6 @@ import java.lang.annotation.ElementType;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@RequireAnnotation(BlockRegistry.class)
|
||||
public @interface ResetDataOnMine {
|
||||
}
|
||||
|
@ -7,5 +7,6 @@ import java.lang.annotation.ElementType;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@RequireAnnotation(BlockRegistry.class)
|
||||
public @interface Sapling {
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import java.lang.annotation.ElementType;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@RequireAnnotation(ItemRegistry.class)
|
||||
public @interface Smeltable {
|
||||
String value();
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import cz.jzitnik.game.annotations.CraftingRecipeRegistry;
|
||||
|
||||
@CraftingRecipeRegistry(
|
||||
recipe = {
|
||||
"Allium", "_", "_",
|
||||
"allium", "_", "_",
|
||||
"_", "_", "_",
|
||||
"_", "_", "_"
|
||||
},
|
||||
|
Reference in New Issue
Block a user