tModLoader Nihilism - Empties the game

hamstar

Terrarian

v4.0.0


Note: Requires Mod Libs


Removes item recipes, mob spawns, item drops from mobs, and items. Configurable. Meant mainly for use by custom maps or mods. Players can enable or disable the mod on a per world basis via. chat commands (type /help for options).



Usage

To activate for a given world, type `/nih-on` in the chat.

To clear the current blacklists and whitelists (e.g. the default samples), type `/nih-clear`.

Use the mod's config editor (settings) to adjust defaults for blacklists and whitelists. Any defaults changes can be applied to the current world with the `nih-defaults-reset` command.

Type `/help` and scroll with the arrow keys to see the full list of commands (also seen here in the source code).



Modders

To use this with your mod, simply call the API functions like so (e.g. to permit only the use of a Gold Pickaxe):
Code:
class MyCustomModPlayer : ModPlayer {
  ...

  public override void OnEnterWorld( Player player ) {
    if( player.whoAmI == Main.myPlayer && this.player.whoAmI == player.whoAmI ) {
      Mod nihMod = ModLoader.GetMod("Nihilism");
      if( nihMod != null ) {
        bool localOnly = true;
        nihMod.Call( "SetItemWhitelistEntry", new ItemDefinition(ItemID.GoldPickaxe), localOnly );
      }
    }
  }

  ...
}


Todo:
  • Filter (black/whitelist) shop items.
  • Filter projectile types.
  • Filter weather/moon events.
  • Filter invasion events.


Source available here. API now available.

Available config fields are defined here.

Nihilism.png

 
Last edited:
v4.0.0
  • (See github commits history.)
v3.1.3
  • Set config fields to be properties
  • Removed config default presets
v3.1.2.2
  • Attempted fix for BaseMod compatibility issue
  • Assorted internal tweaks
v3.1.2
  • Re-implemented per-world filters saving and loading
  • Re-implemented per-world filters saving and loading (WTF!)
  • Removed ModConfig behavior from NihilismFilters class (formerly NihilismFiltersConfig)
  • Added groups to NihilismFiltersAccess.GetFormattedFilterData(string) output
  • Updated to ModConfigStack
  • Restructured 'block equips' player code
  • Fixed PreOpenVanillaBag, which broke for some reason
  • Added API setters for blacklist2 inputs
  • Internal refactoring (renaming)
v3.1.0
  • Tweaked some API functions to allow local-only effects
  • Added OnSyncOrWorldLoad API(Action, float) binding for a 'proper' way to configure configs for worlds on load
  • Added group list clear API bindings
  • Fixed API binding ClearFiltersForCurrentWorld not clearing groups
  • Improved debug filter data output
v3.0.2
  • Updated to TML11.5
v3.0.1
  • Added labels and headers to config field
  • Expanded config description header to mention chat commands
v3.0.0
  • Updated to MH5 and TML11
  • Switched to ItemDefinition and NPCDefinition rather than "qualified names" (note: breaks compatibility)
  • Refactored filters (per world) config to use instance switching when InstancedFilters (previous SuppressAutoSaving) on
  • Removed many chat commands for filter list editing; all done with ModConfig now
  • Added item, recipe, NPC, NPC loot groups lists as separate config setting fields
  • Added filter caches for mapping keys and index positions
  • Re-implemented filter setters (and API)
  • Added FiltersAccess setters and API bindings for groups
  • Renamed groups FiltersAccess and API methods slightly
v2.2.1
  • Added NihilismFilterAccess getters for groups-per-item/recipe/npc
  • Added API getters for the above
  • Renamed base code files for convention
  • Added DebugModePerItemInfo config setting (shows filter groups per item in tooltips)
  • Added Blacklist2 Clear API bindings
v2.2.0
  • Added DefaultFiltersClearCommand (/nih-clear)
  • Added ItemBlacklist2EntrySetCommand, LootBlacklist2EntrySetCommand, NpcBlacklist2EntrySetCommand, RecipeBlacklist2SetCommand
  • Altered command bindings to use set instead of add, where applicable
  • Added data fields for whitelist exception stuff (blacklist2)
  • Added NihilismAPI.ClearFiltersForCurrentWorld()
  • Added whitelist exceptions (blacklist2) to NihilismFilterAccess's Is<>Enabled methods
  • Finished implementing whitelist exceptions (blacklist2)
  • Restructured FilterAccess code files into further subdivisions
v2.1.7.5
  • Added error prevention measures against bad references to local player
