Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import de.dafuqs.spectrum.blocks.decay.*;
import de.dafuqs.spectrum.blocks.enchanter.*;
import de.dafuqs.spectrum.helpers.*;
import de.dafuqs.spectrum.items.magic_items.*;
import de.dafuqs.spectrum.networking.*;
import de.dafuqs.spectrum.particle.*;
import de.dafuqs.spectrum.recipe.fluid_converting.*;
Expand All @@ -16,6 +17,7 @@
import net.minecraft.item.*;
import net.minecraft.particle.*;
import net.minecraft.recipe.*;
import net.minecraft.registry.*;
import net.minecraft.server.world.*;
import net.minecraft.sound.*;
import net.minecraft.state.*;
Expand Down Expand Up @@ -165,6 +167,30 @@ private static void disenchantItemAndSpawnXP(World world, ItemEntity itemEntity)
itemEntity.setToDefaultPickupDelay();
}
}
else if(itemStack.isOf(SpectrumItems.ENCHANTMENT_CANVAS))
{
if(itemStack.getNbt()!= null && itemStack.getNbt().getString("BoundItem")!=null)
{
String targetItemString = itemStack.getNbt().getString("BoundItem");
Item boundItem = Registries.ITEM.get(Identifier.tryParse(targetItemString));
Map<Enchantment, Integer> canvasEnchantments = EnchantmentHelper.fromNbt(EnchantedBookItem.getEnchantmentNbt(itemStack));
if(!canvasEnchantments.isEmpty())
{
for(Map.Entry<Enchantment, Integer> entry : canvasEnchantments.entrySet())
{
int exp = EnchanterBlockEntity.getEnchantingPrice(boundItem.getDefaultStack(), entry.getKey(), entry.getValue());
exp /= EXPERIENCE_DISENCHANT_RETURN_DIV;
if (exp > 0) {
ExperienceOrbEntity experienceOrbEntity = new ExperienceOrbEntity(world, itemEntity.getX(), itemEntity.getY(), itemEntity.getZ(), exp);
world.spawnEntity(experienceOrbEntity);
}
}
}
world.playSound(null, itemEntity.getBlockPos(), SoundEvents.BLOCK_GRINDSTONE_USE, SoundCategory.NEUTRAL, 1.0F, 0.9F + world.getRandom().nextFloat() * 0.2F);
SpectrumS2CPacketSender.playParticleWithRandomOffsetAndVelocity((ServerWorld) world, itemEntity.getPos(), SpectrumParticleTypes.GRAY_SPARKLE_RISING, 10, Vec3d.ZERO, new Vec3d(0.2, 0.4, 0.2));
EnchantmentCanvasItem.unbind(itemStack);
}
}
}

