#help-development

1 messages · Page 704 of 1

gilded granite
#

its for action bar

#

oh yeah that' cuz i use a runnable

#

how can i have shaded and remapped plugin ?

chrome beacon
#

You use both the remapping and shading

#

in your pom

gilded granite
#

how

lost matrix
gilded granite
#

Its making a 130mo file breh

#

and i still have the issue

lost matrix
#

Which issue

gilded granite
#

noClassFoundExeption for mongo db

lost matrix
#

First of all... Why are you shading the entire maven shade plugin?

gilded granite
#

how to fix?

chrome beacon
#

They're not using the maven shade plugin

lost matrix
#

And wtf is even this?? Thats not the spigot api.

lost matrix
gilded granite
#

i press package button

#

still java.lang.NoClassDefFoundError: com/mongodb/client/MongoClients

lost matrix
#

Ok, so step one: Remove the maven shade plugin from your dependencies
Next: Explain what Jaconp:SpigotAPIs is. If you cant, then remove it.

gilded granite
#

idk what is it

lost matrix
#

Idk its in your pom...

#

Are you writing your code in kotlin?

gilded granite
gilded granite
lost matrix
#

Then remove kotlin from your project

gilded granite
#

ok

worldly ingot
#

Because they will break. It's unsupported use of internals

upper hazel
#

how can you make a method to search for a safe location (comparison with the list of material) volumetric spaces?

#

for structures

lost matrix
lost matrix
gilded granite
#

i got 4 plugins which should i use?

echo basalt
lost matrix
gilded granite
#

88Mo?

upper hazel
tawdry pilot
#

[00:32:32 WARN]: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
[00:32:32 WARN]: SLF4J: Defaulting to no-operation (NOP) logger implementation
[00:32:32 WARN]: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
does anyone know what this error is

upper hazel
#

the blocks on the screen are a selected area

lost matrix
upper hazel
#

down up

lost matrix
#

In most cases this will lead to a ton of overhead as areas tend to be filled with air at the top

gilded granite
#

@lost matrix still the same error java.lang.NoClassDefFoundError: com/mongodb/client/MongoClients

upper hazel
#

damn the translator is dumb

#

I mean what is better from bottom to top yes

lost matrix
gilded granite
#

how?

lost matrix
upper hazel
#

are there better ways?

gilded granite
upper hazel
#

