#help-development

1 messages · Page 469 of 1

weak meteor
#

why JavaPlugin#getResource returns a file but if i wanna declare it says me to make a InputStream

proper iron
#

Does anyone know how to get the PersistentDataContainer of a sign?

plush nest
#

okay

regal scaffold
#

5 questions in 1 second

#

gl alex

regal scaffold
#

cya later

tender shard
fluid river
tender shard
#

not sure which one is correct

weak meteor
plush nest
#

as you can see it only goes to 1.12 and not 1.8.8 or 1.8.9 which is the version i want to make my mc plugin in. I'm using intellij and im using the "Minecraft Development Plugin" in Intellij

fluid river
weak meteor
tender shard
plush nest
#

oh alr

weak meteor
plush nest
#

bc in the modules it shows the 1.12 api

young knoll
#

It’s the block state

weak meteor
#

what should i use it then?

young knoll
#

State handles pdc

plush nest
#

idk if that'll effect it

tender shard
#

"1.19.4-R0.1-SNAPSHOT"

proper iron
fluid river
#

get the FileConfiguration

remote swallow
weak meteor
hazy parrot
plush nest
#

thx

tender shard
tender shard
#

PDC is 1.14+

fluid river
#

or version mismatch as alex said

tender shard
#

hello nuker

fluid river
#

hi

tender shard
#

good evening

#

how you doing

weak meteor
proper iron
fluid river
#

half past three 4 me

plush nest
#

where can I find the pom.xml for 1.8.9 or 1.8.8 if 1.8.9 doesnt exist?

fluid river
remote swallow
#

getResource gets it from your jar, not from the datafolder

plush nest
#

im new to mc plugin coding but i know some java

fluid river
tender shard
plush nest
#

ok

#

where can i find the pom.xml for it

weak meteor
remote swallow
tender shard
fluid river
#

learn how to use configs ig

#

by asking questions

proper iron
plush nest
#

yes but it has 1.12 like this and idk if you need another for 1.8.8

young knoll
#

It’s on the state

weak meteor
plush nest
#

im new to using spigot api and stuff

weak meteor
fluid river
weak meteor
#

k thanks

remote swallow
# weak meteor

