-
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
fa956de
commit 7e19612
Showing
34 changed files
with
354 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.equilibrium.block; | ||
|
||
import net.minecraft.block.*; | ||
import net.minecraft.item.BlockItem; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.util.Identifier; | ||
|
||
import static net.minecraft.block.Blocks.register; | ||
|
||
public class ModBlocksTest { | ||
|
||
public static final Block EXAMPLE_BLOCK = new Block(Block.Settings.create().strength(4.0f)); | ||
//strength中第一个为硬度,第二个为爆炸抗性 | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
public static void registerModBlocks(){ | ||
Registry.register(Registries.BLOCK, Identifier.of("miteequilibrium", "example_block"), EXAMPLE_BLOCK); | ||
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium", "example_block"), new BlockItem(EXAMPLE_BLOCK, new Item.Settings())); | ||
} | ||
} |
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,34 @@ | ||
package com.equilibrium.item; | ||
|
||
|
||
import net.minecraft.item.Item; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class Ingots { | ||
|
||
//以下开始添加物品: | ||
public static final Item adamantium= new Item(new Item.Settings()); | ||
public static final Item ancient_metal = new Item(new Item.Settings()); | ||
public static final Item copper = new Item(new Item.Settings()); | ||
public static final Item gold = new Item(new Item.Settings()); | ||
public static final Item mithril = new Item(new Item.Settings()); | ||
public static final Item silver = new Item(new Item.Settings()); | ||
|
||
|
||
|
||
|
||
public static void registerModItemIngots() { | ||
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium"), adamantium); | ||
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","ancient_metal"), ancient_metal); | ||
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","copper"), copper); | ||
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","gold"), gold); | ||
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","mithril"), mithril); | ||
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","silver"), silver); | ||
|
||
|
||
|
||
|
||
} | ||
} |
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,60 @@ | ||
package com.equilibrium.item; | ||
|
||
import com.equilibrium.MITEequilibrium; | ||
import com.equilibrium.block.ModBlocksTest; | ||
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup; | ||
import net.minecraft.item.ItemGroup; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.Items; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.text.Text; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class ModItemGroup { | ||
//自定义物品栏 | ||
public static final ItemGroup modGroup = Registry.register(Registries.ITEM_GROUP, Identifier.of(MITEequilibrium.MOD_ID,"testgroup"), | ||
//注册名小写 | ||
FabricItemGroup.builder().displayName(Text.translatable("itemgroup.testgroup")) | ||
//itemgroup.testgroup是不加翻译前的物品栏名字 | ||
.icon(()->new ItemStack(ModItems.test)).entries((displayContext, entries) -> | ||
//这里开始添加物品 | ||
{ | ||
entries.add(ModItems.test); | ||
entries.add(Items.BOOK);//可以加原版物品 | ||
entries.add(ModBlocksTest.EXAMPLE_BLOCK); | ||
|
||
} | ||
).build()); | ||
|
||
//工具栏 | ||
public static final ItemGroup modTools = Registry.register(Registries.ITEM_GROUP, Identifier.of(MITEequilibrium.MOD_ID,"toolsgroup"), | ||
FabricItemGroup.builder().displayName(Text.translatable("itemgroup.toolsgroup")) | ||
.icon(()->new ItemStack(Tools.adamantium_axe)).entries((displayContext, entries) -> | ||
{ | ||
entries.add(Tools.adamantium_axe); | ||
} | ||
).build()); | ||
|
||
//锭栏 | ||
public static final ItemGroup modIngots = Registry.register(Registries.ITEM_GROUP, Identifier.of(MITEequilibrium.MOD_ID,"ingotsgroup"), | ||
FabricItemGroup.builder().displayName(Text.translatable("itemgroup.ingotsgroup")) | ||
.icon(()->new ItemStack(Ingots.adamantium)).entries((displayContext, entries) -> | ||
{ | ||
entries.add(Ingots.adamantium); | ||
entries.add(Ingots.copper); | ||
entries.add(Ingots.ancient_metal); | ||
entries.add(Ingots.gold); | ||
entries.add(Ingots.mithril); | ||
entries.add(Ingots.silver); | ||
} | ||
).build()); | ||
|
||
|
||
|
||
|
||
|
||
public static void registerModItemGroup(){ | ||
|
||
} | ||
} |
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,61 @@ | ||
package com.equilibrium.item; | ||
|
||
|
||
import com.equilibrium.MITEequilibrium; | ||
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries; | ||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; | ||
import net.fabricmc.fabric.api.registry.FuelRegistry; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemGroups; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class ModItems { | ||
//Add a “test” Item | ||
public static final Item test = new Item(new Item.Settings()); | ||
//以下开始添加物品: | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
public static void registerModItemTest() { | ||
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","test"), test); | ||
//give @s miteequilibrium:test以获取该物品 | ||
//注册名必须小写 | ||
//Identifier.of("miteequilibrium","test")中,第一个是modid,第二个是物品注册id | ||
//寻找纹理时,"layer0": "miteequilibrium:item/test",也就是要一一对应 | ||
} | ||
} | ||
|
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,34 @@ | ||
package com.equilibrium.item; | ||
|
||
|
||
import net.minecraft.item.Item; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.util.Identifier; | ||
|
||
public class Tools { | ||
|
||
//以下开始添加物品: | ||
public static final Item adamantium_axe= new Item(new Item.Settings()); | ||
public static final Item adamantium_battle_axe = new Item(new Item.Settings()); | ||
public static final Item adamantium_dagger = new Item(new Item.Settings()); | ||
public static final Item adamantium_hatchet = new Item(new Item.Settings()); | ||
|
||
|
||
|
||
|
||
|
||
|
||
public static void registerModItemTools() { | ||
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_axe"), adamantium_axe); | ||
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_battle_axe"), adamantium_battle_axe); | ||
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_dagger"), adamantium_dagger); | ||
Registry.register(Registries.ITEM, Identifier.of("miteequilibrium","adamantium_hatchet"), adamantium_hatchet); | ||
|
||
|
||
|
||
|
||
|
||
|
||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/resources/assets/miteequilibrium/blockstates/example_block.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,5 @@ | ||
{ | ||
"variants": { | ||
"": { "model": "miteequilibrium:block/example_block" } | ||
} | ||
} |
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,6 @@ | ||
{ | ||
"item.miteequilibrium.test": "Test", | ||
"block.miteequilibrium.example_block": "TestBlock", | ||
"itemgroup.testgroup": "MITEequilibrium" | ||
|
||
} |
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,5 @@ | ||
{ | ||
"item.miteequilibrium.test": "测试物品", | ||
"block.miteequilibrium.example_block": "测试方块", | ||
"itemgroup.testgroup": "测试物品栏" | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/miteequilibrium/models/block/example_block.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,6 @@ | ||
{ | ||
"parent": "block/cube_all", | ||
"textures": { | ||
"all": "miteequilibrium:block/example_block" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/miteequilibrium/models/item/adamantium.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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "miteequilibrium:item/adamantium" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/miteequilibrium/models/item/adamantium_axe.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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "miteequilibrium:item/adamantium_axe" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/miteequilibrium/models/item/adamantium_battle_axe.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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "miteequilibrium:item/adamantium_battle_axe" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/miteequilibrium/models/item/adamantium_dagger.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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "miteequilibrium:item/adamantium_dagger" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/miteequilibrium/models/item/adamantium_hatchet.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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "miteequilibrium:item/adamantium_hatchet" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/miteequilibrium/models/item/ancient_metal.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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "miteequilibrium:item/ancient_metal" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/miteequilibrium/models/item/copper.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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "miteequilibrium:item/copper" | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
src/main/resources/assets/miteequilibrium/models/item/example_block.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,3 @@ | ||
{ | ||
"parent": "miteequilibrium:block/example_block" | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/miteequilibrium/models/item/gold.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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "miteequilibrium:item/gold" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/resources/assets/miteequilibrium/models/item/mithril.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,6 @@ | ||
{ | ||
"parent": "item/generated", | ||
"textures": { | ||
"layer0": "miteequilibrium:item/mithril" | ||
} | ||
} |
Oops, something went wrong.