#help-development

1 messages ยท Page 2065 of 1

desert musk
#

java is wack holy shit

#

thank u

ivory sleet
#

String x = "";
for (var s : args) {
x = x.concat(s);
}

#

lol

#

nw

quaint mantle
#

dont actually do that ^^

ivory sleet
#

yes

#

that too

desert musk
#

lol

lavish hemlock
#

Yeah actually you should probably use a StringBuilder

viral temple
#

String.join("", list)

lavish hemlock
#

concat would create a StringBuilder per iteration iirc

ivory sleet
#

ye

desert musk
#

i see

lavish hemlock
#

con-cat

#

HAHA

#

CAT PUN

desert musk
#

lmfao

#

shut the fuck up

#

๐Ÿคฃ

#

who is this outlaw

viral temple
lavish hemlock
#

I believe it's Arrays.toList

viral temple
#

Or list.of

#

Can't remember

lavish hemlock
#

Arrays.toList and List.of are actually implemented differently

#

For one, the former is like, as old as the JDK.

viral temple
#

List.of is immutable

lavish hemlock
#

The second was introduced in... I think Java 16?

#

Arrays.toList returns a package-private implementation of List that exists as a inner-class of Arrays

#

Which is fixed-size but not immutable.

grim ice
#

btw

lavish hemlock
#

Meaning you can use set on it, just not add.

grim ice
#

can I use java in place of nodejs/php

lavish hemlock
#

List.of returns different implementations depending on the amount of elements.

#

For instance, 0 = Collections.emptyList() (which is a singleton instance of an implementation called EmptyList)

#

1 = singletonList I think?

#

Actually 1 and 2 might be List12, which is specific to List.of

#

And then everything after that is ListN

viral temple
#

Anyway, good night everyone, if the comments for the yaml works, I'm gonna post soon a free* resource for leaderboards that makes 0 or less lag

ivory sleet
#

pog

viral temple
#

#multi-threading
#with-no-queue

lavish hemlock
#

I have no idea why Microsoft is the way they are

#

"You can use our mappings... for development."

desert musk
#

they steal ur code

ivory sleet
#

to stop "skidders" I suppose lol

#

which is in itself a pretty feeble reason imo but ye

manic furnace
#

When I am using mysql in my plugin, should I create a own database with the plugin?

ivory sleet
#

I mean no

#

or well wym by creating your own db?

manic furnace
#

Like when the user uses the plugin, if I should create a database automatically? Sry if that question is stupid, I am new to databases

lavish hemlock
#

You should create a table in the user's DB

visual tide
lavish hemlock
#

The point is that like

manic furnace
lavish hemlock
#

why the fuck aren't they available for production?

#

What is the point in that?

#

Either way I personally think Spigot should just use Yarn mappings for production :p

lavish hemlock
#

Not the package names

#

Also Mojmap can't be used in production

#

Because

#

Microsoft

#

are fucking assholes

#

There should be no point to remapping back to Bukkit names on compile :p

ivory sleet
#

ye

#

it literally sucks

desert musk
#

how do i get the current thread time or something like that

#

i'm making cooldowns for my new command

smoky oak
#

there's no such thing as current thread time

#

but

#

you can just use system time

#

dunno if its a bukkit or java thing tho

#

it spits out the current time in milli or nanoseconds

ivory sleet
vocal cloud
#

Hashmap UUID long. Long is the currentmili of when the user last used it. Simple impl but it works

desert musk
#

thanks

ivory sleet
ornate patio
#

how do i iterate through commands in the plugin.yml

ivory sleet
#

Plugin::getPluginDescriptionFile

ornate patio
#

i've seen PluginDescriptionFile#getCommands()

ivory sleet
#

iirc

#

yeah

#

thats it

ornate patio
#

but for some reason that returns a weird map

ivory sleet
#

ye

ornate patio
#

how would I grab specific values such as usage

#

or description

ivory sleet
#

getCommands().get("commandname").get("usage").toString()

#

or sth iirc

ornate patio
#

alright i'll try that

desert musk
ivory sleet
#

ye

desert musk
#

oh shit nvm it was working i'm just pepega

ivory sleet
#

lol

desert musk
#

can someone explain why sometimes i get
"plugin-version-remapped-obf.jar" instead of
"plugin-version-remapped.jar"

#

or is "plugin-version-remapped.jar" inside of
""plugin-version.jar""

#

bruh

#

its like i just have to spam build until i get remapped.jar

ornate patio
#
survivalrevival:
  description: "Displays the survivalrevival help menu"
  usage: /survivalrevival
deathcoordsvisible:
  description: "Sets whether or not player death coordinates are displayed."
  usage: "Usage: /<command> on|off"

what's the difference between the first and second usage?

ivory sleet
#

analyze the commands with /bukkit:help

cold pawn
#

How would I get the parent value of a key? For some extra context im storing a players UUID to multiple numbers in a file, im using the configuration.getKeys(true) method to get every instance of there UUID, what I want to know is how I would be able to get every number that there UUID is stored in?

desert musk
#

why can't hashmap have a primitive type?

#

am i abusing them?

echo basalt
#

which won't do keys-in-keys type thing

echo basalt
#

it's just a java thing

#

Set<int> is invalid, but Set<Integer> works

cold pawn
desert musk
#

okee

#

also my E key is double clicking

#

concerning...

echo basalt
#

you mean, conceerning

#

:)

desert musk
#

:)

cobalt tinsel
#

hey

#

i want to set a custom color of a glass pane, i know that it's made with setDurability and that 15 is black

mortal cedar
#

Is there any way to bring the 1.16 world generation into a 1.18 server?
I wanna develop my plugin with the newest java version while also making the games playable with 1.16 with old generation but since you cant start a 1.16 server with 1.17 I hoped to just put via backwards onto it with old generation and make it work like that

cobalt tinsel
echo basalt
fossil lily
#
public class BigWither extends EntityWither {
    public BigWither(Location loc){
        super(EntityTypes.aZ, ((CraftWorld) loc.getWorld()).getHandle());

        this.b(loc.getX(), loc.getY(), loc.getZ());

        this.r(false); // Can Pick up Loot
        this.n(true); // Custom Name Visible
        this.a(new ChatComponentText(ChatColor.GREEN + "MyEntity")); // Custom Name
    }
}

Anyone know why it doesnt like this?

echo basalt
cobalt tinsel
cobalt tinsel
echo basalt
echo basalt
#

Try it and see if you like it

cobalt tinsel
#

k

mortal cedar
echo basalt
#

you can also just go into creative and grab the glass and its ID

echo basalt
#

welp I'm bored

#

time to write a tutorial on how to make client-side entities

mortal cedar
#

could you maybe write a tutorial on how to spawn vanilla structures xd

#

I could really need that ^^

echo basalt
#

uhh

