Jump to content

ModuleManager: Create if doesn't exist, don't touch otherwise?


Sharpy

Recommended Posts

I want to make my mod compliant with CommunityResourcePack, but not include it (all the hassle with updates, maintenance, the sheer size of CRP comparing to my mod).

I need one resource that is present in CRP; I'd like to define it if CRP is not present, not touch if CRP is present. What would the syntax be?

Say, if I wanted to "edit or create", I'd write

@RESOURCE_DEFINITION[StoredCharge]
{
    @name = StoredCharge
    @unitCost = 0
    @density = 0
    @flowMode = NO_FLOW
    @transfer = NONE
    @isTweakable = false
    @isVisible = true
    @volume = 1
}

But what I want is "Create Or Leave Alone"?

Link to comment
Share on other sites

Would not % be the create or edit operator, vs @? I thought the latter only edits if exists? I often get this backwards though :( 

there is another rare operator that would work, &, but I would have to check the details, and the above solution with needs is way cleaner. (But there are more options then people realize with MM :D )

Edited by komodo
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...