BG-Software-LLC / SuperiorSkyblock2

Optimized, feature packed Skyblock core.
https://bg-software.com/superiorskyblock/
GNU General Public License v3.0
159 stars 134 forks source link

Misssions: Splash / Extended / Upgraded Potions ammount placeholders do not work #1772

Closed Evalutik closed 10 months ago

Evalutik commented 1 year ago

Minecraft's Version

PurPur 1.19.3

Plugin's Version

SuperiorSkyblock2-2023.2-b37

Describe the bug

I'm trying to make a mission where you need to brew 3 potions:

required-potions:
  '1':
    potions:
      '1':
        type: POISON
        upgraded: false
        extended: true
        splash: true
    amount: 200
  '2':
    potions:
      '1':
        type: WEAKNESS
        upgraded: false
        extended: true
        splash: true
    amount: 150
  '3':
    potions:
      '1':
        type: SLOWNESS
        upgraded: true
        extended: false
        splash: true
    amount: 100

But apparently placeholders that should show the number of potions made do not work for this:

      - '&7Made splash potion of poison (1:30): &f{value_poison}&7/&f200'
      - '&7Made splash potion of weakness (4:00): &f{value_weakness}&7/&f150'
      - '&7Made splash potion of slowness IV (00:20): &f{value_slowness}&7/&f100'

gives: image

File with my mission it .txt format: brewing2.txt

To Reproduce

Additional Information

No response

Evalutik commented 1 year ago

I also have a question about the potion of turtle power: what will be the placeholder for it and did I place it correctly in the list of required potions?

image image

required-potions:
  '1':
    potions:
      '1':
        type: HARM
        upgraded: true
        extended: false
        splash: true
    amount: 4000
  '2':
    potions:
      '1':
        type: REGENERATION
        upgraded: true
        extended: false
        splash: true
    amount: 1800
  '3':
    potions:
      '1':
        type: JUMP
        upgraded: true
        extended: false
        splash: true
    amount: 1600
  '4':
    potions:
      '1':
        type: SLOWNESS
        upgraded: true
        extended: false
        splash: false
      '2':
        type: DAMAGE_RESISTANCE
        upgraded: true
        extended: false
        splash: false
    amount: 40
Evalutik commented 1 year ago

This string: - '&7Сделано взрывных зелий регенерации II (0:22): &f{value_regeneration}&7/&f1800' Leads to the error:

[15:38:07 WARN]: java.lang.IllegalArgumentException: This is not a valid potion data.
[15:38:07 WARN]:    at com.bgsoftware.superiorskyblock.missions.BrewingMissions$PotionData.fromString(BrewingMissions.java:368)
[15:38:07 WARN]:    at com.bgsoftware.superiorskyblock.missions.BrewingMissions$1.getRequirementFromKey(BrewingMissions.java:191)
[15:38:07 WARN]:    at com.bgsoftware.superiorskyblock.missions.BrewingMissions$1.getRequirementFromKey(BrewingMissions.java:188)
[15:38:07 WARN]:    at com.bgsoftware.superiorskyblock.missions.brewing.Placeholders.parsePlaceholders(Placeholders.java:55)
[15:38:07 WARN]:    at com.bgsoftware.superiorskyblock.missions.BrewingMissions.formatItem(BrewingMissions.java:214)
[15:38:07 WARN]:    at SuperiorSkyblock2-2023.2-b37.jar//com.bgsoftware.superiorskyblock.core.menu.button.impl.MissionsPagedObjectButton.modifyViewItem(MissionsPagedObjectButton.java:91)
[15:38:07 WARN]:    at SuperiorSkyblock2-2023.2-b37.jar//com.bgsoftware.superiorskyblock.core.menu.button.AbstractPagedMenuButton.createViewItem(AbstractPagedMenuButton.java:29)
[15:38:07 WARN]:    at SuperiorSkyblock2-2023.2-b37.jar//com.bgsoftware.superiorskyblock.core.menu.layout.PagedMenuLayoutImpl.populateInventory(PagedMenuLayoutImpl.java:69)
[15:38:07 WARN]:    at SuperiorSkyblock2-2023.2-b37.jar//com.bgsoftware.superiorskyblock.core.menu.layout.AbstractMenuLayout.buildInventory(AbstractMenuLayout.java:73)
[15:38:07 WARN]:    at SuperiorSkyblock2-2023.2-b37.jar//com.bgsoftware.superiorskyblock.core.menu.AbstractMenu.lambda$buildInventory$2(AbstractMenu.java:79)
[15:38:07 WARN]:    at org.bukkit.craftbukkit.v1_19_R2.scheduler.CraftTask.run(CraftTask.java:101)
[15:38:07 WARN]:    at org.bukkit.craftbukkit.v1_19_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57)
[15:38:07 WARN]:    at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[15:38:07 WARN]:    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[15:38:07 WARN]:    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[15:38:07 WARN]:    at java.base/java.lang.Thread.run(Thread.java:1589)

