-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
6e23b9c
commit 1b9afa1
Showing
11 changed files
with
158 additions
and
49 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
src/main/generated/.cache/89b86ab0e66f527166d98df92ddbcf5416ed58f6
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,2 @@ | ||
// 1.19.2 2024-04-17T20:37:27.0952932 Language | ||
84f246a88b9c3dc4c5d0c98a56c4de5529eabe74 assets\the_origin_of_magic\lang\en_us.json |
15 changes: 8 additions & 7 deletions
15
...ssets/the_origin_of_magic/lang/en_us.json → ...ssets/the_origin_of_magic/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,13 +1,14 @@ | ||
{ | ||
"item.the_origin_of_magic.test_staff": "Test Staff", | ||
"item.the_origin_of_magic.deadwood_staff": "Deadwood Staff", | ||
"block.the_origin_of_magic.magic_workbench": "Magic Workbench", | ||
"text.the_origin_of_magic.magic_work_station.staff_state": "Staff State", | ||
"item.the_origin_of_magic.deadwood_staff": "Deadwood Staff", | ||
"item.the_origin_of_magic.hoglin_entity_limiter": "Hoglin Entity Limiter", | ||
"item.the_origin_of_magic.test_magic": "Test Magic", | ||
"text.the_origin_of_magic.not_staff": "This is not a staff , have no magic energy.So you can't edit it with magic work station", | ||
"item.the_origin_of_magic.test_staff": "Test Staff", | ||
"itemGroup.the_origin_of_magic.normal": "The Origin Of The Magic", | ||
"text.the_origin_of_magic.empty_staff": "Maybe...... I means that the staff on your hand is empty,no magic in it and can't cast any magic,you need to use the Magic Workbench to edit this staff", | ||
"text.the_origin_of_magic.staff_scattering": "Spell Scatter", | ||
"text.the_origin_of_magic.magic_work_station.staff_state": "Staff State", | ||
"text.the_origin_of_magic.not_staff": "This is not a staff , have no magic energy.So you can't edit it with magic work station", | ||
"text.the_origin_of_magic.staff_capacity": "Staff Capacity", | ||
"itemGroup.the_origin_of_magic.normal": "The Origin Of The Magic", | ||
"text.the_origin_of_magic.staff_casting": "Casting Num" | ||
"text.the_origin_of_magic.staff_casting": "Casting Num", | ||
"text.the_origin_of_magic.staff_scattering": "Spell Scatter" | ||
} |
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
11 changes: 0 additions & 11 deletions
11
src/main/java/com/ictye/the_origin_of_magic/ModDataGenerator.java
This file was deleted.
Oops, something went wrong.
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
17 changes: 17 additions & 0 deletions
17
src/main/java/com/ictye/the_origin_of_magic/infrastructure/Datagen/BlockLootTable.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,17 @@ | ||
package com.ictye.the_origin_of_magic.infrastructure.Datagen; | ||
|
||
import com.ictye.the_origin_of_magic.Contents.AllBlock; | ||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider; | ||
|
||
public class BlockLootTable extends FabricBlockLootTableProvider { | ||
|
||
public BlockLootTable(FabricDataGenerator dataGenerator) { | ||
super(dataGenerator); | ||
} | ||
|
||
@Override | ||
protected void generateBlockLootTables() { | ||
addDrop(AllBlock.MAGIC_WORKSTATION); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/ictye/the_origin_of_magic/infrastructure/Datagen/DefaultLang.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,31 @@ | ||
package com.ictye.the_origin_of_magic.infrastructure.Datagen; | ||
|
||
import com.ictye.the_origin_of_magic.Contents.AllItem; | ||
import com.ictye.the_origin_of_magic.the_origin_of_magic; | ||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricLanguageProvider; | ||
import java.nio.file.Path; | ||
|
||
public class DefaultLang extends FabricLanguageProvider { | ||
protected DefaultLang(FabricDataGenerator dataGenerator) { | ||
super(dataGenerator, "en_us"); | ||
} | ||
|
||
@Override | ||
public void generateTranslations(TranslationBuilder translationBuilder) { | ||
// 生成代碼内翻譯 | ||
for(String name : AllItem.ItemTrans.keySet()){ | ||
translationBuilder.add(AllItem.ItemTrans.get(name), name); | ||
} | ||
|
||
the_origin_of_magic.LOGGER.info("Adding existing language file!"); | ||
|
||
// 添加預製的語言文件 | ||
try { | ||
Path existingFilePath = dataGenerator.getModContainer().findPath("assets/the_origin_of_magic/lang/en_us.existing.json").get(); | ||
translationBuilder.add(existingFilePath); | ||
} catch (Exception e) { | ||
throw new RuntimeException("Failed to add existing language file!", e); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/com/ictye/the_origin_of_magic/infrastructure/Datagen/ModDataGenerator.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,21 @@ | ||
package com.ictye.the_origin_of_magic.infrastructure.Datagen; | ||
|
||
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; | ||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; | ||
|
||
import java.io.IOException; | ||
|
||
public class ModDataGenerator implements DataGeneratorEntrypoint { | ||
@Override | ||
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) { | ||
|
||
fabricDataGenerator.addProvider(DefaultLang::new); | ||
fabricDataGenerator.addProvider(BlockLootTable::new); | ||
|
||
try { | ||
fabricDataGenerator.run(); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
src/main/resources/assets/the_origin_of_magic/lang/en_us.existing.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"block.the_origin_of_magic.magic_workbench": "Magic Workbench", | ||
"text.the_origin_of_magic.magic_work_station.staff_state": "Staff State", | ||
"text.the_origin_of_magic.not_staff": "This is not a staff , have no magic energy.So you can't edit it with magic work station", | ||
"text.the_origin_of_magic.empty_staff": "Maybe...... I means that the staff on your hand is empty,no magic in it and can't cast any magic,you need to use the Magic Workbench to edit this staff", | ||
"text.the_origin_of_magic.staff_scattering": "Spell Scatter", | ||
"text.the_origin_of_magic.staff_capacity": "Staff Capacity", | ||
"itemGroup.the_origin_of_magic.normal": "The Origin Of The Magic", | ||
"text.the_origin_of_magic.staff_casting": "Casting Num" | ||
} |
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