#help-development

1 messages · Page 479 of 1

remote swallow
#

its the support server for papi

wet breach
#

I bought someone last year a $100 mouse

remote swallow
#

they have services section too

icy beacon
remote swallow
#

i love just looking at what people want for like nothing

icy beacon
#

roccat kain 122 and gmo-

remote swallow
#

or what people want for way way too much

icy beacon
#

i'll take a look

#

though processing payments may turn out to be a bitch

brisk estuary
#

which switches would u recommend?

remote swallow
#

reds

wet breach
icy beacon
#

tbh i don't know anything about switches

wet breach
#

And it was all metal

remote swallow
#

especially if you live with people and are awake at night

brisk estuary
#

lol, are they that loud?

#

the blue ones

wet breach
remote swallow
#

if i was on my old keyboard my brother would come in telling me to shut up, there is 3 walls between us and he had headphones on

wet breach
#

Lol

remote swallow
#

these ar ealso plastered walls

#

not shit american drywall ones

icy beacon
#

sounds adequate

#

but i don't want to risk taking comms through discord tbh

brisk estuary
#

lol that is not a keyboard, that's a driller

icy beacon
#

a chance to get scammed is there

wet breach
icy beacon
#

what's escrow? is it like an intermediate for money

wet breach
#

The escrow service guarantees i get paid for the work. The contract is for the escrow service so they know what the rules are

wet breach
brisk estuary
#

cool, gotta have that in mind when I start doing services

wet breach
#

As long as you hold up your end of the deal you get paid and the requestor cant pull the money back

icy beacon
#

i see, but how does it ensure that the money goes to the right person? (e.g. the developer if the commission is done)

wet breach
#

If you dont hold up your end the requestor gets their money back

wet breach
flint coyote
#

Is there an actual person inbetween or is it automated?

icy beacon
wet breach
#

Its half and half. There needs to be a person that verifies

icy beacon
#

one wrong move with this sevrice and i'll be declared a foreign agent in my country

wet breach
#

Lmao

flint coyote
wet breach
#

The downside of going contract route is that minors cant enter into contracts on their own. Which is fine with me because rarely have had any good experiences with minors paying for stuff

icy beacon
#

oh that's right

#

minors can't enter contracts

#

looks like i'm not doing helpchat commissions any time soon

flint coyote
wet breach
#

Well there is exceptions just i didnt encounter those often

flint coyote
#

Well as a trusted developer you can request the charge before delivery. Sure it's their risk but it's also their decision to work with you.

icy beacon
#

fair

flint coyote
#

Obviously you have to be ready to fix bugs/make slight adjustments if it isn't as requested after you delivered it. But that's what makes you the trusted developer

icy beacon
#

yep

#

speaking of which i gotta fix a couple bugs

#

thanks for the convo yall, and cya

analog thicket
#

Yo, quick question. I have a plugin with generators. Basically, it saves their generators to a file, loads on join, and unloads on leave. The problem is if a player spam joins the server the file bugs, and ends up deleting all their stuff. How would i fix this?

eternal oxide
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

eternal oxide
#

You can't spam join a server

#

there is always a disconnect between joins

#

No code can't help further

remote swallow
#

any gradlers in chat

eternal oxide
#

spit

remote swallow
#

dont you dare

wet breach
remote swallow
#

before i get ?ask'd anyone know why gradle shadow minimize starts to remove the entire nms dir instead of keeping all of its contents, it keeps the nms dir but doesnt keep any of its children that are accessed by reflection

    minimize() {
        exclude("me/epic/spigotlib/nms/**")
    }
``` thats what does it, changing it to include just removes everything from the jar
sullen marlin
#

Cause it doesn't handle reflection

remote swallow
#

exclude should stop it from getting removed i would have guessed

quiet ice
#

We had that issue once before with mfnalex

remote swallow
#

i was looking through that message

#

it didnt help

quiet ice
#

Do you relocate or something like it?

remote swallow
#

yeah

remote swallow
#

ill try without relocating rq

quiet ice
#

Yeah then use the pre-relocated name

remote swallow
#

i do use those

quiet ice
#

then try the post-relocated name

remote swallow
#

even without relocating still removes nms dir

quiet ice
#

or just try both

#

Ugh.
At worst don't use minimize

#

I really don't understand why one would ever touch it

remote swallow
#

make jar smaller

#

adventure is huge

#

adding both to minimize still removes nms dir

quiet ice
#

And useless too

#

Adventure-bukkit does nada

remote swallow
#

the format is great, would love if i could replicate it without the like 2mb it takes up

quiet ice
#

At worst just use the plugin.yml libraries feature

remote swallow
#

wont work

quiet ice
#

🤨

remote swallow
#

tried that for like 3 hours for them to say "doesnt work with the libraries feature because some random method doesnt exist"

quiet ice
#

looks to me that you are using the wrong version

#

but whatever

remote swallow
#

with the earliest version that is on maven central that is like a patch version off it wont work

young knoll
#

This is why you don’t support 1.17

quiet ice
#

At worst include adventure instead of excluding your nms dir

#

Though at that point we are playing whack-a-mole

remote swallow
#

i hve nothing better to do so why shouldnt i go and make my own minimessage esque formatting stuff

young knoll
#

Because I don’t trust you to make an efficient parser

remote swallow
#

gradients are gonna fucking hurt but its better than shading 2 megabytes

young knoll
#

:p

remote swallow
#

smh

quiet ice
remote swallow
#

its still gonna be 14

#

actuallyd

#

do i wanna spend 4 days on this

#

or do i drop 1.17 support

young knoll
#

It’s not a competing standard if it sucks

quiet ice
#

Also, does anyone happen to know how to push outputs to a passive mekanism transport pipe programatically?

#

Probably not but doesn't hurt to ask anyways

river oracle
quiet ice
#

why would anyone be on 1.17 anyways?

#

1.19.2 is the shit

river oracle
quiet ice
#

after that it is all going down

weak meteor
#

Anyone knows any spigot with this events: PotionEffectExpireEvent, PotionEffectRemoveEvent, EquipmentSetEvent?

#

Nvm just found one

remote swallow
#

without shading adventure my end plugin jars are 50kb, with shading they are 650kb

eternal oxide
weak meteor
#

But theres custom spigots with it

eternal oxide
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

steady wasp
#

hi can i ask craftbukkit 1.7.10 help here?

eternal oxide
#

you can always ask. Don;t expect an answer though

flint coyote
#

💀. But sure we can try to help. I'm just not aware what was available back then

steady wasp
#

why CreatureSpawnEvent.getEntity() returns null when player uses spawn egg?

flint coyote
#

I never used that event. I usually use the CreatureSpawnEvent for LivingEntities. Is that available in 1.7? And do you get the same result?

quiet ice
steady wasp
#

i messed up

#

ok it works now, i used incorrect event sorry :/

#

(SpawnEntityEvent is from worldguard)

quiet ice
#

smh - discord doesn't support the new markdown logic here either

quiet ice
#

These are 1.7.10 docs

steady wasp
quiet ice
#

They ought to

steady wasp
quiet ice
icy beacon
#

the ss is from my test server with only me and 6 bots

#

not sure why it doesn't work here

#

oh nvm

#

misread your msg

quiet ice
#

Discord only does stuff incrementally

icy beacon
#

thought you said "already" instead of "here either"

#

💀

steady wasp
#

is there way to get real class from CustomProjectileEntity?

somber night
#

when coding custom items, can i make a new class file for each item? I tried but didnt work so it might have just been my bad code

steady wasp
reef forge
#

import com.ultimatest.hardcore.Hardcore;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;

import java.util.UUID;

public class DeathListener implements Listener {

    public void onPlayerDeath(PlayerDeathEvent e){
        Player p = e.getEntity().getPlayer();
        UUID playerUUID = p.getUniqueId();
        Hardcore.getBannedPlayers().add(playerUUID);
    }

}```
floral drum
#