public static class Flowing extends MidnightSolutionFluid {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,13 @@ public boolean hasGlint(ItemStack stack) {
return !EnchantedBookItem.getEnchantmentNbt(stack).isEmpty();
}

public static void unbind(ItemStack stack) {
NbtCompound nbt = stack.getOrCreateNbt();
nbt.remove("BoundItem");
nbt.remove("StoredEnchantments");
stack.setNbt(nbt);
}

private static void bindTo(ItemStack enchantmentExchangerStack, ItemStack targetStack) {
NbtCompound nbt = enchantmentExchangerStack.getOrCreateNbt();
nbt.putString("BoundItem", Registries.ITEM.getId(targetStack.getItem()).toString());
Expand Down
30 changes: 16 additions & 14 deletions src/main/resources/assets/spectrum/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -2558,6 +2558,8 @@
"book.spectrum.guidebook.enchanting_items.page3.title": "Required Experience",
"book.spectrum.guidebook.enchantment_canvas.page0.text": "My pickaxe, which was sinfully expensive to enchant? It's almost broken, and each broken block now is more damaging to my nerves than the tool itself.\\\n\\\nEven if I can't save the tool, at least I can save the enchantments! This canvas does not capture color: when used on a tool, the enchantments are swapped.",
"book.spectrum.guidebook.enchantment_canvas.page1.text": "Once used, an image of the item it was used on will manifest on the canvas, binding it to that type of item.",
"book.spectrum.guidebook.enchantment_canvas.page2.title": "Unbinding",
"book.spectrum.guidebook.enchantment_canvas.page2.text": "Midnight Solution is great at disenchanting things, which greatly improves this canvas's longevity! Letting a canvas take a soak in the stuff completely resets it, letting me apply it to anything else I want.\\\n\\\n*No matter how much I try to wash it, it never feels like enough.*",
"book.spectrum.guidebook.enchantment_characteristics": "Characteristics",
"book.spectrum.guidebook.ender_dropper.page0.text": "The Ender Dropper is the counterpart to the [Ender Hopper](entry://magical_blocks/ender_hopper). On a [#](449900)redstone pulse[#]() it ejects an item from my [#](bb00bb)Ender Inventory[#]().\\\n\\\nBeware: who's to stop someone from placing a button next to it and emptying it completely?\\\nThe counterpart to the [Ender Hopper](entry://magical_blocks/ender_hopper).",
"book.spectrum.guidebook.ender_glass.page0.text": "I felt from the moment I put the recipe on paper that this creation was going to be something special.\\\n\\\nThe combination of [#](449900)the End[#](), [#](449900)Redstone[#]() and [#](449900)Magic[#]() gives it very strange properties.",
Expand Down Expand Up @@ -2793,7 +2795,7 @@
"book.spectrum.guidebook.ideas.topaz.page0.text": "I never knew Geodes could be found at great heights, like on top of hills and sky-high mountains, but here we are.",
"book.spectrum.guidebook.ideas.where_to_find": "Where to find",
"book.spectrum.guidebook.ideas.where_to_look": "Where to look",

"book.spectrum.guidebook.hoverblock.page0.text": "Created from a collision of [Stratine](entry://general/stratine) and [Paltaeria](entry://general/paltaeria), this block just... floats around, vibing.",
"book.spectrum.guidebook.hoverblock.page1.text": "...well, most other placed blocks seem to be able to float in the air without support just fine for whatever reason, too, but this one is special: [#](449900)it retains any momentum I give it[#](), like when using a [#](bb00bb)Piston[#](), even if I stand on it.\\\n\\\nSneak+Use to pick it up again.",
"book.spectrum.guidebook.howling_spires.ashen_blackslag.text": "While it seemed like snow at first, I can see now that this place is blanketed in white ash. The wind roars, bringing with it a rain of ash not unlike a gentle, everlasting snowfall.\\\n\\\nI wonder where it comes from.",
Expand Down Expand Up @@ -3098,7 +3100,7 @@
"book.spectrum.guidebook.milky_resin.page0.text": "This caramel-colored sap has a sweet aroma and a surprisingly luxurious taste! I can use it in the same way as milk, it just needs a little bit of fermenting first.\\\n\\\n*The resin itself is tasty as well, but too sticky to drink on its own.*",
"book.spectrum.guidebook.milky_resin.page1.text": "*~ A pinch of sugar and a little love, and tada - [Clotted Cream](entry://cuisine/titration_barrel#4)! ~*",
"book.spectrum.guidebook.milky_resin.page1.title": "Plant-based Milk",
"book.spectrum.guidebook.mob_heads.page0.text": "I was able to get a Mob Head, and not one of the few I knew before, but another one I had never seen before.\\\n\\\nWhile they make for a nice display on my wall, they also still inherit a small spark of the creature's existence.",
"book.spectrum.guidebook.mob_heads.page0.text": "I was able to get a Mob Head, and not one of the few I knew before, but another one I had never seen before.\\\n\\\nWhile they make for a nice display on my wall, they also still inherit a small spark of the creature's existence.",
"book.spectrum.guidebook.mod_integration.ae2.name": "Applied Energistics",
"book.spectrum.guidebook.mod_integration.ae2.page0.text": "\"Any technology advanced enough is indistinguishable from magic\", I once heard.\\\n\\\nI'm still not entirely sure how this system manages to store so many blocks in such a small space, but since I regularly walk around with hundreds of square metres of dirt, I've never bothered to question it.",
"book.spectrum.guidebook.mod_integration.ae2.page1.text": "Looks like the [#](bb00bb)Crystal Growth Accelerator[#]() can speed up the growth of all kinds of Gemstone Buds!",
Expand Down Expand Up @@ -3361,7 +3363,7 @@
"book.spectrum.guidebook.monstrosity.name": "Horrors Below?",
"book.spectrum.guidebook.monstrosity.page0.text": "There is *something* lurking in the dark for me, I am sure. Am I going mad? Is it just my nerves?",
"book.spectrum.guidebook.moonstone_cores.name": "Moonstone Cores",
"book.spectrum.guidebook.moonstone_cores.page0.text": "This powerhouse of an item is capable of channeling huge amounts of [Ink](entry://ink/ink) with ease. Can be used to enhance the capabilities of equipment and devices.\\\n\\\n*A relic of times long past*.",
"book.spectrum.guidebook.moonstone_cores.page0.text": "This powerhouse of an item is capable of channeling huge amounts of [Ink](entry://ink/ink) with ease. Can be used to enhance the capabilities of equipment and devices.\\\n\\\n*A relic of times long past*.",
"book.spectrum.guidebook.aether_vestiges.page0.text": "Words leave me every time I look at this. I wish I could write more but...\\\n\\\nEvery time I look at this I loose track of time and space; my head pounds as if my brain were a trapped rat, trying to escape from certain doom. An overwhelming sense of dread creeps up from my heart and up my throat, it strangles and chokes me until I tear up.",
"book.spectrum.guidebook.aether_vestiges.page1.title": "Remnants",
"book.spectrum.guidebook.aether_vestiges.page1.text": "*These are but the barest dregs of something greater, something beyond time and thought.\\\n\\\nIt is beyond mortal mind and yet I cannot help but dream of what it could be.*",
Expand Down Expand Up @@ -3808,19 +3810,19 @@
"book.spectrum.guidebook.soothing_bouquet.page1.text": "As was is as will be - nuzzle that bodacious blossom and take a deep breath.\\\n\\\n*This not an overpriced sleeping bag - it is a SUPERIOR overpriced sleeping bag!*",
"book.spectrum.guidebook.soporific": "Soporific (Resistances)",
"book.spectrum.guidebook.spawner_creature_change.name": "Changing Spawner Creatures",
"book.spectrum.guidebook.spawner_creature_change.page0.text": "I found out how to assign a new type of creature to mob spawners, making it spew out other creatures altogether!\\\nA somewhat terrifying ability, I must admit.\\\n\\\nWill I become the person to create life for the sake of the gift of life, or only to tear it away again immediately?",
"book.spectrum.guidebook.spawner_creature_change.page0.text": "I found out how to assign a new type of creature to mob spawners, making it spew out other creatures altogether!\\\nA somewhat terrifying ability, I must admit.\\\n\\\nWill I become the person to create life for the sake of the gift of life, or only to tear it away again immediately?",
"book.spectrum.guidebook.spawner_creature_change.page1.text": "What sort of person am I? In this case, my morals must serve as a guide.",
"book.spectrum.guidebook.spawner_creature_change.page1.title": "Associating a Creature",
"book.spectrum.guidebook.spawner_manipulation.name": "Spawner Manipulation",
"book.spectrum.guidebook.spawner_manipulation.intro.text": "My new [Resonance](entry://enchanting/enchantments/resonance) enchantment finally allowed me to get Spawners to drop. Look what I got here!\\\nWhile I haven't yet figured out how to make these constructs myself, I'm starting to feel comfortable altering their properties in my favor, thanks to the [Spirit Instiller](entry://creating_life/spirit_instiller).\\\n*This gon be gud.*",
"book.spectrum.guidebook.spawner_manipulation.spawn_count_change.text": "Increases the number of creatures summoned with each spawn cycle.",
"book.spectrum.guidebook.spawner_manipulation.spawn_count_change.title": "Spawn Amount",
"book.spectrum.guidebook.spawner_manipulation.spawn_delay_change.text": "Lowers both min and max spawn delay.",
"book.spectrum.guidebook.spawner_manipulation.spawn_delay_change.title": "Spawn Delay",
"book.spectrum.guidebook.spawner_manipulation.max_nearby_entities_change.text": "Spawners seem to naturally stop spawning creatures when there are a lot of them around. Almost as if they want to give me a chance. *Pathetic, isn't it? As if I needed that.*\\\nThis modification increases the number of creatures that are allowed to be near the Spawner.",
"book.spectrum.guidebook.spawner_manipulation.max_nearby_entities_change.title": "Summoning Criteria",
"book.spectrum.guidebook.spawner_manipulation.required_player_range_change.text": "Increases the distance I can be away from a spawner and it still works.",
"book.spectrum.guidebook.spawner_manipulation.required_player_range_change.title": "Activation Range",
"book.spectrum.guidebook.spawner_manipulation.name": "Spawner Manipulation",
"book.spectrum.guidebook.spawner_manipulation.intro.text": "My new [Resonance](entry://enchanting/enchantments/resonance) enchantment finally allowed me to get Spawners to drop. Look what I got here!\\\nWhile I haven't yet figured out how to make these constructs myself, I'm starting to feel comfortable altering their properties in my favor, thanks to the [Spirit Instiller](entry://creating_life/spirit_instiller).\\\n*This gon be gud.*",
"book.spectrum.guidebook.spawner_manipulation.spawn_count_change.text": "Increases the number of creatures summoned with each spawn cycle.",
"book.spectrum.guidebook.spawner_manipulation.spawn_count_change.title": "Spawn Amount",
"book.spectrum.guidebook.spawner_manipulation.spawn_delay_change.text": "Lowers both min and max spawn delay.",
"book.spectrum.guidebook.spawner_manipulation.spawn_delay_change.title": "Spawn Delay",
"book.spectrum.guidebook.spawner_manipulation.max_nearby_entities_change.text": "Spawners seem to naturally stop spawning creatures when there are a lot of them around. Almost as if they want to give me a chance. *Pathetic, isn't it? As if I needed that.*\\\nThis modification increases the number of creatures that are allowed to be near the Spawner.",
"book.spectrum.guidebook.spawner_manipulation.max_nearby_entities_change.title": "Summoning Criteria",
"book.spectrum.guidebook.spawner_manipulation.required_player_range_change.text": "Increases the distance I can be away from a spawner and it still works.",
"book.spectrum.guidebook.spawner_manipulation.required_player_range_change.title": "Activation Range",
"book.spectrum.guidebook.spirit_instiller.page0.text": "With all the knowledge I gathered, I created the **Spirit Instiller**. I specifically designed it to combine the energies of two items, with the help of a third object to bind them.\\\nLike the others, the Spirit Instiller needs a focus structure to work. To rotate the structure hologram in the direction I want it to go, I am able click on the Spirit Instiller when it is placed.",
"book.spectrum.guidebook.spirit_instiller.page1.text": "An almost spiritual process, hence the name.",
"book.spectrum.guidebook.spirit_instiller.page2.text": "Dimensions: 8x9x5 blocks\\\nIt can be enhanced by placing [Upgrades](entry://magical_blocks/upgrades) on the two [#](bb00bb)Onyx Chiseled Blocks[#]().",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,23 @@
"text": "book.spectrum.guidebook.enchantment_canvas.page0.text",
"title": "item.spectrum.enchantment_canvas"
},
{
"type": "spectrum:pedestal_crafting",
"text": "book.spectrum.guidebook.enchantment_canvas.page1.text",
"title": "container.spectrum.rei.pedestal_recipe",
"recipe_id": "spectrum:pedestal/tier2/enchantment_canvas"
}
{
"type": "spectrum:pedestal_crafting",
"text": "book.spectrum.guidebook.enchantment_canvas.page1.text",
"title": "container.spectrum.rei.pedestal_recipe",
"recipe_id": "spectrum:pedestal/tier2/enchantment_canvas"
},
{
"type": "modonomicon:spotlight",
"title": "book.spectrum.guidebook.enchantment_canvas.page2.title",
"item": {
"item": "spectrum:midnight_solution_bucket"
},
"text": "book.spectrum.guidebook.enchantment_canvas.page2.text",
"condition": {
"type": "modonomicon:advancement",
"advancement_id": "spectrum:midgame/create_midnight_aberration"
}
}
]
}
Loading