[Request] Add support to blacklist somes armor pieces or Baubles in certain dimension
Fireztonez opened this issue ยท 11 comments
Hello,
I whant to blacklist Jetpacks, Angel Ring, Squid Ring and Chicken Ring in the Twilight Forest, but currently, unless the player right-click on the jetpack, question to equipe directly, the jetpack will continue working.
So this is really really easy to cheat, if the player doesn't have into is chestplate slot, it only have to go in the inventory, and place in the chestplate slot and it will work without any problem...
Minecraft: 1.12.2
ItemBlacklist: 1.4.0
Forge: 14.23.5.2806
Thank's
Fireztonez
No, I totally understand for the packing function, what I say, me personnaly I have turn off into my server, for avoid the possibility of using the jetpack like I can into the Twilight Forest, but yes, if you turn off it can caused issue for somes people...
Not sure why it does not trigger, if you look for
If you can take a look and see if you can find a solution, it would be nice!
Hmm, it should be banning the items on dim change as it did in the past.
I am unsure if I can fix it though...
Ok, I just test and yes, the jetpack have been lock when I change dimension, so this is is nice, but for sure I have to remove the possibility to turn off the unpackage functionnality, because unless the player can unpack and use into the twilight forest...
So, like that, unless the player craft the item into the twilight forest or put the jetpack into an inventory and take back when in the twilight forest...
I have somes ideas how you can possibly fix that, so, you can look if there have one way how risk less to caused other issue...
I think for the Bauble slot it can be more difficult, because this is not Forge directly, but for armor you can;
- Look when player equip an armor piece
- Look when player pickup thing from an inventory or craft
I think this is the 2 best way for fix that issue.
Thank's for you really fast reply!
I can't remove the packing function as it is required for crafting related parts.
Picking up, using, dim change and other things should trigger it. I'm not sure how it's getting passed.
I just test in a server, with a Not OP player, and look like when you use the right-click, to question to equip directly the JetPack into the Twilight Forest, it equip the real and functional JetPack, and create a Fake visual locked item in is hand...
Fist we think this is a Dupe Bug, but finally the item have disapear completly, so you cannot really Unlocked to dupe it, but blacklist don't work at all if items is bring in simple Backpack, for any armor parts...
I will try soon if this bug work with a clean Forge Server with only Item Blacklist on it...
Sorry I haven't gotten to this yet, Looking into it a bit deeper now.
Players moving things around in inventories will be difficult to stop, There was a check for things like that but it was removed as it apparently didn't work. I can look into trying to add it again but I am unsure of the reason why it was disabled.
As for the jetpack getting equipped and locked that must be a bug with the jetpack as they shouldn't be equipped as the event should be getting cancelled. Vanilla armor follows this rule correctly.
EDIT: Unless the armor issue is related to the server but I doubt that. You can check that if you want. Ban any vanilla armor and try to put it on. If it does the same thing we know what the problem is.
I just saw the message I have try to send about my tests have juust never been send. Sorry for the delay...
I have try everithing again, and when change dimension with the armor pieces in my backpack or any storage and I try to equipe using the right-click, it place the armor balcklisted armor pieces in the armor slot and after it will blacklist, but the armor still work, until the player remove it manually and try to replace again into teh slot... I got a false Blacklist item in my hand but, this is just inventory visual glitch... So Basically, unless the player have equip or have the jetypack in is inventory during the dimension change, Item Balcklist doesn't work at all for armor pieces on server (But work great in single player, unless player try to place armor manually into the armor slot...).
I'm pretty sure, I'm pretty sure Forge have an event for Armor Equipment change or a simple way to look what armor is in place, so if you can catch that event and use it to blacklist completly the item and remove it from the armor slot, everithing should be good I think.
I don't know if it can help you, but I have find this in the MinecraftForge Forum about armor pieces events: https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/modification-development/1434786-forge-flying-with-custom-armor
If is better, you can possibly add a different array for armor pieces blacklist, to avoid somes verifications.
I really really want to find a good way to blacklist armor pieces from dimension, so if you think you can't do that, just let me know, I will understand and I will try to find another mod-dev for that.
Thank's Claycrop
Fireztonez
Its fine, We will get it figured out eventually.
I looked at all of it and I don't have many options, I'm afraid some might cause issues but it's not all my fault technically.
How all this works is when the armor is "used" a copy is placed into the slot but as the event is getting canceled the stack size of that item is zero. You shouldn't have the ability to use or interact with stack size zero items (you can move them in your inventory but that's it.), They should simply disappear when anything is done with them otherwise. Except in the case of armor...
If the stack size is zero the item isn't removed at all like under normal circumstances when it is acted on, BUT this armor (in the case of vanilla) is functionally non-existent. You don't receive any armor bonus or the effects of the enchants. What this tells me is those mods that add these extra abilities don't check for stack size, they only look if the item(s) exists in the correct slot(s).
I can add a bit of code to the event that will try to clear the armor inventory of any empty stacks to fix this.
Alright talked to someone whole knows more than I, It was a stupid bug and my fault 100%
What how it worked was the item was on the client still but the server says it isn't and this was never synced. Apparently many mods do a bunch of things on the client for flight and other special abilities.
1.4.1 will fix this issue. It's on CF waiting to be approved.
Ok, thank's for that fixed and to take time to explain a little bit, I really enjoyed the modpacks development, but I really want to learn the Java and start making a mod ones day... If direworlf20 can, I can!!
I really appreciate the fact you take time to reply to issue, not all dev do that... Somes dev just close issue and didn't say anything...
So, continue your great job!
Fireztonez