v2.1.7.3
  • Fixed issue with bags incorrectly refunding stack when blocked from opening
  • Added dependency major version checks
  • Updated to MH v4.2.3
v2.1.7.2
  • Fixed issue with Mod.Call being overly picky with bindings
  • Updated to MH v4.2.2
  • Corrected info for on/off commands
v2.1.7.1
  • Fixed issue with Mod.Call being overly picky with bindings
v2.1.7
  • Updated to MH v4.2.1 (and its standards)
  • Changed snake case to camel case
v2.1.6.1
  • Updated for MHv4
v2.1.5
  • Added Unset API functions for white and blacklists
  • Added API Mod.Call bindings for unset
v2.1.4
  • Updated to Mod Helpers v2.0.2
  • Updated commands to use dashes in names for readability
v2.1.3
  • Added proper item and ammo consumption white and blacklisting
v2.1.2.5
  • (Hopefully) fixed Wing Mod support
v2.1.2.4
  • Attempted better detection of Wing Slot mod for compatibility
  • Attempted fix of secondary function of items
v2.1.2.2
  • Fixed forcing of default settings with previous version
v2.1.2.1
  • Corrected default blacklist
  • Fixed possible error with item use detection
  • Fixed Reset Configs to Defaults control panel button
  • Added bag opening blacklisting
v2.1.2
  • Updated to Mod Helpers v1.6.3
  • Fixed console commands
  • Fixed possible mod compatibility crash issues
v2.1.0
  • Fixed blacklists not being set
v2.1.0
  • Added blacklists back; now identical to whitelists
  • Added API commands to clear lists
  • Altered chat commands accordingly
  • Added Wing Slot mod support natively
  • Updated to new Hamstar's Helpers code layout
v2.0.0
  • Removed blacklists; bool on/off only, now
  • Finished implementing entity groups for whitelists
  • Updated config defaults
  • Refactored whitelist data structures into sets
  • Fixed npc loot drops and odd whitelist checking behavior
  • Added whitelist clearing API functions
  • Set whitelisting to apply to bag opening
  • Set whitelisting to apply to equipping misc items
  • Internal restructuring/refactoring
v1.5.9
  • Set to use new world data file convention (gives alert for old mod version owners)
  • Removed underscores from chat commands and simplified descriptions
v1.5.8
  • Set ammo types to be subjected to filters
v1.5.7
  • Reduced tint of item X
  • Fixed on load crash with certain mods
  • Added preventative measure/fix for mod dependency load order issue
  • Added custom load event internally
  • Now requiring HH v1.4.17
v1.5.6.2
  • Fixed an issue with npcs not dying to DoT damage
v1.5.6.1
  • Fixed item whitelist commands to accept the full parameter string correctly
  • Fixed grappling item detection
v1.5.6
  • Minor internal player data fix
  • Extensive internal refactoring
v1.5.5.1
  • Fixed a minor Mod.Call param error checking issue
  • Set item X overlays to be somewhat transparent
v1.5.5
  • Set items to use non-overrideable names for filtering purposes (allows dynamically-named items)
  • Fixed non-syncing API calls
v1.5.4
  • Added 'SuppressAutoSavingOn' and Off to API
  • Added 'nih_showfilters' command
  • Set API to require parameter for each command to indicate if sync occurs or not
  • Assorted internal refactoring
v1.5.3
  • Fixed recipe lag (hopefully)
v1.5.2
  • Added configs to disable specific filter options
v1.5.1
  • Added API functions NihilateCurrentWorld and UnnihilateCurrentWorld
  • Fixed possible issues with default configs
v1.5.0
  • Added 'nih_defaults_set' command (SetFiltersAsDefaultsCommand)
  • Added 'nih_defaults_reset' command (ResetFiltersFromDefaultsCommand)
  • Added default black and whitelist settings back into the main config file (these do NOT update settings for nihilated existing worlds)
v1.4.0.1
  • Implemented API
  • Implemented commands
  • Fixed syncing
  • Added inbox alert of commands to replace UI
v1.3.3
  • Fixed multiplayer item duplication glitch
  • Fixed configs not setting up with default values properly
v1.3.2.1
  • (Hopefully) fixed multiplayer loading hang issue
v1.3.2
  • Fixed UI positioning
  • UI code refactoring
v1.3.1
  • Fixed issue with default settings being forced to apply (major issue)
v1.3.0.1
  • Added mod icon
  • Added support for Hamstar Helpers v1.2.0 issue report
  • Refactored net protocol
v1.2.0
  • Added blacklist regex patterns.
v1.1.0.1
  • Added a UI popup to enable or disable Nihilism for the current world.
 