mortal cedar
echo basalt
#

that's a ton of nms

crisp steeple
echo basalt
mortal cedar
#

yea I know

#

Or is there a good library that can be used for multiple versions?

fossil lily
fossil lily
echo basalt
#

Here's an example of your error

#
public class Car {

  public int getFuelLeft() {
    return 0;
  }
}

public class BMW extends Car {
  
  @Override // this is optional
  public double getFuelLeft() {
    return -1.0;
  }
}
#

It will error out because you're trying to override a method that has a different return type (int vs double)

smoky oak
#

wait thats optional

echo basalt
#

yes

smoky oak
#

it always screams at me if its not there

echo basalt
#

it often screams if you're returning null on a nullable type

smoky oak
#

huh

fossil lily
#

still hurts my brain

#

What do I want to return?

#

I want to spawn a wither

smoky oak
#

.....honestly just use remapped nms

#

the method names will make a lot more sense

fossil lily
#

ahhhh whats that

smoky oak
#

?nms

#

?remapped

fossil lily
#

xd

smoky oak
#

I always expect those commands to work

#

someone add those

#

anyways let me look for the forum post

fossil lily
#

thanks

smoky oak
#

should be the 2nd post in this thread

fossil lily
#

So I should use that maven import example?

smoky oak
#

well afaik you need to build the server locally with the remapped profile

#

which generates the remapped mojang.jar in your .md2 folder

#

then if you add that maven import it can read that jar and display it in your IDE

#

the second part - the plugin below - is a legally required inclusion

#

something about how your built plugins may not include source code

fossil lily
#

AKJSDG

#

this is so hard

smoky oak
#

what are you trying to do anyways? Spawning a wither shouldnt require nms

fossil lily
smoky oak
#

ah yea that probably requires packet manipulation

fossil lily
#

mhm

smoky oak
#

well as said my recommendation is to use remapped nms if you have to use nms

#

there's one more advantage to that actually

#

not-remapped nms code only works for that exact version

#

remapped nms code is more stable

#

ie can be built for different versions with usually minimal alterations

#

welp imma go sleep now, good luck dude

fossil lily
#

thanks man

#

i hope i understand this eventually

desert musk
#

playerAOEs is a hashmap containing a UUID key and a UUID value, how do i iterate through each key and reference its value through the iterator?

vocal cloud
#

You really shouldn't iterate through a hashmap if you can avoid it. What are you trying to do

desert musk
#

ok kinda complex

vocal cloud
#

map.forEach which takes in a BiConsumer

ivory sleet
#

^

#

or use the entrySet function

desert musk
#

wait wut

#

oh sweet

vocal cloud
#

Like I said though, try to avoid doing it often if you can avoid it.

ivory sleet
#

for (var it = map.entrySet().iterator();it.hasNext();) {
var entry = it.next();
}

#

but yeah the BiConsumer is way more readable

ivory sleet
#

altho negligibly slower, but ye

fossil lily
#

How do I use nms remappings?

#

Whats different about it?

ivory sleet
#

readable stuff

#

gets rid of most obfuscation

fossil lily
#

Is it a different import?

ivory sleet
#

yes but just during compile time

#

you probably wanna look at special source maven plugin or paperwight userdev plugin (maven/gradle)

lavish hemlock
#

Which is a direct equivalent but way more readable

#

(Also easier to type)

spring minnow
#

how do i check if player is going to wear armor?

sand vector
#

I just got this message when exporting. What does it mean and where do I go to solve it.

spring minnow
#

i don't use Eclipse, i advice you to use Intellij Idea

#

Eclipse its a lot outdated

worldly ingot
#

It was literally updated 2 weeks ago wot

worldly ingot
vocal cloud
#

Eclipse isn't outdated it's just a lighter tool with more modularity

worldly ingot
#

Click project, Alt + Enter

#

Java Build Path -> Source. Add the src folder if it's not there

patent horizon
#

does anyone know a way i can index islands?

#

i have 5 main regions of the map and i wanna make a color code system for each and possibly even see what region a player is currently in, but cubic regions wont exactly work

waxen plinth
#

MultiRegion

#

You can use RedLib's MultiRegion to compose one large region out of many cuboids

#

And there's a method to recalculate it to be as efficient as possible in its use of those cuboids

#

Do avoid using it if you have a lot of cuboids though, since it's something like O(n^3) to recalculate with n regions

desert musk
#

?paste

undone axleBOT
desert musk
patent horizon
vocal cloud
desert musk
waxen plinth
desert musk
#

how would you do that

vocal cloud
#

something.whatevertakesinabiconsumer((a,b) -> {})

patent horizon
desert musk
#

now i understand all of that code i read

#

well anywho

#

have fun reading my code in the future

#

when i NEVER use that

waxen plinth
desert musk
#

๐Ÿ˜ˆ

dusty sphinx
#

I'm trying to port a plugin to 1.18.2. I'm getting this error: java.lang.NoClassDefFoundError: org/bukkit/craftbukkit/v1_18_R2/inventory/CraftItemStack at org.vivecraft.VSE.setLocalizedItemName(VSE.java:195) ~[Vivecraft_Spigot_Extensions-remapped-spigot.jar:?]

lavish hemlock
#

What, are you porting it from 1.18 to 1.18.2?

dusty sphinx
#

1.18.1

#

to 1.18.2

lavish hemlock
#

You need to update the plugin to use the proper imports on the NMS side

dusty sphinx
#

Ight

#

what do i need to change

lavish hemlock
#

That error is telling you that this class does not exist:
org.bukkit.craftbukkit.v1_18_R2.inventory.CraftItemStack

dusty sphinx
#

yeah ik

#

i know java im just saying is there a known change

#

my specialsource config may be fucked too

#

im not sure

lavish hemlock
#

Oh actually wait

#

1.18.2 uses the same package name

dusty sphinx
#

wait wait

#

i think im running 1.18.1

tame bay
#

hey there.
Iยดm currently trying to update a plugin from 1.17 to 1.18.2
I cant seem to find the sendPacket function.

((CraftPlayer) all).getHandle().b.sendPacket(new ClientboundInitializeBorderPacket(worldBorder));

lavish hemlock
tame bay
#

pls no ._.

desert musk
#

lol

dusty sphinx
#

got it working

lavish hemlock
#

Have fun :D

tame bay
#

But how do I send packets now?

lavish hemlock
#

Either use remapped or figure out which method is sendPacket

dusty sphinx
#

specialsource still works though innit

lavish hemlock
#

Yeah

fossil lily
#

Okay;

im learning NMS and I found this example on the web, and I changed some stuff.

public class BigWither extends EntityWither {
    public BigWither(Location loc){
        super(EntityTypes.aZ, ((CraftWorld) loc.getWorld()).getHandle());

        this.b(loc.getX(), loc.getY(), loc.getZ());

        this.r(false);
        this.n(true);
        this.a(new ChatComponentText(ChatColor.GREEN + "MyEntity"));
    }
}