If I comment it: #- '&7Сделано взрывных зелий регенерации II (0:22): &f{value_regeneration}&7/&f1800'

It will be ok. Seems like {value_regeneration} is incorrect.

OmerBenGera commented 1 year ago

The format for the potion in the value is as follows: <potion_type>;<upgraded?true|false>;<extended?true|false>;<splash?true|false>

Therefore, for your poison potion, you'd use: POISON;false;true;true

Let me know if that fixes the issue.

Evalutik commented 1 year ago

The format for the potion in the value is as follows: <potion_type>;<upgraded?true|false>;<extended?true|false>;<splash?true|false>

Therefore, for your poison potion, you'd use: POISON;false;true;true

Let me know if that fixes the issue.

I changed it but the placeholders just show 0 now even though I tried brewing every type of this potion.

My potions now:

required-potions:
  '1':
    potions:
      '1':
        type: POISON
        upgraded: false
        extended: true
        splash: true
    amount: 200
  '2':
    potions:
      '1':
        type: WEAKNESS
        upgraded: false
        extended: true
        splash: true
    amount: 150
  '3':
    potions:
      '1':
        type: SLOWNESS
        upgraded: true
        extended: false
        splash: true
    amount: 100

My placeholders now:

      - '&7Сделано взрывных зелий отравления (1:30): &f{value_POISON;false;true;true}&7/&f200'
      - '&7Сделано взрывных зелий слабости (4:00): &f{value_WEAKNESS;false;true;true}&7/&f150'
      - '&7Сделано взрывных зелий замедления IV (0:20): &f{value_SLOWNESS;true;false;true}&7/&f100'

image

mission file in .txt format: brewing2.txt

Evalutik commented 11 months ago

Some news about it?

OmerBenGera commented 11 months ago

Works just fine for me https://gyazo.com/21d3d875edff2f5b6cce53adec83146f

Evalutik commented 11 months ago

Works just fine for me https://gyazo.com/21d3d875edff2f5b6cce53adec83146f

Could you please send your mission config?

OmerBenGera commented 11 months ago

I used the one you sent me.

Evalutik commented 11 months ago

Works just fine for me https://gyazo.com/21d3d875edff2f5b6cce53adec83146f

Could you please send your mission config?

Yes, it seems to work. But how do I check and what placeholder will be for Turtle Master Potion? Am I checking it correctly:

  '4':
    potions:
      '1':
        type: SLOWNESS
        upgraded: true
        extended: false
        splash: false
      '2':
        type: DAMAGE_RESISTANCE
        upgraded: true
        extended: false
        splash: false
    amount: 40

image

But what is the placeholder then?

I also have problems with some other effects:

1) SLOW_FALLING - does not work image

required-potions: '1':

    potions:
      '1':
        type: SLOW_FALLING
        upgraded: false
        extended: true
        splash: false
    amount: 3000

icons:
  not-completed:
    type: FEATHER
    name: '&6SOME TEXT'
    lore:
      - '&7SOME TEXT'
      - '&7SOME TEXT'
      - '&7SOME TEXT:'
      - ''
      - '&6To do:'
      - '&7 - x3000 Potion of Slow Fall (4:00)'
      - '&7 - x1500 SOME TEXT'
      - ''
      - '&7Done Potions of Slow (4:00): &f{value_SLOW_FALLING;false;true;true}&7/&f3000'

Mission config: brewing4.txt

2) REGENERATION couse plugin error When I using this string: - '&7Made explosive regeneration potions II (0:22): &f{value_REGENERATION;true;false;true}&7/&f1800' It gives me an error and missions menu doenst load after this item image

How it should be (how it works without this line): image

with this line: image

I am using:

  '2':
    potions:
      '1':
        type: REGENERATION
        upgraded: true
        extended: false
        splash: true
    amount: 1800

and

