I used the following pattern to prevent crafting two specific items (returning false for those items) while allowing the rest (returning true for all other cases). This resulted in a duplication bug on my server which has wrecked the economy and most of the builds and will require a wipe.
What is the recommended, safe way to prevent crafting of specific items while allowing the rest?
If a umod admin cares to get the details of HOW to duplicate with this code in place, contact me directly ([email protected]).
What is the recommended, safe way to prevent crafting of specific items while allowing the rest?
bool CanCraft(ItemCrafter itemCrafter, ItemBlueprint bp, int amount)
{
if (!this.allowCraft_CodeLockCheck(bp.targetItem))
{
itemCrafter.containers[0].GetOwnerPlayer().ChatMessage("explanation");
return false;
}
else if(!this.allowCraft_DoorKeyCheck(bp.targetItem))
{
itemCrafter.containers[0].GetOwnerPlayer().ChatMessage("explanation");
return false;
}
return true;
}If a umod admin cares to get the details of HOW to duplicate with this code in place, contact me directly ([email protected]).