#help-development

1 messages ยท Page 60 of 1

round finch
#

yeah i did that before

rare flicker
#

what did it give you?

#

OOOHH

round finch
#

Strings

rare flicker
#

you wanna convert it back

round finch
#

i need the item

rare flicker
#

create a new YAMLConfiguration from each string

#

and use getItemStack

wraith apex
#
config = YamlConfiguration.loadConfiguration(new File("this/is/where/config/file/is/config.yml"));
round finch
#

my config work is fine

wraith apex
#

aight

round finch
#

just neeed to get content

#

so i can set it to a inventory

rare flicker
#

gimme a sec

wraith apex
#

idk what the ==: is for

#

next to org.bukkit.inventory.ItemStack

#

unless that's using the serialiser?

rare flicker
#
        YamlConfiguration configuration = null;
        List<String> StringList = configuration.getStringList("Enderchest");
        for(String string : StringList) {
            YamlConfiguration stringBlob = YamlConfiguration.loadConfiguration(new CharArrayReader(string.toCharArray()));
            ItemStack it = stringBlob.getItemStack("");
        }
#

something along theses lines

hushed pawn
#

what is better for scoreboard?

rare flicker
wraith apex
#

oh

#

fairs

rare flicker
round finch
#

maybe getStringList

use String to getItem?

#

1 sec

rare flicker
#

also found a flaw

#

theres a StringReader

#

so

YamlConfiguration configuration = null;
List<String> StringList = configuration.getStringList("Enderchest");
for(String string : StringList) {
    YamlConfiguration stringBlob = YamlConfiguration.loadConfiguration(new StringReader(string));
    ItemStack it = stringBlob.getItemStack("");
}
sullen current
#

hi, i have a question... can i use a normal sleep command to make a waiting time in a action of my plugin?

eternal oxide
#

never on the main thread

ancient plank
#

throwback to "why my server crashing? I use Thread.sleep(900000000) to get wait"

vocal cloud
#

Sleeping the main thread so it can take a break

arctic moth
#

what event should i use for when a player obtains and item?

#

whether that be through crafting, smelting, etc.

#

InventoryItemPickupEvent doesn't have a getPlayer function

river oracle
rare flicker
arctic moth
#

ok

bronze bison
balmy valve
#

Anyone know why Im getting this error?
This is the code for the packet listener:

        protocolManager.addPacketListener(new PacketAdapter(this, ListenerPriority.LOWEST, PacketType.Play.Client.USE_ENTITY) {

            @Override
            public void onPacketSending(PacketEvent event) {
                Player player = event.getPlayer();
                Entity interacted = protocolManager.getEntityFromID(player.getWorld(), event.getPacket().getIntegers().read(0));

                if (spiritEntityManager.getCustomClass(interacted, null) != null) {
                    event.setCancelled(true);
                }
            }
        });
ancient plank
#

?paste

undone axleBOT
balmy valve
#

Im just le very confused

#

I just dont get this error

river oracle
boreal sparrow
#

Where should i put default values, like in the onEnable, and then extend it to another class?

quaint mantle
#

i have a class with a deserialization method that gets a location from config. it gets the information on server start.
im getting this error: java.lang.IllegalArgumentException: unknown world

#

not sure how to fix

eternal oxide
#

you can;t create a Location for a world that is not yet loaded

crisp kiln
#

i found this thread, https://www.spigotmc.org/threads/custom-sheep-crashing-the-server-on-spawn.512870/ which was exactly what my problem was but i don't exact get what the OP means by "but I renamed the "initPathfinder" and it works!" because isn't the point of naming the function initPathfinder so that the super's initPathfinder get's overrided and instead we set our pathfindergoals in our class? (ping when respond please!)

quaint mantle
#

bro wait

#

my brain

#

brb

