Coder Social home page Coder Social logo

Comments (6)

biscuut avatar biscuut commented on June 15, 2024 2

Yeye will be adding slot locker in next update

from skyblockaddons.

fsckmc avatar fsckmc commented on June 15, 2024

I wrote a way to disable inventory drag + dropping of ItemStack's that have a lore containing a rarity of a certain amount, the UI framework you use doesn't seem to support dropdowns, so currently it's a very hacky /sba setrarity {1,2,3,4,5} etc.

Happy to push it to my fork and submit a PR, unless you'd rather implement it yourself, I'm slightly concerned about WatchDog detecting it though, I'm not sending any custom packets but it's not clear atm if the InventoryDragEvent is client side, so cancelling it won't cause WatchDog to see an anomaly. I joined the discord, would love to chat more about this.

from skyblockaddons.

ViralTaco avatar ViralTaco commented on June 15, 2024

@fsckmc
To be honest I'm not a fan of the idea, especially since it involves checking strings all the time. There is already too much of that imho. I play on a laptop. :/
but eh if you have the code you can always make a pull request and just reference the id here

from skyblockaddons.

fsckmc avatar fsckmc commented on June 15, 2024

It only checks strings on a drop event, which happens rarely. I've profiled it and it's not that bad, I haven't added the drop event to the branch yet, due to ItemTossEvent not cancelling properly, I may need to write a custom mixin Injection to handle that.

https://github.com/fsckmc/SkyblockAddons/tree/feature-rarity-detection-antidrop

You can see how I'm checking, also added a small utility "library" to check rarity of items.

Could you elaborate what you mean by "involves checking strings all the time" perhaps I'm missing something. (I also play on a laptop, and writing code that doesn't bottleneck is super important for me)

from skyblockaddons.

ViralTaco avatar ViralTaco commented on June 15, 2024

Could you elaborate what you mean by "involves checking strings all the time"

Sure thing. here is a String "I am a string." here is a method

@override public Boolean equals(String theString) {
    if (theString == null) 
        return false;
    if (theString == this)
        return true;
    if (theString.length != this.length)
        return false;

    char[] theStringAsArray = theString.toCharArray();
    char[] thisAsArray = this.toCharArray();
    for (int i = 0; i < this.length; ++i) {
        if (thisAsArray[i] != theStringAsArray[i])
            return false;
    }
    return true;
}

That method is linear O(n). You no doubt understand the implications.
Here is another example of a linear algorithm: sleep sort

All that being said, the fact that you used the drop event makes this whole passive-aggressive rambling unnecessary… I did work hard on it though, so I put this disclaimer at the end.

from skyblockaddons.

fsckmc avatar fsckmc commented on June 15, 2024

Really not entirely sure what to say other than I guess this may have provided some useful links to people who are interested in algorithms?

from skyblockaddons.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.