lmao

reef forge
#

this doesnt work for some reason

floral drum
#

don’t worry, I use unity too

#

whoever that was

reef forge
#

it doesnt add the uuid to the arraylist

echo basalt
#

@EventHandler

reef forge
#

i forgor

echo basalt
#

Also I wouldn't recommend you use single letter variable names

#

whatever readability argument you may have doesn't matter

ocean hollow
#

here is something wrong

floral drum
#

playerUUID is perfect

#

just the “p”

ocean hollow
echo basalt
#
public void onPlayerDeath(PlayerDeathEvent event) {
  Player player = event.getPlayer();
  UUID playerId = player.getUniqueId();

  // whatever
}
echo basalt
reef forge
floral drum
#

oh god

#

E

reef forge
#

lmao

echo basalt
reef forge
#

chill guys

flint coyote
# ocean hollow

The armorstand probably does not have anything on the head slot

echo basalt
#

welp fun time is over

floral drum
#

oh god JAVA

echo basalt
#

gotta go back to schoool

#

got a school meeting at 6:30pm woeisme

floral drum
#

rip

reef forge
#

dat eventhandler decorator saved my life

#

:/

granite owl
#

is it resource heavy to have each CommandExcutor also registered as an EventListener? i mean it would only put load @ onLoad right as i still need to hook the actual functions with the @EventHandler annotion right?

the purpose is to have events that are tied to a specific command are sorted better. e.g i have a plugin that manages ranks and permissions, adds a scoreboard team to the player for a prefix and then i want to hook a PlayerChatEvent to reformat the player chat

exotic oriole
#

Hello! I am thinking moving from maven to gradle.. witch one is better?

ocean hollow
echo basalt
#

certain bukkit versions may have the @NotNull

#

but it's still good to sanity check

flint coyote
#

Maven has more users (therefore you get help easier), gradle has less boilerplate - in the end it's personal preference

eternal oxide
exotic oriole
#

I am trying to shade all of the dependencies, but its not working for intellij idea (its working but I am dumb xd)