correct, but you should use new File(JavaPlugin#GetDataFolder, "userdata/")

remote swallow
plush nest
fluid river
#

he might be trying to access userdata of the server, if there's even a folder for that

proper iron
plush nest
fluid river
#

i dont even remember if there is a folder with this name

remote swallow
fluid river
#

i thought it's all in world foler

remote swallow
#

top right

plush nest
weak meteor
#

like this?

remote swallow
#

yeah

weak meteor
#

k thanks u both

tender shard
#

@proper iron @plush nest Please both open a thread. You both have similar questions, you better both open a thread, otherwise answers to you will get mixed up etc

plush nest
tender shard
#

unless ofc you already got it working, in that case - great, nvm then lol

young knoll
#

This is why people want a forum channel :p

tender shard
#

yeah but forums suck

#

because IIRC then you don't have any "general" channel anymore

young knoll
#

You do

#

But you could always just have 2 channels

worldly ingot
#

We have a forums channel, silly

#

?forums

#

Really? We don't have a command for that?

#

Colour me shocked

remote swallow
#

no

#

fuck website forums

#

discord on top

weak meteor
#

tecnically this will get the messages.yml in resources folder and save it in plugin folder?

tender shard
#

yes

remote swallow
#

i would recommend checking if the file exists first, otherwise you wil get "Couldnt save file X because it already exists"

tender shard
#

but you should check whether the file alreaedy exists ^

young knoll
#

That messages sucks

tender shard
#

yeah it's kinda stupid

young knoll
#

We literal specify with the Boolean that we don’t want it to replace it

tender shard
#

if "plreace" is false, it should just silently shut up

young knoll
#

So don’t tell us that you aren’t replacing it

tender shard
#

on the other hand, it makes sense

#

you tell it to "save a resource"

#

so it makes sense that it complains lol

remote swallow
#

coll

#

ive got a new pr for you

tender shard
#

imho the "replace" flag is useless

remote swallow
#

go make that message shut up

tender shard
#

share it here

remote swallow
#

pr

#

pull request

tender shard
#

pr0n request?

young knoll
#

I already have too many open :p

remote swallow
#

choco does it

#

why cant you

tender shard
#

coll got too many pr0n requests open

young knoll
#

Because Choco is cool

remote swallow
#

@worldly ingot can you do what coll wont

tender shard
#

yeah @worldly ingot can you do what coll wont?!

worldly ingot
#

What won't he do?

remote swallow
#

make a pr to shut the saveResource up

#

if the file already exists

worldly ingot
#

Oh I hate that message lol

young knoll
#

You gotta be careful to not make a PR MD doesn’t like, otherwise you’ll suffer

tender shard
#

@maven can you do what gradle can't?

maven be like

oh sure, I can

  1. use descriptive build files
  2. use build "scripts" that do not break on every new release of myself
  3. shade dependencies without a third party plugin written by some random person
  4. work without downloading a 150mb wrapper of myself. for every single repository that you have.
  5. use a JDK that doesn't have to be the same as the source/target version defined in my pom, errrrm I mean build.gradle or gradle.properties file
young knoll
#

Choco once made a getTPS PR and that’s how he lost an arm

worldly ingot
#

I can confirm that I have lost an arm

#

I've actually lost three arms

remote swallow
#

what about a leg

tender shard
#
  1. show actually helpful error messages in case something actually goes wrong - which is unlikely in maven, because we use DESCRIPTIVE build files, instead of just random scripts
#

sorry but I can't help myself

young knoll
#

Man was hurt by gradle at a young age

remote swallow
#

guess why i swapped to gradle

tender shard
#

I also wanted to hate about how gradle breaks itself on every update but I realised, I already mentioned that in #2

tender shard
#

using paperweight probably

remote swallow
#

i got a class unsupportered exception or what its called

#

and i didnt know how to fix it

winged anvil
#

chads use intellij build

tender shard
remote swallow
#

that was the fix

#

i couldnt find anything online

#

i swapped to gradle

#

and it worked

tender shard
#

I don't hate gradle, I just inherently dislike it

#

gradle is probably perfect if you study it for 56 months

remote swallow
#

i didnt study it at all and i can use it for my needs

plush nest
#

real quickly would this work if I coded it since I see people list thigns like this in a specific way (ignore the minemen my goal is to recreate it as a personal project)

tender shard
young knoll
#

I have a masters in gradleing

#

Hey hey

tender shard
remote swallow
#

i dont do that untill idk how to do something

#

but it works

#

so ¯_(ツ)_/¯

young knoll
#

John Rengleman is not a random person

#

He’s a hero

remote swallow
#

if it randomly breaks one day on a new gradle update i simply just downgrade

tender shard
#

yeah he's still random because it's not builtin into gradle

#

it's like using "abzjohnny's hack to make windows 10 work with windows 8 graphics driver for KVM64"

young knoll
#

I mean

#

You can do it with just gradle

tender shard
#

you can, but the official docs dont tell you how

remote swallow
#

you say stuff breaks on new gradle updates, i just simply dont update

#

i just work around stuff i cant do

tender shard
#

gradle summarized in 1 sentence

#

2 sentences*

#

mb

remote swallow
#

we can do anything we want

tender shard
#

"it works, idk how - i just copied sth from SO, and have no clue how or why"

regal scaffold
#

How do I use new Interactables

#

in .4

tender shard
#

you spawn them like any other entity

regal scaffold
#

Oh just like that

tender shard
#

yes

regal scaffold
#

It's a replacement for packets right?

#

For holograms

tender shard
#

erm no

#

well

#

yes/no

#

every other plugin dev will thank you if you read this ^

plush nest
#

Question about this and config

regal scaffold
#

Ok but wait

#

That doesn't answer

weak meteor
#

How to get console instance? lol

tender shard
#

wdym?

#

"console instance"?

regal scaffold
#

in .3 and below we always did ```java
entity = new ArmorStand(world, location.getX(), location.getY(), location.getZ());

#

Then set the properties and send the packet

tender shard
weak meteor
regal scaffold
#

So then

tender shard
weak meteor
#

same for this

#

Oh

regal scaffold
#

For the new interactables

weak meteor
#

lol

regal scaffold
#

Is it just new Interacble?

tender shard
#

Idk I have not used Interactables yet

#

lemme check

young knoll
#

TextDisplay

#

ItemDisplay

#

BlockDisplay

#

Interaction

tender shard
#

There is no "Interactable"

regal scaffold
#

I meant Interaction

#

But the weird thing is

#

Interact in it's constructor requires another Entity

young knoll
#

Why are you constructing it

#

World.spawn

tender shard
#

?xy

undone axleBOT
tender shard
#

tell us what you're trying to do pls

regal scaffold
#

Ok.. again

young knoll
#

Also use TextDisplay for holograms

tender shard
#

^

regal scaffold
#

Ok but I'm confused on something different I think

#

Hear me out

#

in .3 and below we used to have to spawn ArmorStands using nms, then packets to be able to display holograms.

Now, we have the option of those 4 classes that you mentioned above, but like, how much do they replace what we used to do?

If I want to adapt my .4 NMS class to support the new classes, I'm trying to figure out what changes

young knoll
#

I mean

#

You never had to use NMS

#

People just did it for optimization

#

You don’t really need to resort to packets for these new entities

#

They don’t tick

regal scaffold
#

Then, doing

new Interaction(net.minecraft.world.entity.EntityType<?> entitytypes, net.minecraft.world.level.Level world)

For some reason requires a entitytype in the constructor which I don't seem to understand why, and a world instead of a location, so I don't even understand wtf it really is

#

Ok so then that means I don't need packets

#

fOR .4

worldly ingot
#

I'd avoid packets entirely for this, yeah

regal scaffold
#

Ok good

worldly ingot
#

Its "benefits" are null and void because those display and interaction entities are not ticked

#

They're nothing to the server

regal scaffold
#

Ok so then

#

I think I can figure it out now

#

Be back later

worldly ingot
#
  • you can hide entities with Player#hideEntity(), or do Entity#setVisibleByDefault() & Player#showEntity()
regal scaffold
#

?jd-s

undone axleBOT
regal scaffold
#

Do I treat the 4 new classes as another entity? #spawn()

worldly ingot
#

Yeah they're all different entities

regal scaffold
#

Cool

#

Lets see if I can figure out how to change from old version support to new classes

weak meteor
regal scaffold
#

It's been so long since I spawned an entity I got vietnam flashbacks

tender shard
regal scaffold
#

xd

#

Is this

#

What I think it is

#

I will cry

#

Ok and now since I'm using bukkit instead of nms I can no longer set the name to be a component

#

Back to nms

weak meteor
#

This booli stuff is never changing in the actual player file

regal scaffold
#

?stash

undone axleBOT
trim bough
#

the server sends a unique packet for system chat and player chat to each player, how would i make it to where i can assign all of these into 1 id? so like if 10 ppl are online and a chat packet is sent it should be able to store 10 values with the same ID instead of a unique ID for each packet

hazy parrot
weak meteor
hazy parrot
#

Or its JavaPlugin#saveConfig, I don't remember

weak meteor
#

Not config.yml

#

but dont worry i know how to do it

regal scaffold
#

Where can I see spigot/bukkit implementation on nms

#

Like for example, how spigot made their TextDisplay from NMS

young knoll
#

?stash

undone axleBOT
regal scaffold
#

Yeah but what part

proper iron
#

I got a question. So I am setting some data to the block in a PersistentDataContainer during a SignChangeEvent. But then in a PlayerInteractEvent on that sign I can't retrieve the same PersistentDataContainer data. Thoughts?

regal scaffold
#

I'm browsing

young knoll
#

CraftBukkit

regal scaffold
#

There it was

#

ty

young knoll
#

CraftTextDisplay most likely

regal scaffold
#

Yup

#

And now

#

Where's spigot implementation of CraftTextDisplay

young knoll
#

Hmm?

regal scaffold
#

Spigot has something called TextDisplay

young knoll
#

The entity

#

It’s an interface

#

It’ll be in Bukkit

regal scaffold
#

❤️

hazy parrot
#

Craft+something is usually implementation

regal scaffold
#

Don't ask what I'm looking for

#

Cause... I have no clue

hazy parrot
#

So CraftTextDisplay would be impl of TextDisplay

regal scaffold
#

Yeah I just found it

young knoll
#

I hope we get that component support soon

regal scaffold
#

I just still can't figure out why the nms constructor for TextDisplay requires a EntityType

young knoll
#

I wonder how Chocos PR is going

regal scaffold
#

If we had component support I wouldn't be needing to use nms rn

#

So 🙏

young knoll
#

Yeah @worldly ingot

#

Smh

worldly ingot
#

Honestly haven't touched it in like 9 months

regal scaffold
#

Ok but I still need to figure out how to do it

worldly ingot
#

ngl

regal scaffold
#

Oh! component commit going fantastic

#

Glad to hear

young knoll
#

Are there changes currently requested?

regal scaffold
#

I'm gonna commit sui

#

public (EntityType arg0, Level arg1)

#

Why does Display.TextDisplay() require those parameters

young knoll
#

Most mobs do

#

One is the type of entity

regal scaffold
#

public (Level arg0, double arg1, double arg2, double arg3)

young knoll
#

The other is the world

regal scaffold
#

Why is it not asking for exact location

#

Like a armorstand

young knoll
#

¯_(ツ)_/¯

#

Probably have to set the location after

regal scaffold
#

And why is it asking for a EntityType

#

If TextDisplay is the entity

young knoll
#

You know you can just summon the Bukkit entity

regal scaffold
#

No components

#

Support

#

So no

young knoll
#

And then convert it to NMS to apply the components

regal scaffold
#

Oh

#

Wait

#
((CraftEntity) entity).getHandle();
```?
#
        final Display.TextDisplay nmsEntity = (Display.TextDisplay) ((CraftEntity) entity).getHandle();
OR
        final Entity nmsEntity = ((CraftEntity) entity).getHandle();

Is it worth treating it like a TextDisplay or just a Entity

young knoll
#

TextDisplay

regal scaffold
#

Cool

young knoll
#

It’s display content is different from its custom name iirc

regal scaffold
#

Yeah it has different methods

#

Tjat'

#

Holy shit

#

We have a compiled build

#
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R3.entity.CraftTextDisplay cannot be cast to class net.minecraft.world.entity.Entity (org.bukkit.craftbukkit.v1_19_R3.entity.CraftTextDisplay and net.minecraft.world.entity.Entity are in unnamed module of loader java.net.URLClassLoader @45fe3ee3)
#

Good try

young knoll
#

Use CraftTextDisplay for the cast

regal scaffold
#

Nono

#

Display.TextDisplay

#

CraftTextDisplay isn't liked either

#

I think I know why

young knoll
#

Display.TextDisplay = ((CraftTextDisplay)entity).getHandle

regal scaffold
#

The error isn't in

#

The creation

#

But when a packet is sent

young knoll
#

What packet

regal scaffold
#

Exactly

#

Since I used bukkit to spawn it

#

I don't need it

#

And I left it there

#

I need a plugin playground for all this new holo stuff

tender shard
#

did I miss sth

#

lemme pretend to be md5: "there's api for that"

young knoll
#

Not for components

tender shard
#

oh ok

#

ok lemme rephrase it again: "@worldly ingot where's PR for displays so people can use it with components without having to use slughorn"?

#

(slughorn = new fancy name for NMS)

young knoll
#

😩

trim bough
#

how do i check if 2 components are the same

#

can i just do component.equals(component) 🤔

tender shard
#

equals()

trim bough
#

kk

tender shard
#

yes

#

if one might be nullable, use Objects.equals

#

One of the reasons why I love java and dislike kotlin

#

kotlin be like

if(myComp1?!=myComp2?)
young knoll
#

I should use Objects.equals more

regal scaffold
#

Choco said he hasn;'t touched the pr

#

in 9 months

#

a.k.a It's going fantastic

young knoll
#

It’s only the first pr too

regal scaffold
#

xd

young knoll
#

It only covers more player stuff and item lore/name

regal scaffold
#

Good think I'm implementing components myself then

#

about 3-5

#

years

#

Do you use Components a bunch Coll?

#

Currently storing hologram lines as a List<String> and since I want components I thought List<Components> but I could've swore that components had a way to store a List of that

river oracle
#

I was just thinking about how I wanted something to beable to check contains fast, insert and remove quickly. I spent hours stumped at what could possibly do this better than a list. Alas 😭 I somehow forgot about HashSet

young knoll
#

I normal just use strings

regal scaffold
#

Fair

#

Ok listen up

#

Now, I can make holograms with the new TextDisplay

#

But... they seem to be persistent....

#

Without doing anything

#

Meaning if you reload/restart once and you didn't keep track of the entity, I have no clue how to get it back

young knoll
#

Track the uuid

regal scaffold
#

Yeah yeah I know like]