#
        LootpoolObj b = new LootpoolObj((String) d.get("name"), (Double) d.get("dropChance"), (Integer) d.get("delay"), (Integer) d.get("radius"));
        HashMap<ItemStack, Double> i = (HashMap<ItemStack, Double>) d.get("drops");
        b.setLocation((Location) d.get("center"));
        b.start();
        for(Map.Entry<ItemStack, Double> e : i.entrySet()) {
            b.addDrop(e.getKey(), e.getValue());
        }
        return b;
    }

    @Override
    public Map<String, Object> serialize() {
        Map<String, Object> s = new HashMap<>();
        s.put("name", name);
        s.put("dropChance", dropChance);
        s.put("delay", delay);
        s.put("center", center);
        s.put("radius", radius);
        s.put("drops", drops);
        return s;
//        return null;
    }```
ive got this running on a sync bukkit task for 0 ticks (which i believe should run once the worlds are loaded)
boreal sparrow
arctic moth
hasty prawn
#

Good deal honestly

arctic moth
#

ikr

#

you have no idea how much grinding it takes for those ingots btw

#

i made it so you have to smelt the shard thingy for 10 minutes to get one nugget

#

and you need 9

#

to get one ingot

#

i love trolling

hasty prawn
#

10 minutes LOL

quaint mantle
#

idk how to fix that though

minor fox
#

Does anyone have experience with grafana?

quaint mantle
#

have u registered the event?

minor garnet
#

yes -__

quaint mantle
#

sorry iw as just checking

#

๐Ÿ˜„

opal sluice
#

Anyone has a clue about this?

desert frigate
#

Would it be possible to make it so hoppers that are under a chest, can't take items from the chest?

desert frigate
#

Awesome

#

ty

strong parcel
#

Is there a way I can simultaneously change the Material Type of a list of blocks? I am currently trying to replace a pool of water with air by iterating through the list, but it seems like the water replaces itself before all of it is removed. https://paste.md-5.net/hoqafocoha.cs

eternal oxide
#

setType(Air, false)

strong parcel
#

Oh, I will give that a shot. Are there any potential unwanted side effects from canceling the physics on the air block?

shy rock
#

Does it have to be implements listener for item pool to work?

#

all good

#

heyy new day

compact haven
#

huh

carmine nacelle
torn shuttle
#

Is there any long-standing api that does pathfinding goals?

tulip owl
#

Why does everyone use Gradle? Iโ€™ve always used Maven so Iโ€™m just interested ๐Ÿ™‚

eternal night
#

caching is interesting especially in regards to NMS

#

beyond that, having the ability to just code whatever you want in your build script is pretty nice

tulip owl
#

I see, is the syntax much harder?

tulip owl
wet breach
#

it is just done differently is all

quiet ice
round finch
#

spigot get item name without legacy?

tulip owl
wet breach
#

you can make any custom maven plugins that do whatever you really want it to do

quiet ice
tulip owl
wet breach
#

I didn't say it was hard to make a maven plugin

#

it is really simple

quiet ice
#

As simple as using their maven resolver?

#

If so then "simple" is an exaggeration

wet breach
quiet ice
quaint mantle
#

bro how do i fix this. I literally did what minimessage said to-do. Im also on a Paper build

wet breach
#
<dependencies>
    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-api</artifactId>
        <version>3.6.3</version>
    </dependency>
    <dependency>
        <groupId>org.apache.maven.plugin-tools</groupId>
        <artifactId>maven-plugin-annotations</artifactId>
        <version>3.6.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-project</artifactId>
        <version>2.2.1</version>
    </dependency>
</dependencies>

these are the only dependencies you need to make a maven plugin.

quiet ice
#

0 (useable) documentation, 100% enterprise-level

wet breach
#

there is no requirements to have your custom maven plugin hosted on maven central either unless you are intending to share it

#

but even then, don't need maven central to share it either just makes it easier to do so

tulip owl
ivory sleet
wet breach
ivory sleet
#

Gradle, just write it out, nothing needed other than that

#

It is less flexible in my experience

quiet ice
ivory sleet
#

It isnt

wet breach
#

You are not limited in what you can or can't do in a maven plugin as its a programming language you are writing in. Java.

#

From Java, you can invoke literally anything and only limited by your abilities and creativity

quiet ice
#

That may be true but I doubt that you want to use the Unsafe class just to circumvent shoddy API

#

Writing something in java doesn't necessarily mean you can manipulate other programs to do something you want to

wet breach
#

shouldn't need to use Unsafe and not sure what shoddy API you would be referring to

ivory sleet
#

Myes, but gradle becomes easier to bend, or adjust at will at any moment, as you have to rewrite a plugin sometimes in order to change behavior thus requiring recompilation (maven) , gradle has its api, ready to go which with groovy or preferably kotlin dsl becomes way more accessible, flexible and convenient for that part

wet breach
#

Java has a native interface

quiet ice
wet breach
ivory sleet
#

So?

#

It doesnt deduct the fact that gradle is way more accessible to arbitrary and powerfully impactful configurations

tulip owl
wet breach
quiet ice
ivory sleet
rapid aspen
quiet ice
#

Also the api vs implementation/providedApi vs provided scopes are another neat main selling point (though that falls under deployment again)

alpine urchin
#

mfw using kotlin

wet breach
quiet ice
eternal night
#

did I miss a maven update

ivory sleet
#

The entire step of having to write a maven plugin as an extra, additional go makes it less accessible and somewhat inflexible, but yeah it would be possible to add scripting to maven in which I guess the difference would be even less significant (theoretically at least)

quiet ice
#

If so public static HashMap<Player, Player> tpa = new HashMap<>(); is an immediate red flag as what do you want to do if a player disconnects?

wet breach
eternal night
#

wat ?

glossy lily
#

how does someone import a world from singleplayer into a world that can be copied via spigot

eternal night
#

what arbitrary code can you define in your pom.xml

rapid aspen
wet breach
eternal night
#

LOL

quiet ice
#

You can even define custom maven plugin repos

inland axle
#

what should I be using instead of AsyncPlayerChatPreviewEvent?

quiet ice
#

that event is already deprecated?

#

?jd-s

undone axleBOT
quiet ice
#

Ah no, it's just draft API

ivory sleet
#

Its draft api iirc

#

Yeah

inland axle
#

org.bukkit.event.player.AsyncPlayerChatPreviewEvent is deprecated

eternal night
#

might just be my opinion then but a custom maven plugin that has to be compiled and published in order to work cross devices is so far off from the arbitrary code definitions you can do in gradle it is laughable to compare the two

quiet ice
#

Why the hell is draft API in production

ivory sleet
#

One of the deprecation moments, but not for removal

eternal night
#

to collect feedback ?

river oracle
glossy lily
#

importing a singleplayer world and then trying to call GetWorld on the name of said world just returns null

wet breach
inland axle
eternal night
#

you cannot include your maven plugin in the repo directly can you ?

quiet ice
#

We are waiting years for the material rewrite which has been drafted but not put in production yet this draft API goes to prod instantaneously? The spigot team is built out of a bunch of clowns huh

eternal night
#

like gradles build-src

ivory sleet
eternal night
#

ah so you code up an entire plugin

#

and then compile that as part of your pipeline ?

river oracle
glossy lily
eternal night
wet breach
# eternal night and then compile that as part of your pipeline ?

you could if you wanted to, but typically you would have your plugin compiled before hand. However, as far as where you can put it to be accessible, literally anywhere as long as you are able to tell maven where it is at, or you could just manually include it. That is download it and toss it into your maven repo

eternal night
#

I mean, if I have to download a custom compiled maven plugin from some github repo for a project to compile

#

that is kinda the end of it

wet breach
#

oh so you don't use specialsource?

eternal night
#

having it as part of the project to auto compile or publish it to a maven repo seems to be the only usable options omi

wet breach
#

because that is a custom maven plugin

eternal night
#

which is published to a maven repo ?

eternal night
#

also no lol I do not use special source

wet breach
#

but you do with buildtools

eternal night
#

but I don#t use build tools

#

tho that is all besides the point tbh

wet breach
#

Anyways point being, yes specialsource has a maven repo, and most custom plugins for maven typically have their own maven repo or are on maven central and that is if you want to share it

quiet ice
#

It is easy to use custom repos for maven plugins

    <pluginRepositories>
        <pluginRepository>
            <id>apache-snapshots</id>
            <url>https://repository.apache.org/content/repositories/snapshots/</url>
        </pluginRepository>
    </pluginRepositories>
wet breach
#

if your plugin isn't intended for everyone else, then it doesn't really matter

eternal night
#

Yea, that is the point I am on

#

if I just wanna do a small piece of custom code logic in my build pipeline

#

maven sucks hard compared to gradle

#

which, that is usually the amount of custom logic you need

#

everything beyond that is a proper plugin which, both maven and gradle, keep those published in proper maven repos

wet breach
eternal night
#

that sounds like the hackiest solution possible

wet breach
#

Buildtools does it just fine

#

most just don't realize it

quiet ice
#

so that is why BT is so unstable?

wet breach
#

in what way is it unstable?

quiet ice
#

People (as in complete strangers) over at #spigot ask for help concerning BT not working all the time

eternal night
#

I mean, idk if I'd personally show off build tools as "look up easy custom code is in maven"

wet breach
#

and then the other small percentage is because of the git library that is the only decent one to use occasionally encounters problems

#

and then the rest is because their internet sucks

eternal night
#

Welp /shrug, if you wanna actually argue that custom logic in build scripts is as easy in maven as in gradle, I don't think a discussion on this is worth much

#

idk why build tools still exists, paperclip is just

#

like better in every way ?

wet breach
#

it isn't. BuildTools is to maven as paperclip is to gradle

eternal night
#

neither of them have anything to do with build tools

wet breach
#

You missed the analogy then

quiet ice
#

I mean it probably is concerning that gradle uses a more or less custom programming language for scripting

eternal night
#

I might have, unless your point was "build tools is outdated bloated and slow like maven whereas paperclip is faster, more convenient like gradle"

wet breach
#

paperclip does what buildtools does, just differently. You could view it as being better but it does have drawbacks

#

one of the drawbacks is making it more difficult to code against

eternal night
#

Have you compared the two setups for NMS ? xD

quiet ice
#

paperclip and bt were more or less written for two different purposes

wet breach
eternal night
#

Well bloated might be wrong term

#

does useless stuff might be better

wet breach
#

what useless stuff does it do?

#

everything it does is required o.O

eternal night
#

patching and building the entire server is not needed

#

as seen in paperclip

#

which like, that is the nr 1 reason people use build tools

#

there is a reason pages like getbukit exist

wet breach
#

otherwise you won't have the source including patches

eternal night
#

no you just install a gradle plugin ๐Ÿ˜›

wet breach
#

the difference is that buildtools just goes ahead and does it in the beginning

#

paperclip just does it later on

wet breach
eternal night
#

build tools doing so ahead is a pretty not clever decision

wet breach
#

it is simple and easy

#

that is the intended goal

dim bronze
eternal night
#

Maybe you are not around often enough for the people that think it isn't easy enough and end up on illegal pages like getbukit

quiet ice
#

at least for a sizeable portion of projects

eternal night
#

tbf, I do have my fair share of maven project xD

wet breach
quiet ice
#

And for some things gradle is unusuable

eternal night
#

still work well, at least you don't have to update maven every other week lol

wet breach
#

until I encounter that reason, I stick with maven and it hasn't let me down yet

quiet ice
#

Want to deploy your artifact to a maven repo using ftp? Not possible. Using ssh? Nope

dim bronze
#

That joke seems to have caused a ruckus. whoops

wet breach
quiet ice
#

Not anymore

wet breach
#

you need to use the wagon plugin

iron glade
#

Guys, might be a dumb af question, but in onCommand I return true by default, would I return true after specific parts too to exit the code?

dim bronze
quiet ice
wet breach
dim bronze
#

most plugins aren't managed by gradle?

wet breach
quiet ice
iron glade
#

Alright thanks guys, was something I haven't really thought about yet

quiet ice
#

Return true if not

iron glade
#

yeah I don't want that message to pop up that's why I always return true

quiet ice
#

That litterally is the only purpose of the boolean

dim bronze
wet breach
quiet ice
#

Though ideally you wouldn't want to ALWAYS return true

wet breach
quiet ice
#

https'post or something like that

round finch
#

i'm saving Item names but they're wrong!

how to fix legacy?

wet breach
#

it can use https, ftp, ftps, ssh

iron glade
wet breach
#

otherwise you are just wasting resources on unnecessary checks

iron glade
#

yeah that's what I was worried about

quiet ice
wet breach
#

that is just weird for gradle not being about to do that

#

lol

#

even more of a reason for me to stick with maven ๐Ÿ˜›

dim bronze
#

I mean seeing as the script files for grade are just groovy/kotlin you could always handle it manually

eternal night
#

pretty sure I have seen plugins for that too, but eek

dim bronze
#

I just feel like gradle is a lot more obvious what it's doing

eternal night
#

Welp does not matter

vocal cloud
#

Gradle is great cause you can do anything with it really

eternal night
#

in the end, personal subjective decision

dim bronze
#

of course

#

because it's the standard for kotlin I just got used to it and never looked back

wet breach
#

as we just explained above

#

both do it differently

round finch
dim bronze
#

but you can't just write your logic in xml, you'd have to write a separate maven plugin to do what you want and use that (afaik)

wet breach
#

maven can also invoke ant as well, which is a build script language

#

and there is already a maven plugin for ant

eternal night
#

maven can also invoke bash, which is also a language so

#

checkmate

dim bronze
#

what if windows

wet breach
#

yep it definitely can

wet breach
eternal night
#

the straight forward way

dim bronze
#

what if no git-bash / cygwin ๐Ÿ™ƒ

eternal night
#

just write windows compatible bash

wet breach
#

then they are not a developer then and shouldn't be messing with maven anyways

dim bronze
#

okat now I'm trolling

eternal night
#

LOL

dim bronze
#

I'll be quiet

eternal night
#

literally trolling

strong parcel
# eternal oxide setType(Air, false)

Thanks! That works for removing the water in the specified blocks. However, when the water gets placed, even though I use .setType(Material.Water, false) , the water flows normally. The water that flows out of the zone doesn't get removed. I have been trying to cancel the BlockFromToEvent for blocks inside the flood area, but I haven't been able to figure out how to get the list of blocks from the command to the event handler.

obsidian drift
#

In plugin.yml, if you depend on a plugin, will this plugin be disabled before the dependency?

eternal oxide
#

if you want to affect the flowing water you have to enable physics

strong parcel
#

I am trying to prevent the water from flowing.

eternal oxide
#

or you search for connected water, not just source blocks

strong parcel
#

I am worried that if I search for connected water, it could lead to the plugin trying to delete an ocean or something.

#

So you're saying that if I want to stop the water from flowing, I have to enable physics?

eternal oxide
#

No, if you want to affect water which is already flowing, you have to allow physics when you remove its source block

#

to prevent water from beginning to flow, you replace/place it with no physics

strong parcel
#

Okay, I am trying to stop it from beginning.

eternal oxide
#

then do everything with no physics

#

place with no physics = no flowing

strong parcel
#

The water on top of the trees does not flow, but the water that spawns on the ground does flow.

eternal oxide
#

I've never had any issue spawning static water anywhere

strong parcel
#

I will link a video

eternal oxide
#

odd

strong parcel
#

Should I send all my code?

eternal oxide
#

there is an event for water flowing but I can;t remember the name of it

#

I don;t think its teh spread event

#

listen for any of your blocks triggering that event

wet breach
eternal oxide
#

nah not physics

#

FromTo is pretty much for water/lava spreading

round finch
#

oh he mean state

#

?

strong parcel
#

I have been trying to cancel that event for blocks in the flood zone, but I am having an issue getting the list of blocks to the event handler.

eternal oxide
#

you add them to a List so just DI

strong parcel
#

What is DI?

eternal oxide
#

?di

undone axleBOT
eternal oxide
#

as its all in one class you don;t need DI

strong parcel
#

Okay

eternal oxide
#

all you need do in the event is java if (block_list.contains(event.getBlock())) event.setCancelled(true);

strong parcel
#

Do you think there is an issue with the current if statement I have there?

#

I don't think the block list is getting into the event code block because "Water flow cancelled" never fires.

eternal oxide
#

does water flow detected?

strong parcel
#

Yes

eternal oxide
#

then your blocklist is empty

#

as yoru sysout for cancelled is not included in the if condition so it shoudl print for every block

strong parcel
#

I donโ€™t know how to get the full blocklist out of the scope of the command and into the event

eternal oxide
#

its already a field

#

so long as that event is exactly as it shows in teh paste

#

do you register it as a CommandExecutor and a Listener?

severe turret
#

first of all

#

he wants to do something with blocks in the flood zone

#

so you want a map ig

eternal oxide
#

no

#

teh List is just fine

severe turret
#

no?

strong parcel
#

The class implements CommandExecutor and Listener, and it is registered as an event and a command in main

eternal oxide
#

ok

crisp forum
#

I'm trying to send PacketPlayInBlockPlace but I don't know what is it's fields (using Protocollib) where can I find it?

severe turret
#

You want to use separate classes for different functions

#

a CommandExecutor should only hold the command

#

then you get a Map of Blocks and their Location

eternal oxide
#

yes, but he shoudl get it workgin first. Before he goes worryign about single responsibility

severe turret
#

and you check if a block and it's location is in that flood zone

#

and then cancel the event

eternal oxide
#

thats not what he is trying to do. He's simply spawning static water and tryign to prevent the blocks from flowing

#

spawning without physics is correct, but I believe he is triggering a physics update when the grass breaks

#

as such he needs to prevent any of the blocks he placed from spreading

#

His List is just fine as a Block is a single instance, it simply points to a Location.

#

all he has to do is ask if teh FromTo block is in his list

#

@strong parcel try using the line of code I showed you in the event

severe turret
#

I really recommend he uses single responsibility, adheres to coding style and camelCase

#

would probably make it easier for himself to diagnose the issue

eternal oxide
#

Working and ugly code is better than broken but pretty

severe turret
#

the problem is when a bug happens

#

try to find it in the ugly code

eternal oxide
#

His code design has nothing to do with his issue

#

He's actually making it simpler to diagnose with it all in one class

severe turret
#

lol

eternal oxide
#

Yep I looked at the video again, the physics event is being triggered when the grass breaks next to the water which is higher than it.

carmine nacelle
#

alright guys I got a dumb question again like usual

#

I need to get all field names of the beehive block I punch

eternal oxide
#

We got lots of dumb answers ๐Ÿ™‚

carmine nacelle
#
                    CraftBeehive craftBeehive = (CraftBeehive) event.getBlock().getState();
                    Class hiveClass = craftBeehive.getClass();

                    for(Field f : hiveClass.getDeclaredFields()) {
                        System.out.println(f.getType() + " " + f.getType().getCanonicalName() + " " + f.getName());
                    }
#

this outputs nothing

#

Now if I output the class name of the Beehive block it just returns CraftBlock, not CraftBeehive

eternal oxide
#

I don't belive getDeclaredFields will get private fields

carmine nacelle
#

but

#

im tryna do stuff with reflection

eternal oxide
#

If i remember there is a different method to get private ones

wet breach
#

anytime something gets modified or triggered, a physics update is triggered for the surrounding blocks/chunk

carmine nacelle
severe turret
#

yo what api is that even

#

I'm looking at spigot javadocs and I can't find any of the methods

carmine nacelle
#

So Iโ€™m just doing it wrong or

severe turret
#

oh it's reflection

#

yeah f that

#

gl

eternal oxide
#

You need the correct class to start

#

You will not read fields in the super class

#

only those in teh class you look at

carmine nacelle
#

Iโ€™ve tried Beehive and CraftBeehive both

#

Both return nothing for declared fields

eternal oxide
#

one sec

#

let me pull up the class

#

?stash

undone axleBOT
carmine nacelle
#

Aight

eternal oxide
#

Correct, CraftBeehive has no fields

#

so class.getSuperclass().getDeclaredFields()

carmine nacelle
#

So use that?

eternal oxide
#

give it a try

carmine nacelle
#

outputs this

[19:43:43] [Server thread/INFO]: class net.minecraft.world.level.block.entity.TileEntity net.minecraft.world.level.block.entity.TileEntity tileEntity
[19:43:43] [Server thread/INFO]: class net.minecraft.world.level.block.entity.TileEntity net.minecraft.world.level.block.entity.TileEntity snapshot
eternal oxide
#

what specific field are you after?

carmine nacelle
#

I need to set the entitycount

iron glade
#

Is intelliJ stupid or am I? It says this method is always inverted

    public boolean hasControlCache(Player p) {

        for (ControlCache c : controlCacheStorage) {

            if(c.getUuid().equals(p.getUniqueId())) {
                return true;
            }

        }
        return false;

    }```
