-
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.
- Loading branch information
Showing
11 changed files
with
162 additions
and
57 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
56 changes: 56 additions & 0 deletions
56
common/src/main/java/dev/dubhe/chinesefestivals/festivals/LanternFestival.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,56 @@ | ||
package dev.dubhe.chinesefestivals.festivals; | ||
|
||
import net.minecraft.client.resources.model.ModelResourceLocation; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.Items; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.Blocks; | ||
import net.minecraft.world.level.block.LanternBlock; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
|
||
import java.util.Map; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
import java.util.function.Supplier; | ||
|
||
public class LanternFestival extends LunarFestival { | ||
public LanternFestival() { | ||
super("lantern", 1, 15); | ||
} | ||
|
||
@Override | ||
public ModelResourceLocation getBlockReplace(BlockState blockState) { | ||
if (blockState.is(Blocks.LANTERN) && blockState.getValue(LanternBlock.HANGING)) { | ||
return SpringFestival.LANTERN; | ||
} | ||
if (blockState.is(Blocks.SOUL_LANTERN) && blockState.getValue(LanternBlock.HANGING)) { | ||
return SpringFestival.TALL_LANTERN; | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public String getBlockTranslateReplace(Block block) { | ||
var key = BuiltInRegistries.BLOCK.getKey(block); | ||
if (!(block instanceof LanternBlock && "minecraft".equals(key.getNamespace()))) return null; | ||
return switch (key.getPath()) { | ||
case "lantern" -> "block.chinesefestivals.lantern"; | ||
case "soul_lantern" -> "block.chinesefestivals.tall_lantern"; | ||
default -> null; | ||
}; | ||
} | ||
|
||
@Override | ||
public Map<Item, Supplier<Item>> getItemReplace() { | ||
Map<Item, Supplier<Item>> map = new ConcurrentHashMap<>(); | ||
map.put(Items.BEETROOT_SOUP, LabaFestival.SWEET_DUMPLINGS); | ||
return map; | ||
} | ||
|
||
@Override | ||
public Map<String, Supplier<String>> getTranslationReplace() { | ||
return new ConcurrentHashMap<>() {{ | ||
this.put("item.minecraft.beetroot_soup", () -> "item.chinesefestivals.sweet_dumplings"); | ||
}}; | ||
} | ||
} |
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
29 changes: 19 additions & 10 deletions
29
common/src/main/resources/assets/chinesefestivals/lang/en_us.json
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 |
---|---|---|
@@ -1,17 +1,26 @@ | ||
{ | ||
"item.chinesefestivals.mooncake": "Mooncake", | ||
"block.chinesefestivals.hotpot_n": "Clear Soup Hot Pot", | ||
"block.chinesefestivals.hotpot_s": "Jiugongge Hot Pot", | ||
"block.chinesefestivals.lantern": "Lantern", | ||
"block.chinesefestivals.mooncakes": "Mooncakes", | ||
"block.chinesefestivals.tall_lantern": "Tall Lantern", | ||
"command.debug.message": "Festivals have been set as %s.", | ||
"entity.chinesefestivals.plate": "Plate", | ||
"entity.chinesefestivals.plate_dark": "Dark plate", | ||
"festival.dong_zhi.name": "Dongzhi Festival", | ||
"festival.double_ninth.name": "Double Ninth Festival", | ||
"festival.dragon_boat.name": "Dragon Boat Festival", | ||
"festival.laba.name": "Laba Festival", | ||
"festival.lantern.name": "Lantern Festival", | ||
"festival.moon.name": "Moon Festival", | ||
"festival.qixi.name": "Qixi Festival", | ||
"festival.spring.name": "Spring Festival", | ||
"item.chinesefestivals.dumplings": "Dumplings", | ||
"item.chinesefestivals.flower_cake": "Flower cake", | ||
"item.chinesefestivals.hotpot_s": "Jiugongge Hot Pot", | ||
"item.chinesefestivals.hotpot_n": "Clear Soup Hot Pot", | ||
"item.chinesefestivals.dumplings": "Dumplings", | ||
"item.chinesefestivals.hotpot_s": "Jiugongge Hot Pot", | ||
"item.chinesefestivals.laba_congee": "Laba Congee", | ||
"item.chinesefestivals.mooncake": "Mooncake", | ||
"item.chinesefestivals.sweet_dumplings": "Sweet Dumplings", | ||
"block.chinesefestivals.mooncakes": "Mooncakes", | ||
"block.chinesefestivals.hotpot_s": "Jiugongge Hot Pot", | ||
"block.chinesefestivals.hotpot_n": "Clear Soup Hot Pot", | ||
"entity.chinesefestivals.plate": "Plate", | ||
"entity.chinesefestivals.plate_dark": "Dark plate", | ||
"block.chinesefestivals.lantern": "Lantern", | ||
"block.chinesefestivals.tall_lantern": "Tall Lantern", | ||
"item.firework_star.shape.dragon": "Dragon-shaped" | ||
} |
27 changes: 18 additions & 9 deletions
27
common/src/main/resources/assets/chinesefestivals/lang/lzh.json
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 |
---|---|---|
@@ -1,17 +1,26 @@ | ||
{ | ||
"block.chinesefestivals.hotpot_n": "清湯古董羹", | ||
"block.chinesefestivals.hotpot_s": "九宮格古董羹", | ||
"block.chinesefestivals.lantern": "燈籠", | ||
"block.chinesefestivals.mooncakes": "月團", | ||
"item.chinesefestivals.mooncake": "月團", | ||
"block.chinesefestivals.tall_lantern": "高燈籠", | ||
"command.debug.message": "節已為%s。", | ||
"entity.chinesefestivals.plate": "玉盤", | ||
"entity.chinesefestivals.plate_dark": "玄玉盤", | ||
"festival.dong_zhi.name": "冬至", | ||
"festival.double_ninth.name": "重陽", | ||
"festival.dragon_boat.name": "端午", | ||
"festival.laba.name": "臘八", | ||
"festival.lantern.name": "元宵", | ||
"festival.moon.name": "仲秋", | ||
"festival.qixi.name": "乞巧", | ||
"festival.spring.name": "春節", | ||
"item.chinesefestivals.dumplings": "交子", | ||
"item.chinesefestivals.flower_cake": "重陽糕", | ||
"item.chinesefestivals.hotpot_s": "九宮格古董羹", | ||
"item.chinesefestivals.hotpot_n": "清湯古董羹", | ||
"item.chinesefestivals.dumplings": "交子", | ||
"block.chinesefestivals.hotpot_s": "九宮格古董羹", | ||
"block.chinesefestivals.hotpot_n": "清湯古董羹", | ||
"item.chinesefestivals.hotpot_s": "九宮格古董羹", | ||
"item.chinesefestivals.laba_congee": "臘八粥", | ||
"item.chinesefestivals.mooncake": "月團", | ||
"item.chinesefestivals.sweet_dumplings": "浮圓子", | ||
"entity.chinesefestivals.plate": "玉盤", | ||
"entity.chinesefestivals.plate_dark": "玄玉盤", | ||
"block.chinesefestivals.lantern": "燈籠", | ||
"block.chinesefestivals.tall_lantern": "高燈籠", | ||
"item.firework_star.shape.dragon": "龍狀" | ||
} |
27 changes: 18 additions & 9 deletions
27
common/src/main/resources/assets/chinesefestivals/lang/zh_cn.json
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 |
---|---|---|
@@ -1,17 +1,26 @@ | ||
{ | ||
"block.chinesefestivals.hotpot_n": "清汤火锅", | ||
"block.chinesefestivals.hotpot_s": "九宫格火锅", | ||
"block.chinesefestivals.lantern": "灯笼", | ||
"block.chinesefestivals.mooncakes": "月饼", | ||
"item.chinesefestivals.mooncake": "月饼", | ||
"block.chinesefestivals.tall_lantern": "高灯笼", | ||
"command.debug.message": "节日已变更为%s。", | ||
"entity.chinesefestivals.plate": "盘子", | ||
"entity.chinesefestivals.plate_dark": "暗色盘子", | ||
"festival.dong_zhi.name": "冬至", | ||
"festival.double_ninth.name": "重阳", | ||
"festival.dragon_boat.name": "端午", | ||
"festival.laba.name": "腊八", | ||
"festival.lantern.name": "元宵节", | ||
"festival.moon.name": "中秋", | ||
"festival.qixi.name": "七夕", | ||
"festival.spring.name": "春节", | ||
"item.chinesefestivals.dumplings": "饺子", | ||
"item.chinesefestivals.flower_cake": "重阳糕", | ||
"item.chinesefestivals.hotpot_s": "九宫格火锅", | ||
"item.chinesefestivals.hotpot_n": "清汤火锅", | ||
"item.chinesefestivals.dumplings": "饺子", | ||
"block.chinesefestivals.hotpot_s": "九宫格火锅", | ||
"block.chinesefestivals.hotpot_n": "清汤火锅", | ||
"item.chinesefestivals.hotpot_s": "九宫格火锅", | ||
"item.chinesefestivals.laba_congee": "腊八粥", | ||
"item.chinesefestivals.mooncake": "月饼", | ||
"item.chinesefestivals.sweet_dumplings": "汤圆", | ||
"entity.chinesefestivals.plate": "盘子", | ||
"entity.chinesefestivals.plate_dark": "暗色盘子", | ||
"block.chinesefestivals.lantern": "灯笼", | ||
"block.chinesefestivals.tall_lantern": "高灯笼", | ||
"item.firework_star.shape.dragon": "龙形" | ||
} |
27 changes: 18 additions & 9 deletions
27
common/src/main/resources/assets/chinesefestivals/lang/zh_hk.json
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 |
---|---|---|
@@ -1,17 +1,26 @@ | ||
{ | ||
"block.chinesefestivals.hotpot_n": "清湯火鍋", | ||
"block.chinesefestivals.hotpot_s": "九宮格火鍋", | ||
"block.chinesefestivals.lantern": "燈籠", | ||
"block.chinesefestivals.mooncakes": "月餅", | ||
"item.chinesefestivals.mooncake": "月餅", | ||
"block.chinesefestivals.tall_lantern": "高燈籠", | ||
"command.debug.message": "節日已變更為%s。", | ||
"entity.chinesefestivals.plate": "盤子", | ||
"entity.chinesefestivals.plate_dark": "暗色盤子", | ||
"festival.dong_zhi.name": "冬至", | ||
"festival.double_ninth.name": "重陽", | ||
"festival.dragon_boat.name": "端午", | ||
"festival.laba.name": "臘八", | ||
"festival.lantern.name": "元宵節", | ||
"festival.moon.name": "中秋", | ||
"festival.qixi.name": "七夕", | ||
"festival.spring.name": "春節", | ||
"item.chinesefestivals.dumplings": "餃子", | ||
"item.chinesefestivals.flower_cake": "重陽糕", | ||
"item.chinesefestivals.hotpot_s": "九宮格火鍋", | ||
"item.chinesefestivals.hotpot_n": "清湯火鍋", | ||
"item.chinesefestivals.dumplings": "餃子", | ||
"block.chinesefestivals.hotpot_s": "九宮格火鍋", | ||
"block.chinesefestivals.hotpot_n": "清湯火鍋", | ||
"item.chinesefestivals.hotpot_s": "九宮格火鍋", | ||
"item.chinesefestivals.laba_congee": "臘八粥", | ||
"item.chinesefestivals.mooncake": "月餅", | ||
"item.chinesefestivals.sweet_dumplings": "湯圓", | ||
"entity.chinesefestivals.plate": "盤子", | ||
"entity.chinesefestivals.plate_dark": "暗色盤子", | ||
"block.chinesefestivals.lantern": "燈籠", | ||
"block.chinesefestivals.tall_lantern": "高燈籠", | ||
"item.firework_star.shape.dragon": "龍形" | ||
} |
27 changes: 18 additions & 9 deletions
27
common/src/main/resources/assets/chinesefestivals/lang/zh_tw.json
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 |
---|---|---|
@@ -1,17 +1,26 @@ | ||
{ | ||
"block.chinesefestivals.hotpot_n": "清湯火鍋", | ||
"block.chinesefestivals.hotpot_s": "九宮格火鍋", | ||
"block.chinesefestivals.lantern": "燈籠", | ||
"block.chinesefestivals.mooncakes": "月餅", | ||
"item.chinesefestivals.mooncake": "月餅", | ||
"block.chinesefestivals.tall_lantern": "高燈籠", | ||
"command.debug.message": "節日已變更為%s。", | ||
"entity.chinesefestivals.plate": "盤子", | ||
"entity.chinesefestivals.plate_dark": "暗色盤子", | ||
"festival.dong_zhi.name": "冬至", | ||
"festival.double_ninth.name": "重陽", | ||
"festival.dragon_boat.name": "端午", | ||
"festival.laba.name": "臘八", | ||
"festival.lantern.name": "元宵節", | ||
"festival.moon.name": "中秋", | ||
"festival.qixi.name": "七夕", | ||
"festival.spring.name": "春節", | ||
"item.chinesefestivals.dumplings": "餃子", | ||
"item.chinesefestivals.flower_cake": "重陽糕", | ||
"item.chinesefestivals.hotpot_s": "九宮格火鍋", | ||
"item.chinesefestivals.hotpot_n": "清湯火鍋", | ||
"item.chinesefestivals.dumplings": "餃子", | ||
"block.chinesefestivals.hotpot_s": "九宮格火鍋", | ||
"block.chinesefestivals.hotpot_n": "清湯火鍋", | ||
"item.chinesefestivals.hotpot_s": "九宮格火鍋", | ||
"item.chinesefestivals.laba_congee": "臘八粥", | ||
"item.chinesefestivals.mooncake": "月餅", | ||
"item.chinesefestivals.sweet_dumplings": "湯圓", | ||
"entity.chinesefestivals.plate": "盤子", | ||
"entity.chinesefestivals.plate_dark": "暗色盤子", | ||
"block.chinesefestivals.lantern": "燈籠", | ||
"block.chinesefestivals.tall_lantern": "高燈籠", | ||
"item.firework_star.shape.dragon": "龍形" | ||
} |
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