First, what do I return?
Second, when I call it up, do I do this?

connection.a(new PacketPlayOutSpawnEntity(BigWither));
echo basalt
#

uhh

#

you can spawn it directly

#

if you want a client-size entity

#

which seems like what you're doing

#

you can just follow a tutorial

sand vector
#

im trying to add items from one item to another. To do this I need to iterate through the map created from event.getCursor().getEnchantments(). How do I do this without knowing the name of the enchants

kind hatch
#

Use a for loop?

itemstack original = whatever method to get the original.
itemstack updated;

for (every enchantment on the itemstack) {
  apply enchant to new itemstack (updated)
}

You could also just clone the ItemStack directly and change what you need. Albiet that would only be beneficial if you don't have to change much.

tall dragon
#

does anyone know where the JedisConnectionException comes from? i know this aint rlly spigot but maybe someone knows.

#

it only seems to throw when my connection has been idle for a bit and no trafic has gone through for a bit.

#

then on the next attemp to do anything it will throw this exception and then work fine again

desert musk
#

is there a method to find the distance between two Locations?

kind hatch
#

Location#distance()

desert musk
echo basalt
#

You can use a jedis pool

fossil lily
#

How do I set what type of entity I want to send with protocol lib? When I set entity id to 1, it just makes an area effect cloud.

tall dragon
#

for thread safety

echo basalt
#

Read it entirely

tall dragon
#

and when i add these lines

        this.pool.setTestWhileIdle(true);
        this.pool.setMinEvictableIdle(Duration.ofMillis(60000));
        this.pool.setTimeBetweenEvictionRuns(Duration.ofMillis(30000));
        this.pool.setNumTestsPerEvictionRun(-1);

the exception goes away. but after like 30 minutes it just stop performing operations.

fossil lily
#

:O

#

Thankis

echo basalt
tall dragon
#

i am indeed returning them to the pool.

tall dragon
fossil lily
#

AY

#

I did it

faint cypress
#

I'm writing a Plugin that will allow me to record Player movements and then play them back.
It will achieve this by saving all of the packets related to the sequence along with the system time that they were sent. It will then play them back in the sequence at the right time using the system time deltas.

I am using ProtocolLib to achieve this.

I will be doing the sending of packets on a different thread with ProtocolLib, which gives me the ability to simply sleep the thread for the duration in between packets.

My question is, is the above description thread safe?
Can I send packets with ProtocolLib on a different thread? Is it okay to sleep intermittently as described?

echo basalt
#

Protocollib IO is async afaik

echo basalt
#

ping

#

Etc

tall dragon
#