rare flicker
#

is there a way to do something like #PrepareAnvilEvent but for grindstones?

shadow zinc
#

I'm looking for either a sorta convenient way to open a book to collect user data or an api that does it for me

eternal oxide
#

its in the snapshot<Beehive>

carmine nacelle
#

how can you see that?

#

this search thing on the spigot hub sucks

eternal oxide
#

look at teh CraftBehive link I posted

#

look at teh method isFull()

#

it looks at teh snapshot

#

now open the second link I sent

#

CraftBlockEntityState.java

#

its has a field private final T snapshot;

carmine nacelle
#

ok I see that part

#

so then would I need to keep using CraftBeehive?

#

or TileEntityBeehive

eternal oxide
#

well you need the snapshot field

quaint mantle
#

why isn't this working? Im trying to do api.doStuff() but it isn't working

dusk flicker
#

does api exist

quaint mantle
#
public class API {

    public static void doStuff() {
        Bukkit.getLogger().log(Level.INFO, "ew");
    }

}```
dusk flicker
#

does doStuff exist

eternal oxide
#

which is a TileEntityBeehive

quaint mantle
#

yes

carmine nacelle
# eternal oxide well you need the snapshot field

which would be TileEntity

    public CraftBlockEntityState(World world, T tileEntity) {
        super(world, tileEntity.getBlockPos(), tileEntity.getBlockState());

        this.tileEntity = tileEntity;

        // copy tile entity data:
        this.snapshot = this.createSnapshot(tileEntity);
        this.load(snapshot);
    }
#

yeah

eternal oxide
#

TileEntityBeehive

dusk flicker
#

'api'

quaint mantle
carmine nacelle
#

which would be the blockstate

dusk flicker
#

its static

#

?learnjava

undone axleBOT
quaint mantle
#

ik java

dusk flicker
#

not enough

quaint mantle
#

the stupid tutorial

dusk flicker
#

?learnjava!

shadow zinc
#

use do API.doStuff()

undone axleBOT
shadow zinc
#

bro he jerking off java

carmine nacelle
#

TileEntityBeehive cannot be cast to CraftBeehive @eternal oxide

eternal oxide
#

no

#

its not the same thing

#

teh snapshot field IS a TileEntityBeehive

carmine nacelle
#

but I need to get that somehow

eternal oxide
#

You should be able to cast CraftBeehive to CraftBlockEntityState

#

then you can getDeclaredFields()

severe turret
#

it's just a warning

carmine nacelle
#

@eternal oxide

 Beehive hive = (Beehive) event.getBlock().getState();
                    CraftBeehive craftBeehive = (CraftBeehive) hive;
                    TileEntityBeehive tileEntityBeehive = craftBeehive
severe turret
#

so every time you call it you use it with !

#

that's about it

sterile token
iron glade
carmine nacelle
#

I only see #getSnapshotNBT

shadow zinc
severe turret
#

instead of have it

#

since you're always using it like that

eternal oxide
#

TileEntityBeehive is NMS

carmine nacelle
# eternal oxide Sorry `CraftBlockEntityState`

so

                    Beehive hive = (Beehive) event.getBlock().getState();
                    CraftBlockEntityState entityState = (CraftBlockEntityState) hive;

                    for(Field f : entityState.getClass().getDeclaredFields()) {
                        System.out.println(f.getType() + " " + f.getType().getCanonicalName() + " " + f.getName());
                    }
```?
#

