magemonkeystudio / fabled

MIT License
59 stars 35 forks source link

[Bug]: #626

Closed iomatix closed 8 months ago

iomatix commented 9 months ago

Is there an existing issue for this?

Have you tried to reproduce this without OP?

Current Behavior

We can not increase the speed value via attributes at the latest release build. We should modernize the API and use attribute modifiers everywhere, where is it possible. We can also make more possible attribute stats with these to scale it better with same values. [23:12:10 WARN]: [ProSkillAPI] Attempted to set player speed to 1.05 but failed: Speed value (1.05) need to be between -1f and 1f

Expected Behavior

Player speed has been increased to 1.05 without fighitng with game rulset of the game.

Steps To Reproduce

  1. Just be and add e.g. move-speed: 'a*0.05+v'to stats in selected attribute
  2. Spend some points, at least for 1 point.

Environment

- Server Software: Papper 1.20.2
- ProSkillAPI Version: 1.1.13-R0.9
- ProMCCore Version: 1.1.0-R1
- Plugins: 
[23:23:35 INFO]: Server Plugins (53):
[23:23:35 INFO]: Paper Plugins:
[23:23:35 INFO]:  - ProMCCore, ProRPGItems, ProSkillAPI
[23:23:35 INFO]: Bukkit Plugins:
[23:23:35 INFO]:  - AuthMe, BloodNight, BlueBorder, BlueMap, BossShopPro, ChestSort, Citizens, CustomTime, DangerousCaves, DiscordSRV
[23:23:35 INFO]:  DoorsReloaded, *elyby-skinsystem, FlagWar, Gringotts, GringottsTowny, GSit, LevelledMobs, LuckPerms, MapTowny, PlaceholderAPI
[23:23:35 INFO]:  ProBlockRegen, ProEnchantmentAPI, ProHolographicDisplays, ProMCUtilities, ProRandomChests, ProRPGCrafting, ProSchematicBuilder, ProtectionStones, ProtocolLib, RiseCore
[23:23:35 INFO]:  SiegeWar, sleep-most, SMPtweaks, SuperVanish, Towny, TownyCultures, TownyNameUpdater, TownyProvinces, TownyResources, TreeFeller
[23:23:35 INFO]:  UnexpectedSpawn, Vault, VentureChat, ViaVersion, WorldBorder, WorldEdit, WorldEditSelectionVisualizer,
 WorldGuard, WorldGuard-Towny, WorldGuardExtraFlags```

latest.log

latest.log

```log [23:09:11 INFO]: [ProSkillAPI] ProSkillAPI hook into PlaceholderAPI: §asuccess. [23:09:11 INFO]: [ProSkillAPI] Registration complete [23:09:11 INFO]: [ProSkillAPI] - 0 skills [23:09:11 INFO]: [ProSkillAPI] - 1 classes [23:09:11 WARN]: [ProSkillAPI] Attempted to set player speed to 1.2 but failed: Speed value (1.2) need to be between -1f and 1f [23:09:11 WARN]: [ProSkillAPI] Attempted to set player speed to 8.7 but failed: Speed value (8.7) need to be between -1f and 1f [23:09:11 INFO]: ProSkillAPI has been reloaded ```

Anything else?

Please make a little review if it's a problem or not.

Thank you!

iomatix commented 9 months ago

Important

Another bug spotted - if move-speed: 'v' there is no move speed at all, maybe there is old doesn't working function for getting speed implemented? Let's use attribute modifieres for all stats to prevent these. I'll help with the development. We could add some few new features regarding stats section at attributes aswell at same time.

iomatix commented 9 months ago

Important

Another bug spotted - if move-speed: 'v' there is no move speed at all, maybe there is old doesn't working function for getting speed implemented? Let's use attribute modifieres for all stats to prevent these. I'll help with the development. We could add some few new features regarding stats section at attributes aswell at same time.

My bad there, there was a comment after stat (move-speed: 'v' #some comment) at the line and that caused this one.

Travja commented 8 months ago

So what you have to understand here is that the from a code perspective, the default walk speed is actually 0.2. The max value being 1, obviously with the min speed being -1. A speed of 0 means that the player won't be able to move. Negative will make them walk backwards instead of forwards, left instead of right, etc. A speed of 1.0 is the fastest you can go, and is actually quite quick.

Now... I did test this just to make sure that it wasn't immediately attempting to set the speed over 1.0. With a formula as state above, it takes up until level 16 of the attribute in order to get that error message. At this point, the speed has already been capped out at 1.0 and can no longer be upgraded further.