otherwise I will again have to mess with asynchronous threads (

lost matrix
worldly ingot
#

No reason to do that sort of thing async if you don't absolutely need to. All you're doing is comparing block types

#

If possible I would advise using World#getType() over World.getBlock()#getType() to avoid unnecessary Block instances, but if you need the Block then go for it

gilded granite
#

how to send images

#

@lost matrix see in dms please

lost matrix
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

gilded granite
lost matrix
gilded granite
#

its not here

lost matrix
#

Is even this

gilded granite
#

oh yes its there but not the plugin isnt working

lost matrix
#

Ok. Clean your plugins folder
Do a mvn clean
Then mvn install
Then show the jars that got compiled.

gilded granite
#

ok

lost matrix
# gilded granite ok

Wait this is a completely different exception now.
There is no mentioning of mongodb anywhere.

gilded granite
#

ik

lost matrix
#

This exception is not even from your plugin my guy

gilded granite
#

what is it then

#

i dont have authme plugin

lost matrix
gilded granite
#

i dont have this plugin breah

lost matrix
#

Spigot says you do.

gilded granite
lost matrix
#

Delete PlugManX
And while you are at it: Never use the reload command

gilded granite
#

why?

sterile token
#

How can i cancel enderpearl consume event? Is it via PlayerItemConsumeEvent

lost matrix
# gilded granite why?

Because both will lead to a ton of problems and break your server in unimaginable ways

gilded granite
#

still the same error

lost matrix
gilded granite
#

i dont have it breh

river oracle
#

Clearly you do or it wouldn't launch with AuthMe

#

maybe your server jar was modified in some way?

#

try rebuilding spigot

gilded granite
#

Its even creating the folder AuthMe but i dont have the plugin wtf

#

is it injected on any of my plugin

river oracle
#

🤷‍♂️ doubt it

#

makes me wonder if this is an official distrobution of authme

#

you had installed

gilded granite
#

i didnt installed anything

river oracle
#

mmm then I'd check for malware

#

@vagrant stratus

gilded granite
#

a malware that install authme brehhh

river oracle
#

anti malware here maybe?

subtle folio
#

j make a new server lol

gilded granite
#

Its adding authme to the server when i build the plugin brehhh

river oracle
#

I'd say this warrants looking into it first if it is malware I wouldn't leave it lingering arround

gilded granite
#

its in one of my pom dependency maybe

river oracle
subtle folio
gilded granite
sterile token
#

i have even open reverse shells just because they use a plugman which it can load remote jars

river oracle
gilded granite
#

it doesnt have the error

river oracle
#

?paste

undone axleBOT
sterile token
river oracle
sterile token
#

well im just code one, but cant stop the item dissapearing from the player inventory

subtle folio
river oracle
#

v

subtle folio
#

oh nvm

river oracle
#

fairly popular it seems i doubt it has malware

subtle folio
#

what about nbteditor @gilded granite

chrome beacon
#

kangarko :kekw:

river oracle
gilded granite
river oracle
#

and decompiled

subtle folio
#

real

river oracle
#

this is legacy as fuck but not malware as far as I can see

gilded granite
#

do i try removing 1by1?

river oracle
#

no send your jar

subtle folio
#

send your jar

river oracle
# subtle folio send your jar
<dependency>
      <groupId>com.cjcrafter</groupId>
      <artifactId>openai</artifactId>
      <version>1.3.1</version>
  </dependency>```
 what about this one
gilded granite
#

i cant here

river oracle
#

verify if you have forums

subtle folio
river oracle
#

ahhk

#

!verify

undone axleBOT
#

Usage: !verify <forums username>

subtle folio
river oracle
#

eww kotlin you can look at that if you want xD

subtle folio
#

it is not a spigot library

river oracle
#

ahhh

subtle folio
#

no auth me 😅

river oracle
#

I wonder what would even want to inject authme 🤔

#

@gilded granite just to verify issue goes away after you remove your jar right?

gilded granite
#

!verify LiamCtgn

undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

gilded granite
#

Its 80mb gonna take a while

river oracle
#

WHAT

#

how is your jar 80mb

echo basalt
#

there's probably a nicer java chatgpt api

gilded granite
#

idk

echo basalt
#

If not I'm down to making one myself

gilded granite
river oracle
#

no Liam how is your jar 80mb

#

that's not right

gilded granite
#

wait im building again

river oracle
#

not really

#

intellij is made with java

gilded granite
#

it has never appeared before

weak meteor
#

hello, got a question abt mongodb connections, never understood properly how to connect it cause last time i used it i needed like the host ip, port and more, but now i use atlas and its nothing similar than

its like this: mongodb+srv://<username>:<password>@host.qoymv1e.mongodb.net/?retryWrites=true&w=majority

echo basalt
#

hypixel clone clown_2

gilded granite
#

shit password leak

echo basalt
#

lmfao

weak meteor
gilded granite
#

i got this Provides transitive vulnerable dependency maven:commons-codec:commons-codec:1.11
Cxeb68d52e-5509 3.7 Exposure of Sensitive Information to an Unauthorized Actor vulnerability pending CVSS allocation
Results powered by Checkmarx(c)

chilly hearth
#

um

weak meteor
chilly hearth
#

how i can get a #getEntity.getkiller as a entity

#

because that only contains player

weak meteor
#

i guess Entity entity = (Entity) player; ?

chrome beacon
#

You can't

weak meteor
#

guess not

chrome beacon
#

as you said getKiller only returns a player

chilly hearth
#

yes

chrome beacon
#

Do you want to know what killed a player in the death event?

gilded granite
#

WTFFFFFF

#

2GB

weak meteor
#

bro how u even manage to have 2gb of dependencies

gilded granite
#

Idkk

chrome beacon
#

That's the repository index

gilded granite
#

why its 2gb

echo basalt
#

I got over 14gb in maven caches

gilded granite
#

i dont need 2bg

chrome beacon
#

Because there are many dependencies in maven central

gilded granite
chilly hearth
chrome beacon
#

?¨¨

chilly hearth
#

cuz i spawned an mob added the tag in another class so in this class i need to get the mob that contains that tag

chrome beacon
#

You know you can just pass a variable

chilly hearth
#

i can pass the varibale into another class ?

weak meteor
#

i luv u 7smile7

chilly hearth
#

....

chilly hearth
grizzled oasis
#

most stupid question, how can i place a closed door (even replacing block)

lost matrix
grizzled oasis
#

thought that would not count on spigot or some shit don't know why i specified that

chilly hearth
#

can we

#

?///////

grizzled oasis
#

yes obv

lost matrix
chilly hearth
#

heh

#

i meant can we pass variable into another class ?

lost matrix
lost matrix
chilly hearth
#

#getStage ig that could work for closed door

grizzled oasis
#

like

private String omg;

public YourClass(String omg) {
    this.omg = omg;
}
chilly hearth
#

daym

upper hazel
grizzled oasis
subtle folio
lost matrix
#

Then check the block on top before smileybolb

grizzled oasis
upper hazel
#

chat gpt in chat minecraft???

lost matrix
#

What?

#

This is just a simple wrapper for the gpt api web endpoint

upper hazel
#

what does he give?
chat methods?

#

oh wait

#

I was wrong this is for Java and not for plugins

gilded granite
gilded granite
echo basalt
#

bros shading literally everything

#

factions, discordsrv, papi

#

what the actual fuck

gilded granite
#

how to choose what to shade?

chrome beacon
#

Set the scope of what you don't want to shade to provided

smoky anchor
#

I have this beauty of a method which prints the leaderboard of all players for bingo.
It colors the winner in gold and adds tooltip with all finished tasks.
I can't get the sorting to work for some reason. (commented line)
||I can use the Sleep Sort ™️ instead, but I would rather the sorting to work :D||

Anyone got any clue why the sort does not work ?

quaint mantle
upper hazel
#

who has a directory for building the plugin version and its numbering

#

tutorial

#

I don't know what standards you have

buoyant viper
#

looks interesting

smoky anchor
smoky anchor
buoyant viper
#

hmm

#

interesting alternative to built in (Base)Components ig

echo basalt
#

given you're using my minigame lib

#

or well

#

my structure for it

#

don't forget that each phase should also have control of its own tasks

#

So when the phase cleans up, tasks do too

smoky anchor
#

Oh I do have that, but in this case
I had to use the normal way 'cause they would get cleaned up after the phase ends and nothing would be printed by the sleepsort

echo basalt
#

then just end the phase after all the messages are sent?

smoky anchor
#

I guess that would have been a way as well lul.
But I did fix the sorting so it don't matter now

echo basalt
#

yeye

sterile token
#

something really weird, the item slot is being found but the item doesnt appear

#

do you think that must be issue a with my textures?

echo basalt
#

uhh

#

how are you opening the inv

weak meteor
#

cause u gotta use ChatColor.translate

#

no?

sterile token
#

Something more to add, if i listen to the custom click event. The the event.getItem() is not null

echo basalt
#

ok so no packet wizardry

#

nice

sterile token
#

This is how im debugging

#

So far item is not null

#

So only thing im thinking its a fucking texture issue or if not, no idea what could be happening

#

I can share fully code if you want

#

Thats the calling of menu click

#

Also the item not even appears, adding it via code 💀

#

@echo basalt most code of MenuInventory:

public class InventoryMenu implements Menu {

    @Getter private final String name;
    @Getter private final int rows;
    @Getter private final Map<Integer, CustomItem> items;
    @Getter private final Inventory inventory;

    public InventoryMenu(String name, int rows) {
        this.name = Chat.style(name);
        this.rows = rows;
        this.items = new HashMap<>();
        this.inventory = Bukkit.createInventory(this, this.rows * 9, this.name);
        items.forEach((slot, item) -> inventory.setItem(slot, item.build()));
    }

    @Override
    public Menu set(int slot, CustomItem item) {
        this.items.put(slot, item);
        return this;
    }

    @Override
    public Menu unset(int slot) {
        this.items.remove(slot);
        return this;
    }

    @Override
    public Menu update() {
        this.inventory.clear();
        items.forEach((slot, item) -> inventory.setItem(slot, item.build()));
        for (HumanEntity player : inventory.getViewers()) ((Player) player).updateInventory();
        return this;
    }

    @Override
    public void open(HumanEntity player) {
        player.openInventory(this.inventory);
    }
}
echo basalt
#

yikes reminds me of my first menu lib

sterile token
#

yeah its pretty similar haha

#

But i cant udnerstand why the item doesnt appear

echo basalt
#

what I showed you was v2

sterile token
#

oh right

#

but dont have any idea?

#

my brain is currently white haha

echo basalt
#

Do you update after setting?

#

call update before open

sterile token
#

im using this to test, so there shouldnt be issues

#

@echo basalt

echo basalt
#

you gotta learn to add empty lines for readability my dude

sterile token
#

what?

pseudo hazel
#

add empty lines for readablility

#

split the code into logical blocks that belong together

#

to not burn my eyes and make my head spin when reading the code

sterile token
#

he?

#

I just have my menu api as dependency

pseudo hazel
#

no we just mean in your code

sterile token
#

so what you need i can do it and explain

hybrid spoke
#

just big fat code blocks

sterile token
echo basalt
#

google style still accepts empty lines

hybrid spoke
#

i helped illusion to understand

echo basalt
#

I have google style as my codestyle in my ide

sterile token
#

hmnn too messed up, it just now that my items are not appearing

#

Ohh you mean IJ style

#

🤔

#

LMAO i thought you were talking about my code itself, that wasnt understable what im doing

hybrid spoke
#

anyways whats the problem

#

tldr please

sterile token
#

right, so far the item doesnt appear on the inventory

#

But while listening to custom menu click event, the item i get from the event is not null

twilit roost
#

hey!
does anyone know of good way to make "Did you mean"?

e.g.: user inputs "enbled"
but only options are "enable" "disable"

therefore the DYM would tell him if he meant the "enable" option

echo basalt
#

uhh

#

word matching

#

Basically you need to make an algorithm that spits out a "similarity percentage" between 2 strings

#

And make a comparator out of that

#

"enbled" is a lot more similar to "enable" than to "disable"

#

there's a lot of weird cases

#

Like uhh

#

accounting for the whole keyboard layout

#

if I type my input but every single character is offset to the right

hybrid spoke
#

but just not gets added

#

btw updateInventory is redundant

echo basalt
#

smile knows the algorithm names because he didn't drop out of school

#

thanks smile

twilit roost
#

just asked GPT for some example code and it also uses levenshtein :D

#

tysm for that ref tho!
very helpfull

sterile token
twilit roost
#

:DD

echo basalt
#

can't wait for the next kid asking us for help with their hypixel skyblock clone

hybrid spoke
hybrid spoke
sterile token
echo basalt
#

amogus

#

anyways command code is fun

#

I'm having so much fun

#

(kill me ples)

sterile token
quaint mantle
echo basalt
#

InventoryClickEvent

echo basalt
#

and a lot of hope & praying

sterile token
hybrid spoke
#

at the exact moment a player clicks an item (getClickedItem) he takes it out

#

on the cursor = not in the inventory

sterile token
#

answering me right?

hybrid spoke
#

no

#

at your case i need more context

sterile token
#

ok, so elaborate it more

hybrid spoke
#

nah, rather show more

#

a picture or video says more than 1000 words

sterile token
#

ok

#

i will do a video

shadow night
gilded granite
#

Can any1 help i cant shade my plugin idk why

echo basalt
#

I hate these goddamn lombok warnings

#

I already turned them off like 13 times and they still keep appearing

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

sterile token
hybrid spoke
icy beacon
#

based

quaint mantle
icy beacon
#

this is just a stacktrace

#

code is necessary to diagnose what's going on

remote swallow
#

?paste ur pom

undone axleBOT
gilded granite
#

me?

remote swallow
#

yes

icy beacon
#

and the usage of the MongoClients

gilded granite
sterile token
gilded granite
remote swallow
icy beacon
#

very cool now show it

#

i don't know the base initialization of mongoclients by heart

gilded granite
#

MongoClient mongoClient = MongoClients.create("mongodb+srv://LiamCtgn:PASSWORD@finepixel.ngqtdne.mongodb.net/?retryWrites=true&w=majority");

icy beacon
#

try running Class.forName for this class somewhere in onEnable or in your class init or maybe in a static block

#

it usually happens with jdbc drivers that you need to Class.forName it, in my experience

#

maybe mongodb also needs it

#

if not, the problem is probably somewhere in your pom

gilded granite
#

the problem is the pom file

#

i cant add it to the plugin when building

small current
#

can i prevent this from happening?

#

im .set ing a string containing . s

sterile token
#

lol

#

why commas inside

small current
#

ignore it

#

just the '.'

#

is being used as section

sterile token
#

what?

small current
#

im using

#

config.set(stuff, otherstuff)

#

but the stuff

#

contains .

sterile token
#

code

small current
#
        ConfigurationSection kitNpcsSection = config.createSection("kit-npcs");
        for (KitNpc npc : kitNpcs.values()) {
            kitNpcsSection.set(npc.getPosition().serialize(), npc.getKit());
        }
#
    public String serialize() {
        return x + ", " + y + ", " + z + ", " + yaw + ", " + pitch;
    }
gilded granite
#

any1 can please help i cant shade my plugin

small current
#

the x y z contains . in them

#

since they are double

#

and while im using .set()

#

the . is being used as a way to specify sections

remote swallow
#

change the seperator

tender shard
gilded granite
#

I think i fixed

sterile token
echo basalt
#

I think I actually managed to pull off my new command lib

#

v3 joeswag

distant wave
#

what is the site for mappings

echo basalt
#

?mappings

undone axleBOT
distant wave
#

i forget alot

echo basalt
weak meteor
#

WAS THAT

sterile token
#

@hybrid spoke Sorry for tagging man, but doesnt make fucking sense

#

Also i checked 3 times the config to see if everything matches and its perfect

tender shard
#

descriptive method name

pseudo hazel
#

lmao

gilded granite
#

how can i make that works if the end is disabled ```@EventHandler
public void onPlayerEnterEndPortal(PlayerPortalEvent event) {
Player player = event.getPlayer();
if (event.getCause() == PlayerPortalEvent.TeleportCause.END_PORTAL) {
event.setCancelled(true);
event.doSomting;

    }
}```
upper hazel
#

what this lol

pseudo hazel
#

wdym

#

if the end is disabled wont this event just not happen?

#

not much you can do about it

gilded granite
#

i want it to happend even if the end is disabled

#

Should i use playermovement event?

hazy parrot
#

tf

#

what do you want to do

gilded granite
#

i want to teleport the playe when he enter the portal the problem is that the end is disabled

#

so it doesnt work

twin venture
#

Hi , i get a null profile when loading a user , so long story short is i have 8 diffrent profiles that a Player must load when join , but its null for some reason ..

river oracle
twin venture
#

i have this abstract and i implement it into the Profiles Types :

#

iam intilizing them when server start :

#

if it was 1 profile , it will be easy to handle but multiple profiles .. that's hard ..

twin venture
twin venture
#

yes ik , how would i be able to get it to work with multi profiles?

#

like each profile will load its own data ,

echo basalt
#

I do it here

#

Basically you assign each player a profile id

twin venture
#

alright let me check it

echo basalt
#

and use that profile id for all the data

#

It kinda doubles the latency as you have to wait for the profile ID to be fetched

#

Before fetching all the data

#

But it's a decent tradeoff

#

better than fetching all the profile data

small current
remote swallow
#

yes

#

change the yaml config seperator while setting it

#

then change it back

#

the . in the double is no longer an issue

small current
#

how

#

wait

#

how to do it

#

there is no setSeperator or whatever

small current
#
        config.options().pathSeparator('@');
        ConfigurationSection kitNpcsSection = config.createSection("kit-npcs");
        for (KitNpc npc : kitNpcs.values()) {
            kitNpcsSection.set(npc.getPosition().serialize(), npc.getKit());
        }
        config.options().pathSeparator('.');
        config.save(data);
#

like this ?

remote swallow
#

yeah

small current
#

cool

#

i think i dont need to change the seperator back to .

gilded granite
#

any way to remove this shit ?

#

chat packets?

pseudo hazel
#

ive never seen that

small current
#

its for cracked servers

#

idk i think it was a way

gilded granite
#

Its when u disble the report or enable craked server

small current
#

google the error

gilded granite
#

its working

#

so

#

nice

small current
#

cool

#

guys did we make google a verb in english?

gilded granite
#

breh

pseudo hazel
#

not just english

#

its pretty much worldwide at this point

gilded granite
small current
#

but yeah its not always used as a name

#

verb
search for information about (someone or something) on the internet using the search engine Google.
"on Sunday she googled an ex-boyfriend"

#

oh ma god

gilded granite
#

how i can get a file and send it via webhook?

#

in the server folder

#

i need logs files

vast ledge
#

I just read i need legs files

round finch
#

leg files

#

pls

icy bone
#

Okay im struggeling a little bit with the config file, how can i update my changes made in the Java Editor (Intellij IDEA) to the exactly config file? because right now im doing the following:

        this.getConfig().options().copyDefaults(true);
        saveDefaultConfig();

in my onEnable() function, but when i start up the server, my config doesnt get overwriten

small current
#

well the seperator is @

#
        config.options().pathSeparator('@');
        for (String key : kitNpcsSection.getKeys(false)) {
            System.out.println(kitNpcsSection.getString(key));
            Optional<Kit> optionalKit = KitManager.kitByName(kitNpcsSection.getString(key));
            if (!optionalKit.isPresent()) {
                throw new IllegalStateException("Unknown kit");
            }
            npcs.add(new KitNPC(deserializeLocation(world, key), optionalKit.get()));
        }
#

and the output of the sout is MemorySection[path='kit-npcs.4001', root='YamlConfiguration']

small current
#

ok it is not working

green plaza
#

Its not even full secured cuz it doesnt have native inside

upper hazel
#

what is better to create a region in a certain zone and link the region to the zone itself or link the zone to its locations via math

#

without linking the region

#

like in skywars

lost matrix
#

How are regions and zones different from each other?

tall dragon
#

?pdc

upper hazel
#

not location

#

locations - > region

lost matrix
#

If you want to create regions then you should use BoundingBoxes

upper hazel
#

i want to associate zone locations with the zone itself via hashMap
location -> List<Location> locations -> zone - but skip step 2

lost matrix
#

Someone translate this for me pls...

#

If you want to create a region, use a BoundingBox to check weather a location is within this BoundingBox

river oracle
river oracle
#

BoundingBoxes are much faster than whatever you would be doing now

lost matrix
#

I think what he is trying to do would be impossible

tender shard
#

to everyone who uses jetbrains annotations: Here's a tiny gradle task to fix the "double annotation" issue. https://github.com/mfnalex/cesspool/blob/master/buildSrc/src/main/kotlin/com/jeff_media/cesspool/gradle/tasks/FixJavadoc.kt

Usage: ```kotlin
tasks.withType<Javadoc> {
// regular javadoc options ...
finalizedBy("fixJavadoc")
}

tasks.register<FixJavadoc>("fixJavadoc") {
description = "Fixes double javadoc annotations"
group = "documentation"
directory.set(tasks.getByName<Javadoc>("javadoc").destinationDir)
}

GitHub

Contribute to mfnalex/cesspool development by creating an account on GitHub.

upper hazel
river oracle
#

^ BoundingBox go brrrr

upper hazel
#

oh

lost matrix
#

Does all the math for you

upper hazel
#

this api or

#

were found this

lost matrix
#

Yes its spigot api.
BoundingBox.of(...)
is your entry point

upper hazel
#

does the Bounding Box work if it's not an island but a zone on the field?

lost matrix
#

You are mocking us, dont you?

upper hazel
#

no really

river oracle
#

Bounding boxes always just work

#

the math doesn't change no matter what you call your area of coordinates

#

that's the beatiful thing about math

#

it just is

lost matrix
#

A BoundingBox defines a box between two locations x and y.

upper hazel
#

OH this not api..

#

i see

lost matrix
#

Yes it is api

river oracle
#

?jd-s

undone axleBOT
river oracle
#

its definitely API

upper hazel
#

the problem is that the 2nd point may be unknown...

lost matrix
#
    Location locationA = ...;
    Location locationB = ...;

    BoundingBox boundingBox = BoundingBox.of(locationA, locationB);

    // Get the center of the box
    Vector center = boundingBox.getCenter();

    // Check if a location is within the box
    Location locationX = ...;
    boolean isInside = boundingBox.contains(locationX.toVector());
lost matrix
austere cove
#
@Blocking
@Override
public synchronized boolean reload() {
    return config.reload() & messages.reload();
}

bois this will call both reloads right? no matter what they return

lost matrix
upper hazel
#

but how is it used in skywars if they do not know the 2nd point?

lost matrix
upper hazel
#

I heard somewhere that in this formula it is necessary to divide by 16

lost matrix
#

Ok lets take a big step back.
You are riddling in absolute, incoherent gibberish.

What are you trying to do. Give us the whole picture.

austere cove
#

I got donowalled feelsbadman

lost matrix
#

F

upper hazel
echo basalt
#

Mans really picky about his hashmaps

upper hazel
#

location -> zone classlocation -> zone class

echo basalt
#

He basically wants a sort of octree

lost matrix
upper hazel
#

zone is auto mine

echo basalt
upper hazel
#

yes

#

AutoMineClass

#

connect with him Locations

echo basalt
#

What if we made a hashing algorithm that makes a zone id based on its position and size

upper hazel
#

end get mine object location -> AutoMineClass

echo basalt
#

That way we can use your stupid hashmap

upper hazel
#

why hashmap this stuped

#

this qwicly

lost matrix
upper hazel
#

this better then search region

lost matrix
#

A mine has a defined size, right?
It has two corners.

upper hazel
#

location -> region -> object or location -> object

#

so this is why i use 2 step

#

2 option

echo basalt
#

this dude does not know what he's talking about

lost matrix
#

Ok. So what you need is a BoundingBox

#

This is what you need

upper hazel
#

but for this you need to know 2 points and I have only 1 anywhere

lost matrix
#

You cant define a zone with one point

#

If you have one point then there is no location which is inside

upper hazel
#

how do you find an island in skywars by its location?

#

so i want this do too

pulsar parcel
#

Hi, this is my pom.xml and I am trying to import protocollib dependency, but for some reason it just shows this. Does anyone now what can be wrong? And yes, I reloaded my maven

lost matrix
#

You create a boundingbox around the each island

pulsar parcel
lost matrix
# pulsar parcel 1.19.2-R0.1-SNAPSHOT
        <dependency>
            <groupId>com.comphenix.protocol</groupId>
            <artifactId>ProtocolLib</artifactId>
            <version>5.0.0</version>
            <scope>provided</scope>
        </dependency>
#

*PS: Make sure to add the repository of dmulloy

upper hazel
#

I'm sorry, but I'm Russian is to blame for the fact that I'm not able to express my thoughts the translator)

lost matrix
#

Oh you are from there...

upper hazel
#

translate sack

pulsar parcel
upper hazel
#

even now translated not properly

pulsar parcel
upper hazel
#

who is Russian here, let me explain the problem in a personal

#

Spigot policy does not allow
another language

lost matrix
pulsar parcel
lost matrix
#

spigot first

pulsar parcel
#

done, still doesn't work

lost matrix
pulsar parcel
#

OMG it worked. Thank you so much, you just saved me like 3 hours of time.

tawdry monolith
#
[WARNING] 
[WARNING] Plugin validation issues were detected in 3 plugin(s)
[WARNING] 
[WARNING]  * org.apache.maven.plugins:maven-compiler-plugin:3.8.1
[WARNING]  * org.apache.maven.plugins:maven-shade-plugin:3.2.4
[WARNING]  * org.apache.maven.plugins:maven-resources-plugin:3.3.0
[WARNING] 
[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]
[WARNING]

anyone know hwy im getting this when I build? I haven't worked on this plugin in a while and now im getting a warnings from maven

lost matrix
tawdry monolith
#

makes sense

#

any way to update easily?

#

ok for some reason my plugin just completely breaks....

#

not even showing up on plugin list anymore

tender shard
#

is this the correct way to get all tasks of a type?

tawdry monolith
#

its clearly there but it doesn't show up

#

all I did was build then override current ver

#

now it just doesn't work...

#

and I get build success

lost matrix
# tawdry monolith its clearly there but it doesn't show up
[21:22:28] [Server thread/ERROR]: Could not load 'plugins/AnarchyCore-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.IllegalStateException: Cannot get plugin for class com.possiblepanda.anarchycore.AnarchyCore from a static initializer
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:149) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_20_R1.CraftServer.loadPlugins(CraftServer.java:433) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3849-Spigot-b41c46d-d548daa]
    at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:219) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3849-Spigot-b41c46d-d548daa]
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:973) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3849-Spigot-b41c46d-d548daa]
    at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304) ~[spigot-1.20.1-R0.1-SNAPSHOT.jar:3849-Spigot-b41c46d-d548daa]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.IllegalStateException: Cannot get plugin for class com.possiblepanda.anarchycore.AnarchyCore from a static initializer
    at org.bukkit.plugin.java.JavaPlugin.getPlugin(JavaPlugin.java:404) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at com.possiblepanda.anarchycore.AnarchyCore.<init>(AnarchyCore.java:15) ~[?:?]
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
    at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
    at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
    at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) ~[?:?]
    at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) ~[?:?]
    at java.lang.Class.newInstance(Class.java:645) ~[?:?]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:79) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:145) ~[spigot-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    ... 7 more

Pretty clear

tawdry monolith
#

havent done java and spigot in ages

lost matrix
#

You are doing some sketchy stuff in your plugins constrcutor

tawdry monolith
#

I think I may know why

lost matrix
#

AnarchyCore.java:15

tender shard
#

I'm surprised that this compiles

lost matrix
#

lol
null!!

tender shard
#

yeah shouldnt it cause a compilation error or sth lol

#

"null can't be not null" or sth

lost matrix
#

do null?:null!! XD

#

Wait

#

Thats not the right operator

#

Whats that one operator named after a singer

#

?: elvis operator

slender elbow
#

very famous poet

lost matrix
#

XD

#

Has been i while since i touched kotlin

austere cove
#

t u r b o f i s h gang ::<>

lost matrix
#

!! is just a runtime assertion iirc

tender shard
#

what's the difference between TaskContainer#create(...) and #register(...) ?

slender elbow
#

ah, apparently register is lazy whereas create isn't

tender shard
#

That means …? :d

slender elbow
#

don't wanna spend that extra build time in creating something that isn't gonna be used

tender shard
#

Ah

#

So im going to create a custom task, my plugin implements Plugin<Project> - can I somehow change ALL Javadoc tasks to run my custom task after them?

#

I also need to pass those Javadoc objects to my task

lost matrix
#

isnt this usually configured in your build.gradle when you decide to use that task?

tender shard
#

my task fixes an issue with the normal javadoc generation, hence when people use my plugin, they 100% wanna run it on all Javadoc tasks automatically

#

otherwise they woudln't be using my plugin

#

(it removes those annoying double annotations from the generated html files)

slender elbow
#

uh you can do something like, TaskContainer#all<Javadoc> { finalizedBy("myOtherTask") }

tender shard
#

yep I'm currently doing that but how would I then get the Javadoc task from within my task?

#

I feel like my task should not extend/implement DefaultTask but sth else

lost matrix
#

What if other javadoc tasks are registered after yours?

tender shard
#

I don't know

slender elbow
#

i'd do something like, for each javadoc task register a fix<JavadocTaskName>Javadoc and your FixJavadoc task have a Directory as input property (via ctor or configure it in-place)

slender elbow
#

(specifically withType(Class<T>), then others derive from that)

tender shard
#

my task currently looks like this but it's not getting called at all

#

I'm registering it like this, and it does print "FixJavadocTask is being applied to javadoc"

slender elbow
#

no not forEach

#

all

#

i don't see where you are registering your task tho

tender shard
#

ok I'm registering them like this:

#

when I run javadoc on my project now, ofc gradle complains because my TaskACtion method requires a Javadoc object


An exception occurred applying plugin request [id: 'com.jeff-media.fix-javadoc', version: '1.0-SNAPSHOT']
> Failed to apply plugin 'com.jeff-media.fix-javadoc'.
   > Could not create task ':fixJavadoc'.
      > Cannot use @TaskAction annotation on method FixJavadocTask.fixJavadoc() because class org.gradle.api.tasks.javadoc.Javadoc is not a valid parameter to an action method.

hybrid spoke
#

feeling sick today?

tender shard
#

yeah I've been drinking yesterday and still hangover. 10mg diazepam, 1mg clonaezpam and 0.5mg lorazepam didn't help so yeah I'm writing gradle plugins now

slender elbow
tender shard
slender elbow
tender shard
#

uuugh right I'm stupid

#

I rewrote the whole thing so I don't have duplicate code for main project and subprojects, then forgot to call the new method lmao

#

thanks

#

hmm now I get this

  - In plugin 'com.jeff_media.fixjavadoc.FixJavadocPlugin$Inject' type 'com.jeff_media.fixjavadoc.FixJavadocTask' property 'task' is missing an input or output annotation.```
slender elbow
#

i guess you'd annotate the getter with @Internal iirc?

#

forgot that was a thing

quiet ice
#

Or make the getter private

tender shard
#

adding Input to the constructor worked

#

However now my issue is that it only detects the Javadoc tasks of the root project

#
abstract class FixJavadocPlugin : Plugin<Project> {

    override fun apply(project: Project) {

        println("Applying FixJavadocPlugin to whole project...")

        println("Checking Javadoc tasks of root project:")
        project.tasks.withType(Javadoc::class.java).forEach { javadocTask ->
            println("Found javadoc task: ${javadocTask.name}")
            addFixJavadocTaskToJavadocTask(project, javadocTask)
        }

        println("Checking Javadoc tasks of subprojects:")
        project.subprojects.forEach { subproject ->
            subproject.tasks.withType(Javadoc::class.java).forEach { javadocTask ->
                println("Found javadoc task: ${subproject.name}/${javadocTask.name}")
                addFixJavadocTaskToJavadocTask(subproject, javadocTask)
            }
        }
    }

now when I run gradle javadoc on a subproject, I get this

...
> Task :buildSrc:jar UP-TO-DATE

> Configure project :
Applying FixJavadocPlugin to whole project...
Checking Javadoc tasks of root project:
Found javadoc task: javadoc
Checking Javadoc tasks of subprojects:

> Task :shared:compileJava UP-TO-DATE
...
echo basalt
#

why are you rewriting your stuff in kotlin in the first place

quiet ice
#

Something like

        project.afterEvaluate((var10001) -> {
            project.getChildProjects().values().forEach((child) -> {
                
            });
        });

I guess

tender shard
quiet ice
#

Also in case you ask, I have no idea what afterEvaluate does

dry hazel
#

it just defers it to a further phase of the configuration as far as I know, useful when something isn't set during the apply logic, like some extensions' values

tender shard
#

last question, how can I set the "group" name of a task created by code?

quiet ice
#

Good thing you can code otherwise I'd be hard-pressed to convert that to groovy

tender shard
#

using build.gradle.kts I can declare tasks like this, including group and description

quiet ice
#

I do it like follows:

        project.getTasks().create("deployMods", GslDeployModsTask.class, (task) -> {
            task.setDescription("Deploy mods to the extension directory of the development environment.");
            task.setGroup(TASK_GROUP);
        });
dry hazel
quiet ice
#

You probably can invoke setGroup in the task's constructor though

tender shard
#

thank you @slender elbow and @quiet ice , I got everything working now!

quiet ice
#

This also reminds me that I should get rid of my fromJar hack I have in that project considering that Project#zipTree exists

steel spindle
#

is it possible to override a method of a class?
like spigot have class RegisteredListener with method callEvent, and i wanna override that method

#

?

quiet ice
#

Just FYI, you don't have to delete your old message

tender shard
#

unless the class or method is final, ofc

quiet ice
#

?jd-s

undone axleBOT
steel spindle
quiet ice
#

What I am saying is that your query makes 0 sense

#

You shouldn't write custom implementations of that class unless I am sorely mistaken

#

It's been a while since I've been working with bukkit though so it could very well be that I'm rusty

steel spindle
#

I need to override a method to call other functions

quiet ice
#

Override as in replace/overwrite the bukkit implementation? That is any call to RegisteredListener#callEvent will forward to your method?

steel spindle
#

like

old:

public class RegisteredListener {
public void callEvent(final Event event) throws EventException {
        if (event instanceof Cancellable){
            if (((Cancellable) event).isCancelled() && isIgnoringCancelled()){
                return;
            }
        }
        executor.execute(listener, event);
    }
}

custom:

public class RegisteredListener {
public void callEvent(final Event event) throws EventException {
        if (event instanceof Cancellable){
            if (((Cancellable) event).isCancelled() && isIgnoringCancelled()){
                return;
            }
        }
        
        System.out.println(event.getName());

        executor.execute(listener, event);
    }
}
tall dragon
#

why would you want to do that

steel spindle
quiet ice
steel spindle
#

i need to override

quiet ice
steel spindle
quiet ice
tall dragon
steel spindle
lost matrix
# steel spindle yep

Hm what do you mean by handle?
Because this can have an enormous impact on the servers performance.
Which language and how does the cross application communication look like?

quiet ice
#

RegisteredListener only wraps your registerEvents call in the first place

tall dragon
#

there isnt rlly a good way to do so unfortunately

#

as far as i know

sullen marlin
quiet ice
#

Dynamic typing I fear...

sullen marlin
#

There's tonnes of python and JavaScript plugins that do fine

quiet ice
#

At which point you'd have to cleverly work around this limitation

steel spindle
#

i can just list all the events and register them via registerEvent, right?

quiet ice
# steel spindle for what

Basically

MyRegistwredLustener extends RegisteredListener {
[...]
@Override 
public void callEvent(Event e) {
  // [...]
}
steel spindle
quiet ice
#

It seems you are unfamiliar with OOP

sullen marlin
#

?xy

undone axleBOT
lost matrix
# steel spindle for listen all events blyad

You would have to do classpath scanning and register listeners this way.
But there has to be a better way. You are also ditching listener properties like
the event priority with this approach

tender shard
#

Task :publishPlugins
Publishing plugin com.jeff-media.fix-javadoc-plugin version 1.0
Thank you. Your new plugin com.jeff-media.fix-javadoc-plugin has been submitted for approval by Gradle engineers. The request should be processed within the next few days, at which point you will be contacted via email.
yaay

tender shard
#

what's the equivalent of Function<T,R> in kotlin? kotlin.Function only seems to have one return type parameter

barren peak
#

How do you prevent a certian item from dropping on death

#

e.getDrops().remove(item); doesn't work

onyx fjord
#

like what does the plugin do

barren peak
eternal valve
#

I assigned 4 skins to 1 block with minecraft variations, but can I use a command to use the wood variation I want, for example /give minecraft:oak_planks textures:oak_purple

#

Can I choose the model I want in the same way, when I added 4 variation models to 1 model with variation

kindred sentinel
#

?nms

kindred sentinel
#

Is there any tutorials to write "clean code" or something like this? Because the plugins that i'm creating are working but... I'm not sure that this code will satisfy somebody or something like this

river oracle
#

writing "clean code" is stupid

#

write good code

kindred sentinel
#

Like i'm always thinking how to make code look clean, and readable but i dont know java too good to make it look well

kindred sentinel
#

🥲

river oracle
#

then you'll never improve

#

either you have to learn your code is shit or someone has got to tell you :P

#

personally I've felt self acceptance is the best method

#

my code sucks

kindred sentinel
#

Oh ok, i'll try

marsh crater
#

Is there an easier way to wrap a Player object like this so I can add custom methods and things to it, without having to have an AdagraPlayerManager to store a hashmap of all online AdagraPlayer objects?

eternal valve
#

Help me plss 😭

#

I assigned 4 skins to 1 block with minecraft variations, but can I use a command to use the wood variation I want, for example /give minecraft:oak_planks textures:oak_purple

worldly ingot
#

That’s not how textures work, no

ivory sleet
#

Do you want a link?

tender shard
#

can one publish gradle plugins to a normal maven repository?

remote swallow
#

Yes

#

Well im pretty sure so

tender shard
#

Im wondering because it uses the fully qualified plugin name as artifact id

#

Epic are you using jetbrains annotations?

eternal valve
tender shard
#

is there a javadoc option to get rid of this "external link" button?

eternal valve
#

So can I do it with a plugin, if I write a plugin, can I choose the variant texture I want or can I put it

remote swallow
tender shard
#

annotations or annotations-java5?

remote swallow
#

Annotations

#

Might be old though

thin iris
#

never back down never what?

remote swallow
#

Never give up

thin iris
#

i’m bored idk what to code though

tender shard
kind hatch
tender shard
brazen badge
#

if it is an "a" tag

kind hatch
# brazen badge ```css a::after { content: ''; } ```

That's already set on the default javadocs. If you want to truly remove it, you set it to none. Alternatively, you can set background-image: none since some docs like to use that instead of specifying the icon in the content tag.

#

I guess you could also do display: none, but maybe there's a reason to keep it in the dom.

brazen badge
kind hatch
#

True true. It's all going to depend on what the CSS standard javadocs support.

tender shard
kind hatch
brazen badge
#

Anyone knows how to make a shake effect?

tender shard
#

you can use a repeated task and teleport the player while only changing their pitch and yaw

kind hatch
#

I think that would be more mod territory. Although a shader might be able to produce that effect.

brazen badge
#

Because I use oraxen and i want to do that when the item has been used, it produce a shake effect to all the near player

kind hatch
#

I guess it just depends on what you define shake as.
Are you talking about a real screen shake effect?
Or maybe something like a ground shake?

brazen badge
#

idk if it is possible to do ground shake

kind hatch
#

Ground shake can be simulated (although would probably be a little intensive).
To the best of my knowledge, screen shake is not something that's achievable without mods. Like I said before, a resourcepack shader might be able to do that, but that requires knowledge of how to write shaders.

kind hatch
#

That can work if the player is stationary. If you want the player to be able to look around while the effect is happening, it might start to look a little buggy.

brazen badge
#

and how to make gorund shake effect?

kind hatch
#

A lot of display entities. Get a radius around the player, get the topmost ground layer, set to barriers, spawn block displays in their place, have them shake a bit, maybe spawn some particles, gradually reduce shakiness over time and once done, return blocks to their original state.

Have that happen while the player is moving to have it happening all around them.

That's the rough idea. ^
Could probably do some better method when it comes to determining the blocks to select for shaking.

#

You could also do some of that with Player#sendBlockChange() so the server isn't killing itself.

#

Would be nice if we had the /camera command that bedrock has. It has screen shake functionality built in.

dry forum
#

best way to host a webpage off of a plugin?

ruby mesa
#
[20:44:07 ERROR]: Uncaught exception in thread Profile Lookup Executor #36596
java.lang.NullPointerException: null

[13:35:59 ERROR]: Uncaught exception in thread Profile Lookup Executor #52
java.lang.NullPointerException: Cannot invoke "java.util.Optional.isPresent()" because "optional" is null
        at net.minecraft.Util.ifElse(Util.java:448) ~[?:?]
        at net.minecraft.world.level.block.entity.SkullBlockEntity.lambda$updateGameprofile$5(SkullBlockEntity.java:141) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]```

Why does this error happen on my friends server? im assuming its smth with the world but im not entirely sure
cursive kite
#

Does world.getChunkAt(x, z) not work async?

tender shard
#

No, as it loads the chunk

cursive kite
#

Ah makes sense

#

I am trying to count value for chunks and need to find certain blocks and tile entities :l

tender shard
fickle rivet
#

help me? I'm trying to make the player, when placing a seed in the plowed land, 3 blocks next to him to be planted with a seed also automatically, but he is breaking the block instead of planting.

@EventHandler
    public void onPlayerInteract(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        if (!plantingSkillActive.getOrDefault(player, false)) {
            return; // Se a habilidade não estiver ativa, retorne e não faça mais nada
        }

        // Verificar se o jogador clicou com o botão direito em um bloco
        if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
            ItemStack itemInHand = player.getInventory().getItemInHand(); // Obter o item na mão do jogador

            // Verificar se o item na mão é uma semente
            if (itemInHand != null && itemInHand.getType() == Material.SEEDS) {
                Block clickedBlock = event.getClickedBlock();

                // Verificar se o bloco clicado é terra arrada
                if (clickedBlock.getType() == Material.SOIL) {
                    // Tentar plantar sementes em até três blocos ao lado
                    for (int i = 1; i <= 3; i++) {
                        Block nextBlock = clickedBlock.getRelative(BlockFace.NORTH, i);

                        if (nextBlock.getType() == Material.SOIL && !player.getInventory().contains(Material.SEEDS)) {
                            break; // Se o jogador não tiver mais sementes, saia do loop
                        }

                        if (nextBlock.getType() == Material.SOIL) {
                            nextBlock.setType(Material.CROPS); // Planta a semente
                            removeSeedFromInventory(player);
                        } else {
                            break; // Se um dos blocos não é terra arrada, saia do loop
                        }
                    }
                }
            }
        }
    }