#

The problem is

#

If you forget to implement something to track the UUID

#

It stays

young knoll
#

Mhm

#

Entities tend to do that

regal scaffold
#

How can I keep track between reloads temporarily, just to play around

#

Or do I need to implement a serialize/deserialize

#

I could just kill all entities

young knoll
#

Just keep track of the uuid

regal scaffold
#

Ondisable

#

If I keep track of UUIDs in memory, when I reload they are gone

young knoll
#

Save them

regal scaffold
#

Kill on disable it is, Just a playground rn

young knoll
#

Or just add an identifier into the text displays pdc

#

Then you can grab it on chunk load

#

I’m curious why you need components here anyway

regal scaffold
#

I'm making my library

#

And I want to be able to customize holograms with minimessages

young knoll
#

You don’t need components for that

#

Unless you want to use something like a translatable component I guess

regal scaffold
#

I do

#

I could just MiniMessage.ToString

#

But that's boring

young knoll
#

Meh

#

I rarely have a use for translatable components

remote swallow
#

holograms dont need clickable or hoverable text so use strings and legacy serializer

young knoll
#

Yes but translatable

remote swallow
#

language files

regal scaffold
#

Boring solution

young knoll
#

The client has how many languages

#

Smh

trim bough
#
java.lang.StackOverflowError: null
        at net.kyori.adventure.key.KeyImpl.examinableProperties(KeyImpl.java:85) ~[adventure-key-4.13.1.jar:?]
        at net.kyori.examination.Examiner.examine(Examiner.java:45) ~[examination-api-1.3.0.jar:?]
        at net.kyori.examination.AbstractExaminer.examine(AbstractExaminer.java:53) ~[examination-api-1.3.0.jar:?]
        at net.kyori.examination.ExaminableProperty$1.examine(ExaminableProperty.java:79) ~[examination-api-1.3.0.jar:?]
        at net.kyori.examination.AbstractExaminer.lambda$examine$0(AbstractExaminer.java:156) ~[examination-api-1.3.0.jar:?]
        at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
        at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:992) ~[?:?]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
        ...```anyone know why im getting tis massive error...
#

it's stackoverflow but i dont know why

#

and it doesnt trace back to any of my code

#

it just spams java.util and net.kyori

worldly ingot
#

That's Paper API

#

Nothing to do with us

regal scaffold
#

I gotta admit this seems cool

remote swallow
#

theres a lot wrong with that video'

regal scaffold
#

😦

#

Like what

remote swallow
#

feather client, server running with gui

regal scaffold
#

Feather for multi-client

#

gui is myb

#

xd

#

I'm surprised at how smooth this is

#

It's a cool pattern

#

Oh well, 6 hours ago I just wanted to make interactable holograms

remote swallow
#

sounds painful

regal scaffold
#

6 hours later I made my hologram manager for .4 compatible with components

#

And no interactable stuff yet

#

But, it looks sick

remote swallow
#

you either have to check if they click the armor stand or where its text is

regal scaffold
#

No

#

.4

#

New entities

remote swallow
#

still

#

.4 makes it somewhat harder and easier

regal scaffold
#

I'm still using nms

#

So

#

My goal is not only gonna be making lines clickable consistently

remote swallow
#

you'd need to figure out where the text is and summon an interactable entity

regal scaffold
#

But making words

#

I think I'm supposed to spawn the interactable entity from the start

#

No need to wait

remote swallow
#

what about making a specific word clickable

regal scaffold
#

Separate a line into multiple entities

#

It's just math

#

I've studied math for years, it'll finally be useful now

#

Separate click HERE to whatever

Into 3 entities correctly spaced

#

I'll have to see how the boxes work tho

#

But I be "one of the first" ( to my knowledge ) to have clickable words efficiently

remote swallow
#

im pretty sure illusion did something like that

regal scaffold
#

Nope

#

He did lines

#

Or he did "words"

#

Like sort of

#

With vectors

#

But it was pretty inaccurate

wise mesa
regal scaffold
#

Depends on how the boxes are made

#

Haven't gotten to that part yet

crystal bay
#

i need some help understanding a machine learning anti cheat can someone some what break it down in easy terms

worldly ingot
#

Easiest terms possible is that it has inputs, does some magic in between with weights and biases, then has output

#

Those weights and biases are constantly changing and to tell it how to change them, the methodology differs. Manual reinforcement, random genetic mutation, etc.

crystal bay
#

oki

regal scaffold
#

I've been doing nms all night

#

And suddenly I can't extend EntitySlime

#

And it's added in my pom

trim bough
regal scaffold
#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>${spigotVersion}-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
            <classifier>remapped-mojang</classifier>
        </dependency>
#

... nvm

#

It works...

#

I was trying to extend EntitySlime

#

................

lost matrix
#

The best performance is probably achieved with a support vector machine because
you dont need a lot of learning data. The only problem is that you have only binary
classification (cheater or not) instead of probabilistic values. Same problem occurs
with K nearest neighbours. This could be mitigated by using a KNN variant called
expectation maximization in which a gaussian function is used to create probabilities
for every cluster.

#

The real problem is generating training data for any of those.

#

The simplest approach would probably throwing a NN together with a few layers

#

And simply feeding it with tons of data. That often works XD

desert frigate
#

im currently using the vault api but it has kept returning even though vault is installed on the server.

RegisteredServiceProvider<Economy> rsp = Bukkit.getServicesManager().getRegistration(Economy.class);
        if (rsp == null) {
        //returns here
            return false;
        }```
