#help-development

1 messages · Page 110 of 1

quaint mantle
#

yes ofcourse lol

drowsy helm
#

Only thing I csn think of

#

That looks like a vault log not spigot

fervent siren
#

idk why but on my server worldguard is bugging out ive denied pvp but people can still pvp even tho it says "Hey! Sorry, but you can't PvP here.
and ive disabled fall damage but people still take it

tardy delta
#

what kind of exception should i throw when calling a method on an object with an invalid state to give any meaningful impl to that method?

quaint mantle
tardy delta
#

IllegalStateException is like when the object has an invalid state, but it doesnt

drowsy helm
#

Which overload

hushed spindle
#

just getDrops()

drowsy helm
#

Pretty sure thats just if broken by hand

hushed spindle
#

yeah and thats intended

#

yet it returns a collection with two itemstacks, one expected itemstack and one as if it was broken with fortune

#

also judging by its random amounts

drowsy helm
#

Very strange

tardy delta
drowsy helm
#

What sre you trying to do with it

hushed spindle
#

i got like a skills plugin where im trying to multiply and judge exp based on the amount of drops

#

and with this extra unexpected itemstack people are getting way more crops and exp than intended

tardy delta
drowsy helm
#

Shot in the dark but have you tried getDrops(null)

hushed spindle
#

i could try that

#

gimme a minute

drowsy helm
#

Not sure if it would work though

hushed spindle
#

im not either but its worth a shot

onyx fjord
#

does anyone have tutorial how to make configurable recipes?

im talking something like this
"A": DIAMOND
"B": DIRT
shape:

  • "A A"
  • "BBB"
  • "BAB"
#

all i know there will be some looping going on

hushed spindle
#

yeah you're on the right track, where exactly are you struggling

hushed spindle
#

strange behaviour but im sure im doing something wrong

charred blaze
#

It is still white

onyx fjord
#

blah

drowsy helm
#

Yeah im not too sure then sorry

onyx fjord
#

i mean in code

#

smh

hushed spindle
#

i mean its exactly that

#

you got a list of 3 strings each 3 characters long

#

so you set the shape as list[0], list[1], list[2]

onyx fjord
#

so i do for row and for column loop?

drowsy helm
#

Just parse material and make it inti a shaped recipe

hushed spindle
#

a shaped recipe is essentially already defined by the parameters you got in your config

drowsy helm
#

Shaped recipe takes 3 strings

hushed spindle
#

so its really not as hard as you might think

onyx fjord
#

ima try something

#

there will be a big of safechecking no?

dreamy crypt
#

Do you guys know how to create a delay in a command?

onyx fjord
#

or its pretty flexible

drowsy helm
#

Yeah youd need some

onyx fjord
#

for example someone puts 2 rows

hushed spindle
dreamy crypt
#

Thanks

hushed spindle
#

i mean it depends on how you do it but you likely have to do some safechecking yeah

onyx fjord
#

tbh ima add it to my lib

#

will never have to go thru this again

hushed spindle
#

if you're doing it like i did with the list[0] list[1] etc. then list[2] would throw an error if your list is only 2 elements long

onyx fjord
#

isnt 2x2 valid shape tho?

hushed spindle
#

yeah it is

#

then you just have to do list[0], list[1]

onyx fjord
#

sword is 3 rows and 1 column

hushed spindle
#

leave the list[2] out which is where you do the safechecking

onyx fjord
#

mhm

#

i gotta figure out annotations too

#

cool kids use them

hushed spindle
#

i got a feeling you've overthinking it

#

shapedrecipes are pretty simple

onyx fjord
#

perhaps

hushed basin
#

Hello People!
I have an issue with a plugin called AuthMe on my server. Whenever a player reconnects twice without doing the /login they are sent back to spawn. I think this happens because AuthMe just pulls the coords from the player.dat. Could someone point me into the right direction of how I can fix this issue?

onyx fjord
#

ive had more stable moments in my life

hushed basin
#

no I mean from a code perspective

golden turret
#

How can I get the player target block? The LivingEntity#getTargetBlockExact returns null if the player is facing no block

hushed basin
#

I run an old AuthMe version so I wont get support from AuthMe people

golden turret
#

i dont want null

hushed spindle
#

then what do you want

onyx fjord
#

ig if its null return air 😂

drowsy helm
#

What do yoy want

hushed spindle
#

if the player isnt targeting anything what do you expect

quaint mantle
#

how to fix getOnlinePlayers?

hushed spindle
#

isn't it just getPlayers() now

drowsy helm
#

Is it?

#

Paper maybe

hushed spindle
#

i dunno lol

#

check why its deprecated

#

often times it'll suggest an updated alternative

golden turret
quaint mantle
golden turret
#

If he hits a block, it will teleport him to the block

#

if not, it will teleport him to the max distance

drowsy helm
#

And what fork

fervent siren
#

idk why but on my server worldguard is bugging out ive denied pvp but people can still pvp even tho it says "Hey! Sorry, but you can't PvP here.
and ive disabled fall damage but people still take it

quaint mantle
drowsy helm
#

Thats your problem

onyx fjord
quaint mantle
#

ok

quaint mantle
drowsy helm
#

Lol there ya go

onyx fjord
hushed spindle
#

you could try getLineOfSight and use the last block

#

@golden turret

quaint mantle
#

if don't know

hushed spindle
#

the only mistake is using 1.7.10 tbh

#

why are you using that version anyway

quaint mantle
hushed spindle
#

then use 1.19?

#

you're using an old api right now, you cant update to newer versions on an old api

quaint mantle
hushed spindle
#

you use old apis to make plugins for old versions

#

you want the plugin to the latest version

#

that is 1.19 yes

#

or am i mistaken

quaint mantle
tardy delta
#

copilot ahaha

hushed spindle
#

then you shouldnt use the 1.7.10 api

tardy delta
#

have tbh but i maybe needed it once

onyx fjord
#

i guess

#

change spigot api version

#

and change what errors

#

or got deprecated

#

spoiler: a lot

round finch
#

is copilot good?

#

and is it intellij?

hushed spindle
#

yeah updating plugins to such a newer version isnt gonna be easy

#

most likely

#

unless its a super simple baby plugin

round finch
#

i hate how i'm forced to learn intellij

#

😵‍💫

onyx fjord
#