#

obs: spigot 1.8.8

cursive kite
tender shard
#

it should include BlockStates and BLockData just fine?

cursive kite
# fickle rivet obs: spigot 1.8.8

You are setting the block to crops, crops go ontop of the block nextBlock.getLocation().clone().add(0, 1, 0).getBlock().setType(Material.CROPS); // Planta a semente

#

How the heck do I use ints within block data 😢

cursive kite
#

I am using 1.8, that seems to be a newer thing 😦

#

Doesnt seem like i can do anything with it

#

Ugh I wonder if it is more efficient to do 2 loops

#

One can loop though chunk snapshots to count blocks, another on main thread loops tile entities for spawner and chests

tribal quarry
#

hey there, how can I cancel the drop item event, with perishing the item?

#

I mean, I just want to make that item disappear, preventing it from giving back to player?

#

The problem is: I set the item cursor for player, then they/them close the inventory & it'll given back to the player, which i don't want to.

tender shard
twin venture
#

Hello , i have a problem with mysql not updating value , well its but after 4 , 5 times of try to change it it stop

#

no errors nothing

#

is something wrong with these too?

tribal quarry
tribal quarry
undone axleBOT
glad prawn
#

?

cursive kite
#

Does ChunkSnapShot's snapshot.getHighestBlockYAt(x z) count tile entities