at least as far i know this should auto return try(Jedis jedis = server.getPool().getResource()){

echo basalt
#

Eh that's good enough

#

Tbh I prefer getting a resource from the pool whenever I use it, than keeping it alive indefinitely

#

Jedis#isBroken will help

tall dragon
#

you never return the resource?

desert musk
#

how do i test if a block is a bed, and not if it's Material.BLACK_BED | Material.WHITE_BED | Material.ORANGE_BED etc

kind hatch
#

You could do that one of two ways.

  • Create a list of the bed types and compare using #contains()
  • Check the last part of the material name.
tall dragon
#

orrr

#

use Tag.BEDS

#

which contains a list for you already

cobalt tinsel
#

hey

#

where i can get the durability to get a healing potion

crisp steeple
#

look on the item

cobalt tinsel
#

it just says brewing

#

instant health 2

crisp steeple
#

f3+h and then look at the number on the item

worldly ingot
#

What version are you using? There's likely a more abstract alternative

cobalt tinsel
#

16421

worldly ingot
#

PotionData I believe is what it was before 1.13

tall dragon
#

choco you ever work with jedis?

worldly ingot
#

Constantly, yes

tall dragon
#

i would love you ask you a question then

#

my connections stops working after it has been idling for like 30 minutes

#

like i cant publish messages anymore

#

is there some kind of timeout?

worldly ingot
worldly ingot
tall dragon
#

yep

#

i am

#

i create it like this

this.pool = new JedisPool(uri);
        this.pool.setTestWhileIdle(true);

        this.pool.setTestWhileIdle(true);
        this.pool.setMinEvictableIdle(Duration.ofMillis(60000));
        this.pool.setTimeBetweenEvictionRuns(Duration.ofMillis(30000));
        this.pool.setNumTestsPerEvictionRun(-1); 

but tbh im not even sure what these things do

#

before i added these things it would throw a JedisConnectionException after idling for a bit instead of just doing nothin

worldly ingot
#

Yeah connections will auto close after 60 seconds by default so a pool is what you should be using. If you're still having issues, just make sure you're closing your connections to Jedis after using them.

#

e.g.

try (Jedis jedis = pool.getResource()) {
  // Do your Jedis
}```
tall dragon
#

yea i only ever use Jedis in the way you just described

#

so it should auto-close

worldly ingot
#

Then I'm not sure what would boot you off >:/

tall dragon
#

hmm, then i will need to do some more investigating ig

#

thanks anyway :p

fossil lily
#

How can I change the metadata of an outgoing spawn entity packet with protocol lib?

outer sorrel
#

how do i loop through a worldedit selecttion region? I have this code and it only works when the selections are in certain places.something about the order you make the selection in and how i loop through. how can i fix this? im not sure how else to describe it properly

for (int i = sel.getMinimumPoint().getBlockX(); i < sel.getMaximumPoint().getBlockX(); i++) {
                            for (int j = sel.getMinimumPoint().getBlockY(); j < sel.getMaximumPoint().getBlockY(); j++) {
                                for (int k = sel.getMinimumPoint().getBlockZ(); k < sel.getMaximumPoint().getBlockZ(); k++) {
                                    //code
                                }
                            }
                        }
wet breach
gritty basin
#

Hello!
Does anyone know if theres a way to get structures to spawn in a custom map?

#

we have a earth map and would like it to have villages, ruined portals etc

golden turret
#

use b.a(packet)

vocal cloud
#

Or just use mappings kek

golden turret
#

mappings bad for gradle

maiden thicket
tall dragon
#

do i need to send a ping message every X amount of time?

wet breach
#

well that is primarily the reason for connection pools. Is to ensure there is always a connection

#

sending a ping message should allow it to stay open

tall dragon
#

yea, but i am using a connection pool

wet breach
#

because the timeout only applies if no communications occur

#

but a connection pool should be routinely checking if a connection is alive, if it isn't it needs to refresh it

#

if it isn't doing that, then it isn't a very good connection pool

tall dragon
#

should it do that by default

#

or do i need to set some setting

wet breach
#

I have no idea what you are using

#

I can only tell you how its suppose to work or why they even exist

tall dragon
#

hm well right now it has been running for 50 min and its still working. maybe it was a fluke somehow? i have no clue tbh

wet breach
#

well it could have been the OS

#

since the timeout is controlled by that

#

but if you are having to communicate between 2 systems, then you have to look at both

#

one side could terminate earlier then expected lol

#

the default TCP timeout is 30 seconds

tall dragon
#

yea this client - server shit has me hurting my brain already

#

maybe its just time to sleep on it

wet breach
#

but this is why MC protocol even has a ping packet ๐Ÿ˜›

#

and it gets sent like every 10 seconds or so

#

because at that interval it leaves some latency room

tall dragon
#

so i might just be best off having a ping packet as well?

wet breach
#

if your timeout is 30 seconds for the socket, and it takes 5 seconds for the packet to get to its destination, then you need to actually send a ping no later then 20 seconds

wet breach
tall dragon
#

well yea, i really need it to stay open haha

wet breach
#

at least in that manner if you don't get a response back, you need to re-open a new connection

#

because something happened with the old one

tall dragon
#

but shoulnt the pool handle that for me

wet breach
#

it is suppose to yes

tall dragon
#

it should just give me a working one

#

and discard the broken one im pretty sure

wet breach
#

yep

#

that is what it is suppose to do

#

unless it had none in reserve and hit its limit

tall dragon
#

eh, will do some more investigation tommorow

#

its 5AM YEP

wet breach
#

well at least you have more information then you did previously

tall dragon
#

yep, thank you for that.

desert musk
#

can someone help recommend sleeping pills

young knoll
#

Wut

sharp flare
#

that commit history though

#

always test your stuffs

noble lantern
#

on my private projects i typically work all day, and then at the end of the day i push it all in one 1k+ additions commit

#

only reason i see the need for 50 commits in a day is if your fixing bugs on a public plugin

#

even then.... why so many commits

summer scroll
#

It's not a bad thing right to have a lot of commits.

noble lantern
sharp flare
#

yeah I'd rather push most of my changes (assuming Its tested properly) in a commit unless there are unseen typos, etc

noble lantern
#

yeah i can understand random typos or maybe removing some debug logs you possibly forgot

But dont write a method and then push to git lmao

#

Question: How do block AsyncPlayerJoinEvent?

#

Would you just set the result to a deny result, and then set it to a allowed result once your ready?

#

Or if im already processing loading data will it automatically just block until i finish doing what i need to?

quasi patrol
#

I am confused with the 1.17 NMS cause it is no longer PlayerConnection connection = craftPlayer.getHandle().playerConnect; and so I have no clue what the new one is. D:

summer scroll
noble lantern
#

you can ctrl + click and view all methods that can return that object

summer scroll
summer scroll
quasi patrol
# summer scroll Yes, it's `b` I think

Do you know what the equivalent of PacketPlayOutPlayerInfo.EnumPlayerInfoAction.REMOVE_PLAYER, and PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER is?

summer scroll
#

What do you mean equivalent?

hexed orbit
#

Hello everyone, everything good? Could someone help me send a player to a specific position on another server with BungeeCord? Thanks
For example: send the player to the Lobby server, but in a specific position on that server

crisp steeple
noble lantern
#

^

crisp steeple
#

(and player)

quasi patrol
lavish hemlock
#

then

#

f i x i t

hexed orbit
#
   out.writeUTF("Connect");
   out.writeUTF("skywars");
   p.sendPluginMessage(this, "BungeeCord", out.toByteArray());```
crisp steeple
#

you could write something like "player:<player uuid>"

#

and then the coords as well

outer sorrel
#

is it possible to change the delay of a bukkitrunnable task inside of it while its running?

crisp steeple
#

i doubt that

#

unless runTaskTimer overrides the previous value

summer scroll
#

Yeah I don't think it's possible.

#

But there is a workaround, by set your own "time" inside the task.

outer sorrel
#

is there a good way to foreever run code with different delay times?
i tried something like this but it keeps giving thread dumps, not my actual code just anb exmaple i made quickly

while (true)
  int delay = 20;
  new BukkitRunnable() {
    // some code to run
    delay = new Random.nextInt() * 100;
  }.delay(20);
}```
outer sorrel
summer scroll
#

Create one BukkitRunnable that runs every 1 second

#

What are you trying to achieve anyway? It looks like an xy problem.

outer sorrel
#

no

crisp steeple
#

๐Ÿค“

river oracle
crisp steeple
#

I cannot believe i have been invited to the real discord tester program

#

And all i have to do is enter my email and password

noble lantern
#

omg ikr

#

i cant wait to see if im accepted

fading lake
#

free robux???! sure, lemme just get my social security number for u

outer sorrel
river oracle
#

what are you trying to do

outer sorrel
#

i have a section of blocks that changes every random amount of time, 1-10 seconds for example, and i want it to forever run

river oracle
#

a sync task should work with that

#

scheduled one

#

maybe its the wrong one

sullen marlin
#

the problem is your while true lol

#

remove that

#

and your code is just weird af

outer sorrel
sullen marlin
#

read the scheduler wiki

#

?scheduler

outer sorrel
sullen marlin
#
BukkitWiki

This tutorial will guide you in using the scheduler provided by bukkit. It will allow you to defer the execution of code to a later time. This is not the same as registering a Listener, a block of code which is executed in response to an event in the game. Blocks of code may also be scheduled to be executed repeatedly at a fixed interval, with o...

outer sorrel
#

ill check that out thanks

#

do they allow me to change the delay time though?

river oracle
#

wait were you putting the scheduler in the while loop;

#

the entire point of the scheduler is to not do that

#

you'd be spawning an infinite amount of scheduler tasks

summer scroll
outer sorrel
#

yea its just the closest ive gotton to a solution, it is bad

outer sorrel
summer scroll
#

I told you, create a task that run every 1 second, and add conditions inside the task

river oracle
#

to do this you would use a scheduler as md5 posted above

outer sorrel
river oracle
#

you make ascheduler and add logic inside

summer scroll
#
Bukkit.getScheduler().runTaskTimer(instance, 0L, 20L, () -> {
  int timer = 0;
  
  if(timer == 5){
    // do something
  }  

  timer++;
});
outer sorrel
#

ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

#

that makes sense

#

thanks

summer scroll
#

No problem

crisp steeple
vale jolt
#

HI, I'm starting to learn java, and I have a problem with a BlockBreakEvent, I've already looked on the forums, and I can't find an understandable answer for me, so I send you my code and my errors

 package fr.charpy.openwar;

import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockEvent;

public class OpenWarList implements Listener {
    
    @EventHandler
    public void onBreakBlock(BlockBreakEvent e){
        
        
        Player p = e.getPlayer();
        p.playSound(p.getLocation(), Sound.ORB_PICKUP, 2.0F, 1.0F);
        ((BlockEvent) p).getBlock();
        System.out.println(e);
        
        
    }
}

and the error :

org.bukkit.event.EventException
...
Caused by: java.lang.ClassCastException: org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer cannot be cast to org.bukkit.event.block.BlockEvent
        at fr.charpy.openwar.OpenWarList.onBreakBlock(OpenWarList.java:16) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_322]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_322]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_322]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_322]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:334) ~[JavaPluginLoader$1.class:1.7.10-40]
        ... 18 more```