how does instancing work

#

like wen is my class instance of another one

tardy delta
hushed spindle
tardy delta
hushed spindle
#

if you make an interface with a certain method and you have one of your classes inherit said interface, your class will be an instance of that interface

round finch
onyx fjord
#

but mah custom class cannot implement player for example

hushed spindle
#

why would you want that anyway

round finch
#

why coin flip needed in crypto coins

tardy delta
#

kacper instanceof Danger

onyx fjord
tardy delta
#

whatever that means

onyx fjord
#

its his wife...

hushed spindle
#

waltuh

onyx fjord
#

put ur d away waltuh...

round finch
hushed spindle
#

put your abstraction away waltuh

#

i dont wanna deal with polymorphism right now waltuh

onyx fjord
#

it all sounds like buzzwords

hushed spindle
#

kinda is

onyx fjord
#

ye i think i looked up wrong polymorphism

tardy delta
#

i always forget what they mean but i know how they work lol

onyx fjord
#

i made records without knowing

tardy delta
#

i mean people learn what words mean but dont know how to apply them 🤔

onyx fjord
#

its called records

#

or DI

hushed spindle
#

it just means something like an abstract class can have multiple implementations

onyx fjord
#

i didnt know i do DI but i do

hushed spindle
#

hence the poly

tardy delta
#

records and di doesnt have anything to do with eo

onyx fjord
#

foobar

tardy delta
#

im gonna slab you with that

round finch
dire marsh
#

guys i found jabba

charred blaze
#

Its not working still

onyx fjord
#

extending is super isnt it

round finch
charred blaze
tardy delta
#

super() calls superclass constructor yes

round finch
#

add jabba to minecraft

#

:)

tardy delta
#

better way to advance two nodes in a linkedlist where nodes can be null?

hushed spindle
#

crikey

quiet hearth
#

how can I listen to packets from a certain player only with protocollib?

echo basalt
#

well

#

PacketEvent provides a player

#

so just filter it out

quiet hearth
#

is it a protocollib limitation

#

if so is there a tutorial for packet handling or another api that lets you do that

#

considering its possible i guess hopefuly

#

it realy should be

echo basalt
#

I mean

#

just like bukkit

#

how do you listen to a bukkit event only for a certain player?

#

You have a PacketEvent#getPlayer

#

so what's the problem

quiet hearth
#

I have something like an intro in my server, listen to move events and such
but every player goes through it only once
i want to unlisten to event afterwards

echo basalt
#

just have a set of uuids or something

quiet hearth
#

I currently do

#

but performance

echo basalt
#

It's negligible

arctic moth
#

Also ew who uses else

tardy delta
quiet hearth
quaint mantle
echo basalt
#

HashSet#contains is like O(1)

quiet hearth
echo basalt
#

and packet events are mostly done async regardless

arctic moth
quaint mantle
echo basalt
#

They work in different ways

arctic moth
tender shard
echo basalt
#

HashSet is literally a HashMap<T, Object> where the object is a constant

#

so you have node objects and all

#

but it uses hashing for queries and all

golden turret
#

which particle is used for the enderman?

rigid drum
# echo basalt so you have node objects and all

yeah it's less memory efficient in some ways. it cannot be forgotten that arraylists double in size when they run out of space so they can be up to 50% inefficient in that regard.
But the meaningful memory based difference is that the array has excellent spatial locality so iteration is much faster than a linked list (and so as a result also the linked nodes of a hashmap)

heady spruce
#

I've a question. Would it be good if I make a class called Kit and just every class that is a kit extends it? (The Kits have all an custom ability etc)

echo basalt
#

oh damn exerosis is here

rigid drum
#

Once in a while yeah

echo basalt
#

I remember you helped me when I started codin plugins

eternal night
#

just here to trash linked lists 😭

echo basalt
#

linkedlists are useful on that one time

#

in a million

#

that you want to actually use it as a dequeue / list

rigid drum
#

It is true that I rarely used linked lists, when I do make them I generally just make my own nodes.

echo basalt
#

I think I only used a linkedlist like once

#

where it was the best choice

#

instead of just the most convenient

#

think it was like a size-limited transaction log

rigid drum
#

I don't even know when it's most convenient, arraydeqeue has similar level of convivence. Queues tend to be blocking/concurrent/channel

echo basalt
#

where I'd poll the last element and add the first in type deal

#

so I'd have to shift every single node by 1 element, if it was an array

#

but with linkedlists it was simple, just remove the last and add the first

rigid drum
#

Oh well certainly they perform better when you are adding elements to the middle

#

but when you add to the end and remove from the start you might be tempted to just use a ring buffer, since you don't need to reallocate a fixed sized data structure like that.

echo basalt
#

listen man I'm just an amateur developer no need to micro-optimize everything for a 20$ commission

rigid drum
#

True, which is why linkedlist is fairly useless lol

echo basalt
#

it has convenience as a queue/deque with a get(index) method

#

pretty sure that's another reason why I didn't use arraydeque

#

the get(index) part was useful for something

rigid drum
#

get(index) is O(n) on linkedlist tho

#

and it's O(1) with ArrayDeque

echo basalt
#

doesn't bother me much

#

ArrayDeque doesn't have a get

tardy delta
#

made a boundedbuffer which overwrites old elements hehe

echo basalt
#

do I really want to waste an hour thinking of the best data structure for a transaction log limited to like 30 elements

tranquil stump
echo basalt
#

just to fuck with people

#

like make a custom helmet or something and spin the yaw really fast

#

maybe go beyond 20tps

tardy delta
heady spruce
#

I've got a question. Would it be good if I make a class called Kit and just every class that is a kit extends it? (The Kits have all an custom ability etc)

echo basalt
#

abstract class or interface yeah

rigid drum
echo basalt
#

reminds me of the time I was optimizng Math#abs to not use any ternary or If statements

quiet hearth
#

I need to know to stop doing that

echo basalt
#

🤦

tardy delta
#

i hate myself

#

this whole idea of working with operator priority just sucks

quiet hearth
echo basalt
#

Basically

eternal oxide
echo basalt
#

it's very negligible

#

you can run trillions of if statements per second

echo basalt
#

I just happen to be a little shit and like to challenge myself

tardy delta
#

only thing i did today was fixing some bugs and a stackoverflow 🤡