tribal quarry
#

InventoryCloseEvent?

icy beacon
#

not sure, i haven't looked into your problem, just noticed that you said you coud;n't find the method

tribal quarry
#

Yes, thanks, i had to mention about finding that setCursor function, sorry

upper hazel
#

where to find documentation about plugin.yml what command is database: true. I did not find its description on the Internet

#

oh great i found it

rigid otter
#

My code just use an ArrayList#add("Something") how is this possible to the index -1?

java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 10
        at java.util.ArrayList.add(ArrayList.java:455) ~[?:?]
        at java.util.ArrayList.add(ArrayList.java:467) ~[?:?]
small current
#

Why do i have hardcore hearts when my plugin is loaded?

green prism
#

Is it possible to save and load ShapedRecipes to/from config?

// ShapedRecipe shapedRecipe = (ShapedRecipe) section.get(key);

Something like this or is there any easier way?

glossy venture
rigid otter
#

No

glossy venture
#

tf

sullen marlin
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

glossy venture
#

jdk bug?

#

this is prob a newer version

vagrant stratus
#

Got bored, going through bukkit plugin requests again.
What would even be a good way of implementing this? https://bukkit.org/threads/command-on-date-time.331746/

I guess limiting checking to only on plugin start? But that doesn't help if the date passes while the server's already enabled 🤔

