Skip to content
This repository was archived by the owner on Jul 29, 2026. It is now read-only.

Commit 8111ba8

Browse files
committed
finish setup and add basic form of items
1 parent 224316c commit 8111ba8

13 files changed

Lines changed: 303 additions & 2 deletions

src/main/java/teamport/aethersedge/AetherEdgeMod.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import net.fabricmc.api.ModInitializer;
44
import org.slf4j.Logger;
55
import org.slf4j.LoggerFactory;
6+
import teamport.aethersedge.item.AetherEdgeItems;
67
import turniplabs.halplibe.util.GameStartEntrypoint;
78

89
public class AetherEdgeMod implements ModInitializer, GameStartEntrypoint {
@@ -16,6 +17,7 @@ public void onInitialize() {
1617

1718
@Override
1819
public void beforeGameStart() {
20+
AetherEdgeItems.init();
1921
}
2022

2123
@Override

src/main/java/teamport/aethersedge/AetherEdgeModels.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import net.minecraft.client.render.block.color.BlockColorDispatcher;
88
import net.minecraft.client.render.block.model.BlockModelDispatcher;
99
import net.minecraft.client.render.item.model.ItemModelDispatcher;
10+
import net.minecraft.client.render.item.model.ItemModelStandard;
11+
import teamport.aethersedge.item.AetherEdgeItems;
1012
import turniplabs.halplibe.util.ModelEntrypoint;
1113

1214
@Environment(EnvType.CLIENT)
@@ -18,7 +20,10 @@ public void initBlockModels(BlockModelDispatcher dispatcher) {
1820

1921
@Override
2022
public void initItemModels(ItemModelDispatcher dispatcher) {
21-
23+
dispatcher.addDispatch(new ItemModelStandard(AetherEdgeItems.TOOL_SWORD_PHOENIX, null).setIcon("aethersedge:item/tool_sword_phoenix").setFull3D().setFullBright());
24+
dispatcher.addDispatch(new ItemModelStandard(AetherEdgeItems.TOOL_AXE_PHOENIX, null).setIcon("aethersedge:item/tool_axe_phoenix").setFull3D().setFullBright());
25+
dispatcher.addDispatch(new ItemModelStandard(AetherEdgeItems.TOOL_PICKAXE_PHOENIX, null).setIcon("aethersedge:item/tool_pickaxe_phoenix").setFull3D().setFullBright());
26+
dispatcher.addDispatch(new ItemModelStandard(AetherEdgeItems.TOOL_SHOVEL_PHOENIX, null).setIcon("aethersedge:item/tool_shovel_phoenix").setFull3D().setFullBright());
2227
}
2328

2429
@Override
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package teamport.aethersedge;
22

3+
import turniplabs.halplibe.helper.RecipeBuilder;
34
import turniplabs.halplibe.util.RecipeEntrypoint;
45

6+
import static teamport.aether.AetherMod.MOD_ID;
7+
58
public class AetherEdgeRecipes implements RecipeEntrypoint {
69
@Override
710
public void onRecipesReady() {
@@ -10,6 +13,6 @@ public void onRecipesReady() {
1013

1114
@Override
1215
public void initNamespaces() {
13-
16+
RecipeBuilder.initNameSpace(MOD_ID);
1417
}
1518
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
package teamport.aethersedge.item;
2+
3+
import net.minecraft.core.item.Item;
4+
import net.minecraft.core.item.material.ToolMaterial;
5+
import net.minecraft.core.item.tag.ItemTags;
6+
import turniplabs.halplibe.helper.ItemBuilder;
7+
8+
import static teamport.aether.AetherConfig.itemID;
9+
import static teamport.aethersedge.AetherEdgeMod.MOD_ID;
10+
11+
@SuppressWarnings({"java:S1104", "java:S1444", "java:S3008"})
12+
public final class AetherEdgeItems {
13+
public static final ToolMaterial phoenix = (new ToolMaterial()).setDurability(1536).setEfficiency(8.0F, 10.0F).setMiningLevel(3);
14+
15+
public static Item TOOL_PICKAXE_PHOENIX;
16+
public static Item TOOL_SHOVEL_PHOENIX;
17+
public static Item TOOL_AXE_PHOENIX;
18+
public static Item TOOL_SWORD_PHOENIX;
19+
20+
private static boolean hasInit = false;
21+
22+
private AetherEdgeItems() {
23+
}
24+
25+
public static void init() {
26+
if (!hasInit) {
27+
hasInit = true;
28+
initializeItems();
29+
}
30+
}
31+
32+
public static String itemKey(String string) {
33+
return MOD_ID + ":item/" + string;
34+
}
35+
36+
public static void initializeItems() {
37+
registerArmor();
38+
registerTool();
39+
registerOther();
40+
}
41+
42+
public static void registerOther() {
43+
44+
}
45+
46+
public static void registerTool() {
47+
TOOL_SWORD_PHOENIX = new ItemBuilder(MOD_ID)
48+
.setTags(ItemTags.PREVENT_CREATIVE_MINING)
49+
.build(new ItemToolSwordPhoenix("tool.sword.phoenix", itemKey("tool_sword_phoenix"), itemID("TOOL_SWORD_PHOENIX"), phoenix));
50+
51+
TOOL_SHOVEL_PHOENIX = new ItemBuilder(MOD_ID)
52+
.build(new ItemToolShovelPhoenix("tool.shovel.phoenix", itemKey("tool_shovel_phoenix"), itemID("TOOL_SHOVEL_PHOENIX"), phoenix));
53+
54+
TOOL_PICKAXE_PHOENIX = new ItemBuilder(MOD_ID)
55+
.build(new ItemToolPickaxePhoenix("tool.pickaxe.phoenix", itemKey("tool_pickaxe_phoenix"), itemID("TOOL_PICKAXE_PHOENIX"), phoenix));
56+
57+
TOOL_AXE_PHOENIX = new ItemBuilder(MOD_ID)
58+
.build(new ItemToolAxePhoenix("tool.axe.phoenix", itemKey("tool_axe_phoenix"), itemID("TOOL_AXE_PHOENIX"), phoenix));
59+
}
60+
61+
public static void registerArmor() {
62+
63+
}
64+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package teamport.aethersedge.item;
2+
3+
import net.minecraft.core.block.Block;
4+
import net.minecraft.core.block.Blocks;
5+
import net.minecraft.core.entity.Mob;
6+
import net.minecraft.core.entity.player.Player;
7+
import net.minecraft.core.item.ItemStack;
8+
import net.minecraft.core.item.material.ToolMaterial;
9+
import net.minecraft.core.util.helper.DamageType;
10+
import net.minecraft.core.util.helper.Side;
11+
import net.minecraft.core.world.World;
12+
import teamport.aether.helper.ParticleMaker;
13+
import teamport.aether.item.AetherHasCustomDamageType;
14+
import teamport.aether.item.AetherItems;
15+
import teamport.aether.item.item_tool.ItemToolAxeAether;
16+
import turniplabs.halplibe.helper.EnvironmentHelper;
17+
18+
public class ItemToolAxePhoenix extends ItemToolAxeAether implements AetherHasCustomDamageType {
19+
public ItemToolAxePhoenix(String name, String namespaceId, int id, ToolMaterial enumtoolmaterial) {
20+
super(name, namespaceId, id, enumtoolmaterial);
21+
}
22+
23+
@Override
24+
public boolean hitEntity(ItemStack itemstack, Mob target, Mob attacker) {
25+
if (target instanceof Mob && target.hurtTime == 10 && attacker.isSneaking() && attacker instanceof Player) {
26+
ParticleMaker.spawnFireSwordParticles(target);
27+
target.maxFireTicks = 600;
28+
target.remainingFireTicks = 600;
29+
}
30+
31+
return super.hitEntity(itemstack, target, attacker);
32+
}
33+
34+
@Override
35+
public boolean onBlockDestroyed(World world, ItemStack itemstack, int i, int x, int y, int z, Side side, Mob mob) {
36+
Block<?> block = Blocks.blocksList[i];
37+
if (block != null) {
38+
if (block.getHardness() > 0.0F || this.isSilkTouch()) {
39+
itemstack.damageItem(1, mob);
40+
}
41+
42+
if (!EnvironmentHelper.isClientWorld()) {
43+
world.dropItem(x, y, z, new ItemStack(AetherItems.AMBROSIUM, 1));
44+
}
45+
}
46+
47+
return true;
48+
}
49+
50+
@Override
51+
public DamageType getDamageType() {
52+
return DamageType.FIRE;
53+
}
54+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package teamport.aethersedge.item;
2+
3+
import net.minecraft.core.block.Block;
4+
import net.minecraft.core.block.Blocks;
5+
import net.minecraft.core.entity.Mob;
6+
import net.minecraft.core.entity.player.Player;
7+
import net.minecraft.core.item.ItemStack;
8+
import net.minecraft.core.item.material.ToolMaterial;
9+
import net.minecraft.core.util.helper.DamageType;
10+
import net.minecraft.core.util.helper.Side;
11+
import net.minecraft.core.world.World;
12+
import teamport.aether.helper.ParticleMaker;
13+
import teamport.aether.item.AetherHasCustomDamageType;
14+
import teamport.aether.item.AetherItems;
15+
import teamport.aether.item.item_tool.ItemToolPickaxeAether;
16+
import turniplabs.halplibe.helper.EnvironmentHelper;
17+
18+
public class ItemToolPickaxePhoenix extends ItemToolPickaxeAether implements AetherHasCustomDamageType {
19+
public ItemToolPickaxePhoenix(String name, String namespaceId, int id, ToolMaterial enumtoolmaterial) {
20+
super(name, namespaceId, id, enumtoolmaterial);
21+
}
22+
23+
@Override
24+
public boolean hitEntity(ItemStack itemstack, Mob target, Mob attacker) {
25+
if (target instanceof Mob && target.hurtTime == 10 && attacker.isSneaking() && attacker instanceof Player) {
26+
ParticleMaker.spawnFireSwordParticles(target);
27+
target.maxFireTicks = 600;
28+
target.remainingFireTicks = 600;
29+
}
30+
31+
return super.hitEntity(itemstack, target, attacker);
32+
}
33+
34+
@Override
35+
public boolean onBlockDestroyed(World world, ItemStack itemstack, int i, int x, int y, int z, Side side, Mob mob) {
36+
Block<?> block = Blocks.blocksList[i];
37+
if (block != null) {
38+
if (block.getHardness() > 0.0F || this.isSilkTouch()) {
39+
itemstack.damageItem(1, mob);
40+
}
41+
42+
if (!EnvironmentHelper.isClientWorld()) {
43+
world.dropItem(x, y, z, new ItemStack(AetherItems.AMBROSIUM, 1));
44+
}
45+
}
46+
47+
return true;
48+
}
49+
50+
@Override
51+
public DamageType getDamageType() {
52+
return DamageType.FIRE;
53+
}
54+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package teamport.aethersedge.item;
2+
3+
import net.minecraft.core.block.Block;
4+
import net.minecraft.core.block.Blocks;
5+
import net.minecraft.core.entity.Mob;
6+
import net.minecraft.core.entity.player.Player;
7+
import net.minecraft.core.item.ItemStack;
8+
import net.minecraft.core.item.material.ToolMaterial;
9+
import net.minecraft.core.util.helper.DamageType;
10+
import net.minecraft.core.util.helper.Side;
11+
import net.minecraft.core.world.World;
12+
import teamport.aether.helper.ParticleMaker;
13+
import teamport.aether.item.AetherHasCustomDamageType;
14+
import teamport.aether.item.AetherItems;
15+
import teamport.aether.item.item_tool.ItemToolShovelAether;
16+
import turniplabs.halplibe.helper.EnvironmentHelper;
17+
18+
public class ItemToolShovelPhoenix extends ItemToolShovelAether implements AetherHasCustomDamageType {
19+
public ItemToolShovelPhoenix(String name, String namespaceId, int id, ToolMaterial enumtoolmaterial) {
20+
super(name, namespaceId, id, enumtoolmaterial);
21+
}
22+
23+
@Override
24+
public boolean hitEntity(ItemStack itemstack, Mob target, Mob attacker) {
25+
if (target instanceof Mob && target.hurtTime == 10 && attacker.isSneaking() && attacker instanceof Player) {
26+
ParticleMaker.spawnFireSwordParticles(target);
27+
target.maxFireTicks = 600;
28+
target.remainingFireTicks = 600;
29+
}
30+
31+
return super.hitEntity(itemstack, target, attacker);
32+
}
33+
34+
@Override
35+
public boolean onBlockDestroyed(World world, ItemStack itemstack, int i, int x, int y, int z, Side side, Mob mob) {
36+
Block<?> block = Blocks.blocksList[i];
37+
if (block != null) {
38+
if (block.getHardness() > 0.0F || this.isSilkTouch()) {
39+
itemstack.damageItem(1, mob);
40+
}
41+
42+
if (!EnvironmentHelper.isClientWorld()) {
43+
world.dropItem(x, y, z, new ItemStack(AetherItems.AMBROSIUM, 1));
44+
}
45+
}
46+
47+
return true;
48+
}
49+
50+
@Override
51+
public DamageType getDamageType() {
52+
return DamageType.FIRE;
53+
}
54+
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package teamport.aethersedge.item;
2+
3+
import net.minecraft.core.entity.Mob;
4+
import net.minecraft.core.entity.player.Player;
5+
import net.minecraft.core.item.ItemStack;
6+
import net.minecraft.core.item.material.ToolMaterial;
7+
import net.minecraft.core.util.helper.DamageType;
8+
import net.minecraft.core.world.World;
9+
import teamport.aether.entity.projectile.ProjectileElementFire;
10+
import teamport.aether.helper.ParticleMaker;
11+
import teamport.aether.item.AetherHasCustomDamageType;
12+
import teamport.aether.item.item_tool.ItemToolSwordAether;
13+
14+
public class ItemToolSwordPhoenix extends ItemToolSwordAether implements AetherHasCustomDamageType {
15+
public ItemToolSwordPhoenix(String name, String namespaceId, int id, ToolMaterial enumtoolmaterial) {
16+
super(name, namespaceId, id, enumtoolmaterial);
17+
}
18+
19+
@Override
20+
public boolean hitEntity(ItemStack itemstack, Mob target, Mob attacker) {
21+
boolean hitEntity = super.hitEntity(itemstack, target, attacker);
22+
if (target instanceof Mob && target.hurtTime == 10 && hitEntity) {
23+
if (target instanceof Player && ((Player) target).gamemode.isPlayerInvulnerable()) {
24+
return false;
25+
} else {
26+
ParticleMaker.spawnFireSwordParticles(target);
27+
target.maxFireTicks = 600;
28+
target.remainingFireTicks = 600;
29+
return true;
30+
}
31+
} else {
32+
return false;
33+
}
34+
}
35+
36+
@Override
37+
public ItemStack onUseItem(ItemStack itemstack, World world, Player entityplayer) {
38+
if (!world.isClientSide) {
39+
ProjectileElementFire elementFire = new ProjectileElementFire(world, entityplayer);
40+
elementFire.setHeading(entityplayer.getLookAngle().x, entityplayer.getLookAngle().y, entityplayer.getLookAngle().z, 1.0F, 0.0F);
41+
world.playSoundAtEntity(entityplayer, entityplayer, "mob.ghast.fireball", 1.0F, (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F + 1.0F);
42+
world.entityJoinedWorld(elementFire);
43+
itemstack.damageItem(15, entityplayer);
44+
entityplayer.swingItem();
45+
}
46+
47+
return itemstack;
48+
}
49+
50+
@Override
51+
public DamageType getDamageType() {
52+
return DamageType.FIRE;
53+
}
54+
}
436 Bytes
Loading
441 Bytes
Loading

0 commit comments

Comments
 (0)