gigaherz / PackingTape

A Minecraft Forge Mod
http://minecraft.curseforge.com/projects/packing-tape
Other
11 stars 3 forks source link

Cannot Whitelist #25

Closed 4ilur0phile closed 3 weeks ago

4ilur0phile commented 3 years ago

I have typed a bunch of different ways to whitelist mob spawners in the config file, and for the life of me I cannot get it to work. I can't remember all the ways I typed it in because my memory sucks, I just know that my attempts to whitelist them resulted in java freezing on the loading world screen every single time. I had to empty everything in the brackets just so I could play again.

gigaherz commented 3 years ago

This works fine for me in development:

[general]
    tape_roll_uses = 8
    blacklist = []
    whitelist = ["minecraft:mob_spawner"]
    consume_paper = true
lulabyte commented 3 years ago

I have a similar issue. I am using 1.16.3 and when I put whitelist = ["minecraft:mob_spawner"] in the server config, I can no longer join the server :(

lulabyte commented 3 years ago

My server config file looks like this (and the server won't start):

[general]

How many times the tape roll can be used before it breaks

#Range: 0 ~ 2147483646
tape_roll_uses = 8
#TileEntities to disallow (whitelist takes precedence)
#DEPRECATED: Use the tileentity tag 'packingtape:te_blacklist' instead. This config be removed in the future.
#NOTE: This list now uses 'Block Entity Type' IDs. Eg. the shulker boxes are 'minecraft:shulker_box'.
blacklist = []
#TileEntities to allow regardless of the blacklist and vanilla restrictions.
#DEPRECATED: Use the tileentity tag 'packingtape:te_whitelist' instead. This config be removed in the future.
#WARNING: This whitelist bypasses the 'only ops can copy' limitation of Minecraft, which can result in security issues, don't whitelist things unless you know what the side-effects will be.
#NOTE: This list now uses 'Block Entity Type' IDs. Eg. the spawner is 'minecraft:mob_spawner'.
whitelist = ["minecraft:mob_spawner"]
#Whether the tape roll consumes paper when used
consume_paper = true
Charmanth commented 3 years ago

So, I have the version with the whitelist in configs deprecated. I can't find/figure out how to add the needed line to the tag list of the tileentities. I'm assuming that's @lulabyte 's issue as well.

It would help if there were a tutorial on how to do this.

fampat commented 2 years ago

So, I have the version with the whitelist in configs deprecated. I can't find/figure out how to add the needed line to the tag list of the tileentities. I'm assuming that's @lulabyte 's issue as well.

It would help if there were a tutorial on how to do this.

Since this stuff is mostly undocumented i hope this will help. Iam on 1.18.1 - Forge 39.0.5

Create a Datapack, like described here: https://minecraft.fandom.com/wiki/Data_pack This results in having a folder with an file named pack.mcmeta and a sub-folder named data.

When you have a working data-pack follow this these steps. In this example iam adding the spawner to the whitelist, you may add whaterver you wish.

  1. Create this file: YOUR_WORLD_SAVE_FOLDER/datapacks/YOUR_DATAPACK_FOLDER/data/packingtape/tags/block_entity_types/te_whitelist.json
  2. Put this in: { "values": [ { "id": "#forge:movable", "required": false }, { "id": "#forge:relocation_supported", "required": false }, { "id": "minecraft:mob_spawner", "required": false } ] }

Save the json and /reload or restart the world, done.

Water-Cat1 commented 2 years ago

I have tried following the above suggestion as well as other attempts to add the spawner to the whitelist but I cannot see it actually getting added to the tag, and cannot package a spawner. However durability from the packing tape does go down on attempts.

gigaherz commented 3 weeks ago

Sorry for not saying anything in years. Since the original issue was about config-based whitelist, and this is not supported anymore, I am closing this issue. The alternatives in newer versions are a pair of block tags, and a pair of blockentity tags that can be used from datapack. Note that as of 1.21, the folders for tags are singular (block_entity_type, not types). To blacklist/whitelist a block: data/packingtape/tags/block/te_blacklist.json / data/packingtape/tags/block/te_whitelist.json To blacklist/whitelist a blockentity: data/packingtape/tags/block_entity_type/te_blacklist.json / data/packingtape/tags/block_entity_type/te_whitelist.json