PreciousStones

PreciousStones

269k Downloads

IDEA/BUG Multiple fields with same block type, dynamic config loading

Omanoctoa opened this issue ยท 2 comments

commented

I've encountered an unexpected issue. I'm trying to create fields that give potion effects (works) and can be 'upgraded', by being crafted with a Nether Star (works). The problem...is PreciousStones is not registering the different variations. Here's a code snippet...

`

  • title: "Crystal Lens of Fire"
    block: '95:1'
    meta-name: '&6Crystal Lens of Fire'
    meta-lore:
    • '&7Grants Fire Resistance'
    • '&7Protects a 20-block radius'
      meta-autoset: false
      radius: 20
      surfaces: [beacon]
      no-resize: true
      ^potions:
    • FIRE_RESISTANCE
      potion-intensity:
    • 0
      no-conflict: true
      breakable: true
      required-permission: perks.survival.crystallens
  • title: "Crystal Lens of Cinders"
    meta-name: '&6Crystal Lens of Cinders'
    meta-lore:
    • '&7Grants Fire Resistance'
    • '&7Protects a 40-block radius'
      meta-autoset: false
      block: 'stained_glass:1'
      radius: 40
      surfaces: [beacon]
      ^potions:
    • FIRE_RESISTANCE
      potion-intensity:
    • 0
      custom-height: 41
      breakable: true
      no-conflict: true
      required-permission: perks.survival.crystallens
      no-resize: true
  • title: "Crystal Lens of the Inferno"
    meta-name: '&6Crystal Lens of the Inferno'
    meta-lore:
    • '&7Grants Fire Resistance'
    • '&7Protects a 60-block radius'
      meta-autoset: false
      block: 'stained_glass:1'
      radius: 60
      surfaces: [beacon]
      ^potions:
    • FIRE_RESISTANCE
      potion-intensity:
    • 0
      custom-height: 61
      breakable: true
      no-conflict: true
      required-permission: perks.survival.crystallens
      no-resize: true`

I've called them different names but they used to be called Crystal Lens of Fire, Fire II and Fire III. I assumed it was ignoring the repeating III and just reading the last one, but after some testing I realized it was actually ignoring the other 2 fields. It appears PS is not able to register different field types using the same block type, which kind of breaks my idea.

My second point, is to suggest dynamic configuration loading. Basically, when PS is reloaded or is restarting, read the fields individually instead of all at once. If it encounters a problem with a field, simply ignore that field, print a semi-useful error in Console (bonus!) and continue loading the rest. Craftbook, one of my favourite plugins, is incredibly easy to use because of this. If you could set up a similar system so if a field has errors it is simply skipped, this would be phenomenal and definitely make creating custom fields less frustrating. :)

commented

You cannot use the same block type+data combo. You can use same block type with different data though, like different shades of grass etc. Unfortunately, this is one of the bedrock principles of the plugin, everything works around the uniqueness of type+data. This cannot change without re-writing the whole plugin from scratch.

The loading thing might be a good idea. Though limited use as wanting to load up a server with broken fields is a very rare thing.

commented

I figured that was the case. The wiki/guide didn't mention that so I wasn't aware. It also details the incorrect format for listing potion effects and intensities. It details it as being a [single-line list], whereas it is actually supposed to be

  • listed
  • vertically
    which is very confusing. The only reason I figured it out (apart from other lists being in the new format) was by looking at the default config.yml file. The wiki feels a little outdated ;D