Jump to content

Custom configuration screen review


portablejim

Recommended Posts

Given a recent discussion in github, I was wanting some input into the configuration system (including config screen) I use for VeinMiner.

 

1) The configuration screen

 

The main screen

 

UZ98UlZ.png

 

"Enable Veinminer": Cycles between different options

"Range" and "Blocklimit": Slider with a logarithmic* scale with the range 1-1000 blocks.

"Range" and "Blocklimit": Slider with a logarithmic* scale and the end displays "Infinite".

The tool is selectable and the tool list and block list for each tool can be gotten to.

* It changes more per pixel the greater the number.

 

The tool list

 

SJ1AS3u.png

 

ASYNGbd.png

 

A list of tools. Typing in the box will show the icon to the left of the box when you type a matching name. "Delete from list" acts on the currently selected item of the list.

 

The block list

 

9sgxfAG.png

 

Similiar to the tool list.

 

 

2) Configuration files

 

I have 2 configuration files. The first one uses the standard configuration class.

 

# Configuration file

##########################################################################################################
# autodetect
#--------------------------------------------------------------------------------------------------------#
# Autodetect items and blocks during game start-up.
##########################################################################################################

autodetect {
    # Autodetect blocks with the below prefixes in the ore dictionary, adding the names to the axe list. [default: true]
    B:autodetect.blocks.axe.enable=true

    # List of prefixes to autodetect as blocks to be used with a axe.
    # Separate with ',' [default: 'log,treeLeaves'] 
    S:autodetect.blocks.axe.prefixes=log,treeLeaves

    # Autodetect blocks with the below prefixes in the ore dictionary, adding the names to the hoe list. [default: false]
    B:autodetect.blocks.hoe.enable=false

    # List of prefixes to autodetect as blocks to be used with a hoe.
    # Separate with ',' [default: ''] 
    S:autodetect.blocks.hoe.prefixes=

    # Autodetect blocks with the below prefixes in the ore dictionary, adding the names to the pickaxe list. [default: true]
    B:autodetect.blocks.pickaxe.enable=true

    # List of prefixes to autodetect as blocks to be used with a pickaxe.
    # Separate with ',' [default: 'ore'] 
    S:autodetect.blocks.pickaxe.prefixes=ore

    # Autodetect blocks with the below prefixes in the ore dictionary, adding the names to the shears list. [default: true]
    B:autodetect.blocks.shears.enable=true

    # List of prefixes to autodetect as blocks to be used with a shears.
    # Separate with ',' [default: 'treeLeaves'] 
    S:autodetect.blocks.shears.prefixes=treeLeaves

    # Autodetect blocks with the below prefixes in the ore dictionary, adding the names to the shovel list. [default: false]
    B:autodetect.blocks.shovel.enable=false

    # List of prefixes to autodetect as blocks to be used with a shovel.
    # Separate with ',' [default: ''] 
    S:autodetect.blocks.shovel.prefixes=

    # Autodetect tools on starting the game, adding the names to the list.
    B:autodetect.tools.enable=true
}


##########################################################################################################
# client
#--------------------------------------------------------------------------------------------------------#
# These settings are used client side, so they have no impact on servers.
##########################################################################################################

client {
    # What mode should the client use when joining a game.
    # Valid modes: [default: pressed]
    #   'disabled' = don't enable, even when keybind pressed
    #   'pressed' = enables when keybind is pressed
    #   'released' = enables when keybind is released
    #   'sneak' = enables when sneaking (ignores keybind)
    #   'no_sneak' = enables when not sneaking (ignores keybind)
    S:client.preferredMode=pressed
}


limit {
    # Limit of blocks to be destroyed at once. Use -1 for infinite. [range: -1 to 2147483647, default: 800]
    I:limit.blocks=-1

    # Maximum number of blocks to be removed per game tick (1/20 seconds). Using a low number will keep the game from getting huge performance drops but also decreases the speed at which blocks are destroyed. [range: 1 ~ 1000, default: 10]
    I:limit.blocksPerTick=10

    # Maximum distance from the first block to search for blocks to destroy. [range: -1 to 1000, default: 20]
    I:limit.radius=545
}


