-
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
Showing
20 changed files
with
200 additions
and
12 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
6 changes: 6 additions & 0 deletions
6
src/main/generated/.cache/9adbe1c44971b18122390f472ecf7bb970889f75
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 @@ | ||
// 1.20.1 2024-03-07T23:18:18.414589 Squared Additions/Model Definitions | ||
71776dfec5b5f01ce4a9d3b3e000c3bf53bd5bf5 assets/squaredadditions/models/item/copper_shovel.json | ||
5dc59b79a3e713f07045de3613f4ed4b3e29befc assets/squaredadditions/models/item/copper_sword.json | ||
32fe678c1527b64ea225930db2db5251c0a7ba7a assets/squaredadditions/models/item/copper_pickaxe.json | ||
f6bd2f2c35340d899a2928bdacb127ca28140e3d assets/squaredadditions/models/item/copper_hoe.json | ||
e707267f36198cf7a546e3b58db73fa98b8e056a assets/squaredadditions/models/item/copper_axe.json |
6 changes: 6 additions & 0 deletions
6
src/main/generated/assets/squaredadditions/models/item/copper_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": "minecraft:item/handheld", | ||
"textures": { | ||
"layer0": "squaredadditions:item/copper_axe" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/generated/assets/squaredadditions/models/item/copper_hoe.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": "minecraft:item/handheld", | ||
"textures": { | ||
"layer0": "squaredadditions:item/copper_hoe" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/generated/assets/squaredadditions/models/item/copper_pickaxe.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": "minecraft:item/handheld", | ||
"textures": { | ||
"layer0": "squaredadditions:item/copper_pickaxe" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/generated/assets/squaredadditions/models/item/copper_shovel.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": "minecraft:item/handheld", | ||
"textures": { | ||
"layer0": "squaredadditions:item/copper_shovel" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/generated/assets/squaredadditions/models/item/copper_sword.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": "minecraft:item/handheld", | ||
"textures": { | ||
"layer0": "squaredadditions:item/copper_sword" | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
src/main/java/pl/xyundy/squaredadditions/datagen/ModModelProvider.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,27 @@ | ||
package pl.xyundy.squaredadditions.datagen; | ||
|
||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; | ||
import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider; | ||
import net.minecraft.data.client.BlockStateModelGenerator; | ||
import net.minecraft.data.client.ItemModelGenerator; | ||
import pl.xyundy.squaredadditions.item.ModItems; | ||
import net.minecraft.data.client.Models; | ||
public class ModModelProvider extends FabricModelProvider { | ||
public ModModelProvider(FabricDataOutput output) { | ||
super(output); | ||
} | ||
|
||
@Override | ||
public void generateBlockStateModels(BlockStateModelGenerator blockStateModelGenerator) { | ||
|
||
} | ||
|
||
@Override | ||
public void generateItemModels(ItemModelGenerator itemModelGenerator) { | ||
itemModelGenerator.register(ModItems.COPPER_SWORD, Models.HANDHELD); | ||
itemModelGenerator.register(ModItems.COPPER_PICKAXE, Models.HANDHELD); | ||
itemModelGenerator.register(ModItems.COPPER_SHOVEL, Models.HANDHELD); | ||
itemModelGenerator.register(ModItems.COPPER_AXE, Models.HANDHELD); | ||
itemModelGenerator.register(ModItems.COPPER_HOE, Models.HANDHELD); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
src/main/java/pl/xyundy/squaredadditions/item/ModItems.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,49 @@ | ||
package pl.xyundy.squaredadditions.item; | ||
|
||
import net.fabricmc.fabric.api.item.v1.FabricItemSettings; | ||
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries; | ||
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents; | ||
import net.minecraft.item.*; | ||
import net.minecraft.registry.Registries; | ||
import net.minecraft.registry.Registry; | ||
import net.minecraft.util.Identifier; | ||
import pl.xyundy.squaredadditions.SquaredAdditions; | ||
|
||
public class ModItems { | ||
|
||
public static final Item COPPER_SWORD = registerItem("copper_sword", | ||
new SwordItem(ModToolMaterial.COPPER_INGOT, 2, 2f, new FabricItemSettings())); | ||
public static final Item COPPER_PICKAXE = registerItem("copper_pickaxe", | ||
new PickaxeItem(ModToolMaterial.COPPER_INGOT, 1, 1f, new FabricItemSettings())); | ||
public static final Item COPPER_SHOVEL = registerItem("copper_shovel", | ||
new ShovelItem(ModToolMaterial.COPPER_INGOT, 0, 0f, new FabricItemSettings())); | ||
public static final Item COPPER_AXE = registerItem("copper_axe", | ||
new AxeItem(ModToolMaterial.COPPER_INGOT, 6, -2f, new FabricItemSettings())); | ||
public static final Item COPPER_HOE = registerItem("copper_hoe", | ||
new HoeItem(ModToolMaterial.COPPER_INGOT, 0, 0f, new FabricItemSettings())); | ||
|
||
|
||
|
||
private static Item registerItem(String name, Item item) { | ||
return Registry.register(Registries.ITEM, new Identifier(SquaredAdditions.MOD_ID, name), item); | ||
} | ||
|
||
|
||
public static void itemGroupCombat(FabricItemGroupEntries entries) { | ||
entries.add(COPPER_SWORD); | ||
entries.add(COPPER_PICKAXE); | ||
} | ||
public static void itemGroupTools(FabricItemGroupEntries entries) { | ||
entries.add(COPPER_PICKAXE); | ||
entries.add(COPPER_SHOVEL); | ||
entries.add(COPPER_AXE); | ||
entries.add(COPPER_HOE); | ||
} | ||
|
||
public static void registerModItems() { | ||
SquaredAdditions.LOGGER.info("Registering Mod Items for " + SquaredAdditions.MOD_ID); | ||
|
||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS).register(ModItems::itemGroupTools); | ||
ItemGroupEvents.modifyEntriesEvent(ItemGroups.COMBAT).register(ModItems::itemGroupCombat); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
src/main/java/pl/xyundy/squaredadditions/item/ModToolMaterial.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,59 @@ | ||
package pl.xyundy.squaredadditions.item; | ||
|
||
import net.minecraft.item.Items; | ||
import net.minecraft.item.ToolMaterial; | ||
import net.minecraft.recipe.Ingredient; | ||
import net.minecraft.util.Lazy; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public enum ModToolMaterial implements ToolMaterial { | ||
COPPER_INGOT(5, 1500, 11.0f, 5.0f, 28, () -> Ingredient.ofItems(Items.COPPER_INGOT)); | ||
|
||
private final int miningLevel; | ||
private final int itemDurability; | ||
private final float miningSpeed; | ||
private final float attackDamage; | ||
private final int enchantability; | ||
private final Lazy<Ingredient> repairIngredient; | ||
|
||
ModToolMaterial(int miningLevel, int itemDurability, float miningSpeed, float attackDamage, | ||
int enchantability, Supplier<Ingredient> repairIngredient) { | ||
this.miningLevel = miningLevel; | ||
this.itemDurability = itemDurability; | ||
this.miningSpeed = miningSpeed; | ||
this.attackDamage = attackDamage; | ||
this.enchantability = enchantability; | ||
this.repairIngredient = new Lazy<>(repairIngredient); | ||
} | ||
|
||
@Override | ||
public int getDurability() { | ||
return this.itemDurability; | ||
} | ||
|
||
@Override | ||
public float getMiningSpeedMultiplier() { | ||
return this.miningSpeed; | ||
} | ||
|
||
@Override | ||
public float getAttackDamage() { | ||
return this.attackDamage; | ||
} | ||
|
||
@Override | ||
public int getMiningLevel() { | ||
return this.miningLevel; | ||
} | ||
|
||
@Override | ||
public int getEnchantability() { | ||
return this.enchantability; | ||
} | ||
|
||
@Override | ||
public Ingredient getRepairIngredient() { | ||
return this.repairIngredient.get(); | ||
} | ||
} |
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
Binary file added
BIN
+1.56 KB
src/main/resources/assets/squaredadditions/textures/item/copper_axe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.5 KB
src/main/resources/assets/squaredadditions/textures/item/copper_hoe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.57 KB
src/main/resources/assets/squaredadditions/textures/item/copper_pickaxe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.5 KB
src/main/resources/assets/squaredadditions/textures/item/copper_shovel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.65 KB
src/main/resources/assets/squaredadditions/textures/item/copper_sword.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.