kaupen bow and ashes

This commit is contained in:
Vos
2025-11-11 00:04:27 -06:00
parent 4938b5675e
commit 69ec2bea0b
18 changed files with 184 additions and 21 deletions
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "acesbs:item/infernal_ashes"
}
}
@@ -53,6 +53,7 @@ public class ModModelProvider extends FabricModelProvider {
itemModelGenerator.register(ModItems.ORACLE_LEMON, Models.GENERATED);
itemModelGenerator.register(ModItems.GREEN_BRICKS, Models.GENERATED);
itemModelGenerator.register(ModItems.STABLE_ENTROPY, Models.GENERATED);
itemModelGenerator.register(ModItems.INFERNAL_ASHES, Models.GENERATED);
// itemModelGenerator.register(ModItems.WAND, Models.HANDHELD_ROD);
itemModelGenerator.register(ModItems.PRISMA_STEEL, Models.GENERATED);
itemModelGenerator.register(ModItems.PRISMA_SMITHING_TEMPLATE, Models.GENERATED);
@@ -22,8 +22,8 @@ public class ModItemGroups {
entries.add(ModItems.ORACLE_LEMON);
entries.add(ModItems.RAW_ENTROPY);
entries.add(ModItems.STABLE_ENTROPY);
entries.add(ModItems.INFERNAL_ASHES);
entries.add(ModItems.GREEN_BRICKS);
entries.add(ModItems.WAND);
entries.add(ModItems.PRISMA_STEEL);
entries.add(ModItems.PRISMA_SMITHING_TEMPLATE);
})
@@ -69,6 +69,7 @@ public class ModItemGroups {
entries.add(ModItems.PRISMA_STEEL_CHESTPLATE);
entries.add(ModItems.PRISMA_STEEL_LEGGINGS);
entries.add(ModItems.PRISMA_STEEL_BOOTS);
entries.add(ModItems.KAUPEN_BOW);
})
@@ -80,7 +81,7 @@ public class ModItemGroups {
.icon(() -> new ItemStack(ModItems.PRISMA_STEEL_PICKAXE))
.displayName(Text.translatable("itemgroup.acesbs.tools"))
.entries((displayContext, entries) -> {
entries.add(ModItems.PRISMA_STEEL);
entries.add(ModItems.WAND);
entries.add(ModItems.PRISMA_STEEL_SHOVEL);
entries.add(ModItems.PRISMA_STEEL_PICKAXE);
entries.add(ModItems.PRISMA_STEEL_HAMMER);
@@ -29,13 +29,14 @@ public class ModItems {
public static final Item WAND = registerItem("wand", new Wand(new Item.Settings().maxDamage(32)));
public static final Item RAW_ENTROPY = registerItem("raw_entropy", new Item(new Item.Settings()));
public static final Item STABLE_ENTROPY = registerItem("stable_entropy", new Item(new Item.Settings()));
public static final Item INFERNAL_ASHES = registerItem("infernal_ashes", new Item(new Item.Settings()));
public static final Item LEMON = registerItem("lemon", new Item(new Item.Settings().food(ModFoodComponent.LEMON)));
public static final Item COOKED_LEMON = registerItem("cooked_lemon", new Item(new Item.Settings().food(ModFoodComponent.COOKED_LEMON)));
public static final Item GREEN_BRICKS = registerItem("green_bricks", new Item(new Item.Settings()) {
@Override
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
if(Screen.hasShiftDown()){
tooltip.add(Text.translatable("tooltip.acesbs.green_bricks.shift_down"));
if(!Screen.hasShiftDown()){
tooltip.add(Text.translatable("tooltip.acesbs.generic.shift_up"));
}
else {
tooltip.add(Text.translatable("tooltip.acesbs.green_bricks"));
@@ -91,6 +92,27 @@ public class ModItems {
public static final Item PRISMA_SMITHING_TEMPLATE = registerItem("prisma_armor_trim_smithing_template",
SmithingTemplateItem.of(Identifier.of(AcesBS.MOD_ID, "prisma"), FeatureFlags.VANILLA));
public static final Item KAUPEN_BOW = registerItem("kaupen_bow",
new BowItem(new Item.Settings().maxDamage(500)) {
@Override
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
if(!Screen.hasShiftDown()){
tooltip.add(Text.translatable("tooltip.acesbs.generic.shift_up"));
}
else {
tooltip.add(Text.translatable("tooltip.acesbs.kaupen_bow"));
tooltip.add(Text.translatable("tooltip.acesbs.kaupen_bow_2"));
}
super.appendTooltip(stack, context, tooltip, type);
}
});
private static Item registerItem(String name, Item item){
return Registry.register(Registries.ITEM, Identifier.of(AcesBS.MOD_ID, name), item);
}
@@ -57,8 +57,8 @@ public class Wand extends Item {
@Override
public void appendTooltip(ItemStack stack, TooltipContext context, List<Text> tooltip, TooltipType type) {
if(Screen.hasShiftDown()) {
tooltip.add(Text.translatable("tooltip.acesbs.wand.shift_down"));
if(!Screen.hasShiftDown()){
tooltip.add(Text.translatable("tooltip.acesbs.generic.shift_up"));
} else {
tooltip.add(Text.translatable("tooltip.acesbs.wand"));
}
@@ -0,0 +1,39 @@
package com.acethewildfire.acesbs.mixin;
import com.acethewildfire.acesbs.item.ModItems;
import com.mojang.authlib.GameProfile;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
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 org.spongepowered.asm.mixin.injection.callback.LocalCapture;
// With help from https://github.com/Globox1997/MedievalWeapons/blob/1.21/src/main/java/net/medievalweapons/mixin/client/AbstractClientPlayerEntityMixin.java
// Under MIT License!
@Mixin(AbstractClientPlayerEntity.class)
public abstract class AbstractClientPlayerEntityMixin extends PlayerEntity {
public AbstractClientPlayerEntityMixin(World world, BlockPos pos, float yaw, GameProfile gameProfile) {
super(world, pos, yaw, gameProfile);
}
@Inject(method = "getFovMultiplier", at = @At(value = "TAIL"), locals = LocalCapture.CAPTURE_FAILSOFT, cancellable = true)
private void getFovMultiplierMixin(CallbackInfoReturnable<Float> info, float f) {
Item item = this.getActiveItem().getItem();
ItemStack itemStack = this.getActiveItem();
if (this.isUsingItem() && itemStack.isOf(ModItems.KAUPEN_BOW)) {
int i = this.getItemUseTime();
float g = (float)i / 20.0f;
g = g > 1.0f ? 1.0f : g * g;
f *= 1.0f - g * 0.15f;
info.setReturnValue(MathHelper.lerp(MinecraftClient.getInstance().options.getFovEffectScale().getValue().floatValue(), 1.0f, f));
}
}
}
@@ -4,6 +4,8 @@ import com.acethewildfire.acesbs.AcesBS;
import com.acethewildfire.acesbs.component.ModDataComponentTypes;
import com.acethewildfire.acesbs.item.ModItems;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.util.Identifier;
public class ModModelPredicates {
@@ -12,6 +14,21 @@ public class ModModelPredicates {
ModelPredicateProviderRegistry.register(ModItems.WAND, Identifier.of(AcesBS.MOD_ID, "used"),
(stack, world, entity, seed) -> stack.get(ModDataComponentTypes.COORDINATES) != null ? 1f : 0f);
registerCustomBow(ModItems.KAUPEN_BOW);
}
private static void registerCustomBow(Item item){
ModelPredicateProviderRegistry.register(item, Identifier.ofVanilla("pull"), (stack, world, entity, seed) -> {
if (entity == null) {
return 0.0F;
} else {
return entity.getActiveItem() != stack ? 0.0F : (stack.getMaxUseTime(entity) - entity.getItemUseTimeLeft()) / 20.0F;
}
});
ModelPredicateProviderRegistry.register(
item,
Identifier.ofVanilla("pulling"),
(stack, world, entity, seed) -> entity != null && entity.isUsingItem() && entity.getActiveItem() == stack ? 1.0F : 0.0F
);
}
}
+12 -9
View File
@@ -1,11 +1,14 @@
{
"required": true,
"package": "com.acethewildfire.acesbs.mixin",
"compatibilityLevel": "JAVA_21",
"mixins": [
"ExampleMixin"
],
"injectors": {
"defaultRequire": 1
}
"required": true,
"package": "com.acethewildfire.acesbs.mixin",
"compatibilityLevel": "JAVA_21",
"mixins": [
"ExampleMixin"
],
"injectors": {
"defaultRequire": 1
},
"client": [
"AbstractClientPlayerEntityMixin"
]
}
@@ -2,6 +2,7 @@
"item.acesbs.oracle_lemon.effect.blindness": "Oracle of Lemon",
"item.acesbs.raw_entropy": "Raw Entropy",
"item.acesbs.stable_entropy": "Stabilized Entropy",
"item.acesbs.infernal_ashes": "Infernal Ashes",
"item.acesbs.lemon": "Odd Lemon",
"item.acesbs.cooked_lemon": "Cooked Odd Lemon",
"item.acesbs.green_bricks": "Green Bricks",
@@ -26,6 +27,11 @@
"item.acesbs.prisma_steel_boots": "Prisma Steel Boots",
"item.acesbs.prisma_armor_trim_smithing_template": "Prisma Smithing Template",
"item.acesbs.kaupen_bow": "Kaupen Bow",
"trim_material.acesbs.prisma_steel": "Prisma Steel Material",
"trim_pattern.acesbs.prisma": "Prisma Armor Pattern",
"block.acesbs.entropy_block": "Block of Raw Entropy",
"block.acesbs.prisma_steel_block": "Block of Prisma Steel",
"block.acesbs.entropy_ore": "Entropic Ore",
@@ -51,14 +57,14 @@
"itemgroup.acesbs.combat": "Ace's BS Combat",
"itemgroup.acesbs.tools": "Ace's BS Tools",
"tooltip.acesbs.generic.shift_up": "Hold §eShift§r for item description.",
"tooltip.acesbs.entropy_block.tooltip": "Exerts an §o§4uncertain force§r when stepped on.",
"tooltip.acesbs.stable_entropy_block.tooltip": "Exerts an §o§2upward force§r of 4.5 blocks when stepped on.",
"tooltip.acesbs.green_bricks.shift_down": "§o§7Useless Item§r",
"tooltip.acesbs.green_bricks": "Hold §eShift§r for item description.",
"tooltip.acesbs.green_bricks": "§o§7Useless Item§r",
"tooltip.acesbs.entropy_block.tooltip2": "Has a 1/20 chance of turning an apple into a lemon.",
"tooltip.acesbs.wand.shift_down": "Changes blocks using Entropy",
"tooltip.acesbs.wand": "Hold §eShift§r for item description.",
"tooltip.acesbs.wand": "Changes blocks using Entropy",
"trim_material.acesbs.prisma_steel": "Prisma Steel Material",
"trim_pattern.acesbs.prisma": "Prisma Armor Pattern"
"tooltip.acesbs.kaupen_bow": "§7§oThanks to §1Modding by Kaupenjoe§r",
"tooltip.acesbs.kaupen_bow_2": "§7§oYou made minecraft modding easy.§r"
}
@@ -0,0 +1,50 @@
{
"parent": "item/generated",
"textures": {
"layer0": "acesbs:item/kaupen_bow"
},
"display": {
"thirdperson_righthand": {
"rotation": [ -80, 260, -40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"thirdperson_lefthand": {
"rotation": [ -80, -280, 40 ],
"translation": [ -1, -2, 2.5 ],
"scale": [ 0.9, 0.9, 0.9 ]
},
"firstperson_righthand": {
"rotation": [ 0, -90, 25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
},
"firstperson_lefthand": {
"rotation": [ 0, 90, -25 ],
"translation": [ 1.13, 3.2, 1.13],
"scale": [ 0.68, 0.68, 0.68 ]
}
},
"overrides": [
{
"predicate": {
"pulling": 1
},
"model": "acesbs:item/kaupen_bow_pulling_0"
},
{
"predicate": {
"pulling": 1,
"pull": 0.65
},
"model": "acesbs:item/kaupen_bow_pulling_1"
},
{
"predicate": {
"pulling": 1,
"pull": 0.9
},
"model": "acesbs:item/kaupen_bow_pulling_2"
}
]
}
@@ -0,0 +1,6 @@
{
"parent": "acesbs:item/kaupen_bow",
"textures": {
"layer0": "acesbs:item/kaupen_bow_pulling_0"
}
}
@@ -0,0 +1,6 @@
{
"parent": "acesbs:item/kaupen_bow",
"textures": {
"layer0": "acesbs:item/kaupen_bow_pulling_1"
}
}
@@ -0,0 +1,6 @@
{
"parent": "acesbs:item/kaupen_bow",
"textures": {
"layer0": "acesbs:item/kaupen_bow_pulling_2"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB