Jump to content

Spoonail

Vintarian
  • Posts

    9
  • Joined

  • Last visited

Community Answers

  1. Spoonail's post in What all did you have to do to make your 1.21 mod work for 1.22? was marked as the answer   
    You don't have to create a new project.
    Updating the .net version in the existing .csproj file works.
    I mean, just open the .csproj file and replace:
    <TargetFramework>net8.0</TargetFramework> with:
    <TargetFramework>net10.0</TargetFramework> If you don't like editing the csproj directly, you can also open the project properties and set the target framework:

    Either way, make sure all the existing projects are updated.
    The official template includes two projects (the main and CakeBuild), so you need to update both.
    Also, the template has updated the CakeBuild package versions, so it should be worth following it in your existing projects as well.
    Here's a quote from Discord post by Th3Dilli (one of the dev members) describing how to do that:
    Original: https://discord.com/channels/302152934249070593/351624415039193098/1479916087050240142
    VS 2022 didn't fail to compile for me, but caused an issue on debugging and trying to decompile the game dll.
    VS 2026 works without the issue, so I'd recommend updating anyway.
  2. Spoonail's post in Recipe Outputs being Given Durability (not intended) was marked as the answer   
    The behavior averaging durability can be disabled from the recipe json.
    Add "averageDurability": false to the recipe.
  3. Spoonail's post in Request for help regarding how to generate food. 请求帮助,关于如何生成食物。 was marked as the answer   
    I made a few changes and got it working:
    In `StartServerSide`:
    The handler and a method for Ground Storage:
    Changes and reasons:
    - Spawning the pot at fixed position was hard to debug, so changed the command to spawn it at player pos +3z
      - So after running the command, look south to find the spawned pot
    - Getting block/item by raw ID doesn't work well. Use it with `AssetLocation` always.
      - Actually `GetBlock(1093)` gave me one of variants of brick blocks
    - Meat stew requires at least 2 meat, so changed the ingredient to 2 red meat and 2 carrots 
    - To set meal into a pot properly, you need to call `IBlockMealContainer.SetContents`
    - In recent VS versions, meal containers are placed in Ground Storages instead of being placed directly, so changed the code to follow the way
      - Create a pot stack, set meal content to it, create a Ground Storage, place the gs and set the pot stack into it
  4. Spoonail's post in [ask for help]Is there any way to turn the BGM on or off by command?[寻求帮助]请问有没有办法通过指令来开关BGM? was marked as the answer   
    You can set any client config value via the `.clientConfig` command, including the bgm volume (`musicLevel`):
    .clientConfig musicLevel 0 .clientConfig musicLevel 30 If you want short-hand commands, you can define custom commands in your mod's `StartClientSide` and use `ICoreClientAPI.TriggerChatMessage` to call `.clientConfig`.
    That should look like:
    public override void StartClientSide(ICoreClientAPI api) {     api.ChatCommands         .Create("notbgm")         .HandleWith(args => {             api.TriggerChatMessage(".clientConfig musicLevel 0");             return TextCommandResult.Success($"Current music level: {ClientSettings.MusicLevel}");         });     //... }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.