#help-development

1 messages · Page 1871 of 1

young knoll
#

Or nothing

arctic moth
#

lol

#

gets controlled

chrome beacon
#

Did you forget to register the listener

swift adder
#

No https://paste.md-5.net/oqapaxabor.java

#

Wrong thing

somber hull
#

Wait…

#

Is the listener in the if statement?

#

I’m on mobile

#

It’s hard to tell

swift adder
#

No

tender shard
#

what the fuck

#

why are you casting a player to player

#

why are you casting a block to a block

somber hull
#

Ik im like

tender shard
#

why do you use equals for enums

somber hull
#

So confused what’s going on here

tender shard
#

and also you didnt register the event listener

somber hull
#

@swift adder for enums, like materials use ==

somber hull
somber hull
swift adder
somber hull
swift adder
chrome beacon
#

Where

#

Show us

swift adder
#

In my main

young knoll
somber hull
swift adder
#

getServer().getPluginManager().registerEvents(new pStats(), this);

tender shard
#

String string = (String) "string";

tender shard
tender shard
swift adder
#

Mhm

swift adder
somber hull
#

Registering command*

tender shard
#

oh wait wtf

#

@swift adder

#

you check if b equals DIRT

#

a block can never equal a material

somber hull
tender shard
#

would be easier to see if you used actual proper variable names like "block" instead of "b" 🙂

swift adder
#

😭

somber hull
tender shard
#

change if(b.equals(Material.DIRT)) to if(b.getType() == Material.DIRT)

somber hull
#

It’s might feel like your doing EVERYTHING wrong

#

But trust me

#

You are

swift adder
#

Someone else helped me and changed like bits of my code

tender shard
#

yeah but all those casts are bullshit

somber hull
#

Well they were a dumbass

swift adder
#

Mine before had one issue and worked fine before

tender shard
#

and as said, get the blocks type instead of comparing the block to a material

#

and please do yourself a favor and use proper variable names

somber hull
swift adder
somber hull
#

It’s helpful

#

People won’t yell at you as often

swift adder
#

I'll mkae my variables very descriptive like BlockThatPlayerDestroys

somber hull
#

Speaking from experience

swift adder
#

Oh okay

somber hull
#

Since it’s defined in the scope as blockBreakEvent, people can reasonably assume that it is the broken block

lilac dagger
#

can someone help me please

somber hull
#

Can’t

lilac dagger
#

whyyy

somber hull
#

Cause you have no information…

lilac dagger
#

i have

#

i did what he said

somber hull
#

Nope

#

Put it here

lilac dagger
#

but i dont know what else to do

somber hull
#

If it has to do with plugins

#

Like

#

Developing

#

Put it here

#

If not, we ain’t gonna help you

north trench
#

can i get .getItem in PlayerInteractAtEntityEvent?

somber hull
#

Probably

#

Yea

#

Player.getOnventory.Getiteminmainhand

quaint mantle
somber hull
quaint mantle
#

cool

somber hull
#

Maybe there’s a way through the event

swift adder
#

The event still doesn't work

somber hull
#

But idk

somber hull
quaint mantle
north trench
somber hull
#

You can’t just say it doesn’t work

swift adder
somber hull
#

What did you change, what isn’t working, show examples

quaint mantle
swift adder
#

Still the same issue

somber hull
#

Sheeeesh

swift adder
somber hull
#

There

quaint mantle
swift adder
quaint mantle
#

like implements Listener?

swift adder
#

Yes

quaint mantle
#

can u send the main class?

swift adder
#

I'm not dumb I've done the basic

swift adder
somber hull
somber hull
swift adder
somber hull
somber hull
#

That’s a small main class

#

Lol

quaint mantle
#

wait where is it?

arctic moth
#

why is player.getAttribute(Attribute.GENERIC_ATTACK_KNOCKBACK) null

somber hull
swift adder
#
public final class Shovel extends JavaPlugin {

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new pStats(), this);
        getCommand("stats").setExecutor(new pStats());


    }

    @Override
    public void onDisable() {
    }
}```
quaint mantle
#

wait

quaint mantle
#

ohhh

quaint mantle
somber hull
quaint mantle
#

wait nvm

young knoll
#

Because players don’t use that attribute

somber hull
#

And pass that in instead of new pStats

#

Cause your creating a new instance twice

quaint mantle
young knoll
#

Yes?

#

Don’t you know how objects work

somber hull
quaint mantle
#

I usually just create two new classes

arctic moth
young knoll
#

Nothing

somber hull
arctic moth
#

?

young knoll
#

Well, you’d have to make your own code to modify knockback

swift adder
#

pStats pstats= new pStats();
?

somber hull
somber hull
#

Pretty much

#

It’s a lot of pStats ik

quaint mantle
arctic moth
young knoll
#

Because you can’t modify it?

left swift
#

Can i disable animation for example placing blocks? maybe using packets or sth like this.

somber hull
arctic moth
swift adder
quaint mantle
somber hull
#

Cause you casted a player to a player

quaint mantle
#

I dont get it but ok

young knoll
arctic moth
#

but they did

swift adder
#

Getting "Method call expected" now

young knoll
#

No they didn’t

somber hull
arctic moth
#

it does work in vanilla

#

lol

somber hull
somber hull
somber hull
arctic moth
swift adder
#
public final class Shovel extends JavaPlugin {
    pStats pstats= new pStats();

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new pStats(), this);
        getCommand("stats").setExecutor(pstats());


    }

    @Override
    public void onDisable() {
    }
}```
somber hull
#

