Comments (18)
If that line is commented out, the Boost effect from the Sigil of Haste would... be irreversible and blow up. Thaumcraft does something similar, however Azanor may have a way that is a lot better.
from bloodmagic.
mhh, that would mean that the effect would last for ever, right ?
I think it would be enough if you set it to 0.1 every 20th tick and only on players with the effect. If the effect lasts 1 second longer who cares. As the effect is permanent wouldn´t it be possible to only cast it when the effect gets removed and on playerJoin ?
from bloodmagic.
Hi, if that would be irreversible, couldnt you just reset players with a sigil of haste? Or only reset in the tick the players loses the 'sigil of haste'-effect?
from bloodmagic.
You'd still have to look if the player has that sigil, which might be worse. And what if they drop the sigil? What if they get the buff from another source?
from bloodmagic.
Would it be possible to save a list of players with active sigils? If a player is tested, you check if the Sigil is still there and if not (=dropped) you remove the buff. As only a few have the sigil, the total work would be less (I guess).
from bloodmagic.
yeah + every 20th tick. This would lower down the cpu usage by about +20000% for us.
100 * 20 * 10 (if every 10th player uses a sigil)
from bloodmagic.
Unfortunately that wouldn't exactly solve it (the one every 20th tick just can't work out). I think the issue is that the way it currently works also affects FakePlayers, which includes a bunch of blocks in the game (this is just a guess, but I don't know if it's actually the case). I'll think on it a bit and hope that I can find a solution that works out.
from bloodmagic.
After browsing the code a bit, would it work to add something along the following to SigilOfHaste.java:
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
//...
tag.setBoolean("isActive", !(tag.getBoolean("isActive")));
//here comes my codeproposal
if(tag.getBoolean("isActive"))
{
activePlayers.add(par3EntityPlayer); //activePlayers would be a list which is checked in AlchemicalWizardryTickHandler
}
else
{
activePlayers.remove(par3EntityPlayer);
}
//here does it end
//...
}
On a server with 70 people with only 5 having the Sigil of Haste active, the extra work created by checking a list 65 times would be minimal compared to 65 unnecessary setPrivateAttribute-calls. Would of course extrawork if it would be reversed (eg. 65 having the sigil active)...
Maybe a Set would be better?
Would this be threadsafe? Please tell me, what do you think of this.
from bloodmagic.
Unfortunately that wouldn't work, although it may be close to what I need. I'll have a hashmap save the names of the people using my mod's speed-altering items/buffs, and on the tick end I'll instead iterate over that list instead of all of the players. It should also remove the player from the list at each tick end, and depending on how well it works through testing, should constantly reset and re-add the player to the list.
Will it be more efficient per player? Probably not. Overall, though? I hope so! I'll do a bit of testing on this later on, and will close & comment this issue if it works.
from bloodmagic.
@WayofTime come on IRC plox, I have a solution for this.
from bloodmagic.
whats the solution now ? We just removed the check and it works fine. I don´t see any need for it on a big server.
from bloodmagic.
@WayofTime Was this fixed?
from bloodmagic.
It will be fixed in the 1.7.2 version for sure, and if I get it working there I may be able to port the fix to 1.6.4.
from bloodmagic.
Please do, this is a major issue for us and would be a great fix to avoid disabling the item.
from bloodmagic.
@WayofTime Status report? :P
from bloodmagic.
@tterrag1098 Should be all fixed already!
from bloodmagic.
Nice! We have 1.0, I assume that's the version with the fix?
from bloodmagic.
That it does.
from bloodmagic.
Related Issues (20)
- 1.19 HOT 1
- [Error] Can't place player // Serverside exception // Related to spectral tiles HOT 1
- Mod Compat with Valkyrian Skies
- Fungal charge crafting recipe using an empty tag 1.20.1 neoforge HOT 1
- [1.20.1] The book does not work
- Reinforced variants of runes have no effective tool HOT 1
- Anointments can't be applied to two-handed weapons and tools (Better Combat).
- Feature Request: Add (re-add?) ability edit filters in nodes without removing them
- Tag Item Filters tag selection inacurate
- [1.20.1] Log spam upon player death HOT 3
- Question: HOT 2
- i dont know how to do PR's lol Please update the CuriosCompat.java class to fix a crash with Corail Tombstone. (1.20.1) HOT 1
- Standard filter stacking HOT 3
- Tunnel shape charge does not craft into a tunnel shape charge (Bap me if its not implemented) HOT 2
- [1.20.1] Certus quartz crystal does not summon a meteor using Mark of Fallen Tower HOT 2
- HUD location adjustments not saved by default
- [1.18.2] [Feature] Dispensers should throw soul snares
- [1.20.1] Bug or mod interaction issue with Str buffs and Dagger of Sacrafice causig no LP generation at alter HOT 5
- ritual diviner dusk
- No texture HOT 1
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 bloodmagic.