glossy venture
#

check current time every 20 ticks and compare it to every scheduled task (>= so it runs if its late too)

sullen marlin
#

No there’s nothing by default

#

You could write some code relatively easily

vagrant stratus
glossy venture
#

and then check every 5 minutes whether shit needs to move to the next block

#

and only check the upcoming/front block every second/5 seconds

vagrant stratus
#

Performance isn't really the issue, just seems like a lot of pointless scheduling lmao

glossy venture
#

wdym scheduling

#

just a repeating task

#

or two

green prism
vagrant stratus
#

yea, and it could be a lot of repeated tasks which aren't really needed 🤔

glossy venture
#

no only one

#

which goes through every task

#

in the first block

#

and one which runs on start and like every hour

#

which updates the blocks

sullen marlin
#

You just sort the tasks by time and stop that execution once you reach one in the future

glossy venture
#

like a subscheduler

vagrant stratus
#

Ich search for a plugin wich do a command on a date e.g. at 5.5.2015 at 15:05 the server use the command ¨/say hello¨ or somthing.

so it would be configured something like

times:
 date: <command>
 date: <command>
 date: <command>

At least my guess 🤷‍♂️

vagrant stratus
#

well, it's what makes the most sense for their request

#

You have a completely arbitrary date & time, with a command assigned too it