Happy?

arctic moth
#

lol k

young knoll
#

Huh

#

It does seem that the player does indeed accept that attribute

somber hull
somber hull
dusk flicker
young knoll
#

Remove the ()

dusk flicker
#

Oh I see the thing above nevermind

somber hull
#

@swift adder just. Think before you ask questions

#

Like

#

Look at it

#

Think, is there anything I know how to fix

#

If not

#

Then ask

dusk flicker
#

you are obviously new to this discord

#

Most people miss basic things

somber hull
swift adder
arctic moth
#

what is the difference betweem finaldamage and damage

somber hull
dusk flicker
#

?jd

somber hull
#

getServer().getPluginManager().registerEvents(new pStats(), this);

young knoll
#

No no

somber hull
young knoll
#

Don’t create another instance

dusk flicker
#

use the same instance yeah

somber hull
#

He originally made two, I’m trying to get him to fix it

swift adder
somber hull
#

Then send the updated code

#

Got dam

arctic moth
#

very helpful error

dusk flicker
#

LMAO

#

have fun

somber hull
dusk flicker
#

talking to Tristan

somber hull
swift adder
#

public final class Shovel extends JavaPlugin {
pStats pstats= new pStats();

@Override
public void onEnable() {
    getServer().getPluginManager().registerEvents(pstats(), this);


}

@Override
public void onDisable() {
}

}

somber hull
somber hull
dusk flicker
swift adder
#

fggrtttttttttttttttttttttttttttttttttttttttttttttttttttted'

somber hull
#

Also remove the ()

arctic moth
#

oh yeah theres like a thousand of those ats

#

lol

dusk flicker
#

Tristan you will need to look for a line number

#

I know they suck to find tho lol

somber hull
young knoll
#

My guess is calling an event in an event

dusk flicker
#

In a stack overflow error they can be a bitch

swift adder
#

She got scared of a candle and walked backwards

dusk flicker
#

lmao

somber hull
#

Lol

arctic moth
#

worlds longest error?

somber hull
#

?paste

undone axleBOT
arctic moth
#

lol

dusk flicker
#

dude it literally auto embeds in discor

somber hull
#

I don’t give a fuck if it’s a txt file use paste

arctic moth
somber hull
dusk flicker
#

you need to chill out dude thefuck

somber hull
#

But I’m untrusting

dusk flicker
#

you won't survive in this discord if you get that annoyed/pissed

hasty prawn
#

You're untrusting of auto-embeds?

#

How paranoid are you KEKW

arctic moth
arctic moth
#

thats part of it

dusk flicker
#

this Hyper dude

hasty prawn
arctic moth
#

i cant

#

error

dusk flicker
#

Try a different paste website

hasty prawn
#

What

somber hull
arctic moth
#

its too big for it to save a link

tender shard
somber hull
#

I’m tired

hasty prawn
swift adder
#

what bad can .txt files do, say a bad word?

tender shard
arctic moth
tender shard
arctic moth
#

oh

quaint mantle
#

Java stack trace is the best at screaming "panic!"

hasty prawn
#

Sucks for them LULW

arctic moth
#

ive tried multiple paste websites all of them its above the limit

#

its about 4 mb of text btw

dusk flicker
#

eh not the biggest thing

#

it did auto embed so it works

arctic moth
#

lol

hasty prawn
#

What is Listeners line 34

arctic moth
#

finally

dusk flicker
#

now thats a sketch link lmao

#

but makes sense you need a sketch website for a paste that big

sullen marlin
#

?botstrap

arctic moth
#

lol

sullen marlin
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

arctic moth
hasty prawn
#

?paste your Listeners class

undone axleBOT
arctic moth
somber hull
#

I’m on mobile rn

#

It shows up as a txt

#

I thought you meant how when you paste a long message it sends it as message.txt

arctic moth
#

so if it was gonna fuck it you wouldnt have had to download it

tender shard
tender shard
hasty prawn
swift adder
#

How could I save HashMap data?

tender shard
young knoll
#

Ohno

swift adder
arctic moth
#

i did /data get and it had it

wet breach
#

@arctic moth
problem is with Players-Revamped v1.0
there is an integer null in relation to doing something with PDC

arctic moth
hasty prawn
# arctic moth

You're using event.getDamager(), I assume it should be event.getEntity() ?

#

Line 35

arctic moth
#

need to check if its player first

hasty prawn
#

You are wot

#

You're checking if the getEntity is a player and then getting the PDC of the damager.

arctic moth
#

oh wait

#

lol

arctic moth
#

oh

#

wait im dmb

#

that shit was supposed to go in a different event

#

or whatever

#

so yeah it is getEntity

woeful crescent
#

is there any way to monitor warnings on a java logger?

somber hull
#

?

#

Like catch output with the warning tag?

woeful crescent
#

Yeah

#

i want to broadcast a message whenever logger is warned

#

to alpha testers

still valley
#

I need help, so I have this code

    boolean shouldSendCoords = false;

    @EventHandler
    public void onBlockPlaced(BlockPlaceEvent event)
    {
        if(shouldSendCoords)
        {
            if(!event.getPlayer().isOp())
            {
                return;
            }
            Location location = event.getBlock().getLocation();
            event.getPlayer().sendMessage(event.getBlock().getType().toString() + " : "+ ChatColor.AQUA + "X : " + location.getX() + ChatColor.RED + " Y : " + location.getY() + ChatColor.YELLOW + " Z : " + location.getZ());

        } else {
            System.out.println("shouldn't send coords");
            System.out.println(shouldSendCoords);
        }
         }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if(!shouldSendCoords) { shouldSendCoords = true; } else { shouldSendCoords = false; }

        return false;
    }
}

For some reason the command is failing to set shouldSendCoords to true, I can't figure out why. I have tried other ways of making it true and nothing works. is this just a simple oversight or something else

#

i have confirmed the command is running but it never gets set to true. i even changed the code to literally just

shouldSendCoords = true;
#

and it still won't set to true, I might just be tired but I feel like this should work

tender shard
#

just testing sth quickly:

#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

tender shard
#

awesome

tender shard
woeful crescent
#

also is there a way to build an artifact to two places with intellij

tender shard
still valley
#

yeah, i made a println that says "this does in fact run" and it triggered

echo basalt
tender shard
tender shard
still valley
#

oh yeah

#

I didn't think of that

tender shard
#

stupid fix; make the variable static

#

proper fix: use one instance for both, command and event

echo basalt
#

ew static

tender shard
#

static is perfectly fine to use in many cases 🙂

ancient plank
#

putting listeners in the same class as a command class 🤮

still valley
#

I had to have the event access the variable and same with the command, im not the best at coding it's all I knew how to do

tender shard
woeful crescent
tender shard
woeful crescent
#

LOL

tender shard
#

ooh

woeful crescent
#

lmao

tender shard
#

it's a pointer finger

#

haha

#

sorry

woeful crescent
#

s'ok

tender shard
#

I thought it was a middle finger

#

lol

#

mb

dusty sphinx
#

How do I do multi-module projects in maven for Bungee & Spigot at the same time

#

I don't understand it

buoyant viper
#

cpp be like

dusty sphinx
#

i get modules

buoyant viper
#

👆

quaint mantle
#

Thats all

young knoll
#

Singleton?

quaint mantle
#

only if it has immutable state

#

(antipattern btw)

#

Static classes are somehow handy too

upper niche
#

what is the range that the setRotation() method for entities takes for pitch and yaw?

ivory sleet
somber hull
#

probably 360

ivory sleet
# quaint mantle as example?

resource intensive components which might not end up being used by the system at all, ofc you could fix it by using IoC and DI with a simple supplier sam tho it kinda depends on context more specifically.

quaint mantle
#

ah maybe

#

but, i cant really imagine a resource intensive component without depenecies. How could you pass depenencies to the singletone..?

ivory sleet
#

you have a point, and well, you can always avoid static in these stateful cases, tho sometimes dissuading yourself from it might end up making the design more complicated unnecessarily

#

yeah manya that might be problematic in some scenarios, which may just prove static singleton is the wrong choice there

quaint mantle
#

Singletones are good for some immutable implementations thst doesnt takes depenencies, good example are persistent data types or kyori component serializers

ivory sleet
tender shard
quaint mantle
#

Passing ClanBuilderFactory all the time if i need to just create a plain java object

tender shard
#

ask yourself "Does it make sense to call this method or access this field, even if no object has been constructed yet?" If so, it should definitely be static.

ivory sleet
#

also yeah static factory

#

that is one hella of a good pattern

#

tho its not about state

quaint mantle
#

i mean, i dont have a static factory

ivory sleet
#

well I mean static factory methods

tender shard
rough basin
#

How can I prevent a player from temporarily becoming invulnerable after being hit by a certain arrow?

rough basin
#

damn nice

#

Thanks

tender shard
#

np

#

I think you'll have to set it to 0 so they can be damaged right away again

#

hi

winged barn
#

Yoooo

tender shard
#

you need any help?

quaint mantle
#

my gosh thats 3 am

winged barn
#

The chat is turning wild

ivory sleet
#

you better justify what you just wrote rn

tender shard
quaint mantle
#

😄

upper niche
#

seems like a warning/ban is in order

tender shard
#

rukus stop spamming this channel then if you don't have any development questions, thanks

modern fox
#

I am cancelling EntityDamageByEntityEvent but it is still doing damage

#

?paste

undone axleBOT
tender shard
tender shard
#

if the event gets cancelled, there definitely is no damage happening

ivory sleet
modern fox
tender shard
modern fox
#

Yes it does

tender shard
#

are you 100% sure? Did you add some debug text to see it?

modern fox
#

Ill debug it now

tender shard
#

just add some System.out.println above e.setCancelled and see if it gets printed

modern fox
#

It does

tender shard
#

do you have any other plugins running?

light parcel
modern fox
#

Not that I know of that would effect this but I'll try removing them

tender shard
modern fox
#

Only one left is Essentials. Let's remove that and see

tender shard
#

I mostly just do stuff like this:

    public void debug(String s) {
        if(getConfig().getBoolean("debug",false)) {
            getLogger().warning(s);
        }
    }
light parcel
#

Nope, but it'd be nice if it was a known simple fix

modern fox
#

Also taking the normal knockback and everything

tender shard
#

let me create a test plugin quickly

modern fox
#

I am on 1.8.8 does it affect anything?

tender shard
#

1.8.8 sucks but it should still work fine if you are sure that the code runs

quaint mantle
#

Cringe!

modern fox
#

I'll comment everything out after the cancell so my code cannot affect it