crisp steeple
#

you are trying to cast a player to a block event

#

that is not going to work in any circumstance

vale jolt
#

how i can fix that ?

crisp steeple
#

why are you trying to do that in the first place?

vale jolt
#

when a player break a block i want to play a XP orb sound

crisp steeple
#

it looks like you already did that in the line above

vale jolt
#

yes i remove ((BlockEvent) p).getBlock();
System.out.println(e); and its work x) im so dumb wtf

crisp steeple
#

yeah im not even sure why that even compiled in the first place

noble lantern
#

So ive been experiementing with Lombok recently and really love it but

Does anyone know if there is another library similar to it, that allows a @Adder annotation?

sullen marlin
#

What would adder do?

noble lantern
#

Basically add adder methods for data types like int and long etc

#

Basically so i wouldnt have to write out basic methods like this, like i would with get and set using Lombok

solar sable
solar sable
noble lantern
#

You can set the background in file -> settings -> Appearance -> Change Background

#

Thats the theme plugin

solar sable
#

so you just change the background i see

#

I thought it was a special theme lol

noble lantern
#

Nah background is just changeable in this area

#

but transparency is a little buggy

#

took me a while to find a picture (had to edit it as well) to get it with with the alpha texture

#

you have to use a different form of alpha, where it doesnt show up on the picture preview

tardy delta
#

o

vale jolt
#

