#help-development

1 messages ยท Page 263 of 1

twin venture
#

am i doing it wrong?

echo basalt
#

OH GOD

orchid gazelle
#

uhm lol

twin venture
echo basalt
#

negate the offest and add some more

#

needs more pitch too

tardy delta
#

i love implementing Iterable<E> to not have to expose collections

orchid gazelle
#

so I just play around with Yaw/Pitch until I like how it looks? lol

echo basalt
#

play with yaw/pitch and the XYZ values on the offset vector

orchid gazelle
#

aight

twin venture
#

any help xd?

orchid gazelle
#

thank you already anyways^^

tardy delta
twin venture
tardy delta
#

ig

twin venture
#

yeb that did the trick !

orchid gazelle
fair zealot
#

when i run this:

        System.out.println(getServer().getServicesManager().getKnownServices());
        System.out.println(getServer().getServicesManager().getRegistration(net.milkbowl.vault.chat.Chat.class));
        System.out.println(getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class));

It puts out this:

[15:04:25] [Server thread/INFO]: [class net.milkbowl.vault.metrics.bukkit.Metrics, class net.milkbowl.vault.chat.Chat, interface net.milkbowl.vault.economy.Economy, class ru.tehkode.permissions.PermissionManager, class net.milkbowl.vault.permission.Permission]
[15:04:25] [Server thread/INFO]: null
[15:04:25] [Server thread/INFO]: null
rotund ravine
#

yeah the suppliers haven't run yet.

smoky tinsel
#

how can i checking if player is holding down right click or what ever

#

right clicking item

#

i mean

#

hold down

#

keep hold down some item

#

bruh

#

and do u know how can i use NMS?

smoky tinsel
#

?buildtools

undone axleBOT
fair zealot
#

i ran out of ideas

orchid gazelle
#