Attachments

  • Nihilism v1.1.0.1.zip
    43.5 KB · Views: 286
  • Nihilism v1.2.0.zip
    46.2 KB · Views: 270
  • Nihilism v1.4.0.1.zip
    47.8 KB · Views: 248
  • Nihilism v1.5.0.zip
    57.7 KB · Views: 237
  • Nihilism v1.5.1.zip
    58.4 KB · Views: 250
  • Nihilism v1.5.2.zip
    58.9 KB · Views: 243
  • Nihilism v1.5.3.zip
    58.6 KB · Views: 253
  • Nihilism v1.5.4.zip
    62.2 KB · Views: 255
  • Nihilism v1.5.5.zip
    62.7 KB · Views: 224
  • Nihilism v1.5.5.1.zip
    62.6 KB · Views: 256
  • Nihilism v1.5.6.zip
    63.6 KB · Views: 238
  • Nihilism v1.5.6.1.zip
    63.8 KB · Views: 229
  • Nihilism v1.5.6.2.zip
    63.8 KB · Views: 262
  • Nihilism v1.5.7.zip
    64.2 KB · Views: 233
  • Nihilism v1.5.8.zip
    64.5 KB · Views: 251
  • Nihilism v1.5.9.zip
    65 KB · Views: 260
  • Nihilism v2.0.0.zip
    63.4 KB · Views: 232
  • Nihilism v2.1.0.zip
    66.9 KB · Views: 234
  • Nihilism v2.1.1.zip
    64.9 KB · Views: 236
  • Nihilism v2.1.2.zip
    66.2 KB · Views: 242
  • Nihilism v2.1.2.1.zip
    68.2 KB · Views: 231
  • Nihilism v2.1.2.2.zip
    68.3 KB · Views: 240
  • Nihilism v2.1.2.4.zip
    68.6 KB · Views: 234
  • Nihilism v2.1.2.5.zip
    68.6 KB · Views: 212
  • Nihilism v2.1.3.zip
    68.9 KB · Views: 239
  • Nihilism v2.1.4.zip
    41.7 KB · Views: 204
  • Nihilism v2.1.5.zip
    41.3 KB · Views: 251
  • Nihilism v2.1.6.1.zip
    41.2 KB · Views: 207
  • Nihilism v2.1.7.zip
    37.8 KB · Views: 178
  • Nihilism v2.1.7.1.zip
    38.4 KB · Views: 178
  • Nihilism v2.1.7.2.zip
    37.3 KB · Views: 191
  • Nihilism v2.1.7.3.zip
    37.4 KB · Views: 177
  • Nihilism v2.1.7.5.zip
    37.5 KB · Views: 171
  • Nihilism v2.2.0.zip
    40.8 KB · Views: 179
  • Nihilism v2.2.1.zip
    42.5 KB · Views: 189
  • Nihilism v3.0.0.zip
    108.6 KB · Views: 161
  • Nihilism v3.0.1.zip
    110 KB · Views: 177
  • Nihilism v3.0.2.zip
    110.3 KB · Views: 163
  • Nihilism v3.1.0.zip
    116.8 KB · Views: 189
  • Nihilism v3.1.2.zip
    122.1 KB · Views: 168
  • Nihilism v3.1.2.2.zip
    121 KB · Views: 149
  • Nihilism v3.1.3.zip
    131.4 KB · Views: 183
Last edited:
So if I've got this right. You can make an obstacle course map then use this mod to disable enemy spawns but white list the grappling hook so players will get an intrusion free run every time?
 
So if I've got this right. You can make an obstacle course map then use this mod to disable enemy spawns but white list the grappling hook so players will get an intrusion free run every time?
Yep. But you'll have to either make a simple mod to go with this to specifically implement these rules for the given world (in the way shown up top), or else adjust the mod's config file, which will put these specific settings onto all worlds you select the in-game option to enable nihilism for.

Next version I want an in-line method to add per-world settings, if I can figure on a way to do this non-messily...
 
Last edited:
This is pretty neat for custom maps, good job!
The only sort-of problem is that most people who know how to make a custom map probably don't know how to code a mod. (unless this mod's coding is so easy a kindergartner could do it, I'm very bad at coding).
 
This is pretty neat for custom maps, good job!
The only sort-of problem is that most people who know how to make a custom map probably don't know how to code a mod. (unless this mod's coding is so easy a kindergartner could do it, I'm very bad at coding).
Modding the settings is just making a glorified config file wrapper. In fact, if you have a config file you want to make into a mod to work with a specific world, just post it here and I'll do it quickly myself. Until an in-game option becomes available, that is.

