DoubleDoorDevelopment / ItemBlacklist

Now is not the time to use that. (Dimension based item filter)
MIT License
7 stars 5 forks source link

Crashes server when item is disabled in configs. #38

Closed CommanderLouiz closed 4 years ago

CommanderLouiz commented 4 years ago

Having an item in the blacklist which, after being added, is disabled through a mods config file, crashes the server.

This issue arose on the Lapitos Galacticraft Modpack, on our PvE server. We previously had some creative and chunkloading items banned, and I decided to be double sure about it and just straight disable them through configs. However, this crashes the server.

Ex. The Extra Utilities 2 chunkloader.

I searched the old issues and found this one, which is when an entire mod is removed (But is really the same cause/effect.) https://github.com/DoubleDoorDevelopment/ItemBlacklist/issues/29

I know you tagged it "won't fix" because it's intended to prevent typos, however, why not just ignore the item if it's null and move on, as opposed to killing the entire server. Typo or removed, it kills the game, so why not just ignore it, throw the error, and continue on?

Code Segment public BanListEntry(ResourceLocation uid, int damage) { this.item = Item.REGISTRY.getObject(uid); if (this.item == ItemBlacklisted.I) throw new IllegalArgumentException("You can't ban the banning item."); this.damage = damage; if (item == null) throw new IllegalArgumentException(uid.toString() + " isn't a valid item."); }

Crash Log: crash-2020-06-07_19.47.48-server.txt

Claycorp commented 4 years ago

You shouldn't have used Item Blacklist to block items you don't want people to have if they have configs to disable them. Also if you can remove recipes that's even better yet. Item Blacklist is intended for disabling problematic items/blocks while a mod is broken to prevent people from using it and breaking things (Like right clicking X on Y = Crash). Otherwise it's a last solution option for items you don't want people to have at all. (Yes I'd rather people use the better options available for the issue they are trying to solve and not use this mod at all.)

If malformed items are ignored and someone messes with the file or is making them by hand any items they thought were banned are now not banned because they made a mistake. Thus allowing damage to be done to there server/pack/whatever. It's a two second fix for you to do that prevents mistakes from causing far more damage than a server crash at boot.

As said in the last issue, this isn't changing now and will never change in the future as it's an intended safety feature.