do u know how to call modded item with spigot ?

        if (((BlockEvent)p).getBlock() == Material.valueOf("IC2_blockRubLeaves")) {
            if (p.getGameMode() == GameMode.SURVIVAL) {
                p.playSound(p.getLocation(), Sound.ORB_PICKUP, 2.0F, 1.0F);
eternal needle
tardy delta
chrome beacon
eternal needle
chrome beacon
#

Yes

eternal needle
#

ok

vale jolt
hardy crystal
#

Hello, I try to update a plug-in for my server, but I need to import the nms, after various test, I import the nms whit buildtools remapped (bukkit and craftbukkit), but I have error whit net.minecraft, how can I import it?

tardy delta
#

what is p btw?

vale jolt
#

player

tardy delta
#

you cant cast a player to an event

#

that doesnt make sense

vale jolt
#

ok but how to call modded item ? is that good ?

eternal needle
buoyant viper
#

?nms

#

oh, not a command

hardy crystal
#

I build buildtools whit the โ€”remapped option

#

(For 1.18.2)

#

Craftbukkit and bukkit work

amber palm
#

Hello Guys, my Plugin will not save the things in my config.
code:
String creator = player.getUniqueId().toString(); String guildname = args[1].toString(); Integer claims = 2; Integer points = 0; Integer level = 0; Guildconfig.get().createSection(guildname); Guildconfig.get().createSection(guildname + ".creator"); Guildconfig.get().addDefault(guildname + ".creator" , player.getUniqueId().toString()); Guildconfig.get().createSection(guildname + ".claims"); Guildconfig.get().addDefault(guildname + ".claims" , claims.toString()); Guildconfig.get().createSection(guildname + ".points"); Guildconfig.get().addDefault(guildname + ".points" , points.toString()); Guildconfig.get().createSection(guildname + ".level"); Guildconfig.get().addDefault(guildname + ".level" , level.toString()); Guildconfig.get().options().copyDefaults(true); Guildconfig.save();

whats in the config:

testguild: creator: {} claims: {} points: {} level: {}

whats wrong?

hardy crystal
#

But net.minecraft no

wild nexus
#

Hi, i want to create a GUI that show the craft of my new item (Cobblestone compressed Tier 1, Tier 2, Tier 3, Tier 4), i've got the function to get the item's craft and to show it on the GUI but when i choose to see the craft for example of my cobblestone Tier 2 or Tier 3, the GUI show me the craft of my Cobblestone Tier 1 and the same for my Iron Pickaxe Tier 2, Tier 3, Tier 4, the gui show me the craft of my Iron Pickaxe Tier 1.
I think it's the method Bukkit.getRecipesFor that does not take the ItemMeta of my selected Item to find her recipe.
Sorry for my English

buoyant viper
hardy crystal
#

I send my Pom.xml

#

One second

buoyant viper
#

?paste

undone axleBOT
hardy crystal
hardy crystal
hardy crystal
#

To convert in 1.18.2

#

(I never used nms, but I need this plug-in in 1.18.2 for my server, and maybe for pubblic)

outer sorrel
#

i have a function that saves data to a yml file like

blocks:
  '1'
    '1'
      -'1': minecraft:stone
    '2'
      -'5': minecraft:wood
  '2'
    '4'
      -'2': minecraft:oak_door[facing=west,half=lower,hinge=left,open=false,powered=false]
etc
``` how could i get those values back into a class (BlockData)?
sullen marlin
#

createBlockData(String)

outer sorrel
#

ah just found that, thanks

hardy crystal
hardy crystal
lethal knoll
#

Anyone an idea since which version the TextComponent was introduced?

sullen marlin
#

1.7

lethal knoll
#

Alright thanks one more question, in order to use it you need to use .spigot(), does it mean that it will only work for spigot or forks of spigot?

sullen marlin
#

yes... which is all server software made in the last 7 years

lethal knoll
#

Alright, all good, thank you

#

and yes indeed

hardy crystal
#

F everyone ignore me

sullen marlin
#

run buildtools

#

there is no step 2

hardy crystal
#

Whit remapped option

noble lantern
sullen marlin
#

theres nothing comparable to lombok

#

so if lombok doesnt have it nothing will

hardy crystal
#

And after I put spigot on Pom.xml whit mojang remapped

noble lantern
#

Thanks md5!

hardy crystal
amber palm
hardy crystal
#

And build tools run whit the remapped option

#

I reed the 1.17 and 1.18 change

sullen marlin
#

post your buildtools log

hardy crystal
lethal knoll
# amber palm no one knows whats wrong?

There is literally a bunch of things that could be wrong. the path is incorrect, you didn't save the initial file, your GuildConfig being undefined, do you have any erros?

amber palm
#

it just wont save it

lethal knoll
sullen marlin
#

idk what your issue is, the nms jar is clearly there C:\Users\manfr.m2\repository\org\spigotmc\spigot\1.18.2-R0.1-SNAPSHOT\spigot-1.18.2-R0.1-SNAPSHOT-remapped-mojang.jar

#

whats your maven log

amber palm
#

i dont have github but i upload it hear

#

heres the code

#

the config looks after creation of the guild so:
test:
creator: {}
test1:
creator: {}

lethal knoll
#

did you run the setup method?

amber palm
#

yea

#

in the OnEnable

lethal knoll
#

does it create the file or not?

amber palm
#

yes

#

it creates everything

lethal knoll
#

okay

amber palm
#

but not sets the value

#

test:
creator: {}

#

that whats it says

#

but without value

#

the value is String creator = player.getUniqueId().toString();

lethal knoll
#

did you check if the code ever reaches the line where it saves?

amber palm
#

it does because the Sections will be saved

#

but the defaults not

lethal knoll
#

what are you trying to achieve with the copyDefaults?

amber palm
#

its copying the adddefaults in the config

#

but it does it not xD

#

im trying out with a set value

#

not with a UUID

lethal knoll
#

but why do you not just set the value?

#

instead of set defaults

#

I never use the default stuff

amber palm
#

how do i do that?

lethal knoll
#

.set(Object, value)

amber palm
#

okay

#

thx you

#

it worked. Thank you so much mate

lethal knoll
#

no problem

modern vigil
#

Is there a page that shows all the nms methods, as letters but with actual docs?

#

like with the method signature and what the methods do

lethal knoll
amber palm
#

next problem xD

#

Map<String, Object> Guildsearch = Guildconfig.get().getValues(true);
if (Guildsearch.containsKey(creator)) {
player.sendMessage("ยงcYou are already in a Guild");
} else if (Guildsearch.containsKey(guildname)) {
player.sendMessage("This Guild already Exists.");
}

here does it not check if the players is in a Guild. so it not checks deeper then the name.
Config looks so:
test:
creator: c705ef9f-0cfe-49ae-aced-d9186a9e6207
test1:
creator: c705ef9f-0cfe-49ae-aced-d9186a9e6207

lethal knoll
#

please put this in a format with ``java

amber palm
#

`Map<String, Object> Guildsearch = Guildconfig.get().getValues(true);
if (Guildsearch.containsKey(creator)) {
player.sendMessage("ยงcYou are already in a Guild");
} else if (Guildsearch.containsKey(guildname)) {
player.sendMessage("This Guild already Exists.");
}

here does it not check if the players is in a Guild. so it not checks deeper then the name.
Config looks so:
test:
creator: c705ef9f-0cfe-49ae-aced-d9186a9e6207
test1:
creator: c705ef9f-0cfe-49ae-aced-d9186a9e6207`

lethal knoll
#

you need to check on the path

amber palm
#

whats the get of that?

lethal knoll
#

what are you trying to do?

grim ice
#

this is so messy

#

wtf do u want to do

amber palm
#

to check if the player is already in a Guild or the guild already exists

lethal knoll
#

yes, it is, but experience comes with time

grim ice
amber palm
#

test: creator: c705ef9f-0cfe-49ae-aced-d9186a9e6207 test1: creator: c705ef9f-0cfe-49ae-aced-d9186a9e6207

lethal knoll
#

I recommend you to make your config like this:

grim ice
lethal knoll
#
guilds:
 guild1:
   members:
     - ID1
     - ID2
#

the reason why is so you can fetch all keys from the parent "guilds"

grim ice
#

if ur thing is like

lethal knoll
#

really depends on what you are trying to store tbh

grim ice
#

guilds:
test1:
creator: X

#

then

grim ice
#

loop through the configuration section of guilds

#

with getKeys(true)

hardy crystal
amber palm
#

i want it so at the end:

Guilds:
Guild1:
Creator:
Members:
Points:
Level:

grim ice
#

then check if the value from the key is the creator u want

#

btw u shouldnt store stuff like that in config

hardy crystal
grim ice
#

config is meant for configuration not storing player information

hardy crystal
#

Doesnโ€™t exist

grim ice
#

use a database instead but that might be too complicated for you so ig keep on with a config

sullen marlin
#

Well you need to add 1.16

#

You only added 1.18

grim ice
#

but in the long run u will need to use a database

#

Anyways

lethal knoll
amber palm
lethal knoll
#

maybe that will be better for you

grim ice
#

dont

#

never

#

bad advice

#

if ur gonna get to that degree just use a database

#

Anyways

#

loop through the config getKeys()

#

getKeys(true)

#

and check if the value is the player uuid

lethal knoll
#

What do you mean bad advice ?

amber palm
#

yea ^^

grim ice
#

Do not use serialization

#

for that

hardy crystal
#

Thanks

grim ice
#

thats bad advice

lethal knoll
#

What else would you use serialization for?

grim ice
#

Anything other than that

lethal knoll
#

like what?

#

It's literally made for that purpose

grim ice
#

Nope

#

Its for storing objects in string inputs

#

e.g u wanna store an itemstack in a database

#

u cant put an itemstack there

#

it needs to be a VARCHAR

#

people usually encode it with Base64

lethal knoll
#

that's not what I meant, but okay

grim ice
#

like i did here

#

anyways

#

@lethal knoll or when you want an entity

#

stored in a config or database

#

you can use my library that serializes it

#

Serializing isnt made for storing data that can be represented as a sequence of chars

#

if you can represent it that way, use flat files databases, or a database

lethal knoll
#

Well, spigot literally has implementations to serialize it to configuration files

#

so whether you believe that the use case is not valid , I leave that fight up to you between md5 and you

grim ice
#

Youre really wrong

#

Oh my god

#

give me one fucking thing that implements ConfigurationSerializable

#

that can be represented in a String format and retrieved again easily

lethal knoll
#

What do you mean?

grim ice
#

I meant what I meant lol

#

if you dont know how spigot configuration serializing works dont talk about it

lethal knoll
#

I do know how it works ...

grim ice
#

Then why are you asking what I meant

#

@lethal knoll how would you store an entity in the config?

#

You cant, thats why you need to serialize it somehow

#

thats because an entity cant be represented in a string format

#

like a uuid

#

you should never serialize a uuid, since it can be represented in string format

#

so what you suggested should never be done

amber palm
#

@grim ice why does it not work? did I forget something?

` Set<String> Guildsearch = Guildconfig.get().getKeys(true);

            if (Guildsearch.contains(creator)) {
                player.sendMessage("ยงcYou are already in a Guild");
            } else if (Guildsearch.contains(guildname)) {
                player.sendMessage("This Guild already Exists.");`
grim ice
#

thats not how to do it

#

the guildSearch one would work

#

but the creator one wont

amber palm
#

how does it work?

grim ice
#

you have to loop through the keys, then check if the value of the key

#

is the creator uuid

amber palm
#

config looks so:
Guilds:
test:
creator: c705ef9f-0cfe-49ae-aced-d9186a9e6207
claims: 2
points: 0
level: 0
members: {}

grim ice
#
for(String sectionName : config.getConfigurationSection("Guilds").getKeys(false)) {
    if(config.getString("Guilds." + sectionName + ".creator").equalsIgnoreCase(uuid.toString)) {
// player created a guild before.
    }```
#

whats this doing is looping through the keys of Guilds, then checking if their creator value is the uuid of the creator

#

sectionName is their guilds name btw

amber palm
#

sectionname is the guildname

grim ice
#

Yep

amber palm
lethal knoll
#

@grim ice , to answer your question, I would have created a class Guild that implements serializable

#

I'm not talking about serializing individual values ...

grim ice
#

I would make a factory pattern

lethal knoll
#

That is absolutely not bad design

grim ice
#

in the interface Guild

#

to manufacture

noble lantern
#

you can store java classes as Gson json objects considering you create a serializable class (Not a Entity class or similar)

grim ice
#

a guild from info passed in

grim ice
#

You should not serialize info that can be stored in string format

#

Youre missing the whole point of serializing

lethal knoll
#

No I am not, what if for any reason he starts to store more information then string values

#

I am talking about serializing the Guild class

#

Which is 100% fine

#

I know my stuff

#

I'm far from a beginner

noble lantern
grim ice
#

You seem to not know it

noble lantern
#

storing it as yaml is just more work

lethal knoll
grim ice
#

You shouldnt serialize it thats just painful

noble lantern
#

gson its 2 lines of code and stupidly simple

grim ice
#

Oh dear god

lethal knoll
#

Serializing and deserializing classes is piece of cake

#

it's literally creating properties in your class, and the serialization does the rest for you

grim ice
#

Fucking up your design is a piece of cake as well

#

You shouldnt serialize entities that can be stored in a string format

lethal knoll
#

Okay, think it your way

grim ice
#

the whole point of serializing is to turn something that cant be stored in a string into a string

#

youre turning something that can be made into a string without serializing

#

into a string

#

with serializing

#

thats just dumb

amber palm
#

Hex i cant set Sectionname to guildname

#

it gives a ERror

grim ice
amber palm
#

Error

noble lantern
#

send error

grim ice
#

am i supposed to guess what error is it

#

send it lol

amber palm
#

no xD

noble lantern
#

when you get 500 hours of java under your belt you get the skill to guess errors

#

do yall not know that?

lethal knoll
amber palm
#

for(guildname : Guildconfig.get().getConfigurationSection("Guilds").getKeys(false)) {

he want there a ; but where?

noble lantern
#

not just guildname

grim ice
#

not just guildname

amber palm
#

but the Strring is set

#

String guildname = args[1];

grim ice
#

lol no

amber palm
#

so?

grim ice
#

thats a foreach var

noble lantern
#

that first argument is what getKeys() is iterating through

grim ice
#

a for loop variable

#

oh whatever

#

do String guildName

#

or sectionName

#

just have it different from ur other variable

amber palm
#

okay thx

noble lantern
#

i wonder if getKeys works in lambda form i never tried that

grim ice
#

stop it

#

you clearly dont know the point of serializing

#

how about this

#

ill be serializing a string into a string

#

does that look okay to you

noble lantern
#

just store the string in a file directly

#

its a string

grim ice
#

but yes

lethal knoll
#

Again, I'm talking about serializing a Guild class

noble lantern
#

well whichever way your storing it

grim ice
#

HOLY FUCK

#

anyways

noble lantern
grim ice
noble lantern
#

gson works with mongodb as well ๐Ÿ˜‰

noble lantern
#

i could make the body async but meh

grim ice
#

DRY

lethal knoll
grim ice
#

so put it in the metheod

#

method

#

and name writeDataToFileAsync

noble lantern
#

or a async method like that ^

grim ice
#

oh yeah that makes sense

amber palm
#

org.bukkit.command.CommandException: Unhandled exception executing command 'guild' in plugin EmpiresSystemPlugin v1.0.0 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[server.jar:3284a-Spigot-3892929-0ab8487] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[server.jar:3284a-Spigot-3892929-0ab8487] at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:790) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.server.network.PlayerConnection.handleCommand(PlayerConnection.java:1931) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1770) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1751) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:46) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:30) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.server.TickTask.run(SourceFile:18) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.util.thread.IAsyncTaskHandler.executeTask(SourceFile:151) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.util.thread.IAsyncTaskHandler.executeNext(SourceFile:125) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.server.MinecraftServer.bf(MinecraftServer.java:1148) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.server.MinecraftServer.executeNext(MinecraftServer.java:1141) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.util.thread.IAsyncTaskHandler.awaitTasks(SourceFile:134) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.server.MinecraftServer.sleepForTick(MinecraftServer.java:1125) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1054) ~[server.jar:3284a-Spigot-3892929-0ab8487] at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:305) ~[server.jar:3284a-Spigot-3892929-0ab8487] at java.lang.Thread.run(Thread.java:833) [?:?] Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getKeys(boolean)" because the return value of "org.bukkit.configuration.file.FileConfiguration.getConfigurationSection(String)" is null at Commands.Guildcommands.onCommand(Guildcommands.java:70) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[server.jar:3284a-Spigot-3892929-0ab8487] ... 19 more

