Prisma Steel Armor

This commit is contained in:
Vos
2025-11-09 16:54:44 -06:00
parent 2fbb0d893b
commit b859c72096
62 changed files with 763 additions and 50 deletions
@@ -0,0 +1,68 @@
{
"parent": "minecraft:item/generated",
"overrides": [
{
"model": "acesbs:item/prisma_steel_boots_quartz_trim",
"predicate": {
"trim_type": 0.1
}
},
{
"model": "acesbs:item/prisma_steel_boots_iron_trim",
"predicate": {
"trim_type": 0.2
}
},
{
"model": "acesbs:item/prisma_steel_boots_netherite_trim",
"predicate": {
"trim_type": 0.3
}
},
{
"model": "acesbs:item/prisma_steel_boots_redstone_trim",
"predicate": {
"trim_type": 0.4
}
},
{
"model": "acesbs:item/prisma_steel_boots_copper_trim",
"predicate": {
"trim_type": 0.5
}
},
{
"model": "acesbs:item/prisma_steel_boots_gold_trim",
"predicate": {
"trim_type": 0.6
}
},
{
"model": "acesbs:item/prisma_steel_boots_emerald_trim",
"predicate": {
"trim_type": 0.7
}
},
{
"model": "acesbs:item/prisma_steel_boots_diamond_trim",
"predicate": {
"trim_type": 0.8
}
},
{
"model": "acesbs:item/prisma_steel_boots_lapis_trim",
"predicate": {
"trim_type": 0.9
}
},
{
"model": "acesbs:item/prisma_steel_boots_amethyst_trim",
"predicate": {
"trim_type": 1.0
}
}
],
"textures": {
"layer0": "acesbs:item/prisma_steel_boots"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_boots",
"layer1": "minecraft:trims/items/boots_trim_amethyst"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_boots",
"layer1": "minecraft:trims/items/boots_trim_copper"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_boots",
"layer1": "minecraft:trims/items/boots_trim_diamond"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_boots",
"layer1": "minecraft:trims/items/boots_trim_emerald"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_boots",
"layer1": "minecraft:trims/items/boots_trim_gold"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_boots",
"layer1": "minecraft:trims/items/boots_trim_iron"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_boots",
"layer1": "minecraft:trims/items/boots_trim_lapis"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_boots",
"layer1": "minecraft:trims/items/boots_trim_netherite"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_boots",
"layer1": "minecraft:trims/items/boots_trim_quartz"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_boots",
"layer1": "minecraft:trims/items/boots_trim_redstone"
}
}
@@ -0,0 +1,68 @@
{
"parent": "minecraft:item/generated",
"overrides": [
{
"model": "acesbs:item/prisma_steel_chestplate_quartz_trim",
"predicate": {
"trim_type": 0.1
}
},
{
"model": "acesbs:item/prisma_steel_chestplate_iron_trim",
"predicate": {
"trim_type": 0.2
}
},
{
"model": "acesbs:item/prisma_steel_chestplate_netherite_trim",
"predicate": {
"trim_type": 0.3
}
},
{
"model": "acesbs:item/prisma_steel_chestplate_redstone_trim",
"predicate": {
"trim_type": 0.4
}
},
{
"model": "acesbs:item/prisma_steel_chestplate_copper_trim",
"predicate": {
"trim_type": 0.5
}
},
{
"model": "acesbs:item/prisma_steel_chestplate_gold_trim",
"predicate": {
"trim_type": 0.6
}
},
{
"model": "acesbs:item/prisma_steel_chestplate_emerald_trim",
"predicate": {
"trim_type": 0.7
}
},
{
"model": "acesbs:item/prisma_steel_chestplate_diamond_trim",
"predicate": {
"trim_type": 0.8
}
},
{
"model": "acesbs:item/prisma_steel_chestplate_lapis_trim",
"predicate": {
"trim_type": 0.9
}
},
{
"model": "acesbs:item/prisma_steel_chestplate_amethyst_trim",
"predicate": {
"trim_type": 1.0
}
}
],
"textures": {
"layer0": "acesbs:item/prisma_steel_chestplate"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_chestplate",
"layer1": "minecraft:trims/items/chestplate_trim_amethyst"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_chestplate",
"layer1": "minecraft:trims/items/chestplate_trim_copper"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_chestplate",
"layer1": "minecraft:trims/items/chestplate_trim_diamond"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_chestplate",
"layer1": "minecraft:trims/items/chestplate_trim_emerald"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_chestplate",
"layer1": "minecraft:trims/items/chestplate_trim_gold"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_chestplate",
"layer1": "minecraft:trims/items/chestplate_trim_iron"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_chestplate",
"layer1": "minecraft:trims/items/chestplate_trim_lapis"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_chestplate",
"layer1": "minecraft:trims/items/chestplate_trim_netherite"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_chestplate",
"layer1": "minecraft:trims/items/chestplate_trim_quartz"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_chestplate",
"layer1": "minecraft:trims/items/chestplate_trim_redstone"
}
}
@@ -0,0 +1,68 @@
{
"parent": "minecraft:item/generated",
"overrides": [
{
"model": "acesbs:item/prisma_steel_helmet_quartz_trim",
"predicate": {
"trim_type": 0.1
}
},
{
"model": "acesbs:item/prisma_steel_helmet_iron_trim",
"predicate": {
"trim_type": 0.2
}
},
{
"model": "acesbs:item/prisma_steel_helmet_netherite_trim",
"predicate": {
"trim_type": 0.3
}
},
{
"model": "acesbs:item/prisma_steel_helmet_redstone_trim",
"predicate": {
"trim_type": 0.4
}
},
{
"model": "acesbs:item/prisma_steel_helmet_copper_trim",
"predicate": {
"trim_type": 0.5
}
},
{
"model": "acesbs:item/prisma_steel_helmet_gold_trim",
"predicate": {
"trim_type": 0.6
}
},
{
"model": "acesbs:item/prisma_steel_helmet_emerald_trim",
"predicate": {
"trim_type": 0.7
}
},
{
"model": "acesbs:item/prisma_steel_helmet_diamond_trim",
"predicate": {
"trim_type": 0.8
}
},
{
"model": "acesbs:item/prisma_steel_helmet_lapis_trim",
"predicate": {
"trim_type": 0.9
}
},
{
"model": "acesbs:item/prisma_steel_helmet_amethyst_trim",
"predicate": {
"trim_type": 1.0
}
}
],
"textures": {
"layer0": "acesbs:item/prisma_steel_helmet"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_helmet",
"layer1": "minecraft:trims/items/helmet_trim_amethyst"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_helmet",
"layer1": "minecraft:trims/items/helmet_trim_copper"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_helmet",
"layer1": "minecraft:trims/items/helmet_trim_diamond"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_helmet",
"layer1": "minecraft:trims/items/helmet_trim_emerald"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_helmet",
"layer1": "minecraft:trims/items/helmet_trim_gold"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_helmet",
"layer1": "minecraft:trims/items/helmet_trim_iron"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_helmet",
"layer1": "minecraft:trims/items/helmet_trim_lapis"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_helmet",
"layer1": "minecraft:trims/items/helmet_trim_netherite"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_helmet",
"layer1": "minecraft:trims/items/helmet_trim_quartz"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_helmet",
"layer1": "minecraft:trims/items/helmet_trim_redstone"
}
}
@@ -0,0 +1,68 @@
{
"parent": "minecraft:item/generated",
"overrides": [
{
"model": "acesbs:item/prisma_steel_leggings_quartz_trim",
"predicate": {
"trim_type": 0.1
}
},
{
"model": "acesbs:item/prisma_steel_leggings_iron_trim",
"predicate": {
"trim_type": 0.2
}
},
{
"model": "acesbs:item/prisma_steel_leggings_netherite_trim",
"predicate": {
"trim_type": 0.3
}
},
{
"model": "acesbs:item/prisma_steel_leggings_redstone_trim",
"predicate": {
"trim_type": 0.4
}
},
{
"model": "acesbs:item/prisma_steel_leggings_copper_trim",
"predicate": {
"trim_type": 0.5
}
},
{
"model": "acesbs:item/prisma_steel_leggings_gold_trim",
"predicate": {
"trim_type": 0.6
}
},
{
"model": "acesbs:item/prisma_steel_leggings_emerald_trim",
"predicate": {
"trim_type": 0.7
}
},
{
"model": "acesbs:item/prisma_steel_leggings_diamond_trim",
"predicate": {
"trim_type": 0.8
}
},
{
"model": "acesbs:item/prisma_steel_leggings_lapis_trim",
"predicate": {
"trim_type": 0.9
}
},
{
"model": "acesbs:item/prisma_steel_leggings_amethyst_trim",
"predicate": {
"trim_type": 1.0
}
}
],
"textures": {
"layer0": "acesbs:item/prisma_steel_leggings"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_leggings",
"layer1": "minecraft:trims/items/leggings_trim_amethyst"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_leggings",
"layer1": "minecraft:trims/items/leggings_trim_copper"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_leggings",
"layer1": "minecraft:trims/items/leggings_trim_diamond"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_leggings",
"layer1": "minecraft:trims/items/leggings_trim_emerald"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_leggings",
"layer1": "minecraft:trims/items/leggings_trim_gold"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_leggings",
"layer1": "minecraft:trims/items/leggings_trim_iron"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_leggings",
"layer1": "minecraft:trims/items/leggings_trim_lapis"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_leggings",
"layer1": "minecraft:trims/items/leggings_trim_netherite"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_leggings",
"layer1": "minecraft:trims/items/leggings_trim_quartz"
}
}
@@ -0,0 +1,7 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/prisma_steel_leggings",
"layer1": "minecraft:trims/items/leggings_trim_redstone"
}
}
@@ -57,21 +57,43 @@
{ {
"condition": "minecraft:match_tool", "condition": "minecraft:match_tool",
"predicate": { "predicate": {
"items": "acesbs:prisma_steel_pickaxe" "items": [
"acesbs:prisma_steel_pickaxe",
"acesbs:prisma_steel_hammer"
]
} }
} }
], ],
"entries": [ "entries": [
{ {
"type": "minecraft:item", "type": "minecraft:item",
"name": "acesbs:raw_entropy", "name": "minecraft:air",
"weight": 20 "weight": 360
}, },
{ {
"type": "minecraft:item", "type": "minecraft:item",
"name": "acesbs:lemon", "name": "minecraft:coal",
"weight": 14
},
{
"type": "minecraft:item",
"name": "minecraft:raw_copper",
"weight": 10 "weight": 10
}, },
{
"type": "minecraft:item",
"name": "minecraft:raw_iron",
"weight": 8
},
{
"type": "minecraft:item",
"name": "minecraft:raw_gold",
"weight": 6
},
{
"type": "minecraft:item",
"name": "acesbs:raw_entropy"
},
{ {
"type": "minecraft:item", "type": "minecraft:item",
"name": "minecraft:diamond" "name": "minecraft:diamond"
@@ -87,7 +109,11 @@
"function": "minecraft:explosion_decay" "function": "minecraft:explosion_decay"
} }
], ],
"rolls": 1.0 "rolls": {
"type": "minecraft:uniform",
"max": 3.0,
"min": 1.0
}
}, },
{ {
"bonus_rolls": 0.0, "bonus_rolls": 0.0,
@@ -115,7 +141,10 @@
"term": { "term": {
"condition": "minecraft:match_tool", "condition": "minecraft:match_tool",
"predicate": { "predicate": {
"items": "acesbs:prisma_steel_pickaxe" "items": [
"acesbs:prisma_steel_pickaxe",
"acesbs:prisma_steel_hammer"
]
} }
} }
} }
@@ -136,7 +165,11 @@
"function": "minecraft:explosion_decay" "function": "minecraft:explosion_decay"
} }
], ],
"rolls": 1.0 "rolls": {
"type": "minecraft:uniform",
"max": 3.0,
"min": 1.0
}
} }
] ]
} }
@@ -0,0 +1,8 @@
{
"values": [
"acesbs:prisma_steel_helmet",
"acesbs:prisma_steel_chestplate",
"acesbs:prisma_steel_leggings",
"acesbs:prisma_steel_boots"
]
}
@@ -5,6 +5,7 @@ import com.acethewildfire.acesbs.component.ModDataComponentTypes;
import com.acethewildfire.acesbs.item.ModItemGroups; import com.acethewildfire.acesbs.item.ModItemGroups;
import com.acethewildfire.acesbs.item.ModItems; import com.acethewildfire.acesbs.item.ModItems;
import com.acethewildfire.acesbs.util.HammerUsageEvent; import com.acethewildfire.acesbs.util.HammerUsageEvent;
import com.acethewildfire.acesbs.util.UpdateRecipies;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents; import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents;
@@ -32,6 +33,8 @@ public class AcesBS implements ModInitializer {
ModDataComponentTypes.registerDataComponentsTypes(); ModDataComponentTypes.registerDataComponentsTypes();
UpdateRecipies.updateVanilla();
PlayerBlockBreakEvents.BEFORE.register(new HammerUsageEvent()); PlayerBlockBreakEvents.BEFORE.register(new HammerUsageEvent());
} }
} }
@@ -39,6 +39,10 @@ public class ModItemTagProvider extends FabricTagProvider.ItemTagProvider {
.add(ModItems.PRISMA_STEEL_SHOVEL); .add(ModItems.PRISMA_STEEL_SHOVEL);
getOrCreateTagBuilder(ItemTags.HOES) getOrCreateTagBuilder(ItemTags.HOES)
.add(ModItems.PRISMA_STEEL_HOE); .add(ModItems.PRISMA_STEEL_HOE);
getOrCreateTagBuilder(ItemTags.TRIMMABLE_ARMOR)
.add(ModItems.PRISMA_STEEL_HELMET)
.add(ModItems.PRISMA_STEEL_CHESTPLATE)
.add(ModItems.PRISMA_STEEL_LEGGINGS)
.add(ModItems.PRISMA_STEEL_BOOTS);
} }
} }
@@ -1,14 +1,16 @@
package com.acethewildfire.acesbs.datagen; package com.acethewildfire.acesbs.datagen;
import com.acethewildfire.acesbs.AcesBS;
import com.acethewildfire.acesbs.block.ModBlocks; import com.acethewildfire.acesbs.block.ModBlocks;
import com.acethewildfire.acesbs.item.ModItems; import com.acethewildfire.acesbs.item.ModItems;
import com.acethewildfire.acesbs.util.ModTags; import com.acethewildfire.acesbs.util.ModTags;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider; import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider;
import net.fabricmc.fabric.api.loot.v3.LootTableEvents;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.Enchantments; import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemConvertible; import net.minecraft.item.ItemConvertible;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@@ -21,7 +23,6 @@ import net.minecraft.loot.condition.MatchToolLootCondition;
import net.minecraft.loot.entry.ItemEntry; import net.minecraft.loot.entry.ItemEntry;
import net.minecraft.loot.entry.LeafEntry; import net.minecraft.loot.entry.LeafEntry;
import net.minecraft.loot.function.ApplyBonusLootFunction; import net.minecraft.loot.function.ApplyBonusLootFunction;
import net.minecraft.loot.function.ConditionalLootFunction;
import net.minecraft.loot.function.ExplosionDecayLootFunction; import net.minecraft.loot.function.ExplosionDecayLootFunction;
import net.minecraft.loot.function.SetCountLootFunction; import net.minecraft.loot.function.SetCountLootFunction;
import net.minecraft.loot.provider.number.ConstantLootNumberProvider; import net.minecraft.loot.provider.number.ConstantLootNumberProvider;
@@ -31,12 +32,11 @@ import net.minecraft.predicate.item.EnchantmentPredicate;
import net.minecraft.predicate.item.EnchantmentsPredicate; import net.minecraft.predicate.item.EnchantmentsPredicate;
import net.minecraft.predicate.item.ItemPredicate; import net.minecraft.predicate.item.ItemPredicate;
import net.minecraft.predicate.item.ItemSubPredicateTypes; import net.minecraft.predicate.item.ItemSubPredicateTypes;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.RegistryWrapper; import net.minecraft.registry.RegistryWrapper;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
public class ModLootTableProvider extends FabricBlockLootTableProvider { public class ModLootTableProvider extends FabricBlockLootTableProvider {
@@ -66,7 +66,7 @@ public class ModLootTableProvider extends FabricBlockLootTableProvider {
addDrop(ModBlocks.LEMONWOOD_DOOR, doorDrops(ModBlocks.LEMONWOOD_DOOR)); addDrop(ModBlocks.LEMONWOOD_DOOR, doorDrops(ModBlocks.LEMONWOOD_DOOR));
addDrop(ModBlocks.LEMONWOOD_TRAPDOOR); addDrop(ModBlocks.LEMONWOOD_TRAPDOOR);
addDrop(ModBlocks.ENTROPY_ORE, prismaSteelOreDrops(ModBlocks.ENTROPY_ORE, ModItems.RAW_ENTROPY, ModItems.PRISMA_STEEL_PICKAXE, 1, 6)); addDrop(ModBlocks.ENTROPY_ORE, prismaSteelOreDrops(ModBlocks.ENTROPY_ORE, ModItems.RAW_ENTROPY, 1, 3));
} }
public LootTable.Builder multipleOreDrops(Block drop, Item item, float minDrops, float maxDrops) { public LootTable.Builder multipleOreDrops(Block drop, Item item, float minDrops, float maxDrops) {
@@ -86,7 +86,7 @@ public class ModLootTableProvider extends FabricBlockLootTableProvider {
} }
public LootTable.Builder prismaSteelOreDrops(Block block, Item defaultItem, ItemConvertible tools, float minDrops, float maxDrops){ public LootTable.Builder prismaSteelOreDrops(Block block, Item defaultItem, float minDrops, float maxDrops){
RegistryWrapper.Impl<Enchantment> impl = this.registryLookup.getWrapperOrThrow(RegistryKeys.ENCHANTMENT); RegistryWrapper.Impl<Enchantment> impl = this.registryLookup.getWrapperOrThrow(RegistryKeys.ENCHANTMENT);
LootCondition.Builder silkTouchCondition = MatchToolLootCondition.builder( LootCondition.Builder silkTouchCondition = MatchToolLootCondition.builder(
ItemPredicate.Builder.create() ItemPredicate.Builder.create()
@@ -99,7 +99,7 @@ public class ModLootTableProvider extends FabricBlockLootTableProvider {
LootPool.Builder defaultPool = LootPool.builder() LootPool.Builder defaultPool = LootPool.builder()
.rolls(UniformLootNumberProvider.create(minDrops, maxDrops)) .rolls(UniformLootNumberProvider.create(minDrops, maxDrops))
.conditionally(InvertedLootCondition.builder(silkTouchCondition)) .conditionally(InvertedLootCondition.builder(silkTouchCondition))
.conditionally(InvertedLootCondition.builder(specialToolCondition(tools))) .conditionally(InvertedLootCondition.builder(specialToolCondition(ModItems.PRISMA_STEEL_PICKAXE, ModItems.PRISMA_STEEL_HAMMER)))
.with(ItemEntry.builder(defaultItem).weight(1)) .with(ItemEntry.builder(defaultItem).weight(1))
.apply(ApplyBonusLootFunction.oreDrops(impl.getOrThrow(Enchantments.FORTUNE))) .apply(ApplyBonusLootFunction.oreDrops(impl.getOrThrow(Enchantments.FORTUNE)))
.apply(ExplosionDecayLootFunction.builder()); .apply(ExplosionDecayLootFunction.builder());
@@ -113,13 +113,14 @@ public class ModLootTableProvider extends FabricBlockLootTableProvider {
LootPool.Builder prismaPool = LootPool.builder() LootPool.Builder prismaPool = LootPool.builder()
.rolls(UniformLootNumberProvider.create(minDrops, maxDrops)) .rolls(UniformLootNumberProvider.create(minDrops, maxDrops))
.conditionally(InvertedLootCondition.builder(silkTouchCondition)) .conditionally(InvertedLootCondition.builder(silkTouchCondition))
.conditionally(specialToolCondition(tools)) .conditionally(specialToolCondition(ModItems.PRISMA_STEEL_PICKAXE, ModItems.PRISMA_STEEL_HAMMER))
.with(ItemEntry.builder(defaultItem).weight(360)) .with(ItemEntry.builder(Items.AIR).weight(360))
.with(ItemEntry.builder(Items.COAL).weight(14)) .with(ItemEntry.builder(Items.COAL).weight(14))
.with(ItemEntry.builder(Items.RAW_COPPER).weight(10)) .with(ItemEntry.builder(Items.RAW_COPPER).weight(10))
.with(ItemEntry.builder(Items.RAW_IRON).weight(8)) .with(ItemEntry.builder(Items.RAW_IRON).weight(8))
.with(ItemEntry.builder(Items.RAW_GOLD).weight(6)) .with(ItemEntry.builder(Items.RAW_GOLD).weight(6))
.with(ItemEntry.builder(Items.DIAMOND).weight(2)) .with(ItemEntry.builder(ModItems.RAW_ENTROPY).weight(1))
.with(ItemEntry.builder(Items.DIAMOND).weight(1))
.apply(ApplyBonusLootFunction.oreDrops(impl.getOrThrow(Enchantments.FORTUNE))) .apply(ApplyBonusLootFunction.oreDrops(impl.getOrThrow(Enchantments.FORTUNE)))
.apply(ExplosionDecayLootFunction.builder()); .apply(ExplosionDecayLootFunction.builder());
@@ -6,6 +6,7 @@ import com.acethewildfire.acesbs.item.ModItems;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider; import net.fabricmc.fabric.api.datagen.v1.provider.FabricModelProvider;
import net.minecraft.data.client.*; import net.minecraft.data.client.*;
import net.minecraft.item.ArmorItem;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
public class ModModelProvider extends FabricModelProvider { public class ModModelProvider extends FabricModelProvider {
@@ -61,5 +62,10 @@ public class ModModelProvider extends FabricModelProvider {
itemModelGenerator.register(ModItems.PRISMA_STEEL_AXE, Models.HANDHELD); itemModelGenerator.register(ModItems.PRISMA_STEEL_AXE, Models.HANDHELD);
itemModelGenerator.register(ModItems.PRISMA_STEEL_SHOVEL, Models.HANDHELD); itemModelGenerator.register(ModItems.PRISMA_STEEL_SHOVEL, Models.HANDHELD);
itemModelGenerator.register(ModItems.PRISMA_STEEL_HOE, Models.HANDHELD); itemModelGenerator.register(ModItems.PRISMA_STEEL_HOE, Models.HANDHELD);
itemModelGenerator.registerArmor((ArmorItem) ModItems.PRISMA_STEEL_HELMET);
itemModelGenerator.registerArmor((ArmorItem) ModItems.PRISMA_STEEL_CHESTPLATE);
itemModelGenerator.registerArmor((ArmorItem) ModItems.PRISMA_STEEL_LEGGINGS);
itemModelGenerator.registerArmor((ArmorItem) ModItems.PRISMA_STEEL_BOOTS);
} }
} }
@@ -0,0 +1,34 @@
package com.acethewildfire.acesbs.item;
import com.acethewildfire.acesbs.AcesBS;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.recipe.Ingredient;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;
import java.util.EnumMap;
import java.util.List;
import java.util.function.Supplier;
public class ModArmorMaterials {
public static final RegistryEntry<ArmorMaterial> PRISMA_STEEL_ARMOR_MATERIAL = registerArmorMaterial("prisma_steel",
() -> new ArmorMaterial(Util.make(new EnumMap<>(ArmorItem.Type.class), map -> {
map.put(ArmorItem.Type.BOOTS, 2);
map.put(ArmorItem.Type.LEGGINGS, 4);
map.put(ArmorItem.Type.CHESTPLATE, 6);
map.put(ArmorItem.Type.HELMET, 2);
map.put(ArmorItem.Type.BODY, 4);
}), 20, SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND, () -> Ingredient.ofItems(ModItems.PRISMA_STEEL),
List.of(new ArmorMaterial.Layer(Identifier.of(AcesBS.MOD_ID, "prisma_steel"))), 0, 0));
public static RegistryEntry<ArmorMaterial> registerArmorMaterial(String name, Supplier<ArmorMaterial> material){
return Registry.registerReference(Registries.ARMOR_MATERIAL, Identifier.of(AcesBS.MOD_ID, name), material.get());
}
}
@@ -63,6 +63,11 @@ public class ModItemGroups {
.entries((displayContext, entries) -> { .entries((displayContext, entries) -> {
entries.add(ModItems.PRISMA_STEEL); entries.add(ModItems.PRISMA_STEEL);
entries.add(ModItems.PRISMA_STEEL_SWORD); entries.add(ModItems.PRISMA_STEEL_SWORD);
entries.add(ModItems.PRISMA_STEEL_AXE);
entries.add(ModItems.PRISMA_STEEL_HELMET);
entries.add(ModItems.PRISMA_STEEL_CHESTPLATE);
entries.add(ModItems.PRISMA_STEEL_LEGGINGS);
entries.add(ModItems.PRISMA_STEEL_BOOTS);
}) })
@@ -82,6 +87,7 @@ public class ModItemGroups {
entries.add(ModItems.PRISMA_STEEL_HOE); entries.add(ModItems.PRISMA_STEEL_HOE);
}) })
.build()); .build());
@@ -70,6 +70,22 @@ public class ModItems {
.attributeModifiers(HoeItem.createAttributeModifiers(ModToolMaterials.PRISMA_STEEL, -2.0F, -1.0F))) .attributeModifiers(HoeItem.createAttributeModifiers(ModToolMaterials.PRISMA_STEEL, -2.0F, -1.0F)))
); );
public static final Item PRISMA_STEEL_HELMET = registerItem("prisma_steel_helmet",
new ArmorItem(ModArmorMaterials.PRISMA_STEEL_ARMOR_MATERIAL, ArmorItem.Type.HELMET, new Item.Settings()
.maxDamage(ArmorItem.Type.HELMET.getMaxDamage(15))));
public static final Item PRISMA_STEEL_CHESTPLATE = registerItem("prisma_steel_chestplate",
new ArmorItem(ModArmorMaterials.PRISMA_STEEL_ARMOR_MATERIAL, ArmorItem.Type.CHESTPLATE, new Item.Settings()
.maxDamage(ArmorItem.Type.CHESTPLATE.getMaxDamage(15))));
public static final Item PRISMA_STEEL_LEGGINGS = registerItem("prisma_steel_leggings",
new ArmorItem(ModArmorMaterials.PRISMA_STEEL_ARMOR_MATERIAL, ArmorItem.Type.LEGGINGS, new Item.Settings()
.maxDamage(ArmorItem.Type.LEGGINGS.getMaxDamage(15))));
public static final Item PRISMA_STEEL_BOOTS = registerItem("prisma_steel_boots",
new ArmorItem(ModArmorMaterials.PRISMA_STEEL_ARMOR_MATERIAL, ArmorItem.Type.BOOTS, new Item.Settings()
.maxDamage(ArmorItem.Type.BOOTS.getMaxDamage(15))));
private static Item registerItem(String name, Item item){ private static Item registerItem(String name, Item item){
return Registry.register(Registries.ITEM, Identifier.of(AcesBS.MOD_ID, name), item); return Registry.register(Registries.ITEM, Identifier.of(AcesBS.MOD_ID, name), item);
} }
@@ -33,18 +33,10 @@ import java.util.Random;
public class HammerItem extends MiningToolItem { public class HammerItem extends MiningToolItem {
// private final Random r = new Random();
// private List<Item> replacementItems = new ArrayList<>();
public HammerItem(ToolMaterial material, Settings settings) { public HammerItem(ToolMaterial material, Settings settings) {
super(material, BlockTags.PICKAXE_MINEABLE, settings); super(material, BlockTags.PICKAXE_MINEABLE, settings);
} }
// private boolean isValidItem(ItemStack stack) {
// return stack.isIn(ModTags.Items.PRISMA_CONVERTABLE);
// }
public static List<BlockPos> getBlocksToBeDestroyed(int range, BlockPos initalBlockPos, ServerPlayerEntity player) { public static List<BlockPos> getBlocksToBeDestroyed(int range, BlockPos initalBlockPos, ServerPlayerEntity player) {
List<BlockPos> positions = new ArrayList<>(); List<BlockPos> positions = new ArrayList<>();
HitResult hit = player.raycast(20, 0, false); HitResult hit = player.raycast(20, 0, false);
@@ -78,28 +70,4 @@ public class HammerItem extends MiningToolItem {
return positions; return positions;
} }
// @Override
// public boolean postMine(ItemStack stack, World world, BlockState state, BlockPos pos, LivingEntity miner) {
// ItemStack nextItem = stack;
// ItemStack testing = new ItemStack(ModItems.LEMON, 1);
// state.getDroppedStacks(new LootContextParameterSet.Builder(world.getServer().getWorld(world.getRegistryKey()))
// .add(LootContextParameters.ORIGIN, Vec3d.ofCenter(pos))
// .add(LootContextParameters.TOOL, stack)
// ).removeFirst();
// if(isValidItem(stack)){
// int chance = r.nextInt(1,21); // 1-20
// replacementItems.add(ModItems.RAW_ENTROPY);
// replacementItems.add(ModItems.STABLE_ENTROPY);
// replacementItems.add(ModItems.LEMON);
// int itemIndex = r.nextInt(1, replacementItems.size()+1);
//
// ItemStack replacementStack = new ItemStack(replacementItems.get(itemIndex), stack.getCount());
// if (chance == 20) {
// nextItem = replacementStack;
// }
// }
// return super.postMine(stack, world, state, pos, miner);
// }
} }
@@ -0,0 +1,77 @@
package com.acethewildfire.acesbs.util;
import com.acethewildfire.acesbs.AcesBS;
import com.acethewildfire.acesbs.item.ModItems;
import net.fabricmc.fabric.api.loot.v3.LootTableEvents;
import net.minecraft.block.Blocks;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.item.ItemConvertible;
import net.minecraft.item.Items;
import net.minecraft.loot.LootPool;
import net.minecraft.loot.LootTable;
import net.minecraft.loot.condition.InvertedLootCondition;
import net.minecraft.loot.condition.LootCondition;
import net.minecraft.loot.condition.MatchToolLootCondition;
import net.minecraft.loot.entry.ItemEntry;
import net.minecraft.loot.function.ApplyBonusLootFunction;
import net.minecraft.loot.function.ExplosionDecayLootFunction;
import net.minecraft.loot.provider.number.UniformLootNumberProvider;
import net.minecraft.predicate.NumberRange;
import net.minecraft.predicate.item.EnchantmentPredicate;
import net.minecraft.predicate.item.EnchantmentsPredicate;
import net.minecraft.predicate.item.ItemPredicate;
import net.minecraft.predicate.item.ItemSubPredicateTypes;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.registry.RegistryWrapper;
import java.util.List;
public class UpdateRecipies {
private static LootCondition.Builder specialToolCondition(ItemConvertible... tools){
return MatchToolLootCondition.builder(
ItemPredicate.Builder.create()
.items(tools)
);
}
public static void updateVanilla(){
AcesBS.LOGGER.info("Updating vanilla Ore Drops for Prisma Steel");
RegistryKey<LootTable> ironOreLootId = Blocks.IRON_ORE.getLootTableKey();
LootTableEvents.MODIFY.register((key, tableBuilder, source, wrapperLookup) -> {
RegistryWrapper.Impl<Enchantment> impl = wrapperLookup.getWrapperOrThrow(RegistryKeys.ENCHANTMENT);
LootCondition.Builder silkTouchCondition = MatchToolLootCondition.builder(
ItemPredicate.Builder.create()
.subPredicate(
ItemSubPredicateTypes.ENCHANTMENTS,
EnchantmentsPredicate.enchantments(List.of(new EnchantmentPredicate(impl.getOrThrow(Enchantments.SILK_TOUCH), NumberRange.IntRange.atLeast(1))))
)
);
// Target only iron ore
if (source.isBuiltin() && ironOreLootId.equals(key)) {
LootPool.Builder extraPool = LootPool.builder()
.rolls(UniformLootNumberProvider.create(1, 2))
.conditionally(InvertedLootCondition.builder(silkTouchCondition))
.conditionally(specialToolCondition(ModItems.PRISMA_STEEL_PICKAXE, ModItems.PRISMA_STEEL_HAMMER))
.with(ItemEntry.builder(Items.AIR).weight(360))
.with(ItemEntry.builder(Items.COAL).weight(14))
.with(ItemEntry.builder(Items.RAW_COPPER).weight(10))
.with(ItemEntry.builder(Items.RAW_IRON).weight(8))
.with(ItemEntry.builder(Items.RAW_GOLD).weight(6))
.with(ItemEntry.builder(ModItems.RAW_ENTROPY).weight(1))
.with(ItemEntry.builder(Items.DIAMOND).weight(1))
.apply(ApplyBonusLootFunction.oreDrops(impl.getOrThrow(Enchantments.FORTUNE)))
.apply(ExplosionDecayLootFunction.builder());
// Add our extra drop pool to loot table
tableBuilder.pool(extraPool);
}
});
}
}
@@ -20,6 +20,11 @@
"item.acesbs.prisma_steel_shovel": "Prisma Steel Shovel", "item.acesbs.prisma_steel_shovel": "Prisma Steel Shovel",
"item.acesbs.prisma_steel_hoe": "Prisma Steel Hoe", "item.acesbs.prisma_steel_hoe": "Prisma Steel Hoe",
"item.acesbs.prisma_steel_helmet": "Prisma Steel Helmet",
"item.acesbs.prisma_steel_chestplate": "Prisma Steel Chestplate",
"item.acesbs.prisma_steel_leggings": "Prisma Steel Leggings",
"item.acesbs.prisma_steel_boots": "Prisma Steel Boots",
"block.acesbs.entropy_block": "Block of Entropy", "block.acesbs.entropy_block": "Block of Entropy",
"block.acesbs.prisma_steel_block": "Block of Prisma Steel", "block.acesbs.prisma_steel_block": "Block of Prisma Steel",
"block.acesbs.entropy_ore": "Entropic Ore", "block.acesbs.entropy_ore": "Entropic Ore",
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB