#help-development

1 messages · Page 189 of 1

golden turret
#

I have a list of vectors

#

basically a line

#

I want to rotate it to where I look

#

I know the existence of the rotateAroundX and YZ methods

#

but idk how to use them

#

how do I use it for my purpose

echo basalt
#

Rotate by the angle

#

In radians

#

So just rotate it by radians(yaw)

sand vector
#

when depending, how do you know what the name of the plugin is? Is it the jar file name or is it what comes up when using /pl?

wet breach
#

in this manner it doesn't matter what the jar file name is and doesn't affect the plugins name in the server 🙂

sand vector
#

👍

timid jetty
#

I need to do a lot of testing of outputs and such, is there such a thing as a command line interface I can run spigot code directly while running my game

golden turret
# echo basalt So just rotate it by radians(yaw)

would this be right then? java public void play(Location location) { for (ParticleBuilder particle : particles) { Vector vector = particle.location().clone(); vector.rotateAroundY(-Math.toRadians(location.getYaw())); vector.rotateAroundX(-Math.toRadians(location.getPitch())); particle.spawn(location, vector); } }

echo basalt
#

try and see

golden turret
#

I already tried and it not worked

shadow gate
#

Tell me, and how to register the playback of your sounds from the resource pack through the plugin?

warm token
#

How to change the skin of player head in the tab

#

I'm using TAB

tardy delta
#

why not calling inv.setItem

#

heh

wind blaze
#

Does anyone know how to color name tags while having luckperms plugin? I need to color name tags red, and I know how to, but it’s bugged with having luclperms plugin (which is vital for my server) any work arounds anyone knows?

wind blaze
#

Player name tags

#

As in I see your name Ingame

#

I used scoreboard teams

#

But it’s bugged whenever I add luckperms to server

smoky oak
#

whats the java code again to make a test case? Iirc it was something along the lines of 'assume' or 'expect'

tardy delta
#

assert?

fickle mist
#

Hi all! My question is how to commit what is supposedly the key or not(code below)

tardy delta
#

is that setence english?

fickle mist
#

a little

tardy delta
#

i see

#

a little much

smoky oak
#

uh

#

if i flag my server on boot with -ea does it spit out plugin assert errors?

tardy delta
#

it will ig

#

or just use some validation class

fickle mist
tardy delta
#

i dont even know what to help you with

tardy delta
#

i got told it was smth with scoreboards or smth, to assign a team name to that npc or smth

chrome beacon
#

Yeah use prefix and suffix

serene sigil
#

how to detect if a player is standing one block behind another player? (dont take this out of context :))

#

hello?

grim ice
#
private boolean isABlockBehind(Entity player, Entity ent) {
    Vector pDir = player.getLocation().getDirection();
    Vector eDir = ent.getLocation().getDirection();

    double relativeAngle = (Math.atan2(pDir.getX() * eDir.getZ() - pDir.getZ() * eDir.getX(), pDir.getX() * eDir.getX() + pDir.getZ() * eDir.getZ()) * 180) / Math.PI;

    return ((angleInDegrees <= 60 && angleInDegrees >= -32) &&     player.getLocation().distance(ent.getLocation()) <= 1);
}
#

in this case ent is the player in front

#

is 1 or under

serene sigil
glad prawn
#

Maybe

grim ice
#

i think that's pretty obvious

#

by the method name

eternal oxide
#

Method name is non descriptive

serene sigil
#

also how would u make it so if u sneak a number of times in 10 seconds it triggers sth

terse raven
#

Is there a block event that handles all block changes?

eternal oxide
#

no

terse raven
#

aight

#

then i guess i will have a fun time

quartz solstice
#

Does anyone know how to dispatch a command asynchronously?

fossil lily
#

Anyone know why if I'm constantly teleporting an entity to a player the entity looks delayed on the client but not for any other players?

chrome beacon
#

Because player movement is clientside

#

If you're trying to display extra text with an armorstand make the entity a passenger

quartz solstice
chrome beacon
#

Don't

fluid river
#

why do you even need that

quartz solstice
#

i want to make a command run after a certain amount of time

chrome beacon
#

use the scheduler

quartz solstice
#

how

chrome beacon
#

?scheduling

undone axleBOT
quartz solstice
#

i tried but it is running the command

#

ok

fluid river
#

why async

quartz solstice
#

with the scheduler?

fluid river
#

Bukkit.getScheduler().scheduleSyncDelayedTask(() -> {

});

#

or smth similar

chrome beacon
#

?scheduling

undone axleBOT
eternal oxide
#

runTaskLater

fluid river
#

var runnable = new BukkitRunnable() {
public void run() {
// your code
}
};
runnable.runTaskLater();

shadow gate
#

How to make it apply to only one player. If another player comes in, then this message is also written to the rest 🙂

fluid river
#

just send player a message

#

and set join message to null

#

so nobody sees that player joined

shadow gate
#

Precisely! Thanks!

fluid river
#

next time you decide to code

#

open javadocs on second screen

#

or on half screen

#

or just alt tab

#

?jd-s

undone axleBOT
fluid river
shadow gate
fluid river
#

event.getPlayer().sendMessage("hey dummy");

shadow gate
#

Okay And how to fix the problem that one player's music is heard by another?

#

As I understand it, I made her play for everyone?

fluid river
#

you play a sound on location

#

everybody can hear it

shadow gate
#

How to make the music play only for the one who has the event

shadow gate
shadow gate
#

Thanks

fluid river
#

just open the javadocs and never close

#

here are all the answers you need

quaint mantle
#

do any nerds here know what happens if two runnables are going off on the exact same tick

fluid river
#

nothing

quaint mantle
#

which fires first

smoky oak
#

random

fluid river
#

random

smoky oak
#

probably whatever registered first

#

but no guarantee

fluid river
#

nanoseconds mismatch

fading spindle
#

how do i check every 3 or so ticks that if the player is sprinting and execute certain things like a chat message if the player is sprinting

fluid river
#

runTaskTimer

fading spindle
#

k

fluid river
#

you want to check if player is STILL sprinting after 3 ticks? or just send every sprinting player a message every 3 ticks

fading spindle
#

SO BASICALLY

#

oops caps

#

so basically

#

i want to keep checking if the player is sprinting

smoky oak
#

imagine being me

fading spindle
#

and if he sprints like 5 blocks

smoky oak
#

no caps indicator

fading spindle
#

i will send msg

fluid river
smoky oak
#

theres a togglesprintevent

#

?events

fluid river
#

also no language indicator

fading spindle
#

ok

smoky oak
#

seriously when tf will they add a quick event list

fluid river
#

player can stop sprinting and start sprinting again

#

within 3 ticks between two checks of your timer

smoky oak
#

playertogglesprintevent

#

consider saving this link

fading spindle
#

sok

#

ok

#

thx

#

basically put it in a loop

#

and keep checking

smoky oak
#

well u could just register the last time the sprint event got toggled

#

and then check if theyre sprinting

#

if answer is over 3 sec and yes

fluid river
#

you can create a map

smoky oak
#

less overhead same result

fading spindle
#

ok

fluid river
#

where you store the location where player started sprinting

#

and have a timer which goes through this map and checks distance between player's current location and location where he started sprinting

fading spindle
#

ok

#

thanks

fluid river
#

so if it's > 5 then do something

fading spindle
#

ok

#

wait you got some sample code

fluid river
#

tho wouldn't work if player is running circles

fading spindle
#

?

fading spindle
smoky oak
#

check sprinted distance

#

u can check player stats

fluid river
#

true actually

fading spindle
#

oh ye

fluid river
#

then we can just make a list, not a map

fading spindle
#

Oh

fluid river
#

so we don't loop through players who weren't even sprinting

#

actually nah

smoky oak
#

why use many code when few do trick
<- probably the laziest person in the chat

fluid river
#

we would still need map

fading spindle
#

ok so how do we setup a how many player kill counter

fluid river
#

cuz we need to store sprinting distance when player started sprinting

smoky oak
fading spindle
#

ok nvm

#

so

sand vector
#

I have a plugin thats gonna be a dependency. How do i make the poml stuff for it? can anyone send me a guide or something, as im struggling to find anything

fading spindle
#

if its not alraedy made for you check if your on maven

fluid river
#
HashMap<UUID, Double> distances = new HashMap<>();

@EventHandler
public void onSpint(PlayerToggleSprintEvent e) {
    if (e.isSprinting()) distances.put(e.getPlayer().getUniqueId(), sprintDistance/*which you have to get from player's stats*/);
    else distances.remove(e.getPlayer().getUniqueId());
}```

and a task timer somewhere in onEnable
rocky pond
#

Hey, I'm trying to register multiple aliases and for some reason the command works, but the aliases dont. No errors. Only the commands with 1 alias work (for example, /staffchat's alias /sc does work.)

fading spindle
#

ok got it!

smoky oak
#

even if, technically anything with public methods doubles as a library. you just need to 1) import it in the project that depends and 2) put it in ur plugin loadbefore list iirc

quaint mantle
#

hello, do you need a license to sell on spigot?

smoky oak
rocky pond
#

Aight i'ma try that 1s

smoky oak
#

iirc u need some amount of merit or smthj

quaint mantle
#

thanls

smoky oak
#

string list weirdness

#

cuz we use .yml

rocky pond
#

i said it did work

#

my english is just trash

fluid river
rocky pond
smoky oak
rocky pond
#

i also tried to make it a string list

#

aight 1s

#

i used yamlLint, it says it's valid

smoky oak
#

im out of ideas

fluid river
#

how do you register your command executor

rocky pond
#

this used to work, i'm not sure why it doesnt work now

quaint mantle
rocky pond
fluid river
#

do they even show up

#

when you do

#

/yourpluginname:command

rocky pond
#

the aliases dont show up. no sign of em

#

yeah i tried that the command shows the alias doesnt

fluid river
#

/mod returns unknown command message?

smoky oak
#

cough google cough

#

honestly if u cant find it u shouldnt code lol

#

90% of our time is spent searching the internet

rocky pond
fluid river
#

errors in console?

rocky pond
#

Nope

#

i feel like im missing something

fluid river
#

ьь

#

umm

#

is your plugin

#

ExtraStaff

#

smth

rocky pond
#

Lemme try something

fluid river
#

throw out plugman out and restart your server

#

uninstall plugman completely

rocky pond
fluid river
#

and never /reload

#

it just breaks plugins ya know

rocky pond
#

it worked thank you

fluid river
#

ez

rocky pond
#

lol

fluid river
#

there is a PlugWoman on spigotmc

#

devs claim that it's better

keen horizon
#

If I’m looking for a plug-in with stuff that I would want is this the channel to ask?

fluid river
#

no

#

here you ask how to learn coding

#

go to any other channel

#

tho dm me maybe i can code it in 10 minutes

fluid river
rocky pond
#

its just a test server

#

idk if it matters

#

its freaking minehut

fluid river
#

use /reload confirm at least

#

it doesn't break so much stuff

fluid river
#

you can add like 999 optimizations yourself

rocky pond
#

yeah i have one

fluid river
#

view distance to 3

rocky pond
#

only for mysql testing stuff tho

#

idk i just like minehut

fluid river
#

disable end and nether

#

and so on

rocky pond
#

i run my mysql host thing on my elite amazon server

fluid river
#

💵

quartz solstice
#

Why is Bukkit.dispatchCommand() not working

fluid river
#

it is

#

i guess you just use it wrong

quartz solstice
#

how?

fluid river
#

show your code

quartz solstice
#

nvm

#

i cant use a slash

#

i figured it out

mental moon
#

Having a really strange error with my custom quiver script using bundles.
When I was initially building the script I would get a similar "null or air" error when adding an Air ItemStack to a bundle.
When I hold the bundle in the cursor and right click on a stack of arrows everything works, filling up the bundle to 256 without error.
If I hold the arrows and rightclick them into the bundle however, if the bundle is at or over 128 it explodes with that error without firing anything from my script.
if I could read the "and x more..." lines that it hides I'm sure I could get somewhere.

Error Log:
https://pastebin.com/JK8jy8e1

Script:
https://pastebin.com/y3pWurNR

fluid river
#

do you have some kind of quiver item?

mental moon
#

It's a bundle

#

Let me post the whole class, sorry

mental moon
quaint mantle
#

what is the name of the text written with hyphens?

#

like this

mental moon
#

isn't that called ASCII art?

olive lance
#

Yeah

quaint mantle
#

ily

fluid river
mental moon
#

That's the thing, I'm not sure.
If you see the top of the console error it only fires once when I first pickup the arrow itemstack. The System.out command at the top of my Listener doesn't even fire it just crashes, and I can't see a pointer back to any of my code

fluid river
#

why are u using & instead of && everywhere

mental moon
#

Should I be?
Whoops

fluid river
#

i mean for java especially

#

it goes like this

mental moon
#

I use | a lot too

fluid river
#

if (first && second && third) doSomething();

#

so if first is false then program doesn't check second and third argument

mental moon
#

Ohh

#

That's not good lol

fluid river
#

and for & it still would check them

mental moon
#

I gotcha

fluid river
#

same goes with || and |

#

if (first || second || third) doSomething();

sterile token
#

Because then you can apply it when u are programming

fluid river
#

if first is true then program doesn't check second and third

#

and for | it does

hazy parrot
#

& is in fact binary operator, it will check other because it will try 1(true) AND 1(true)

hazy parrot
#

it does ?

fluid river
#

does

mental moon
#

It does and I was using it

fluid river
#

& and | both exist in java

hazy parrot
#

as i said, its binary operator

fluid river
#

which are both binary

hazy parrot
#

&& is logical

fluid river
#

yeah

sterile token
#

ohh weird

#

never seen tha thaha

fluid river
#

you don't really need & and | in your usual programming cases

sterile token
#

I always use the &&, ||

hazy parrot
fluid river
#

except when you are doing some binary stuff

#

there is also a byte move operation

hazy parrot
#

<<

fluid river
#

with and without filling 0

#

ye

#

XOR which is ^

#

~ which is ! but for binary

hazy parrot
#

tbh before starting uni I was sure that ^ is power

fluid river
#

ahah true

#

calculators still accept ^ as power

#

look at java

mental moon
#

I feel kind of good that the only standout thing about my code was using inefficient operators.
I've only made a handfull of plugins and haven't touched anything but Java yet.

fluid river
#

~ & | ~ >> << >>> &= ^= |= <<= >>= >>>=

#

all valid in java

sterile token
#

std is not really used in java terms, is more for other langs like C, rust

fluid river
#

cout

#

cin

#

#include <iostream>

#

int a;
std::cin >> a;
std::cout << a + 2;

mental moon
#

I'll probably just make it so the bundle has to be the item on the cursor.

fluid river
#

you are doing much weird stuff

mental moon
#

Okay I figured.
I'm kind of curious what weird stuff I'm doing

fluid river
#

your code looks like i decompiled it with JD-GUI

#

after you compiled it

mental moon
#

I don't know if that's good or bad

fluid river
#

extremely bad

mental moon
#

Oh lol

fluid river
#

decompiled code looks like it's written by some dumb AI just to make code hard to read

mental moon
#

What I think I'm doing is making it fail fast

fluid river
#

can you explain your idea

mental moon
#

I know I also need to split these big methods into smaller fetching methods, but I'm just mapping out the basic functionality first

fluid river
#

what are you even trying to do

#

why don't you just store arrows in bundles

#

like you should

mental moon
#

Then you're limited to 64

raw prairie
#

Monke

fluid river
#

?

#

you have 6 slots

#

in each you can place 64 arrows

mental moon
#

In bundles?

fluid river
#

isn't it

mental moon
#

They only accept 64 items by default

fluid river
#

well who needs 65

mental moon
#

Then there's no point to the item I'm creating

#

A lone stack of 64 arrows would be better

fluid river
#

idk what you are creating

quaint mantle
#

java.lang.NullPointerException: Cannot invoke "me.distruzionee.staffpanel.Main.getConfig()" because "this.main" is null

undone axleBOT
quaint mantle
#

in events work, on commands no

quaint mantle
mental moon
fluid river
#

and what is wrong with that

sterile token
#

hey stop arguing, this is not the best way to fix issues

fluid river
#

in constructor or by reflection

sterile token
fluid river
fluid river
#

with DI you basically init a field in a constructor

sterile token
mental moon
#

When I try to add a stack of arrows any size from the cursor it blows up.
When I pick up the bundle and click the arrows with the bundle it functions properly and I have no idea what the discrepancy is

fluid river
#

you need to sleep

sterile token
#

Yeah im those guy against Singleton*

fluid river
#

you don't get what we are saying

quaint mantle
sterile token
#

I mean static burns my eyes

quaint mantle
#

now works

fluid river
fluid river
fluid river
#

import static is OP

sterile token
quaint mantle
#

👀

sterile token
#

I dont want to ge tmad

#

Dont make me lost time

fluid river
#

you already are

#

i guess

sterile token
#

yes because u are loting my time

fluid river
#

just ignore me

#

isn't that done by packets tho

sterile token
fluid river
#

you can place armorstand as player's passenger and set it's name

sterile token
#

Either packets or PTC lib

sterile token
fluid river
#

when player has passenger, his nickname plate hides

sterile token
#

Okay

#

So take a look at name tag edit

#

i think its open source

#

Why fucked intellij is not putting maven dependencies?

river oracle
#

Intellij L

sterile token
#

yeah

#

i mean it should put them by default

hazy parrot
#

wdym by "putting"

sterile token
#

yeah i mean it should the maven dependencies inside jar

#

every none scope provided, should be shaded by default inside the jar

hazy parrot
#

you mean why do you need shade plugin ?

sterile token
#

that my question lMAO}

#

I asking that why intellij DOESNT SHADE NONE PROVIDED DEPENDENCIES BY DEFAULT

#

Shit sorry for caps

#

I didnt realize i toggled

tall dragon
#

because you need the shade plugin

sterile token
#

👉 👈

sterile token
quaint mantle
#

why it doesn't work bruh
for (int i = 0; i < 10; i++){
System.out.println("ciao");
}

sterile token
#

🤔

river oracle
#

no lol

tall dragon
#

no

river oracle
#

its not

sterile token
#

weird in my case was by default

#

😂

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.

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.

quaint mantle
#

in commands class works, in main not

sterile token
#

👀

#

Doesnt make sense i mean, atleast describe why, etc

sterile token
quaint mantle
tall dragon
#

yea thats not enough

#

u need to add the shade plugin

quaint mantle
#

while ?

sterile token
#

you can use use for (UUID uuid : listOfUUid)

tall dragon
#

that doesnt rlly matter

quaint mantle
#

emh

sterile token
#

I mean have you learnt java?

tall dragon
#

it will be compiled to the same

quaint mantle
tall dragon
#

its just easier to write

quaint mantle
#

i watch the video in my course

sterile token
#

Yes epic dont fuck bruh, i mean you never agree

#

I said white, you said black, and that every time

tall dragon
#

just saying the facts my man

quaint mantle
sterile token
#

Yeah haha

quaint mantle
sterile token
#

It was for him

quaint mantle
#

oh okay hahah

sterile token
#

Na dont worry

#

Sorry epic, i was on fired

#

👉 👈

river oracle
#

verano you need to still practice a lot on your english xD the only time you make sense is when I talk to you in spanish

sterile token
#

I mean i havent gone to english clases since last month because i dont have enought time to code plugins and get money

tall dragon
quaint mantle
#

how do i get the plugin to do something every bit of time?

river oracle
#

?di

undone axleBOT
tall dragon
#

???

#

with a scheduler

river oracle
#

dependency injection is da way

tall dragon
#

?scheduling

undone axleBOT
tall dragon
#

no its not ?

sterile token
#

I mean you can also do a fast research on ?google

river oracle
#

oh i read it wrong xcd

#

I'm watching a presentation on bytecode right now I'm not sure why I thought this would be interesting

quaint mantle
river oracle
#

its so intuitive to read I should just skip this part

fluid river
#

maven-shade-plugin

river oracle
#

get rekt

river oracle
#

than just copy and paste it xD

#

thats how I do my maven

fluid river
sterile token
#

hat?

fluid river
#

i'm god

sterile token
#

I mean i was trolling when i sentt hat code

#

hahaha

#

Im not so idiot

tardy delta
#

gn

sterile token
#

I know that verybody here treat me as idiot but meh im not dumb

river oracle
#

your not an idiot your just bad at getting your point acrossed xD

river oracle
#

the trouble of language bariers

sterile token
#

weird sh** closed enligsh

tall dragon
#

if only everyone just spoke english

sterile token
#

You talk a really closed english were != native can understand it

river oracle
sterile token
river oracle
#

we just need to use a human engineered language for maximum efficency

tall dragon
#

i mean its better than my native language

river oracle
#

what is ur native lang

tall dragon
#

dutch

sterile token
river oracle
#

💀 dutch

sterile token
#

Spanish is really sweaty

tall dragon
#

yea

#

indeed

#

💀

river oracle
#

idk anything about dutch but I felt like saying that

sterile token
#

German right?

tall dragon
#

well ur right

#

its shit

sterile token
tall dragon
#

no

#

dutch = the netherlands

sterile token
#

ohh i always associated with german

river oracle
#

Germany == Deustach

tall dragon
#

yea xD

sterile token
#

i thought that dutch was a short way

#

indeed maven shade is not working

#

😡

river oracle
#

Dw vernano

#

I'll hook you up

#

gimme a minute

sterile token
#

no wait

#

i can use libraries from bukkit

river oracle
#

@sterile token

  <build>
    <plugins>
      <!-- Maven Shader Plugin -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.4</version>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
              </excludes>
            </filter>
          </filters>
        </configuration>
      </plugin>
    </plugins>
  </build>
#

bakka

#

thats a bad solution

#

just use shade plugin

sterile token
#

is possible to use libraries from bukit with custom repo?¡

river oracle
#

then do mvn package

#

😭 please juist copt what I sent than compile with mvn package

sterile token
river oracle
#

lol

fluid river
river oracle
sterile token
#

i mean if you run mvn package will run the build goal

fluid river
#

i mean he knows maven

sterile token
#

Doesnt make sense wha tu said

sterile token
#

i jsut was having some issues

river oracle
#

I prefer mvn package cuz mvn install installs it to your m2 and I find that annoying for some odd reason

#

we can't look down upon mvn deploy either its my buddy

fluid river
#

yeah that's why i seen literally nobody using install

#

package/clean package

sterile token
#

install is not donde for that

#

mvn package - packaging the project
mvn compile - compiling the project
mvn install - installing the project into local repo
mvn deploy - deploying the project into remote repo

#

😂

river oracle
#

what about mvn alk

#

bet you didn't know about that one

sterile token
river oracle
#

yea alk

sterile token
#

😡

river oracle
#

its not real 😂

sterile token
#

Is shading fucked spigot when has SCOPE COMPILE

#

😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡 😡

river oracle
#

leave blank

sterile token
#

provided*

river oracle
#

oh yeah

#

provided mb

#

lmao

#

your smarter than me here apparently xD

sterile token
#

yes

#

it still shade it

#

fucked maven***

#

Definetly maven is idiot

#

Is doing what his ass signs

river oracle
#

send your pom

#

?paste

undone axleBOT
sterile token
river oracle
#

no se?

sterile token
#

I could be dumb but i know how to send code and everyting

river oracle
#

Oh i just sent the paste thing for convience for you lol

#

not trying to insult your inteligence lol

sterile token
#

oh ok my bad

#

Sorry man i mreally bad these days

#

i think i have told u what happened to me

river oracle
#

you should try avoiding SQL and web development

#

it'd really improve your mood

sterile token
#

no i dont use SQL

#

Website and SQL doesnt get together

#

The combination is WebDevelopement + MongoDB

#

SQL is heavy dury for working and treating

#

You should be really mentally prepared

#

mate could u check the ponm

#

Its correct

#

I have parsed it on a website

river oracle
#

try using this verano

sterile token
#

oh i realize what happenm

#

the spigot is added cuz of nested dependencies

#

So the libraries im using doesnt contain provided scope for their own depends

river oracle
#

💀 what the fuck

sterile token
#

It must be that

#

Let say i have i use a library which depend on spigot right? So that libraries doesnt contain spigot dependency as provided

#

So when i use it my project and i shade the project, that nested depedency is shaded

#

👍

sterile token
#

I have to finish this thing 3d ago

#

😬

fluid river
#

?learnenglish hehe

river oracle
#

rood

sterile token
#

I dont have humor and i dont want to swear you

#

So please i would be really thankfull if you dont disturb my self doing inncessary things

river oracle
#

can I disturb you

sterile token
river oracle
#

ok 👍🏽

fluid river
#

how's your family

sterile token
#

if u want to ask me smth or just talk dm me

fluid river
#

really important

sterile token
#

i mean i just having bad days

#

the girl i meet is mad with me

#

Because i did something really stupid

fluid river
#

she is so mad that you even forgot how to speak english hehe

#

not tagging

#

not disturbing

river oracle
#

Why is SQL so fucked I don't understand

#
        PreparedStatement ps = dbc.getDatabase().prepareStatement(query);
        ps.setInt(1, 6);
        ps.setString(2, "two three");
        ps.executeUpdate();
``` I feel like this just shoouldn't work when the second data type is supposed to be varchar with length of 2
eternal oxide
#

depends on teh DB type and driver

#

Some support auto conversion

river oracle
#

I'm using SQLite

#

wait

#

I figured out why

#

my table was wrong

fluid river
#

JDBC?

river oracle
#

oh no it still works lol

#

Yea I'm using JDBC

fluid river
#

gtg cya

river oracle
#

well I was just testing out data types on sql tables because I'm going to start working on an API but for some reason it puts in the string "two Three" even though my second table argument is a varchar with length 2

SQLDataType.VARCHAR(1)
#

it works but I feel like this shouldn't lol

#
CREATE TABLE IF NOT EXISTS test (id INTEGER PRIMARY KEY, name VARCHAR(1) NOT NULL);
sterile token
#

I mean you can either use JDBC or HirakiCP

#

So what he is doing is okay

main dew
#

How disable place item_frame?

river oracle
#

not my issue why can I add "two three" if it will only allow 1 char to the table

ocean ginkgo
#

how do I have a nonstatic thing ran every tick? Im using Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask inside my onEnable of my main

sterile token
ocean ginkgo
#

its saying It needs to be static

#

is there a way to make it so It well doesnt need to be static?

river oracle
#

so fucking jank

sterile token
#

table?

#

I mean tables is a key-value storage

echo basalt
#

no

sterile token
#

So im really sure you should be talking about colums

sterile token
river oracle
#

yes I am but what I meant is that column only allows 1 character so why is it I can add 8 without an error being thrown

sterile token
#

It should be added 1 char only

river oracle
echo basalt
#

You can have duplicate rows pretty sure

eternal oxide
river oracle
sterile token
#

i mean Varchar only limitate what you can add to the colum

#

It doesnt limitate how much values you can add to the table

eternal oxide
#

it does if he specified a max

#

anything over teh limit is truncated

sterile token
#

hmnn

#

i dont know what is talking about

river oracle
#

?paste

undone axleBOT
sterile token
#

I just know that varchar(1) limitate how many chars you can add to the colum, not hoy many values related to that colums you can add to that table

main dew
#

Thanks

river oracle
#

ok ignore the shitty code I just made builders so I could make statements faster at the beginning as I'm learning sql
https://paste.md-5.net/guwawazomo.cs

The driver name is SQLite JDBC
Connected to database.
CREATE TABLE IF NOT EXISTS test (id INTEGER PRIMARY KEY, name VARCHAR(1) NOT NULL);
INSERT INTO test(id, name) VALUES(?, ?) 
#

first print is the table creation logic
second statement is the insert statement

#

I deleted my old sqlite file and built a new one from scratch on this run

#

no errors thrown and no protest even though I set varchar to length of 1