tender shard
modern fox
#

It was something with my code that affected it. It worked when I removed the thing after. Ima find out what makes it not workj

#

I found out why. Thank you man 😄

tender shard
#

:3

ivory sleet
#

Alex didn’t you have a pdc type library?

tender shard
waxen plinth
#

Can listeners be registered async safely?

tender shard
somber hull
#

Ok im gonna get this answered

waxen plinth
#

Reasons

somber hull
#

@tender shard what do you do with plugin, do you use the plugin.yml permissions system

#

or do you hardcode them with plr.getPermission()

ivory sleet
#

But who cares about 1.8 frankly

tender shard
ivory sleet
#

Hyperlink I use plugin.yml

#

Altho it’s pretty terrible sometimes

young knoll
#

You really should attach permissions directly to your commands

#

That way unauthorized users can’t even see them

tender shard
ivory sleet
#

Don’t you register the to the map?

young knoll
#

Please link them to the command

#

Either via plugin.yml or reflection jank

tender shard
somber hull
ivory sleet
young knoll
#

commands:
beep:
permission: beep.beep

tender shard
ivory sleet
#

I mean it’s nice to declare the permissions in plugin yml so LuckPerms can pick ‘em up

tender shard
somber hull
young knoll
#

Not only can they not run it, but they can’t see it either

tender shard
somber hull
#

wait, do you mean like autocomplete in luckperms?

tender shard
#

for example, yes

somber hull
#

ok

ivory sleet
#

If your plugin declares permissions like that, then you’re officially cool

young knoll
#

😎

quaint mantle
#

Where I can learn how does the spigot server deals with plugin?

#

I'd like to understand better how does the Plugin context interfaces itself with the user

ivory sleet
#

Like the bootstrap process? Or just the concrete implementation of the api?

quaint mantle
#

Yes, the bootstrap one.

ivory sleet
#

Well you need to understand how classloading works first then

quaint mantle
#

I just want to know if there is some documentation

#

or if i need to dive into the code

ivory sleet
#

The code

#

It’s not documented

#

But it gives your the best explanation of how the server is implemented

#

as it’s 100% up to date

#

and code never lies

quaint mantle
#

hahahaha

ivory sleet
#

Just creates miserable illusions

quaint mantle
#

another question

ivory sleet
#

Ask away

quaint mantle
#

The plugin instance is shared among users right? So basically, it's one instance for many.

ivory sleet
#

Yes

#

Well

#

Partly true

#

Bukkit ensures a plugin singleton given that the plugin is loaded onto the server

quaint mantle
#

I think i got it

#

thx

ivory sleet
#

But yeah zer0

#

Spigot actually extends a custom class loader

#

Which stores the correct plugin instance

#

As you’re aware it uses reflection to instantiate each plugin also

#

However if one were to reload the server

#

There’s no guarantee that the plugin instance that was created before the reloaded is still present in memory

#

In other words, reload can cause the old plugin instances to be garbage collected

quaint mantle
#

These kind of stuff is always damn interesting

ivory sleet
#

As well as plugins like plugman and plugewoman

#

Yeah

minor garnet
#

Some1 know how transform a euler angle to a vector

tender shard
young knoll
#

It’s used for armor stand posing

minor garnet
#

I Just want set the armorstand pose using nbt

#

Euler angle ungly

young knoll
#

It’s just a vector but radians

young knoll
#

Covert each component to radians and then construct a vector from them?

minor garnet
#

Ok?

hybrid spoke
#
private static EulerAngle convertVectorToEulerAngle(Vector vec) {
     
        double x = vec.getX();
        double y = vec.getY();
        double z = vec.getZ();
     
        double xz = Math.sqrt(x*x + z*z);
     
        double eulX;
        if(x < 0) {
            if(y == 0) {
                eulX = Math.PI*0.5;
            } else {
                eulX = Math.atan(xz/y)+Math.PI;
            }
        } else {
            eulX = Math.atan(y/xz)+Math.PI*0.5;
        }
     
        double eulY;
        if(x == 0) {
            if(z > 0) {
                eulY = Math.PI;
            } else {
                eulY = 0;
            }
        } else {
            eulY = Math.atan(z/x)+Math.PI*0.5;
        }
     
        return new EulerAngle(eulX, eulY, 0);
     
    }

literally the first google result

tender shard
minor garnet
hybrid spoke
minor garnet
#

Bit i want euler angle to vector

hybrid spoke
#

so retrace it

minor garnet
#

I dont know How do this

tender shard
#

ask in spigot development forum

#

there's some math geniuses there

minor garnet
#

Mucho ifs

hybrid spoke
minor garnet
#

If work..

#

So mucho maths 🌶️

hybrid spoke
#

its literally a step by step instruction

minor garnet
#

I can use only the first math to get a vector

quaint mantle
#

where are you from guys? askin for curiosity

waxen plinth
#

US

vocal cloud
#

Canada Eh

quaint mantle
#

Central Europe

tender shard
tender shard
#

are canadians really as friendly as portrayed in all the memes?

vocal cloud
# tender shard sorry

Also I'm 99% sure it's impossible to figure out the blocks that fall without using reflection or something lol. It's the tick method that decides if a bock breaks when the bottom is removed

#

No I'm an ass

tender shard
#

but you are honest about it

quaint mantle
quaint mantle
#

he is canadian, it's the law

tender shard
#

I like turtles

quaint mantle
#

i like trains

tender shard
#

lol this capitol storming documentary is awesome

worldly ingot
#

Seriously. Bump into someone in Canada by accident and they will say "Sorry about that", but what they're thinking is "Fuck that guy, look where you're going, damn it"

sullen marlin
tender shard
#

oh btw

#

I still remember FurnitureLib

#

is it still a thing? like do people still use it?

rotund jolt
#

Is anyone else having issues loading the Spigot API?

tender shard
#

what issues do you have

tender shard
#

just run buildtools

#

?bt

undone axleBOT
tender shard
#

no need to download anything if you just run buildtools

winter mesa
#

they don't really work for me when it comes to Spigot

tender shard
#

then download newest BuildTools again and run it

#

should be fixed then

winter mesa
#

i just did

#

but ok

tender shard
#

hm let me check

winter mesa
#

third try's a charm

tender shard
#

what version are you building?

dusty sphinx
#

1.18

#

(came here from the paper server)

tender shard
#

1.18 or 1.18.1 / latest?

winter mesa
#

^

#

1.18.1

dusty sphinx
#

1.18.1

tender shard
#

remapped or "default"?

dusty sphinx
#

pretty sure they dont need it remapped

#

they said they use need the spigot artifact

#

im a paper person i only use spigot for old stuff

#

sorry if im sayin the wrong thing

tender shard
#

well someone who uses spigot instead spigot-api should use remapped in 99% of cases

winter mesa
#

build tools console logged something about remapping and %..

dusty sphinx
#

what are you using it for

winter mesa
#

so i assume it's building a remapped

tender shard
#

@sullen marlin

winter mesa
#

@tender shard

#

Again same error when it comes to spigot

dusty sphinx
#

can you just paste your console output

tender shard
dusty sphinx
#

i cannot read that

winter mesa
#
Rebuilding Forked projects....
Cloning into 'Spigot-API'...
fatal: invalid branch name: init.defaultBranch =
applyPatches.sh: line 16: cd: /c/Users/Tomek/IdeaProjects/mobarablasts/buildtools/Spigot/Spigot-API: No such file or directory
Resetting Spigot-API to Bukkit...
fatal: ambiguous argument 'origin/spigot': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
  Applying patches to Spigot-API...
fatal: could not open '../Bukkit-Patches/*.patch' for reading: No such file or directory
  Something did not apply cleanly to Spigot-API.
  Please review above details and finish the apply then
  save the changes with rebuildPatches.sh
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [C:\WINDOWS\system32\cmd.exe, /D, /C, sh, applyPatches.sh]
        at org.spigotmc.builder.Builder.runProcess0(Builder.java:964)
        at org.spigotmc.builder.Builder.runProcess(Builder.java:895)
        at org.spigotmc.builder.Builder.main(Builder.java:694)
        at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
rotund jolt
# tender shard what issues do you have