eternal oxide
#

who needs 1 plus one anyway. Its overrated

tardy delta
#

seems like i broke the whole thing now

#

1+1 worked before 🤡

torpid sapphire
#

who needs math anyway

eternal oxide
#

back to counting on your fingers

tardy delta
#

kids that are too lazy to do their homework

tender shard
#

also why does the dude look like a sausage

echo basalt
#

the thumbs up at the intro is the funny stuff

tardy delta
#

youre a sausage

#

german sausage

echo basalt
#

pov: compliment

tender shard
#

also ugh

#

why does this dude use a piece of paper as mousepad

hushed spindle
#

idk

#

i dont think its that noteworthy

#

:))))

tardy delta
#

hmm multiplying bigdecimals should not give those weird floating point issues right?

#

im wondering what the overhead is with using a BigDecimal instead of a double

hasty prawn
#

I still don't understand why you're not converting it from infix to RPN and then evaluating RPN

#

@tardy delta

tardy delta
#

infix, rpn? whaaat

hasty prawn
#

Maybe I'm mis-understanding what you're trying to do... but if you're trying to evaluate things like ((1 + 9) * 6), thats what you should be doing.

tardy delta
#

ah rpn i know

#

just wanted to create smth that can parse readable strings

hasty prawn
#

infix is the regular expression format you're probably writing in

tardy delta
#

yes

hasty prawn
#

Yeah, if you convert it to RPN then evaluating it while following order of operations is extremely easy with a stack

arctic moth
arctic moth
#

I bet it would be entirely possible with nms though and I wouldn't need to use blender

hasty prawn
#

You made that video?

arctic moth
#

Yes

#

The Steve thing is also a shader

hasty prawn
#

That's really cool and I hate you at the same time

#

Because thats cursed af

arctic moth
#

That's the point

hasty prawn
#

You succeeded

arctic moth
#

Just repeating that bc of reaction

tardy delta
#

lol

arctic moth
#

Should I remake it in fabric and make it actually playable rather than just for a video

tardy delta
#

that would be cursed asf

arctic moth
#

Good

tardy delta
#

?services

undone axleBOT
small current
#

was there any 1.8 pvp option in the new spigot versions ?

red sedge
#

How would i go about loading a 3d model in a way that i can spawn it inside the world

arctic moth
#

I've been solo carrying an entire smp bc the owner was too lazy to hire anyone else

tulip owl
#

(Maven)

So I just built my plugin without changing anything relating to Maven and it errors with

[ERROR] Malformed \uxxxx encoding.

According to stack overflow I need to delete all the files containing \uxxxx in my .m2 directory but upon doing that the error reoccurs.

sturdy frigate
#

My name has been changed on the spigot forums, how do i make it reflect here?

young knoll
#

Talk to one of the staff

golden turret
#

How can I trace a ray using the player rotation? The World#rayTrace returns null if it does not hit anything. I would like something like world.rayTrace(location, direction, distance).getHitPosition()

young knoll
#

Can’t you just pass the players look vector

golden turret
#

wdym

young knoll
#

You want to raytrace using the players rotation

#

So pass their look vector into the rayTrace method

golden turret
#

yes but it returns null if does not hit anything

#

so I cant .getHitPosition

young knoll
#

Ah

golden turret
young knoll
#

If you just want to get what’s X blocks in the players looking direction you can just do some vector math

golden turret
#

how can i do this

young knoll
#

Iirc you just multiply it

strong parcel
#

Is there a list anywhere of what types of trees are naturally generated in each biome?

golden turret
#

I would like the world.rayTrace behaviour

#

so I could use the getHitPosition

red sedge
#

eeeeee does anyone know a library that cna convert a blockbench/magicavoxel model into like an array of voxels

void isle
red sedge
#

so i can spawn blocks according to the voxels

golden turret
red sedge
#

im seriously gonna cyr

young knoll
#

Afaik all rayTrace methods will return null if they don’t hit anything

ancient plank
#

Who'd have thought

mighty aurora
#

Quick question. I have been trying to add a dependency to my plugin in my plugin.yml. For some reason though anytime I compile the plugin it doesn't have the dependency.

young knoll
#

What are you compiling with

opal oasis
#

does anyone know how to replace a material's underscore with nothing? i am trying to make a /give command. and i am using material.getmaterial

mighty aurora
#

I have tried clean package

#

and I have tried reinstalling maven

young knoll
#

Have you tried running clean t- welp

ancient plank
#

plugin.yml

mighty aurora
#

?

hasty prawn
#

I've somehow created a set that has duplicate values

mighty aurora
hasty prawn
#

This is what's printing, this.getObject() is Gson's JsonObject and keySet should return a Set<String> of all it's keys, which obviously shouldn't ever contain duplicate values

#

But it does... Susge

granite burrow
#

Bump

bright flax
# void isle upp

Did you shade the driver library into your plugin or include it under libraries in your plugin.yml?

void isle
#

i add it to my pom it's that ?

bright flax
void isle
#

yes

bright flax
void isle
#

ty !

mighty aurora
bright flax
mighty aurora
#

ProtocolLib

bright flax
#

Unsure if you ProtocolLib allows to be used inside another plugin, but;

In your pom.xml make sure you have shading setup and remove scope as provided from ProtocolLib (if set)

young knoll
#

Read the issue again

#

It’s about it not staying in the plugin.yml

bright flax
#

or a failure at locating it

mighty aurora
#

Well everything else is properly saved and compilled each time

#

its only the depend line that is missing each and every time

kindred valley
#

Can someone explain why states are snapshots?

kindred valley
bright flax
wise mesa
#

is there an event or something for when a player has fully loaded in

#

like they've generated terrain and stuff

young knoll
#

Don’t think so

mighty aurora
#

Thats my plugin.yml

#

if you need the physical file I can send that too

wise mesa
#

so im using the player join event and setting a task for 1 tick later where it sets the players resource pack

#

issue is the first time the player joins after startup the resource pack fails

#

it gives this message

#

one sec

opal oasis
#

does anyone know how to replace a material's underscore with nothing? i am trying to make a /give command. and i am using material.getmaterial

wise mesa
arctic moth
wise mesa
#

i am forcing the resource pack

arctic moth
wise mesa
#

no but the thing is

arctic moth
#

