repo for my hex addons :3
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

casting pouch sealing

+36 -9
+1
project/hexic/changelog
··· 8 8 1.4.7-pre.2 make greatspells actually greatspells 9 9 1.4.7-pre.2 meow 10 10 1.4.7-pre.2 remove internal error with out-of-bounds excisor's gambit 11 + 2.0.0 add casting pouch sealing 11 12 2.0.0 add Cessation and Resumption 12 13 2.0.0 add docs for plane-related patterns 13 14 2.0.0 add view iotas (experimental!)
+1 -1
project/hexic/src/main/resources/assets/hexcasting/patchouli_books/thehexbook/en_us/entries/addon/hexic/media_bundle.json
··· 5 5 "sortnum": 1, 6 6 "pages": [ 7 7 "Though a $(l:items/phials)$(item)Phial/$ is my ultimate goal for _media storage, knitting a pouch out of $(l:addon/hexic/mediaweave)$(item)mediaweave/$ may help me manage my amethyst better. Only a few cloths are needed to give me some decent capacity. Each pouch holds six slots, and I can extend their capacity to twelve with a bit more weave. A small pouch may go within a large pouch, but neither size can be placed within itself.", 8 - "Upon Nature's request for _media, my pouches will offer themselves and their contents first of all; similarly, if I attempt to $(l:patterns/spells/hexcasting#hexcasting:recharge)$(action)Recharge/$ a pouch, the inserted _media will form a 'cloud' of sorts inside, which will settle into any $(l:items/hexcasting)$(item)trinket/$ or similar within.", 8 + "Upon Nature's request for _media, my pouches will offer themselves and their contents first of all; similarly, if I attempt to $(l:patterns/spells/hexcasting#hexcasting:recharge)$(action)Recharge/$ a pouch, the inserted _media will form a 'cloud' of sorts inside, which will settle into any $(l:items/hexcasting)$(item)trinket/$ or similar within. To inhibit this behavior, casting pouches may be sealed by applying $(item)Honeycomb/$ the same way I'd insert an item. I can later wash off the seal by applying a wet sponge.", 9 9 { 10 10 "type": "patchouli:text", 11 11 "advancement": "hexcasting:enlightenment",
+34 -8
project/hexic/src/main/scala/org/eu/net/pool/hexic/main.scala
··· 526 526 .toSeq 527 527 private def heldItems_=(x: Seq[ItemStack]): Unit = 528 528 stack.getOrCreateNbt.put("Contents", NbtList().tap: l => 529 - for item <- x do 529 + for item <- x if !item.isEmpty do 530 530 val c = NbtCompound() 531 531 item.writeNbt(c) 532 532 l.add(c) 533 533 ) 534 + private def isWaxed = Option(stack.getNbt).exists(_.contains("ro")) 535 + private def isWaxed_=(value: Boolean) = 536 + if value then 537 + stack.getOrCreateNbt.put("ro", NbtCompound()) 538 + else 539 + stack.getOrCreateNbt.remove("ro") 534 540 private def withMediaHolders[T](f: Seq[CCMediaHolder] => T): T = 535 - val heldItems = stack.heldItems 536 - try 537 - f(heldItems.flatMap(p => Option(HexCardinalComponents.MEDIA_HOLDER.getNullable(p)))) 538 - finally 539 - stack.heldItems = heldItems 541 + if stack.isWaxed then 542 + f(Seq()) 543 + else 544 + val heldItems = stack.heldItems 545 + try 546 + f(heldItems.flatMap(p => Option(HexCardinalComponents.MEDIA_HOLDER.getNullable(p)))) 547 + finally 548 + stack.heldItems = heldItems 540 549 private def mediaHolders = stack.heldItems.flatMap(p => Option(HexCardinalComponents.MEDIA_HOLDER.getNullable(p))) 541 550 override def getMedia(stack: ItemStack): Long = stack.mediaHolders.map(_.getMedia).sum 542 551 override def getMaxMedia(stack: ItemStack): Long = stack.mediaHolders.map(_.getMaxMedia).sum ··· 577 586 cursorStackReference.set(p) 578 587 stack.heldItems = held.tail 579 588 player.playSound(SoundEvents.ITEM_BUNDLE_REMOVE_ONE, 0.8F, 0.8F + player.getWorld.getRandom.nextFloat * 0.4F) 589 + else if otherStack.isOf(Items.HONEYCOMB) && !stack.isWaxed then 590 + stack.isWaxed = true 591 + otherStack.decrement(1) 592 + player.playSound(SoundEvents.ITEM_HONEYCOMB_WAX_ON, 0.8F, 0.8F + player.getWorld.getRandom.nextFloat * 0.4F) 593 + else if otherStack.isOf(Items.WET_SPONGE) && stack.isWaxed then 594 + stack.isWaxed = false 595 + player.playSound(SoundEvents.BLOCK_SLIME_BLOCK_PLACE, 0.8F, 0.8F + player.getWorld.getRandom.nextFloat * 0.4F) 580 596 else if HexCardinalComponents.MEDIA_HOLDER.getNullable(otherStack) != null then 581 597 val held = stack.heldItems 582 598 if fits(held, otherStack.getItem) then ··· 635 651 override def appendTooltip(stack: ItemStack, world: World, tooltip: util.List[Text], context: TooltipContext): Unit = 636 652 tooltip.add(Text.translatable("hexic.media_bundle.items", stack.heldItems.size, size).styled(_.withColor(Formatting.GRAY))) 637 653 val (consumables, batteries, trinkets) = getMediaInfo(stack) 654 + val isWaxed = stack.isWaxed 655 + var mentionedSealing = false 656 + def convertForWaxing(text: MutableText) = 657 + if isWaxed then 658 + mentionedSealing = true 659 + Text.empty().append(text.styled(_.withStrikethrough(true))).append(" ").append(Text.translatable("hexcasting.tooltip.spellbook.sealed").formatted(Formatting.GOLD)) 660 + else 661 + text 638 662 batteries match 639 663 case Some((total, max)) => tooltip.add(showMedia("external", total + consumables.getOrElse(0L), max)) 640 664 case None => for value <- consumables do 641 - tooltip.add(showMedia("external", value)) 665 + tooltip.add(convertForWaxing(showMedia("external", value))) 642 666 for (total, max) <- trinkets do 643 - tooltip.add(showMedia("internal", total, max)) 667 + tooltip.add(convertForWaxing(showMedia("internal", total, max))) 668 + if !mentionedSealing then 669 + tooltip.add(Text.translatable("hexcasting.tooltip.spellbook.sealed").formatted(Formatting.GOLD)) 644 670 private def showMedia(tag: String, media: Long) = Text.translatable("hexic.media.infinite", Text.translatable(s"hexic.media.$tag"), Text.translatable("hexcasting.tooltip.media", dustAmount(media).styled(_.withColor(ItemMediaHolder.HEX_COLOR)))) 645 671 private def showMedia(tag: String, media: Long, maxMedia: Long) = Text.translatable("hexic.media.finite", Text.translatable(s"hexic.media.$tag"), dustAmount(media).styled(_.withColor(ItemMediaHolder.HEX_COLOR)), Text.translatable("hexcasting.tooltip.media", dustAmount(maxMedia)).styled(_.withColor(ItemMediaHolder.HEX_COLOR)), Text.literal(PERCENTAGE.format(100.0 * media / maxMedia)+"%").styled(_.withColor(MediaHelper.mediaBarColor(media, maxMedia)))) 646 672 private def dustAmount(media: Long) = Text.literal(DUST_AMOUNT.format(media / MediaConstants.DUST_UNIT.toDouble))