glossy venture
#

is pulling an item from an array deque expensive

sullen marlin
#

Linkedlist would be fine

glossy venture
#

yeah

#

just curious

#

if they dont have some kind of magic unsafe pointer shit or smth

#

instead of moving the array

remote swallow
vagrant stratus
#

If it were just year-month-day. It wouldn't be difficult to just

every IRL day, check the date via LocalDateTime

#

but it's the arbitrary time that's the fun part ig

remote swallow
#

@eternal oxide wheres the code to run something at an exact time

vagrant stratus
lilac dagger
glossy venture
#

yeah linkedlist would be better here

vagrant stratus
#

&

    
public boolean isActive() {
LocalDateTime now = LocalDateTime.now(ZoneId.systemDefault());
boolean sameMonth = now.getMonthValue() == this.monthDay.getMonthValue();
boolean sameDayOfMonth = now.getDayOfMonth() == this.monthDay.getDayOfMonth();
return sameMonth && sameDayOfMonth;
}

it's the specific time that's the problem lmao

tall dragon
# remote swallow <@554021111231283200> wheres the code to run something at an exact time
    /**
     * Schedule every Monday.
     * 
     */
    public void schedule() {
        
        LocalDate nextDate = LocalDate.now().with(TemporalAdjusters.next(DayOfWeek.MONDAY));
        Long midnight = LocalDateTime.now().until(nextDate.atStartOfDay(), ChronoUnit.MINUTES);
        ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
        scheduler.scheduleAtFixedRate(()-> { /* Code here */ }, midnight, TimeUnit.DAYS.toMinutes(7), TimeUnit.MINUTES);
    }