ok so I now got: ```java
float yawOffset = 3.18f;
float pitchOffset = 7.18f;

    for(Player player : Bukkit.getOnlinePlayers()) {
        double yawRightHandDirection = Math.toRadians(-1 * player.getEyeLocation().getYaw() - 45);
        double x = 0.7 * Math.sin(yawRightHandDirection) + player.getLocation().getX();
        double y = player.getLocation().getY() + 1;
        double z = 0.7 * Math.cos(yawRightHandDirection) + player.getLocation().getZ();
        Location handLocPure = new Location(player.getWorld(), x, y, z);
        Location handLocation = handLocPure.clone();
        handLocation.setYaw(handLocation.getYaw() - yawOffset);
        handLocation.setPitch(handLocation.getPitch() - pitchOffset);
#

Well ok now I got it so it cares about my direction, but yeah I cannot explain this well but look at the screenshot:

tardy delta
#

that looks weird

orchid gazelle
#

yeah lol

#

new Code btw.:

            
            float yawOffset = 4.82f;
            float pitchOffset = 7.48f;
            double yawRightHandDirection = Math.toRadians(-1 * player.getEyeLocation().getYaw() - 45);
            double x = 0.6 * Math.sin(yawRightHandDirection) + player.getLocation().getX();
            double y = player.getLocation().getY() + 1;
            double z = 0.6 * Math.cos(yawRightHandDirection) + player.getLocation().getZ();
            Location handLocPure = new Location(player.getWorld(), x, y, z);
            Location handLocation = handLocPure.clone();
            handLocation.setYaw(player.getEyeLocation().getYaw() - yawOffset); //handLocation.getYaw()
            //handLocation.setYaw((float)yawRightHandDirection);
            handLocation.setPitch(player.getEyeLocation().getPitch() - pitchOffset);
tardy delta
#

please

orchid gazelle
#

it is

smoky tinsel
#
@EventHandler
    public void sonicboom(PlayerInteractEvent e)
    {
        Player p = e.getPlayer();
        Action a = e.getAction();
        Material iteminhand = p.getItemInHand().getType();
        int charging = 0;
        int cooltime = p.getCooldown(Material.ECHO_SHARD);
        if(iteminhand == Material.ECHO_SHARD)
        {
            if(cooltime == 0)
            {
                if(a == Action.RIGHT_CLICK_AIR)
                {
                    charging = charging + 1 ;
                    p.sendMessage(charging + "");
                }
            }
        }
    }
#

um

#

i test this

#

and charging is still 1

tardy delta
#

because its a local variable

#

it can only be 0 or 1

#

i'd work with pdc

#

?pdc

smoky tinsel
#

what should i have to do?

#

if i want to add 1 to charging every time

orchid gazelle
#

im literally gonna throw a brick against some windows right now, Iยดve been messing around with this for 3 days now

tardy delta
#

best thing to me is to use pdc, just store that int there and check it in that event and increase it

#

might wanna use some kind of map too but thats essentially the same thing

orchid gazelle
#

seems like the issue is that my yaw just continues kicking in, not at the crosshair

smoky tinsel
#
 int charging = 0;

    @EventHandler
    public void sonicboom(PlayerInteractEvent e)
    {
        Player p = e.getPlayer();
        Action a = e.getAction();
        Material iteminhand = p.getItemInHand().getType();
        int cooltime = p.getCooldown(Material.ECHO_SHARD);
        if(iteminhand == Material.ECHO_SHARD)
        {
            if(cooltime == 0)
            {
                if(a == Action.RIGHT_CLICK_AIR)
                {

                    charging = charging + 1 ;
                    p.sendMessage(charging + "");
                }
            }
        }
    }
#

ok i did this

#

i make variable to not local

#

ty โค๏ธ

tardy delta
#

uh whenever another player joins and triggers that event it will change too

smoky tinsel
#

uh

tardy delta
#

make it bound to a certain player

smoky tinsel
#

thats

#

right

orchid gazelle
#

make a HashMap

smoky tinsel
#

HashMap

#

ok ill try

#

ty ty

orchid gazelle
#

with UUID and int

rotund ravine
# smoky tinsel ```java int charging = 0; @EventHandler public void sonicboom(PlayerIn...

To make this plugin per player, you can add a charging variable for each player. One way to do this is to create a HashMap that maps players to their charging value. Here's an example of how you can modify the code to achieve this:

import java.util.HashMap;
import java.util.UUID;

// ...

// Declare a HashMap to store the charging value for each player
private final Map<UUID, Integer> charging = new HashMap<>();

@EventHandler
public void sonicboom(PlayerInteractEvent e) {
    Player p = e.getPlayer();
    Action a = e.getAction();
    Material iteminhand = p.getItemInHand().getType();
    int cooltime = p.getCooldown(Material.ECHO_SHARD);
    if (iteminhand == Material.ECHO_SHARD) {
        if (cooltime == 0) {
            if (a == Action.RIGHT_CLICK_AIR) {
                // Get the player's UUID
                UUID playerId = p.getUniqueId();
                // Get the player's charging value from the HashMap
                int playerCharging = charging.getOrDefault(playerId, 0);
                // Increment the player's charging value
                playerCharging++;
                // Update the player's charging value in the HashMap
                charging.put(playerId, playerCharging);
                p.sendMessage(playerCharging + "");
            }
        }
    }
}

A UUID is a unique identifier that is assigned to each player when they join the server for the first time. It is a string representation of a 128-bit number, and it is guaranteed to be unique across all players, servers, and devices. Using UUID instead of Player in the HashMap has several benefits:
It allows you to store the charging value for a player even if they are not online. This can be useful if you want to keep track of the charging value for a player who has logged off, or if you want to store the charging value in a database or file.
It allows you to store the charging value for multiple players in the same HashMap, without worrying about conflicting names or duplicates.

I hope this helps! Let me know if you have any questions.

orchid gazelle
#

Jan GigaChad

tardy delta
#

you might consider Map#merge

#

syntax is charging.merge(p.getUniqueId(), 1, Integer::sum) or smth

rotund ravine
tardy delta
#

replaces 4 lines

#

but ye their choice

echo granite
#

Yes

rotund ravine
tardy delta
#

it returns the value

orchid gazelle
#

ok sadge now I ran out of ideas

tardy delta
#

the bible

echo granite
#

I understand it's difficult to understand, but I don't see anything wrong in it

echo granite
quiet ice
# echo granite Yes

Then just copy the contents of the repo, revert back to two commits before and commit back everything

quiet ice
#

But for javadoc standards it is quite short

orchid gazelle
tardy delta
#

the impl of HashMap#merge is even worse

echo granite
# quiet ice It's quite long

I don't think the difficulty comes from it being long, but from all the generics and the fact that it's really hard to read and visualize in your head

rotund ravine
quiet ice
#

Yeah #merge is a beefy function

tardy delta
#

if you want something even worse, check Math.pow impl

quiet ice
#

Isnt's it just calling StrictMath#pow?

echo granite
#

My brain hurts

orchid gazelle
tardy delta
#

its calling FcLibm.Pow.compute lol

#

lemme paste it

echo granite
#

wtf

tardy delta
#

have fun debugging that

#

i should measure how long such a call takes

rotund ravine
# tardy delta it returns the value

Ah okay:

@EventHandler
public void sonicboom(PlayerInteractEvent e) {
    Player p = e.getPlayer();
    Action a = e.getAction();
    Material iteminhand = p.getItemInHand().getType();
    int cooltime = p.getCooldown(Material.ECHO_SHARD);
    if (iteminhand == Material.ECHO_SHARD) {
        if (cooltime == 0) {
            if (a == Action.RIGHT_CLICK_AIR) {
                // Get the player's UUID
                UUID playerId = p.getUniqueId();
                // Update the player's charging value in the HashMap using the merge method
                // Assign the return value of the merge method to a variable
                int playerCharging = charging.merge(playerId, 1, Integer::sum);
                p.sendMessage(playerCharging + "");
            }
        }
    }
}

This code will increment the value for the key playerId by 1 each time the player right-clicks in the air while holding an ECHO_SHARD. If the key does not exist in the map, it will be added with a value of 1. If the key already exists in the map, its value will be updated by adding 1 to it. The updated player's charging value will then be retrieved using the return value of the merge method and sent as a message to the player.

echo granite
#

Makes a lot of sense to me

quiet ice
#

Do note that Math#pow takes in doubles and thus it gets complicated

glossy venture
quiet ice
#

And you need to do it relatively efficently

tardy delta
#

isnt there a Math.pow(int, int)?

quiet ice
#

no

orchid gazelle
tardy delta
#

or double int atleast

quiet ice
#

no

glossy venture
#

or

Math.ipow(double, int)
``` at least
tardy delta
#

get ninjad

echo granite
quiet ice
#

only Math.pow(DD)D

orchid gazelle
#

omg ICANT anymore

tardy delta
#

gl debugging my parsing algorithm too

quiet ice
#

The implementation has most likely not changed in decades

orchid gazelle
#

this damn yaw/pitch vector garbage

#

I need to be maths professor at harvard

tardy delta
quiet ice
#

This is a write-once, forget forever type of deal

#

There is no need for debugging

#

Especially given that this is the implementation that will never run

orchid gazelle
#

im malding

quiet ice
#

Math.pow is an intrinsic candidate, that is it's using an assembly or c-level implementation

orchid gazelle
#

I just noticed all my code is garbage rn

#

for the handLocation

tardy delta
quiet ice
#

it will never run lol

orchid gazelle
#

wow congrats I got the yaw/pitch for a specific coordinate, now nothing works

tardy delta
#

ahh \๐Ÿ˜ณ

quiet ice
#

Unless you are using a nonstandard JVM (OpenJ9 for example)

shell trench
#

I'm using the config api to interact with the config file.
But when there is an error in the config it clears itself.
Can I disable this?

orchid gazelle
#

ok, another Update: The target is right if I aim into the air, since then it can directly access the endpoint without hitting a block. If it hits a block, the direction is just like it would be without hitting the block

sterile breach
#

hi questions, to learn spigot, plugin devloppement do you need a good foundation in java?

orchid gazelle
#

yes

smoky tinsel
#

how can i detect clicking

orchid gazelle
smoky tinsel
#

i mean hold down

orchid gazelle
#

nah man now im getting a mental breakdown

harsh totem
#

How do I get a random color?

orchid gazelle
#

somebody get me out

#

oh nvm he means chatcolor

#

yeah thats what the stackoverflow said

quiet ice
orchid gazelle
#

lol

sterile breach
quiet ice
#

Way faster than whatever stupid stuff you have in store

orchid gazelle
tardy delta
#

whers the Double.valueOf uwu

sterile breach
quiet ice
#

Okay fine

sterile breach
#

with gui and options etc...

quiet ice
#

It's new Color(System.identityhashcode(new Object())); that is better

orchid gazelle
#

eh you need a kind of decent amount of knowledge

sterile breach
quiet ice
#

looks at the RegionatedIntIntToObjectMap used in presence

#

The answer is yes, you might need a bit of experience

orchid gazelle
#

and I would suggest making easy(easier) plugins than instantly going for an advanced system

tardy delta
#

hmm

orchid gazelle
#

uhm can somebody explain me what exactly the method Location#getDirection() does?

quiet ice
#

?stash

undone axleBOT
sterile breach
#

learn the basics i need how many hours will it take me?

quiet ice
#

Depends on how good of a learner you are

#

Absolute basics are like 30 - 50 hours if you know how to program at a mid-tier beginner level

quiet ice
orchid gazelle
#

so now I think something is wrong with my ```java
Location l = bulletStart;
Vector vector = bulletStart.getDirection().clone();
double length = 0;
while(length < distance) {
l.add(vector);
projectionLocations.add(l.clone());
length += 1.05;
}

#

After this, I never want to see any vector again in my life.

quiet ice
#

Oh you will

eternal night
#

uni will be pain for you KEKW

orchid gazelle
#

this stupid garbage destroying me for 3 days now

eternal night
#

depends on the vector KEKW

orchid gazelle
#

yeah if its so easy then tell me what im doing wrong

#

yes?

eternal night
#

What is not working with that ?

#

getDirection should be normalised

#

idk why you are adding 1.05

quiet ice
#

myeah, that is a very odd number

eternal night
#

the euclidian norm of that vector should be 1

orchid gazelle
#

ok so, if im looking into the air, it works fine, the target is at my crosshair. If a block intersects it(THen the target Position is changed to that), it just has the wrong vector

eternal night
#

what do you mean, wrong vector ๐Ÿ˜…

orchid gazelle
#

see:

river oracle
#

I don't see

tardy delta
#

maths \๐Ÿ’€

orchid gazelle
tardy delta
#

thats a nice gun you got there

orchid gazelle
#

yeah ty

eternal night
#

is your target position the block location

#

like block.getLocation()

#

(it is)

#

is that location floored

orchid gazelle
#
        RayTraceResult RTres = bulletStart.getWorld().rayTraceBlocks(bulletStart, direction, 1000);
        if(RTres == null || RTres.getHitBlock() == null && RTres.getHitEntity() == null) {
            distance = 1000;
        } else {
            distance = RTres.getHitPosition().distance(bulletStart.toVector());
        }
``` this is the part where it calculates the distance, which is the target
eternal night
#

(it is, yes that is what block.getLocation() does)

quiet ice
#

Yeah, how does it work from other angles?

orchid gazelle
#

in the wrong situation, the target is basicly RTres.getHitPosition()

eternal night
#

please show me how the target is computed

orchid gazelle
eternal night
#

also great naming convention

#

RTres

orchid gazelle
#

oh wait the posting of my code errored

#

let me show you

#

??paste

eternal night
#

?paste

undone axleBOT
quiet ice
orchid gazelle
quiet ice
#

gaps for air

river oracle
#

Magic numbers??

orchid gazelle
#

magic?

quiet ice
#

(Their value being unexplainable by pure logic)

orchid gazelle
#

which ones?

#

the 0.6 is just to make it look better

#

the 1000 is the max range

#

1.05 is for the visuals of the particles

quiet ice
#

I still do not understand the 1.05

orchid gazelle
#

those are basicly the steps

river oracle
#

Use constants in the future ๐Ÿ‘๐Ÿฝ

eternal night
#

yea but the "length" of that vector is 1

#

and your step always adds the vector

quiet ice
#

Also, as it still stands you still fail to account that the crosshair is for the EYES, not the hand

eternal night
#

beyond that, I am confused as to how that is the wrong vector

#

yea

quiet ice
#

So naturally the crosshair will always be X blocks off

orchid gazelle
#

yes but the target should be exactly on the crosshair

eternal night
#

no

#

not with that code at least

quiet ice
#

Not with your code

orchid gazelle
#

thats my intent

eternal night
#

your start your walk from the hand pos

#

and just walk x units into the direction the player is looking

#

how would the not in face location of the hand gun

#

ever meet the cross hair

orchid gazelle
#

what?

eternal night
#

if you shoot a line

orchid gazelle
#

yes

eternal night
#

with the same vector

#

one time from the camera location that is the player head

#

and one time from the location that is the hand

orchid gazelle
#

yes

eternal night
#

how would those lines magically intercept

orchid gazelle
#

they don't

eternal night
#

indeed

orchid gazelle
#

but how do they do

#

give me magic

quiet ice
#

They do not.

orchid gazelle
#

well but I want them to lol

#

so how can I

quiet ice
#

Unless you make them not parallel

orchid gazelle
#

why would I care about them not being parallel?

quiet ice
#

i.e. trace with eye, then find the vector between hand and target, and use that

eternal night
#

because parallel lines don't intersect

quiet ice
orchid gazelle
#

yes

#

thats obvious

eternal night
#

why would I care about them not being parallel?

orchid gazelle
#

well

orchid gazelle
#

indirectly

quiet ice
#

You trace with your hand right now

orchid gazelle
#

no

quiet ice
#

using the eyes direction, but hand nonetheless

orchid gazelle
#

I do

#

RayTraceResult RTres = bulletStart.getWorld().rayTraceBlocks(bulletStart, direction, 1000);

quiet ice
#

Bullet start being hand?

orchid gazelle
#

bullet start is hand, direction is eyedirection

#

and I trace with eyedirection

quiet ice
#

With trace with X I mean source pos

orchid gazelle
#

uhm

eternal night
#

your trace there does nothing to the starting location

quiet ice
#

The direction as we both see is correct

eternal night
#

only to the distance

eternal night
#

this hurts to explain

quiet ice
#

Time to fire up paint! (Or well, inkscape because I have nothing else at my disposal)

eternal night
#

how does any distance value mean the lines would ever intersect

orchid gazelle
#

which lines??

#

there is only 1 line

eternal night
#

there is two

#

one is the line of sight

#

from the camera of the player to their crosshair and beyond

orchid gazelle
#

ah ok

eternal night
#

e.g. what the player thinks to be their current crosshair target

#

the other from the gun to wherever

orchid gazelle
#

yes ok

#

and like....

#

what next

eternal night
orchid gazelle
#

imma watch that

quiet ice
tardy delta
#

some indian dude explaining math

orchid gazelle
#

well I understand how its working, but like... code.... like... idk man

#

I know I have the direction

quiet ice
orchid gazelle
#

of the startlocation

#

in a vector

#

and then stepwise add this vector to the startloc

quiet ice
#

Difference = EndLocation - StartLocation
DifferencePerStep = Difference / stepCount

#

However for uniform distribution of points along the line you'd want to normalize the difference to a unit vector (length of 1)

orchid gazelle
#

weah well then I have the difference

#

...which I never use in my code

#

you are basicly saying I should screw ```java
Vector vector = bulletStart.getDirection().clone();
double length = 0;
while(length < distance) {
l.add(vector);
projectionLocations.add(l.clone());
length += 1.05;
}

#

and work with like a for loop iterating

eternal night
#

I mean the issue is the following.
Either you already know what the bullet hits, then geol has the answer for you.
Or your don't at which point you are fucked

orchid gazelle
#

I always know what the bullet hits, since I am raytracing it

eternal night
#

yea then go with the award winning and absolutely breathtaking art geol produced

#

the while loop is fine

#

you just need a different direction

orchid gazelle
#

...a different direction?

#

you mean a different Vector vector

eternal night
#

yea

#

which would be the direction of the line you are sampling points from

#

descriptive variable names and all that

orchid gazelle
#

well isn't it already the line kind of

quiet ice
#

no

orchid gazelle
#

the vector is the vector of the line, while the while() loop reapplies the vector to the location

quiet ice
#

Your trace eye -> target but shoot hand -> target

quiet ice
#

You do NOT trace hand -> target as otherwise it will always be X blocks away from the crosshair

quiet ice
# quiet ice

As you see here, the shooting direction and tracing direction can be very very different

orchid gazelle
#

yes

orchid gazelle
#

so I also need to trace them with the method

quiet ice
#

Exactly, ONLY pasrticles

#

NOT tracing

orchid gazelle
#

tracing what?

quiet ice
#

If you want to trace hand to target once more I'll go to your house to slap your in the face again

orchid gazelle
#

particles are spawned by tracing the bullet

quiet ice
#

s<mjsy,.mjklrรถkopkjoรถjkxm

orchid gazelle
#

saftaetzw367f6stzfguz43

eternal night
#

pain

orchid gazelle
#
  1. I trace what the eye is targetting
#
  1. I get the target location from that
rancid willow
#

Hey guys!

Could somebody help me out ๐Ÿ˜„
Some friends of mine just wanna play a chill SMP with some plugins.

Now there is one plugin that has open source but not the jar file for the plugin.
Can anyone help me make the jar file for the plugin from the source? I have 0 experience in doing so or coding :/

orchid gazelle
#
  1. I get the distance between target location and hand
eternal night
#

can you link the plugin ?

#

no

quiet ice
#

Maven: mvn package
Gradle: ./gradlew build
Eclipse JDT: Gl bro
IJ whatever: Same

#

that is maven, so mvn package

orchid gazelle
#
  1. While Loop: I apply a vector, add the location to spawn it, apply it again, add the next, ...
#

done

eternal night
#

a vector

#

bruh

quiet ice
#

After installing maven that is

orchid gazelle
eternal night
#

that vector has been the entire point of this

#

and you are using the wrong one

quiet ice
#

Shouldn't be too hard, somehow my Windows I from a few years ago figured out that too

orchid gazelle
#

the vector is the direction of hand -> target

eternal night
#

it isn't

orchid gazelle
#

:(

eternal night
#

it should be

humble tulip
#

Anyone has a method to check if a vector intersects with an AABB given the origin of the vector

eternal night
#

but your code doesn't do it

floral drum
#

meow

orchid gazelle
#

ok so you want to say that I am using a garbage vector

eternal night
#

indeed

orchid gazelle
#

not the right vector

floral drum
#

hi lynx

eternal night
#

hi ign!

orchid gazelle
#

and the right vector is Hand -> Target/steps?

humble tulip
eternal night
#

your current vector is just the vector that is the player direction

#

the right one would be yea, hand to target

orchid gazelle
#

ok so I change it to Hand->Target/steps?

humble tulip
eternal night
orchid gazelle
#

so I subtract the Vector of the of the bulletStart from the Vector of the target

quiet ice
orchid gazelle
#

and divide it by distance/length

quiet ice
#

nah, in that case you normalize it to have unit vectors

orchid gazelle
#

huh???

#

so:

#

(Target->Hand).normalize()/steps

humble tulip
#

(Target-bulletorigin).normalize

#

Normalize makes length 1

orchid gazelle
#

yes

quiet ice
#

uh

orchid gazelle
#

no /steps?

quiet ice
#

target.substract(origin).normalize().multiply(1/stepsPerUnit)

humble tulip
quiet ice
#

or larger

humble tulip
#

Well yes

#

But there's another way as well

quiet ice
#

If you want a certain strictly defiend and absolute number of steps, normalize is superflous

humble tulip
#

If you wannahave steps for the entire bullet, you can not nirmalize and just divide by steps

orchid gazelle
#

Vector vector = RTres.getHitPosition().subtract(bulletStart.toVector()).normalize().multiply(1/(distance/1.05));

quiet ice
#

no distance

humble tulip
#

1/distance/1.05?

quiet ice
#

Distance falls out thanks to normalization

orchid gazelle
#

Vector vector = RTres.getHitPosition().subtract(bulletStart.toVector()).normalize().multiply(1/1.05);

quiet ice
#

normalize basically already does that

humble tulip
#

Normalizing a vector is dividing by distance

quiet ice
#

Yeah

quiet ice
orchid gazelle
#
        while(length < distance) {
            l.add(vector);
            projectionLocations.add(l.clone());
            length += 1.05;
        }
quiet ice
#

Vectors have no distance

orchid gazelle
#

the steps are 1.05

humble tulip
orchid gazelle
#

so I multiply by 1/1.05?

humble tulip
#

Length

quiet ice
#

Ah if you want to have steps of 1.05 it'd need be .multiply(1.05)

humble tulip
#

Bro being like my physics teacher when i mkx velocity and speed

orchid gazelle
#

imma try

quiet ice
#

Yeah

orchid gazelle
#

nice, exactly the same issue

#

and when I aim into the air it does nothing

eternal night
#

who was asking for the vector in AABB ?

orchid gazelle
#

lol

humble tulip
eternal night
#

I think Sam Symons might have something on it

humble tulip
#

Who tf is sam symons

eternal night
#

some dude

orchid gazelle
#

ok I know why when I aim into the air it does nothing

eternal night
#

ah only ray plane intersection

#

๐Ÿ˜ญ

#

idk if a plane is enough for you

#

I presume it isn't

orchid gazelle
#

but 1. its still the same issue and 2. which vector to use when I shoot into the air?

quiet ice
#

when I shoot into the air you use your eye direction vector and miss X blocks but in the grand scheme of things X is nothing compared to infinity

eternal night
#

I think the spigot API actually implements a AABB check for a ray btw

#

@humble tulip BoundingBox#rayTrace

humble tulip
orchid gazelle
#

why use eye direction

humble tulip
#

Gonna copy it

eternal night
#

include licence then

humble tulip
#

Cuz i have to use 1.8 for my. Client

quiet ice
#

You will be off by X blocks, but we can't do anything about it

orchid gazelle
#

but then I do not have the thingy with my hand

quiet ice
#

Well your source is still the hand

orchid gazelle
#

yes

#

but my target is completely wrong

humble tulip
quiet ice
#

But it is soooooooooooooo far away that you might as well not bother

orchid gazelle
#

so I just trace for a long distance?

#

and then nobody will notice

quiet ice
#

Basically

orchid gazelle
#

ok wait

quiet ice
#

You'll use the same code you had previously

orchid gazelle
#

Vector vector = bulletStart.getDirection();?

#

ok now the one issue remains

#

it still did not change anything about the vector looking wrong lol

quiet ice
#

What is your current code now

orchid gazelle
#

?paste

undone axleBOT
orchid gazelle
quiet ice
#

?jd-s

undone axleBOT
eternal night
#

run a formatter once

#

my god

orchid gazelle
#

lol

quiet ice
#

no idea what is wrong there

orchid gazelle
#

hm

#

its literally the same issue just like its been before

quiet ice
#

OKay no i am a fool

#

And I'm not going to say what the issue is because I've already said it a few hundred times

orchid gazelle
#

uhm`?

#

the vector is wrong?

quiet ice
#

TRACE WITH YOUR DAMN EYES

#

Since when do you look with your hand??????

eternal night
#

imma start tracing with my eyes

orchid gazelle
#

uhm so

#

imma subtract the EyeLocation.toVector?

eternal night
quiet ice
#

:doom:

orchid gazelle
#

whats wrong?

#

vector = RTres.getHitPosition().subtract(eyeLocation.toVector()).normalize().multiply(1.05);

eternal night
#

my thirteenth reason why

orchid gazelle
#

this is the eye

quiet ice
#

RayTraceResult RTres = bulletStart.getWorld().rayTraceBlocks(bulletStart, direction, 1000); this thing is wrong - that's wrong

eternal night
#

rayTraceBlocks(FROMTHEFUCKINGEYES, direction 1000)

#

actually

orchid gazelle
#

you know I get the direction from the EyeLocation right?

eternal night
#

omg

orchid gazelle
#

oh

#

thats what u mean

#

huh

eternal night
#

imma jump

orchid gazelle
#

I see I see

#

lets try

#

wait I cannot believe

#

IT WORKS?

eternal night
#

someone should ban you ๐Ÿ˜‚

orchid gazelle
#

thats insane

#

something works!

#

thank you so much^^

eternal night
#

geol and I are probably ready for like, 2 weeks of mental care by now

orchid gazelle
#

ok now I gotta write like z764532z762675627 lines of code for the rest of the logics

orchid gazelle
#

christmas is soon

quiet ice
#

Sadly that mavenresolver doesn't write itself

orchid gazelle
#

lol

#

uhm well it works, but also it doesn't

#

it does not care if it hits an entity

orchid gazelle
#

yes

floral drum
#

damn

orchid gazelle
#

z is 01111010

floral drum
#

nerd

orchid gazelle
#

HAHA

#

gotcha

topaz cape
#

im pretty sure I'd rather kill myself than try one more time on ProtocolLib

#

ProtocolLib + maven wasn't the move

floral drum
#

protocollib is fine

topaz cape
#

i don't mind ProtocolLib itself

#

it's about a bug i had earlier

#

.

tardy delta
#

fuck anyone who wants to debug the solving of ```6.57.8^2.3 + (3.5^3+7/2)^3 -(54/(2-3))4 + 6.57.8^2.3 + (3.5^3+7/2)^3 -(5*4/(2-3))*4

  • 6.57.8^2.3 + (3.5^3+7/2)^3 -(54/(2-3))4 + 6.57.8^2.3 + (3.5^3+7/2)^3 -(5*4/(2-3))*4```
#

google, chatgpt and my parser are giving three different results lol

topaz cape
#

oh you started coding in brainfuck?

#

oh

#

well it's possible to calculate

tardy delta
#

my both algorithms are atleast the same thing

#

debugging is smth else

orchid gazelle
#

do it in your head

tardy delta
#

got two sites which say its

#

need a few pieces of paper for that lol

quiet ice
#

Wolfram-alpha says 99735.958984375 or (3.5^3 + 7/2)^3

tardy delta
#

already wrote 11 pages

quiet ice
#

Yeah, probably bugged a bit - it doesn't make too much sense

tardy delta
#

now having to figure out where it goes wrong \๐Ÿฅบ

quiet ice
#

Interesting, WA gives a different result in natural language than in the "math input" mode

floral drum
#

what ze fuck

tardy delta
#

oh ye didnt even see

#

now look for any /2 or smth

floral drum
tardy delta
#

there are too many lol

floral drum
#

lolll

orchid gazelle
#

uhm so here I am raytracing blocks, is there a simple way to raytrace both blocks and entities at the same time?

#

Or do I need to use the .rayTrace() method directly?

tardy delta
#

hmm yes

floral drum
#

doggo

hasty prawn
#

Oh gosh Fourteen you're still doing that? LOL

tardy delta
#

stopped doing it for a while

hasty prawn
#

Ahh

tardy delta
#

it works already a lot better

hasty prawn
#

Want me to check what mine says for that?

orchid gazelle
#

ok so

tardy delta
#

sure

orchid gazelle
#

what do I use as a raySize

tardy delta
#

google saying 200k and a bit

hasty prawn
#

Mine says 201096.6593070298

orchid gazelle
#

?spigot-sd

tardy delta
#

good

orchid gazelle
#

?spigot-jd

#

oh cmon

tardy delta
#

well suddenly it started to work again lol

hazy parrot
#

?jd-s

undone axleBOT
orchid gazelle
#

ty lol

tardy delta
hasty prawn
#

inchresting that Google's is double mine

tardy delta
#

same

#

wolframalpha giving double

hasty prawn
#

Well if Wolfram and Google are saying it's 400k something then it probably is and we're dumb

tardy delta
#

i have two algorithms and looks like we are both wrong

#

both algorithms seem to be wrong too

hasty prawn
#

Oh wait

#

Mine is saying 402193 now

#

The newline was messing it up

fresh timber
#

sorry, its been a while, but im already using negative mining fatigue for this and I dont use like this id thing i just use player.sendBlockDamage im super confused and I see u said to use the block location's hashcode but idk how to do that either like what would I do with this id or hashnode

tardy delta
#

ij got issues with my lines too

#

whenever i paste the expression i dont have to press enter but it immediately executes

#

too long expression ig

hasty prawn
#

Yeah just remove the newline and it worked for me

orchid gazelle
#

ok. Why does:
RayTraceResult RTres = bulletStart.getWorld().rayTraceBlocks(eyeLocation, direction, 1000); work but
RayTraceResult RTres = bulletStart.getWorld().rayTrace(eyeLocation, direction, 1000, FluidCollisionMode.NEVER, false, 0.25, null);doesn't?

tardy delta
#

seems to work without the newline too

#

i only seem to have a bunch of precision loss

hasty prawn
#

Why is that the expected?

tardy delta
#

copied that expression from some other lib and maybe it doesnt post the result for a reason smh

#

oh uh i have a file full of expressions and the expected result underneath

hasty prawn
#

What does the 2nd one do that it's supposed to do

orchid gazelle
eternal oxide
#

what is "garbage"?

hasty prawn
orchid gazelle
#
        if(RTres == null || RTres.getHitBlock() == null && RTres.getHitEntity() == null) {
            vector = bulletStart.getDirection().clone();
            distance = 1000;
        } else {
            vector = RTres.getHitPosition().subtract(bulletStart.toVector()).normalize().multiply(1.05);
            distance = RTres.getHitPosition().distance(bulletStart.toVector());
        }
```the first RT is giving me correct results, the second one is just always setting the distance to around 0.5
tardy delta
#

precision loss of 1 lol

fresh timber
#

I am trying to make a custom block breaking system and in it I am using player.sendBlockDamage() again every time they damage the block but it is very flickery and hard to see... does anyone know how I can fix this?
here is a video showing it

eternal oxide
orchid gazelle
tardy delta
#

anyways how can i build a maven project after i cloned it from git?

eternal oxide
#

raytrace looks for blocks AND Entitues

orchid gazelle
#

so imma ignore the entity if it is the Player?

eternal oxide
#

yep

#

or start 1 block in front of you

orchid gazelle
#

good that raytrace already has a filter included

#

well, somehow my Predicate (e) -> e.getUniqueId() == this.shooter.getUniqueId() is not working

#

its still the same issue

tardy delta
#

hm some random parser i found on the internet has about the same precision loss

eternal oxide
#

you want != so it excludes the shooter

orchid gazelle
#

oh

#

nvm

#

lol

#

mb

hazy parrot
#

Or iv you have maven installed just open cmd in that dir and build

tardy delta
#

doing it i vsc now but it works

#

im wondering why im using a CharBuffer instead of writing a simple one myself lol

#

why does man calls StrictMath.pow and not just Math.pow

#

if you wanna do it good call FdLibm.Pow.compute

shell trench
#

How can I disable a plugin?
I build an licensing system that checks a given license in the onEnable() method.

How can I disable my pluggin if the key is not valid(if statement is false)

vocal cloud
#

I mean no matter what you do someone can disable your licensing system in a matter of minutes anyways. Not worth the effort.

shell trench
#

I found a way to kinda protect it, the only thing I currently need help is disabeling the pluggin(and even decomiling a jar stop the most people cuz they don't have an understanding of java)

vocal cloud
#

If your plugin is worth stealing it will be stolen

river oracle
#

I rather not explain again but yeah there's nothing you can do against pirating

vocal cloud
#

Focus on writing actual code over some DRM stuff that will take 1/100 of the time to break

shell trench
river oracle
#

When I see drm all I want to do is break it ๐Ÿ˜‚

vocal cloud
#

Don't forget that even if you disable it someone can just reenable it

#

Disabling your plugin should only really be used on conflict/configuration error

shell trench
vocal cloud
#

I've never seen it throw a noclassdef

tardy delta
#

Bukkit.getPluginManager().disablePlugin(this);

#

mismatched api and server version maybe?

shell trench
tardy delta
#

that wont fix it

#

what server version and what api version do you have?

shell trench
tardy delta
#

hmm

rotund ravine
river oracle
#

?paste error

undone axleBOT
vale ember
#

Hey, anyone know how do i set head's owner? SkullMeta::setOwner and Bukkit.getOfflinePlayer are both deprecated

river oracle
#

For player name maybe

rotund ravine
river oracle
#

Also did you look why they were deprecated

vale ember
vale ember
rotund ravine
#

You can do that

#

It is deprecated cause usernames are not unique anymore.

vale ember
#

yes, but it's deprecated

rotund ravine
#

Not because you can't do it

river oracle
#

Depreciation is just a suggestion

vale ember
#

there isn't a way to do this without using deprecated api?

river oracle
#

No

vale ember
#

๐Ÿ˜ญ

river oracle
#

Just use it it won't be removed likely

rotund ravine
#

It isn't deprecated due to it not being a thing anymore

#

Just to encourage you to use the uuid

rotund ravine
vocal cloud
#

Purpur what a world to live in

rotund ravine
#

it's fine

vocal cloud
#

I know. I'm just saying

rotund ravine
#

How did you restart your server.

shell trench
rotund ravine
#

did you replace the jar after stopping or before

vale ember
#

is there a way to create head with custom texture without depending on mojang's authlib? does depending on authlib break version compatibility?

rotund ravine
#

try after

shell trench
rotund ravine
#

if you open your jar with 7zip or winrar does that classfile show?

shell trench
rotund ravine
#

not in \commands?

shell trench
#

.\de\thedannicraft\permissionitems\commands are 3 for the 2 commands and one tab completer I have.

When I remove the Bukkit.getPluginManager().disablePlugin(this); line from my code everything works and compiles fine but as soon as I add this I get the error

rotund ravine
#

seems unlikely, what errors does eclipse give you?

#

and where did you ardd it

shell trench
sage patio
#

can i use switch for itemstacks?

rotund ravine
sage patio
rotund ravine
sage patio
#

its smth like this

#

InventoryClickEvent

rotund ravine
#

and what would you put inside it with "long ifs"

sage patio
#

its a gui with a lot of clickable items

kind hatch
# sage patio

You should really be using the PDC and then compare those values. That way, you can still use a switch statement if you want.

turbid tartan
#

Can anyone recommend a good data storage solution for a standalone server? I'm running a complex single instance survival server and need to rewrite the foundational plugins... Looking for a robust but simple database.

kind hatch
#

PersistentDataContainer

#

?pdc

rotund ravine
#

@turbid tartan a simple filebased system

turbid tartan
sage patio
shell trench
kind hatch
rotund ravine
turbid tartan
#

ok

kind hatch
#

You could probably use SQLite if you have a lot of data.

turbid tartan
#

thanks

rotund ravine
#

sqlite is also an option yeah.

kind hatch
sage patio
# kind hatch Yes

i'm on an older version unfortunately, can you help for "you can still use a switch statement if you want."?

kind hatch
sage patio
#

thanks

#

maybe switching item name will be ok

kind hatch
# sage patio maybe switching item name will be ok

You could, and it would work, but it's not recommended due to potential exploits. Other plugins that let you rename things with color codes will create issues. That's why people started switching things over to the PDC since it adds unique NBT data to the itemstack.

#

Understandably for older versions, you'll need to find other ways around that problem, but I just wanted to make you aware.

sage patio
#

yea its ok

twin venture
#

Hello, friends i have a question :
make an enum with PLAY,WIN,KILL,BREAK,PICKUP , and in the loader method and i can use that to check if the quest is PLAY Quest or win quest [in the event part]
so what i tried is :

#

this class and some others like it extend AbstractQuestEvent

#

is this possible?

rotund ravine
#

?learn

twin venture
#

already know how to use enum , but i didn't understand how i can make that part

hazy parrot
#

And what is your question

#

You put abstract question event as param for enum but you put empty parentasis(idk how to spell it) for win

#

Ofcourse it will be red

quiet ice
#

"Java eNum", myeah I don't know whether this is a reliable source @rotund ravine

#

But whoever spells enums like that and pretends that they are tied to java is very strange to me

twin venture
#

iam stuck at Event part ..

#

in config there is :
quests:
quest-win:
name.... etc
and there is
event-type: PlayerWinEvent < this event extend AbstractQuestEvent

hazy parrot
#

Ad you want to get instance of event-type?

twin venture
#

yeb!

#

so when i run the Event

#

FOR EXAMPLE !

#

this event the one i point to in red

#

it extend AbstractQuestEvent

#

so i was thinking i can make a enum and link it to the value that in the config?

hazy parrot
#

If I understood you right, you can use reflection to find that class, check if superclass is AbatractQuestEvent(just in case) and just do Class#newInstance

twin venture
#

no not that ๐Ÿ˜ฆ

#

so i am making a quest plugin , and i finished frotend code , gui , select , mysql etc

#

what iam stuck now is

#

events part

#

this is how the config.yml looks liks

#

so user can make unlimited quests

#

did you get a small idea of what iam trying to do xd?

hazy parrot
#

Not really ahahaha

twin venture
#

oh ok

#

thanks anyway ๐Ÿ˜„

hazy parrot
#

Someone will probably do better than me, sorry

twin venture
#

no don't be , thank you..

hazy parrot
#

Wait why you don't just make quest object serializable and load/read it from config?

hazy parrot
young dome
#

Hello, I hope you are well. I have a problem with redisson, it uses a newer version of netty than the one used by spigot so that causes problems. Do you have any idea what I can do to fix this problem? (Error : java.lang.NoSuchMethodError: 'boolean io.netty.util.internal.PlatformDependent.isOsx()')

young dome
twin venture
young dome
#

Like many people ๐Ÿซ 

rotund ravine
agile anvil
young dome
#

Yes I know the best issue but I can't update; I tried to put last netty version into my gradle dependencies but it doesn't work, I thinks spigot dependencies go over.

hardy pilot
#

Hey everyone! I am trying to run some code in a while loop every x minutes (where x is a random number between 10 and 20 minutes).

this is my code:

while (running) {
   randomTicks = Min + (int) (Math.random() * ((Max - Min) + 1));
   Bukkit.getScheduler().runTaskLater(Main.getInstance(), () -> swapPlayers(), randomTicks);
}

i know this is as wrong as it could be because i put a bukkit scheduler inside a while but its just to show what i am doing. i'd appreciate any help! thanks

eternal oxide
#

this will crash your server

hardy pilot
#

I am very aware of that. I tried it. And thats also why I am here

eternal oxide
#

MC/Bukkit is single threaded. Your while loop halts all other code running

hardy pilot
#

Yep

#

But I need another way to do it

eternal oxide
#

don't use a while loop. start and stop on a schedule.

hardy pilot
#

how do you stop a schedule? and how would i make the delay always be different?

young dome
hardy pilot
#

cuz you see the randomTicks value? it should generate something between 10 and 20 minutes

hardy pilot
eternal oxide
#

start a new runTaskLater inside your runTaskLater if you need it to run again with a new random delay

#

if it ends you don;t start a new task

young dome
eternal oxide
#

they always will. they are loaded first by the classLoader

young dome
#

Yes of course, but gradle is supposed to default to the latest version if the lib is same.

eternal oxide
#

gradle is not the class loader

young dome
#

Absolutely, but shouldn't it take over?

eternal oxide
#

you are using authlib which is mojang so will never be overridden by your own depends

young dome
eternal oxide
#

netty is also included in MC so will not be overridden unless you relocate

young dome
#

Yes I know, how I can relocate it ?

eternal oxide
#

can't tell you for gradle, I use maven

humble tulip
#

When yiu schedule them, you get a bukkit taks

#

Which you can store and cancel

tardy delta
#

scheduler better

agile anvil
#

Runnable and scheduler are basically not comparable since they don't do the same think

#

When you speak about one, you usually use both

tardy delta
#

i kill people that use new BukkitRunnable() {}.runTaskTimer(

eternal night
#

use that on a daily

eternal night
#

throw away objects are pretty bleh

tardy delta
#

the scheduler method is way more cleaner, you just pass in a lambda and you can always call the Consumer<BukkitTask> one if you really need a bukkittask

rotund ravine
opal juniper
#

Hmmm, I wanna wrap an object that contains two Integers and then a list of locations into a PDC, how to write the adapters for that lul

rotund ravine
#

?pdc

opal juniper
#

Yeah i see that I just wasn't sure what to boil it down to

tardy delta
#

alex has his pdc lib which makes you define custom datatypes or smth

eternal oxide
tardy delta
#

didnt know that was possible

eternal night
fresh timber
#

I am trying to make a custom block breaking system and in it I am using player.sendBlockDamage() again every time they damage the block but it is very flickery and hard to see... does anyone know how I can fix this?
here is a video showing it

tardy delta
#

video taking 3 minutes

#

4

glossy venture
# hardy pilot Hey everyone! I am trying to run some code in a while loop every x minutes (wher...

you could do it 'recursively':

boolean cancelled = false;

void scheduleNext() {
  // calculate delay until next action
  int randomTicks = Min + (int) (Math.random() * ((Max - Min) + 1));
  // schedule next action
  Bukkit.getScheduler().runTaskLater(Main.getInstance(), () -> {
    // check cancelled
    if (cancelled)
      return;
    // do stuff
    swapPlayers();

    // schedule next task for next time
    scheduleNext();
  }, 
}
#

then just call scheduleNext() once at the start

#

and maybe have some kind of way to cancel it

midnight shore
#

Hi, i have a strange question. Is there a way I can somehow detect when a player starts the bow aim animation and when it ends so that i can make a sort of a widget like the photo uploaded based on the current state of aiming?

zealous scroll
#

are there any alternatives to redstone particles i can use to prevent rotating these shields from looking laggy/delayed

#

redstone particles dont really sit well with movement

worldly ingot
#

Not really. They're the only colourable particles aside from potion splashes

limpid umbra
#

Does spigot have some sort replacement for a PlayerBanEvent? Or maybe an easy workaround?

limpid umbra
#

Well, I kind of expected a PlayerBanEvent to exist since join / quit / kick all exist but it doesn't

#

Maybe I got the naming wrong

#

Basically an event that fires when a player gets banned

wet breach
#

when a player gets banned, they have to be kicked if they are currently on.

#

if they try to rejoin, they auto get kicked and you can get the reason from their that they are banned

limpid umbra
#

Yes, but I need to know the moment they are banned, regardless of them being online or not

wet breach
#

then listen for the command I suppose or make a custom plugin that handles bans

limpid umbra
#

That still wouldn't fire if a player gets banned by a plugin via the API

#

It's not about a plugin. It's about all bans that happen via player / console command or other plugins

hazy parrot
#

Well, afaik most plugins just kick player if they are on ban list

#

So there is no real "ban"

wet breach
#

you have to kick when you ban anyways if the player is currently on

#

however, when a player tries to join, the server will kick and you can get the reason being for being banned

limpid umbra
wet breach
#

the game itself doesn't do anything when you ban a player, it just adds the player/uuid to the ban list

#

still have to kick them for them to actually leave

limpid umbra
#

The player being online or offline while being banned doesn't matter

wet breach
#

well not sure why you need a work around, just take over the ban commands to be part of your plugin

limpid umbra
#

That won't cover getServer().getBanList(BanList.Type.NAME).addBan(...) i think

wet breach
#

can't read a file?

#

it is a singular file, however most plugins developers who create a ban plugin typically opt to instead handle the tracking of bans though because depending on how large of a server you are, that singular file isn't enough lmao

limpid umbra
#

Plugins that are incompatible with the default ban-list can be ignored

#

Of course I could just read the ban-list manually every few ticks but that really dosn't seem like the best possible implementation

fresh timber
#

how can I check if a player has just a certain type of potion effect active on them?

#

oop just figured it out ๐Ÿ’€

wet breach
#

you can read it manually if you want to

limpid umbra
wet breach
#

however there is an api method you could just invoke to get an updated list

fresh timber
limpid umbra
#

I mean reading the list manually can't be the most efficient way to do this, right?

wet breach
#

we don't know because we have no clue what it is you are making

#

you just asked a question and everyone providing solutions you have stated wouldn't work, so we don't know

#

either you are making a plugin in which case this is really should be a non-issue

#

or you are not making a plugin and instead trying to hook into another?

#

which wouldn't make sense

limpid umbra
#

Ok a simple example of what I need is a Plugin that does something (e.g. print "XY has been banned") the moment someone gets banned. It doesn't matter if that player is online or not or whether the ban was caused by a command or by calling the mentioned API method.

#

That seems like something that usually can be handled by listening to an event but that event doesn't exist

#

I mean I could just check manually every tick but that seems unecessarily inefficient

agile anvil
#

You don't have many solutions since as everyone told ya before: there is no standard way of banning a player.
Solutions would include:

  • listen to /ban commands
  • listen to kicks and get the reason
  • hook to the mostly used ban plugins
limpid umbra
#

So there's no actual solution, just some hacks that probably work most of the time?

agile anvil
#

Yep sir

wet breach
#

if you are using essentials

#

essentials already has a permission for people to see who was banned

#

most plugins that broadcast bans are the very same plugins that handle the bans to begin with, which is the most ideal solution here

limpid umbra
#

Hm ok :/

#

Still thanks for the help ^^

limpid umbra
wet breach
#

well doesn't make sense to do so

#

what you are trying to do would require you to implement every single ban plugin out there, I am assuming you are just trying to make a public plugin for broadcasting purposes?

#

or is this something specific for your server?

limpid umbra
#

That's why I hoped there would be an event for when the game logic handles a ban

karmic dirge
#

hi, I would like to ask a question, how do you make a maven api?

wet breach
#

Well there is, just you are wanting to broadcast the moment someone is banned, in this case your best bet is to capture the ban command

#

but even then that wouldn't really be reliable

#

there are some plugins that don't even touch the vanilla ban system

#

and instead have their own

#

in those cases it wouldn't even matter if there was an event or not

#

which is typically how most plugins handle it with the exception of something like essentials

#

but I think what you are finding out, is that there isn't really a need for a plugin like yours since most ban plugins already incorporate it as a feature anyways

limpid umbra
#

Yep, I'm ignoring those cases deliberately because I can't make my stuff compatible to every plugin out there. So I'm sticking to what the game and API provides

limpid umbra
karmic dirge
#

Yes

wet breach
#

well you don't make a maven api

karmic dirge
#

like that of luckperms, worldguard etc ..

wet breach
#

you design your plugin to have an API included

limpid umbra
#

Still, thank you kindly ^^

karmic dirge
#

hmm i didn't understand well ._.

wet breach
#

Essentials has an API

#

and is the most common plugin most use even with banning lol

karmic dirge
#

I had bought a guy's udemy course (which I think you know) to learn more about spigot plugins, and he was creating another project and stuff like that, so I should put the dependency tag in the pom file with the same artifacId, version and etc..

limpid umbra
karmic dirge
#

ok...

limpid umbra
#

But tbh I don't know how to explain the plugin part of it (like how to structure your project)

quiet ice
#

Uploading stuff to maven central is rare here

peak depot
#

how can I set the gamemode of someone while hes loading to another world

wet breach
#

either you handle it before

#

or after they teleport

peak depot
#

how would I go about checking when they finished teleporting

wet breach
#

you would just wait a few ticks after they have teleported

#

there isn't really any way to actually check for that

glossy venture
#

dude what the fuck

#

it isnt even run

#

no message in console

wet breach
#

lol

glossy venture
#

here its registered

#

i dont fucking understand this shit

limpid umbra
peak depot
#

did it the scuffed

white root
limpid umbra
last sleet
#

does the player#setFlying function also affect elytra gliding?

#

I'm tryna stop a player from using the elytra

sullen marlin
#

?jd-s

undone axleBOT
sullen marlin
last sleet
#

found player#setGliding, perhaps that will work

quaint mantle
#

Is it possible to do a return statement for an ItemStack?

sullen marlin
#

what do you mean?

#

return itemstack; // return statement for an itemstack

quaint mantle
#

yea

hazy parrot
#

It is possible, no reason to not be

quaint mantle
#

I figured, been trying to find anything online to help figure out how, but I've been doing trial and error:

[to call]
ItemStack myPin = PinList.createRidePin(pinnum,ride);

[method]
public class PinList {
    public static ItemStack createRidePin(int pinnum, String ride) {
        String locate = Main.park;
        if (pinnum == 3) {
            ItemStack myPin = new ItemStack(338, 1);
            ItemMeta im = myPin.getItemMeta();
            im.setDisplayName(ride);
            List<String> lore = new ArrayList<>();
            String msg = String.valueOf(locate);
            lore.add(ChatColor.BLUE + msg);
            im.setLore(lore);
            im.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_ENCHANTS });
            im.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_ATTRIBUTES });
            im.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_UNBREAKABLE });
            im.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_DESTROYS });
            im.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_PLACED_ON });
            im.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_POTION_EFFECTS });
            im.setUnbreakable(true);
            myPin.setItemMeta(im);
            return new ItemStack(myPin);
        } else {
          ItemStack myPin = new ItemStack(434, 1);
          ItemMeta im = myPin.getItemMeta();
          im.setDisplayName("Error Token");
          myPin.setItemMeta(im);
          return new ItemStack(myPin);
                }
    }
}
sullen marlin
#