eternal oxide
#

ah SQLite

#

SQLite has no defined max value. it is ignored

river oracle
#

okay good to know lol

sterile token
#

oh i didnt know that tho

river oracle
#

I was so confused I'm trying to make an API for all DB impl and was confused as hell

#

thanks ok I think I know a structure that will work now

sterile token
#

Is this statement correct? Because its all time returning

echo basalt
#

put the ! after the (

sterile token
#

oh ok

#

so just need to remove the 2 double brackets

#

and negate each statm right?

echo basalt
#

pretty much

sterile token
#

Thanks

#

Idk why i have understand that (!(a && b)) is the same that (!a && !b)

worldly ingot
#

It's why I try to avoid !(a && b) pretty much any instance that I can

#

It's kind of difficult to wrap your head around

echo basalt
#

I'm just a smart boy and read the parenthesis first

robust sinew
#

how do I add noclip to an armor stand

tall dragon
#

pretty sure you need to get the CraftBukkit version of armorstand and set the field noclip in there

tall dragon
#

wdym

robust sinew
tall dragon
#

then you need to use mappings

sterile token
tall dragon
#

im fairly sure on 1.8 this field is not even obfuscated

#

its just called noclip

sterile token
#

weird

tall dragon
#

idk bout other versions

robust sinew
#

I'm on 1.19

robust sinew
#

I just started using spigot for the first time yesterday so I am new to this

sterile token
#

oh that why

#

First of all, have you learnt java?

#

Its smth really important before starting with spigot

robust sinew
#

oh ok ty

#

that's a lot easier than what I was doing lol

sand vector
#

Im trying to add my dependency to my other plugin, I keep getting this messange. anyone know why?

ivory sleet
#

Maven or Gradle?

sand vector
#

maven

ivory sleet
#

Mind showing us the pom.xml?

fresh timber
#

I am trying to use the setTabHeader() on the BungeeCord API but I am getting an error that I need to use a BaseComponent... I don't even know what that is. I put in a string. It is giving me errors. How can I fix this? How do I put a "BaseComponent" in?

ivory sleet
#

Yeah

#

BaseComponent… is a vararg parameter

fresh timber
#

yea

#

cus there is a header and a footer

ivory sleet
#

You know how to use those?

fresh timber
#

no

#

I do not

sand vector
ivory sleet
fresh timber
#

I know a little abt the,

ivory sleet
#

Read that

fresh timber
#

ok

ivory sleet
#

(You need to know about arrays sort of also)

fresh timber
#

oh, yeah, I got those

ivory sleet
#

@sand vector what repo is colourful tags from?

sand vector
#

now you say that ive probably got it set wrong, its supposed to be from the jitpack repo linked to my github

#

let me make sure ive set it up correctly. im pretty sure I haven't

golden turret
#

How do I get the player's body rotation?

ivory sleet
#

According to jitpack

robust sinew
eternal oxide
#

disable AI and set invulnerable and you should be able to move it anywhere

sterile token
golden turret
#

I want the BODY rotation

eternal oxide
#

Player#getLocation().getDirection()

robust sinew
fresh timber
ivory sleet
#

That was for you to understand what BaseComponent… means

fresh timber
#

Do I have to like convert my strings to a different object or smthin

ivory sleet
#

That too yes

#

?jd-bcc

ivory sleet
#

new TextComponent("string")^

golden turret
#

but I found it

#

in the nms LivingEntity

sterile token
robust sinew
#

the armor stand still can't go through blocks

#

is there a way to check if it's touching blocks?

eternal oxide
#

how are you trying to send it through blocks?

robust sinew
#

velocity

#

oh wait

robust sinew
#

it'll be a lot easier that way

eternal oxide
#

in that case using velocity you will need NMS

#

generally you teleport stands to simulate movement not using velocity

robust sinew
#

ah

sterile token
#

Phase?

#

Phase is the correct name

robust sinew
#

it'll just be easier if I check if the hitbox is in/is touching blocks

eternal oxide
#

its noclip, but it's not exposed in the API

sterile token
eternal oxide
#

avoid NMS if there is an alternative

sterile token
#

but teleporting doesnt make your resources going down?

robust sinew
sterile token
#

And you should use remapped jar

robust sinew
#

how do I do that?

eternal oxide
#

which is why you shoudl avoid NMS generally

#

due to obfuscation you need to build for every version of Spigot

sterile token
robust sinew
#

yeah but how do unobfuscate it

#

was what I meant

eternal oxide
#

one sec

sterile token
#

In most of the cases its not really simple

#

Because you have lot of broken things

#

And its not recommended

sterile token
#

In case of mojang code, u can have legal problems because their code is protected by law

robust sinew
#

so if we can go to the far easier way to do this, how do I check if the hitbox of the armorstand is touching a block

fresh timber
#

I have this code and I am trying to run something at the end. It gets to the first part, sending the player a message, but does not get to the very end. I literally cannot figure out why. Anyone know why?

drowsy helm
#

so which line exactly does it stop at

fresh timber
#

I know it does not get to the end

#

it doesnt get to the 2nd line to the end

#

cus tab is not changed

#

but it does do the outdated client text

#

I dont know if it stops at the ranks or what

#

ill check if it stops before tab thing

#

it does get to the part inbetween the pUUID variable and the if event.getplayer is beatthis101

#

it does get to part after whole if, else if, and else block of code thing, here

#

so it must stop at event.getPlayer().setDisplayName(tabname.get(pUUID));

#

there's ur answer

#

Line 47:
event.getPlayer().setDisplayName(tabname.get(pUUID));

@drowsy helm

drowsy helm
#

why not just put a println at each point it could stop rather than guessing

fluid river
#

true

fresh timber
#

never used println once in plugin development 🤔

fluid river
#

also why not optimize your code

drowsy helm
#

and yeah, that could be optimised way more

fresh timber
#

bro I started plugin development like a month ago

fluid river
#

to 1 line

#

it's basic java

fresh timber
#

so idk how to optimize

fluid river
#

which you need to handle

fresh timber
#

everything is

fluid river
#

no

drowsy helm
#

use a map

fresh timber
#

why

fluid river
#

tabName.put(pUUID, getPrefix(event.getPlayer) + event.getPlayer().getDisplayName());

moving this to separate method

#

in the method do

fresh timber
#

I am creating the prefix

drowsy helm
#

        Map<String, String> ranks = new HashMap<>();
        ranks.put("manager", "[Manager]");
        ranks.put("administrator", "[Admin]");
        //etc..

        for(String rankTag : ranks.keySet()){
            if(player.hasPermission("chat." + rankTag)){
                tabNameput(pUUID, ranks.get(rankTag));
                break;
            }
        }```
#

something like that

fluid river
#
public class ListenerClass implements Listener {

    private HashMap<String, String> ranks = Map.of("vip", "&cVIP", "smth", "&eSOMETHING &f");

    public ListenerClass(MainClass plugin) {
        plugin.getServer().getPluginManager().registerEvents(this, plugin);
    }

    @EventHandler
    public void onLogin(PostLoginEvent event) {
        // your other code
        tabName.put(pUUID, getPrefix(event.getPlayer) + event.getPlayer().getDisplayName());
    }

    private String getPrefix(Player player) {
        if (player.getName().equals("your") return "&cOWNER &f";
        for(String rankTag : ranks.keySet()){
            if (player.hasPermission("chat." + rankTag)) return ranks.get(rankTag);
        }
        return "NOPRIVILLEGE &f";
    }
}```
drowsy helm
#

but you should have a way more robust system

#

than just a map

fresh timber
#

are maps slow

hazy parrot
#

No lol

drowsy helm
#

not at all

#

and efficiency shouldnt be your worry rn

fresh timber
#

u literally were talking about it being slow

#

that is what I thought u were talkin abt

drowsy helm
#

it's very negligible in this situation

#

no it's just inefficient code

#

and takes up way too much space

fresh timber
#

I'm confused because your ways would take up the same space

drowsy helm
#

not really

#

make a immutable map

#

your code is jsut boilerplate thats what we're saying

fresh timber
#

have no idea what that means

#

but still why does it not get to the last part

drowsy helm
#

boilerplate just means it's repetitive

#

I'm not sure did you debug your code?

#

use a println and see where it stops printing

fresh timber
#

yeah because each new ranks has a different prefix

#

so I have to repeat it

fresh timber
hazy parrot
#

Or just use debugger, it's useful to learn

fluid river
#

that's how it should look like

#

so now you are able to set 999 prefixes and forget about if else else else else

fresh timber
#

would be different but I see what u mean

drowsy helm
#

how

fresh timber
#

the prefixes arent like that

fluid river
#

oh i forgor

#

need a legacy text colorizer

drowsy helm
#

it's an example

fresh timber
#

yea

#

so uh

fluid river
#
    return ChatColor.translateAlternateColorCodes('&', s);
}```
fresh timber
#

println is supposed to print the line where

fluid river
#

now you can use & in your code

fresh timber
#

I just use §

#

easier

fluid river
#

Alt + 0167

#

definitely easier

fresh timber
#

tf

fluid river
#

than just Shift + 7

fresh timber
#

I use CTRL + shift + a

fluid river
#

§

fresh timber
#

I have autohotkey program

fluid river
#

oh

#

tho for public plugins

#

you would better have a colorizer

fresh timber
#

yea

fluid river
#

cuz everybody use &

drowsy helm
fresh timber
#

I use this plugin for my server tho

drowsy helm
#

there are many reasons not to use §

fresh timber
#

hm

#

like

fluid river
#

tho the only difference between mine and your prefixes are []

#

around the words

fresh timber
#

yea and bold and right colors

fluid river
#

why don't you just use Vault/Luckperms api

#

and get prefix of player's group

fresh timber
#

cus I dont know how to do that

#

so I just did what I do know

fluid river
#

basically add vault as dependency

fresh timber
#

dont know how

#

to use dependencies

fluid river
#

maven

#

copy paste

#

dependency and repo

fresh timber
#

oh yea

fluid river
#

and install vault and permissions plugin to your server

fresh timber
#

yea

fluid river
#

LuckPerms or smth

fresh timber
#

I use lp but not vault

drowsy helm
#

lp doesnt work well with vault

fluid river
#

didn't know that

fresh timber
#

ok well that works for me

#

cus I dont use

#

vault

fluid river
#

worked fine for me

fresh timber
#

yea

fluid river
#

well switch to Pex if still exists

fresh timber
#

a lot of plugins require vault

fluid river
#

ye

fresh timber
#

nah

#

I like lp

#

I've always used it

fluid river
#

what happened to PeX

fresh timber
#

not gonna change and learn another thing

#

pex died lol

fluid river
#

cool

fresh timber
#

tbh i dont rly know how many ppl still use it but idc

fluid river
#

luckperms have a wiki page where you can see how to get player's prefix in like 2 lines of code

fresh timber
#

fancy

fluid river
#
#
String prefix = user.getCachedData().getMetaData().getPrefix();```
#
User user = luckPerms.getUserManager().getUser(uuid);```
fresh timber
#

ok uh so I did the System.out.println("text");... where is the printed lines supposed to go

fluid river
#

all you basically need

fresh timber
#

cus I cant find it

fluid river
#

in console

fluid river
#

tho you can do Bukkit.broadcastMessage()

fresh timber
#

it didnt show up

fluid river
#

so it's printed to all players and console

#

as long as you are solo

#

it will only be sent to you

fluid river
fresh timber
#

this is a bungeecord plugin

fluid river
#

🙂

#

oh

dry forum
#

Caused by: java.lang.ClassNotFoundException: jerefla.com.smgui.GUI why am i getting an error saying theres no class? <dependency> <groupId>jerefla.com</groupId> <artifactId>sGUI</artifactId> <version>1.0-SNAPSHOT</version> <scope>system</scope> <systemPath>${project.basedir}/src/main/resources/sGUI-1.0-SNAPSHOT.jar</systemPath> </dependency> the plugin jar is in my resources folder

fresh timber
#

oh u were right I did need to look better

fluid river
#

maven-shade-plugin google

fresh timber
#

so uh

fluid river
#

i thought it's spigot

fresh timber
#

it gets past event.getPlayer.setDisplayName(tabname.get(UUID)); but after that it is stuck

drowsy helm
#

and no error?

fresh timber
#

so it stops on event.getPlayer().setTabHeader(new TextComponent("\n§3§lWild§b§lGames §9Network\n§fYou are currently connected to §e§l" + event.getPlayer().getServer().getInfo().getName() + "\n"), new TextComponent("\n§fDiscord: §9/discord\n§fStore: §a/store\n§fPlayers: §b" + ProxyServer.getInstance().getPlayers().size() + "§7/§b1000\n\n§7playwildgames.net"));

dry forum
fresh timber
#

nah no error

drowsy helm
#

because it wouldn't stop for no reason

fresh timber
#

hmm wait

#

ah there is one

fluid river
#

null server

#

cool

drowsy helm
#

so you never looked for an error?

fresh timber
#

well I get a ton of errors from tebex

#

so its hard to find the right ones

#

so I thought it was from tebex

fluid river
#

umm remove tebex

#

then

fresh timber
#

it gives me loads of errors

#

but works fine

#

;-;

fluid river
#

are you using Postlogin?

fresh timber
#

yes

#

cus I can use methods in that

#

otherwise there is no bukkit methods

#

or whatever they are called

fluid river
#

i mean

#

in PreLogin you can't get the server as far as i remember

#

would be null

fresh timber
#

its not prelogin

#

maybe smthin is wrong with setTabHeader

fluid river
#

errors basically says

fresh timber
#

ah