thats the error because its Null

noble lantern
#

WOAH

dire marsh
#

AAA PLEASE USE PASTE SITE

noble lantern
#

SIRE

#

?paste

undone axleBOT
amber palm
#

okay

dire marsh
#

not even a codeblock either smh

grim ice
#

ur Guilds section does not exist @amber palm

amber palm
#

ohhhh

#

i need to set first the guilds section ^^

noble lantern
#

ngl though i should make a togglable async option for that

grim ice
#

and is it abstracted

#

if not then make an interface for it

#

Libraries and APIs should be abstracted

#

The user only has access to interfaces

#

he doesnt interact with classes

noble lantern
#

That class itself isnt abstracted itself

Most of the API runs on Functional Interfaces but the data part is abstracted

grim ice
#

ic

noble lantern
#

you extend a JsonDataClass that stored the File, and another class you call a instance upon managed the actual file saving

grim ice
#

Abstract classes arent always absolute abstracting

#

but ig

noble lantern
#

basically the API works by handling all the caching for you in a HashMap

#

and you basically just call a new instance of PluginDataMap whenever you want a new DataMap for something else, this one is just for player data

viral temple
#

๐Ÿค”

viral temple
#

how does this work?

noble lantern
#

lombok ftw

stark carbon
#

its possible texture pack spigot ?

noble lantern
stark carbon
dire marsh
noble lantern
grim ice
dire marsh
#

the non simplified makes more sense to me

noble lantern
#

didnt you know you can just { stuff } lmfao

noble lantern
viral temple
noble lantern
#