misc {
    # Block IDs (with metadata) to consider equivalent.
    # Names are formatted like 'modName:block_name/metadata'. Separate names (with metadata) with ','. Use 'minecraft' as the mod name for vanilla blocks.
    # [default: 'minecraft:redstone_ore=minecraft:lit_redstone_ore']
    S:equalBlocks=minecraft:lit_redstone_ore=minecraft:redstone_ore
}


overrides {
    # Mine all blocks with all registered tools that can harvest blocks.
    B:override.allBlocks=false

    # Allow all tools, including the open hand, to be used to mine blocks.
    B:override.allTools=false
}


 

 

The second uses JSON to configure the tools. Custom values for the tools can be used (e.g. for new tool groups added by other mods).

 

{
  "tools": {
    "axe": {
      "name": "Axe",
      "icon": "minecraft:diamond_axe",
      "toollist": [
        "minecraft:diamond_axe",
        "minecraft:golden_axe",
        "minecraft:iron_axe",
        "minecraft:stone_axe",
        "minecraft:wooden_axe"
      ],
      "blocklist": [
        "minecraft:fence",
        "minecraft:leaves",
        "minecraft:leaves2",
        "minecraft:log",
        "minecraft:log2"
      ]
    },
    "hoe": {
      "name": "Hoe",
      "icon": "minecraft:diamond_hoe",
      "toollist": [
        "minecraft:diamond_hoe",
        "minecraft:golden_hoe",
        "minecraft:iron_hoe",
        "minecraft:stone_hoe",
        "minecraft:wooden_hoe"
      ],
      "blocklist": [
        "minecraft:carrots",
        "minecraft:melon_block",
        "minecraft:potatoes",
        "minecraft:pumpkin",
        "minecraft:wheat"
      ]
    },
    "pickaxe": {
      "name": "Pickaxe",
      "icon": "minecraft:diamond_pickaxe",
      "toollist": [
        "minecraft:diamond_pickaxe",
        "minecraft:golden_pickaxe",
        "minecraft:iron_pickaxe",
        "minecraft:stone_pickaxe",
        "minecraft:wooden_pickaxe"
      ],
      "blocklist": [
        "minecraft:coal_ore",
        "minecraft:cobblestone_wall",
        "minecraft:diamond_ore",
        "minecraft:emerald_ore",
        "minecraft:glowstone",
        "minecraft:gold_ore",
        "minecraft:iron_ore",
        "minecraft:lapis_ore",
        "minecraft:lit_redstone_ore",
        "minecraft:mossy_cobblestone",
        "minecraft:nether_brick_fence",
        "minecraft:obsidian",
        "minecraft:quartz_ore",
        "minecraft:redstone_ore"
      ]
    },
    "shears": {
      "name": "Shears",
      "icon": "minecraft:shears",
      "toollist": [
        "minecraft:shears"
      ],
      "blocklist": [
        "minecraft:deadbush",
        "minecraft:leaves",
        "minecraft:leaves2",
        "minecraft:tallgrass",
        "minecraft:vine",
        "minecraft:web",
        "minecraft:wool"
      ]
    },
    "shovel": {
      "name": "Shovel",
      "icon": "minecraft:diamond_shovel",
      "toollist": [
        "minecraft:diamond_shovel",
        "minecraft:golden_shovel",
        "minecraft:iron_shovel",
        "minecraft:stone_shovel",
        "minecraft:wooden_shovel"
      ],
      "blocklist": [
        "minecraft:clay",
        "minecraft:gravel"
      ]
    }
  }
}

 

 

 

I know I am using a custom configuration GUI.

  • Is this GUI intuitive?
  • For these options, can the forge config GUI be as intuitive (or more intuitive)?
  • I am using separate config files for data of different structures. Is this good? Should it be 1 config file?
  • Is there a better way to do this?

 

 

