From 327855e05772211c06c425bb4135ec856693fc02 Mon Sep 17 00:00:00 2001 From: Vos Date: Sat, 14 Mar 2026 20:48:02 -0500 Subject: [PATCH] Bubble Pipe --- .../advancement/recipes/food/bubble_pipe.json | 32 +++++++++++ .../data/acesbs/recipe/bubble_pipe.json | 21 ++++++++ .../com/acethewildfire/acesbs/V1 Complete.txt | 1 - .../component/ModDataComponentTypes.java | 3 ++ .../acesbs/datagen/ModRecipeProvider.java | 9 ++++ .../acesbs/item/ModItemGroups.java | 1 + .../acethewildfire/acesbs/item/ModItems.java | 1 + .../acesbs/item/custom/BubblePipe.java | 44 ++++++++------- .../acesbs/util/ModModelPredicates.java | 6 +++ .../resources/assets/acesbs/lang/en_us.json | 1 + .../acesbs/models/item/bubble_pipe.json | 50 ++++++++++++++++++ .../models/item/smoking_bubble_pipe.json | 38 +++++++++++++ .../acesbs/textures/item/birch_pipe.png | Bin 0 -> 345 bytes 13 files changed, 183 insertions(+), 24 deletions(-) create mode 100644 src/main/generated/data/acesbs/advancement/recipes/food/bubble_pipe.json create mode 100644 src/main/generated/data/acesbs/recipe/bubble_pipe.json create mode 100644 src/main/resources/assets/acesbs/models/item/bubble_pipe.json create mode 100644 src/main/resources/assets/acesbs/models/item/smoking_bubble_pipe.json create mode 100644 src/main/resources/assets/acesbs/textures/item/birch_pipe.png diff --git a/src/main/generated/data/acesbs/advancement/recipes/food/bubble_pipe.json b/src/main/generated/data/acesbs/advancement/recipes/food/bubble_pipe.json new file mode 100644 index 0000000..946f533 --- /dev/null +++ b/src/main/generated/data/acesbs/advancement/recipes/food/bubble_pipe.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_birch_planks": { + "conditions": { + "items": [ + { + "items": "minecraft:birch_planks" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "acesbs:bubble_pipe" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_birch_planks" + ] + ], + "rewards": { + "recipes": [ + "acesbs:bubble_pipe" + ] + } +} \ No newline at end of file diff --git a/src/main/generated/data/acesbs/recipe/bubble_pipe.json b/src/main/generated/data/acesbs/recipe/bubble_pipe.json new file mode 100644 index 0000000..1469bf8 --- /dev/null +++ b/src/main/generated/data/acesbs/recipe/bubble_pipe.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "#": { + "item": "minecraft:iron_ingot" + }, + "P": { + "item": "minecraft:birch_planks" + } + }, + "pattern": [ + " #", + "PPP", + " " + ], + "result": { + "count": 1, + "id": "acesbs:bubble_pipe" + } +} \ No newline at end of file diff --git a/src/main/java/com/acethewildfire/acesbs/V1 Complete.txt b/src/main/java/com/acethewildfire/acesbs/V1 Complete.txt index 3790350..d041a93 100644 --- a/src/main/java/com/acethewildfire/acesbs/V1 Complete.txt +++ b/src/main/java/com/acethewildfire/acesbs/V1 Complete.txt @@ -1,4 +1,3 @@ -Bubble Pipe + Pale Wood + Vanilla Wood Types Ahab's Harpoon Aquarium Gravel Burning Wizard (Infernal Ashes on a Villager) diff --git a/src/main/java/com/acethewildfire/acesbs/component/ModDataComponentTypes.java b/src/main/java/com/acethewildfire/acesbs/component/ModDataComponentTypes.java index 8ae4612..7389b28 100644 --- a/src/main/java/com/acethewildfire/acesbs/component/ModDataComponentTypes.java +++ b/src/main/java/com/acethewildfire/acesbs/component/ModDataComponentTypes.java @@ -22,6 +22,9 @@ public class ModDataComponentTypes { public static final ComponentType COMMAND = register("command", stringBuilder -> stringBuilder.codec(Codec.STRING).packetCodec(PacketCodecs.STRING)); +// public static final ComponentType PIPE_VARIANT = +// register("pipe_variant", integerBuilder -> integerBuilder.codec(Codec.INT).packetCodec(PacketCodecs.INTEGER)); + public static final ComponentType COMMAND_ACTIVE = register("command_active", booleanBuilder -> booleanBuilder.codec(Codec.BOOL).packetCodec(PacketCodecs.BOOL)); diff --git a/src/main/java/com/acethewildfire/acesbs/datagen/ModRecipeProvider.java b/src/main/java/com/acethewildfire/acesbs/datagen/ModRecipeProvider.java index c0d293c..d25ebc2 100644 --- a/src/main/java/com/acethewildfire/acesbs/datagen/ModRecipeProvider.java +++ b/src/main/java/com/acethewildfire/acesbs/datagen/ModRecipeProvider.java @@ -194,6 +194,15 @@ public class ModRecipeProvider extends FabricRecipeProvider { .criterion(hasItem(ModBlocks.STRIPPED_LEMONWOOD_LOG), conditionsFromItem(ModBlocks.STRIPPED_LEMONWOOD_LOG)) .offerTo(recipeExporter); + ShapedRecipeJsonBuilder.create(RecipeCategory.FOOD, ModItems.BUBBLE_PIPE, 1) + .pattern(" #") + .pattern("PPP") + .pattern(" ") + .input('#', Items.IRON_INGOT) + .input('P', Blocks.BIRCH_PLANKS) + .criterion(hasItem(Blocks.BIRCH_PLANKS), conditionsFromItem(Blocks.BIRCH_PLANKS)) + .offerTo(recipeExporter); + createStairsRecipe(ModBlocks.LEMONWOOD_STAIRS, Ingredient.ofItems(ModBlocks.LEMONWOOD_PLANKS)) .criterion(hasItem(ModBlocks.LEMONWOOD_PLANKS), conditionsFromItem(ModBlocks.LEMONWOOD_PLANKS)) .offerTo(recipeExporter); diff --git a/src/main/java/com/acethewildfire/acesbs/item/ModItemGroups.java b/src/main/java/com/acethewildfire/acesbs/item/ModItemGroups.java index 58d5f47..242c224 100644 --- a/src/main/java/com/acethewildfire/acesbs/item/ModItemGroups.java +++ b/src/main/java/com/acethewildfire/acesbs/item/ModItemGroups.java @@ -38,6 +38,7 @@ public class ModItemGroups { entries.add(ModItems.CIGARETTE); entries.add(ModItems.CIGARETTE_LEMON); entries.add(ModItems.CIGARETTE_FUNNY); + entries.add(ModItems.BUBBLE_PIPE); entries.add(ModItems.FREN_SPAWN_EGG); entries.add(ModItems.VULGAR_BONES_SPAWN_EGG); }) diff --git a/src/main/java/com/acethewildfire/acesbs/item/ModItems.java b/src/main/java/com/acethewildfire/acesbs/item/ModItems.java index 20eb4c3..9fa9d30 100644 --- a/src/main/java/com/acethewildfire/acesbs/item/ModItems.java +++ b/src/main/java/com/acethewildfire/acesbs/item/ModItems.java @@ -205,6 +205,7 @@ public class ModItems { public static final Item CIGARETTE = registerItem("cigarette", new Cigarette(new Item.Settings().maxCount(20))); public static final Item CIGARETTE_LEMON = registerItem("cigarette_lemon", new CigaretteLemon(new Item.Settings().maxCount(20))); public static final Item CIGARETTE_FUNNY = registerItem("cigarette_funny", new CigaretteFunny(new Item.Settings().maxCount(20))); + public static final Item BUBBLE_PIPE = registerItem("bubble_pipe", new BubblePipe(new Item.Settings().maxCount(1))); public static final Item FREN_SPAWN_EGG = registerItem("fren_spawn_egg", new SpawnEggItem(ModEntities.FREN, 894731, 0, new Item.Settings())); diff --git a/src/main/java/com/acethewildfire/acesbs/item/custom/BubblePipe.java b/src/main/java/com/acethewildfire/acesbs/item/custom/BubblePipe.java index 171b8a3..7c7e4d5 100644 --- a/src/main/java/com/acethewildfire/acesbs/item/custom/BubblePipe.java +++ b/src/main/java/com/acethewildfire/acesbs/item/custom/BubblePipe.java @@ -1,9 +1,13 @@ package com.acethewildfire.acesbs.item.custom; +import com.acethewildfire.acesbs.AcesBS; import com.acethewildfire.acesbs.component.ModDataComponentTypes; import com.acethewildfire.acesbs.effect.ModEffects; import com.acethewildfire.acesbs.item.ModItems; +import com.acethewildfire.acesbs.sounds.ModSounds; +import com.acethewildfire.acesbs.sounds.PlayerAttachedSound; import com.acethewildfire.acesbs.util.ModStats; +import net.minecraft.client.MinecraftClient; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.player.PlayerEntity; @@ -28,6 +32,9 @@ public class BubblePipe extends Item { super(settings); } + // Store the currently playing sound (client only) + private static PlayerAttachedSound activeSound; + @Override public TypedActionResult use(World world, PlayerEntity user, Hand hand) { if (!user.getItemCooldownManager().isCoolingDown(this)) { @@ -41,6 +48,12 @@ public class BubblePipe extends Item { @Override public void onStoppedUsing(ItemStack stack, World world, LivingEntity user, int remainingUseTicks) { super.onStoppedUsing(stack, world, user, remainingUseTicks); + + if (activeSound != null) { + MinecraftClient.getInstance().getSoundManager().stop(activeSound); + activeSound = null; + } + stack.set(ModDataComponentTypes.SMOKING, false); } @@ -56,7 +69,7 @@ public class BubblePipe extends Item { @Override public int getMaxUseTime(ItemStack stack, LivingEntity user) { - return 50; + return 72000; // basically infinite hold } @Override @@ -69,21 +82,18 @@ public class BubblePipe extends Item { Vec3d look = user.getRotationVec(1.0f); // Spawn position (near mouth) - double x = user.getX() + look.x * 0.3; + double x = user.getX() + look.x * 0.75; double y = user.getEyeY() - 0.15; - double z = user.getZ() + look.z * 0.3; - - // Base outward velocity - double speed = 0.08; + double z = user.getZ() + look.z * 0.75; // Add small randomness so it spreads naturally - double vx = look.x * speed + (world.random.nextDouble() - 0.5) * 0.02; - double vy = 0.02 + (world.random.nextDouble() * 0.02); // slight upward drift - double vz = look.z * speed + (world.random.nextDouble() - 0.5) * 0.02; + double vx = (world.random.nextDouble() - 0.5) * 0.01; + double vy = 0.1 + (world.random.nextDouble() * 0.02); + double vz = (world.random.nextDouble() - 0.5) * 0.01; if (remainingUseTicks % 4 == 0) { world.addParticle( - ParticleTypes.SMOKE, + ParticleTypes.BUBBLE_POP, x, y, z, vx, vy, vz ); @@ -98,14 +108,13 @@ public class BubblePipe extends Item { user.getX(), user.getY(), user.getZ(), - SoundEvents.ENTITY_GENERIC_EXTINGUISH_FIRE, + SoundEvents.BLOCK_BUBBLE_COLUMN_UPWARDS_AMBIENT, SoundCategory.PLAYERS, 1.0f, 1.0f ); } } - } @Override @@ -122,19 +131,8 @@ public class BubblePipe extends Item { if (!world.isClient) { player.incrementStat(ModStats.CIGARETTES_USED); - player.incrementStat(Stats.USED.getOrCreateStat(ModItems.CIGARETTE)); - if (player instanceof ServerPlayerEntity s_player){ - int uses = s_player.getStatHandler().getStat(Stats.CUSTOM.getOrCreateStat(ModStats.CIGARETTES_USED)); - - if (uses >= 500) { - grantAdvancement(s_player, "500_cigarettes"); - } - } } } - - - return stack; } } diff --git a/src/main/java/com/acethewildfire/acesbs/util/ModModelPredicates.java b/src/main/java/com/acethewildfire/acesbs/util/ModModelPredicates.java index 0bb047e..14b4bd7 100644 --- a/src/main/java/com/acethewildfire/acesbs/util/ModModelPredicates.java +++ b/src/main/java/com/acethewildfire/acesbs/util/ModModelPredicates.java @@ -25,6 +25,12 @@ public class ModModelPredicates { ModelPredicateProviderRegistry.register(ModItems.CIGARETTE_LEMON, Identifier.of(AcesBS.MOD_ID, "smoking"), (stack, world, entity, seed) -> Boolean.TRUE.equals(stack.get(ModDataComponentTypes.SMOKING)) ? 1f : 0f); + ModelPredicateProviderRegistry.register(ModItems.BUBBLE_PIPE, Identifier.of(AcesBS.MOD_ID, "smoking"), + (stack, world, entity, seed) -> Boolean.TRUE.equals(stack.get(ModDataComponentTypes.SMOKING)) ? 1f : 0f); + +// ModelPredicateProviderRegistry.register(ModItems.BUBBLE_PIPE, Identifier.of(AcesBS.MOD_ID, "pipe_variant"), +// (stack, world, entity, seed) -> stack.get(ModDataComponentTypes.PIPE_VARIANT)); + registerCustomBow(ModItems.KAUPEN_BOW); } diff --git a/src/main/resources/assets/acesbs/lang/en_us.json b/src/main/resources/assets/acesbs/lang/en_us.json index ea2a380..35b1565 100644 --- a/src/main/resources/assets/acesbs/lang/en_us.json +++ b/src/main/resources/assets/acesbs/lang/en_us.json @@ -71,6 +71,7 @@ "item.acesbs.cigarette": "Cigarette", "item.acesbs.cigarette_lemon": "Cigarette", "item.acesbs.cigarette_funny": "Hazy Cigarette", + "item.acesbs.bubble_pipe": "Bubble Pipe", "item.acesbs.fren_spawn_egg": "Fren Spawn Egg", "item.acesbs.vulgar_bones_spawn_egg": "Vulgar Bones Spawn Egg", diff --git a/src/main/resources/assets/acesbs/models/item/bubble_pipe.json b/src/main/resources/assets/acesbs/models/item/bubble_pipe.json new file mode 100644 index 0000000..6325c79 --- /dev/null +++ b/src/main/resources/assets/acesbs/models/item/bubble_pipe.json @@ -0,0 +1,50 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "acesbs:item/birch_pipe" + }, + "display": { + "thirdperson_righthand": { + "rotation": [-34.6, 74.81, 7.18], + "translation": [-1.5, 2.25, 0.5], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [-156.57, -78.01, -155.53], + "translation": [-1, 2, 1.75], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "rotation": [-180, 87, 144], + "translation": [0.5, -1.5, -11] + }, + "firstperson_lefthand": { + "rotation": [0, -81, 5], + "translation": [0, -2.5, -7.5] + }, + "ground": { + "rotation": [90, -105, 0], + "translation": [-1.5, -3, 1], + "scale": [0.5, 0.5, 0.51] + }, + "head": { + "rotation": [0, 69, 0], + "translation": [3.25, -5.25, -10.75], + "scale": [0.75, 0.75, 0.75] + } + }, + "overrides": [ + { + "predicate": { + "acesbs:smoking": 1 + }, + "model": "acesbs:item/smoking_bubble_pipe" + }, + { + "predicate": { + "acesbs:pipe_variant": 1 + }, + "model": "acesbs:item/birch_pipe" + } + ] +} diff --git a/src/main/resources/assets/acesbs/models/item/smoking_bubble_pipe.json b/src/main/resources/assets/acesbs/models/item/smoking_bubble_pipe.json new file mode 100644 index 0000000..048244c --- /dev/null +++ b/src/main/resources/assets/acesbs/models/item/smoking_bubble_pipe.json @@ -0,0 +1,38 @@ +{ + "format_version": "1.21.11", + "credit": "Made with Blockbench", + "parent": "minecraft:item/generated", + "textures": { + "layer0": "acesbs:item/birch_pipe" + }, + "display": { + "thirdperson_righthand": { + "rotation": [-5.35, 74.81, 7.18], + "translation": [-1.5, 2.25, 1.5], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [-156.57, -78.01, -155.53], + "translation": [-1, 2, 1.75], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "rotation": [-180, 87, 144], + "translation": [0.5, -7.75, -11] + }, + "firstperson_lefthand": { + "rotation": [0, -81, 5], + "translation": [0, -2.5, -7.5] + }, + "ground": { + "rotation": [90, -105, 0], + "translation": [-1.5, -3, 1], + "scale": [0.5, 0.5, 0.51] + }, + "head": { + "rotation": [0, 69, 0], + "translation": [3.25, -5.25, -10.75], + "scale": [0.75, 0.75, 0.75] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/acesbs/textures/item/birch_pipe.png b/src/main/resources/assets/acesbs/textures/item/birch_pipe.png new file mode 100644 index 0000000000000000000000000000000000000000..33453b3f5fbd1e8d27818bb0cb7c0f00d3f69f1f GIT binary patch literal 345 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jPK-BC>eK@{Ea{HEjtmSN z`?>!lvI6-E$sR$z3=CCj3=9n|3=F@3LJcn%7)lKo7+xhXFj&oCU=S~uvn$XBD8X6a z5n0T@z%2~Ij105pNB{-dOFVsD*#>Uom ztY-axgT`N-wXwH>Gh9Dia^e92{`vcoEehWWG7F#4{3^WNaGu5Y4#qTrUB!tH9$qd7 zNjHC(X8KC20vF<*#nI$btL@4z#moNdA;4AFOlC&#_u ZW;k~>JhW?%RUFXi44$rjF6*2UngA6gb;|$% literal 0 HcmV?d00001