well tbh im not sure what your doing there

#

is that your constructor orrr?

amber palm
#

?paste

undone axleBOT
viral temple
#

i want to create an ConfigurationSection with pre-defined default values

amber palm
#

now it says nothing. no error and it dont work

noble lantern
#

ah so it is your constructor

viral temple
#

yes

#

kind of

noble lantern
#

Why not have it like this?

grim ice
#

and let the user do .get()

noble lantern
#

Looks a lot better to the naked eye

viral temple
grim ice
viral temple
grim ice
#

no

#

ur passing a configrationsection

noble lantern
#

^

grim ice
#

not a Supplier<ConfigurationSection>

viral temple
#

the value must be a configuration section

grim ice
#

sigh

#

u can just .get()

#

later

viral temple
#

this is what I'm trying to achive

grim ice
#

yeah

#

and

#

that doesnt change what i said

viral temple
#

nevermind then, I'm doing in the constructor

#

bruh, I could always do that

tranquil valley
#

Who In here is a skyblock god dev?

grim ice
#

skyblock god?

noble lantern
#

I dont mean to brag but

#

i did add support for wildstackers on bento box

tranquil valley
#

I call hacks

noble lantern
#

In all honestly though

#

theres no such thing as a "god dev"

tranquil valley
#

Get ban YB better + ratio

noble lantern
#

sir this is spigotmc not rust (the game) discord

tranquil valley
#

But anyway let me ask my question

#

So you know how we have the skyblock layout... what if we could add a entertrace to the layout like I'm talking about bridges/walkway/houses and they could change the themes by doing into /permissions island and gonto the theme and pick whatever theme that they want from the section

#

do you know how to code that

noble lantern
#

that already exists

tranquil valley
#

Oh wait?

noble lantern
#

but the player would lose everything on theyre island doing that

tranquil valley
#

Where?

noble lantern
#

iirc bento box does it

#

same with iridium

#

its pretty much a common thing now

#

players being able to swap island themes

tranquil valley
#

I can't send u pictures here can I send it to you on dms

noble lantern
#

verifiy your account

tranquil valley
#

No sus shit

noble lantern
#

and you can send pictures

tranquil valley
#

I don't have a account

noble lantern
#

Wtf

#

make one lol

tranquil valley
#

Eh

#

Jk making one rn

noble lantern
#

this is if you are asking for java support

#

ie help my code doesnt work type thing

tranquil valley
#

They ignore me

noble lantern
#

that doesnt provide much info

tranquil valley
#

There's a boarder line between the players island and the entertrace

hardy crystal
#

@sullen marlin sorry for the ping, but i have problem whit build cannot access net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo.PlayerInfoData

#
[INFO] ------------< org.golde.bukkit.corpsereborn:CorposeReborn >-------------
[INFO] Building corpose reborn 3.0 BETA 1
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ CorposeReborn ---
[INFO] Deleting C:\Users\manfr\Desktop\intellij idea\corpose reborn\target
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ CorposeReborn ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ CorposeReborn ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 68 source files to C:\Users\manfr\Desktop\intellij idea\corpose reborn\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /C:/Users/manfr/Desktop/intellij idea/corpose reborn/src/main/java/org/golde/bukkit/corpsereborn/nms/nmsclasses/NMSCorpses_v1_18_R2.java:[61,61] cannot access net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo.PlayerInfoData
  bad class file: C:\Users\manfr\.m2\repository\org\spigotmc\spigot\1.16.5-R0.1-SNAPSHOT\spigot-1.16.5-R0.1-SNAPSHOT.jar(/net/minecraft/server/v1_16_R3/PacketPlayOutPlayerInfo$PlayerInfoData.class)
    bad RuntimeInvisibleParameterAnnotations attribute: PlayerInfoData(com.mojang.authlib.GameProfile,int,net.minecraft.server.v1_16_R3.EnumGamemode,net.minecraft.server.v1_16_R3.IChatBaseComponent)
    Please remove or make sure it appears in the correct subdirectory of the classpath.
[INFO] 1 error
[INFO] -------------------------------------------------------------```
vocal cloud
#

Did you just ping md_5 for an issue lmfao

hardy crystal
visual tide
#

is it possible to kill a player with a custom death message without additionally listening for palyerdeathevent?

hardy crystal
#

first

quaint mantle
#

are spigot plugins compatible with paper?

vocal cloud
#

yes

quaint mantle
#

ok

west oxide
#

how can i compile plugin from github (its my plugin am just learning to use github)

#

when i do it i get this

#

no .jar file

vocal cloud
#

you need to build it

west oxide
vocal cloud
#

by using an IDE?

west oxide
#

this doesnt work

#

this does what i showed

sharp flare
#

what argument you using for your build

west oxide
vocal cloud
#

Run mvn package

sharp flare
#

click the green button

west oxide
vocal cloud
#

And

west oxide
#

it did what i showed also

sharp flare
#

try clean package?

west oxide
vocal cloud
#

and what is the output of that

sharp flare
#

what error shows up

west oxide
sharp flare
#

can u show ur project structure fields

vocal cloud
#

send your pom

west oxide
west oxide
sharp flare
#

do what mike said first

vocal cloud
#

?paste pom

undone axleBOT
west oxide
vocal cloud
#

pom is good. But I'm curious what shows up in the build log if you just run

west oxide
#

oh wait

#

that worked

tall dragon
#

does any1 know why this class could throw an ExceptionInInitializerError?

public class GlobalGson {

    private static final GsonBuilder BUILDER = new GsonBuilder()
            .registerTypeAdapter(AnnihilationClan.class, ClanJsonAdapter.class)
            .registerTypeAdapter(ClanUser.class, ClanUserJsonAdapter.class)
            .disableHtmlEscaping();

    public static Gson GSON;

    static {
        GSON = BUILDER.setPrettyPrinting().create();
    }
}
west oxide
vocal cloud
#

I assumed whatever config was in your runs was bad

west oxide
#

ohh yeah its wrong directory on it

#

i didnt know i could change that

#

i just clicked around now

craggy lichen
#

I want to stop sweet berry bushes from damaging entities but have no idea what method should I use to achieve that. I will be thankful for advices

pale pendant
#

can anyone help me? i have both of these but it makes an error, imma post the error in a second

#
'registerEvents(org.bukkit.event.Listener, org.bukkit.plugin.Plugin)' in 'org.bukkit.plugin.PluginManager' cannot be applied to '(com.alanek2012.alanplugin.listeners.PlayerJoinedListener, com.alanek2012.alanplugin.AlanPlugin)'```
tall dragon
#

does your class implement Listener?

pale pendant
#

you mean the main plugin?

#

or the listener

tall dragon
#

no the PlayerJoinedListener class

pale pendant
#

oh, i thought i added it, thanks!

tall dragon
craggy lichen