nothing still

eternal oxide
#

no clue then, I don;t have an IDE open

carmine nacelle
#

shit

eternal oxide
#

thats definitely the class you need as thats where the snapshot field is

shadow zinc
#

no ide(a)?

eternal oxide
#

Why are you tryign to access a field via reflection again?

carmine nacelle
#

cause there isnt a set method exposed

#

there is a hive#getEntityCount but no hive#setEntityCount

shadow zinc
carmine nacelle
eternal oxide
#

yeah you won;t be able to set teh count no matter what, They are actual entities being stored

shadow zinc
#

damn I didn't know it was so hot

carmine nacelle
#

was told id have to use reflection

eternal oxide
#

yes but it references actual stored entities

carmine nacelle
#

they arent actually stored

eternal oxide
#

no?

carmine nacelle
#

nah

#

when a bee enters that number increments by 1

#

so 1 bee, enters 7 times

wooden cedar
#

how to spawn Particle.REDSTONE? it is not working as the other ones

carmine nacelle
#

boom, "7" "bees" "stored"

eternal oxide
#

I thought it stored teh actual entity with its PDC and everything

carmine nacelle
#

not this

#

every time a bee exits it gets a new uuid

#

So I have this hive, a bee has entered 3 times

#

and it says 3 bees belong to it