#

this is copied from the vault github page

lost matrix
desert frigate
#

what do you mean by providing a economy? i thought vault was the economy? or stores the eco

lost matrix
#

Vault is just a platform that lets different plugins communicate over a common pipeline.
You still need a plugin that actually implements the Economy interface and registers
a service provider. You can also implement the Economy interface and register your
implementation as a service.

desert frigate
#

so something like this?

getServer().getServicesManager().register(Economy.class, new MinionEconomy(), this, ServicePriority.Normal);
        RegisteredServiceProvider<Economy> rsp = Bukkit.getServicesManager().getRegistration(Economy.class);```
lost matrix
quaint mantle
#

how do you guys always make yur code look so fancy in dc

lost matrix
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
quaint mantle
#

oh

#

thx

desert frigate
lost matrix
desert frigate
#

lowkey hella confused but I guess it works

quaint mantle
desert frigate
lost matrix
#

Ususally those implementations are only provided by pure economy plugins.
So i would do your approach only if this is for a private project

lost matrix
desert frigate
#

ive copied the code straight from my other plugin that works fine but doesnt on this plugin? i dont understand why i need to implement these?

lost matrix
#

Then dont implement Economy and dont register a service provider

#

Install an economy plugin like EssentialsX or something else

desert frigate
#

yes but funny enough essentialsX support told me to use vault <3

lost matrix
#

Yes. Vault + Essentials

desert frigate
#

okay then how would i get the economy from essentialsX? through their api?

lost matrix
#

No. Thats what Vault is for.
Vault gives you a standardized way of communicating with any economy plugin
by getting the service which was provided by the random economy plugin.

#

You always use Vault, no matter who implements the economy.
Thats the whole point of Vault. No need to know which economy
plugin is installed. You just communicate with Vault.

desert frigate
#

exactly but how would i do that? you told me to not implement my own economy but thats everything that vault docs say so i dont really know what to do

lost matrix
#

You get a registered service provider for the Economy class and use it.

desert frigate
#

OHH WAIT

#

its cause i dont have essentials installed

lost matrix
#

Yes thats what i told you. You need an economy plugin installed.

desert frigate
#

😀 thank you for your time

#

im slow sorry

fluid river
#

FREE

#

JAVA

#

LESSONS

torn oyster
#

i switched to gradle from maven, i used to be able to put ${project.version} in plugin.yml and it would automatically input the version

#

is there something like this with gradle

torn oyster
#

ok

ivory sleet
#

You modify the processResources task

#

so you basically filter to make it only go through the plugin.yml or your resources folder

#

And then you expand

torn oyster
#

yeah so

#

i have no clue how to do that

ivory sleet
#

processResources.from(sourceSets.main.resources).expand version: project.version, name: project.name

#

I think

#

And then u can use $version and $name

#

Not used to groovy syntax so

lost matrix
#

The services are registered in onLoad. So i doubt that this is the problem.

wet breach
#

You just need to tell maven to filter the resources

torn oyster
tardy delta
torn oyster
#

i already did do that

#

i just switched to gradle

#

from maven

#

and was wondering if i could still do that

wet breach
tardy delta
#

💀

#

are they also pointy?

wet breach
#

Not sure, memory is a weird thing

lost matrix
#

smart pointers is what you want

tardy delta
#

ye true

#

also would this work or should i allocate it on the heap?

#

that it is destroyed before i work with it or smth

#

Got some weird linking errors that it cannot find a vtable ref lol

lost matrix
#

General rule is: The creator of an object has also the burden of destructing it.
Thats why methods should usually not create new objects on the heap and
pass them to their caller.

#

This creates a Tokenizer on the stack so there is no real issue i can see right away

#

Well i can see an issue... You are passing a reference to an object on the stack which is destroyed when the function exits

tardy delta
#

Uhu

lost matrix
#

One solution would be

const void Tokenizer::branchOff(int newPos, Tokenizer* target) const {

}

This would transfer the burden of destruction to the caller

#

God i hate c++

#

Ah and make it a const pointer

#

and newPos should probably be int&& newPos or else you are copying the int into a new variable
on the stack each time the function is called

tardy delta
#

Brr

#

What should in be doing with that ptr then?

lost matrix
#

Allocate it and pass it to the function

#

?

misty current
#

how can I use my custom world generator to generate a world with multiverse? I'm not sure what the id is supposed to be

#

is it the plugin name?

#

oh yea it is nevermind

#

i should've tried ;-;

lost matrix
tardy delta
#

I believe i understand what you mean

#

Creating a mutable ptr, then calling that method with the ptr as param?

torn oyster
#

how do i add a new server to bungeecord through code, if that's possible?

jagged monolith
#

You might be able to some extend, but you'd still need to edit the config for bungee as well.

torn oyster
#

for my minigame setup

eternal oxide
#

?jd-bc

torn oyster
eternal oxide
#

have you looked at the javadocs?

torn oyster
#

i looked in all the places i think it would be

eternal oxide
#

My guess would be constructServerInfo

jagged monolith
#

Yeah, that would be the closest thing from what I can see

misty current
#

i'm trying to get structures to generate in my custom chunkgenerator using worldedit schematics. I have made a method that works fine when called from a command, but the same method times out the server when used in chunk generation as soon as I start creating a world with multiverse

#

?paste

undone axleBOT
misty current
lost matrix
misty current
#

i had thought of that but i don't understand why would that time out the server

lost matrix
#

There are several reasons why this could time out the server.
If it triggers an infinite chain of chunk generations for example

misty current
#

wouldn't that cause a stackoverflow

lost matrix
#

Its not a recursive generation

misty current
#

i see

#

any suggestions?

eternal oxide
#

I'd suggest not using multiverse inside chunk generation

misty current
#

you mean worldedit

eternal oxide
#

Spigot has a StructureManager now which will allow pasting of schematics

lost matrix
misty current
#

it uses chunkload events

lost matrix
#

Eh... it looks like they dont use a generator at all. Its simply a listener that listens for new chunks and pastes
some random structures in it

misty current
#

i'll take a look, thanks

#

i mean i could do something like that, i don't mind

lost matrix
#

The proper way would be to use a seed system and only generate those part of the structures that
fit in the current chunkj

wet breach
#

This may be a paper specific thing since they have chunks multi threaded

lost matrix
#

This just ate 2h of my time finding out...

wet breach
#

Spigot doesnt. And i have never had an issue with pasting schematics into chunks that were unloaded unless it was a multi million block change in which case the server could lag for a couple of seconds

#

With spigot that is

misty current
#

tho i would prefer my plugin to be paper compatible

lost matrix
#

You shouldnt paste schematics when generating topology

#

"But it works" is not an argument

wet breach
misty current
#

you're right

wet breach
misty current
#

i was going to read the nms code to understand what times out the server and at runtime there are classes that are not present in my buildtools import

wet breach
#

Because they are in the minecraft jar

#

That is a dependency

misty current
#

there's no Level but i have World

#

oh and also everything is obfuscated to death

wet breach
#

It times out because the server main thread gets paused when it needs to load chunks from disk. And then the network is paused because its waiting on the relevant packets to be sent

#

So if the chunks that need to be loaded cross over multiple region files, the server has to load those files and memor map them, then read them then modify the blocks and then send that to the clients

#

The network only allows for at most a 20 second pause

#

Then client disconnects

#

Or the server forces client to dc

misty current
#

ok now i've made it generate in the middle of the chunk and there is no way the schem crosses the border

#

lemme try

wet breach
#

Its not so much the issue of chunk borders rather chunk borders between region files

#

A single region file holds 1024 chunks

#

You can use some math to determine which region file a chunk falls in

#
int regionX = (int) floor(chunkX / 32.0f);
int regionZ = (int) floor(chunkZ / 32.0f);

// bit shifts
int regionX = chunkX >> 5;
int regionZ = chunkZ >> 5;```
misty current
#

the server timed out anyways

#

i'll try to put it in a scheduled task

wet breach
#

Relevant formula to finding the region file a chunk belongs to

tall dragon
#

wish i understood how bit shifting worked :<>

wet breach
tall dragon
wet breach
#

If you shift to the right 5 times, 5 bits get shoved off the end and are gone

tender shard
worldly ingot
#

0001 << 3 = 1000, therefore 1 << 3 = 8

tender shard
#

bitshifting is like a croissant 🥐

tall dragon
worldly ingot
#

You're shifting them all

#

It just so happens that the left most are all 0

tender shard
#

ugh

worldly ingot
#

So if you want to get technical it would be 0001000

#

lol

#

Just that the leftmost bits there are 0 so they're nothing

tender shard
tall dragon
#

so how is 1 << 3 8?

wet breach
# tender shard

It should be noted that when shifting a negative to the right the sign is not preserved unless you use 3 arrows

torn shuttle
#

modelengine is so cursed sometimes

#

I really want to make my own alternative

misty current
worldly ingot
#

Because 1 in binary is just 1, 8 in binary is 1000

misty current
#

because the ichunkaccess is invalid the next tick

worldly ingot
#

So if you move that 1 bit to the left 3 times, you get 1000 which is 8

wet breach
tall dragon
#

this would probably be easier to understand if i also had a solid understanding of binary

#

which i dont

worldly ingot
#

very helpful prerequisite, yes

tender shard
misty current
worldly ingot
#

ye, every bit just represents a multiple of two going leftwards

#

Add all the bits and you've got your number

wet breach
tender shard
#

and after turning 1 to 8 through << 3, one can finally dream about croissants again 🥐

torn shuttle
#

why is my model leaving its head behind

misty current
#

i'll go ask on fawe's discord later

torn shuttle
#

don't lose your mind

misty current
#

they might have the implementation wrong or something

tardy delta
#

the attack of the quartz

wet breach
misty current
#

yes they have different implementations for spigot and paper

wet breach
#

I do know world edit doesnt use paper api stuff specifically if i recall so that could be the issue as well

#

Again all paper specific stuff lol

torn shuttle
#

it doesn't even error either

#

and its's just this model

#

how weird

misty current
#

ok so with a 0 tick delayed task it generated, but it still stopped the thread for 5-10 seconds

wet breach
misty current
#

time to test on spigot

tall dragon
torn shuttle
#

there's a million resources for that

wet breach
#

There is plenty. About to drive home right now so will have to wait on the resources

tall dragon
#

so technically base64 is also binary?

wet breach
#

I have some resources that are really good at breaking it down to make it easier to learn

tall dragon
#

or is that not how the bases thing works

tall dragon
wet breach
tall dragon
#

and computers use base 1 right?

wet breach
#

Binary is base 2

tall dragon
#

oh right

eternal oxide
#

a base 1 computer would only know False

tall dragon
#

thought it would include 0 :d

torn shuttle
#

my kind of computer

wet breach
#

Well it is more correct to say it only knows 1 state

hazy parrot
#

base is basically number of digits/chars you can use to present some data

wet breach
#

Binary is 2 states

tall dragon
#

fair enough

worldly ingot
wet breach
#

Ternary is 3 states and so forth

tall dragon
#

and humans use base 10 then yea

wet breach
#

Depends on region

torn shuttle
#

speak for yourself, I use base 100

wet breach
#

In large part yes

tall dragon
#

xD okay

torn shuttle
#

because I am 10x the man choco is

worldly ingot
#