eternal oxide
#
if generateRed().isSimilar(...```
echo basalt
quaint mantle
#

Should I reflect command map or still use CommandExecutor?

echo basalt
#

There are tons of events including custom ones which is why there's the Listener empty interface + @EventHandler for telling the code to detect your method and handle it

floral drum
#

we love command maps for easy api’s

echo basalt
granite owl
echo basalt
#

I'd only access the command map if I'd need to register custom commands with tab completion

granite owl
#

by ur answrr

echo basalt
#

EventListener is a java interface

#

and it's just a tag

#

The process of parsing a class and mapping out event handlers is a bit heavy

#

It's much easier and effective to associate an interface and call the methods

floral drum
#

I hate @fresh templetHandler :D

echo basalt
#

Instead of looping through the class' method and associating certain methods with certain events

#

Anyways gtg fr now

floral drum
#

thanks discord for pinging someone

remote swallow
#

shouldnty be called even

#

like @urban grotto

ocean hollow
small current
#

Hello, i have protocol questions

#

ClientboundPlayerInfoUpdatePacket.Action.REMOVE_PLAYER does not exist

steady wasp
small current
#

what should i use

#

UPDATE_LATENCY?

alpine swan
#

how does the attack() method in spigot 1.15.2+ work?

small current
#

or UPDATE_LISTED

alpine swan
ocean hollow
#

I can't figure out what's the problem

copper moss
#

did you guys patched the string dupe thing?

remote swallow
#

was it reported on jira

weak meteor
#

How can i get the event when a player equips a armor?

#

and its type.

cobalt thorn
#

Hi im having an issues,

Math.round(iconsPage.size() / size);

the number for the division return 3.1111111...
but the math.round round it to 3 and not 4 so some item gets substituted, any solution for this?

opal juniper
#

round up? Math.ceil

cobalt thorn
opal juniper
#

cast it lol

remote swallow
#

or integer.parseInt

opal juniper
#

??

#

no

#

cast it

#
(int) Math.ceil(iconsPage.size() / size);
floral drum
#

hi oli

opal juniper
#

hi!

floral drum
#

:3

ocean hollow
#

oh, I solved it, I got error where ArmorStand is null

#

How can I compare entities?

#

if it equals

#

it always gives null

undone axleBOT
ocean hollow
#

okay, wait

#

that is my error now)

#

Okay, I'll try now. I just don’t understand why, if stand is stored in this object

#

Well, in general, the problem is not only this, it simply cannot compare entities, I will fix it now.

quaint mantle
#

hi , how to tell when a player move to xyz , run a event ?

#

is work with xyz ?

lost matrix
quaint mantle
fluid river
#

freejavalessons is back

lost matrix
quaint mantle
#

no , like this when a + y tell to the player "You Are +y" , is just example

fluid river
#

i mean, you can ask him with message

#

but not force the player object to start moving

#

you can teleport him or use velocity to punch him to the direction you need

quaint mantle
fluid river
#

idk

#

what are you trying to achive

#

make player walk like NPC to the goal location?

quaint mantle
#

not matter , i try with playermoveevent if is not worked is not problem so thanks for everyone for help

sacred mountain
#

i'm currently trying to implement a sort of rocket launcher ability into my minigame, but the recoil is not working as intended. The pitch should change by a few degrees, and the way i've achieved that effect is by using https://www.spigotmc.org/threads/teleport-player-smoothly.317416/ which works nicely, but has the same issue if the player is moving, if they are moving or jumping, the teleport will not retain their velocity in a smooth way.

Is there any easy way to modify the direction they are looking without causing this

#

i also realised after that that resource is for a slightly different purpose so i might be doing things wrong

#

i just want to apply some sort of upward push on their yaw

lost matrix
#

You just want to create a pull up after someone shot a weapon but you need this pull up to be
done over several ticks?

sacred mountain
#

it should happen relatively quickly, so like over the course of a few ticks

#

i previously wanted to give some sort of like

#

camera velocity

#

if that makes any sense

#

yeah and the only way i've found to modify someone's yaw is by setting it to a static value at a certain time, which makes it look overall jittery and the player physically stops moving whilst being teleported

lost matrix
# sacred mountain it should happen relatively quickly, so like over the course of a few ticks
  public void interpolatedPullUp(Player player, double degrees, int ticks) {
    double degreesPerTick = degrees / ticks;
    BukkitScheduler scheduler = Bukkit.getScheduler();
    for(int i = 0; i < ticks; i++) {
      scheduler.runTaskLater(this, () -> pullUp(player, degreesPerTick), i); // "this" needs to be your plugin ofc
    }
  }

  private void pullUp(Player player, double degrees) {
    Location eyeLoc = player.getEyeLocation();
    player.setRotation(eyeLoc.getYaw(), (float) (eyeLoc.getPitch() + degrees));
  }

Try this and tell me the result.

sacred mountain
#

setRotation?!?!?!?

#

bruhhhhh

sacred mountain
#

not sure why i can't see a logic error

#

testing again without a scheduler

lost matrix
#

Try to calculate it to radians first...

  private void pullUp(Player player, double degrees) {
    Location eyeLoc = player.getEyeLocation();
    float radians = (float) Math.toRadians(degrees);
    player.setRotation(eyeLoc.getYaw(), eyeLoc.getPitch() + radians);
  }
sacred mountain
#

thanks 👍

reef forge
#

getting this error

#
            Player name = Bukkit.getPlayer((e.getCurrentItem().getItemMeta()).getDisplayName());
            UUID uuid = name.getUniqueId();```
#

anyone willing to help pls;-;

sacred mountain
#

lol

#

no clue why the pitch changed tho, might be that the eye location is stored from where the player previously was

lost matrix
reef forge
#

ik

sacred mountain
#

wait what

reef forge
#

i saw that on the first glance

#

but i need solution

#

how can i make it so that it doesnt return null

#

it returns some data

lost matrix
lost matrix
reef forge
#

then

sacred mountain
#

up down, left right, sometimes a 180 degree spin

reef forge
lost matrix
# sacred mountain up down, left right, sometimes a 180 degree spin
  private void pullUp(Player player, double degrees) {
    Location eyeLoc = player.getEyeLocation();
    float radians = (float) Math.toRadians(degrees);
    float yaw = (float) Math.toRadians(eyeLoc.getYaw());
    player.setRotation(yaw, eyeLoc.getPitch() + radians);
  }

Probably need to translate the yaw to radians as well?

sacred mountain
#

hm it works when i stand still but whenever i move my camera goes flying

lost matrix
# reef forge tHeN

There is no then.
If the methods returns null the player is not on the server.

sacred mountain
#

nvm u aren't meant to convert either

reef forge
#

k

sacred mountain
#

ill do more testing

reef forge
#

what if the player is on the server and it returns null

#

(thats what happened in the earlier error and code)

lost matrix
lost matrix
#

Its not

reef forge
#

yes

#

i checked if its returning null

#

and it is

lost matrix
#

Print out the displayname.

reef forge
#

aight

young knoll
#

Make sure to strip any colors

reef forge
#

i mean it still shouldnt return null

#

even if there are colors

#

it should return smth

young knoll
#

What should it return then

reef forge
#

SOMETHIN

#

[08:15:05] [Server thread/INFO]: null
[08:15:06] [Server thread/INFO]: null

lost matrix
young knoll
#

null is something

#

Technically

reef forge
#

when i printed the name

#

any thoughts bout it?

#

no thoughts?

sacred mountain
young knoll
#

Well yes

reef forge
#

nice

young knoll
#

But null is a keyword so its technically something

reef forge
#

lemme try strippin the colors

#

null

#

fork

lost matrix
# reef forge null

If you strip color from null then the result doesnt change.
You are simply checking an item which has no name.

sacred mountain
#

how tf ur players returning null

reef forge
sacred mountain
#

try printing Bukkit#getOnlinePlayers()

#

just raw sout

#

system.out.println

reef forge
#

nice

#

idea

lost matrix
#

We already identified the problem

sacred mountain
#

oh u did

#

mb

reef forge
lost matrix
sacred mountain
#

ahhh i love opensource github projects, got my code on a nice big spoon

reef forge
#

why is it nameless

lost matrix
#

Because it has no name

reef forge
#

if the player is in server

reef forge
hazy parrot
#

What does player have to do with display name being null

lost matrix
#

What do you mean?
Did you add the players name on the ItemStack?

reef forge
#

lemme check

earnest wasp
#

hello, how add enderchest inventory player in menu?

reef forge
#

should i try removing it

reef forge
lost matrix
#

You didnt even set the name on it. There is nothing to remove.

reef forge
#

wat do i do

#

;-;

lost matrix
# reef forge wat do i do

Add the players UUID in the Persistent Data Container of the ItemStack when opening the GUI.
Then on click you get the UUID from the PDC again and get the player of that UUID.

reef forge
#

idk anything bout pdc

young knoll
#

?pdc

reef forge
#

who nobody knows

#

but helps under 1 nanosec

remote swallow
#

we all know coll

serene sigil
#

can someone help me with this? ive posted a question yesterday and no one answered

sacred mountain
#

unsafe location

#

probably

#

check your other plugins

#

they will mostly likely listen for unsafe teleports and teleport to the nearest safe location, maybe like essentials or something

lost matrix
quaint mantle
#

Hi , how to get player postion ?

chrome beacon
#

player#getLocation

lost matrix
quaint mantle
#

or get Y

young knoll
#

Player#getLocation()#getY

#

?jd is your friend

quaint mantle
serene sigil
#

can you maybe force it?

young knoll
#

Does it occur without other plugins

lost matrix
serene sigil
#

i have no other plugins

#

the last one is mine

ocean hollow
#

Can I do this?

young knoll
#

No

ocean hollow
#

so how to save entity

#

uuid?

young knoll
#

Yes

ocean hollow
young knoll
#

mhm

sacred mountain
#

THEY LIED TO ME

#

oh its bc i screwed something up

#

as usual

#

sigh

serene sigil
sacred mountain
#

turn off the safe teleport setting in essentials

#

they have a config

serene sigil
#

bruh i dont have esentrals

sacred mountain
#

well what plugins do you have

#

that could affect that

serene sigil
sacred mountain
#

oh

#

havent ever seen a couple of those

#

so not sure

#

geyser may have a setting

serene sigil
#

hmm

lost matrix
sacred mountain
#

i suggest you just look through the config files

serene sigil
#

but it would maybe only be bor bedrock players

sacred mountain
#

theres not too many plugins there

serene sigil
#

so its not that

#

its a weird bug and i need it fixed rq

lost matrix
modern plume
flint coyote
#

you did not register the listener

wet breach
#

it is quite possible the y is the same

modern plume
#

public final class ObBlocker extends JavaPlugin implements Listener { i do

wet breach
#

if the y does not change to the next whole number

#

it still points to the same block

#

so y 1.5 is still the same as y being 1.75

flint coyote
modern plume
#

inside onEnable() ?

flint coyote
#

yes

modern plume
#

i love you

#

its work

#

omg

wet breach
#

@serene sigil when it comes to teleporting and changing blocks it is generally best to not use floats as well and instead just integers

eternal oxide
#

do the teleport 1 tick later. your block changes are not likely reflected in the world in the same tick.

wet breach
#

that is also possible as well

eternal oxide
#

also add 0.5 to both x and z coords you tp the player to

#

you are teleporting the very corner of a block

wet breach
#

or just use ints....

eternal oxide
#

ints would also be a block corner

wet breach
#

0.5 is no guarantee to get the next whole number as they are using a range

#

or even the middle

eternal oxide
#

they don't want a whole number in the teleport location, they want center of the block

wet breach
#

you don't need the center, whole number works best but again they are using a range

eternal oxide
#

ah you mean in the random? yes use ints for the randoms

#

but add 0.5 to x and z for the teleport location

modern plume
#

spigot support thunder on a block event?

flint coyote
eternal oxide
#

yes, but use variable so you are not creating so many objects

#

you can use just runTask

#

it tries to do it the next tick

serene sigil
#

still wont work

#

and i am on top

eternal oxide
#

what coords did you tp to?

#

end up?

serene sigil
serene sigil
#

gtg for 10 min

#

brb

eternal oxide
#

I mean multiple location objects

#

you only need 1

#

I don;t believe you are using spigot as it only alters the tp destination when using a portal

rare rover
#

I was wondering, does anyone got a tiny tutorial on a custom command system, I'm working on an annotation based command api and I'm not sure how to fully register the commands

#

With the tab complete and stuff

echo basalt
#

command map

rare rover
#

Yeah, but like how would I register each since each method would be their own arg, or should I just make it all 1 method ?

#

I wanna make it as readable as possible

echo basalt
#

depends on what you're looking for

#

basically you'd need to make 1 command class per "base" command and handle args manually

#

For example, my simplecommand system just has identifiers like command.whatever.* which is then converted to /command whatever <whatever>

lost matrix
#

Before reinventing the wheel: Does someone have some code which linearly interpolates the direction between two bukkit vectors?
(Within N steps)

#

Nvm i just realised that i dont need quaternion fkery for this.
I can simply interpolate each pitch and yaw for that.

eternal oxide
#

surely it's just the application of a unit vector anyway

#

oh no origin

#

you are literally talking about just vectors

humble tulip
#

TotemUseEvent

eternal oxide
#

yes

#

first decide what you are going to do with what they are already wearing

humble tulip
#

Sorry bro😂

eternal oxide
#

ok, then Player#getInventory. It has methods for set armor slots

humble tulip
#

I was joking

#

What's a totem?

#

Ohhhhh

eternal oxide
#

you get an instance of that player

humble tulip
#

EntityRessurectEvent @quaint mantle

regal scaffold
#

What's the correct value for api version

#

Is it the lowest it will work on?

remote swallow
#

yeah

regal scaffold
#

So if it's 1.17

#

1.19 will have no issue

remote swallow
#

mhm

regal scaffold
#

Thanks

#

And is not including it a bad idea?

remote swallow
#

you enable legacy support, breaks a lot with the material enum

quiet ice
#

Can add like a good minute to the startup time

eternal oxide
#

damager is a block not a Material

#

bush.getType()

#

no

#

if (bush.getType() == Material...

rough drift
#

does Entity#getLocation return a copy?

sacred mountain
#

guys is there a way to cancel default mechanics like genericmovementspeed attribute modifiers when crouching or in powder snow

sacred mountain
rough drift
#

even though it's a player as well lmao

#

whatever

remote swallow
#

it does that bc its on local repo and doesnt grab docs from the repo

#

no idea why

sacred mountain
#

oops

eternal oxide
#

You could always tp into a block so I don;t belive anything has changed

sacred mountain
#

bro he spoonfed you already

#

you're calling

#

entitydad.equals(EntityType)

sacred mountain
#

thats valid code but not valid logic

#

think about it

#

you're comparing the entity object to it's type

#

its never gonna equal that

#

you gotta call .getType() and compare that

eternal oxide
sacred mountain
#

try removing all ur other plugins add them back one by one

#

you have like 6 its not gonna take a long time

serene sigil
#

i am literally teleporting to that cord (even making room for the player) and it still wont work

sacred mountain
#

is your server just that plugin

#

that's doing the teleporting

serene sigil
#

my plugin

remote swallow
#

give the players head sky view

sacred mountain
#

bruh then whats the problem

#

do it again

#

it'll work again

#

🤯

#

nevermind

#

probs your .equals on the string

#

try killer instanceof Player

#

and servant instanceof WitherSkeleton

serene sigil
# sacred mountain yeah

HOWEVER, i found out something... so, basically ive made a 100x100x100"cube" that is made out of 10% air and 90% stone; one time i tped and it did work, so that would mean that the air was pre-generated and so it worked because there was space for the player

sacred mountain
#

because this narrows it down if it is

serene sigil
sacred mountain
#

as i said, restart without all of them

serene sigil
#

the last is mine

sacred mountain
#

and if it works then add them back one by one

#

till it stops working

#

and then you know the plugin that's causing the issue

#

if it still happens on vanilla theres something in your code that you gotta figure out

serene sigil
#

i bet its gayser

remote swallow
#

im never calling it anything else

sacred mountain
#

calling what

remote swallow
#

gayser

sacred mountain
#

lmfao

remote swallow
#

gyser

sacred mountain
#

real

serene sigil
#

ye bro it is kina...

#

lol

sacred mountain
#

it's how way to main class looks?

#

what does that mean

#

you sent a picture of your plugin yml

regal scaffold
#

What's the classifier

remote swallow
#

structure is on the left

regal scaffold
#

For nms spigot mappings

remote swallow
#

nothing

regal scaffold
#

👍

remote swallow
#

just import spigot instead of spigot api and you have it

sacred mountain
#

i still dont understand what you want

#

you're sending me your project structure

regal scaffold
#

Uhhhh

serene sigil
#

fuck

regal scaffold
#

Epic

#

I need assistance

serene sigil
#

its gayser

sacred mountain
#

??

regal scaffold
#

Lets say there's a code with 1.17 spigot nms

serene sigil
#

now it works lmao

sacred mountain
#

so whats wrong with your plugin bro

regal scaffold
#

And I want to just change to 1.19 using the same

sacred mountain
#

u havent sent anything useful at all

regal scaffold
#

But there's stuff that's no longer obfuscated

#

Do I need to convert each one?

sacred mountain
#

my guy that is a plugin.yml

#

WHAT IS WRONG WITH IT

regal scaffold
#

Or is there a way I can run 1.17 spigot-map in 1.19

serene sigil
#

@sacred mountain what should i do??

sacred mountain
#

bruh plugin.yml error

#

is very specific

rough drift
#

If I have an entity and teleport it to a player in the PlayerMoveEvent it seems as if the entity is moved in front of the player, why is that?

sacred mountain
#

can u just send the error

eternal oxide
#

your error is in KoTHPlugin.java

sacred mountain
#

ok

#

u gotta put it in resources

#

its just sitting in ur folder

serene sigil
#

@sacred mountain whaz should i do?

sacred mountain
#

where is your main directory

#

what

serene sigil
#

it is gayser

#

now it works

remote swallow
sacred mountain
#

it should have the structure
src

  • main
    -- java
    --- me.blahblah
  • resources
    -- plugin.yml
sacred mountain
#

i told you to check config files earlier

rough drift
#

Entity teleportation issues

regal scaffold
#

Ebic

#

Lastly

#

How can I get no mappiongs

#

Completely obfuscated

remote swallow
#

with spigot you cant iirc

quaint mantle
regal scaffold
#

Oh ok

#

Thanks ebic

radiant shuttle
#

Custom Biome Distribution using vanilla chunk generation

sacred mountain
#

you need the structure i sent above.

#

copy that and it will work

#

i dont know how you have so many folders and so much code without once being able to run your plugin

#

copy this

round finch
#

?paste

undone axleBOT
sacred mountain
#

ignore the .idea folder

#

that is just intellij

round finch
serene sigil
#

ima ask in gayser dc

#

but it have to wait for 10 min to send a message 😩

sacred mountain
#

public Error 😭

#

thats a cursed method

sacred mountain
#

only one way to find out

#

😏

#

this better not crash my pc

#

interesting

quiet ice
#

Does it even compile?

sacred mountain
#

i'm definitely missing a couple variables

#

and the brackets arent even right

#

so like ion know hwere you got it from

#

no...

#

look at the image i sent you

#

please

cursive lily
#

pls is there anyone that knows how to update a plugin to 1.19.4 pls if you know dm me

rose aspen
#

Hello, currently I use mojang mappings for some plugins.
But sometimes I have to shade some dependencies inside the jar, but I really don't know how to do this here:
https://pastebin.com/TPvTTZ0u

Any ideas?

sacred mountain
#

src
-> main
---> java
-----> me.natty
---> resources
-----> plugin.yml

#

please look at it

#

i dont know how more obvious i can make it

quiet ice
sacred mountain
#

bruh

#

this make any sense?

cursive lily
sacred mountain
#

you can't put your resources in the code section you have to always follow that structure

quiet ice
sacred mountain
#

unless it's fully nms

sacred mountain
#

then itll be a pain in the ass

quiet ice
sacred mountain
#

good job

#

sorry

#

yeah thatll work

#

put your plugin yml

#

in your resources

#

yes.?

#

yes.

#

getDataFolder() or whatever the method is

#

will return that resources folder

#

if you're using default yml config that is

#

yep

#

now just change plugin yml to match the class directory

#

for your main class

#

nvm you dont need to

#

keep that how it is

#

should be
main: me.matty.KoTHPlugin

round finch
sacred mountain
#

the rs object has an r field
theres some other variable nrLeaves
and the r and rs objects both have a field called nrLeaves
rs has a field called r that is an integer object

remote swallow
#

why are you naming stuff var for

sacred mountain
#

r has a field called fnleaves that has another field called r AGAIN

remote swallow
#

and why ido you have an iterator, just foreach

#

?learnjava!

undone axleBOT
sacred mountain
remote swallow
#

still needs to learn java if they keep trying to check if something equals something that it never will be

sacred mountain
#

int a = 5;
int b = 7;
while (!a.equals(b)) {
System.out.println("A is not B");
} else {
System.out.println("A is B");
}

#

real

round finch
opal juniper
#

int doesnt have a equals method

round finch
#

like these cursed moments

jovial shadow
jovial shadow
#

idk about programmingbydoing but theres a 12 hour video on youtube that goes over everything

undone axleBOT
hazy parrot
#

You can really get smth inside of your jar as File

serene sigil
chrome beacon
#

I've wasted two by mistake :c

sacred mountain
#

sh

abstract sorrel
#

does anyone know the name of the block break animation packet in nms for 1.19.4?

sacred mountain
#

this may be helpful

sacred mountain
quiet ice
#

Why would it return the resources dir?

#

Especially if the plugin is installed on a different computer it is hard to figure out

sacred mountain
#

yeah dunno mb

#

is there any conversion docs

#

anywhere

#

can't find anything

#

need an easy way to get a minecraft generic movement speed value from a m/s value

eternal oxide
#

a minecraft block is 1 mtr cubed

sacred mountain
#

send the error...

#

telling me it doesnt work is like the least helpful thing u can do

#

jar does not contain plugin.yml?

#

well thats interesting ,

abstract sorrel
#

does anyone know the name of the block break animation packet in nms for 1.19.4?

sacred mountain
#

how are you compiling it

#

through maven?

sacred mountain
#

the java name you can google

#

what?

#

ok erm

eternal oxide
#

why do you want teh block break animation packet? you can use teh Spigot API and send a block break anim

sacred mountain
#

do you have maven

#

do you have a pom.xml

sacred mountain
#

right ok and how exactly do you expect to use placeholderapi and more stuff without even the spigot api

#

do you have ur dependenceies

#

without maven

#

already

#

bruh

#

is this your plugin

#

because it seems like you just decompiled something and copy pasted it into a directory and tried to open it with an IDE

#

bruh

#

consider learning the basics of plugin making first

#

because it looks like you just want a plugin and are trying to just bash the code in a folder as quick as possible

#

at least learn how to import and structure the project properly

#

yeah that really isnt my problem i've already said what you need to do

#

learn how a plugin is structured and how to import your dependencies with maven

#

spigot have a whole tutorial on that i think

quaint mantle
#

Can anyone review my code : )

sacred mountain
#

with that attitude it wont work

#

go learn how to make it work

#

import your dependencies

quaint mantle
#

Check dms

sacred mountain
#

lmao alright

#

good luck with your koth

abstract sorrel
lost matrix
abstract sorrel
lost matrix
abstract sorrel
#

it's protocollib isn't it?

sacred mountain
#

THc?

#

protocollib makes things easier but like i think spigot has methods for that

#

i did it without nms before i remember

mental atlas
#

How do I add custom textures to custom custom items

lost matrix
mental atlas
#

But how do I apply it to a custom item

sacred mountain
#

setCustomModelData() i think

#

requires an integer of up to 7 digits

#

can't start with 0

#

listen, as much as i want to help ur just asking me to do it for you basically, just go learn how to create a default project, and if you want to copy all the github code into ur project, do it after you have a working structure

lost matrix
#

Item models allow predicates. A predicate defines when a model should be applied to an item.
Example:

{
  "parent": "item/generated",
  "textures": {
    "layer0": "item/iron_ingot"
   },

  "overrides": [
    {"predicate": {"custom_model_data":1234567}, "model": "item/gold_ingot"},
    {"predicate": {"custom_model_data":1234567}, "model": "item/custom_ingot"}
  ]
}
sacred mountain
sacred mountain
#

imagine custom overlays for pumpkin head model data

#

the possibilities

#

of guis, interfaces

#

etc

lost matrix
#

I mean you can already do some nice gui stuff by using some other magic.

#

But native support would be nice ofc

sacred mountain
#

gib

#

is there some texture that extends over the gui border

#

to make it look like theres nothing there

#

or is that a mod

lost matrix
#

This is all vanilla

sacred mountain
#

nah what please

#

can u show me anything

#

how do you do the blank slots

#

wtf

#

what magic is this

#

how is that vanilla

lost matrix
#

I mean you need a resourcepack ofc

sacred mountain
#

well yes but

#

i'm guessing the whole backpack including icons is a gui animation

#

can u make custom textures depending on gui

granite owl
#

is this a tolerable wrapper? ```java
public static void registerCommand(@NonNull JavaPlugin plugin, @NonNull String command, @NonNull CommandExecutor executor)
{
plugin.getCommand(command).setExecutor(executor);

    if (executor instanceof Listener)
    {
        plugin.getServer().getPluginManager().registerEvents((Listener)executor, plugin);
    }
}
sacred mountain
#

yea

granite owl
#

what

dire marsh
#

this is great and all for developers

sacred mountain
#

didnt mean the nah

dire marsh
#

as long as you can draw lmao

sacred mountain
#

i was tryna type somewhere else

granite owl
#

yea to which xD

sacred mountain
#

its fine theres nothing wrong with it i dont think

granite owl
#

kk

sacred mountain
#

i would just put it in the main class and just use 'this'

#

because you wont need that anywhere else

#

unless you're registering during runtime

#

which isn't exactly something i think ur meant to do

granite owl
#
public class Utility
{
    public static void registerCommand(@NonNull JavaPlugin plugin, @NonNull String command, @NonNull CommandExecutor executor)
    {
        plugin.getCommand(command).setExecutor(executor);

        if (executor instanceof Listener)
        {
            plugin.getServer().getPluginManager().registerEvents((Listener)executor, plugin);
        }
    }
}
lost matrix
granite owl
#
public class CommandRank implements CommandExecutor, TabCompleter, Listener
{
    @EventHandler
    public void onPlayerChat(AsyncPlayerChatEvent event)
    {
        Bukkit.broadcastMessage("On Player Chat!");
    }

    @Override
    public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings)
    {
        Bukkit.broadcastMessage("On Command!");
        return false;
    }

    @Override
    public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] strings)
    {
        Bukkit.broadcastMessage("On Tab Complete");
        return null;
    }
}
#

like that?

sacred mountain
#

wait

#

is commandexecutor

#

an interface

granite owl
#

ya

sacred mountain
#

i cant remember shit

#

oh

lost matrix
#

You dont want to let your CommandExecutor also be a Listener

granite owl
#

i let it passivly inherit object

#

my class

sacred mountain
#

i would just register them individually and seperate them

sacred mountain
#

theres no point making a custom class

lost matrix
#

Everything inherits from Object

granite owl
#

im trying to figure how to sort all the stuff rn

#

in spigot in particular

sacred mountain
#

just add a commands package and a listeners package idk

lost matrix
# granite owl how so?

Single responsibility principle and separation of concerns.
You dont want a class to have multiple primary goals.

granite owl
#

so if i have a feature that say manages permissions as im writing my own system, and this feature also needs to say monitor the player chat to reformat it, how would i seperate these properly?

#

im currently just trying to get everything set up before i start working on it

lost matrix
#

Create a manager class which manages your data and pass it to your Listener

#

Let me show you an example from a plugin of mine

#

This is the listener which drives my whole GUI library.

#

This class has only one goal: Listen for events and pass them to places where they are needed

granite owl
#

so i create 2 classes and have them interact with each other

#

?

#

and register them independently

lost matrix
#

Yes. Usually you start with the logic in one class (your manager) without knowing from where it will be triggered.
Let me give you a concrete example.

granite owl
#

and the utility function would look like this i presume

#
    public static void registerCommand(@NonNull JavaPlugin plugin, @NonNull String command, @NonNull CommandExecutor executor, @Nullable Listener listener)
    {
        plugin.getCommand(command).setExecutor(executor);

        if (listener != null)
        {
            plugin.getServer().getPluginManager().registerEvents((Listener)executor, plugin);
        }
    }
river oracle
#

what are you doing here?

granite owl
#

im doing trying to figure how im supposed to organize my source code for spigot

river oracle
#

are you tryna do a GUI system?

orchid gazelle
#

hello! I want to move armorstands related to the player's direction. How do I calculate the correct x/z-direction based on the player direction + left/right?

lost matrix
# granite owl and the utility function would look like this i presume

Imagine you want to track blocks (simple example)

public class BlockDataManager {
  
  private final Set<Block> trackedBlocks = new HashSet<>();
  
  public void addTrackedBlock(Block block) {
    trackedBlocks.add(block);
  }
  
  public void removeTrackedBlock(Block block) {
    trackedBlocks.remove(block);
  }
  
}

First thing you do is implement logic to track blocks.
You dont know the trigger (and you also shouldnt need to know it)

Now we decide: Placed blocks are tracked and brocken blocks are untracked

public class BlockTrackListener implements Listener {

  private final BlockDataManager dataManager;

  public BlockTrackListener(BlockDataManager dataManager) {
    this.dataManager = dataManager;
  }

  @EventHandler
  public void onBlockBreak(BlockBreakEvent event) {
    dataManager.removeTrackedBlock(event.getBlock());
  }

  @EventHandler
  public void onBlockPlace(BlockPlaceEvent event) {
    dataManager.addTrackedBlock(event.getBlock());
  }

}
#

But later on we decide: I want to manually add tracked blocks through a command:

public class BlockCommand implements CommandExecutor {

  private final BlockDataManager dataManager;

  public BlockCommand(BlockDataManager dataManager) {
    this.dataManager = dataManager;
  }

  @Override
  public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
    if(!(sender instanceof Player player)) {
      return true;
    }
    Block block = player.getTargetBlockExact(32);
    dataManager.addTrackedBlock(block);
    return true;
  }
}
#

Then we can simply reuse the manager and track blocks manually by implementing a command which calls the managers methods

#

The same goes for when you want to expose an api for other plugins to track blocks in your plugin.
All you need to do is give them the BlockDataManager and boom, they can track blocks with their plugin

granite owl
#

right so i create 3 classes for my example, one manager, one command class and one listener class which both hold a reference to the same manager

lost matrix
#

Right

granite owl
#

and per javas way of handling things only when both class instances are GC'd the manager instance will get GC'd

lost matrix
#

The manager class implements the core logic.
Listeners and Commands are only used to trigger core logic. Not to implement too much logic themselves.

granite owl
#

i.e when the plugin is unloaded

orchid gazelle
orchid gazelle
#

wow

granite owl
#

xD idk man i forgot how to calculate the arc

orchid gazelle
#

xD

lost matrix
granite owl
#

🤣

orchid gazelle
#

well then I do not know what I need to move

#

with just the Vector lol

lost matrix
#

What do you want to move?

orchid gazelle
#

basicly a coordinate

#

if the player is for example looking into the Direction North, Left is z-(not really like that, just an example)

#

and Right would be z+

lost matrix
#
Location oldCoord = ...;
Vector playerDirection = player.getEyeLocation().getDirection();
Location newCoord = oldCoord.clone().add(playerDirection);
orchid gazelle
#

I do not want to use the actual direction, I want left/right of it

lost matrix
#

Or

Location oldCoord = ...;
double distance = ...;
Vector playerDirection = player.getEyeLocation().getDirection();
Location newCoord = oldCoord.clone().add(playerDirection.multiply(distance));
lost matrix
orchid gazelle
#

lol

lost matrix
#

Particles only spawn once and then disappear.
So you would schedule a repeated task which constantly spawns particles at the entities location.

orchid gazelle
lost matrix
jovial shadow
#

i understood that x y z

#

and left = x- and right = x+

#

also a random p?

orchid gazelle
#

P=Player

orchid gazelle
jovial shadow
#

bro

#

i have 5+ in art

#

european?

orchid gazelle
#

yes

jovial shadow
#

me italian

#

i figured u were european since u use numbers

orchid gazelle
#

Italy is like 2h away from me

lost matrix
#

You need to calculate a vector from your feet towards the entities
and then slowly traverse it in N steps. After that you spawn particles
on each step until you reach the target.

A vector C from A to B is calculated using
C = B - A

lost matrix
granite owl
#

@lost matrix so just to see if i got it first my manager ```java
public class ManagerRank
{
public ManagerRank()
{

}

public void foo(@NonNull String str)
{
    Bukkit.broadcastMessage(str);
}

}
then my command executorjava
public class CommandRank implements CommandExecutor, TabCompleter
{
private final ManagerRank m_manager;

public CommandRank(ManagerRank manager)
{
    this.m_manager = manager;
}

@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings)
{
    m_manager.foo("On Command!");
    return false;
}

@Override
public List<String> onTabComplete(CommandSender commandSender, Command command, String s, String[] strings)
{
    m_manager.foo("On Tab Complete");
    return null;
}

}
and then my event listenerjava
public class ListenerRank implements Listener
{
private final ManagerRank m_manager;

public ListenerRank(ManagerRank manager)
{
    this.m_manager = manager;
}

@EventHandler
public void onPlayerChat(AsyncPlayerChatEvent event)
{
    m_manager.foo("On Player Chat!");
}

}

jovial shadow
orchid gazelle
#

Germany

jovial shadow
orchid gazelle
#

xD

lost matrix
#
  1. Naming conventions:
    ManagerRank => RankManager
    m_manager => rankManager

Other than that it looks right.

jovial shadow
#

yas

#

look in the trivia channel xd

orchid gazelle
lost matrix
orchid gazelle
#

I do only have a direction and a vector in this example

lost matrix
# orchid gazelle how would I do that?

You should be able to figure out how to clamp a value to the nearest Nth part.
Hint: You only need to check the yaw and clamp it to the nearest value in [0, 360] {45}

orchid gazelle
#

alright then

jovial shadow
#

am i the only one that likes diarreha in here

mint nova
#

Anyone knows how to turn in ChatColor this $ idk symbol to &?

granite owl
#

ill keep it as modular as possible

mint nova
lost matrix
#

Then Rank needs to be a class ofc

jovial shadow
#

like man

#

how could u forget it

#

:(

#

THE CLASS!

granite owl
#

ill also disable the /op and /deop command and instead tie an attribute to the rank whether or not the bearer should have op

lost matrix
# mint nova how to use it propeyly
    String coloredText = "&cThis is red";
    String translated = ChatColor.translateAlternateColorCodes('&', coloredText);

But you can use any symbol you want

    String coloredText = "~cThis is red";
    String translated = ChatColor.translateAlternateColorCodes('~', coloredText);
lost matrix
jovial shadow
#

:(

granite owl
#

thats something ill tackle later though

lost matrix
#

Im currently mounting players with TextDisplay entities via packets.
Its kind of tricky but you are no longer bound to limitations like name length.

#

Example for this

granite owl
#

xD

#

then id still need to disable a players name though

#

which still requires packets

lost matrix
#

Mounting an entity hides its name automatically.

granite owl
#

hmmm

quaint mantle
lost matrix
#

But yeah naming through scoreboard teams might be more reliable

quaint mantle
#

Is a custom model id possible for a block? And if so would it persist if I were to place it and then rejoin the game?

quaint mantle
#

Is it possible to implement custom blocks with spigot?

granite owl
#

btw @lost matrix im gonna make my plugin dependent on a .dll / .so, can i if the file is not found disable the plugin like this? ```java
@Override
public void onEnable()
{
if (!IniParser.Initialize("../libraries/")) this.setEnabled(false);

    INIPARSER_MSG msg = new INIPARSER_MSG();
    try (IniParser parser = new IniParser(msg))
    {
        if (msg.m_msg == INIPARSER_ERROR)
        {
            throw new NullPointerException("Failed to allocate memory for IniParser");
        }

        //...
    }
    catch (Exception e)
    {
        //...
    }

    ManagerRank rank = new ManagerRank();
    Utility.registerCommand(this, "rank", new CommandRank(rank), new ListenerRank(rank));
}
orchid gazelle
#

so the direction fits to the right angle

#

I gotta round the vector I guess

sacred mountain
#

guys what units is setWalkSpeed() in

#

because the genericmovementspeed attribute default is 0.10000...f and the base walkspeed is 0.2f

#

the spigot one is in the range -1 to 1 but from what m/s values

warm mica
#

In java it is common to call classes e.g. IniParserMessage, with terms generally being fully spelled out

granite owl
warm mica
#

o ok

granite owl
#

sec

#

too many projects at once xD

rough drift
eternal oxide
#

you import into IDE then the IDE will have a convert option

#

or you write teh pom manually before importing

#

No clue using InteliJ

plucky pasture
#

how come every time I put my main constructor in another class I get an illegal argument exception because it's already initialized. I am trying to get a variable and config file should I just move that out of the main class and put it in another?

orchid gazelle
#
  1. You can only have 1 main constructor
  2. Spigot calls a plugin's onEnable on load, not main
young knoll
#

You can’t make an instance of your main class

#

?di

undone axleBOT
regal scaffold
#

Acf tryhards

#

Does acf have a built-in command confirmation system

ivory sleet
#

afaik no

#

but its like 7 lines of code at most

steady wasp
#

is there way to get text item id from itemstack?

young knoll
#

The namespaced key?

#

Material has a method for that

steady wasp
#

it not in 1.7.10

young knoll
#

Lol

ivory sleet
#

💀

young knoll
#

Good luck