#help-development

1 messages · Page 1621 of 1

astral burrow
#

lol

ivory sleet
#

You can be my friend instead

old sun
#

i quit like a year ago

dusty herald
#

i have never seen you in my life before

old sun
#

but i used to be a mc dev

#

maybe im thinking of the wrong person

dusty herald
#

you are

#

what was ur old disc name

old sun
#

literally this

dusty herald
#

what was your old discord

#

like so i can search and stuff

ivory sleet
#

That’s so cursed

#

How did U get that white space there

quaint mantle
#

|||||||||

dusty herald
#

tab

quaint mantle
#

||
||

manic bison
#

bump

ivory sleet
undone axleBOT
quaint mantle
#

just save it as a variable

ivory sleet
#

Feel like you should read that

manic bison
#

i already read that

manic bison
ivory sleet
#

Then you should be a pro (:

manic bison
#

alright i now am a pro

ivory sleet
#

Still what exactly are you trying to accomplish in the big run?

manic bison
#

its complicated

ivory sleet
#

You intrigued me

manic bison
#

when someone clicks an item in a gui, it closes the inv and prompts to enter something in chat, and using the bukkittask, retrieve what the player wrote (on playerchatevent, run the task "get chat message")

ivory sleet
#

Oh

#

Why do you need a BukkitTask?

manic bison
#

to retrieve what the player wrote

ivory sleet
#

Uh you probably don’t need it then

manic bison
#

i tried using conversation API or anvilGUI and its pain in ass

quaint mantle
#

You might wanna use my lib for this

ivory sleet
#

You start to sound like redempt

quaint mantle
#

its useful

ivory sleet
#

Haven’t looked but sure

#

Add JavaDocs, add some wiki on how to use maybe

quaint mantle
#

im going to

ivory sleet
#

Boring parts but crucial for it to grow

#

But yeah @manic bison maybe imaginedev got a good example, see if you can find something there by any chance?

manic bison
#

actually i did understand chatresponsemanager.java

ivory sleet
#

Epic dev moment (:

manic bison
#

what is lombok.RequiredArgsConstructor?

quaint mantle
#

it just automatically generates the constructor

ivory sleet
#

Don’t get pulled into the Lombok cult lol

#

Or actually I don’t mind but yeah

quaint mantle
#

i reccommend it PES_SadShrug

#

makes everything easier to type

#

although java 14+, lombok loses half of its usefulness

#

records 😠

ivory sleet
#

?

#

IDE generations

quaint mantle
ivory sleet
#

IDE minimizes

quaint mantle
#

i like the look of it more too

ivory sleet
#

You’re a lost cause in this case I’m afraid

manic bison
#

okay should there be any errors ?

#

when importing both classes

quaint mantle
#

just change requiredargsconstructor to an actual constructor

manic bison
#

i deleted it

quaint mantle
#

well you need to make a constructor for it

manic bison
#

it put errors everywhere

quaint mantle
#

well you need to make a constructor for it

manic bison
#

what the name of the constructor ? so i can build it mayB

quaint mantle
#

?learnjava

undone axleBOT
manic bison
#

of the one you put on your classes

astral burrow
#

constructor should have the name of the class you are creating here...

manic bison
#

oh lombok

#

okay this is mind fucking

#

and also how would I call the class to register the message ?

#

I've been trying to fix this for more than 24 hours

#

and now my editor wont start

#

Editor could not be initialized. nice

quaint mantle
manic bison
#

okay i'm switching to intellij idea

quaint mantle
#

?

wraith apex
#

Not sure what you mean by this

#

you've solved your own question here

#

gamePlayer.setData(new PlayerData());

vast sapphire
#
public class Events implements Listener {
    @EventHandler
    public void BlockPlaceEvent(BlockPlaceEvent e) {
        if (e.getBlock().getType().equals(Material.DIAMOND_BLOCK)) {
            BukkitScheduler scheduler = getServer().getScheduler();
            scheduler.scheduleSyncRepeatingTask(this, new Runnable() {
                @Override
                public void run() {
                    Location b = e.getBlock().getLocation();
                    e.getPlayer().getWorld().dropItemNaturally(b, new ItemStack(Material.DIAMOND));
                }
            }, 0L, 20L);
        }

    }
}``` confused on bukkit schedulers, what do i replace this with at `scheduler.scheduleSyncRepeatingTask(this, new Runnable()` line?
wide coyote
#
scheduler.scheduleSyncRepeatingTask(this, () -> {
    //code here
}, 0L, 20L);
outer sorrel
#

how could I detect if players successfully landed in water? I dont fall fall damage enabled. rn im basically checking if the player is in liquid on the move event but its highly inaccurate when falling from a great height

unkempt ore
#

Lmao Spigot banned is so fucking stupid

#

Wrong channel oops

proud basin
#

I've debugged pretty much everything and can't find this issue
but when I click a kit the other kits get added to database
they seem to be already in the map even when a kit is not clicked https://imgur.com/a/erKXiiY

bright jasper
#

So im making a plugin which is supposed to be platform agnostic. At the moment im doing events, should I create my own event objects and use Guava eventbus? So both fabric and spigot will just hook into their platforms event system and will just call a platform agnostic event by pushing one of my events to the eventbus

#

Good idea?

high pewter
#

I'm a bit confused by BungeeCord's permissions system as, as far as I can tell, you don't need to register the permission, you just check for it either by defining the permission node in a Command's constructor or using Player.hasPermission(String node). Is there nothing else to it like the ability to have all players have a permission by default or automatically allowing console access, like in the Spigot API?

quaint mantle
#

how to make player execute command if they are within certain coords

cerulean estuary
#

i have this when i try to start my server Error occurred while enabling (Is it up to date?) with this big error someone can help me?

#

Error occurred while enabling Duel v2.1 (Is it up to date?)
java.lang.NullPointerException
at fr.anubizyt.duel.Duels.onEnable(Duels.java:55) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[serveur.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [serveur.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [serveur.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [serveur.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [serveur.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.reload(CraftServer.java:741) [serveur.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.Bukkit.reload(Bukkit.java:535) [serveur.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:25) [serveur.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) [serveur.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchCommand(CraftServer.java:641) [serveur.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.dispatchServerCommand(CraftServer.java:627) [serveur.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:412) [serveur.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:375) [serveur.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [serveur.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [serveur.jar:git-Spigot-db6de12-18fbb24]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_301]

dusk flicker
cerulean estuary
#

thanks

bright jasper
#

What you can do though is install Luckperms on bungee

#

It will hook into the permission system and you can all point them to the same database to sync your spigot/bungee perms

#

Although bungeecord knowing of the permissions isnt that useful when it comes to anything but custom networks with custom plugins

quaint mantle
#

how to check fi player at specific coord

cerulean estuary
dusk flicker
#

restart your server

#

see if the error still persists

cerulean estuary
#

i restart it 5 time

dusk flicker
#

you reloaded on that error

cerulean estuary
#

yea

dusk flicker
#

Restart and send a new error

#

Reload can cause more errors

cerulean estuary
#

its the same error

dusk flicker
#

if the error is still the same, send us your Duels.class without taking anything out of it

#

?paste

undone axleBOT
eternal oxide
quaint mantle
#

i did already

eternal oxide
#

What yaw and pitch do you want?

cerulean estuary
#

how i send it after

dusk flicker
#

yes

cerulean estuary
dusk flicker
outer sorrel
#

how can i get as soon as a player touches the ground? because rn it waits for them to move a tiny bit or has a little delay then runs the code i want it to

#

the player falls from a big height

proud basin
#

Are you using EntityDamageEvent?

outer sorrel
#

there is no falldamage

proud basin
#

What do you mean there is no falldamage?

outer sorrel
#

falldamage is not enabled

#

i made it stop

#

wait

cerulean estuary
eternal oxide
#

it shoudl trigger on a player landing

eternal oxide
proud basin
#

I ain't using a switch case though?

eternal oxide
#

or something like

#

somewhere you are adding cooldowns when you shoudl not

#

so falling through a switch, looping all cooldowns instead of just the one you want

#

something like

proud basin
#

Im leaning towards this ```java
public long getTime(IPlayer iPlayer, String cooldown) {
PlayerData data = playerMap.get(iPlayer.getUuid());
if (data.cooldownMap.get(cooldown) == null) {
data.addCooldown(cooldown, 0L);
}
return data.cooldownMap.get(cooldown);
}

#

the things that add up to it seems like its this

cerulean estuary
eternal oxide
#

well, yes. If there is no cooldown that is setting zero

dusk flicker
#

I told you what you need to do; I won't spoonfeed

#

?learnjava

undone axleBOT
eternal oxide
#

No need to set a zero cooldown, just return zero

#

so if null return 0;

proud basin
#

alright will try that out

#

I feel so stupid

eternal oxide
#
Long value = data.cooldownMap.get(cooldown);
return (value != null)? value: 0L;```
proud basin
#

that prob works too

cerulean estuary
proud basin
#

Elgar you think I should save it to the db when the player gets the cooldown or just save it when they disconnect or just both?

eternal oxide
#

so long as you save async you can save it when teh cooldown happens

proud basin
#

I just have a feeling it's gonna get spammed

eternal oxide
#

setDirection

#

on location there is

#

setDirection(Vector)

high pewter
#

Not really aaking for ‘help’ but curious on good ways to get feedback on code. While I’m pretty comfortable with the Spigot and Bungeecord APIs now, I know there’s probably loads I need to improve on when it comes to formatting my code (since I’ve usually ended up sticking to just one file until more recently) and keeping it generally performant. I haven’t done a ton with these APIs yet so there’s probably many shortcuts to some of the things I’ve tried to do that I’m missing out on. While my plugins mostly perform fine, I think it’s still a good idea to keep it as performant as possible to avoid my future self having to deal with it all

eternal oxide
proud basin
#

lmao

#

It's get pretty busy around 1pm est

high pewter
craggy dawn
#

pls use code blocks

cerulean estuary
#

how

eternal oxide
#
        at fr.anubizyt.duel.Duels.onEnable(Duels.java:55) ~[?:?]```
craggy dawn
#

```
test
```

high pewter
#

Use code blocks or put your error into a paste too

high pewter
# craggy dawn \``` test \```

Also remember that if you share small snippets of code using this, you can specify the language used on the first line too

craggy dawn
#

@cerulean estuary r u following a tutorial

craggy dawn
high pewter
#

Yep, just wanted to let them know for future

craggy dawn
#

ah

cerulean estuary
eternal oxide
#

line 55 of onEnable, so quite high up. I'm going to guess a missing command from the plugin.yml

high pewter
#

I think they meant a tutorial on how to make the plugin in the first place as, if you were, kt is likely that the tutorial is outdated

cerulean estuary
craggy dawn
#

@cerulean estuary before working with spigot, or probably any libraries, try to learn the basics, or even more, of java

eternal oxide
#

We can't guess. What is line 55?

cerulean estuary
#

for (String string : arenaSection.getKeys(true)){

eternal oxide
#

then arenaSection is null

cerulean estuary
high pewter
eternal oxide
#

it either your yaml thats wrong or how you are reading it

high pewter
#

Unless arenaSection is supposed to come from a library or another plugin

eternal oxide
#

teh getKeys(true) tends to indicate its a ConfigurationSection

craggy dawn
#

is there any way I can target all sign types simply? im trying to see if a player right clicks a sign but I dont want to have to check type against all of the sign types

eternal oxide
#

however, if you want just the keys you shoudl getKeys(false) else they will be objects and not strings

cerulean estuary
#

normally it's false but i try to change it

eternal oxide
cerulean estuary
high pewter
# cerulean estuary i learn the base

btw, I hate saying this, but if you’re having to read a tutorial on stacktraces and not sure how to make something not null, I don’t think you know enough of the basics yet

craggy dawn
eternal oxide
#

?paste @cerulean estuary Show us your yml

undone axleBOT
craggy dawn
cerulean estuary
eternal oxide
#

there is no arenas in that. Thats yoru plugin.yml

craggy dawn
# cerulean estuary i know sorry...

yeah ur fine, its something a lot of people do at the start of coding. you want to just rush into the fun stuff but you have to make sure you have a solid understanding of everything else before you go there otherwise youll just end up very confused

proud basin
cerulean estuary
eternal oxide
#

you get teh vector from a location, or you create a new one.

high pewter
#

I would be interested in seeing a quiz that runs yu through all the Java basics you should know before using APIs like Spigot and Bungee to make it easier to find oit if you’re ready yet and what you might want to learn, because I made the mistake of learning the APIs first an I know from experience it’s annoying to be told you might not know enough (and from people have a bit less of a postive response from being told that here) and it’s also annoying to have to re-learn all of Java because you’re missing a few key details. Having a quiz tell you would both mean having to read a lot less tutorials as you can more easily skip everything you’re already fine with

eternal oxide
#

so if you want it to go the direction the player is looking, spawnLoc.setDirection(player.getLocation().getDirection())

#

a location set?

#

Not sure what you are asking

craggy dawn
high pewter
#

It’s the pitch and yaw

proud basin
eternal oxide
#

so you have a spawn location for yoru Arrow. are you tryign to send to to another location?

high pewter
eternal oxide
#
final Vector directionVector = targetLoc.toVector().subtract(projectile.getLocation().toVector());
loc.setDirection(directionVector);```
high pewter
#

Define suggests you are trying to set the pitch and yaw, I thought you were trying to get it? For getting, iirc it’s judt loc.getPitch() and loc.getYaw(). For setting it’s loc.setYaw(yaw) and loc.setPitch(pitch) then Player.setLocation(loc)

eternal oxide
#

What is the target?

high pewter
#

Oh right, I thought you were trying to get the direction an entity is looking at. I’d imagine the player is the target and the arrow is what they want to point towards the player

eternal oxide
#

you need a target to get a direction

#

where it is going to head towards

high pewter
#

The thing you want it to go in the direction of

proud basin
#

Is it possible for a map to reset to a default value?

eternal oxide
#

then just set that yaw and pitch on teh arrows location

high pewter
#

Then just set the pitch and yaw and apply the new loc to the arrow

#

Also, I have a feeling you weren’t intending for the 2 degrees off on the pitch and yaw you set; to go spdirectly west, you’ll be wanting yaw 90 and pitch 0

#

Is the pitch and yaw set the pitch & yaw you want it to use? If not, you need to change it using the functions I gave yoy before

eternal oxide
#

-2 pitch wouls be a slightly upwards elevation

#

If I remember correctly -90 is upwards

high pewter
#

???

eternal oxide
#

his pitch

#

he was using 2

#

shooting slightly down

proud basin
#

What could be a reason why when 2 or more cooldowns are added into a map and when a player leaves and rejoins one of them are replaced with the first cooldown and now are duplicated?

high pewter
#

Sorry I was meaning ??? to him saying “just the pitch and yaw” to me asking what he wants to do with the pitch & aw

eternal oxide
#

ah

eternal oxide
high pewter
#

In this code, you aren’t setting the pitch and yaw, so I’m a but confused; are you trying to say that yoy can’t set the pitch and yaw because they already have a pitch and yaw by default ans you don’t realise you can still change it?

quaint mantle
#

Just thinking about this

public class RemoveLocation implements CommandExecutor {
    @SuppressWarnings("unused")
    private Main plugin;
    public RemoveLocation(Main plugin) {
        this.plugin = plugin;
        plugin.getCommand("RemoveLocation").setExecutor(this);
    }
}

and do i really have to declare plugin as a variable when i don't use it elsewhere in the file? can't i just keep the plugin.getCommand("listlocations").setExecutor(this); and it'd still work fine?

eternal oxide
#

If you have the pitch and yaw set, just getDirection().normalize().multiply(speed) and apply that as a velocity

high pewter
proud basin
eternal oxide
high pewter
#

We can’t see your full code and I assume these are line numbers but they mean nothing to us

quaint mantle
#

hmm okay, i was confused when i saw it in a tutorial video since it seemed kind of pointless

high pewter
#

None of those numbers are 92 and 2 or 90 and 0 though...

#

So you’re not setting them to the values you want

#

Alright, so you’ve set the pitch and yaw... then what’s your auestion? I thought yuo were asking how to set it but you’re saying you’ve already set it elsewhere in your code?

#

Oh wait, are you asking how to apply the location you got from the constructor to the arrow? I was looking for a getYaw() or getPitch()

#

Should just be .setLocation(Location loc)

proud basin
# eternal oxide not saving before loading, and not checkign the map for existing cooldowns

Im doing both of those this is how im adding their data / loading their data when they join```java
if (res.next()) {
playerMap.put(UUID.fromString(res.getString("UUID")), new PlayerData(iPlayer.getUuid()));
PlayerData data = playerMap.get(iPlayer.getUuid());
data.addCooldown(res.getString("Cooldown"), res.getLong("Time"));
} else {
playerMap.put(iPlayer.getUuid(), new PlayerData(iPlayer.getUuid()));
}

stark marlin
#

Is it possible to control completely over what commands the player see immediately after typing a slash? I have tried TabCompleteEvent but it seems to fire only after a registered command has been typed in, when the first argument is meant to be typed.

wraith apex
#

Yes

#

Though the methodology is a bit complicated

unique halo
#

how do i see if the player is looking at a block, what i wanted to do is cast a line from the player, and along that line check if theres any blocks but idk how to do it

wraith apex
#

This is to do with Minecrafts Brigadier parser

stark marlin
#

I'll look into that, thanks!

stark marlin
wraith apex
#

Player.getTargetBlock()

stark marlin
#

Oh, that's probably it

young knoll
wraith apex
#

There is an updateCommands method in CraftPlayer which is responsible for sending the packets to the client as to what commands the server has

stark marlin
#

Does that extend BukkitCommand?

wraith apex
#

Nope this is in CraftPlayer

bright star
#

Can anyone make me custom plugins? I will pay $20USD if you can dm me

young knoll
#

?services

undone axleBOT
wraith apex
#

You will get into a bit of NMS stuff

stark marlin
#

I see, thanks for the help!

wraith apex
#

No problem :)

eternal oxide
unique halo
#

how do i make get target block not include air?

#

and how do i check if a point is inside of a blocks collider

young knoll
#

getTargetBlockExact does take collision into account

#

And only returns air if it hits the max length

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

why is items null

#

its final

#

theres no fucking way

#

hey im wondering how i can get the blocks under the player

#

specifically, the glass

eternal oxide
quaint mantle
#

its just a loop right

quaint mantle
quaint mantle
#

the items are never accessed publicly

#

there is no way it could possibly be null

eternal oxide
#

Then from that code its impossible for items to be null

quaint mantle
#

So why is it

drowsy helm
quaint mantle
#

i actually found something on the spigot site

young knoll
#

Or just a loop

quaint mantle
#

but thank you :D

quaint mantle
young knoll
#

Loop down until you find a glass block, then loop nearby blocks

summer scroll
#

How can I remove those armor stands? I spawned them using packets.

young knoll
#

DestroyEntity packet

#

Or relog

scarlet coral
#

Looks like spirits

summer scroll
unique halo
#

whenever i do setPassenger, the passenger always gets hit how do i make it so they dont get hit

young knoll
#

Then they aren’t clientside

#

Or you are spawning them again

digital plinth
#

damn its so annoying that i can limit how much resource i give to a plugin...

#

i suppose i can code it to run stuff with delay in it

#

if only theres a feature like the set affinity in task manager :<

digital plinth
crude charm
drowsy helm
#

well move event is probably the best way of doing it

#

unless you move them every tick

crude charm
#

hmm ok

#

would that cause lag?

drowsy helm
#

not really

#

if you do it efficiently

crude charm
#

aight

unique halo
#

why can't i teleport the enderdragon if it has someone riding it? heres my code

Location l = p.getLocation();
//Get the way the player is facing            
float h = (float) Math.cos(-l.getPitch()*Math.PI / 180);        
float dx = (float) Math.cos( (l.getYaw() + 90)*Math.PI / 180)*h;
float dz = (float) Math.sin( (l.getYaw() + 90)*Math.PI / 180)*h;
float dy = (float) Math.sin(-l.getPitch()*Math.PI / 180);

EnderDragon m = (EnderDragon) p.getWorld().spawnEntity(l, EntityType.ENDER_DRAGON);
m.setPassenger(p);
            
new BukkitRunnable() {
  Location b = p.getLocation();
  public void run() {
                    
    b = b.add(new Vector(dx, dy, dz));
                                
    m.teleport(b);
                    
  }
                
}.runTaskTimer(plugin, 0L, 0L);

it only works the moment i get off the ender dragon

summer scroll
summer scroll
summer scroll
#

I don't think so, I've been reseraching that for a week full and no result.

#

I had the same problem as you

wraith apex
unique halo
#

like say its a snowball, or an arrow, when i make them ride it it just hits them and then it dissapears

summer scroll
#

Your best bet is removing the passenger before teleport and add the passenger back to the ender dragon. It will be glitchy i guess.

wraith apex
#

Might have to have an invisible armour stand they ride that is riding the snowball to avoid collision

unique halo
#

how does hypixel make rush pearls though

summer scroll
#

Mind showing me like a video or something?

wraith apex
#

I believe hypixel is teleporting the user continuously

#

slightly behind the pearl

summer scroll
#

Riding a pearl?

wraith apex
#

I've not tried it but I'd imagine the pearl could contact you

summer scroll
#

They add player as a passenger of the ender pearl.

unique halo
#

if they were constantly teleporting you, you wouldn't be able to turn so fluidly

#

so i don't think its a constant teleporting

wraith apex
#

what do you mean turn so fluidly?

#

all they're teleporting is your x,y and z

#

not your yaw or pitch

unique halo
#

i thought you aren't able to do that

wraith apex
#

You are

unique halo
#

how d you do it

wraith apex
#

just make the yaw and pitch always equal to that of the players

#

so you're not taking control away from their head

unique halo
#

no that would make your turning kinda buggy and teleporty

summer scroll
#

They're not teleporting the player each tick

#

They simply just make the player rides ender pearl

#

So the movement will follow the vehicle (ender pearl)

unique halo
#

bcz client side minecraft updates your angle every frame, but the server only gets the angle every tick

wraith apex
#

what?

#

no?

#

The game loop is consistent on both sides

#

20 ticks be it server or single player

unique halo
#

when you're turning in minecraft, it's updated to your fps

#

thats why it doesn't look like the game is running at 20 fps

#

and is smooth and all

wraith apex
#

no.... fps is just how fast the game can display updates. Whenever you move or turn your head, a packet is sent to the server about this

unique halo
#

no it isn't, it's only sent 20 times a second

#

so the angle the server has isn't the same as where the player is looking

drowsy helm
#

wrong

unique halo
#

why don't you just try it

drowsy helm
#

the x axis of headmovement has a minimum variance before the head wil actually move

unique halo
#

and see

#

might be since im on 1.8.8

drowsy helm
#

thus, it will look choppy

dense goblet
#

Pretty sure if an entity is riding another, they won't collide

#

Otherwise boats would be glitchy

unique halo
#

since then it will be choppy if you try just setting it to what the server thinks the players pitch and yaw is

wraith apex
#

So the better way is to attach the player to a projectile and move the projectile by applying velocities on it

waxen plaza
#

Where do I find api documentation on spigot? I found out I was using legacy api to get my plugin version.

hidden delta
#

Just type spigot (version) docs

#

In google

quaint mantle
#

hey, sorry for this terrible question...

#

i have an issue on the AsyncPlayerChatEvent

#

(im setting the format)

#

where if the message contains %, theres a parsing error

#

or formating error

#

im not sure how to fix that

#

do i replace that character with \%

chrome beacon
#

Show code?

#

Oh and error

quaint mantle
#

gonna pastemd

#

?paste

undone axleBOT
quaint mantle
#

i left out EventHandler but its in the .java file

#

so im just wondering like

opal juniper
#

Isnt this paper?

quaint mantle
#

do i just replace the % character with two \ followed infront of it

#

Spigot

#

gave up with Paper 😳

chrome beacon
#

Oh go to Paper about that

opal juniper
#

Well, it looks like paper to me

quaint mantle
#

its not

chrome beacon
#

That's adventure not spigot api

quaint mantle
#

im running Paper

#

but the plugin is Spigot

chrome beacon
#

Error is from Paper

opal juniper
#

Ah ok

quaint mantle
#

ahh

#

i dont really like the people at paper, so to avoid trying to actually have a conversation with them i'm going to try to replace the character first

opal juniper
#

I can’t really help though - I’m not familiar with this method

#

The setformat thing

quaint mantle
#

it just sets hte chat format tbh

#

bukkit defaults it to <their_username> message

#

99% sure

opal juniper
#

Myeah

#

So how do you set it?

quaint mantle
#

e.setFormat(string);

chrome beacon
#

I would make sure the server is up to date

#

If it is report error to Paper they shouldn't be too rude about it

#

Just make sure you're on 1.16 or 1.17

quaint mantle
eternal night
#

just linking the paste website ?

quaint mantle
#

oh

#

im so smart

eternal night
#

you didn't link the error, that is why you got that reaction 😂

opal juniper
#

Lmaoooo

quaint mantle
#

lmfao

eternal night
#

looking at it, your format is just plain wrong. The format string contains, well, only the format

#

you already pass the message and username in it

quaint mantle
#

dont spam

#

we're clearly here

#

what

#

can u dont

quaint mantle
#

yeah

wraith apex
#

Don't ask to ask, just ask

quaint mantle
wraith apex
#

xD

quaint mantle
#

what

wraith apex
#

that is the classpath

#

to your Main class

young shell
#

Does someone knows where Nexus is storing the artifacts when deployed through a docker container, because the documentation says there should be a folder named sonatype-work, but it's nowhere to be found in the container

wraith apex
#

in otherwords the class that extends JavaPlugin

#

If my main class was called Core inside of packages com and laeven

chrome beacon
#

No package and class of main class

#

Stop spamming

#

I told you what to do

ivory sleet
#

?kick @quaint mantle spamming

undone axleBOT
#

Done. That felt good.

quaint mantle
#

LOL

#

guarantee hes 13 or younger

ivory sleet
#

Guy needs a chill pill Jesus

chrome beacon
#

Thanks :)

chrome beacon
quaint mantle
#

;-;

chrome beacon
#

?learnjava

undone axleBOT
quaint mantle
#

whats the link

#

yeah

chrome beacon
#

I've told you what to put

quaint mantle
#

why are you being mean

chrome beacon
#

Then go learn Java

#

And stop spamming

#

I won't

quaint mantle
#

ok can you like

#

dont?

#

?learnjava

undone axleBOT
quaint mantle
#

wat

#

@ivory sleet u see this man (he wrote "die" in a reply to the CafeBabe message)

#

we wont spoodneef him

#

so now hes mad

#

yes????

#

idk what to do in this situation

chrome beacon
#

Ignore him

#

He needs to mature

quaint mantle
#

so many good opportunities, but i will try.

chrome beacon
#

Stop pinging me ;/

quaint mantle
#

ok thats just pathetic sorry

#

im sorry

#

i cant not say something, please act like not a 7 year old on the Spigot discord

#

agreed

#

what

chrome beacon
#

If you behave like this in other places get ready for the ban hammer

quaint mantle
#

is that a threat?

bright jasper
#

This is going to be the end of me lmao

#

First plugin i make ends up being platform agnostic with fabric support too

#

Having to remake my own Plugin API

#

With my own eventbus and shit

chrome beacon
#

Just use abstraction

bright jasper
#

Thats what im doing

chrome beacon
#

Then why the eventbus

ivory sleet
#

Platforms

bright jasper
#

I have a core package which contains my own event implementations and commandsender and stuff and I implement it in the Spigot plugin. I need my own eventbus because platforms

#

I need to be able to cancel events in more ways than just not sending a message because the guava bus will just continue sending to listeners

ivory sleet
#

Guava event bus :I

bright jasper
#

🙏 also just gives more control

chrome beacon
#

Aight

bright jasper
#

I used guava because its the only one i know of but i ended up just making my own

#

forgot no custom emotes

ivory sleet
#

Better

bright jasper
#

Yeah guava is too basic for my needs

#

need more stuf

ivory sleet
#

Myeah it’s not as sophisticated you’d think it would be

bright jasper
#

Yeah i would have at least hoped for like, event cancellation

#

but it doesnt even have that

#

At the moment i kinda just do it by requiring all events to extend off of event

#
/**
 * Base event interface
 */
public interface Event {
    /**
     * Get player who sent the message
     *
     * @return player
     */
    PlatformPlayer getPlayer();

    /**
     * Cancel the event from firing, no other listeners will be fired after this is called
     */
    void cancel();

    /**
     * Check if the event was cancelled
     *
     * @return cancelled
     */
    boolean isCancelled();
}

#

which is this

#

🙏

wraith apex
#

I like buses

bright jasper
#

the one problem is i kinda have to use interface and I cant really store the cancelled variable inside the Event itself

#

so every implementation needs it

wraith apex
#

abstract class?

bright jasper
#

I could but i mean... hm maybe

wraith apex
#

^^

bright jasper
#

let me see if that would work for this

ivory sleet
#

A base class seems way more suitable

wraith apex
#

aye

bright jasper
#

all this would have to be abstract classes which would have to be extended further in spigot/fabric impls

#

but yeah i can prob do that

bright jasper
#

wym

#

The way I currently do events is have like a SpigotChatEvent in spigot

ivory sleet
#

Why not have your event bus completely decoupled from any platform

bright jasper
#

It is

#

All those events are purely up to implementation

#

But other platforms have implementations for those events

#

So when they get called its like a conversion event

#
public class SpigotChatEvent implements PlayerChatEvent {
    private final AsyncPlayerChatEvent chatEvent;
    private final PlatformPlayer player;

    public SpigotChatEvent(AsyncPlayerChatEvent chatEvent) {
        this.chatEvent = chatEvent;
        this.player = new SpigotPlayer(chatEvent.getPlayer());
    }

    @Override
    public PlatformPlayer getPlayer() {
        return player;
    }

    @Override
    public void cancel() {
        chatEvent.setCancelled(true);
    }

    @Override
    public String getMessage() {
        return chatEvent.getMessage();
    }

    @Override
    public void setMessage(String message) {
        chatEvent.setMessage(message);
    }

    @Override
    public void setFormat(String format) {
        chatEvent.setFormat(format);
    }

    @Override
    public Set<PlatformPlayer> getRecipients() {
        return new RecipientSet<>(chatEvent.getRecipients());
    }
}

example

#

RecipientSet is an adapter set implementation btw

#

so you can change recipients using platformplayers

ivory sleet
#

Hmm I was thinking something else but I guess

bright jasper
#

What would you do for this?

wraith apex
#

wrong place

ivory sleet
#

PlayformIndependentChatEvent <- PlatformIndependentEvent

Then you got in spigot for instance
ChatEventListener
which listens to the APCE and then from there it publishes a new PlatformIndependentEvent() in this way the common/shared logic doesn’t need to know about any platform dependent shit. Then if it’s the right choice is another question.

wraith apex
#

That doesn't mean you're getting an answer in here

#

this is help for development

bright jasper
wraith apex
#

not for plugin/server configuring

bright jasper
#

Need to make a note to figure out which is better for this

ivory sleet
#

Yeah good luck lol

#

Sparky seriously ask your question

wraith apex
#

Go read the doc

#

There are not that many elements to plugin.yml

bright jasper
# ivory sleet Yeah good luck lol

The main problem with this atm is stuff like recipients wouldnt work since you would have to have a different implementation from fabric/spigot due to the APIs being so different

#

Im building mine so its more spigot oriented on the agnostic side but recipient stuff is decently big

#

looks like this atm lmao

wraith apex
#

Did you read the doc

#

if you don't understand what a main class is, or what packages are, you have some homework to do

bright jasper
#

so learn java

wraith apex
#

Then go learn java

ivory sleet
#

You could have an api interface Recipient and then an RecipientImpl then in each platform you have for instance a SpigotRecipient and a RecipientBridger which bridges between the SpigotRecipient and RecipientImpl or something

#

Maybe a bit over engineered

#

?ban @quaint mantle stop goofing around, come back later

undone axleBOT
#

Done. That felt good.

chrome beacon
#

:o

wraith apex
#

I recommend this tutorial

bright jasper
wraith apex
#

Oh, he's gone

chrome beacon
#

Yeah

wraith apex
#

Aight

bright jasper
#

He was literally talking about raiding before he deserved it lmao

wraith apex
#

Yeah I saw above

#

attention seeking?

chrome beacon
wraith apex
#

:l

ivory sleet
#

Hopefully we won’t see his alts either

wraith apex
#

alt joins

ivory sleet
wraith apex
#

probably in the next 10-20 minutes

#

I've seen it happen

bright jasper
#

Tfw event in bus literally just has nothing implemented in it except extends to differentiate event

public abstract class PlayerMoveEvent extends Event {}
#

👁️ 👃🏽 👁️

ivory sleet
wraith apex
#

well you need to store vars

#

so makes sense

bright jasper
#

More like i need to differentiate the type of event being sent in the bus

#

Event contains all the bases stuff like getting player and cancels

#

All i need to do in my plugin is cancel the move of the player maybe

wraith apex
#

Instanceof or an enum event type

bright jasper
#

instanceof

ivory sleet
#

Enums 😫

#

Btw riku are all events cancellable

bright jasper
#

Yep

ivory sleet
#

Alright

bright jasper
#

If a spigot event isnt cancellable the most that setting cancel will do is just not call anymore listeners on my eventbus

#

since its just one event in spigot to send it to the bus

ivory sleet
#

Yeah sounds reasonable

wraith apex
#

oh?

bright jasper
#

Ok annotation and reflection time lets go

wraith apex
#

then how do you cancel an event like PlayerQuit :3

#

Keeps the player hostage on the server

bright jasper
#

well, it just wont call anymore subscribers for player quit

#

if there are any after the current one

#

they will still disconnect it just cancels the other listeners from calling

wraith apex
#

I see... I thought cancel just meant whatever was to be processed afterwords would not happen

bright jasper
#

well that happens for relevant events like chat

#

on top of not calling anymore subscribers

#

oh actually question is there a way to get a method as a function/consumer value

#

🙏

wraith apex
#

like store a method?

#

and call it later?

bright jasper
#

Yep, and call it

wraith apex
#

2 options I see

#
  1. store a runnable
ivory sleet
#

Method

wraith apex
#

in a map

bright jasper
#

With java im guessing yes since it just will keep the object above it alive while method ref is stored

wraith apex
#

or create a class with a method you intent to override on initialisation

ivory sleet
#

You can reflect it riku

#

Or use a MethodHandle

wraith apex
ivory sleet
#

Well unreflecting the reflect

bright jasper
#

what im essentially trying to do is anything in a listener with a handler annotation should be saved into a map as a value

wraith apex
#

Yeah

bright jasper
#

What i could do as well is just hold the object and the method handle in a pair tho

#

That would work right?

wraith apex
#

You can override a method on initialisation in a custom class

#

with the code you wish

#

and store it

#

or just use a runnable

#

or BukkitRunnable

ivory sleet
#

Yeah just Arrays.stream(class.getDeclaredMethods())
.peek(m -> m.setAccessible(true))
.filter(m -> m.getAnnotation(EventAnnot.class) != null)

#

And then whatever u want

bright jasper
#

Alright

tacit drift
#

how can i "create" the light beam that heals the dragon and point it somewhere?

bright jasper
#

what is peek btw

#

on stream

ivory sleet
#

It’s the same as forEach

#

But it returns the stream

#

Instead of void

bright jasper
#

Ah gotcha

wraith apex
#

so you can perform multiple ops

#

even though you could just do

Arrays.stream(class.getDeclaredMethods()).forEach(v ->
{
  // Stuff
});
ivory sleet
#

That defeats the purpose of streaming it but yeah

bright jasper
#

i love functional java lmao

#

unironically

wraith apex
#

I've been awake for 27 hours, excuse my thought process

bright jasper
#

is there a way to return an exception from a stream above the calling function

#

kinda wanna make sure the param types are normal

#

Wanna make sure theres only one parameter and its of a certain instance

ivory sleet
#

Yeah

#

Method#getParameterTypes I believe

#

Returns a Class<?>[]

bright jasper
#

Yeah i mean like throwing an exception in a stream

#

and making it return to the above function

wraith apex
#

wrap it in a try catch?

bright jasper
#

Im not sure if that would work but afaik streams are fall up

#

No because i want the person using the bus to get the exception

#

As in im throwing it

ivory sleet
#

Oh yeah Apache got something for it 1 sec

wraith apex
#

with?

#

Fire away

ivory sleet
#

Believe spigot has this

#

Like shaded

wraith apex
#

...

#

@ivory sleet

#

he's back

#

that's ban evading

ivory sleet
#

Altho no peek so you might wanna do the
.map(m -> {
m.setAccessible(true);
return m;
})

wraith apex
#

bye byeeee

ivory sleet
#

?ban @quaint mantle ban evasion

undone axleBOT
#

Done. That felt good.

wraith apex
#

why does the bot respond like that lol

#

That felt good

ivory sleet
#

To be fair Idk lol

bright jasper
#

adding commons rq

ivory sleet
#

Think sam is behind that

wraith apex
#

I see

ivory sleet
#

Isn’t that added by default riku?

wraith apex
#

Yeah

#

it is

ivory sleet
#

Else just create your own failable stream (:

wraith apex
#

Spigot already uses apache

bright jasper
wraith apex
#

you just need to call it

ivory sleet
#

Oh right

bright jasper
#

I tend to be low-dependency usage type person

#

so i have little added lmao

ivory sleet
#

Then create a helper class for it I guess

wraith apex
#

:D

ivory sleet
#

So does he use lombok?

bright jasper
#

I do have lombok in some stuff but i avoid it for stuff more now

#

Because it depends on IDE a lot

ivory sleet
#

Yeah

#

Lombok is a fkn cult lol

bright jasper
#

I wish there was something like lombok as a language feature tho

#

imo

#

it makes code cleaner but lombok aint it

ivory sleet
#

We got kotlin but yeah

indigo crypt
#

Hey all, what is the best of making all tools in one plugin or split it

ivory sleet
#

Elaborate

wraith apex
#

^

bright jasper
#

whats the usage of FailableStream btw

wraith apex
#

I think he means just tools for development. Designing an API

ivory sleet
#

It’s basically a stream which takes throwing functional interfaces

wraith apex
#

In my personal opinion, I'd prefer small libraries dedicated to solving one problem or that provide utilities for one thing

#

less clutter

ivory sleet
#

Like
interface Runnable {
void run() throws Exception;
}

wraith apex
#

Like StringUtils lib seperate from a PlayerUtils lib

young shell
#

Is there someone here with experience with the Nexus Repository Manager?

ivory sleet
#

Then it has the throws declaration so no need to have a try catch inside the lambda later

wraith apex
#

instead of bundling everything if you only need to use a few functions from one lib

ivory sleet
young shell
#

Maybe you can forward this question

ivory sleet
#

Hmm sure, why not ask them yourself? 😮

young shell
#

Sure

hybrid spoke
#

or just ask in here

#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

hybrid spoke
bright jasper
#

tfw peak doesnt exist in FailableStream

young shell
#

I'm trying to backup Nexus so i can update the docker container, in the documentation it says there should be a folder named sonatype-work but it's nowhere to be found. I found that there are blob storages which are apparently used by some repositories in the Container. Can i just backup those and replace the default blob storage in the new docker container or am i missing something?

bright jasper
#

ah

#

                .map(m -> {
                    if (m.getParameterTypes().length > 1) {
                        throw new ListenerRegisterException(String.format("Unable to register listener %s because method %s contained more than one parameter",
                                object.getClass().getName(), m.getName()));
                    }

                    return m;
                });```
#

error check 👌

ivory sleet
#

or just new BlahException().printStackTrace() maybe

wraith apex
#

Blah.printBlah()

#

xD

dense remnant
#

Can I ask for Bungeecord help in this server?

ivory sleet
#

Lol ye

wraith apex
#

ye

young shell
ivory sleet
#

I did send ya a DM, shouldn’t be advertising here

ivory sleet
dense remnant
#

Okay I am trying to make a plugin, that grabs the tps & playercount of every server every few minutes. My approach would be to get the playercount with the default message channel and the tps with "sub"-plugins on each server, that sends the tps back when they receive a specific message.

I would have a Main Plugin on the Main Server and smaller Plugins for the tps on all the other servers

Is this a good approach or should I do it differently?

hybrid spoke
#

sadly its private

wraith apex
#

Yeah that's the annoying thing with bungee

#

messages to a server sit in a queue until a player arrives on the server

dense remnant
#

oh

wraith apex
#

then they are processed

#

That is correct

bright jasper
#

how do i check if a Class<?> is an instance of another class

wraith apex
#

Honestly a better solution might be sockets

bright jasper
#

that accepts an object altho would i pass a class into there?

ivory sleet
#

Class#isAssignableFrom

wraith apex
#

Class<?>.isAssignableFrom(Class here);

bright jasper
#

This or backwards? method.getParameterTypes()[0].isAssignableFrom(Event.class)

dense remnant
bright jasper
#

I think its the inverse lmao

ivory sleet
#

Idk that one always confuses me

wraith apex
#

Not that I know of, there might be some bungee plugins that do the trick or even some plugins that just communicate via some custom bridge

bright jasper
#

Well because it has to be possible for the argument to be an instance of event

ivory sleet
#

Redis :0

bright jasper
#

so if you can assign the argument to Event its right

ivory sleet
#

Ye

bright jasper
#

👌 I always use plugin messaging when all it needs is a simple UDP message from or to bungee

ivory sleet
#

I recommend rabbitmq leeo

#

Or just redis

bright jasper
#

for me i use plugin messaging for sending server specific data like how many players are on the network and the name of the server to the spigot server so it can display on scoreboard

ivory sleet
#

You can do it with something like mysql but it’s a hacky solution

bright jasper
#

but yeah redis is better usually

wraith apex
#

But you'd need ChatControl

ivory sleet
#

😮

wraith apex
#

:/

#

It does however ignore players

#

if you google around you might find other solutions

dense remnant
ivory sleet
#

Wym?

#

I mean if you use redis pub/sub you’d do it async and then ofc it handles the synchronization for you between different pub subs

wraith apex
#

You could just perform a multicast

dense remnant
#

I want to store the tps/playercount in the sql database. Should I just make every server update an entry every few minutes?

ivory sleet
#

That’s how they do it

wraith apex
#

and then write it to the database

bright jasper
#

Is this the best way to do this

    private final Map<Class<?>, Set<Pair<Object, Method>>> subscribers = new ConcurrentHashMap<>();

#

essentially just storing the class and then a set of subscribers which is the object and the method of the handler

ivory sleet
#

Is set needed there?

bright jasper
#

well the first part of the map is the event being called, the set is the list of subscribers for that class

ivory sleet
#

Also use a class rather than use something like a Pair

bright jasper
#

whyso

ivory sleet
#

Because that’s damn nested lol

bright jasper
#

Ah

ivory sleet
#

Nested type params are kinda yeah mh

bright jasper
#

ill make a CallableMethod which just calls a method

#

contains the object and the method

ivory sleet
#

Yeah

#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

ivory sleet
#

Riku you might wanna have an ArrayList<CallableMethod>

#

ArrayLists are faster for iteration than HashSet or smtng like that

#

No idea

#

?ban @nova flame ban evasion

undone axleBOT
#

Done. That felt good.

lost matrix
bright jasper
#
public class CallableMethod {
    private final Object object;
    private final Method method;

    public CallableMethod(Object object, Method method) {
        this.object = object;
        this.method = method;
    }

    public Object invoke(Object... args) throws InvocationTargetException, IllegalAccessException {
        return method.invoke(object, args);
    }
}

#

this works

#

🤷‍♂️

#

i should call it InstancedMethod instead

ivory sleet
#

Map<Class<?>,CallableMethod[]> map = new IdentityHashMap<>();

#

Uh

#

CallableMethod sounds better

bright jasper
#

but you can dynamically register listeners so array isn't that good of an idea

ivory sleet
#

Yeah that’s what the Bukkit event api uses tho I believe

bright jasper
#

as in at any point you can register two listener objects to one event

#

ah

#

whats an IdentityHashMap

ivory sleet
#

True

#

It uses == to identify keys in short

#

So if two objects are different instances but have the hashCode they’re still considered different keys

bright jasper
#

ah and accessing .class is comparing static refs

ivory sleet
#

Yeah

bright jasper
#

gotcha

ivory sleet
#

(:

bright jasper
#

i come from c++ and stuff like that so i understand the mechanics of that a lot more i think

#

I wish we had reflection there too but we do not

ivory sleet
#

Lmao

#

I messed with C++

#

And never again will I such stuff

bright jasper
#

It becomes nice when you use it for a while, using anything below C++17 is a bit meh

lost matrix
ivory sleet
#

if I do smtng like
std::cin << "t" it would shout or whatever

bright jasper
#

like this type of eventbus thing

ivory sleet
#

Or yeah having the bitwise operator in the wrong direction

bright jasper
#

Oh yeah C++ has overloadable operators

#

aka << is a stream operator

ivory sleet
#

Oh

#

Yeah

bright jasper
#

you can even overload []

ivory sleet
#

Lol nice

bright jasper
#

thats why the Vector impl in C++ is accessed like array

#

Vector is the C++ arraylist

ivory sleet
#

Java Vector?

bright jasper
#

Yeah java has arraylist C++ has vector

#

I only use/used C++ for gamedev tho lmao

ivory sleet
#

Ah okay

#

Sounds reasonable

bright jasper
#

i do not mean unreal engine that is horrible with C++

ivory sleet
#

After all it allows you to be more agile and conservative about memory I guess

bright jasper
#

Yeah the game i was writing had some cool systems. The whole thing was half written in lua because i wrote the main systems in C++ and wanted it to be moddable so the main game content/items were defined in Lua and loaded through a content.pak

#

and you could like expand on it with others but i never got far enough for it to be super cool

#

Lua was compile time turned into JIT bytecode too when it became a .pak

#

So it was even fast there too

ivory sleet
#

Oo

bright jasper
#

I needa pick up that project but i guarantee my first order of business would be a whole scale rewrite because i was less conventional back then lmao

#

🤡

ivory sleet
#

lol yeah

#

Rewriting code is what I mostly do now of the time

chrome beacon
#

^

bright jasper
#

I wish there was like a eslint type thing for Java/C++ but it not only enforced syntax but ways you should do things like iteration

#

Like "use streams here instead to follow lint file"

chrome beacon
ivory sleet
#

Lol

bright jasper
#

i forgot .computeIfAbsent was a thing and im wowed by it for the 3rd time lmao

ivory sleet
#

Oh yeah

#

Those new higher order ones

grim ice
#

like rewrite ppl code or yours

ivory sleet
#

I make bad code into good code

grim ice
#

o

ivory sleet
#

People’s and my own lol

grim ice
#

hmm

chrome beacon
#

Conclure code review my mod

grim ice
#

i think i dont do any bad practice in my code but idk what ppl think

chrome beacon
#

Let's go DMs

ivory sleet
#

Sure link lmao

ivory sleet
bright jasper
#

tfw tech companies still pay by lines of code sometimes

grim ice
#

e can someone send me git official website

#

i lost it

#

right

ivory sleet
bright jasper
#

Good?

    public <T extends Event> void post(T event) {
        Set<InstancedMethod> methods = subscribers.get(event.getClass());
        if (methods == null) return;

        for (InstancedMethod method : methods) {
            if (event.isCancelled()) return;
            try {
                method.invoke(event);
            } catch (InvocationTargetException | IllegalAccessException e) {
                logger.severe(String.format("Unable to call handler %s on %s",
                        method.getMethod().getName(),
                        method.getObject().getClass().getName()));
                logger.severe(ExceptionUtils.getStackTrace(e));
            }
        }
    }
grim ice
#

WAIT WHAT THE FUCK

#

GOOGLE IS OPEN SOURCE

bright jasper
#

... yeah?

#

tf you think guava is

#

or do you mean like search engine

grim ice
#

the search engine build

#

its open source?

bright jasper
#

...huh?

#

where

grim ice
#

im asking

ivory sleet
#

Nice riku

grim ice
#

idk if it is some guy told me

ivory sleet
#

Some of google’s sources are open sourced

#

Not everything

grim ice
#

oh ok

bright jasper
#

I dont know if its a good idea to pass a logger as the sole argument into EventBus tho but like

#

🤷‍♂️ why not

#
    public void removeListener(Object listener) {
        subscribers.values().forEach(m -> m.removeIf(method -> method.getObject().equals(listener)));
    }

i love functional java lmao

ivory sleet
#

😳

grim ice
#

uHUHUHU

#

why did git tell me to install .NET framework

#

should i do that

bright jasper
#

.. git is made in C/Go

#

why does it need .net lmao

grim ice
#

IDK

#

it told me to download this

bright jasper
#

I swear that might be the installer

#

which is really funny

#

but yeah do it a lot of apps need it

grim ice
#

i alr have it installed bro

bright jasper
#

thats just the runtime, essentially a JVM

grim ice
#

i installed like 3 times

worthy knoll
#

Accessing config from other class throws me an NPE ?

bright jasper
#

different versions because yk... .net

grim ice
#

i prob installed other versions tho

#

i swear git isnt worth it and im wasting my time

ivory sleet
bright jasper
#

git is worth it

grim ice
#

im just doing it so i can share code or whatever

bright jasper
#

You should use git so you can store your code in iterations

#

instead of storing it in a zip file on google drive lmao

grim ice
#

u can ctrl z if u do an oopsie

bright jasper
#

yes

#

it records changes like a transact log

#

as in

grim ice
#

and i hate using my terminal

bright jasper
#

im not gonna bother explaining it, pros use it for a reason so if you wanna become a dev you are gonna have to learn it at some point

#

no avoiding it

#

no jobs will accept you if you dont know git lmao

grim ice
#

THE FUCKING GIT TELLS ME TO DOWNLOAD 4.7.2

#

AND

#

IT LINKS ME

#

TO 4.8

bright jasper
#

backwards compatible pretty sure

grim ice
#

i dont think so

#

i could swear i have 4,8

bright jasper
#

JVM 16 can run Java 8

#

same shit

#

more specifically bytecode version 60 runtime can run 55

vivid temple
#

i want to copy and paste a building through code, anyone an idea on how to go about that?

grim ice
#

yes

#

get every block in that structure and store it in a config file :DDDDDDDDDD

chrome beacon
#

WorldEditAPI ia highly recommended

vivid temple
grim ice
#

LOOPS :D

vivid temple
grim ice
#

/j btw

bright jasper
#

I use worldeditapi right now to hook into block changes to check if a sign is being replaced and check if that sign is a sign in my database

#

since yk, sign interactions

#

i hate the system but it works

#

🤡

#

when block break event doesnt trigger with wedit

vivid temple
worthy knoll
bright jasper
vivid temple
#

thanks

bright jasper
#

here is the javadoc specifically

#

make sure you have worldedit as a dependency in spigot btw

#

i recommend using FastAsyncWorldEdit

vivid temple
#

oh

bright jasper
#

basically faster worldedit implementation

vivid temple
#

mk

bright jasper
#

but regular worldedit docs apply yeah

chrome beacon
#

If using try statements with FAWE make sure to call things async

worthy knoll
#

I have too much code, I would have to throw all my classes as it's a big project

plus the code is a mess as I haven't finished it yet...

(I'm using the saveDefaultConfig() method, and an instance of my main class instead of a constructor)

private Main main = Main.getInstance();
int i = main.getConfig().getInt("int"); //NPE on this line
#

while it is not null on the config

#

I mean

#

!= 0

#

oh wait figured it out

#

I was creating a new instance of this class

in my main

#

(insert facepalm here)

#

goodbye

grim ice
#

fking hell

#

i waited like 3 mins for that shitty git to restart my pc

#

legit wasted my time

amber quarry
#

[13:42:43] [Server thread/DEBUG]: Opening connection to https://api.mojang.com/profiles/minecraft
[13:42:43] [Server thread/DEBUG]: Writing POST data to https://api.mojang.com/profiles/minecraft: ["furkantr6676baba"]
[13:42:43] [Server thread/DEBUG]: Reading data from https://api.mojang.com/profiles/minecraft
[13:42:43] [Server thread/DEBUG]: Reading error page from https://api.mojang.com/profiles/minecraft
[13:42:43] [Server thread/DEBUG]: Successful read, server response was 403
[13:42:43] [Server thread/DEBUG]: Response: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>403 ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
Request blocked.
We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
<BR clear="all">
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: KQAQlpizbGgckB8fZ0LpRlDHYGv6jdCow41ktwA_8Ksc0v5bOjcIxw==
</PRE>
<ADDRESS>
</ADDRESS>
</BODY></HTML>
So my server has lag, how do I fix it?

frosty mauve
#

🤔

chrome beacon
#

Chill lmao

dense remnant
#

When coding a plugin for a bungeecord network, that doesnt need the bungee features tho, can I just use the spigot api?

ivory sleet
#

if its a bungee plugin you obv cant use the spigot api

wraith apex
#

You'd use the bungee api

crimson scarab
#

how to add pdc to itemstack

wraith apex
#

persistent data container?

crimson scarab
#

yea

wraith apex
#

stack.getItemMeta().getPersistentDataContainer()