EccentricVamp / EccentricTome

Minecraft mod for holding books
https://modrinth.com/mod/eccentric-tome
GNU Lesser General Public License v3.0
5 stars 8 forks source link

Tome allows insertion of placeable blocks, which when placed, effectively destroy the tome and all the contents. #21

Closed SodiumShine closed 2 years ago

SodiumShine commented 2 years ago

Versions

Describe the bug

Using a default config, eccentric tome allows insertion of placeable block with matching keywords, like bookshelf or bookpile. When you turn the tome into this block, and place it, this effectively destroys the tome and all the contents as it just becomes that block.

To Reproduce Install a mod that adds modded bookshelves or placeable books. Put one in the tome. Switch tome into that block and place it.

Expected behavior To not be able to put blocks into the tome at all. It should only accept items that can be used in the hand.

Additional context If this issue is something that cannot/will not be resolved, instead I will supply a list of mods/blocks that I found to create this problem.

    #Blacklisted mods
    exclude = ["simplearchivist","everycomp","fantasyfurniture","quark","manyideas_doors"]
    #Blacklisted items
    exclude_items = ["littlelogistics:guide_rail_corner","littlelogistics:guide_rail_tug","hexcasting:akashic_bookshelf"]

Simple Archivist adds many blocks with the word "book" in the name. Every Compat adds bookshelf blocks Fantisy furniture has bookpiles, a decoration. Quark adds some bookshelves Many Ideas Doors adds doors disguised as bookshelves.

EccentricVamp commented 2 years ago

Huh. Never thought of trying to put blocks in. Good catch.

I'll have to see if Forge or Minecraft have an easy way of distinguishing blocks from usable items. If they don't, we'll go the blacklist route.

EccentricVamp commented 2 years ago

Turn out to be a really simple fix https://github.com/EccentricVamp/EccentricTome/commit/8ab39ccdb3ea5cad59813802b829a5c75286da70

The fix has been published in Eccentric Tome 1.7.0-beta.2

Let me know if it solves your issue

SodiumShine commented 2 years ago

It works for most stuff but there's a rather mod specific case that I realised while testing the fix Supplementaries mod allows you to place minecraft:book and minecraft:enchanted_book as decoration, so you can have a pile of enchanted books in your wizard hut or whatever.

Unfortunately the Eccentric Tome allows you to put in enchanted books in that aren't vanilla, like enchantments added by Create, Farmer's Delight, Supplementaries itself etc. Obviously this wouldn't normally be a problem but...

I couldn't find anything else wrong though.

Wait I'm daft. Yes you can put in enchanted books from other mods but it doesn't break the tome so it works fine. Can probably close this! Thanks for your hard work!