2.1.0 Ashen Item Effect

This commit is contained in:
Vos
2026-03-25 20:25:02 -05:00
parent f228f1e532
commit f4666e99b2
9 changed files with 195 additions and 17 deletions
@@ -5,7 +5,7 @@
- Hammers are now included in the pickaxe item tag. (aka, to other mods they will be considered a type of pickaxe)
- Fire Oak Trees and associated wood blocks. Obtainable by placing an oak sapling and infernal ashes in an Entropic Entangler
- Fractal Diamonds can now be obtained by placing a diamond and stable entropy into an entropic entangler. They can be used to craft tools and armor. They have the same effect as Prisma Steel and drop additional ores when mining.
- Hellfire Diamonds can now be obtained by placing a diamond and infernal ashes into an entropic entangler. They can be used to craft tools and armor.
- Hellfire Diamonds can now be obtained by placing a diamond and infernal ashes into an entropic entangler. They can be used to craft tools and armor. They automatically smelt items that are smeltable. (Ex: Ores->ingots, logs->charcoal, sand->glass). These tools are not compatible with silk touch, but other enchantments still work.
## Fixes
- Blocks of Ashen Steel now have a recipe and drop when mined. Not sure how I missed that one.
- Hammers are now enchantable and are compatible with pickaxe enchantments.
@@ -13,6 +13,8 @@
- Lemonwood Trapdoors face the correct direction
## Changes
- Lemonwood saplings are now obtained through an Entropic Entangler recipe (Stable Entropy + Birch Sapling)
- Ashen Steel tools now automatically smelt items that can be smeltable. (Ex: Ores->ingots, logs->charcoal, sand->glass)
- Because of this Silk Touch can not be applied to these tools.
- Durability calculations have changed to reflect the material's rarity.
- Tools have the mining level of the base material with the durability of the next tier.
- Hammers get the equivalent durability for the materials put into them. (effectively the durability x6.33)
@@ -1,13 +1,9 @@
package com.acethewildfire.acesbs.item;
import com.acethewildfire.acesbs.AcesBS;
import com.acethewildfire.acesbs.item.custom.HammerItem;
import com.acethewildfire.acesbs.item.custom.ModArmorItem;
import com.acethewildfire.acesbs.item.custom.*;
import com.acethewildfire.acesbs.trim.ModTrimMaterials;
import net.minecraft.item.*;
import net.minecraft.item.equipment.EquipmentType;
import net.minecraft.resource.featuretoggle.FeatureFlags;
import net.minecraft.util.Identifier;
public class AshenSteelItems {
@@ -15,13 +11,13 @@ public class AshenSteelItems {
public static final Item ASHEN_STEEL_SWORD = ModItems.registerItem("ashen_steel_sword",
setting -> new Item(setting.sword(ModToolMaterials.ASHEN_STEEL, 3, -2.4f)));
public static final Item ASHEN_STEEL_SHOVEL = ModItems.registerItem("ashen_steel_shovel",
setting -> new ShovelItem(ModToolMaterials.ASHEN_STEEL, 1.5F, -3.0F, setting));
setting -> new SmeltingShovel(ModToolMaterials.ASHEN_STEEL, 1.5F, -3.0F, setting));
public static final Item ASHEN_STEEL_PICKAXE = ModItems.registerItem("ashen_steel_pickaxe",
setting -> new Item(setting.pickaxe(ModToolMaterials.ASHEN_STEEL, 1.0F, -2.8F)));
setting -> new SmeltingPickaxe(setting.pickaxe(ModToolMaterials.ASHEN_STEEL, 1.0F, -2.8F)));
public static final Item ASHEN_STEEL_HAMMER = ModItems.registerItem("ashen_steel_hammer",
setting -> new HammerItem(ModToolMaterials.ASHEN_STEEL, 9.0F, -3.4F, setting.maxDamage(9886)));
setting -> new SmeltingHammer(ModToolMaterials.ASHEN_STEEL, 9.0F, -3.4F, setting.maxDamage(9886)));
public static final Item ASHEN_STEEL_AXE = ModItems.registerItem("ashen_steel_axe",
setting -> new AxeItem(ModToolMaterials.ASHEN_STEEL, 6.0F, -3.1F, setting));
setting -> new SmeltingAxe(ModToolMaterials.ASHEN_STEEL, 6.0F, -3.1F, setting));
public static final Item ASHEN_STEEL_HOE = ModItems.registerItem("ashen_steel_hoe",
setting -> new HoeItem(ModToolMaterials.ASHEN_STEEL, -2.0F, -1.0F, setting));
public static final Item ASHEN_STEEL_HELMET = ModItems.registerItem("ashen_steel_helmet",
@@ -1,7 +1,6 @@
package com.acethewildfire.acesbs.item;
import com.acethewildfire.acesbs.item.custom.HammerItem;
import com.acethewildfire.acesbs.item.custom.ModArmorItem;
import com.acethewildfire.acesbs.item.custom.*;
import net.minecraft.item.*;
import net.minecraft.item.equipment.EquipmentType;
@@ -11,13 +10,13 @@ public class HellfireDiamondItems {
public static final Item HELLFIRE_DIAMOND_SWORD = ModItems.registerItem("hellfire_diamond_sword",
setting -> new Item(setting.sword(ModToolMaterials.HELLFIRE_DIAMOND, 3, -2.4f)));
public static final Item HELLFIRE_DIAMOND_SHOVEL = ModItems.registerItem("hellfire_diamond_shovel",
setting -> new ShovelItem(ModToolMaterials.HELLFIRE_DIAMOND, 1.5F, -3.0F, setting));
setting -> new SmeltingShovel(ModToolMaterials.HELLFIRE_DIAMOND, 1.5F, -3.0F, setting));
public static final Item HELLFIRE_DIAMOND_PICKAXE = ModItems.registerItem("hellfire_diamond_pickaxe",
setting -> new Item(setting.pickaxe(ModToolMaterials.HELLFIRE_DIAMOND, 1.0F, -2.8F)));
setting -> new SmeltingPickaxe(setting.pickaxe(ModToolMaterials.HELLFIRE_DIAMOND, 1.0F, -2.8F)));
public static final Item HELLFIRE_DIAMOND_HAMMER = ModItems.registerItem("hellfire_diamond_hammer",
setting -> new HammerItem(ModToolMaterials.HELLFIRE_DIAMOND, 7.0F, -3.4F, setting.maxDamage(12863)));
setting -> new SmeltingHammer(ModToolMaterials.HELLFIRE_DIAMOND, 7.0F, -3.4F, setting.maxDamage(12863)));
public static final Item HELLFIRE_DIAMOND_AXE = ModItems.registerItem("hellfire_diamond_axe",
setting -> new AxeItem(ModToolMaterials.HELLFIRE_DIAMOND, 6.0F, -3.1F, setting));
setting -> new SmeltingAxe(ModToolMaterials.HELLFIRE_DIAMOND, 6.0F, -3.1F, setting));
public static final Item HELLFIRE_DIAMOND_HOE = ModItems.registerItem("hellfire_diamond_hoe",
setting -> new HoeItem(ModToolMaterials.HELLFIRE_DIAMOND, -2.0F, -1.0F, setting));
public static final Item HELLFIRE_DIAMOND_HELMET = ModItems.registerItem("hellfire_diamond_helmet",
@@ -0,0 +1,27 @@
package com.acethewildfire.acesbs.item.custom;
import net.fabricmc.fabric.api.item.v1.EnchantingContext;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.item.AxeItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ToolMaterial;
import net.minecraft.registry.entry.RegistryEntry;
public class SmeltingAxe extends AxeItem {
public SmeltingAxe(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) {
super(material, attackDamage, attackSpeed, settings);
}
@Override
public boolean canBeEnchantedWith(ItemStack stack, RegistryEntry<Enchantment> enchantment, EnchantingContext context) {
if (enchantment.matchesKey(Enchantments.SILK_TOUCH)) return false;
return super.canBeEnchantedWith(stack, enchantment, context);
}
}
@@ -0,0 +1,38 @@
package com.acethewildfire.acesbs.item.custom;
import net.fabricmc.fabric.api.item.v1.EnchantingContext;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ToolMaterial;
import net.minecraft.recipe.RecipeEntry;
import net.minecraft.recipe.RecipeType;
import net.minecraft.recipe.SmeltingRecipe;
import net.minecraft.recipe.input.SingleStackRecipeInput;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import java.util.List;
import java.util.Optional;
public class SmeltingHammer extends HammerItem {
public SmeltingHammer(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) {
super(material, attackDamage, attackSpeed, settings);
}
@Override
public boolean canBeEnchantedWith(ItemStack stack, RegistryEntry<Enchantment> enchantment, EnchantingContext context) {
if (enchantment.matchesKey(Enchantments.SILK_TOUCH)) return false;
return super.canBeEnchantedWith(stack, enchantment, context);
}
}
@@ -0,0 +1,23 @@
package com.acethewildfire.acesbs.item.custom;
import net.fabricmc.fabric.api.item.v1.EnchantingContext;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.entry.RegistryEntry;
public class SmeltingPickaxe extends Item {
public SmeltingPickaxe(Settings settings) {
super(settings);
}
@Override
public boolean canBeEnchantedWith(ItemStack stack, RegistryEntry<Enchantment> enchantment, EnchantingContext context) {
if (enchantment.matchesKey(Enchantments.SILK_TOUCH)) return false;
return super.canBeEnchantedWith(stack, enchantment, context);
}
}
@@ -0,0 +1,26 @@
package com.acethewildfire.acesbs.item.custom;
import net.fabricmc.fabric.api.item.v1.EnchantingContext;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.Enchantments;
import net.minecraft.item.AxeItem;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ShovelItem;
import net.minecraft.item.ToolMaterial;
import net.minecraft.registry.entry.RegistryEntry;
public class SmeltingShovel extends ShovelItem {
public SmeltingShovel(ToolMaterial material, float attackDamage, float attackSpeed, Settings settings) {
super(material, attackDamage, attackSpeed, settings);
}
@Override
public boolean canBeEnchantedWith(ItemStack stack, RegistryEntry<Enchantment> enchantment, EnchantingContext context) {
if (enchantment.matchesKey(Enchantments.SILK_TOUCH)) return false;
return super.canBeEnchantedWith(stack, enchantment, context);
}
}
@@ -0,0 +1,66 @@
package com.acethewildfire.acesbs.mixin;
import com.acethewildfire.acesbs.item.custom.SmeltingAxe;
import com.acethewildfire.acesbs.item.custom.SmeltingHammer;
import com.acethewildfire.acesbs.item.custom.SmeltingPickaxe;
import com.acethewildfire.acesbs.item.custom.SmeltingShovel;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext;
import net.minecraft.loot.context.LootContextParameters;
import net.minecraft.loot.context.LootWorldContext;
import net.minecraft.recipe.RecipeEntry;
import net.minecraft.recipe.RecipeType;
import net.minecraft.recipe.SmeltingRecipe;
import net.minecraft.recipe.input.SingleStackRecipeInput;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
@Mixin(Block.class)
public class BlockMixin {
@Inject(
method = "getDroppedStacks(Lnet/minecraft/block/BlockState;Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/entity/BlockEntity;Lnet/minecraft/entity/Entity;Lnet/minecraft/item/ItemStack;)Ljava/util/List;",
at = @At("RETURN"),
cancellable = true
)
private static void smeltDrops(
BlockState state, ServerWorld world, BlockPos pos, BlockEntity blockEntity, Entity entity, ItemStack stack, CallbackInfoReturnable<List<ItemStack>> cir
) {
if (!(stack.getItem() instanceof SmeltingPickaxe) && !(stack.getItem() instanceof SmeltingHammer) && !(stack.getItem() instanceof SmeltingAxe) && !(stack.getItem() instanceof SmeltingShovel)) return;
List<ItemStack> originalDrops = cir.getReturnValue();
List<ItemStack> newDrops = new ArrayList<>();
for (ItemStack drop : originalDrops) {
Optional<RecipeEntry<SmeltingRecipe>> recipe =
world.getRecipeManager().getFirstMatch(
RecipeType.SMELTING,
new SingleStackRecipeInput(drop),
world
);
ItemStack result = recipe
.map(r -> r.value().craft(new SingleStackRecipeInput(drop), world.getRegistryManager()))
.orElse(drop);
result.setCount(drop.getCount());
newDrops.add(result);
}
cir.setReturnValue(newDrops);
}
}
+2 -1
View File
@@ -3,13 +3,14 @@
"package": "com.acethewildfire.acesbs.mixin",
"compatibilityLevel": "JAVA_21",
"mixins": [
"BlockMixin",
"CreeperInteractMixin",
"CreeperTickMixin",
"CreeperTransformStateMixin",
"EntityMixin",
"ExampleMixin",
"LivingEntityMixin",
"PlayerEntityMixin",
"PlayerEntityMixin"
],
"injectors": {
"defaultRequire": 1