eternal oxide
#

private final List<TileEntityBeehive.HiveBee> stored = Lists.newArrayList();

#

thats the NMS

carmine nacelle
#

๐Ÿคท

eternal oxide
#
    public boolean isFull() {
        return this.stored.size() == 3;
    }```
#

there is no actual int you are looking for

#

its an array

#

that isFull methodf is also bad code

carmine nacelle
#

all I know is.... once the same bee enters 7 times (my max entities that I have set), it doesnt let the bees enter anymore

severe turret
#

dont bees just stop existing the moment they enter

eternal oxide
#

there is a constant in teh class for public static final int MAX_OCCUPANTS = 3;

severe turret
#

I remem someone talking about it

carmine nacelle
eternal oxide
#

Not looking at teh nms, it actually stores the bee

carmine nacelle
#

@eternal oxide beehive.setMaxEntities

#

its normally less but I set it to 7 or whatever

#

so I can have 7 enter

#

but only once..

#

cause each time one enters it increases the number

shadow zinc
#

Vivian what icons are you using?

carmine nacelle
#

atom material icons

#

oh wait

shadow zinc
#

thought so

carmine nacelle
#

i might be dumb

eternal oxide
#

actually I'm wrong, it stores a new set of data, not teh actual bee that entered public void storeBee(NBTTagCompound nbttagcompound, int i, boolean flag) { this.stored.add(new TileEntityBeehive.HiveBee(nbttagcompound, i, flag ? 2400 : 600)); }

carmine nacelle
#

well i am for sure but..

#

im cancelling them from spawning and spawning my own entity instead

#

kinda edging the hive

#

so i guess they stay stored forever..? idk

#

so maybe instead of cancelling the spawn I need to let them spawn but despawn them right away...?

eternal oxide
#

let them spawn and kill them

iron glade
shadow zinc
#

ah yes

round finch
#

opening your own inventory?

shadow zinc
#

You could recreate that easily, but idk if there is a buggy way of doing it

#

Idk if I'm mentally-impaired (apparently the other word violates guidelines) or bad at organizing my code by I can't find a class of mine for the life of me. Is there a way to search for classes in intellij?

dusk flicker
#

Ctrl N

shadow zinc
#

Thank you, thats actually so good

dusk flicker
#

No problem; IntelliJs search system is nice

carmine nacelle
#

yep that was the issue...cancelling the spawn was making it so the stored amount never went down.

round finch
#

sorry i'm a little confused
what you making?

shadow zinc
#

Like 68 specifically

#
                InventoryGUI newPage = InventoryUtil.createInventoryGUI(null, getSize(), title);
                if (pagesInheritParentSettings) {
                    newPage.setPagesInheritParentSettings(true);
                    if (openOnClose != null) {
                        newPage.setOpenOnClose(openOnClose);
                    }
                    if (unregisterOnClose) {
                        newPage.setUnregisterOnClose(true);
                    }
                }```
#

It's not bad, I just want to make sure that I'm not dishonoring myself.

carmine nacelle
#

actually nope that didnt fix it.

#

fuck

shadow zinc
#

why can you say fuck but not retort

arctic moth
#

just to annoy people

round finch
#

troll paintrollpain

arctic moth
round finch
#

:)

#

fun minigame

arctic moth
shadow zinc
#

Mojang wins in annoying development ideas tbh

#

get on their level

round finch
#

cough fireflies

iron glade
shadow zinc
#

bans

iron glade
#

Maybe I should just prevent people from running the command on themselves

round finch
#

it doesn't make sense to look at your own player inventory

#

you can litterally press e

iron glade
#

ikr

round finch
#

๐Ÿคฃ

iron glade
#

idk why I didn't include that simple check back then lmao

#

but funny to see that some people used the command like that and even reported it xD

arctic moth
round finch
#

i thought about p == p?

shadow zinc
#

Now you're getting it

round finch
#

but ye ignoring / skip

sounds a good idea

round finch
#

hahaha

#

must pain full game mode

#

@arctic moth i gotta each other idea
make stamina

#

the lower
the slower you're

cold tartan
#

ik that there are class names available like from the screenshot, but nms doesn't have them. is there a way to get nms with class names?

#

ss from a liveoverflow video btw

delicate lynx
#

use buildtools to make a remapped jar

cold tartan
#

how do i do that?

#

oh nvm got it

#

--remapped

#

i have another question

#

is there a way to use nms with paper?

vocal cloud
#

Yup

worldly ingot
#

ยฏ_(ใƒ„)_/ยฏ

#

We're not Paper

cold tartan
#

oh shoot

#

srry

vocal cloud
#

We're Saper

cold tartan
#

lol

round finch
deft axle
#

What event does using a goat horn call?

reef lagoon
cold tartan
#

good bot

lime moat
#

How could I make a check determining what the item is? java ItemStack item = player.getInventory().getItemInMainHand();

reef lagoon
arctic moth
#

Oh

#

It's basically hunter though

lime moat
#