I keep getting this ```Could not find spigot-api-1.18.1-R0.1-SNAPSHOT.jar (org.spigotmc:spigot-api:1.18.1-R0.1-SNAPSHOT:20211226.225430-20).
Searched in the following locations:
https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.18.1-R0.1-SNAPSHOT/spigot-api-1.18.1-R0.1-20211226.225430-20.jar

Possible solution:

dusty sphinx
tender shard
#

and I get something like "no credentials" when running BT lol

tender shard
sullen marlin
winter mesa
#

do u guys maybe have spigot-api-1.18.1-R0.1.jar ?

rotund jolt
#

its like this with some other API's and idk how to fix it

winter mesa
#

to download already built?

tender shard
#

sorry, yeah

#

I changed the git remote

#

sorry mb

dusty sphinx
#

i thought you needed the server

#

you need to build the server youreslf

dusty sphinx
#

you dont download the jar

#

you just let maven do it

winter mesa
#

eh

tender shard
#

buildtools runs fine for me, my problem was just that I messed with the git remote repository

dusty sphinx
winter mesa
#

I was tyrying to manually have <systemPath>${project.basedir}/src/main/resources/spigot-1.8.8-R0.1-SNAPSHOT-latest.jar</systemPath>

dusty sphinx
#

no god why

winter mesa
#

so for that slution I needed

dusty sphinx
#

also i thought you needed 1.18.1

#

thats 1.8.8

winter mesa
#

I NEED

dusty sphinx
#

and thats the server

winter mesa
#

1.18.1

dusty sphinx
#

ok

#

get rid of that

#

do you know how to use maven

winter mesa
#

can u just

tender shard
winter mesa
#

ok

dusty sphinx
#

lets work on running buildtools first

#

you need to do that

#

to install it to your local maven repo

vocal cloud
tender shard
#

buildtools runs just fine for me

rotund jolt
vocal cloud
#

Oh there's your issue md_5

rotund jolt
#

how? im using what it says to use for gradle

dusty sphinx
#

we got a gradle hater here smh

tender shard
rotund jolt
#

ik that wasnt is answer, but it could atleast have made sense 😂

tender shard
#

show your gradle file then pls 🙂

rotund jolt
#

ofc

#

.build?

tender shard
#

?paste

undone axleBOT
tender shard
dusty sphinx
tender shard
#

your build.gradle or however it's called

dusty sphinx
#

are you using groovy or kotlin dsl

winter mesa
#

@tender shard

  1. This is example of 1.8.8 spigot api (net.minecraft.server) working locally not from repository url.
  2. I need 1.18.1 lib so i can import net.minecraft.server.
    @dusty sphinx
  3. I need API
  4. Idk what BuildTools is used for (API or Server), however it crashes when it comes to spigot (Working fine with CraftBukkit, and Bukkit)
  5. If I could use external link I really would. However I couldn't find anything working, (I assume ur talking about <repository><id>asd</id><url>HERE LINK</url><repository>) SO I WENT ON SEARCHING FOR A JAR which I can use having <systemPath>
dusty sphinx
#

can you send your maven file

#

systemPath has no place here

tender shard
dusty sphinx
#

im also very confused can you just send your maven file

#

ill tell you what you need to do from there

winter mesa
#
2. I need 1.18.1 

?

dusty sphinx
#

ok so

#

just run buildtools to install 1.18.1 to your local maven repo

winter mesa
#
<repositories>
        <repository>
            <id>minecraft-repo</id>
            <url>https://libraries.minecraft.net/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.18.1</version>
            <systemPath>LOCAL FILE IF THERE IS NO LINK</systemPath>
            <type>jar</type>
            <scope>system</scope>
        </dependency>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.18.1-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>authlib</artifactId>
            <version>1.5.21</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
rotund jolt
#

this example isnt mine, im VS'ing someone elses open source plugin to compile, but it isnt working. and ive had the same issue on other projects that ive developed myself https://paste.md-5.net/eqazimisaj.cs

tender shard
dusty sphinx
winter mesa
#

then i give me the link

tender shard
#

just run buildtools like this:

java -jar BuildTools.jar --rev 1.18.1 --remapped
winter mesa
#
3. If I could use external link I really would. However I couldn't find anything working, (I assume ur talking about <repository><id>asd</id><url>HERE LINK</url><repository>) SO I WENT ON SEARCHING FOR A JAR which I can use having <systemPath>
dusty sphinx
#

you need to build it yourself

dusty sphinx
#

it doesnt matter

winter mesa
#

or w/e?

#

ok

dusty sphinx
#

it installs it to your maven folder

tender shard
winter mesa
#

so

#

we come back

dusty sphinx
winter mesa
#

to the Error

#

that BuildTools produce

dusty sphinx
#

ok

#

are you running it with java 17

tender shard
#

remove EVERYTHING inside your buildtools folder, redownload it, then build it. it MUST work

worldly ingot
#

You should have no reason to depend on the server jar unless you're using server internals (which you should avoid at all costs anyways)

worldly ingot
#

API jar = on Maven repo. Server jar != on Maven repo

dusty sphinx
#

we are beyond that

winter mesa
#

jdk17.0.1

#

i think

winter mesa
#

eh

rotund jolt
tender shard
#

java -version?

dusty sphinx
winter mesa
#
java version "17.0.1" 2021-10-19 LTS
Java(TM) SE Runtime Environment (build 17.0.1+12-LTS-39)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.1+12-LTS-39, mixed mode, sharing)
tender shard
#

spigot (unlike spigot-api) is in no repo. you HAVE to build it yourself for copyright reasons

#

so

#

delete your buildtools dir

#

redownload buildtools

#

run the command I sent

dusty sphinx
#

do you need jdk for buildtools or does jre work

tender shard
#

java -jar BuildTools.jar --rev 1.18.1 --remapped

dusty sphinx
#

send your damn error in a fuckin pastebin

#

thats what ive been tellin you to do

tender shard
#

yeah that would be helpful

dusty sphinx
#

i cant help you if i cant read the error

winter mesa
#

ok one second im running it again.

tender shard
#

did you delete everything before running it again though?

winter mesa
#

XD

#

yes

tender shard
#
BUILDTOOLSPATH=/path/to/your/buildtools rm -rf $BUILDTOOLSPATH && mkdir -p $BUILDTOOLSPATH && cd $BUILDTOOLSPATH && wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar && java -jar BuildTools.jar --rev 1.18.1 --remapped```
😛
winter mesa
#

ayyy

#

You have exceeded the maximum paste size of 512 kilobytes per past

dusty sphinx
#

?paste

undone axleBOT
dusty sphinx
#

did you use this

winter mesa
#

could any of u build it and pass it?

#

the jar?

drowsy helm
#

legally we cant

eternal oxide
#

do not include Bukkit. just spigot

#

nor craftbukkit

winter mesa
#

because buildtools on my computer don't work and if sb build it for me it's illegal XD

rotund jolt
magic dome
#

I need a bit of help with Vectors. I'm trying to make a pendulum effect (I want the character to be able to swing) and I'm having a bit of trouble visualizing how this would be done.

#

basically i need to figure out how I would calculate the vector created by the inertia caused by the connection of the player to that point

#

because minecraft already applies gravitational velocity in some form, I would just need to apply the horizontal velocity of the pendulum, getting this right is tricky

winter mesa
dusty sphinx
#

no idea

#

not a spigot person

echo basalt
#

seems like files aren't being created, or they're being deleted

winter mesa
#

yep, i don't have ny kind of anti virus which might do that

echo basalt
#

Syncing stuff like google cloud or onedrive also mess with this stuff

winter mesa
#

good to know

#

will pause it

#

May I pm you?

echo basalt
#

Sure it's whatever

rotund jolt
tender shard
#

you could ping md_5

#

although I don't know whether he likes to be pinged

#

but I don't know any other solution

eternal oxide
tender shard
#