did you put a pack.mcmeta

wise mesa
#

if you hit disconnect and then rejoin

#

it works

mighty aurora
wise mesa
#

the pack works fine

#

it just doesn't work the first time you join the server

wise mesa
#

the second time it loads properly

#

loads perfectly fine the second time

#

why isn't it working the first time?????

#

wait let me try something

bright flax
mighty aurora
onyx fjord
#

can i make falling block break when touching ground somehow?

ancient plank
#

Sure

#

?jd-s

undone axleBOT
onyx fjord
#

deez?

young knoll
#

EntityChangeBlockEvent

kindred valley
obsidian drift
#

Any idea how I can get an entity move a specific amount of blocks forward?

wise mesa
#

ok yea still not working

#

ok i added a 5 second delay with run task later

#

so it definitely didn't run until after my chunks loaded in

#

i still got the same problem though

dire marsh
#

@wise mesa 1.19.2?

wise mesa
#

yes

#

it's so weird that it works the second time though

dire marsh
#

It's a bug that has been introduced

wise mesa
#

ah

#

that explains a lot

dire marsh
#

Mojang fixed bug MC-252082

#

but this creates another bug

#

which is what you are experiencing

wise mesa
#

is the new bug on jira

mighty aurora
#

Does anyone know why a part of a plugin wouldn't be compiled into the end .jar file? as in a specific part of a file? I'm asking because in my plugin.yml in my IDE I have a line that lists my dependencies my plugin needs. Upon compiling the jar and opening it however the plugin.yml file no longer contains the dependency line

wise mesa
#

are you using maven

mighty aurora
#

yea

wise mesa
#

also your plugin.yml isn't compiled its just copied

#

anyways maven clean

mighty aurora
#

I've done that 6 times

dire marsh
wise mesa
#

this is an edge case?

dire marsh
#

afaik it only happens if you don't change the url

wise mesa
#

ohhh

#

interesting

#

yea I regenerate my resource pack every time the server loads

#

guess i could add a random string to the end of the file

dire marsh
#

I'm unsure on that you'd have to check

#

the worst part is the client doesn't send a failed status

#

it sends success instead

wise mesa
#

now that seems like a bug

dire marsh
#

Only "workaround" I've found so far is to check how fast the success status is sent between loading status, because realistically a resourcepack takes at least 1 second to send success status even if it's the smallest one

#

so just resend it if it's too fast xd

wise mesa
#

how do I check the success status

#

is there an event or do i need packets

dire marsh
#

PlayerResourcePackStatusEvent

wise mesa
#

ah thanks

rocky pond
#

any idea how to open a demo troll to a player?

dire marsh
#

Player#showDemoScreen

wise mesa
#

?jd

rocky pond
dire marsh
#

very descriptive and helpful

quaint mantle
#

help my plugin is not working

dire marsh
#

also very descriptive and helpful...

wise mesa
#

people are very helpful today

#

well sam you've actually been incredibly helpful thank you so much

rocky pond
hasty prawn
#

@rocky pond You'll have to find the obfuscated names for this

quaint mantle
#

what do i do when couldn't pass event PlayerInteractEvent

young knoll
#

You read the stack trace

dire marsh
#

don't use 1.8 without knowing what you're doing 👀

rocky pond
quaint mantle
#

couldn't pass event PlayerInteractEvent

dire marsh
rocky pond
#

thanks

wise mesa
dire marsh
#

yep

wise mesa
#

i love whoever made it

quaint mantle
#

HELP PLS

wise mesa
#

hey we're all just a bunch of developers who are here to get help and help others

#

we're not paid

#

we aren't support

#

if we know how to help we will

obsidian drift
#

Anyone know what could be wrong with this? I am trying to move the pig to a specific set of coordinates and b seems to be returning false and nothing happens.

                Pig pig = (Pig) player.getWorld().spawnEntity(player.getLocation(), EntityType.PIG);
                pig.setAI(false);

                Bukkit.getScheduler().scheduleSyncDelayedTask(TowerDefence.getInstance(), () -> {
                        boolean b = ((CraftPig) pig).getHandle().getNavigation().moveTo(5, 70, 18, 1);
                        Bukkit.broadcastMessage("b is: " + b);
                }, 40L);
kindred valley
obsidian drift
hasty prawn
quaint mantle
#
    @EventHandler
    public void onInteract(PlayerInteractEvent e) throws InterruptedException {
        if (e.getAction().equals(Action.RIGHT_CLICK_AIR) || e.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
            if (e.getPlayer().getInventory().getItemInMainHand() != null) {
                if (e.getPlayer().getInventory().getItemInMainHand().equals(creativewand)) {
                    e.getPlayer().getInventory().remove(creativewand);
                    e.getPlayer().setGameMode(GameMode.CREATIVE);
                    wait(300);
                    e.getPlayer().setGameMode(GameMode.SURVIVAL);
                }
            }
        }
    }

anyone knows how to fix it? it's not working

obsidian drift
river oracle
young knoll
#

Sleeping the main thread

young knoll
#

Don’t do that

#

?scheduling

undone axleBOT
#

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

vocal cloud
#

They don't cancel the event and that's what screws them lol

river oracle
#

Thead.sleep on main thread trust me bro

vocal cloud
#

Whenever TRAP is thrown that's the issue

kindred valley
river oracle
quaint mantle
kindred valley
river oracle
vocal cloud
kindred valley
vocal cloud
river oracle
#

your question, doesn't make sense but someone there could prob help you

kindred valley
river oracle
#

:P

quaint mantle
#

im new to this

river oracle
#

good luck mate I highly doubt anyone here is willing to support code that old if you do find someone porting backwards is hard as hell. Don't forget 1.8 is over 7 years old at this point

kindred valley
vocal cloud
void isle
eternal night
#

That would do it yes

quaint mantle
eternal night
#

Tho note that feature is only 1.16.6 or higher

#

.5 or higher XD

wise mesa
#

i am actually so glad they added that libraries feature to plugin.yml

vocal cloud
wise mesa
#

i will (hopefully) never shade again

eternal night
#

The library feature is pretty meh NGL

wise mesa
#

shading was just so annoying

eternal night
#

Downloading from maven central breaks their TOS

wise mesa
#

and now i don't have to do it

river oracle
#

use player UUID not name

#

also if its giving you errors don't use it

