From 09e35f48d83d9ccb00dfd94cecaa7a18609c9db3 Mon Sep 17 00:00:00 2001 From: HaooooZhang Date: Tue, 20 Aug 2024 22:23:02 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E8=A1=A5=E5=85=A8=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/lang/ChineseLanguageProvider.java | 8 ++++ .../data/lang/EnglishLanguageProvider.java | 18 ++++--- .../core/data/provider/ModelProvider.java | 26 +++++------ .../whispergrove/registers/WGItem.java | 44 ++++++++++++------ .../textures/item/bone_fragment.png | Bin 0 -> 181 bytes .../textures/item/duan_long_gu.png | Bin 0 -> 259 bytes .../whispergrove/textures/item/gui_zhi.png | Bin 0 -> 283 bytes .../textures/item/han_shui_shi.png | Bin 0 -> 369 bytes .../whispergrove/textures/item/he_huan_pi.png | Bin 0 -> 350 bytes .../whispergrove/textures/item/mo_yu_gu.png | Bin 0 -> 262 bytes .../textures/item/sheng_di_huang.png | Bin 0 -> 255 bytes .../textures/item/yang_qi_shi.png | Bin 0 -> 344 bytes .../textures/item/zhi_gan_cao.png | Bin 0 -> 284 bytes .../whispergrove/textures/item/zhu_gu.png | Bin 0 -> 348 bytes .../whispergrove/textures/item/zhu_ye.png | Bin 0 -> 295 bytes .../textures/item/zi_shi_ying.png | Bin 0 -> 331 bytes 16 files changed, 63 insertions(+), 33 deletions(-) create mode 100644 src/main/resources/assets/whispergrove/textures/item/bone_fragment.png create mode 100644 src/main/resources/assets/whispergrove/textures/item/duan_long_gu.png create mode 100644 src/main/resources/assets/whispergrove/textures/item/gui_zhi.png create mode 100644 src/main/resources/assets/whispergrove/textures/item/han_shui_shi.png create mode 100644 src/main/resources/assets/whispergrove/textures/item/he_huan_pi.png create mode 100644 src/main/resources/assets/whispergrove/textures/item/mo_yu_gu.png create mode 100644 src/main/resources/assets/whispergrove/textures/item/sheng_di_huang.png create mode 100644 src/main/resources/assets/whispergrove/textures/item/yang_qi_shi.png create mode 100644 src/main/resources/assets/whispergrove/textures/item/zhi_gan_cao.png create mode 100644 src/main/resources/assets/whispergrove/textures/item/zhu_gu.png create mode 100644 src/main/resources/assets/whispergrove/textures/item/zhu_ye.png create mode 100644 src/main/resources/assets/whispergrove/textures/item/zi_shi_ying.png diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/ChineseLanguageProvider.java b/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/ChineseLanguageProvider.java index b2436fb..240d7ef 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/ChineseLanguageProvider.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/ChineseLanguageProvider.java @@ -107,6 +107,14 @@ protected void addTranslations() { add("tooltip.whispergrove.sliced_long_dan_cao",""); add("item.whispergrove.mo_yu_gu","墨鱼骨"); add("tooltip.whispergrove.mo_yu_gu",""); + add("item.whispergrove.shu_fu_pian","熟附片"); + add("tooltip.whispergrove.shu_fu_pian",""); + add("item.whispergrove.bone_fragment","骨头碎片"); + add("tooltip.whispergrove.bone_fragment",""); + + add("item.whispergrove.roller","药碾"); + add("tooltip.whispergrove.roller",""); + add("block.whispergrove.rou_gui_log","肉桂原木"); add("tooltip.whispergrove.rou_gui_log",""); diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/EnglishLanguageProvider.java b/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/EnglishLanguageProvider.java index b9371c1..57cd608 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/EnglishLanguageProvider.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/EnglishLanguageProvider.java @@ -111,19 +111,25 @@ protected void addTranslations() { add("tooltip.whispergrove.sliced_long_dan_cao",""); add("item.whispergrove.mo_yu_gu","Cuttleflsh Bone"); add("tooltip.whispergrove.mo_yu_gu",""); + add("item.whispergrove.shu_fu_pian","Roasted Prepared Common Monkshood Daughter Root,"); + add("tooltip.whispergrove.shu_fu_pian",""); + add("item.whispergrove.bone_fragment","Bone Fragment"); + add("tooltip.whispergrove.bone_fragment",""); + add("item.whispergrove.roller","roller"); + add("tooltip.whispergrove.roller",""); - add("block.whispergrove.rou_gui_log","肉桂 Log"); + add("block.whispergrove.rou_gui_log","Cinnamon Log"); add("tooltip.whispergrove.rou_gui_log",""); - add("block.whispergrove.rou_gui_stripped_log","Stripped 肉桂 Log"); + add("block.whispergrove.rou_gui_stripped_log","Stripped Cinnamon Log"); add("tooltip.whispergrove.rou_gui_stripped_log",""); - add("block.whispergrove.rou_gui_leaves","肉桂 Leaves"); + add("block.whispergrove.rou_gui_leaves","Cinnamon Leaves"); add("tooltip.whispergrove.rou_gui_leaves",""); - add("block.whispergrove.rou_gui_planks","肉桂 Blank"); + add("block.whispergrove.rou_gui_planks","Cinnamon Blank"); add("tooltip.whispergrove.rou_gui_planks",""); - add("block.whispergrove.rou_gui_slab","肉桂 Slab"); + add("block.whispergrove.rou_gui_slab","Cinnamon Slab"); add("tooltip.whispergrove.rou_gui_slab",""); - add("block.whispergrove.rou_gui_stair","肉桂 Stair"); + add("block.whispergrove.rou_gui_stair","Cinnamon Stair"); add("tooltip.whispergrove.rou_gui_stair",""); } } diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/ModelProvider.java b/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/ModelProvider.java index 212ad68..2caf083 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/ModelProvider.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/ModelProvider.java @@ -17,30 +17,28 @@ public ModelProvider(PackOutput gen, ExistingFileHelper helper) { protected void registerModels() { List.of( "huang_qi", -// "yang_qi_shi", -// "gui_zhi", -// "zi_shi_ying", + "yang_qi_shi", + "gui_zhi", + "zi_shi_ying", "gan_mei_gui", "shu_di_huang", "hai_piao_xiao", "fu_zi", "chao_ding_xiang", "wu_wei_zi", -// "zhi_gan_cao", + "zhi_gan_cao", "ren_shen", "fu_ling", "mai_ya", "e_jiao", -// "duan_long_gu", -// "he_huan_pi", -// "zhu_ye", + "duan_long_gu", + "he_huan_pi", + "zhu_ye", "long_dan_cao", -// "pu_gong_ying", -// "zhu_gu", -// "kun_bu", -// "han_shui_shi", + "zhu_gu", + "han_shui_shi", "gui_ban_jiao", -// "sheng_di_huang", + "sheng_di_huang", "sheng_gan_cao", "sliced_huang_qi", "sliced_gui_zhi", @@ -49,7 +47,9 @@ protected void registerModels() { "gan_cao", "sliced_ren_shen", "sliced_long_dan_cao" -// ,"mo_yu_gu" + ,"mo_yu_gu", + //"shu_fu_pian", + "bone_fragment" ).forEach(s -> this.singleTexture(s, ResourceLocation.withDefaultNamespace("item/generated"), "layer0", ResourceLocation.fromNamespaceAndPath(WhisperGrove.MODID, "item/" + s))); diff --git a/src/main/java/org/hiedacamellia/whispergrove/registers/WGItem.java b/src/main/java/org/hiedacamellia/whispergrove/registers/WGItem.java index 07cec40..13dfd80 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/registers/WGItem.java +++ b/src/main/java/org/hiedacamellia/whispergrove/registers/WGItem.java @@ -174,13 +174,13 @@ public class WGItem { ).build() ); - //蒲公英 Dandelion - //pu gong ying - public static final DeferredItem PU_GONG_YING = ITEMS.register("pu_gong_ying", - () -> new BaseItemBuilder().regname("pu_gong_ying").properties( - new Item.Properties().rarity(Rarity.COMMON) - ).build() - ); +// //蒲公英 Dandelion +// //pu gong ying +// public static final DeferredItem PU_GONG_YING = ITEMS.register("pu_gong_ying", +// () -> new BaseItemBuilder().regname("pu_gong_ying").properties( +// new Item.Properties().rarity(Rarity.COMMON) +// ).build() +// ); //竹茹 Bamboo Shavings //zhu gu @@ -190,13 +190,13 @@ public class WGItem { ).build() ); - //昆布 kelp - //kun bu - public static final DeferredItem KUN_BU = ITEMS.register("kun_bu", - () -> new BaseItemBuilder().regname("kun_bu").properties( - new Item.Properties().rarity(Rarity.COMMON) - ).build() - ); +// //昆布 kelp +// //kun bu +// public static final DeferredItem KUN_BU = ITEMS.register("kun_bu", +// () -> new BaseItemBuilder().regname("kun_bu").properties( +// new Item.Properties().rarity(Rarity.COMMON) +// ).build() +// ); //寒水石 Gypsum //han shui shi @@ -297,4 +297,20 @@ public class WGItem { new Item.Properties().rarity(Rarity.COMMON) ).build() ); + + //熟附片 Roasted Prepared Common Monkshood Daughter Root + //shu fu pian + public static final DeferredItem SHU_FU_PIAN = ITEMS.register("shu_fu_pian", + () -> new BaseItemBuilder().regname("shu_fu_pian").properties( + new Item.Properties().rarity(Rarity.COMMON) + ).build() + ); + + //骨头碎片 bone fragment + //bone fragment + public static final DeferredItem BONE_FRAGMENT = ITEMS.register("bone_fragment", + () -> new BaseItemBuilder().regname("bone_fragment").properties( + new Item.Properties().rarity(Rarity.COMMON) + ).build() + ); } diff --git a/src/main/resources/assets/whispergrove/textures/item/bone_fragment.png b/src/main/resources/assets/whispergrove/textures/item/bone_fragment.png new file mode 100644 index 0000000000000000000000000000000000000000..478a1e0715400cef863e649ba988715e15aab9ba GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP%z!o z#WBR9H#tE<=)sqbOaE(L`t#_e>L(tH+MJjF?f2jRXAfe$+Ld#Or!n*2=ihG?F87!_ zbYA4)7M?RJ-ezyh<(nHM4r;~6PWRoHmf}3YRKZ>TVj$;bj~t#23%F-Qxf(CpomRli Zpw6(!?e&G@&w*Alc)I$ztaD0e0su{XL`whw literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/whispergrove/textures/item/duan_long_gu.png b/src/main/resources/assets/whispergrove/textures/item/duan_long_gu.png new file mode 100644 index 0000000000000000000000000000000000000000..21147c21592b9ec8329a878d1506f2643d287877 GIT binary patch literal 259 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP;jfK zi(`mIZ*qc!(1R0B|NrlJGNa?-8TECo!E);v-NkXyg$;%}D)t~)a77Hz(->>uKxHi8zOXT5+t^W#m zPvoRDJoK6I|43-;#x`cF1V`}=o%c_06rPQ}v?%`o0|VQ-()FKjhh77EfWgz%&t;uc GLK6U+)^6GW literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/whispergrove/textures/item/gui_zhi.png b/src/main/resources/assets/whispergrove/textures/item/gui_zhi.png new file mode 100644 index 0000000000000000000000000000000000000000..2d211fcd9ff92c1faf820122b2e810fa701ac48a GIT binary patch literal 283 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAQ1Gm$ zi(`mIZ*qbJM}TO;NBLuEO75GRH=8*3Onq2CiMJuM?(+xH!=L-@3wJNjI`C-!=55#N zV`e?it3SQr`zuqoIczpnUneiLah}YW=Fu}%G3+c45a`_Ci70wwqs+{F_n=~{wHa`4$d_GV3yA8%u(ld-?Zv39|@X1?$iCKkJK)FW8N%Q9(JQyjp zJ`JdiZB3J5Slj=-Ybqqx-TB!YZXCw!aj_?nVdbnq9tC$}X67ITC#Sh4XC)YHzg}cz ZU?`i}_?gc%)fMP522WQ%mvv4FO#s8!Y#jgq literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/whispergrove/textures/item/han_shui_shi.png b/src/main/resources/assets/whispergrove/textures/item/han_shui_shi.png new file mode 100644 index 0000000000000000000000000000000000000000..7a2f2a6cdde6c0d2538915bc6d10688e35565f4d GIT binary patch literal 369 zcmV-%0gnEOP)rlCes|P!xv0l#XdgD1>q#V?&n?B1plPsGyF8BGo|< z6gTk=1VM06ksw`t2kA3p30Z|Ar6Hm19+xI0y$!ncESGyY-#Pz(&xKuwR=m8vJf(jD zmSu8sI>@_`I8hZ02ghl%X;n@YaoF2G0AN0!ZC4=Tpc^Ku zMN&G$z|Y}rQQu7HhHAmKTg+xZ^m>Q6U4Zk8E3F1ll)qXerA8u72_BC<+HE(luT?3? z8UYGy+pV$%x6>sId}N)RPQMXx2m>F0`@0(ehG&;PUn^xJNxQWfJ6k#ZQ<=g8~8bxvS*mb4%@u^i8?IL~wGfi3R0^;*g P00000NkvXXu0mjfNxYQ5 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/whispergrove/textures/item/he_huan_pi.png b/src/main/resources/assets/whispergrove/textures/item/he_huan_pi.png new file mode 100644 index 0000000000000000000000000000000000000000..c026d9213baf32bf7192c7ed73362be06c9505f1 GIT binary patch literal 350 zcmV-k0iphhP)rlCetyVHn1LcSw^WMnZL-;#?qZIyQs|F8&t^{Sz*^ zxV5-B2H}2)LpkZ@Ah+BQSeyn$RChE4@i|0tr{7mM)ib`|`@YZfKFTR7=A1 zJpgWQUvOPl+6SP^h5-`s1OUao9Sp+|krx1%+1yX6)e9Qck}$J5?(gP-s!}}wG1Y_T zd%V8AGkyAq=7F3&47=Cb@jY`}%~gHPO1(SL0&&5S@P0gX`e{fc9t}a{l7V;y9&a w0M7FxXP4vkOemh%wB*I54^EBrHd_XN)m1ONa407*qoM6N<$g0do+T>t<8 literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/whispergrove/textures/item/mo_yu_gu.png b/src/main/resources/assets/whispergrove/textures/item/mo_yu_gu.png new file mode 100644 index 0000000000000000000000000000000000000000..9c880c29bc94d686efd488776df7281b5abe9410 GIT binary patch literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP;iH* zi(`mIZ*qb}#sQC>MVF6H`{({_c9g5|QvP*6&%fWUA#u||%xM;{udT$rJyl&w|9;$5 zx0u}-a`pwoYQ`HT_H`9A8-d{AjgO0Y92IANFgReq5NYgl`EmPn$&{z1l6|uFrwYDZ z5HV%Rjr~@CNQ<4DfuZPx#xk*GpR5*?8k)aNPP!xtgoJI?5ZUkq*!kk2k$p=t_(O2McdIx01(AD zf$3O;i5gh>!geJw9SeZ-<)QtAk|0bB=6Ok!)t|fl3@`arJdUoq99jSX002ovPDHLk FV1lUxXsiGL literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/whispergrove/textures/item/yang_qi_shi.png b/src/main/resources/assets/whispergrove/textures/item/yang_qi_shi.png new file mode 100644 index 0000000000000000000000000000000000000000..5f2e7885740d696bc8dbaa133c8fcd9ade22a49e GIT binary patch literal 344 zcmV-e0jK_nP)*k}*p|F%*SA#YqI$ibE;=G2)uF9Sl?qb#il1XE(Rv zR&cR66u08$EQr3P)S^TY>6_kAC>`T;FM01-brQT&$UWb=$w}bf*V1o=#=0Que)n9t zl~}ZYavA_8@2@$bu`V1R9szKd3;}}l)WBF5T8*Zf6@@!{yR_Q}^m>a{AJ&KX&jQm<9Z85rxr*0y2vH0JT)UZ*6tgKu-nHH~#arV3chCC;W~ z5SM_hMw97m&gj`|?`F`a6yhRqI-BFY*Q)`!5OW6cO9+?@#{ddfHZ~U<6hVOm1V|?z qtgWu=eklX_aT4ZN_0!AzZG8f7u$H5~C6mYi00005r00001b5ch_0Itp) z=>Px#)=5M`R49?{kRfivKoCXWR*@Xyg#m8JF0d5fLQ4TDzG@k)cn+Kp4e;-T$y;1B2UgbxkqMAt$j26ox+ng~DLS z5K~RIV4BH_Wu*!XWv-XaVa7G7y1$^PyY$v<9-g_}_uYH%d*8vIhqqrSzV2%PtrZuS z(^mf|4B22YAJ>Q89-IK+`B7M65RO>q?*Npl;^C=sIL>7;AJ>Cn=!k7MIi{ASaZ9Ar zB>(KbEh$T500zU5?IuTSMX4%!{jOus0r+^kt*@>Vujv?sBeFC`YlRU8I5|Dz?uObC zXl~m$n#`rz*%M&3OqfJ?M#M${kcH%R_5#2xni7QPtd5MOY(Ox28#}mFl u782nLn_U)?NyPDAFuQ2xG}tHq6Z`@#KzqL2f=o^T0000jG<{OyGL@SuGmVQH99I=Q)kH>$Y$B{fuV^j z(nIl|PQ=NmmR>34iiVo2Z{F<5Pb*s}#8CGl!@lH;{nlpB=-qOaYYh%+yvSmhslgD| zZLJJ0A-iW8X)tWn;KlqW_7Lr@$`t_x&r6PjAV*x^pGF@9J|! qd$j9a81k=a{`E^vunMnw$vJga;O`HDAFP3%WbkzLb6Mw<&;$Uwp>*8< literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/whispergrove/textures/item/zi_shi_ying.png b/src/main/resources/assets/whispergrove/textures/item/zi_shi_ying.png new file mode 100644 index 0000000000000000000000000000000000000000..8f3fb5c3a1b358b9eb85c4a605813ce63f0ccf09 GIT binary patch literal 331 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAQ1Gv( zi(`mIZ*qb}#(@rRrTg_?>)C+7GSju~QKp*3Rl|pu?!+gbRZw4h;=_xVwLClTtug+e zSR**3vNv`NVBb(aN`H5#g8tr(yH!}U->Xj>u-&pQwW?atbAAdK!;ulwv_NFwT ziEZxw?~P^b_w&2TEWe+yu5qJ!9?#L$VymCkFQ5PS|Nrl={tKL5_kYKghdeIg)%+kg zv<1vw%X2BI%R={1ftZfK)sQQad3Sf71UW Date: Tue, 20 Aug 2024 22:32:58 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=B0=8F=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/lang/EnglishLanguageProvider.java | 2 +- .../core/data/provider/WGRecipeProvider.java | 20 +++++-------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/EnglishLanguageProvider.java b/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/EnglishLanguageProvider.java index 57cd608..04c6d48 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/EnglishLanguageProvider.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/data/lang/EnglishLanguageProvider.java @@ -111,7 +111,7 @@ protected void addTranslations() { add("tooltip.whispergrove.sliced_long_dan_cao",""); add("item.whispergrove.mo_yu_gu","Cuttleflsh Bone"); add("tooltip.whispergrove.mo_yu_gu",""); - add("item.whispergrove.shu_fu_pian","Roasted Prepared Common Monkshood Daughter Root,"); + add("item.whispergrove.shu_fu_pian","Roasted Prepared Common Monkshood Daughter Root"); add("tooltip.whispergrove.shu_fu_pian",""); add("item.whispergrove.bone_fragment","Bone Fragment"); add("tooltip.whispergrove.bone_fragment",""); diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGRecipeProvider.java b/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGRecipeProvider.java index 0b70e64..d0b06d0 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGRecipeProvider.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGRecipeProvider.java @@ -46,16 +46,6 @@ protected void buildRecipes(RecipeOutput output) { .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT)) .save(output); -// SimpleCookingRecipeBuilder.smelting( -// Ingredient.of(Items.KELP),//输入 -// RecipeCategory.FOOD,//配方类型 -// Items.DIAMOND,//产物,也可以是ItemStack -// 0.1f,//经验值 -// 200//烹饪时间 -// ) -// .unlockedBy("has_kelp", has(Blocks.KELP)) -// .save(output, "dried_kelp_smelting"); - SimpleCookingRecipeBuilder.smelting( Ingredient.of(MO_YU_GU),//输入 RecipeCategory.MISC,//配方类型 @@ -64,16 +54,16 @@ protected void buildRecipes(RecipeOutput output) { 200//烹饪时间 ) .unlockedBy("has_kelp", has(Blocks.KELP)) - .save(output, "mo_yu_smelting"); + .save(output, "mo_yu_gu_smelting"); SimpleCookingRecipeBuilder.smelting( - Ingredient.of(Items.LILAC),//输入 + Ingredient.of(Items.BONE),//输入 RecipeCategory.MISC,//配方类型 - new ItemStack((Holder) CHAO_DING_XIANG),//产物,也可以是ItemStack + new ItemStack((Holder) DUAN_LONG_GU),//产物,也可以是ItemStack 0.1f,//经验值 100//烹饪时间 ) - .unlockedBy("has_lilac", has(Blocks.LILAC)) - .save(output, "dried_lilac_smelting"); + .unlockedBy("has_lilac", has(Items.BONE)) + .save(output, "duan_long_gu_smelting"); } } From ae3cc49dd60203f6ed50384ff82ef7b5f4771afa Mon Sep 17 00:00:00 2001 From: HaooooZhang Date: Tue, 20 Aug 2024 22:50:31 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=86=99=E5=88=B0=E4=B8=80=E5=8D=8A?= =?UTF-8?q?=E7=9A=84=E6=88=98=E5=88=A9=E5=93=81=E8=A1=A8DataGen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../whispergrove/core/data/Data.java | 5 ++- .../core/data/provider/ModelProvider.java | 2 +- .../data/provider/WGLootTableProvider.java | 39 ++++++++++++++++++ .../core/data/provider/WGRecipeProvider.java | 2 + .../textures/item/shu_fu_pian.png | Bin 0 -> 486 bytes 5 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGLootTableProvider.java create mode 100644 src/main/resources/assets/whispergrove/textures/item/shu_fu_pian.png diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/data/Data.java b/src/main/java/org/hiedacamellia/whispergrove/core/data/Data.java index 891240c..1b4fed4 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/data/Data.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/data/Data.java @@ -6,6 +6,7 @@ import org.hiedacamellia.whispergrove.core.data.lang.EnglishLanguageProvider; import org.hiedacamellia.whispergrove.core.data.provider.ModelProvider; import org.hiedacamellia.whispergrove.core.data.provider.StateProvider; +import org.hiedacamellia.whispergrove.core.data.provider.WGLootTableProvider; import org.hiedacamellia.whispergrove.core.data.provider.WGRecipeProvider; public class Data { @@ -13,11 +14,13 @@ public static void onGatherData(GatherDataEvent event) { var gen = event.getGenerator(); var packOutput = gen.getPackOutput(); var helper = event.getExistingFileHelper(); + var lookupProvider = event.getLookupProvider(); gen.addProvider(event.includeClient(), new EnglishLanguageProvider(packOutput)); gen.addProvider(event.includeClient(), new ChineseLanguageProvider(packOutput)); gen.addProvider(event.includeClient(), new ClassicalChineseLanguageProvider(packOutput)); gen.addProvider(event.includeClient(), new ModelProvider(packOutput, helper)); gen.addProvider(event.includeClient(), new StateProvider(packOutput, helper)); - gen.addProvider(event.includeServer(), new WGRecipeProvider(packOutput, event.getLookupProvider())); + gen.addProvider(event.includeServer(), new WGRecipeProvider(packOutput, lookupProvider)); + gen.addProvider(event.includeClient(),new WGLootTableProvider(packOutput, lookupProvider)); } } diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/ModelProvider.java b/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/ModelProvider.java index 2caf083..cc6d9bd 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/ModelProvider.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/ModelProvider.java @@ -48,7 +48,7 @@ protected void registerModels() { "sliced_ren_shen", "sliced_long_dan_cao" ,"mo_yu_gu", - //"shu_fu_pian", + "shu_fu_pian", "bone_fragment" ).forEach(s -> this.singleTexture(s, ResourceLocation.withDefaultNamespace("item/generated"), "layer0", diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGLootTableProvider.java b/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGLootTableProvider.java new file mode 100644 index 0000000..43097c6 --- /dev/null +++ b/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGLootTableProvider.java @@ -0,0 +1,39 @@ +package org.hiedacamellia.whispergrove.core.data.provider; + +import net.minecraft.core.HolderLookup; +import net.minecraft.core.WritableRegistry; +import net.minecraft.data.PackOutput; +import net.minecraft.data.loot.BlockLootSubProvider; +import net.minecraft.data.loot.LootTableProvider; +import net.minecraft.util.ProblemReporter; +import net.minecraft.world.flag.FeatureFlags; +import net.minecraft.world.level.storage.loot.LootTable; +import net.minecraft.world.level.storage.loot.ValidationContext; +import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; + +import java.util.List; +import java.util.Set; +import java.util.concurrent.CompletableFuture; + +public class WGLootTableProvider extends LootTableProvider { + public WGLootTableProvider(PackOutput output, CompletableFuture registries) { + super(output, Set.of(), List.of(new SubProviderEntry(WGBlockLoot::new, LootContextParamSets.BLOCK)), registries); + } + + @Override + protected void validate(WritableRegistry registry, ValidationContext context, ProblemReporter.Collector collector) { + // FIXME 需要核实正确写法 + // map.forEach((key, value) -> LootTables.validate(context, key, value)); + } + + public static class WGBlockLoot extends BlockLootSubProvider { + protected WGBlockLoot(HolderLookup.Provider lookupProvider) { + super(Set.of(), FeatureFlags.REGISTRY.allFlags(), lookupProvider); + } + + @Override + protected void generate() { + + } + } +} diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGRecipeProvider.java b/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGRecipeProvider.java index d0b06d0..b8f3ffc 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGRecipeProvider.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGRecipeProvider.java @@ -46,6 +46,7 @@ protected void buildRecipes(RecipeOutput output) { .unlockedBy("has_iron_ingot", has(Items.IRON_INGOT)) .save(output); + //熔炉配方 SimpleCookingRecipeBuilder.smelting( Ingredient.of(MO_YU_GU),//输入 RecipeCategory.MISC,//配方类型 @@ -65,5 +66,6 @@ protected void buildRecipes(RecipeOutput output) { ) .unlockedBy("has_lilac", has(Items.BONE)) .save(output, "duan_long_gu_smelting"); + } } diff --git a/src/main/resources/assets/whispergrove/textures/item/shu_fu_pian.png b/src/main/resources/assets/whispergrove/textures/item/shu_fu_pian.png new file mode 100644 index 0000000000000000000000000000000000000000..8fa3a7d5d7ce0d2920f40762af1e6301f6d18d93 GIT binary patch literal 486 zcmV@P)S5XWbejnx#Z%?2yd6rtcJ(t7e8O1ydKa|phKH;+DmZy;WMgjziG)Qc62khEBJ zW3n+TnJ@3h^e7sXZ54IEH--4S)g`2Gsm=n{#xEj6H z%Tlr58GDION+58v^RTv#9Lk{I8AtoqH!lm~+qHu_02IvDN&&J(%$+QpnM2tU0K7N! zDQMRYmc?58K#|XHtzagB(A%|x)E+oPbat|-^zNzuND&C4eGM0}1g_;GCEyU?%&A$u zF*fF4yQ2Ei-QbxEGV23ad=vgm4RU&;|CpvM^zN?d+@Z{KC=0VUkxDR#rv9K83bM4i zQ39_dOK!5>ABAA<$x82uf2Q68XGjgA38FC3+t6{bYX|aCRdMTwrAcr^76O1Q$X;hU zQCwfXBWpTI$;{SDBrlexwht8cYbz)HVGs>Bbj)&Ol&Fd*@HD|Z(;ynk`u+J9@}r^S cY3~5Q7Y?QAR)MwtUjP6A07*qoM6N<$g1d;~M*si- literal 0 HcmV?d00001 From 1c087896df84b97aa3db3f3a36457402899bf02f Mon Sep 17 00:00:00 2001 From: HaooooZhang Date: Wed, 21 Aug 2024 13:06:54 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=86=99=E5=88=B0=E4=B8=80=E5=8D=8A?= =?UTF-8?q?=E7=9A=84=E6=88=98=E5=88=A9=E5=93=81=E8=A1=A8DataGen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/provider/WGLootTableProvider.java | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGLootTableProvider.java b/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGLootTableProvider.java index 43097c6..8cb79c6 100644 --- a/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGLootTableProvider.java +++ b/src/main/java/org/hiedacamellia/whispergrove/core/data/provider/WGLootTableProvider.java @@ -1,23 +1,34 @@ package org.hiedacamellia.whispergrove.core.data.provider; +import com.google.common.collect.Iterables; import net.minecraft.core.HolderLookup; import net.minecraft.core.WritableRegistry; import net.minecraft.data.PackOutput; import net.minecraft.data.loot.BlockLootSubProvider; +import net.minecraft.data.loot.EntityLootSubProvider; import net.minecraft.data.loot.LootTableProvider; import net.minecraft.util.ProblemReporter; +import net.minecraft.world.flag.FeatureFlagSet; import net.minecraft.world.flag.FeatureFlags; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.ValidationContext; import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets; +import net.neoforged.neoforge.registries.DeferredHolder; +import javax.annotation.Nonnull; import java.util.List; import java.util.Set; import java.util.concurrent.CompletableFuture; +import static org.hiedacamellia.whispergrove.registers.WGBlock.*; + public class WGLootTableProvider extends LootTableProvider { public WGLootTableProvider(PackOutput output, CompletableFuture registries) { - super(output, Set.of(), List.of(new SubProviderEntry(WGBlockLoot::new, LootContextParamSets.BLOCK)), registries); + super(output, Set.of(), List.of( + new SubProviderEntry(WGBlockLoot::new, LootContextParamSets.BLOCK)), + registries); } @Override @@ -33,7 +44,20 @@ protected WGBlockLoot(HolderLookup.Provider lookupProvider) { @Override protected void generate() { + this.dropSelf(RouGuiLog.get()); + this.dropSelf(RouGuiStrippedLog.get()); + this.dropSelf(RouGuiPlanks.get()); + this.dropSelf(RouGuiSlab.get()); + this.dropSelf(RouGuiLeaves.get()); + this.dropSelf(RouGuiStair.get()); + this.dropSelf(Roller.get()); + } + @Nonnull + @Override + protected Iterable getKnownBlocks() { + // 模组自定义的方块战利品表必须覆盖此方法,以绕过对原版方块战利品表的检查(此处返回该模组的所有方块) + return Iterables.transform(BLOCKS.getEntries(), DeferredHolder::get); } } }