Code Monkey home page Code Monkey logo

customblockdata's Introduction

Metrics

customblockdata's People

Contributors

foodcans avatar mcrtin avatar mfnalex avatar sirsalad avatar the-epic avatar traquolix avatar wizardlybump17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

customblockdata's Issues

Data not clearing when CustomBlockData#clear is called.

I am attempted to clear all the blockdata for certain blocks that previously had data set in them, however I did some testing and it seems that after calling the clear method, all of the values are still there and persisting in the chunk.

code where i clear it:
System.out.println("Clearing data");
jukeboxData.clear();
System.out.println("Is data empty: " + jukeboxData.isEmpty());
System.out.println("UUID key: " + jukeboxData.get(Keys.OWNER, new UUIDDataType()));

output:
[13:21:05] [Server thread/INFO]: Clearing data
[13:21:05] [Server thread/INFO]: Is data empty: false
[13:21:05] [Server thread/INFO]: UUID key: 2357f9da-38ee-49ad-a1f1-2440199000ef

ADD ON readme the

pros of which is high memory usage if using it on a lot of blocks
it's a new HashMap<>() for every single block, developers don't usually see it this way
and this will cause extremely high memory usages, since this is a library it's good to show them that it's not "good" to use on thousands of blocks... (It's a new HashMap<>() for every single block).

IT creates a new persistent data container to every single block that gets set
this means
it'll allocate a keyspace on the map of teh chunk + create a new full key space for each block:
this is how it ends up being like:
Map<NameKey, PersistContainer>

and each perssist data container has a new Map.
image

It would be nice to tell the devs about this, reverting the damage frmo this library if used on a lot of spots it's bad.

Data does not get removed from blocks that are indirectly broken

I've noticed that for blocks like cactus where when the bottom block get's broken all the cactus blocks above break, the data will not get removed from the block and stays there until something is either placed in it's location or it is manually removed. To fix this I suggest getting the cactus blocks above the broken cactus and removing data from them if they have any.

Data does not persist when Block is moved

When using this on 1.20.1, the data does not seem to persist when the block gets moved. I've tried using the example plugin but I cannot seem to build it anymore. The dependency in it's pom is outdated and modifying it to the newer version just causes mismatching imports which I really don't want to fix.

I'm setting the container on a block of TNT, then requesting the data when it gets ignited during the TNTPrimeEvent. The data doesn't end up existing anymore when I retrieve it after it has been moved. When I retrieve it without the tnt moving at all from it's initial location, it still exists.

Code I use to set the data. I have confirmed this code is ran to set it.

val container = CustomBlockData(bukkitBlock, MissileWars.instance)
val key = NamespacedKey(MissileWars.instance, "owner")
container.set(key, PersistentDataType.STRING, user.player.uniqueId.toString())

Code I use to retrieve the data

@EventHandler
private fun onEntityIgnite(event: TNTPrimeEvent) {
    val block = event.block
    val container = CustomBlockData(block, MissileWars.instance)
    val key = NamespacedKey(MissileWars.instance, "owner")
    if (!container.has(key)) {
        return
    }

    val owner = container.get(key, PersistentDataType.STRING)!!
    // Additional code not relevant here
}

Shadowing Doesn't work

Not sure if this is from the library itself or just my bad maven skills, but pasting all the shadowing/repo/dependency stuff and changing it doesn't seem to want to actually shadow. In IntelliJ, the IDE recognizes the dependency, but after building, I get the NoClassDefFound error. My guess is its just an IntelliJ setting, but still making the issue just in case

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.