wise mesa
#

all we need is for aikar to put ACF in maven central and then we won't need to shade that

river oracle
#

names can change

#

uuid's don't

vocal cloud
river oracle
#

simply put you are always running a risk with names though it may be small that player data gets fucked

hasty prawn
wise mesa
#

oh but he's on 1.8 things were different then

hasty prawn
#

?scheduling

undone axleBOT
quaint mantle
river oracle
#

again my point above though its a small chance you still run the risk of having issues

wise mesa
#

see the above link

river oracle
#

on top of UUIDs just being a standard good practice

hasty prawn
wise mesa
quaint mantle
#

ok ty

hasty prawn
#

Yeah get rid of that

quaint mantle
#

ill try

wise mesa
#

wait pauses the whole server

river oracle
#

don't stop main thread :)

kindred valley
wise mesa
#

the scheduler let's you tell the server to run some code on a tick in the future

wise mesa
river oracle
#

I've never stalled main thread always seemed illogical to me to stop what the entire server was running on

quaint mantle
hasty prawn
#

No

#

?scheduling

undone axleBOT
hasty prawn
#

That ^

kindred valley
river oracle
#

let that sink in

#

when you wait 300 miliseconds the entire server is stopping for 300 miliseconds

mighty aurora
#

I have very little knowledge when it comes to packets. I'm currently trying to use ProtocolLib so that I can attempt to make an invisibility thing that will do what hypixels invisibility(in bedwars) does(which is make the player and player's armor invisible). I know I need to be listening for the Entity_Equipment packet but I know basically nothing more on how to edit the packet or change it so that the player will be completely invisible when I turn them invisible.

river oracle
#

no chests can be open no blocks can be broken for 300 miliseconds

hasty prawn
#

I don't think they're trolling they're just new, and there's nothing wrong with that

wise mesa
wise mesa
#

i went from scratch straight to spigot

#

not my best move

river oracle
#

Well I suppose I shouldn't use my starting bar as that for others because all learn at a different pace

wise mesa
#

lol

river oracle
#

While my first plugin was a mess it was still fine enough to sell 🤷‍♂️

wise mesa
#

is it possible to get the current tick the server is on

#

or does it not count those

hasty prawn
#

I just try not to discourage others who are starting to learn by making fun of them for silly mistakes, it's gonna happen and that's okay

kindred valley
hasty prawn
#

It's all a learning process PeepoShrug

wise mesa
#

hmm

#

let me check

river oracle
#

I've been programming for 1 year now been very fun I like making stuff

wise mesa
river oracle
#

I don't think he's targeting you specifically mate

onyx fjord
hasty prawn
wise mesa
#

so like in other games

kindred valley
wise mesa
#

for example tf2

#

they have a running counter of the current tick

#

when the server starts it is on 1 and it just goes up forever

wise mesa
#

i was wondering if minecraft had something like that

kindred valley
river oracle
kindred valley
#

Whats your level

onyx fjord
#

Player#hidePlayer
@mighty aurora

river oracle
#

idk 🤷‍♂️

wise mesa
#

it must've been around early 2019

wise mesa
river oracle
mighty aurora
kindred valley
#

Man its 1.5 years for me and he is fucking better than me

river oracle
#

Everyone learns at a different pace

kindred valley
river oracle
#

only thing that has kept me in it for this recent burst is my job I got for a server

#

I took a 5 month break from coding in general though thats my longest

onyx fjord
#

you want invisible player to see their armor?

mighty aurora
#

I don't really care if the player sees their armor or not.

kindred valley
toxic reef
#

Hello can anyone help me? I would like to have a explosion of "blocks" as "animation". Sorta like the hypixel partypopper gadget. How do create these entities?

mighty aurora
onyx fjord
river oracle
onyx fjord
#

tho i dont use plib, but packetevents

#

does it matter to you?

river oracle
#

PacketEvents on top

mighty aurora
river oracle
#

never used it but looks better lol

mighty aurora
#

Cause this is for 1.19

onyx fjord
#

PE is 1.7+

#

hehe

#

and you can shade it

#

ill take that as a yes

mighty aurora
#

I use maven

onyx fjord
#

shouldnt make a difference at all

wise mesa
#

@dire marsh should i look at the difference in time between sending the resource pack and successfully_loaded or between accepted and successfully_loaded

onyx fjord
#

@alpine urchin i give u free promo

wise mesa
#

what are the benefits of packetevents over protocollib

echo basalt
#

less abstraction

dusk flicker
#

I believe its just a lot simpler to use

#

Haven't had a reason to use it yet, but retrooper is good so I know it's a good resource

dire marsh
wise mesa
#

ok thanks so much

obsidian drift
#

Is there an event for when an entity starts to move to another location?

dire marsh
severe oracle
#

hi, how do i make a custom dimension using spigot api ?

river oracle
#

I... dont' think you can technically speaking

#

I mean you could modify generation to the point where it kinda acts like acustom dimension but there is only so much you can do

#

idk if you can change sky textures withuot affecting the rest of the worlds though that'd be something interesting to check into

sage dragon
#

Is there any bukkit method which allows me to check if it can rain/snow in a specific biome?

#

Just checking before I just make a switch case

severe oracle
#

i have a world folder and i want minecraft to load that folder as dim

sage dragon
severe oak
#

I'm pretty sure weather is handled on the client side with the server providing when its raining and how long.

golden turret
#

I am trying to set a creeper as a passenger of a snowball but it is not working. It works for a very small time then the creeper despawns. Any ideas?

sage dragon
golden turret
sage dragon
severe oak
#

mb

river oracle
sage dragon
river oracle
#

usually i just opt for a bungee setup rather than mess around with stuff like that

#

Generally I'd point you to looking at how multi-verse themselves do it as they are open sourced

severe oak
#
@EventHandler
    public void onPLE(ProjectileLaunchEvent event) {
        Creeper creeper = event.getEntity().getWorld().spawn(event.getEntity().getLocation(), Creeper.class);
        event.getEntity().addPassenger(creeper);
    }
river oracle
#

lol thats funny

#

creeper throw

mighty pier
#

/command argument argument how do i get all the arguments as a string like argument argument

golden turret
severe oak
#

lel

onyx fjord
#

what should i use instead

river oracle
onyx fjord
#

it wants string