:(

tender shard
worldly ingot
#

it's true

torn shuttle
#

choco is base 0

hazy parrot
worldly ingot
torn shuttle
#

because he can't count

young knoll
#

No you can’t have true

#

You only have false

torn shuttle
#

quatre-vingt dix neuf

worldly ingot
#

Yeah, who the fuck

torn shuttle
#

makes perfect sense

worldly ingot
#

It does but why

#

Just come up with a name for 90, don't highjack 4 20s

#

and teens

torn shuttle
#

it's the opposite of japanese

#

where you get a new name every few numbers

tender shard
#

I‘d like to have two times 20 croissants and then three additional ones

tall dragon
#

but is base64 also considered binary or no?

torn shuttle
eternal oxide
#

I love me some warm croissants with butter

torn shuttle
#

we blaze numbers up

hazy parrot
#

in computer means, 0 and 1

tender shard
tall dragon
#

right so only the zero's and ones are considered binary

#

ah well its kind of in the name

#

with "bi"

eternal oxide
#

you can represent any number in binary

wet breach
# tall dragon xD okay

The reason working with different bases can be the harder part is because the base system doesnt equate to how many bits can be used. So base 3 for example. It doesnt mean only 3 bits are used rather it means that every pair is 3 bits wide at most.

tender shard
tall dragon
#

hey leave me alone here

wet breach
tender shard
tall dragon
#

ive noticed

tardy delta
#

give me some

tall dragon
#

you rlly like those huh?

tender shard
#

I love the word

tall dragon
#

yea where are mine

tender shard
#

It sounds funny

torn shuttle
#

and then you have the special computer who say they identify as non-binary

tender shard
#

croissant

tall dragon
#

im only one country over, il come over and get some from you

torn shuttle
#

aka quantum computers

eternal oxide
#

fresh from the oven... so yummy

tall dragon
#

aight?

tardy delta
#

i should really stop this

tender shard
tall dragon
#

thats is if you are still a proud german

wet breach
#

Alright driving home now

tender shard
tall dragon
#

also why are ur pc component prices so low @tender shard, give us some of that

tender shard
#

Are they? Idk

tall dragon
#

i mean, they are quite a bit cheaper as other places

lunar forge
tall dragon
#

probably not

#

im guessing the client has the content of that message hardcoded

torn oyster
#

i'm making a server system that creates and destroys servers when needed for my minigames
my servers are using pterodactyl, and i have setup the api key and stuff (also with bungeecord)
where should i put the server manager? was thinking bungee plugin but was wanting to see if anyone else had a better solution

tender shard
tall dragon
#

i also think the client will only ever show that message once

#

for each session at least

torn shuttle
#

aw man I think I actually drank too much caffeine

river oracle
#

I like the one my Kacper

tall dragon
torn shuttle
#

nah you def can

lunar forge
river oracle
#

Prevent the pop up

lunar forge
#

That's not what I want

#

I want to send it to a player

river oracle
#

Then texture pack prob

#

But that'd be annoying asf

#

You hate your players or sum

torn shuttle
#

oh

#

ok fixed the head I guess

#

also my model is backwards lol

#

yess bby

misty current
#

turns out the issue was multiverse

#

i've made world gen on my own and it worked fine

torn shuttle
#

do you feel it looking into your soul and judging your for your sins?

lost matrix
misty current
#

time to generate through chunks and see what happens

young knoll
#

Isn’t that an amethyst elemental

lost matrix
#

Yeah

torn shuttle
#

what am I some kind of rock guy

young knoll
#

There minerals

worldly ingot
#

I fully expect you to be a geologist, Magma

river oracle
#

Same

torn shuttle
#

well tbf I didn't make this model

river oracle
worldly ingot
#

Oh so now you're stealing?

#

Man, what a guy

torn shuttle
#

what a magmaguy

river oracle
#

Can we just ban this guy?

torn shuttle
#

idk I think banning choco is a bit mean

#

it's not nice to discriminate against choco-type people

river oracle
#

True I guess

#

Choco can stay

torn shuttle
#

I'll be waiting for the bribe money choco

lost matrix
worldly ingot
#

Probably to get his own rocks off. It's MagmaGuy after all

#

(ha, rocks, get it?)

torn shuttle
worldly ingot
#

HEY

young knoll
#

Jesus Christ choco, they’re minerals

worldly ingot
#

That was meant to be private

#

I don't want people stealing my ideas

torn shuttle
#

tbf that's only half the story

lost matrix
torn shuttle
#

they wouldn't believe the other half

worldly ingot
#

As long as they don't find out about the smut fanfic lore wiki for the server

#

Shit...

torn shuttle
#

you should see what he's guarding

river oracle
young knoll
#

Choco has already been caught in 4K several times

torn shuttle
#

hippity hoppity get these furries out of my property

empty gyro
#

no uwu

worldly ingot
#

I don't have a "Furries Out" sign, so this will have to do

torn shuttle
#

yeah I'm not surprised you don't

scarlet kelp
#

How can i check if world is unloaded on spigot 1.12.2? On newer version i saw the isWorldLoaded() method, but nor on 1.12.2. And it's causing really strange behavior if i try teleport a player giving location of unloaded world, it's just teleporting to main world with no error or anything

torn shuttle
#

I'm not saying you're a furry I'm just saying that I remember what your previous pfp was

worldly ingot
scarlet kelp
#

thx

empty gyro
#

halp pls

Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "live.kaminodev.hello.Main.getCommand(String)" is null

executor line:

public hello(Main plugin) {
        this.plugin = plugin;
        plugin.getCommand("hello").setExecutor(this);

    }

plugin.yml:

  name: helloworld
  main: live.kaminodev.Main
  version: 1.0.0
  author: Kamino
  commands:
    hello:
        aliases:
            - hellowrld
            - helloworld
        description: says hi
        permission: hellowrld.execute

idk whats wrong every spigot and bukkit forum just says that it isnt defined correctly in the yml

worldly ingot
#

Do that in onEnable(), not in your plugin's constructor

#

Oh that's not your constructor

opal juniper
#

that isnt the constructor

#

yeah lol

worldly ingot
#

Probably to do with your spacing in the file. Keep it consistent. You have one with 2 spaces and another with 4

#

YAML is picky

opal juniper
#

should have used toml

young knoll
#

Did toml exist when spigot was made back in 1873

river oracle
opal juniper
#

actually it didnt lol

opal juniper
river oracle
#

Yeah

#

Could make a maven plugin to parse it

opal juniper
#

whats the point lol

river oracle
#

And create a plugin.yml from toml

opal juniper
#

i have been using plugin annotations recently tbh

empty gyro
opal juniper
#

they should have indentation

worldly ingot
#

I think the convention is actually to keep them on the same indentation but no that would have no effect

empty gyro
#

yeah i currently have it as this (command has 1 tab indent, aliases having 2)

eternal oxide
#

tab indent?

jagged monolith
#

never use tab indents. Use spaces

empty gyro
#

o.

#

so yml is dumb basically

worldly ingot
#

Like I said, picky

opal juniper
#

wow choco will not call it dumb

empty gyro
#

anything that uses space indentation is dumb
(no offense to anyone)

opal juniper
#

what 🤨

young knoll
#

Rip spigot

opal juniper
#

always use spaces not tabs

empty gyro
#

ok yeah still no effect .-.

glossy venture
#

tabs look so bad on gh

opal juniper
#

just bad for diffs generally

empty gyro
young knoll
#

Who types them manually

opal juniper
#

LMAO

eternal oxide
#

I prefer tabs myself, but yaml standards are spaces

opal juniper
#

my editor just replaces my tabs with spaces

#

so i press tab, but get spaces

vocal cloud
#

Based editor

glossy venture
#

yeah intellij does that by default

opal juniper
#

^

#

so does pycharm i think

glossy venture
#

probably all jetbrains ides

opal juniper
#

it it REALLY matters there

#

cause if you mismatch spaces and tabs in python you have to go through all of them and change one to the other

empty gyro
#

they do?

#

oh

glossy venture
#

jetbrains has like almost no competition when it comes to professional IDEs

#

they so good

empty gyro
#

i was using spaces anyway then -_-

opal juniper
#

i found it a bit of a letdown

hazy parrot
#

Why would you even use fleet

glossy venture
#

true

empty gyro
#

vscode > fleet however intellij > eclipse

glossy venture
#

intellij def top for java dev

empty gyro
#

indeed

wet breach
# tall dragon u cant ever get too much caffeine

In this video we look at the Binary number system. Our jumping off point is comparing and contrasting it to the Decimal number system, which is already familiar to us. This makes understanding Binary much simpler.

We then learn how to count in binary, and how counting in Binary is actually very similar to counting in decimal.

Then we look at ...

▶ Play video
#

this guy explains it very well without using anything confusing

tall dragon
#

oh thanks, will take a look

wet breach
#

once you learn how easy binary is, it then makes sense when you start shifting bits left and right

eternal oxide
#

once you remember to flip left to right

quaint mantle
#

can someone tell me whats wrong with my code ?

((Directional)e.getClickedBlock().getBlockData()).setFacing(BlockFace.WEST);

there is no error or exception on console it just ignores it

empty gyro
eternal oxide
#

Store teh BlockData so you can set it back on the block

wet breach
empty gyro
#

what

#

no it's apple

quaint mantle
#

or store it as Directional ?

wet breach
wet breach
quaint mantle
quaint mantle
wet breach
#

ok, but the first line in that code

#

is getBlockData()

quaint mantle
#

oh yeh

#

you are right

#

i just have to cast it 1 time

#

but it dosent solve anything , bruh

#

my block is anvil btw

wet breach
#

have you tried calling setBlockData() after you set the face?

quaint mantle
#

dude im so stupid

#

you are my hero

#

thx mate

tribal quarry
wet breach
spare radish
#

Hi, I recently created a biome by nms. I would like it to be created like any other biome when generating worlds. Any ideas?

wet breach
#

need to hook into the world generator stuff

glossy venture
#

why doesnt bukkit have mixins

#

i guess you could hook into a class loader or something as if you load your plugins before world gen most classes shouldnt be loaded yet

wet breach
#

well you can define a plugin to take over world generation

glossy venture
#

yeah but then all vanilla generation disappears

wet breach
#

which you can add back in your plugin

#

just because your plugin takes over, doesn't mean you have to override all the vanilla mechanics

glossy venture
#

pretty sure vanilla gen is more complex than just forwarding some chunk noise methods

glossy venture
#

which i dont think is easy with current api

wet breach
#

you could probably use NMS to add your biome to the list

#

or some reflection

glossy venture
#

yeah true

#

just look into how mods do it

#

forge mods or smth

wet breach
#

the easy route is to just let the vanilla mechanics do their thing and then on chunk load change the biome to your custom at whatever interval

spare radish
#

Thanks for all the different ideas. I will try them one by one.

plush nest
#

can someone help me as to why this doesn't work I looked at the spigotmc wiki and everything, it uses 1.8.8 api if you need to know that

wet breach
#

add this in that paranthesis

plush nest
#

oh wow it worked thank you very much

jagged bobcat
#

Store() requires something

wet breach
#

first want to check that it is a number before parsing it as one, otherwise you will get a NAN exception

jagged bobcat
#

It throws NumberFormatException

wet breach
#

you could

#

just as long as you are checking first before parsing is all

wet breach
tardy delta
#

just catch the exception

wet breach
#

while you could do that, that is the improper way to go about it

plush nest
#

/store help

tardy delta
#

some String#matches or Pattern#matches

#

regex is probably [0-9]+

ivory sleet
#

\d+ :>

tardy delta
#

mmh

wet breach
#
private Pattern pattern = Pattern.compile("-?\\d+(\\.\\d+)?");

public boolean isNumeric(String strNum) {
    if (strNum == null) {
        return false; 
    }
    return pattern.matcher(strNum).matches();
}
ivory sleet
#

But also, \d or [0-9] class wont be able to match really large numbers

tardy delta
#

its an int so probably dont need the (\\.\\d+)?

wet breach
#

but the super easy way since spigot has Apache Commons is this

#
StringUtils.isNumeric(CharSequence)```
tawny pine
#

Guys how can I set the pose of a player (NPC) to sleeping? I've looked online already and in the docs, but I'm getting lots of mixed answers.

#

In the latest version that is (1.19.4)

#

🙂

tardy delta
#

packets probably

tawny pine
tardy delta
#

idk

tawny pine
#

Oh ok np 🙂

tardy delta
#

there is a Player#getPose but i dont see a setPose

tawny pine
tawny pine