Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

l拉取更新 #107

Merged
merged 10 commits into from
Mar 8, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
String en_us();
String zh_cn();
String zh_tw();
String descriptionId() default "";
Other[] other() default {};
@interface Other {
String value();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,17 @@ public void classDef(TypeElement typeElement) {
VariableElement variableElement = (VariableElement) element;
I18n i18n = variableElement.getAnnotation(I18n.class);
if (i18n != null) {
add("en_us", ".add(%s, \"%s\")".formatted(typeElement.getQualifiedName() + "." + variableElement.getSimpleName(), i18n.en_us()));
add("zh_cn", ".add(%s, \"%s\")".formatted(typeElement.getQualifiedName() + "." + variableElement.getSimpleName(), i18n.zh_cn()));
add("zh_tw", ".add(%s, \"%s\")".formatted(typeElement.getQualifiedName() + "." + variableElement.getSimpleName(), i18n.zh_tw()));
String name;
if(i18n.descriptionId().isEmpty()) {
name = typeElement.getQualifiedName() + "." + variableElement.getSimpleName();
} else {
name = "\"" + i18n.descriptionId() + "\"";
}
add("en_us", ".add(%s, \"%s\")".formatted(name, i18n.en_us()));
add("zh_cn", ".add(%s, \"%s\")".formatted(name, i18n.zh_cn()));
add("zh_tw", ".add(%s, \"%s\")".formatted(name, i18n.zh_tw()));
for (I18n.Other other : i18n.other()) {
add(other.value(), ".add(%s, \"%s\")".formatted(typeElement.getQualifiedName() + "." + variableElement.getSimpleName(), other.translate()));
add(other.value(), ".add(%s, \"%s\")".formatted(name, other.translate()));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@ public enum ModTranslateKey implements Supplier<TranslatableContents> {

ModTranslateKey(String... keys) {
StringBuilder key = new StringBuilder();
for (int i = 0; i < keys.length; i++) {
String k = keys[i];
if (i == 1) {
key.append(k);
} else {
key.append(".").append(k);
if(keys.length != 0) {
key.append(keys[0]);
for (int i = 1; i < keys.length; i++) {
key.append(".").append(keys[i]);
}
}
translatable = Component.translatable(key.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.minecraft.world.level.block.*;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.block.grower.TreeGrower;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
import net.minecraft.world.level.material.MapColor;
Expand Down Expand Up @@ -216,13 +215,13 @@ public class ModBlocks {
@I18n(en_us = "Azalea Sign", zh_cn = "杜鹃木告示牌", zh_tw = "杜鵑木告示牌")
public static final DeferredBlock<StandingSignBlock> AZALEA_SIGN =
register("azalea_sign", props -> new StandingSignBlock(ModWoodSettings.AZALEA.woodType, props), BlockBehaviour.Properties.ofFullCopy(Blocks.MANGROVE_SIGN));
@I18n(en_us = "Azalea Wall Sign", zh_cn = "墙上的杜鹃木告示牌", zh_tw = "牆上的杜鵑木告示牌")
@I18n(en_us = "Azalea Wall Sign", zh_cn = "墙上的杜鹃木告示牌", zh_tw = "牆上的杜鵑木告示牌", descriptionId = "block.wild_wind.azalea_wall_sign")
public static final DeferredBlock<WallSignBlock> AZALEA_WALL_SIGN =
register("azalea_wall_sign", props -> new WallSignBlock(ModWoodSettings.AZALEA.woodType, props), BlockBehaviour.Properties.ofFullCopy(Blocks.MANGROVE_WALL_SIGN).lootFrom(AZALEA_SIGN));
@I18n(en_us = "Azalea Hanging Sign", zh_cn = "悬挂式杜鹃木告示牌", zh_tw = "懸挂式杜鵑木告示牌")
public static final DeferredBlock<CeilingHangingSignBlock> AZALEA_HANGING_SIGN =
register("azalea_hanging_sign", props -> new CeilingHangingSignBlock(ModWoodSettings.AZALEA.woodType, props), BlockBehaviour.Properties.ofFullCopy(Blocks.MANGROVE_HANGING_SIGN));
@I18n(en_us = "Azalea Wall Hanging Sign", zh_cn = "墙上的杜鹃木悬挂式告示牌", zh_tw = "牆上的杜鵑木懸挂式告示牌")
@I18n(en_us = "Azalea Wall Hanging Sign", zh_cn = "墙上的杜鹃木悬挂式告示牌", zh_tw = "牆上的杜鵑木懸挂式告示牌", descriptionId = "block.wild_wind.azalea_wall_hanging_sign")
public static final DeferredBlock<WallHangingSignBlock> AZALEA_WALL_HANGING_SIGN =
register("azalea_wall_hanging_sign", props -> new WallHangingSignBlock(ModWoodSettings.AZALEA.woodType, props), BlockBehaviour.Properties.ofFullCopy(Blocks.MANGROVE_WALL_HANGING_SIGN).lootFrom(AZALEA_HANGING_SIGN));
public static final DeferredItem<BlockItem> AZALEA_LOG_ITEM =
Expand Down Expand Up @@ -299,13 +298,13 @@ public class ModBlocks {
@I18n(en_us = "Palm Sign", zh_cn = "棕榈木告示牌", zh_tw = "棕櫚木告示牌")
public static final DeferredBlock<StandingSignBlock> PALM_SIGN =
register("palm_sign", props -> new StandingSignBlock(ModWoodSettings.PALM.woodType, props), BlockBehaviour.Properties.ofFullCopy(Blocks.SPRUCE_SIGN));
@I18n(en_us = "Palm Wall Sign", zh_cn = "墙上的棕榈木告示牌", zh_tw = "牆上的棕櫚木告示牌")
@I18n(en_us = "Palm Wall Sign", zh_cn = "墙上的棕榈木告示牌", zh_tw = "牆上的棕櫚木告示牌", descriptionId = "block.wild_wind.palm_wall_sign")
public static final DeferredBlock<WallSignBlock> PALM_WALL_SIGN =
register("palm_wall_sign", props -> new WallSignBlock(ModWoodSettings.PALM.woodType, props), BlockBehaviour.Properties.ofFullCopy(Blocks.SPRUCE_WALL_SIGN).lootFrom(PALM_SIGN));
@I18n(en_us = "Palm Hanging Sign", zh_cn = "棕榈木悬挂式告示牌", zh_tw = "棕櫚木懸挂式告示牌")
public static final DeferredBlock<CeilingHangingSignBlock> PALM_HANGING_SIGN =
register("palm_hanging_sign", props -> new CeilingHangingSignBlock(ModWoodSettings.PALM.woodType, props), BlockBehaviour.Properties.ofFullCopy(Blocks.SPRUCE_HANGING_SIGN));
@I18n(en_us = "Palm Wall Hanging Sign", zh_cn = "墙上的棕榈木悬挂式告示牌", zh_tw = "牆上的棕櫚木懸挂式告示牌")
@I18n(en_us = "Palm Wall Hanging Sign", zh_cn = "墙上的棕榈木悬挂式告示牌", zh_tw = "牆上的棕櫚木懸挂式告示牌", descriptionId = "block.wild_wind.palm_wall_hanging_sign")
public static final DeferredBlock<WallHangingSignBlock> PALM_WALL_HANGING_SIGN =
register("palm_wall_hanging_sign", props -> new WallHangingSignBlock(ModWoodSettings.PALM.woodType, props), BlockBehaviour.Properties.ofFullCopy(Blocks.SPRUCE_WALL_HANGING_SIGN).lootFrom(PALM_HANGING_SIGN));
public static final DeferredItem<BlockItem> PALM_LOG_ITEM =
Expand Down Expand Up @@ -389,13 +388,13 @@ public class ModBlocks {
@I18n(en_us = "Baobab Sign", zh_cn = "猴面包木告示牌", zh_tw = "猴麵包木告示牌")
public static final DeferredBlock<StandingSignBlock> BAOBAB_SIGN =
register("baobab_sign", props -> new StandingSignBlock(ModWoodSettings.BAOBAB.woodType, props), BlockBehaviour.Properties.ofFullCopy(Blocks.ACACIA_SIGN));
@I18n(en_us = "Baobab Wall Sign", zh_cn = "墙上的猴面包木告示牌", zh_tw = "牆上的猴麵包木告示牌")
@I18n(en_us = "Baobab Wall Sign", zh_cn = "墙上的猴面包木告示牌", zh_tw = "牆上的猴麵包木告示牌", descriptionId = "block.wild_wind.baobab_wall_sign")
public static final DeferredBlock<WallSignBlock> BAOBAB_WALL_SIGN =
register("baobab_wall_sign", props -> new WallSignBlock(ModWoodSettings.BAOBAB.woodType, props), BlockBehaviour.Properties.ofFullCopy(Blocks.ACACIA_WALL_SIGN).lootFrom(BAOBAB_SIGN));
@I18n(en_us = "Baobab Hanging Sign", zh_cn = "猴面包木悬挂式告示牌", zh_tw = "猴麵包木懸挂式告示牌")
public static final DeferredBlock<CeilingHangingSignBlock> BAOBAB_HANGING_SIGN =
register("baobab_hanging_sign", props -> new CeilingHangingSignBlock(ModWoodSettings.BAOBAB.woodType, props), BlockBehaviour.Properties.ofFullCopy(Blocks.ACACIA_HANGING_SIGN));
@I18n(en_us = "Baobab Wall Hanging Sign", zh_cn = "墙上的猴面包木悬挂式告示牌", zh_tw = "牆上的猴麵包木懸挂式告示牌")
@I18n(en_us = "Baobab Wall Hanging Sign", zh_cn = "墙上的猴面包木悬挂式告示牌", zh_tw = "牆上的猴麵包木懸挂式告示牌", descriptionId = "block.wild_wind.baobab_wall_hanging_sign")
public static final DeferredBlock<WallHangingSignBlock> BAOBAB_WALL_HANGING_SIGN =
register("baobab_wall_hanging_sign", props -> new WallHangingSignBlock(ModWoodSettings.BAOBAB.woodType, props), BlockBehaviour.Properties.ofFullCopy(Blocks.ACACIA_WALL_HANGING_SIGN).lootFrom(BAOBAB_HANGING_SIGN));
public static final DeferredItem<BlockItem> BAOBAB_LOG_ITEM =
Expand Down Expand Up @@ -445,13 +444,13 @@ public class ModBlocks {
//TODO: TreeGrower
@I18n(en_us = "Palm Sapling", zh_cn = "棕榈树苗", zh_tw = "棕櫚樹苗")
public static final DeferredBlock<SaplingBlock> PALM_SAPLING =
register("palm_sapling", props -> new SaplingBlock(TreeGrower.OAK, props), BlockBehaviour.Properties.ofFullCopy(Blocks.SPRUCE_SAPLING));
register("palm_sapling", props -> new SaplingBlock(ModTreeGrowers.PALM, props), BlockBehaviour.Properties.ofFullCopy(Blocks.SPRUCE_SAPLING));
@BasicBlockLocatedItem
public static final DeferredItem<BlockItem> PALM_SAPLING_ITEM =
register("palm_sapling", PALM_SAPLING);
@I18n(en_us = "Baobab Sapling", zh_cn = "猴面包树苗", zh_tw = "猴麵包樹苗")
public static final DeferredBlock<SaplingBlock> BAOBAB_SAPLING =
register("baobab_sapling", props -> new SaplingBlock(TreeGrower.OAK, props), BlockBehaviour.Properties.ofFullCopy(Blocks.ACACIA_SAPLING));
register("baobab_sapling", props -> new SaplingBlock(ModTreeGrowers.BAOBAB, props), BlockBehaviour.Properties.ofFullCopy(Blocks.ACACIA_SAPLING));
@BasicBlockLocatedItem
public static final DeferredItem<BlockItem> BAOBAB_SAPLING_ITEM =
register("baobab_sapling", BAOBAB_SAPLING);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.polaris2023.wild_wind.common.init;

import net.minecraft.data.worldgen.features.TreeFeatures;
import net.minecraft.world.level.block.grower.TreeGrower;

import java.util.Optional;

public class ModTreeGrowers {
public static final TreeGrower PALM = new TreeGrower(
"palm",
0.1F,
Optional.empty(),
Optional.empty(),
Optional.of(TreeFeatures.OAK),
Optional.of(TreeFeatures.FANCY_OAK),
Optional.of(TreeFeatures.OAK_BEES_005),
Optional.of(TreeFeatures.FANCY_OAK_BEES_005)
);
public static final TreeGrower BAOBAB = new TreeGrower(
"baobab",
0.1F,
Optional.empty(),
Optional.empty(),
Optional.of(TreeFeatures.OAK),
Optional.of(TreeFeatures.FANCY_OAK),
Optional.of(TreeFeatures.OAK_BEES_005),
Optional.of(TreeFeatures.FANCY_OAK_BEES_005)
);
}
59 changes: 5 additions & 54 deletions src/main/resources/assets/wild_wind/models/block/sculk_jaw.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"credit": "By KeepMeow",
"parent": "block/block",
"textures": {
"particle": "wild_wind:block/sculk_catalyst_side",
"teeth": "wild_wind:block/sculk_jaw_teeth",
"top": "wild_wind:block/sculk_jaw_top",
"bottom": "minecraft:block/sculk_catalyst_bottom",
"particle": "minecraft:block/sculk_catalyst_side",
"side": "minecraft:block/sculk_catalyst_side"
"bottom": "wild_wind:block/sculk_catalyst_bottom",
"side": "wild_wind:block/sculk_catalyst_side"
},
"elements": [
{
Expand All @@ -20,19 +20,6 @@
"down": {"uv": [0, 0, 16, 16], "texture": "#bottom"}
}
},
{
"from": [0, 0, 0],
"to": [16, 16, 16],
"color": 8,
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#missing"},
"east": {"uv": [0, 0, 16, 16], "texture": "#missing"},
"south": {"uv": [0, 0, 16, 16], "texture": "#missing"},
"west": {"uv": [0, 0, 16, 16], "texture": "#missing"},
"up": {"uv": [0, 0, 16, 16], "texture": "#missing"},
"down": {"uv": [0, 0, 16, 16], "texture": "#missing"}
}
},
{
"from": [2.75, 20.5, 0],
"to": [7.75, 20.5, 16],
Expand All @@ -59,41 +46,5 @@
"down": {"uv": [0, 0, 6, 16], "texture": "#teeth"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [-110, 45, -180],
"translation": [0, 2.75, -1.25],
"scale": [0.4, 0.4, 0.4]
},
"thirdperson_lefthand": {
"rotation": [-110, 45, -180],
"translation": [0, 2.75, -1.25],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"translation": [4.25, 0, -2.25],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, 45, 0],
"translation": [4.25, 0, -2.25],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 2, 0],
"scale": [0.3, 0.3, 0.3]
},
"gui": {
"rotation": [45, 45, 0],
"scale": [0.6, 0.6, 0.6]
},
"head": {
"rotation": [-90, 0, 0]
},
"fixed": {
"scale": [0.5, 0.5, 0.5]
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"credit": "By KeepMeow",
"parent": "block/block",
"textures": {
"particle": "wild_wind:block/sculk_catalyst_side",
"tendril": "wild_wind:block/sculk_jaw_tendril_active",
"teeth": "wild_wind:block/sculk_jaw_teeth",
"top": "wild_wind:block/sculk_jaw_top",
"bottom": "wild_wind:block/sculk_catalyst_bottom",
"tendril": "wild_wind:block/sculk_jaw_tendril_active",
"particle": "wild_wind:block/sculk_catalyst_side",
"side": "wild_wind:block/sculk_catalyst_side"
},
"elements": [
Expand All @@ -15,11 +15,7 @@
"rotation": {"angle": 0, "axis": "y", "origin": [0, -3, 0]},
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#tendril"},
"east": {"uv": [0, 0, 1, 16], "texture": "#missing"},
"south": {"uv": [0, 0, 16, 16], "texture": "#tendril"},
"west": {"uv": [0, 0, 1, 16], "texture": "#missing"},
"up": {"uv": [0, 0, 1, 16], "texture": "#missing"},
"down": {"uv": [0, 0, 1, 16], "texture": "#missing"}
"south": {"uv": [0, 0, 16, 16], "texture": "#tendril"}
}
},
{
Expand All @@ -34,19 +30,6 @@
"down": {"uv": [0, 0, 16, 16], "texture": "#bottom"}
}
},
{
"from": [0, 0, 0],
"to": [16, 16, 16],
"color": 3,
"faces": {
"north": {"uv": [0, 0, 16, 16], "texture": "#missing"},
"east": {"uv": [0, 0, 16, 16], "texture": "#missing"},
"south": {"uv": [0, 0, 16, 16], "texture": "#missing"},
"west": {"uv": [0, 0, 16, 16], "texture": "#missing"},
"up": {"uv": [0, 0, 16, 16], "texture": "#missing"},
"down": {"uv": [0, 0, 16, 16], "texture": "#missing"}
}
},
{
"from": [2.75, 20.5, 0],
"to": [7.75, 20.5, 16],
Expand All @@ -73,54 +56,5 @@
"down": {"uv": [0, 0, 6, 16], "texture": "#teeth"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [-110, 45, -180],
"translation": [0, 2.75, -1.25],
"scale": [0.4, 0.4, 0.4]
},
"thirdperson_lefthand": {
"rotation": [-110, 45, -180],
"translation": [0, 2.75, -1.25],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_righthand": {
"rotation": [0, 45, 0],
"translation": [4.25, 0, -2.25],
"scale": [0.4, 0.4, 0.4]
},
"firstperson_lefthand": {
"rotation": [0, 45, 0],
"translation": [4.25, 0, -2.25],
"scale": [0.4, 0.4, 0.4]
},
"ground": {
"translation": [0, 2, 0],
"scale": [0.3, 0.3, 0.3]
},
"gui": {
"rotation": [45, 45, 0],
"scale": [0.6, 0.6, 0.6]
},
"head": {
"rotation": [-90, 0, 0]
},
"fixed": {
"scale": [0.5, 0.5, 0.5]
}
},
"groups": [
0,
{
"name": "group",
"origin": [8, 8, 8],
"color": 0,
"children": []
},
1,
2,
3,
4
]
}
Loading
Loading