river oracle
onyx fjord
#

not int

river oracle
#

well yea whgy would you use magic values for getting an entity

#

seems rediculous

onyx fjord
#

thats all i got

#

packets

#

¯_(ツ)_/¯

river oracle
#

where are you getting these magic nubmers from

onyx fjord
#

packet wrapper

river oracle
#

you can just use the deprecated class and ignore the warning it doesn't explicitly say its deprecated for removal

onyx fjord
#

bet

river oracle
#

probably just a warning like there is a better way to do this

#

so do it that way

#

if its ever removed you can just map it yourself

rough drift
quiet ice
#

?stash

undone axleBOT
mighty pier
#

ty

golden turret
quiet ice
# onyx fjord bet

You probably need to referr to either the packet wrapper or the NMS entity registry

rough drift
river oracle
#

huh

#

wdym not possible

quiet ice
#

It's a no-brainer that post 1.13 entities have no stable ID

#

The only ID that they have is the packet/registry ID

#

Bukkit however will refuse to provide those IDs

golden turret
#

The PlayerInteractAtEntityEvent is called before PlayerInteractEvent. I have an object with a rightClick method and it is being called twice. How can I make this be called only 1 time?

red sedge
#

I have an int array that contains values like
0x00000000, 0xFFFFFFFF, 0xFFCCFFFF, 0xFF99FFFF, 0xFF66FFFF, 0xFF33FFFF
But when I get a value from it
it gives me the integer value, which makes snese
but how would I make it like this again

quiet ice
#

Integer#toHexString

red sedge
#

Thanks sm!

smoky anchor
#

Hello. How do I make FallingBlock entities deal damage?
I tried setting setHurtEntities to true but I believe I have to set the tag FallHurtAmount to non-zero value as well to deal damage. But I have not found a function that does this.

iron glade
#

Is stuff like a plus symbol allowed in command args?

dusk flicker
#

dont think anything about command arguments are restricted

iron glade
#

alright thanks

mellow pebble
#

i get error "java.lang.NoSuchFieldError: SKELETON_SKULL"

#

also for PLAYER_HEAD

vocal cloud
#

Wrong API version to server version?

mellow pebble
#

wdym ?

vocal cloud
#

What version is the server running and what version of the API is the plugin using

mellow pebble
#

and my api was 1.19.2

#

now is 1.8.8

#

now i cant even compile it

#

😦

vocal cloud
#

Yup

mellow pebble
#

im such a silly boy

#

now it says it cant find smybol

vocal cloud
#

Yup

mellow pebble
#

whys that

vocal cloud
#

Cause they didn't exist in that version

quiet ice
#

The API in 1.19 is MUCH MUCH different than to the API in 1.8.8

mellow pebble
#

well im not really sure

#

like

quiet ice
#

half the API is not present in 1.8.8 - correct

mellow pebble
#

this is not possible in 1.8.8 ?

quiet ice
#

Yes

mellow pebble
#

then what should i use

quiet ice
#

magic values

mellow pebble
#

i normally use this way

quiet ice
#

new ItemStack(Material.HEAD, 1, (byte) 7 /* What exact value you want I cannot say */); or something like that

#

Actually

#

You'll want new ItemStack(Material.SKULL_ITEM, 1, (byte) 7 /* What exact value you want I cannot say */);

mellow pebble
#

do i really have to put damage

#

or can i just null it

mellow pebble
#

what am i doing wrong why cant i set name of item in itemMeta

dusk flicker
#

not resetting the meta

#

item.setItemMeta(itemMeta);

#

smth along that lines

mellow pebble
stone dust
#

