eldoriarpg / BigDoorOpener

Control the state of doors created by BigDoors by time and by approaching, permissions and more.
GNU Affero General Public License v3.0
5 stars 4 forks source link

[BUG] itemholding condition acts like itemclick condition after server restart #29

Closed MikeHollisJr closed 4 years ago

MikeHollisJr commented 4 years ago

image

Big Doors Opener Version: 2.2 Big Doors Version: image

Problem itemholding condition reverts to itemclick on server restart Tested with evaluation location&&item with proximity set to 5 using a CustomItems item based on a compass as the key

Expected behavior itemholding condition persists server restart

Config Please include a copy of your config with at least one door object

# Dont touch it or at least dont complain when everything burns.
# No version = 1.x
# version 1 = 2.x
enableMetrics: true
doors:
- ==: conditionalDoor
  doorUID: 8
  world: world
  position:
    ==: Vector
    x: -13.5
    y: 82.5
    z: -593.0
  invertOpen: false
  evaluator: location&&item
  evaluationType: CUSTOM
  stayOpen: 0
  conditionChain:
    ==: conditionChain
    item:
      ==: itemClickCondition
      item:
        ==: org.bukkit.inventory.ItemStack
        v: 2567
        type: COMPASS
        meta:
          ==: ItemMeta
          meta-type: COMPASS
          display-name: §bEnder Compass
          lore:
          - §2An etching reads "§aMay you always find your way...§r"
          - §7
          - '§2Shift-LClick: Save a compass specific location.'
          - '§2Shift-RClick: View your saved locations.'
          enchants:
            LURE: 1
          ItemFlags:
          - HIDE_ENCHANTS
          internal: H4sIAAAAAAAAAONiYOBgkEvOz9XLys/KT8nN10suLS7Jz80sSc0t1gORni4MPKl5KalFQEUFicXFzAzK+JSHpRYVZ+bnMTAwMHIwqONUmVeSWpSXmANTzWjIAAA0DWz5igAAAA==
          LodestoneTracked: false
      consumed: false
    permission: null
    location:
      ==: proximityCondition
      dimensions:
        ==: Vector
        x: 7.0
        y: 7.0
        z: 7.0
      proximityForm: CUBOID
    time: null
    weather: null
    placeholder: null
- ==: conditionalDoor
  doorUID: 11
  world: world
  position:
    ==: Vector
    x: -19.0
    y: 101.5
    z: -616.5
  invertOpen: false
  evaluator: location&&item
  evaluationType: CUSTOM
  stayOpen: 0
  conditionChain:
    ==: conditionChain
    item:
      ==: itemHoldingCondition
      item:
        ==: org.bukkit.inventory.ItemStack
        v: 2567
        type: COMPASS
        meta:
          ==: ItemMeta
          meta-type: COMPASS
          display-name: §bEnder Compass
          lore:
          - §2An etching reads "§aMay you always find your way...§r"
          - §7
          - '§2Shift-LClick: Save a compass specific location.'
          - '§2Shift-RClick: View your saved locations.'
          enchants:
            LURE: 1
          ItemFlags:
          - HIDE_ENCHANTS
          internal: H4sIAAAAAAAAAONiYOBgkEvOz9XLys/KT8nN10suLS7Jz80sSc0t1gORni4MPKl5KalFQEUFicXFzAzK+JSHpRYVZ+bnMTAwMHIwqONUmVeSWpSXmANTzWjIAAA0DWz5igAAAA==
          LodestoneTracked: false
      consumed: false
    permission: null
    location:
      ==: proximityCondition
      dimensions:
        ==: Vector
        x: 8.0
        y: 8.0
        z: 8.0
      proximityForm: CYLINDER
    time: null
    weather: null
    placeholder: null
- ==: conditionalDoor
  doorUID: 12
  world: world
  position:
    ==: Vector
    x: -19.5
    y: 81.5
    z: -586.0
  invertOpen: false
  evaluator: location&&item
  evaluationType: CUSTOM
  stayOpen: 0
  conditionChain:
    ==: conditionChain
    item:
      ==: itemClickCondition
      item:
        ==: org.bukkit.inventory.ItemStack
        v: 2567
        type: COMPASS
        meta:
          ==: ItemMeta
          meta-type: COMPASS
          display-name: §bEnder Compass
          lore:
          - §2An etching reads "§aMay you always find your way...§r"
          - §7
          - '§2Shift-LClick: Save a compass specific location.'
          - '§2Shift-RClick: View your saved locations.'
          enchants:
            LURE: 1
          ItemFlags:
          - HIDE_ENCHANTS
          internal: H4sIAAAAAAAAAONiYOBgkEvOz9XLys/KT8nN10suLS7Jz80sSc0t1gORni4MPKl5KalFQEUFicXFzAzK+JSHpRYVZ+bnMTAwMHIwqONUmVeSWpSXmANTzWjIAAA0DWz5igAAAA==
          LodestoneTracked: false
      consumed: false
    permission: null
    location:
      ==: proximityCondition
      dimensions:
        ==: Vector
        x: 5.0
        y: 5.0
        z: 5.0
      proximityForm: CUBOID
    time: null
    weather: null
    placeholder: null
language: en_US
version: 1
refreshRate: 20
checkUpdates: true
jsCacheSize: 400
rainbowdashlabs commented 4 years ago

Thanks for the detailed report. There was a small bug in the deserialization. It's fixed in the next version. The version will be deployed on thursday probably. I just have to wait for v24 of Big Doors to be released officially

rainbowdashlabs commented 4 years ago

Also one small addition. I highly recommend to use the AND evaluator if you just want to do something like location&&item. The custom JS evaluator needs to check all conditions for every player. When you use the AND evaluator it will only check for the item if the location is true. This can increase the performance a lot.