Link to comment
Share on other sites

I think a custom config GUi is better than the built-in one, so long as you're willing to put in the time to make a good one. However the built-in one is convenient because it auto-formats based changes in the Configuration -- in other words you don't have to change code of the GUI when you change the Configuration. However, you also don't have control over things like the order, and generally it looks boring.

 

I do use the built-in one though -- here is my tutorial on doing that: http://jabelarminecraft.blogspot.com/p/minecraft-modding-configuration-guis.html

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • i tried downloading the drivers but it says no AMD graphics hardware
    • Update your AMD/ATI drivers - get the drivers from their website - do not update via system  
    • As the title says i keep on crashing on forge 1.20.1 even without any mods downloaded, i have the latest drivers (nvidia) and vanilla minecraft works perfectly fine for me logs: https://pastebin.com/5UR01yG9
    • Hello everyone, I'm making this post to seek help for my modded block, It's a special block called FrozenBlock supposed to take the place of an old block, then after a set amount of ticks, it's supposed to revert its Block State, Entity, data... to the old block like this :  The problem I have is that the system breaks when handling multi blocks (I tried some fix but none of them worked) :  The bug I have identified is that the function "setOldBlockFields" in the item's "setFrozenBlock" function gets called once for the 1st block of multiblock getting frozen (as it should), but gets called a second time BEFORE creating the first FrozenBlock with the data of the 1st block, hence giving the same data to the two FrozenBlock :   Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=head] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@73681674 BlockEntityData : id:"minecraft:bed",x:3,y:-60,z:-6} Old Block Fields set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=3, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} Frozen Block Entity set BlockState : Block{minecraft:black_bed}[facing=east,occupied=false,part=foot] BlockPos{x=2, y=-60, z=-6} BlockEntity : net.minecraft.world.level.block.entity.BedBlockEntity@6d1aa3da BlockEntityData : {id:"minecraft:bed",x:2,y:-60,z:-6} here is the code inside my custom "freeze" item :    @Override     public @NotNull InteractionResult useOn(@NotNull UseOnContext pContext) {         if (!pContext.getLevel().isClientSide() && pContext.getHand() == InteractionHand.MAIN_HAND) {             BlockPos blockPos = pContext.getClickedPos();             BlockPos secondBlockPos = getMultiblockPos(blockPos, pContext.getLevel().getBlockState(blockPos));             if (secondBlockPos != null) {                 createFrozenBlock(pContext, secondBlockPos);             }             createFrozenBlock(pContext, blockPos);             return InteractionResult.SUCCESS;         }         return super.useOn(pContext);     }     public static void createFrozenBlock(UseOnContext pContext, BlockPos blockPos) {         BlockState oldState = pContext.getLevel().getBlockState(blockPos);         BlockEntity oldBlockEntity = oldState.hasBlockEntity() ? pContext.getLevel().getBlockEntity(blockPos) : null;         CompoundTag oldBlockEntityData = oldState.hasBlockEntity() ? oldBlockEntity.serializeNBT() : null;         if (oldBlockEntity != null) {             pContext.getLevel().removeBlockEntity(blockPos);         }         BlockState FrozenBlock = setFrozenBlock(oldState, oldBlockEntity, oldBlockEntityData);         pContext.getLevel().setBlockAndUpdate(blockPos, FrozenBlock);     }     public static BlockState setFrozenBlock(BlockState blockState, @Nullable BlockEntity blockEntity, @Nullable CompoundTag blockEntityData) {         BlockState FrozenBlock = BlockRegister.FROZEN_BLOCK.get().defaultBlockState();         ((FrozenBlock) FrozenBlock.getBlock()).setOldBlockFields(blockState, blockEntity, blockEntityData);         return FrozenBlock;     }  
    • It is an issue with quark - update it to this build: https://www.curseforge.com/minecraft/mc-mods/quark/files/3642325
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.