Skip to content

Commit c34109e

Browse files
authored
Merge branch 'main' into main
2 parents 2059a49 + 01deea9 commit c34109e

File tree

172 files changed

+3503
-781
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+3503
-781
lines changed

processor/annotation/src/main/java/org/polaris2023/annotation/language/I18n.java

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
String en_us();
1212
String zh_cn();
1313
String zh_tw();
14+
String descriptionId() default "";
1415
Other[] other() default {};
1516
@interface Other {
1617
String value();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.polaris2023.annotation.modelgen.block;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
6+
/**
7+
* @author : baka4n
8+
* {@code @Date : 2025/02/28 20:38:28}
9+
*/
10+
@Retention(RetentionPolicy.SOURCE)
11+
public @interface AllDoor {
12+
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.polaris2023.annotation.modelgen.block;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
6+
/**
7+
* @author : baka4n
8+
* {@code @Date : 2025/02/28 19:59:37}
9+
*/
10+
@Retention(RetentionPolicy.SOURCE)
11+
public @interface AllSign {
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.polaris2023.annotation.modelgen.block;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
6+
/**
7+
* @author : baka4n
8+
* {@code @Date : 2025/02/28 18:10:06}
9+
*/
10+
@Retention(RetentionPolicy.SOURCE)
11+
public @interface AllWood {
12+
}

processor/annotation/src/main/java/org/polaris2023/annotation/modelgen/block/CubeAll.java

+3
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@
55

66
@Retention(RetentionPolicy.SOURCE)
77
public @interface CubeAll {
8+
boolean item() default true;
9+
String render_type() default "";
10+
String texture() default "";
811
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package org.polaris2023.annotation.modelgen.block;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
6+
/**
7+
* @author : baka4n
8+
* {@code @Date : 2025/02/28 18:45:46}
9+
*/
10+
@Retention(RetentionPolicy.SOURCE)
11+
public @interface CubeColumn {
12+
boolean horizontal() default false;
13+
boolean suffix() default false;
14+
boolean item() default true;
15+
String end() default "";
16+
String side() default "";
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.polaris2023.annotation.modelgen.block;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
6+
/**
7+
* @author : baka4n
8+
* {@code @Date : 2025/02/28 17:16:32}
9+
*/
10+
@Retention(RetentionPolicy.SOURCE)
11+
public @interface Fence {
12+
boolean item() default true;
13+
String texture() default "";
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.polaris2023.annotation.modelgen.block;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
6+
/**
7+
* @author : baka4n
8+
* {@code @Date : 2025/02/28 18:02:29}
9+
*/
10+
@Retention(RetentionPolicy.SOURCE)
11+
public @interface FenceGate {
12+
boolean item() default true;
13+
String texture() default "";
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.polaris2023.annotation.modelgen.block;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
6+
/**
7+
* @author : baka4n
8+
* {@code @Date : 2025/02/24 14:02:16}
9+
*/
10+
@Retention(RetentionPolicy.SOURCE)
11+
public @interface Log {
12+
boolean item() default true;
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.polaris2023.annotation.modelgen.block;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
6+
/**
7+
* @author : baka4n
8+
* {@code @Date : 2025/02/28 19:22:17}
9+
*/
10+
@Retention(RetentionPolicy.SOURCE)
11+
public @interface PressurePlate {
12+
String texture() default "";
13+
boolean item() default true;
14+
}

processor/annotation/src/main/java/org/polaris2023/annotation/modelgen/block/Slab.java

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
@Retention(RetentionPolicy.SOURCE)
77
public @interface Slab {
8+
boolean item() default true;
9+
String all() default "";
810
String bottom() default "";
911
String side() default "";
1012
String top() default "";

processor/annotation/src/main/java/org/polaris2023/annotation/modelgen/block/Stairs.java

+2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55

66
@Retention(RetentionPolicy.SOURCE)
77
public @interface Stairs {
8+
boolean item() default true;
89
String bottom() default "";
910
String side() default "";
1011
String top() default "";
12+
String all() default "";
1113
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.polaris2023.annotation.modelgen.block;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
6+
/**
7+
* @author : baka4n
8+
* {@code @Date : 2025/02/28 19:08:19}
9+
*/
10+
@Retention(RetentionPolicy.SOURCE)
11+
public @interface Wood {
12+
boolean item() default true;
13+
}

processor/annotation/src/main/java/org/polaris2023/annotation/modelgen/item/BasicBlockItem.java

+2
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55

66
@Retention(RetentionPolicy.SOURCE)
77
public @interface BasicBlockItem {
8+
String suffix() default "";
9+
String prefix() default "";
810
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package org.polaris2023.annotation.modelgen.item;
2+
3+
import java.lang.annotation.Retention;
4+
import java.lang.annotation.RetentionPolicy;
5+
6+
@Retention(RetentionPolicy.SOURCE)
7+
public @interface BasicBlockLocatedItem {
8+
}

processor/src/main/java/org/polaris2023/processor/clazz/datagen/I18nProcessor.java

+10-4
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,17 @@ public void classDef(TypeElement typeElement) {
3131
VariableElement variableElement = (VariableElement) element;
3232
I18n i18n = variableElement.getAnnotation(I18n.class);
3333
if (i18n != null) {
34-
add("en_us", ".add(%s, \"%s\")".formatted(typeElement.getQualifiedName() + "." + variableElement.getSimpleName(), i18n.en_us()));
35-
add("zh_cn", ".add(%s, \"%s\")".formatted(typeElement.getQualifiedName() + "." + variableElement.getSimpleName(), i18n.zh_cn()));
36-
add("zh_tw", ".add(%s, \"%s\")".formatted(typeElement.getQualifiedName() + "." + variableElement.getSimpleName(), i18n.zh_tw()));
34+
String name;
35+
if(i18n.descriptionId().isEmpty()) {
36+
name = typeElement.getQualifiedName() + "." + variableElement.getSimpleName();
37+
} else {
38+
name = "\"" + i18n.descriptionId() + "\"";
39+
}
40+
add("en_us", ".add(%s, \"%s\")".formatted(name, i18n.en_us()));
41+
add("zh_cn", ".add(%s, \"%s\")".formatted(name, i18n.zh_cn()));
42+
add("zh_tw", ".add(%s, \"%s\")".formatted(name, i18n.zh_tw()));
3743
for (I18n.Other other : i18n.other()) {
38-
add(other.value(), ".add(%s, \"%s\")".formatted(typeElement.getQualifiedName() + "." + variableElement.getSimpleName(), other.translate()));
44+
add(other.value(), ".add(%s, \"%s\")".formatted(name, other.translate()));
3945
}
4046
}
4147
}

0 commit comments

Comments
 (0)