Comments (39)
I might have another look at this some other time, but for now it doesn't seem to be possible.
from bukkitoldcombatmechanics.
@mibby
I might be able to make a plugin to modify offline players' playerdata files... it won't be pretty, but I might be able to get it to work, and that's all that matters.
I've done it once before to restore players inventories by reading their playerdata files, so I should be able to use that as a starting point.
Sorry for the inconvenience this has caused you :/
from bukkitoldcombatmechanics.
The plugin sets an attribute on players with the attack speed, that attribute must be reversed so you would have to keep the plugin enabled and set the attack speed to the default 4 in the config file until all the people that were set to the new speed are set back.
from bukkitoldcombatmechanics.
I see, I will have to keep it on then for a bit so that during the week people can log in to get the reverted mechanics. Now what if I later just remove the plugin and somebody hadn't logged in when I made changes? Would they be still be set to fast attackspeeds as deault?
cheers again for your help!
from bukkitoldcombatmechanics.
Yes, they would still be set to fast attack speed if they had logged in
when the plugin was previously enabled.
2016-08-23 21:35 GMT+01:00 Yohan Vervatwala [email protected]:
I see, I will have to keep it on then for a bit so that during the week
people can log in to get the reverted mechanics. Now what if I later just
remove the plugin and somebody hadn't logged in when I made changes? Would
they be still be set to fast attackspeeds as deault?
cheers again for your help!—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACqRZi0U2_GOpQ8Sht1AM9RoOUQE2jhMks5qi1magaJpZM4JrSC4
.
from bukkitoldcombatmechanics.
So now I've made changes disabled features, done a restart, on my client I see on a sword attack speed as 1.6 but a few users are reporting an attackspeed of 1021.6 and can spam click.
Is there a step I missed? a bug perhaps?
from bukkitoldcombatmechanics.
Try keeping the old attack speed enabled but setting the speed to 4
Il 23/ago/2016 22:25, "Yohan Vervatwala" [email protected] ha
scritto:
So now I've made changes disabled features, done a restart, on my client I
see on a sword attack speed as 1.6 but a few users are reporting seeing
attackspeed of 1021.6 and can spam click again?
Is there a step I missed? a bug perhaps?—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACqRZh2zlvO70piSUVGFf4nfNbKPrUABks5qi2U9gaJpZM4JrSC4
.
from bukkitoldcombatmechanics.
I've realized now that once a feature is disabled when config is reloaded it only affects people who are currently online, so now what is happening is some people have one version of pvp (1.8) some some back to default (1.9)
I should also point out this is on v1.0.1 of the plugin as the newest one did not refresh the config so even after reloads changes would not be present.
from bukkitoldcombatmechanics.
I understand (sort of) that the plugin changes some player NBT data or something but it would really be nice if there was a config once reloaded would change it for everyone (people who arent online either) since players on a server can be of different timezones and there might not be an admin to reload the plugin.
(I really hope what I am trying to say makes any sense?)
from bukkitoldcombatmechanics.
Due to efficiency features, when you disable the module the plugin no longer peforms any check. This means that if you want to revert everyone back (including people who are offline) you must keep the module enabled and set the speed to 4 (default for 1.8). I'm not sure if it is possible to change the attack speed for offline players but I'll have a look.
from bukkitoldcombatmechanics.
There seems to be a way to get a list of all players including offline players but we can't get the world they're in nor edit their attributes in any reasonable manner.
from bukkitoldcombatmechanics.
Ok thank you @gvlfm78 , apologies for the confusion and thank you for helping me through it.
from bukkitoldcombatmechanics.
Why not just reset a player's attributes upon logout? Should be possible, shouldn't it?
from bukkitoldcombatmechanics.
Depends on the timing of events, but it's not a bad idea. That might be a better solution.
On Sep 6, 2016, at 7:14 AM, Luuk Jacobs [email protected] wrote:
Why not just reset a player's attributes upon logout? Should be possible, shouldn't it?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
from bukkitoldcombatmechanics.
PlayerQuitEvent is called right before the player gets disconnected, so the player is stil loaded in memory.
Something like this should suffice:
@EventHandler( priority = EventPriority.HIGHEST )
public void onPlayerQuit( PlayerQuitEvent e )
{
Player player = e.getPlayer();
AttributeInstance attribute = player.getAttribute( Attribute.GENERIC_ATTACK_SPEED );
double baseValue = attribute.getBaseValue();
if ( baseValue != 4 )
{
attribute.setBaseValue( 4 );
player.saveData();
}
}
from bukkitoldcombatmechanics.
Well that makes our job easy :P
Yeah, I just wasn't sure if the player was still loaded in the PlayerQuitEvent. Thanks for saving me the work XD
On Sep 6, 2016, at 7:45 AM, Luuk Jacobs [email protected] wrote:
PlayerQuitEvent is called right before the player gets disconnected, so the player is stil loaded in memory.
Something like this should suffice:@eventhandler( priority = EventPriority.HIGHEST )
public void onPlayerQuit( PlayerQuitEvent e )
{
Player player = e.getPlayer();
AttributeInstance attribute = player.getAttribute( Attribute.GENERIC_ATTACK_SPEED );
double baseValue = attribute.getBaseValue();
if ( baseValue != 4 )
{
attribute.setBaseValue( 4 );
player.saveData();
}
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
from bukkitoldcombatmechanics.
Indeed that would work. I believe the original reason for not doing that was to have the least amount of listeners/operations for the plugin to be as efficient as possible, I never considered anyone would want to get rid of the plugin after having allowed their playerbase on.
from bukkitoldcombatmechanics.
@gvlfm78 it is still something to be considered that a plugin could be removed after it was put in. I am not a programmer by any stretch but as a user (simple server admin) I would think some easier kind of reset would be in place.
from bukkitoldcombatmechanics.
Here's the problem: to my knowledge, we don't' have access to the attack speeds of offline players.
Now even if we implemented a better system, you'd still have a bunch of offline players that would have the wrong attack speed.
I can do some checking though to see if we have access to the offline players, if so then we can probably figure something out.
from bukkitoldcombatmechanics.
How about something that refreshes the config as the player logs in? like right now when i am online i just reload the plugin just so i know it changes some of the old players attack speed
from bukkitoldcombatmechanics.
If you enable the combat coold-down module and set the speed to 4 players will be set back to 1.9 speeds upon entering the server.
from bukkitoldcombatmechanics.
:o So if we use OCM and one day decide to remove it, some players would be stuck with faster combat compared to new players? Seems extremely inefficient for large community servers. Can't wait for every single person to login once to be 'reset'. :s
from bukkitoldcombatmechanics.
We haven't found a way yet to edit the Attributes of offline player, but by adding kukelekuuk00's code anyone that installs the plugin after it's been added should not have this problem. I'm still looking around if there's a practical way to edit offline player's attributes.
from bukkitoldcombatmechanics.
Hopefully you are able to find a way. :) Don't want to be stuck with some players being broken permanently if the plugin is ever removed in the future. Would be nice to reset everyone's attributes before removal.
from bukkitoldcombatmechanics.
Any update to this problem?
from bukkitoldcombatmechanics.
Really the only way I can think of is to crawl through all playerdata files and manually modify the NBT. I think the server would have to be offline for this though....
Anyways it wouldn't be easy to say the least, but it might be possible. I guess I can look into it...
from bukkitoldcombatmechanics.
I have put @kukelekuuk00 's fix in place for version 1.0.2, so that in the meantime at least new installs will not have the same problem.
from bukkitoldcombatmechanics.
Would it be possible to create a temporary offline tool to use on all player files in the world folder to reset their attack speed to default? I don't want to be stuck with broken users forever. :(
from bukkitoldcombatmechanics.
@mibby
So sorry that I have taken so long! I actually forgot about this :(
I just create OCMFixer and it should fix your problems. It's SUPER simple to use, and I did test it out. Let me know if it works!
from bukkitoldcombatmechanics.
It just sets the AttackSpeed NBT tag to 4 (assuming default 1.9/10+ value) for all players? Won't corrupt the player.dat file?
from bukkitoldcombatmechanics.
from bukkitoldcombatmechanics.
Thanks. I'll give it a try later today. :)
Does OCM modify any other player NBT strings? Or was it just attack speed which should now revert on logout?
from bukkitoldcombatmechanics.
It was only modifying attack speed I believe... and it wasn't using the NBT system. The Bukkit API itself lets you change a player's attack speed without any NMS / Reflection, but there just wasn't any way to do that for offline players.
So instead I just wrote OCMFixer to read all the playerdata files and change the attribute value. It should be 100% safe, I wrote some protections into the code so if it doesn't find the right NBT structure in the file it just kinda fails silently without touching the file.
from bukkitoldcombatmechanics.
@mibby If you enabled the old armour values, which causes the plugin to add a large armour toughness value to armour pieces upon wearing them, those values won't be removed upon removing the plugin as players could have easily put the armour pieces in chests etc.
from bukkitoldcombatmechanics.
@mibby
Did OCMFixer solve your problems?
from bukkitoldcombatmechanics.
Assuming OCM doesn't set the attack speed value to the player.dat file anymore (removing it on logout), I hope so. :P I did run the plugin and read command on the world. No way of fully knowing without using an NBT editor and looking at every user file.
from bukkitoldcombatmechanics.
Just look at a few that haven't been online in a while. To make sure.
And @gvlfm78 it does reset on logout now, right?
from bukkitoldcombatmechanics.
If you have the module enabled it does. This means that those that haven't logged it since before the update will still have the fast attack speed and you'll have to use Rayzr's utility if you're uninstalling or disabling the module.
from bukkitoldcombatmechanics.
I have made the plugin set armour NBT tags to default when armour is unequipped or the player leave the server. This means from version 1.1.1 of OCM removing OCM should leave no trace.
from bukkitoldcombatmechanics.
Related Issues (20)
- Armour durability going down faster than expected HOT 7
- Duplication Shield HOT 3
- 1.20 smithing table & netherite upgrade template HOT 3
- Add way to change prefix. HOT 4
- hit-frequency on mythicmobs not working HOT 4
- Sword blocking not showing correctly HOT 4
- Sentinel/Citizens NPC conflict HOT 7
- Bugged pvp
- Offhand not working HOT 1
- Toggling shield causes duping HOT 3
- Snowgolem throwing snowball into boat throws errors
- Make splash potions ignore player velocity HOT 7
- 1.7 enchantment behaviour HOT 6
- Ability to hide hit delay indicator HOT 6
- The Residence has PVP disabled, but players can use fishing rods to inflict damage on other players. HOT 2
- Server crash with OldCombatMechanics error HOT 2
- Break separate inventories
- I would like you to create a function that allows you to use or not use this plugin for each world. HOT 1
- Weakness effect
- Add a placeholder
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bukkitoldcombatmechanics.