#

this is what he sent

vagrant stratus
#

not really what's needed here though, given the amount of arbitrary data

twilit basalt
#

Thanks!

vagrant stratus
#

Scheduling something for a specific month & day within that month isn't the difficult part.
It's getting the time correct that's the problem.
e.g. it could be 1hr, 1min, 1sec or 1hr, 1min, 2sec

#

arbitrary time

#

(╯°□°)╯︵ ┻━┻

grim hound
#

If I want to spoof the PacketPlayOutMap packet, when should I send it? when MapRenderer#render is called? Delay it maybe?

lost matrix
#

Listen for when the packet is sent by the server and send your own one instead?

grim hound
#

That is an option, yes

thorn mason
#

okay so

#

i havent seen anything like it yet but is a health/hunger "bar" like wizard101 as a little ball in the bottom left possible

lost matrix
#

With a resourcepack, yes. It will just be a bit tricky if you want numbers inside as well

thorn mason
#

the numbers were the one part i did know

#

but it would always occupy a hotbar slot for it so it would be a bit annoying

lost matrix
#

You can use the action bar for this

thorn mason
#

duudeee

#

i forgot that thing even existed

#

but could i make it go downwards? im pretty sure i can move it to the left as much as i want but idk about down

lost matrix
#

Yes with some font magic you can move it to the left, right, down and up

