Code Monkey home page Code Monkey logo

Comments (4)

boy0001 avatar boy0001 commented on July 17, 2024

I'm not sure if that's the issue. The default behavior has the block as air if it's null:
https://github.com/sk89q/WorldEdit/blob/master/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java#L122-L133

So as long as you don't set the same location twice, it should work?

from fastasyncworldedit.

filoghost avatar filoghost commented on July 17, 2024

But that is the method to obtain the block, not to set it. I'm not setting it twice, but the clipboard was loaded from disk. Anyway it should be fixed now, thanks.

from fastasyncworldedit.

boy0001 avatar boy0001 commented on July 17, 2024

The clipboard is just a holder of information, it can be backed by whatever data structure I choose. For example, the DiskOptimizedClipboard uses a RandomAccessFile to store the information instead of a byte array. What's important is that getting the block at the location in the clipboard returns the value that you set.

The fix I pushed only changes the behavior to account for setting the id at a location twice, it doesn't create a new array at the index if there wasn't one already there. My point being that it can be redundant to set it to air when the default return value is air.

from fastasyncworldedit.

filoghost avatar filoghost commented on July 17, 2024

Yes it's redundant to set air when the default value is air, but the code doesn't appear to check if the original value is really air. I was having problems changing a solid block to air.

from fastasyncworldedit.

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.