Edit:

v1.3.0.1
  • Added mod icon
  • Added support for Hamstar Helpers v1.2.0 issue report
  • Refactored net protocol
 

Attachments

  • Nihilism v1.3.0.1.zip
    43.5 KB · Views: 238
Last edited:
I just noticed we can only activate it once per world ? not toggle it ? . -. just killed my test world now xD or what i do missing here . -.
 
Last edited:
v1.3.1
  • Fixed issue with default settings being forced to apply (major issue)
Edit:

v1.3.2
  • Fixed UI positioning
  • UI code refactoring
 

Attachments

  • Nihilism v1.3.1.zip
    43.9 KB · Views: 225
  • Nihilism v1.3.2.zip
    47.7 KB · Views: 213
Last edited:
Whenever i try to run this mod in multiplayer i get stuck at "Requesting World information" Is this mod not multiplayer compatible?
It shouldn't have any effect on multiplayer, but I there may be issues with the NetSend and NetReceive that I'm not aware of. I'll make a quick patch to see if this is fixable...

Edit:

v1.3.2.1
  • (Hopefully) fixed multiplayer loading hang issue
 

Attachments

  • Nihilism v1.3.2.1.zip
    47.1 KB · Views: 209
Last edited:
It shouldn't have any effect on multiplayer, but I there may be issues with the NetSend and NetReceive that I'm not aware of. I'll make a quick patch to see if this is fixable...

Edit:

v1.3.2.1
  • (Hopefully) fixed multiplayer loading hang issue

Ahh it seems to work and i can get into my server in multiplayer but i also found another bug.

1gfejIc.gif


It seems when a banned item is put into an chest it duplicates into your inventory in multiplayer.
 
v1.3.3
  • Fixed multiplayer item duplication glitch
  • Fixed configs not setting up with default values properly
Because of a specific change I made, be on the lookout for item blocking failing in some odd specific context or another, and be sure to report it.
 

Attachments

  • Nihilism v1.3.3.zip
    46.1 KB · Views: 246
v1.3.3
  • Fixed multiplayer item duplication glitch
  • Fixed configs not setting up with default values properly
Because of a specific change I made, be on the lookout for item blocking failing in some odd specific context or another, and be sure to report it.

Oh i almost forgot i finally manage to get player to join my server to see if only the item in the chest is banned when he enters my server and this was the result.

AYUIIhL.png


From the looks of it every item was banned when entering my world. my banned item list don't seem apply to him and he's pretty much was completely disabled. I was expecting only the revengense potion to be effected but all of the items were... meaning their is still major issues in multiplayer

their should be a way to block items when players enter your server and only the items the host bans should be Effected.

but this was before your update soo im not sure if it still applies... but it probably does.
 
Last edited:
Oh i almost forgot i finally manage to get player to join my server to see if only the item in the chest is banned when he enters my server and this was the result.

AYUIIhL.png


From the looks of it every item was banned when entering my world. my banned item list don't seem apply to him and he's pretty much was completely disabled. I was expecting only the revengense potion to be effected but all of the items were... meaning their is still major issues in multiplayer

their should be a way to block items when players enter your server and only the items the host bans should be Effected.

but this was before your update soo im not sure if it still applies... but it probably does.
Post your `Nihilism Config.json` content here. The default config actually does specify for all items to be disabled (except the Copper Pickaxe).
 
Post your `Nihilism Config.json` content here. The default config actually does specify for all items to be disabled (except the Copper Pickaxe).

This is what i had when i was doing the test....and i also asked my friend to send his to see if they were the same...it seems his was at "Default"? ...and mines was modified...if that matters.
 

Attachments

  • Nihilism_Config.json
    499 bytes · Views: 373
This is what i had when i was doing the test....and i also asked my friend to send his to see if they were the same...it seems his was at "Default"? ...and mines was modified...if that matters.
If you're running the server, your config is the only one that should matter. I'll look into this.

Edit: I'm unable to replicate this with local dedicated server hosting. My item whitelist updates correctly for my character upon joining an existing server, even when the client changes their config.
 
Last edited:
Can the configs be edited directly or do all changes have to be made in the game via commands?

Also, would it be possible to make it so the player can add new recipes through this mod? Is that even possible to do via modding? It's been my dream feature ever since using MineTweaker for Minecraft--combined with removing recipes (and items, mob spawns, mob drops, etc.) it's a great way to force mods to play nice together if the end user is willing to put in the effort.
 
Back
Top Bottom