#

This screenshot shows how sprite characters look like in chat and in the action bar

#

And here you can see that symbols are moved in different directions.

thorn mason
#

interesting

#

i shall get googling

chilly hearth
#

e ok please can someone explain me how can i pass a variable into another class because i cannot make it the variable public or protected and i cannot get the instance of the class

onyx fjord
#

Dependency injection

lost matrix
#

?di

undone axleBOT
onyx fjord
#

Also remember about getters and setters

chilly hearth
#

so how can i do it

onyx fjord
#

Check the linked wiki article

chilly hearth
#

alr

#

that can pass variables as wel l?

#

ok so if i have a variable of i = 0; for example how can i use this i into another class

wary remnant
#

?di

undone axleBOT
chilly hearth
#

i cant understand that ....

shadow night
#

Maybe you should like explain why you variable is like it is

onyx fjord
#

It's a basic concept

chilly hearth
#

there is just plugin.getname

#

not an variable

onyx fjord
#

Send your class

chilly hearth
#

me ?

onyx fjord
#

Yes

chilly hearth
#

which class

#

class in which variable exists ?

onyx fjord
#

Yes

chilly hearth
#


                WitherSkeleton ent = Bukkit.getWorld("world").spawn(player.getLocation(), WitherSkeleton.class);

                ent.setCustomName(ChatColor.BLUE + "" + ChatColor.BOLD + "Ancient Wither Skeleton");
                ent.setCustomNameVisible(true);
                ent.getEquipment().setChestplate(new ItemStack(Material.DIAMOND_CHESTPLATE));
                ent.getEquipment().setLeggings(new ItemStack(Material.DIAMOND_LEGGINGS));
                ent.getEquipment().setItemInMainHand(new ItemStack(item));
                ent.setMaxHealth(2048);
                ent.setHealth(plugin.getConfig().getDouble("Ancient.health"));
                ent.addPotionEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, Integer.MAX_VALUE, plugin.getConfig().getInt("Ancient.strength")));
                ent.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, Integer.MAX_VALUE, plugin.getConfig().getInt("Ancient.speed")));
                ent.getNearbyEntities(30, 30, 30);

                Double x = ent.getLocation().getX();
                Double y = ent.getLocation().getY();
                Double z = ent.getLocation().getZ();

                PersistentDataContainer ancdata = ent.getPersistentDataContainer();

                ancdata.set(new NamespacedKey(Bosses.getPlugin(), "anc") , PersistentDataType.STRING , "anc");

                ent.addScoreboardTag("s");

#

here simple thing

#

i want to accsess that "ent " variable into another class

echo basalt
#

ain't the first time I'm telling you

onyx fjord
#

That isn't the class

echo basalt
#

and surely won't be the last

#

?learnjava

undone axleBOT
chilly hearth
#

omg

#

bro

#

in java u can just make the variable protected or public and get the instance of class and boom u can accsess the variable

echo basalt
#

One of the 4 principles of OOP is Encapsulation

chilly hearth
#

but its not letting me define the variable as protected or public

echo basalt
#

Collections are also a thing

tall dragon
#

cuz ur doing it in a dang method

onyx fjord
#

Send your whole class

tall dragon
#

sometihng u should know

chilly hearth
onyx fjord
#

...

shadow night
#

You copy your whole class?

chilly hearth
#

no

#

wait

#

?paste

undone axleBOT
onyx fjord
#

Ctrl + a, ctrl + c

shadow night
#

That's like when I was little, my dad taught me how to use computers. One thing he taught me was Ctrl + c, ctrl + v

chilly hearth
#

bro

#

you want me to paste the whole class here ?

#

alr