and you are the only person of whom I could think of to help in this case

livid void
#

is there a way to get the min world block? since in 1.18 vs other versions the min block is at a different location

#

y=0 previously and now y=-65 i think

tender shard
#

oh

#

World#getMinHeight

winter mesa
#

Thanks for trying guys

livid void
#

ah i was using 1.17 so didn't see that thank u @tender shard !!

rotund jolt
tender shard
#

I pinged md_5 for you

#

he'll respond once he has time

rotund jolt
#

just look up spigot gradle API

eternal oxide
#

I'm not searching, if you want help, link it

#

I guarantee it does not recomend adding Bukkit to your gradle anywher on Spigot

rotund jolt
#

thats not help, im telling you that it is, if you want to know then google it

eternal oxide
#

You asking for help, me offering. Either provide a link or I can't help you

tender shard
#

aw shit

#

sorry

sullen marlin
#

Elgar has been correctly saying this repeatedly

tender shard
#

I linked the wrong msg

#

wait pls

#

1 sec pls

tender shard
rotund jolt
eternal oxide
#

No, your gradle build is failing due to missing dependencies

sullen marlin
#

fatal: invalid branch name: init.defaultBranch =

#

User fked their .gitconfig, breaking git

sullen marlin
tender shard
#

I told them to delete their buildtools folder and redownload it like 3 times

#

and they said that they did it

sullen marlin
#

Which makes sense because bukkit doesn’t exist

tender shard
#

@winter mesa

sullen marlin
#

Their .gitconfig in their home dir

tender shard
#

did you actually remove your buildtools folder?!

echo basalt
#

bukkit only exists up to 1.15.2

tender shard
#

ooooh

sullen marlin
#

This is something they changed

#

Nothing to do with buildtools

tender shard
#

your ~/.gitconfig is the problem is what md_5 says

tender shard
winter mesa
#

im building in clear directory

tender shard
#

~ = C:\Users\YourUserName

winter mesa
#

and the file is .gitconfig?

#

in this dir?

eternal oxide
#

C:\Users\%username%\.gitconfig

tender shard
#

it should be there, yes. its probably a hidden file

winter mesa
#

ok so

#

removing file will help?

#

or should i fix it somehow

tender shard
#

rename it pls

winter mesa
#

Ok

tender shard
#

just rename it to "gitconfig.backup" or sth

winter mesa
#

yep

tender shard
#

then run buildtools again

winter mesa
#

on that

#

It worked! Thank you all for help

tender shard
#

🙂

#

np

winter mesa
#

btw u know how to set a location of a EntityPlayer in these new libs?

#

trying to make some npcs

lavish hemlock
#

teleporte

winter mesa
#

thanks 🙂

lavish hemlock
#

I was uh

winter mesa
#

u got link to docs? will be useful

lavish hemlock
#

I was making a joke

winter mesa
#

oh

#

won't it work?

#

so maybe any of u got idea how to create "npc" player?

#

teleport doesn't work..

tender shard
still valley
#

is there a better way to test small changes besides closing the server and restarting it

#

can I like swap them out and reload within minecraft

young knoll
#

Yes

#

/reload after swapping the jar

magic dome
#

how would I get the vector perpendicular to another vector

#

this is so hard

#

im having so much trouble visuallizing this

eternal oxide
#

There is no single vector that is perpendicular to another in 3d space

subtle folio
#

Im trying to add a hover event to my textcomponent, why am I getting a error? java copy.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(ChatColor.YELLOW + "Click to copy the ad!").create()));

quaint mantle
#

would be nice if you showed the error

somber hull
#

is working with persistent data containers slow at all?

#

Like should i avoid it, or is it just fine

young knoll
#

I assume it’s all in memory

#

So it’s just map access

#

Doesn’t 1.15 have a scoreboard API

#

Well yeah

#

You can’t have more than 1 without it either

#

You can swap them around though

#

You can’t

#

With or without NMS

#

What

#

What do you even mean by multiple scoreboards

#

Okay

#

But what do you need more than one for

#

What

#

I still don’t understand

#

Glow is done with teams, a scoreboard can have several teams

wet breach
#

just give them each a scoreboard 😉

#

it will be fine

brittle veldt
#

How would I use BukkitScheduler to run a simple thing 3 seconds later
like running first set to portal thing then 3 seconds later set to air

young knoll
#

runTaskLater

brittle veldt
young knoll
#

?scheduling

undone axleBOT
chilly citrus
#

what's the best version api to develop on, e.g. for a skyblock plugin?

young knoll
#

Latest

kindred valley
#

hello guys

#

how can i set value of random int . Like int a = random.nextInt() < 10

young knoll
#

nextInt takes a value for the upper bound

kindred valley
#

ah

#

i used random.nextInt(bound) one

#

its useful

kindred valley
young knoll
#

indexOf?

kindred valley
#

do i need to type an int on indexOf?

#

want me to type an object

young knoll
#

You want to get the index from an object?

#

Or the object from an index

kindred valley
#

i created 1 arraylist put something to it. I want to see those's number order

#

like if i added "a", "b", "c". Want to see their order numbers.

young knoll
#

ArrayLists are insertion ordered

kindred valley
#

so first one i added is 1

#

0*

young knoll
#

Yes

buoyant viper
kindred valley
buoyant viper
#

its oki

#

i just wanted 2 make a lua joke

spiral light
#