whats the issue

quaint mantle
#

I get this error in console:

17.12 23:40:27 [Server] [INFO] Caused by: java.lang.Error: Unresolved compilation problems: 
17.12 23:40:27 [Server] [INFO] myPin cannot be resolved to a variable
sullen marlin
#

fix the errors in your IDE

#

run a clean compile

drowsy helm
#

why are you declaring it twice

glacial yew
#

any tips on how to make a present plugin, just need it for a personal project plan i'm doing.

spring minnow
#

Why won't spigot load gifs on my resource page

spring minnow
#

i mean here you can have help on how to code a specific task but asking how to do a plugin is a bit generic

glacial yew
spring minnow
#

ok so basically create a Listener class and add a PlayerInteractEvent void

#

then check if event.getAction() == Action.RIGHT_CLICK_AIR

worldly ingot
# sullen marlin whats the issue

The real issue is this! D:

        im.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_ENCHANTS });
        im.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_ATTRIBUTES });
        im.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_UNBREAKABLE });
        im.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_DESTROYS });
        im.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_PLACED_ON });
        im.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_POTION_EFFECTS });

Sir, im.addItemFlags(ItemFlag.values());

spring minnow
spring minnow
spring minnow
sullen marlin
spring minnow
#

it is linked to an imgur page

#