icons:
  not-completed:
    type: RED_DYE
    name: '&dSOME TEXT'
    lore:
      - '&7SOME TEXT.'
      - '&7SOME TEXT.'
      - ''
      - '&6SOME TEXT:'
      - '&7 - x4000 SOME TEXT'
      - '&7 - x1800 Explosive Regeneration Potion II (0:22)'
      - '&7 - x1600 SOME TEXT II (1:30)'
      - '&7 - x40SOME TEXT II (00:20)'
      - ''
      - '&7SOME TEXT: &f{value_INSTANT_DAMAGE;true;false;true}&7/&f4000'
      - '&7Made explosive regeneration potions II (0:22): &f{value_REGENERATION;true;false;true}&7/&f1800'

error after oppening this menu:

 [23:21:58 ERROR]: An unexpected error occurred while setting up menu:
[23:21:58 WARN]: java.lang.IllegalArgumentException: This is not a valid potion data.
[23:21:58 WARN]:    at com.bgsoftware.superiorskyblock.missions.BrewingMissions$PotionData.fromString(BrewingMissions.java:368)
[23:21:58 WARN]:    at com.bgsoftware.superiorskyblock.missions.BrewingMissions$1.getRequirementFromKey(BrewingMissions.java:191)
[23:21:58 WARN]:    at com.bgsoftware.superiorskyblock.missions.BrewingMissions$1.getRequirementFromKey(BrewingMissions.java:188)
[23:21:58 WARN]:    at com.bgsoftware.superiorskyblock.missions.brewing.Placeholders.parsePlaceholders(Placeholders.java:55)
[23:21:58 WARN]:    at com.bgsoftware.superiorskyblock.missions.BrewingMissions.formatItem(BrewingMissions.java:214)
[23:21:58 WARN]:    at SuperiorSkyblock2-2023.2-b57.jar//com.bgsoftware.superiorskyblock.core.menu.button.impl.MissionsPagedObjectButton.modifyViewItem(MissionsPagedObjectButton.java:91)
[23:21:58 WARN]:    at SuperiorSkyblock2-2023.2-b57.jar//com.bgsoftware.superiorskyblock.core.menu.button.AbstractPagedMenuButton.createViewItem(AbstractPagedMenuButton.java:29)
[23:21:58 WARN]:    at SuperiorSkyblock2-2023.2-b57.jar//com.bgsoftware.superiorskyblock.core.menu.layout.PagedMenuLayoutImpl.populateInventory(PagedMenuLayoutImpl.java:69)
[23:21:58 WARN]:    at SuperiorSkyblock2-2023.2-b57.jar//com.bgsoftware.superiorskyblock.core.menu.layout.AbstractMenuLayout.buildInventory(AbstractMenuLayout.java:73)
[23:21:58 WARN]:    at SuperiorSkyblock2-2023.2-b57.jar//com.bgsoftware.superiorskyblock.core.menu.AbstractMenu.lambda$buildInventory$2(AbstractMenu.java:79)
[23:21:58 WARN]:    at org.bukkit.craftbukkit.v1_19_R2.scheduler.CraftTask.run(CraftTask.java:101)
[23:21:58 WARN]:    at org.bukkit.craftbukkit.v1_19_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57)
[23:21:58 WARN]:    at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22)
[23:21:58 WARN]:    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[23:21:58 WARN]:    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[23:21:58 WARN]:    at java.base/java.lang.Thread.run(Thread.java:1589)

this mission file: brewing5.txt logs after starting server with this string (- '&7Made explosive regeneration potions II (0:22): &f{value_REGENERATION;true;false;true}&7/&f1800') latest.log without it its okay

OmerBenGera commented 11 months ago

You should use the correct potion data names from Bukkit. Google it.

Evalutik commented 11 months ago

You should use the correct potion data names from Bukkit. Google it.

Oh yes, i know, I think i used it (REGENERATION and SLOW_FALLING should be correct, idk whats wrong...) image https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html#:~:text=entity%20over%20time.-,static%20final%20PotionEffectType,Regenerates%20health.,-static%20final%20PotionEffectType

and

image https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html#:~:text=Decreases%20dig%20speed.-,static%20final%20PotionEffectType,Slows%20entity%20fall%20rate.,-static%20final%20PotionEffectType

I also cant find info about turtle potion effect

OmerBenGera commented 11 months ago

https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionType.html

It should be SLOW_FALLING and REGEN

OmerBenGera commented 10 months ago

Is there anything else I can help you with?

Evalutik commented 10 months ago

Thx