Nice ... Never got custom entity types to work ... Always had to use already existing entity types and extend them to make it work with the API since it doesn't know the entitytype if you just extend Mob(or EnrityInsentient)

#

Is there a ?-cmd for the world creator with the new Chunk creator as tutorial ?

young knoll
#

No

quaint mantle
#

do giants still exist in the game

#

if so can we summon them

tardy delta
#
Giant g = (Giant)loc.getWorld().spawn(loc, Giant.class);```
The class exists so i assume that's a yes
winter mesa
spiral light
kindred valley
#

hello guys

#

do we can text negative numbers on java

quiet ice
#

?

spiral light
#

"Test negative numbers" ?

quiet ice
#

For String -> Number do Integer.parseInt(...)/Long.parseLong(...)/Float.parseFloat(...)/Double.parseDouble(...)

kindred valley
fallow merlin
#

How do I send a PacketDataSerializer?

quiet ice
#
assert number < 0;
kindred valley
quiet ice
#

debugging stuff, not enabled by default outside of unit testing

#

throws an AssertionError if the operand is false

fallow merlin
quaint mantle
#

ive noticed a lot of ppl talking about creating playerentities

#

can you just make fake nms players easily now?

winter mesa
#

Because world.spawnEntity( is for Types, not EntityPlayer no Player

#

Ok I found that world.getEntities().add(my_entity) will add an entity however only type Entity not EntityPlayer nor Player. Any idea of how to cast it?

quiet ice
#

This sounds dangerous

#

Yeah it's not written in the apispec that it should return a mutable list, let alone a list that is backed by the actual list of entities

misty current
#

does anyone know any apis to add lines above player names using riding entities? I've tried to use multilineapi but the api that it uses doesn't work on 1.8

quaint mantle
#

Eh 1.8

clear iris
#

When making custom crafting how do I group items so I can avoid making multiple crafting recipes and just have one for all?

lusty cipher
#

I'm cancelling InventoryMoveItemEvent and for some reason, idk why, there is a condition where all items except 1 simply disappear. All I do is do setCancelled(true)

tardy delta
quaint mantle
#

how can i access to a private interface in a class via field reflections?

tardy delta
fallow merlin
#

How can I convert a PathResult to a PathEntity? (or get an NMS PathEntity from an API Pathfinder?)

acoustic pendant
#
    public void connect() throws ClassNotFoundException, SQLException {
        if (!isConnected()){
            connection = DriverManager.getConnection("jdbc:mysql://" +
                            host + ":"  + port + "/" + database + "?useSSL=false",
                    username, password);
        }
    }
#

how can i implement autoreconnect here?

quaint mantle
#

use hikaricp

tardy delta
#

use a try with resources instead smh

pulsar path
#
@EventHandler
public void lockEvent(EntityDamageByEntityEvent e) {
  if (e.getEntity() instanceof Minecart) {
    if (e.getDamager() instanceof Player) {
      getServer().broadcastMessage("TEST");
    }
  }
}  

why is this not working?

acoustic pendant
#

you are saying if the entity is a minecart? that won't hit

tardy delta
#

are you sure breaking a minecart is a damage event?

acoustic pendant
#

^^

acoustic pendant
pulsar path
#

whats the event of hitting a minecart then?

acoustic pendant
#

?jd

quaint mantle
#

Take a look at some guide

crimson terrace
acoustic pendant
tardy delta
#

that will be called at every interaction

#

but it doesnt have an entity

crimson terrace
acoustic pendant
#

i mean, i have finished mysql code but if the server doesn't restart it says something about auto-reconnect

tardy delta
#

are you using /restart?

#

as you say "restarting"

quaint mantle
acoustic pendant
#

i mean

tardy delta
#

ah i get it

acoustic pendant
#

when i call something to execute mysql

acoustic pendant
#

it says that has been long and try to use autoreconnect

quaint mantle
#

Do not be aware of rewriting bad code

crimson terrace
tardy delta
#

thats why you need to close your connection

quaint mantle
#

yep, afraid**

crimson terrace
#

makes more sense

tardy delta
#

and returning an open connection on the method call

acoustic pendant
tardy delta
#

so a try with resources + hikariCp would be more convenient

wet breach
tardy delta
#

well uhh

wet breach
#

you can close out the resources being used, but you shouldn't need to close out the connection unless you don't need the connection anymore

quaint mantle
#

Multithreaded access to Connections was deprecated in JDBC and is not supported by HikariCP either.

HikariCP is fast enough that you can obtain a Connection, execute SQL, and then return it back to the pool many times in the course of a request.

It is a Best Practice to only hold Connections in local variables, preferably in a try-with-resources block, or possibly passed on the stack, but never in a class member field. If you follow that pattern it is virtually impossible to leak a Connection or accidentally share across threads.

young knoll
#

Yeah you are meant to close them with hikariCP

wet breach
young knoll
#

Not that I recall

tardy delta
#

i always saw people closing them

young knoll
#

There’s even a setting to detect leaked connections

wet breach
#

well leaking a connection refers to something else using the same connection as another thing

#

I suppose you could end up with a leaked connection with nothing connected to it, but a properly configured MySQL server should kill such connections

#

worst case is you hit the TCP time limits

wet breach
#

this way, the time is removed from opening a new connection and thus using less resources

#

if all the connection pool itself is doing is closing out the connection completely, then it is virtually pointless to have such an API since you can code the few lines to open a connection and then close it out yourself lol

winter mesa