spigot just has to load it, shouldn't matter the mb size, since it is hosted on imgur

sullen marlin
#

Images are proxied

spring minnow
#

what's the mb limit? just to know how much i gotta cut out

jagged monolith
#

It's like 5mb or something close to that im pretty sure

spring minnow
#

5mb its like nothing

#

my gif is 20mb

sullen marlin
#

Upload a video instead

#

No one wants a page filled with 20mb autoplaying gifs

spring minnow
#

its a 20 second clip, it would be better as a gif wouldn'it it?

jagged monolith
#

Video would be better.

spring minnow
#

should i like publish it on youtube or smth?

sullen marlin
#

Sure

#

Will be actually good quality that way too

spring minnow
#

alright thanks

worldly ingot
#

I think the limit on gifs is like 4mb

#

From personal experience. It's either that or 4.5mb. Don't know the exact #

rare rover
#

Anyone having issues login into mongodb?

#

A server error occurred. Please try again in a minute.

#

Says this

#

I've had this for like a week now

sullen marlin
#

MongoDB where

rare rover
#

Right here right now

sullen marlin
#

Helpful

vocal cloud
#

I didn't realize this server had a public mongodb. Where can I access it

subtle folio
#

Is there an event for when a player's food level changes?

#

PlayerItemConsumeEvent found it lol

misty ingot
#

the effect is worse the better food you eat

floral dock
#

Im having an issue with the InventoryClickEvent. This code https://bin.audreyvps.net/gohorikono.csharp works properly when in creative mode, and removes the enchant and lore, but fails when in survival mode

EDIT: Fixed, was the get/setCursor methods not working right, getCurrentItem/setCurrentItem worked fine

distant ridge
#

When using FileConfiguration with something like config.get("key.value") is there a way to understand what type this is? Boolean, String, etc...

open lotus
#

"Server resource pack couldn't be applied Any functionality that requires custom resources might not work as expected"

does anyone know fix pls i need help

jagged monolith
distant ridge
#

So it reads

test: "#&!"

and somehow writes out

test: #&!

#

That's using the YAML parser. I'm not sure if there's another way to fix it