Hello! I cant seem to understand how to make this messy pile of code work, so i am going here in search of answers :P
What i am trying to do: i would like to convert a SQL string into a Location value.
My code: public static Location getMinP(Integer id) throws SQLException { String min = String.valueOf(DB.getFirstRow("SELECT minP FROM event_regionsWHEREid` = '" + id + "';"));
String string1 = min.substring(min.indexOf("=") + 1);
String string2 = string1.replaceAll("[{}]","");
String string3 = string2.replaceAll("(0[.]0)","");

    String[] split = string3.split(" ");
    return new Location(Bukkit.getWorld(split[0]), Double.parseDouble(split[1]), Double.parseDouble(split[2]), Double.parseDouble(split[3]));
}`

I'm sorry if i made you puke because of my horrible code, but i am learning, and trying to perfect my craft :P

Thanks in advance ❤️

EDIT: Code copied to hastebin https://hastebin.com/ewataxesac.php
EDIT EDIT: Code copied to md-5 paste https://paste.md-5.net/kazilodegi.js

undone axleBOT
mellow pebble
#

pls

flint coyote
#

It's on hastebin

young knoll
#

Why are you storing the location as a string

flint coyote
#

What is the type of 'DB'?

stone dust
#

AikarDB - IDB

#

I use MySQL for storing

flint coyote
#

Never heard of AikarDB :/

stone dust
#

Haha, im not blaming you :P

young knoll
#

I believe it’s a library

flint coyote
#

can't even find that on google

stone dust
flint coyote
#

ah I see

kind hatch
#

How did I know it was related to ACF.

stone dust
#

Yes, that is kind of annoying

#

But it does have an API documentation

flint coyote
#

Alright so what does DB.getFirstRow() return? What type?

#

Would take that from the javadoc but since it doesn't exist... ^^

stone dust
#

Can have a look

#

One minute

flint coyote
#

Yeah just hover over it and your IDE will tell ya :)

#

I would guess it returns an object of type "DbRow" based on the api documentation - just making sure.

stone dust
#

Cant you send images in here?

flint coyote
#

only after you are verified

stone dust
flint coyote
#

?verify

#

hm not a command I guess xD

stone dust
#

?verify

young knoll
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

flint coyote
#

ah ty

stone dust
#

!verify superkrokodilen

undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

stone dust
#

There you go :)

flint coyote
#

Alright. In that case

DB.getFirstRow("SELECT minP FROM event_regions WHERE id = '" + id + "';").getString("minP");

might work

stone dust
#

Right now it by itself gives {minP=EventHub 51.0 11.0 13.0 0.0 0.0}

young knoll
#

Use the methods in DBRow

flint coyote
#

yeah because you get a DbRow. Try calling getString with "minP" on it

young knoll
#

Rather than turning it into a string

willow stream
#
final String message = getString(path).replace("%prefix%", getPrefix());
message.replace("%player%", playerName);

Result of 'String.replace()' is ignored

#

Can someone tell me why?

iron glade
#

message = message.replace I think

willow stream
#

I mean it gets the message from final String message and just replaces again, why would that be ignored

sly depot
#

I'm trying to change Chuck's biome beforebe generated - 1.8.8

@Override
    public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
        world.setBiome(chunkX, chunkZ, Biome.PLAINS);

world.setBiome is not working

iron glade
stone dust
# flint coyote Alright. In that case ```java DB.getFirstRow("SELECT minP FROM event_regions WH...

I cant get that to work, unfortunatly.
For my test the first one works, while the other one doesnt
First: public static String test(Integer id) throws SQLException { String min = String.valueOf(DB.getFirstRow("SELECT minP FROM event_regionsWHEREid= '" + id + "';")); return min; }
Other: public static String test(Integer id) throws SQLException { String min = DB.getFirstRow("SELECT minP FROM event_regions WHERE id = '" + id + "';").getString("minP"); return min; }

I'm sorry if this is the silliest problem, but would really help out if i got this sorted :)

willow stream
#
public String colorize(final String path, final String teamTag, final String playerName, final String state, final Time time, final String reason) {
  final String message = getString(path).replace("%prefix%", getPrefix());
  if (playerName != null) message.replace("%player%", playerName);
  if (teamTag != null) message.replace("%teamTag%", teamTag);
  if (state != null) message.replace("%state%", state);
  if (time != null) message.replace("%time%", time.toString());
  return ChatColor.translateAlternateColorCodes('&', message);
}
kind hatch
young knoll
#

Strings are immutable

willow stream
#

I'm a visual person and a beginner, if I don't lay it out I can't figure out how to do it correctly. 🤣

#

Is someone free to explain that on my example?

#

Okay I understand now.

iron glade
flint coyote
willow stream
#

I'm just trying stuff in vain. I want to make optional parameters for my Messages#colorize() and Logger#send() methods.

#

I use Spigot#sendMessage() inside of my Logger#send() method.

vocal cloud
#

You can always make a method but idk it looks like a lot of work for something you don't need

willow stream
stone dust
mighty aurora
#
``` If I have this if statement(disregard the missing } I only need to verify one piece of this)will it run if the packet is correct and the player has only one of the two tags?(sorry if this seems like common sense I just need a sanity check) Basically will it run if the packet is correct and the player has either of the tags or did I put it in wrong
vocal cloud
iron glade
#

you have to copy the packetType() == to the other side of ||

young knoll
#

Add some extra brackets

#

if (a && (b || c))

willow stream
#

Is that even possible?

vocal cloud
#

Whenever you notice that you're doing a lot of repetition in code you can probably extract it into a function

arctic moth
vocal cloud
#

to me this looks like that code could be condensed into 50% of what it is

arctic moth
#

lightning spam was happening in chunks where they were unloaded

#

so every time i loaded a chunk thousands of lightning strikes would occur instantly

sly depot
#

I'm trying to change Chuck's biome beforebe generated - 1.8.8

@Override
    public ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
        world.setBiome(chunkX, chunkZ, Biome.PLAINS);

world.setBiome is not working

young knoll
#

Pretty sure you gotta change it in the ChunkData

arctic moth
#

if you want the pvp, use 1.19 + viarewind and oldpvpmechanics or whatever its called

sly depot
young knoll
#

Well I doubt you can edit a chunk from the world if it hasn't been generated yet

desert frigate
#

im pretty new to java, whats the differences between runTaskTimerAsynchronously and runTaskTimer?

remote swallow
#

runTaskTimer runs on main thread and runTaskTimerAsynchronously runs on another iirc

young knoll
#

Well, most of it

sly depot
golden turret
#

The PlayerInteractAtEntityEvent is called before PlayerInteractEvent. I have an object with a rightClick method and it is being called twice. How can I make this be called only 1 time?

torpid sapphire
#

is there a way to get a random enchatment? i thought EnchantmentWrapper does that but it doesnt look like it does

young knoll
#

Enchantment.values will get you an array of them

#

Then just select a random element from said array

torpid sapphire
#

dont need a random level for an enchant, need a completely random enchant

#

need to reroll a VillagerAquireTradeEvent

#

oh wait i get what you mean

gray merlin
#

@kind hatch Hey, thanks for showing me maven modules. They're extremely useful and I daresay they surpass java modules.

#

I'm very grateful for it.

young knoll
#

NMS

#

No idea, you are on 1.8 so you're on your own

#

Dig through NMS

river oracle
#

?1.8

undone axleBOT
torpid sapphire
#

i love that theres a tag for that

desert frigate
#
if(block.getType().equals(Material.COAL_ORE)) {
                        block.setType(Material.BEDROCK);
                        Bukkit.getScheduler().runTaskLater(plugin, new Runnable() {
                            @Override
                            public void run() {
                                block.setType(Material.COAL);
                            }
                        }, 300L);


                    }```
```java
java.lang.IllegalArgumentException: Cannot get data for not block COAL```
#

anyone know why

lost matrix
#

COAL is not a Block

desert frigate
#

oh fuck im stupid

arctic moth
#

this was completely naturally generated

#

not sure why it isnt burning though lol

lost matrix
river oracle
lost matrix
#

First thing you want: Serializability. If the server restarts then you want the blocks to not be gone forever.

#

Then you should use a PriorityQueue<Something> which is ordered by timestamps and polled every second.
So you poll and work down the queue until you hit a timestamp that is in the future.
This has by far the best performance for this application and can easily handle hundreds of thousands of Blocks.
The stored object should contain

  • the BlockData
  • a unix timestamp (long)
    and implement Serializable<Self>
river oracle
#

thanks for the idea 👍

torpid sapphire
#

are swift sneak and soul speed the only enchants you cant get from a villager?

#

not spigot related but i assume someone here knows

vocal cloud
#

You can get all enchants from villagers?

torpid sapphire
#

can you?

vocal cloud
#

Have you even played minecraft before?

torpid sapphire
#

i thought swift sneak was ancient city exclusive and soul speed was bartering exclusive

vocal cloud
#

Oh I misread they don't

river oracle
vocal cloud
#

Give those 2

echo basalt
#

Yo 7smile7

torpid sapphire
vocal cloud
lost matrix
echo basalt
#

Are you able to give some insight on your current dev environment?

#

Hardware, monitor specs etc

#

I'm just trying to see like

#

the type of hardware decent developers use

river oracle
#

I know you don't care, but I run a lot of minecraft shit xD
i got an i5-12600k cpu with an rtx 3060 :P though don't really use the graphics a lot as most stuff is cpu centric

echo basalt
#

I don't really care about pc specs as much

#

mostly just monitor and all of this niche stuff that can really change the experience regardless of specs

#

I got a 2k 144hz monitor a couple days ago and coding is a lot more enjoyable

hasty wasp
#

Coding in Speeeeeeed

echo basalt
#

So I'm tryna see what else I can do to make the experience even better

river oracle
#

I just have 1 crappy 60hz monitor lol

vocal cloud
#

lol I use a 32" monitor so it can fit more code and I don't have to look too close to my PC

echo basalt
#

mine's 27 inch but pretty close to my eyes

hasty wasp
#

3x 27 inch is the best for me

vocal cloud
#

I can usually sit 2-3 feet away and read comfortably

#

Helps when rereading the same line 20 times

echo basalt
#

I'm about 38cm away

#

not exact, just a visual estimate

vocal cloud
#

That's pretty close

echo basalt
#

I'm also thinking about buying a m1 macbook because I hate my laptop

#

6-bit color piece of garbage

hasty wasp
#

anyone using a laptop like me or just desktop?

echo basalt
#

I transitioned to a desktop like 2 years ago

vocal cloud
#

Desktop with 2 monitors or a laptop with 1 works

lost matrix
#

I have a 2k 165 Hz main monitor (not sure how big but its pretty big) and a second 1080p 90Hz secondary monitor for
stuff like discord or documentations etc.
I got an i9 9900k @4.9Ghz on all cores (Watercooled :D)
3070Ti Founders edition
1000 Watt psu
Some Z390 Motherboard
2x 2TB Nvme
1x 2TB SSD
2x 4TB Hard drive for backups running in raid 1

If i would change something today then it would be the CPU. Ryzen is probably a better fit now.

river oracle
#

I like to sit outside sometimes

#

so I use my laptop then

echo basalt
hasty wasp
#

I feel weak with my Razer Blade 15 😄

echo basalt
#

how much data do you need honestly 👀

vocal cloud
#

smile run a server with every commit of spigot ever made uwu

lost matrix
#

If you only casually game and have a decent inet connection then you surely dont need more than one TB

echo basalt
#
  • 2k 27" 144hz IPS main monitor

  • 1080p 24" 144hz VA monitor for chrome etc

  • 1080p-ish 21" 75hz monitor exclusively for discord

  • Ryzen 5 5600x (water-cooled, even though it's a 65w chip)

  • Rx6600 8gb (does medium ray tracing)

  • B450M-A pro max (was like 50 bucks)

  • 32gb 3600mhz ram

  • 512gb nvme ssd

  • 128gb sata ssd for work stuff

  • 2x 1tb HDD in raid0, each HDD came from an old laptop, with about 35k hours

lost matrix
#

Around 4 months ago when i build a pc for a friend the best CPU you could get regarding price/performance was some i5 12500F or something. Let me double check.

echo basalt
#

things that make coding really handy in my case is my wireless, low-profile keyboard

#

love it

hasty wasp
#

I mean 12 TB is a lot but.. if you have a lot of things to store like games (GtaV..) or just every lib of the mavencentral repo 🤣

lost matrix
#

It was 12400F

vocal cloud
#

Damn what's with all the RAID over here

echo basalt
#

raid0 for performance

hasty wasp
#

xD

echo basalt
#

I wanted to play call of duty

#

yet open it within 5 minutes

#

it's the most fragile raid0 array

vocal cloud
#

Buy a NVME and write it off on your taxes as a work expense

echo basalt
#

imagine paying taxes

lost matrix
hasty wasp
#

Crying with my 480GB SSD xD

echo basalt
#

I mean

#

You don't need that much storage nowadays

sharp flare
#

Jesus i miss skyrim so bad

river oracle
#

I only have 2NVME 1TB

#

lol

vocal cloud
#

I bought a 2TB NVME for my server and it can only use 20% of the throughput

hasty wasp
#

xD

echo basalt
#

I could buy some new monitor arms

river oracle
echo basalt
#

to have better control on my setup

#

or maybe save a bit more and get a nice laptop

lost matrix
echo basalt
#

I just can't trust the laptop industry after the disgrace that is my laptop

vocal cloud
#

Get a microphone so you can make tutorial videos

echo basalt
#

I already have a decent 100$-ish mic

#

with a mic arm

#

that's attached into my monitor arm

#

not janky at all

river oracle
#

my mic is 20 bucks and its peak

echo basalt
#

also got a 30$ webcam like a couple days ago

sharp flare
#

Nvme m.2 is the only ssd I have on my laptop with 1 TB, they were in raid but i disabled it

echo basalt
#

time to open "mine-academy"

#

totally original name

#

make crappy videos into how to make ploogins

vocal cloud
#

If you translate it to another language it'll sound cool and foreign

echo basalt
#

abuse static to keep the video short

#

I can make the tutorial in like 2-3 languages

#

have an international presence

vocal cloud
#

I meant the name

lost matrix
#

For condensor mics i can suggest the Rhode NT1 or NT1A
Got my gf one because she sings a lot. Its around 250€ but you still need an amp for it.

echo basalt
#

imagine having a gf smh my head

#

I have one that's basically a modern blue yeti competitor

vocal cloud
#

Hyper X Quadcast?

echo basalt
#

was thinking on being trendy and getting one of those shure mics

echo basalt
#

thronmax mdrill one

river oracle
echo basalt
#

integrated pop filter n all

echo basalt
#

I'm literally obsessed with optimizing code

lost matrix
echo basalt
#

imma make sure to use my webcam mic

lost matrix
#

Yes!

echo basalt
#

have a yellow circle around the cursor

lost matrix
#

And some broken family noises in the background

echo basalt
#

and every time I click, it makes a circle as well

vocal cloud
#

Bandicam in the corner

echo basalt