Could you explain that a bit more? I was assuming something as simple as this: java if (player.getInventory().getItemInMainHand().equals(Material.AIR)) {

lime moat
#
if (player.getInventory().getItemInMainHand().getType().equals(Material.AIR)) {``` so this?
drowsy helm
#

Yeah

lime moat
#

Thank you!

twilit wharf
#

I want to create a custom mob, and I need it to attack all hostile mobs. I was thinking using a zombie, but I wasnt sure how to make it not attack the other custom mobs like itself. I would eventually retexture them so that they arent zombies. Any ideas on how I would go about doing this? (Version 1.19.2)

tulip nimbus
#

if (player.getInventory().getItemInMainHand().getType() == Material.AIR) { as == is null safe

lime moat
#

Ah, thank you!

drowsy helm
#

just check if the entity is the correct custom one

#

dont think passing the actual custom entity class in wiould work though

twilit wharf
#

I can check the name of it

#

although players could potentially name the entities

drowsy helm
#

dont base your system off of names

dapper saddle
#

does if it extends Entity, but I doubt you are setting your custom mobs like that

drowsy helm
#

simple

deft axle
#

tags n such

drowsy helm
#

Custom mobs should always extend entity?

twilit wharf
#

I can check if its uuid is the same as any of the custom entities

twilit wharf
drowsy helm
twilit wharf
#

yeah

lost matrix
vocal cloud
#

But custom entities don't persist do they?

twilit wharf
#

how can I get a Mob and a Creature from a Entity, can I just simply cast it? (I googled it, couldnt find anything, I might just suck at googling tho)

drowsy helm
lost matrix
drowsy helm
#

or that

lost matrix
# twilit wharf how can I get a `Mob` and a `Creature` from a `Entity`, can I just simply cast ...

You can cast an entity to a Mob if its an instance of a Mob.
Same goes for every cast. Its like this:

  • You have an abstraction Car
  • In reality, this is a Ford (Which extends Car)
  • You can not cast this Car to BMW because its not an instance of BMW. Its an instance of Ford.
  • So first, check if its an instance of X. If it is then you can safely cast.

Just casting your Object to something more specific without checking first is bad practice.

twilit wharf
lost matrix
twilit wharf
#

Ah, thats cool, I didn't know that. Thanks

#

I was just hovering over classes and looking at the first layer of extensions/implementations

lost matrix
#

IntelliJ can even do more

dusk flicker
#

thats hot

worldly ingot
#

That's one thing I do kind of wish Eclipse would do. I'm sure there's a plugin for it but meh

shadow zinc
#

Eclipse is so good

sterile token
#

Eclipse is so shity

shadow zinc
#

I use it on the daily

sterile token
#

I have use it for more than 2y

#

And compared with intellij, eclipse is shity

shadow zinc
#

Ik

sterile token
#

I would even use VScode over eclipse

shadow zinc
#

Lol

#

sup 7๐Ÿ˜„ 7

lost matrix
shadow zinc
#

I think its a fact at this point

sterile token
#

Lmao

#

Eclipse is shit

shadow zinc
#

Its good for beginners in a sense

sterile token
#

Dont get mad bro i was joking when i reply to you

lost matrix
#

No because tools can be preferenced differently. If its a fact then you can
quantify and prove it. Which you cant.

shadow zinc
#

Sorry, I didn't know you had a thing for eclipse

maiden thicket
#

eclipse isnt shit its preference ๐Ÿ’€

#

its more user friendly

lime moat
#

So I have this: java if (player.getInventory().getItemInMainHand().getType() == Material.SHULKER_BOX) How can I make all shulker box colors be included in that?

lost matrix
shadow zinc
#

I was good for me when I was learning, but as you get into more complicated projects you most likely will benefit from using intellij

sterile token
maiden thicket
#

what

sterile token
#

I can accept others argument but that one one please

maiden thicket
#

u act like its the most biggest piece of shit tool ever

#

๐Ÿ’€

sterile token
maiden thicket
#

thats an opinion

lost matrix
sterile token
maiden thicket
#

if intellij wasnt made i bet eclipse would be heavily used still ๐Ÿ’€๐Ÿ’€

shadow zinc
lost matrix
lime moat
#

Ah, thank you very much!

carmine nacelle
#

Anyone know the import for Spigot 1.19.2? not spigot-api, spigot

#

need nms

lost matrix
carmine nacelle
#

Yes

#

for maven

#

well, version

lost matrix
#

Well... the same as for every version. Just with 1.19.2

carmine nacelle
#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.19.2-R0.1-SNAPSHOT</version>
            <classifier>remapped-mojang</classifier>
            <scope>provided</scope>
        </dependency>

Using this, but its not allowing my nms for some reason.

sterile token
#

You have to build it yourself

lost matrix
carmine nacelle
lost matrix
#

For that exact version

carmine nacelle
#

maybe just need to reboot idea..

shadow zinc
#
cd BuildTools
curl -z BuildTools.jar -o BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
set /p Input=Enter the version: || set Input=latest
java -jar BuildTools.jar --rev %Input% --remapped
pause```
shadow zinc
#

You need to build it with the remapped version for the version you want to use

sterile token
#

He said he already run it ----

carmine nacelle
#

ah shit

#

forgot the remapped flag.

sterile token
#

Ah

#

that why

carmine nacelle
#

thx babe

shadow zinc
#

๐Ÿ’‹

sterile token
#

Also why remapped flag doesnt work on 1.12?

carmine nacelle
lost matrix
sterile token
#

Last weeked i look hundred of spigot thread

#

And i didnt find a solution

lost matrix
#

Because mojang mappings where introduced in 1.17

sterile token
#

OH that why

lost matrix
#

Before that spigot had their own

sterile token
#

Im a idiot

sterile token
#

Or not

lost matrix
#

I dont understand your question. Spigot has their own mappings.

#

Which is what you see when you simply use nms in older versions.

#

Or else everything would be obfuscated.

#

Uhm... spigot has a transitive vulnerability through commons-codec

sterile token
#

Report it to spigot?

lost matrix
#

Well its not too bad. Just blind base32 conversion. So unless the user has a way of writing base32 Strings that get persisted and has information
about the backend implementations, this is pretty negligible.

iron palm
#

is it possible to make a bridge between a spigot plugin & velocity plugin? i cant find any solution

lost matrix
iron palm
lost matrix
iron palm
#

oh

#

i dont have redis so i may use sockets or plugin messaging channel could you describe more about them?

lost matrix
iron palm
#

i'd hope that it works on velocity thanks

lost matrix
#

Yes it should

iron palm
#

yeah it does thanks so much

lost matrix
maiden thicket
lost matrix
ashen quest
shadow zinc
#

I was bullshitting lol

ashen quest
#

capuchino frappechino

#

idk i dont drink coffee

shadow zinc
#

what?

#

No one has commented on my resource ๐Ÿ˜ฆ

sharp flare
#

Is it a good idea of having one connection instance of an sqlite db in a class with static crud methods

drowsy helm
#

idk about the necessity of them being static though

sharp flare
#

Singleton object of the db class

#

Oh nvm I'll do dependency injection

#

Disregard the static above

carmine nacelle
#

Why does this not stop item drops on block break?
event.setDropItems(false);

lost matrix
wet breach
#

its file based

#

hikaricp will let you connect using the lib, but it wont use connection pooling for it

lost matrix
#

Every database is file based in the end. Why do you think that you couldnt have a pool for specifically SQLite?

wet breach
#

yes and no. you cant have mulitple file connections opened for the same file. for read purposes it is possible, but in general the OS doesn't like it

#

the is no server software for sqlite, therefore connection pooling wont work

compact haven
#

he is correct, hikari doesnt support connection pooling with sqlite

lost matrix
#

I mean technically you dont need a connection pool when the db is on the same machine in general because the connection
is established instantly anyways. But i think its good practice to write your code agnostic of the backend.

wet breach
#

you do if you are doing tcp connections even if local

lost matrix
#

So just write it once for SQL and dont worry about the dialect

wet breach
#

however, since java 17 allows linux sockets, if the libs would update to allow that type of connection then you would be correct in that connection pooling won't be necessary

mental lynx
#

Wondering why my mob health is insane in my server.. didn't ever edit it nor do I know how to. Legit didn't change anything and the mobs are 10x as strong as default

lost matrix
wet breach
#

there is if you use tcp

#

not sure where you get the idea that the headers don't exist and all

#

just because it doesn't leave the machine doesn't mean they are not still created

#

now it will be quicker for the OS to process though if you are using the loop back device

lost matrix
#

This is just a tiny bit of data. A few more packets that are not even routed through the NIC. Its directly available between applications.

wet breach
#

if you are using the IP assigned to the machine from the network device

#

then it will go out and hit the network device and then come right back

lost matrix
#

No it wont. All network Layer 3 adresses are locally mapped to the loopback address.

mental lynx
#

Normal

lost matrix
#

Probably one of your plugins then

mental lynx
#

It was fine yesterday, implemented some new plugins and it changed

mental lynx
lost matrix
lost matrix
wet breach
#

I think you mean to say all layer 3 addresses are all mapped to a single layer 2 address per physical interface

sturdy frigate
#

How do I get a serializable value of a Material? is there an ID of some sort? And how can I reacquire it when loading

compact haven
#

I mean you literally have Enum#name() and Material#valueOf

lost matrix
#

Well... if we are speaking about LAN and you have only one NIC then you will also just have one MAC address. Sure.
But even before that. On layer 3, or more specifically IP, the routing table has your IP address mapped to the loopback
address which means it doesnt even bother the network controller but rather keeps the communication on the bus.

compact haven
#

it's an enum, you serialize it the same way any enum is

lost matrix
#

So enum -> String
And String -> Enum#valueOf(String)
Material has a safer method Material#matchMaterial(String) which also supports namespaced keys and doesnt throw an exception

compact haven
#

sure, but valueOf(name()) is guaranteed to work because they're provided (and final iirc) by the Enum abstraction, so no problem in using those over matchMaterial

#

it's not like you're having the user give them to you via a config

wet breach
#

a typical routing table, does not map the loop back device to router assigned ip or vice versa

#

since most systems have one physical device, it is quite common to see multiple layer 3 addresses mapped to the same layer 2 address

compact haven
lost matrix
#

Might be true. But then just use the loopback address when creating a connection ๐Ÿคท

wet breach
#

it is generally advised to use loopback if the connection does not need to leave the system

#

as yes it will cut out some but not all overhead

#

since the headers will still exist and still need to be created as per the protocol requires

compact haven
#

you know that 7smile said there was no network overhead, not that there isn't any protocol overhead

wet breach
#

that is pretty much the same thing

compact haven
#

how

maiden thicket
wet breach
#

because the only additional overhead the network does beyond the protocol, is querying for where to send the packets for the next hop. Other then that, the overhead that is typically referred to is mostly coming from the protocol being used for the connection.

compact haven
#

mm I took it more literally, as in the first part

wet breach
#

TCP has overhead in the creation of the headers, the packet body and padding out the packets to be appropriate sizes. And then once the tcp packet is sent, a response is required

#

if the response isn't received in the configured time for the device

#

it will send those packets again

#

if I remember right, the default typically is 3 retries before failing

compact haven
#

well that's because TCP tries to fix a problem, one that doesn't exist for local connections, but I don't think 7smile was arguing that TCP doesn't have overhead

wet breach
#

well even if the connection is local, the protocol still does the same thing

#

the only difference is that it will be quicker and there shouldn't be failing

compact haven
#

right, because the implementations don't care where the connection is

wet breach
#

if there is you got some major problems XD

compact haven
#

yeah, probably more major than connection optimization xd

wet breach
#
Active Routes:
Network Destination        Netmask          Gateway       Interface  Metric
          0.0.0.0          0.0.0.0      192.168.1.1     192.168.1.71     35
        127.0.0.0        255.0.0.0         On-link         127.0.0.1    331
        127.0.0.1  255.255.255.255         On-link         127.0.0.1    331
  127.255.255.255  255.255.255.255         On-link         127.0.0.1    331
      192.168.1.0    255.255.255.0         On-link      192.168.1.71    291
     192.168.1.71  255.255.255.255         On-link      192.168.1.71    291
    192.168.1.255  255.255.255.255         On-link      192.168.1.71    291
        224.0.0.0        240.0.0.0         On-link         127.0.0.1    331
        224.0.0.0        240.0.0.0         On-link      192.168.1.71    291
  255.255.255.255  255.255.255.255         On-link         127.0.0.1    331
  255.255.255.255  255.255.255.255         On-link      192.168.1.71    291

this is what my routing table right now looks like

#

as you can see, the network assigned ip is not at all mapped to loopback

#

or the loop back mapped to network assigned ip

#

this is the standard routing table for most people, unless you configured it differently with some scripts or the OS you use just does that for you or something

distant wave
#

What is this thing called %count%

lost matrix
distant wave
#

Thanks

#

Lol

lavish folio
#

If I spawn entity in unloaded chunk will be spawned?

balmy valve
#

off the top of my head, no idea, Id just try it and see

strong parcel
lost matrix
lavish folio
#

Thanks

strong parcel
# lost matrix Whats the issue?

I am trying to temporarily spawn static water in a radius around the player. I have tried setting applyPhysics to false when setting the air to water and vice versa, but for some reason some of the water still spreads. To stop the water from spreading, I am trying to cancel the BlockFromToEvent for blocks in the flooded area by iterating through the list of blocks in the area and checking if they are equal to the source block in the event. However, the list of blocks appears empty in the event handler, which means the event handler can't check if the source block is in the flooded area.

lost matrix
lost matrix
# strong parcel https://paste.md-5.net/iwekuxosox.java

Before we continue i would suggest that you fix your style issues first.
Class names are always defined in upper camel case. So a manager for player movement would be named PlayerMovementManager
and your flood class should be named Flood

variables and methods are defined in lower camel case. So a method which kills every player with a helmet should be named
killEveryPlayerWithAHelmet() and your block_list should be named blockList

You can right click the variable or class name and then select "Refactor" > "Rename"

rare flicker
#

Is there an alternative to listening for mob spawning events to naturally spawn in custom mobs?
like adding them to minecraft's spawning queue?

idle loom
#

mapping values are not allowed here

strong parcel
lost matrix
rare flicker
#

Would reflection be any simpler?

lost matrix
lost matrix
strong parcel
#

You can have multiple instances of a class that operate independently of each other, right?

rare flicker
#

let's say i create a custom geyser particle effect

#

the class is sort of like a blueprint

#

whereas an instance is a single geyser

strong parcel
#

Cool, I understand.

rare flicker
lost matrix
# strong parcel Cool, I understand.

I would suggest that you create 3 classes.
A command, a listener and a manager class.
The manager class contains the blockList and each the listener and the command contain the same instance of your manager class.
Thats how you usually do it with everything.

rare flicker
#

^^
point of that is to make sure the manager, listener, and command handler in your code always refer to the same one

strong parcel
#

So the command class would pass the block list to the manager?

rare flicker
#

you can go about it a few ways

  • have a reference of what you want be passed in in the constructor
  • have the main class have a reference to everyinthing and a static reference to itself so it can be accessed anywhere
  • probably a lot of other ways
#

I think the command should essentially tell the manager to spawn a Flood at the sender's location.

#

as for the block list, i usually store a public static list of all instances of Flood so i can access all of the affected blocks. Though i'm not sure if that's good practice

#

it does work though

strong parcel
#

So the flood class would create the block list based on the players location the moment it is initialized?

rare flicker
#

yup

#

organize your code by "responsability"
"would it make sense for flood to handle its blocks?" if so, then Flood should handle it

lost matrix
rare flicker
#

I'm all ears to new perspectives

#

and also one last thing that is sort of unrelated but might help if I understand your case correctly

if the water is purely there for visuals and doesn't need to be actual water, don't use real blocks, use sendBlockUpdate, that way since the water doesn't actually exist it won't be updated, whenver you wanna make it disseapear just call sendBlockUpdate again but with the actual block there

pros :

  • will never grief the world, especially useful for things like chests
  • no need to cancel any events, the water is fake
  • if there is a reload mid-way/crash/bug, the water isnt real so no damage will be done

cons :

  • it's not actual water, but only essentially a collective illusion
    edit :
  • if the block gets clicked, it resets to the real one
strong parcel
#

By the way, you guys have been very helpful. Thank you!

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

someone

#

pls

granite burrow
#

For Particle#FIREWORKS_SPARK is it possible to set the spark color to whatever color I want like a actual firework has?

rare flicker
ashen quest
#

the plugin needs itemsadders but its not installed

granite burrow
rare flicker
#

there is the redstone particle as a "replacement"

granite burrow
#

its too big of a particle :/

rare flicker
#

you cas set a custom rgb color and size to it

#
Wisp.this.bat.getWorld().spawnParticle(Particle.REDSTONE, Wisp.this.bat.getLocation(), 1, 0.05, 0.05, 0.05, 0.01f, new DustOptions(Color.fromRGB(5764863), 3));
#

sample from one of my plugins

strong parcel
quaint mantle
rare flicker
#

the three at the end dictates the size

rare flicker
lost matrix
#
public record Flood(UUID floodId, Set<Location> locations) {

}
public class FloodManager {

  private final Map<UUID, Flood> activeFloods = new HashMap<>();
  private final Set<Location> floodedLocations = new HashSet<>();

  public void addFlood(Flood flood) {
    floodedLocations.addAll(flood.locations());
    activeFloods.put(flood.floodId(), flood);
  }

  public void removeFlood(UUID floodId) {
    Flood flood = activeFloods.get(floodId);
    if(flood != null) {
      floodedLocations.removeAll(flood.locations());
    }
  }

  public boolean isFlooded(Location location) {
    return floodedLocations.contains(location);
  }

}

Ive kept it simpler than i would personally implement it but this is a good start.

rare flicker
lost matrix
#

I wouldnt use any lists in the first place. But yes. The FloodManager should be able to handle mutliple floods.

rare flicker
#

i suppose if the list is only ever accessed to know what blocks to check in the listener that would be better

granite burrow
strong parcel
#

Thanks!

boreal seal
#

is HikariCP is the best sql library out there?

lost matrix
#

HicariCP is not an SQL library

#

technically its a jdbc library

#

A connection pool to be precise

lost matrix
ashen quest
#

did someone just say

#

HIBERNATE ๐Ÿ˜

boreal seal
#

gonna check out hibernate

ashen quest
#

man its just so good

boreal seal
#

tbh i just want get lost of all the boilterplate code

#

like the connection and shit

#

u know

#

so i will have only to add commands

#

and create tables that i need

sturdy frigate
#

Hey guys, I have this in my pom.xml

            <groupId>com.sk89q.worldedit</groupId>
            <artifactId>worldedit-bukkit</artifactId>
            <version>7.2.12</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.sk89q.worldedit</groupId>
            <artifactId>worldedit-core</artifactId>
            <version>7.2.12</version>
            <scope>provided</scope>
        </dependency>```
But I'm not able to access classes like `EditSession` and `BukkitAdapter` am i supposed to download a different artifactId?
lost matrix
sturdy frigate
#

This right? <repository> <id>sk89q-repo</id> <url>https://maven.enginehub.org/repo/</url> </repository>

#

yep

idle loom
#

How does one make a /itemrename command that allows you to have spaces in the name, I cant figure it out or find anything on it cause I'm dumb

boreal seal
#

like /command this 2

idle loom
#

Yes

boreal seal
#

oh

#

args

lost matrix
idle loom
#

like uh

boreal seal
#

just args

#

and check if ==

#

else list of commands

idle loom
#

I just need to join the args together

boreal seal
#

i mean not list of commands

#

i mean command help

idle loom
#

yesh

boreal seal
#

of usage or something

#

yeah use ARGS

#

here is an simple example from my code

#

if you dont know what is "args" do some java homework

echo basalt
#

do some java homework

#

my man the amount of nesting in that code

boreal seal
#

yeah final was not nessacery here

idle loom
#

Oh if that's bad lord help you if you see my code

boreal seal
#

thats my first plugin o/ it meant to replace essentials lol

#

i made it like 2 years ago

gaunt pendant
#

Hello, according to the hooking instructions from the placeholder api, I added these lines to build.gradle. But when I want to use Placeholderapi in some class, it doesn't work.

idle loom
#

I'm kinda making a plugin to replace ess, since the people I work with dont lik eit

boreal seal
#

and its actually fine

echo basalt
#

ยฏ_(ใƒ„)_/ยฏ

#

nesting bad

boreal seal
#

ยฏ_(ใƒ„)_/ยฏ

gaunt pendant
boreal seal
#

it appears

#

...

#

oh its not papi

#

lol

gaunt pendant
#

its minimessage

#

but i need papi

echo basalt
#

API Version v2.11.2

gaunt pendant
#

oh.. i had one extra character there, sorry :D

boreal seal
#

sometimes the docs are outdated ยฏ_(ใƒ„)_/ยฏ

sturdy frigate
chrome beacon
#

Show us the other ones below

sturdy frigate
chrome beacon
#

Looks fine. Is the problem happening when you compile your jar or is it that you can't import the classes?

sturdy frigate
#

Ah, the problem seems to be with intellij not having it indexed I think? I couldn't autocomplete it

#

Manual imports seem to work though, is there any way to force intellij to index the jars?

chrome beacon
#

File > Invalidate Caches and restart

river oracle
echo basalt
#

use vim

shadow zinc
#

How can I listen for permission queries like LuckPerms verbose (for now I don't want to use API, however it going to be too much other I will)

chrome beacon
#

Use their API

#

It will be much easier

sturdy frigate
chrome beacon
#

I did

echo basalt
#

use the api

#

no point in being special

river oracle
#

you aren't cool if you don't use their api

#

use their api

shadow zinc
#

and can I add that to my lib and redistribute it?

river oracle