#help-development

1 messages · Page 107 of 1

tender shard
#

yeah custom biomes are easy

#

it was easily possible at least since 1.16, probably earlier

tardy delta
#

never done smth related lol

young knoll
#

1.16.1

smoky oak
#

did you ever do it yourself

#

because i have no idea how to do it

young knoll
#

That’s when Mojang added biome registry syncing

tender shard
#

lemme look through my NMS code

smoky oak
#

remember that i need per block biome

#

not in that 4³ area

tender shard
#

basically you can just add your own biome to that registry and that's it

#

(but ofc this will not alter the default world generation, in case that's what youre talking about)

young knoll
#

If you want that just make a datapack tbh

#

It’s easier

tender shard
#

yeah

#

(although I hate datapacks)

#

(because I dont understand how they work)

#

does anyone here know the Blaze and Caves datapack or whats it called?

smoky oak
#

that 256 height nether thingy

#

?

tender shard
#

no

#

it adds a ton of new achievements

#

like, thousands

smoky oak
#

idk that one

tender shard
#

I used to use this in my ingame events

#

I used to do advancement speedruns with a custom plugin

#

e.g. people did /challenge and it opened a GUI with "non-vanilla" achievements and whoever did one of those first, got some prize

#

e.g. "be the first one to have a full set of "flower pots" with ALL kinds of flowers in one chunk"

#

stuff like that

#

or "look at a beacon with a spyglass from at least 200+ blocks distance"

young knoll
#

Yeah

#

Could be cool for that

#

Dumb for survival though

tender shard
#

it's really an awesome datapack

#

yeah it's useless for survival in general

young knoll
#

Way to much bloat

tender shard
#

but it makes a great thingy for stuff like give away events

young knoll
#

Advancements are meant to be neat little challenges, not “Craft a trapdoor”

twilit roost
#

How to run WorldCreator#createWorld() async?

tender shard
#

you don't

eternal night
#

you don't

#

wow

tender shard
#

^

#

lelz

twilit roost
#

then how can I overcome that stall?

tender shard
#

maybe paper has a feature for this

twilit roost
#

when generating

tender shard
eternal night
#

I mean, world loading is slow /shrug

twilit roost
eternal night
#

on paper you can disable loading the spawn chunks

twilit roost
twilit roost
eternal night
#

since when does bukkit/spigot support not loading spawn chunks

#

that feature does not even exist in spigot kekw

twilit roost
#
    @EventHandler
    public void disableInitChunkLoad(WorldInitEvent e){
        e.getWorld().setKeepSpawnInMemory(false);
    }
twilit roost
eternal night
#

you already have to have the world then

#

that is too late

tender shard
#

?xy

undone axleBOT
tender shard
#

what are you trying to achieve?

twilit roost
#

Im just trying to create worlds without having all players stuck on place due to lag

tender shard
#

I'd go for bungee and use a separate server

#

how big are those worlds?

#

are they limited in size?

twilit roost
#

300x300

tender shard
#

if so I'd use a "placeholder" void world

#

you can load a void world on startup

#

and then paste your "world" into the void world

twilit roost
#

but how to generate terrain after

tender shard
#

by using a normal world and using per player world borders

#

and just teleporting them to that world?

twilit roost
#

teleporting but also changing some blocks at some coords

tender shard
#

why dont you just use a totally normal world?

#

and then you can keep track of stuff like

#

player 1 has its world at 0|0

#

player 2 has its world at 1000|0

#

player 3 has its world at 0|1000

#

etc

twilit roost
#

im creating minigame
and for easier management im creating new World for each game
since each Game doesn't need that much resources

#

its really light weight
except that generation part

tender shard
#

yeah but that's overkill

#

why not use the same world for all games

#

just put them apart by 1000 blocks if its only 300x300

twilit roost
#

don't want to manage Tab

tender shard
#

hm

#

well

#

but yeah world loading will always cause lag

#

if not even paper has a feature for it, then I am pretty sure you cannot just do it in spigot

twilit roost
#

if I would just use void world and then for each chunk in border I would do : chunk.load("generate"true);

#

it would lag, but I could controll when it will lag

tender shard
#

?

kindred valley
#

How can i change all words i texted in the class?

tender shard
#

"generate"true?

tender shard
#

e.g. Ctrl+R in intelliJ

twilit roost
#

"generate" that IntelliSens thing
in case you wouldn't know what that true would do

tender shard
#

you could try to use PaperLib

warped escarp
#
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "lp user "+ player.getName() + " meta setsuffix "+ badges_int +" §7§lʃ §f§lѺ");

Hi, I want to put a suffix of luckperm from the console but there are spaces so it doesn't put me the whole suffix.

tender shard
#

it can create new chunks async on paper, or sync on spigot

twilit roost
#

ooh never head of that

tender shard
#

@eternal night is PaperLib still a thing?

eternal night
#

yea

tender shard
#

Because there's so many nice features I could think of

#

e.g. making stuff listen to PlayerJumpEvent

eternal night
#

You can always PR those

tender shard
#

yeah but

#

gradle

#

contributing

#

understanding paper

hybrid pond
#

If I'll add BukkitTask to the Map<Location, BukkitTask>, after scheduled task execution Map.containsKey(blockLocation) will return true or false?

tender shard
#

not my kind of stuff lol

eternal night
#

I mean paperlib only uses paper api

#

nothing internal

#

you don't really have to understand paper lol

tender shard
#

e.g. suggestion for PaperLib:

A PlayerJumpEvent. On paper, it uses the native event. on Spigot it could use the IncrementStats event

twilit roost
#

PaperLib is executable?
I thought its some sort of API

tender shard
#

and then pass it on to plugins

#

so people can enjoy the jump event on both spigot and paper without having to worry about whether someone uses spigot or apper

kindred valley
#

I am storing itemstack by their custom model data. Would it be a risk?

tender shard
tardy delta
eternal night
twilit roost
tardy delta
warped escarp
#
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "lp user "+ player.getName() + " meta setsuffix "+ badges_int +" §7§lʃ §f§lѺ");

Hi, I want to put a suffix of luckperm from the console but there are spaces so it doesn't put me the whole suffix.

kindred valley
tender shard
#

wtf

hybrid pond
eternal night
#

wat 😂

tender shard
#

PersistentDataContainer is a long word, yes

#

but your IDE PROOOOBABLY has a tab-completion feature

eternal night
#

don't say long words MonkaChrist

#

or use var

kindred valley
tender shard
#

yeah

#

.put(...)

#

sooo long

#

erm

kindred valley
#

customdata better

#

nvm

tender shard
#

set(...)

#

sorry

#

it's set, not put

eternal night
#

are you currently complaining about method name length ? xD

tender shard
#

no

#

I think

#

what they mean is this:

#
  1. you gotta pass in the namespacedkey (damn, what a long word)
  2. you gotta pass in the data type
  3. you gotta pass in the value you wanna set
eternal night
#

Well yea, you gotta pass a few "a lot of characters to create" parameters

torpid sapphire
#

i asked this yesterday but didnt get a working answer, any ideas?

tender shard
#

some people complain about PDC, meanwhile I'd totally make out with lynx for adding it

eternal night
#

but the general issue still stands

#

custom model data might change

tender shard
#

PDC for real is like NBT on crack

kindred valley
tender shard
#

it even has stuff builtin to translate your complex classes into primitive stuff that are "storable"

tender shard
#

obviously

eternal night
#

mate you are coding not writing an essay

twilit roost
tender shard
#

I mean, what's longer? the chinese wall, or your cock?

eternal night
#

a method length is not a valid argument

tender shard
warped escarp
#
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "lp user "+ player.getName() + " meta setsuffix "+ badges_int +" §7§lʃ §f§lѺ");

Hi, I want to put a suffix of luckperm from the console but there are spaces so it doesn't put me the whole suffix.

kindred valley
eternal night
#

wouldn't you wanna use the luckperms plugin API

#

if a method siganture of that size "fucks your brain"

#

maybe don't code java yet ?

tender shard
#

the design of PDC is straightforward. You toss in

  1. the "name of your key"
  2. the datatype you expect
  3. THATS IT ALREADY
#

if you have problems with that, maybe take a look at assembly

#

all "methods" there are only 3 letters

kindred valley
#

Ok mfnalex

tender shard
#

LDA

#

ASR

#

BCC

#

LDA

#

AND

#

JMP

#

very straightforward

twilit roost
#

except byte management

#

and values

tender shard
#

yeah or stuff like... everything else

#

although I have to agree

twilit roost
#

asm is meant only for gods

tender shard
#

instead of getPersistentDataContainer(), it should have been getPDC() 😛

eternal night
#

maybe just pdc()

#

for the cool kids style

kindred valley
#

😡

tender shard
#

lol

eternal night
#

I mean, for all I care, static import the data types

#

store the PDC in a variable or smth

kindred valley
#

pdc not contains untickable blocks

eternal night
#

nor does custom model data

#

whats the point xD

twilit roost
#

I have PaperLib setted up..
Should I get chunk async and try to async generate it?

tender shard
#

"PDC is much to type"

#

I disagree

twilit roost
# tender shard

what plugin are you using for that auto completion?
the way u completed new NamespacedKey..

ornate mantle
#

copilot gang

tender shard
#

it's paid, unless you have a university or school email address

kindred valley
tender shard
#

you know what else is shorter?

#

player.kick()

eternal night
#

this is the least meaningful discussion in a while 😂

#

I love it

delicate lynx
#

copilot is free with school emails? hell yeah I need that

tender shard
#

yeah limpeex is trolling since hours

tender shard
#

well

#

at least it is for my university email

ornate mantle
#

apply for github student pacl

tender shard
#

I'm in 19th semester now lmao

ornate mantle
#

u gotta have some form of verification of being in school

delicate lynx
#

I have 2, maybe one will work

ornate mantle
#

like a report card or somthing

tender shard
ornate mantle
#

i had to send my report card

delicate lynx
#

wtf

ornate mantle
#

got it a few hours later but i checked 2 weeks after

tender shard
#

hm then your school's domain isn't part of their "trusted schools" list

ornate mantle
#

yeah its not

tender shard
#

well almost all universities get accepted automatically

ornate mantle
#

i can say with confidence no one has ever tried to get github student pack in my entire school

tender shard
#

e.g. I got unlimited @still fulcrum-muenster.de and @wwu.de addresses and they all get accepted automatically, everywhere

#

at jetbrains, at github, at adobe, at microsoft, ...

ornate mantle
#

im not in uni

tender shard
#

yeah okay

ornate mantle
#

im in a school

kindred valley
#

alex tries to present as many counterargumen as he can

tender shard
#

if you're only on a "regular" school, then yeah they will have to accept it manually, that's normal

kindred valley
#

thank you

ornate mantle
#

lmao

tender shard
#

actually I think this is time to block this troll

kindred valley
#

I am not a troll

tender shard
#

you are

kindred valley
#

I just said it was shorter

#

Troll?

#

no im a terrorist

tender shard
#

and I gave you examples of what's even more short

#

player.kick() is even shorter than myItemMeta.getCustomModelData()

reef lagoon
#

ahhh right shorter code

tender shard
reef lagoon
#

save the bytes

tender shard
#

I for myself would rather System.out.println(...) than doing std::cout

#

like wtf is cout?

#

does anyone know?

eternal oxide
#

if your method name doesn't trigger a word wrap you are not doing it correctly

tender shard
#

System.out <- output stream

#

println <- print a line

reef lagoon
#

if something can be done in 1 line why do it in 2 lines

#

readability is nothing

tender shard
#

meanwhile "cout" = whut?

ornate mantle
#

does std.cout even work on java

#

std::cout or whatever

tender shard
ornate mantle
#

yeah i know

tender shard
#

yeah but what's the question then

ornate mantle
#

i dont even know

tender shard
#

lol

ornate mantle
#

saw you comparing std::cout to sysout

tender shard
#

Giorno are you italian?

ornate mantle
#

no im british

tender shard
#

oh I just wondered because of your username

#

like

#

bongiorno

ornate mantle
#

giorno is an anime character's name

#

yeah

tender shard
#

or however its spellt

ornate mantle
#

means day

tender shard
#

yeah

#

day420

#

420 blaze it

ornate mantle
#

weed all day

tender shard
#

I stopped putting the weed into my body 3 years ago

#

now all I inhale is jägermeister and tobacco

#

and, sometimes, fresh air

#

while(!dead) breath();

#

no wait, I can do this better

ornate mantle
#

all i breathe is air

tender shard
#
@Override
public void tick() {
  if(!dead) breath();
  ...
torpid sapphire
#

also where my name came from but Felix420 was taken

ornate mantle
tender shard
#

why not Felix42 or Felix421

ornate mantle
#

why not Felix_420

torpid sapphire
#

doesnt flow as well

tender shard
ornate mantle
#

why not Xx_Felix420_xX

tender shard
#

yeah

#

xX_Felix_421_BlazeIt_Slay00r_420_419_Async_Xx

torpid sapphire
#

was hilarious at the time

tender shard
#

talking about "hilarous" things...

#

1 min pls

warped escarp
sterile token
#

@sterile token

#

?

ornate mantle
#

when initialising an NPC is there a way to change their name after setting their GameProfile

sterile token
tender shard
ornate mantle
torpid sapphire
#

ive always hated guis, especially since im mostly a rust dev and the gui ecosystem over there is hell

tender shard
#

I do GUI apps since 10 years and they are ALWAYS hell

sterile token
tender shard
#

apple is the only company that got it at least HALFWAY right

sterile token
#

I seen a ping from you

tender shard
torpid sapphire
tender shard
torpid sapphire
#

"since 10 years"

smoky oak
#

how do wildcards again

tender shard
#

oh

torpid sapphire
#

seit 10 jahren

tender shard
#

is it "for 10 years"?

smoky oak
#

yes

sterile token
torpid sapphire
#

yes

tender shard
#

well

#

TIL

#

thanks

#

okay but wait

#

"since 10 years ago"

austere wave
#

Hello guys, I'm trying to add mongodb on my plugin, but when I start it using java -Xmx1G -Xms1G -classpath "spigot-1.17.1.jar:lib/*" org.bukkit.craftbukkit.Main The console give me this error: java.lang.NoClassDefFoundError: org/litote/kmongo/KMongo, everything is working in the plugin

tender shard
#

that would be correct i guess

smoky oak
#

yea

torpid sapphire
#

it would be

sterile token
smoky oak
#

trying to make the check generic

torpid sapphire
#

but you usually dont say it like that in this context

smoky oak
#

im checking if all instances of the innermost arraylist are exactly 1 in size

tender shard
#

are you using maven @austere wave ?

tender shard
#

?paste your pom.xml file

undone axleBOT
smoky oak
#
for(ArrayList<ArrayList<?>> list1 : rItems){
  for(ArrayList<?> list2 : list1){
    if(list2.size()!=1) return false;}}
return true;
sterile token
tender shard
smoky oak
#

but if i say T instead of ? it says 'symbol not found'

sterile token
#

Me that I only like lambda stream

tender shard
twilit roost
#

How to use PaperLib with NMS Remapped?

sterile token
tender shard
austere wave
tender shard
#

you just do PaperLib.doStuff()

tender shard
austere wave
smoky oak
sterile token
#

Maybe ask there

twilit roost
#

yee but when I package plugin and try to use it
I get NoClassDefFoundError pointing to io/papermc/lib/PaperLib

twilit roost
tender shard
sterile token
#

Because spigot != paper

tender shard
#

PaperLib is a separate dependency @sterile token

sterile token
#

I mean mostly here do spigot stuff so they wont know anything about paper

#

Ohh ok

#

My bad

#

Also who is pinging me?

#

😂 😂

tender shard
#

PaperLib is like a lib that makes people use paper features on paper, or fall back to normal stuff on spigot

twilit roost
#

^

tender shard
torpid sapphire
#

can i somehow figure out the name of an item that the client shows? i want to add a prefix to the item name

tidal yacht
#

umm, how to change custom model data for trident ( and the entity) using resources pack?

tender shard
smoky oak
#

so either im an idiot or itemStack isnt an object

tender shard
twilit roost
#

OH MY

warped escarp
#
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "lp user "+ player.getName() + " meta setsuffix "+ badges_int +" §7§lʃ §f§lѺ");

Hi, I want to put a suffix of luckperm from the console but there are spaces so it doesn't put me the whole suffix.

austere wave
ornate mantle
#

what boolean value is null

twilit roost
#

why ArrayList inside ArrayList inside ArrayList

tender shard
#

you must compile it using maven

#

one sec

torpid sapphire
smoky oak
#

nope

tender shard
#

in intellij, on the right side, click on "maven" and then double click on "package"

ornate mantle
#

or just open the console and type mvn package

#

WHAT BOOLEAN VALUE IS NULL

sterile token
# smoky oak

Bruh do:

public <T> ArrayList<ArrayList<T>> función()

tender shard
tender shard
#

it cannot work

sterile token
#

What the hell is he doing?

#

I dont understand what the fuck is doing with an array inside another Array

#

🤔

tender shard
#

but booleans will be false instead of null

smoky oak
#

its the raw data structure returned by a scan method

#

material -> blocks of that material -> entities standing on that block

tender shard
#

@smoky oak paste your whole class

sterile token
#

English-english, not english-dev lang. Hahaha take care im not very good with thechnical things

warped escarp
#
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "lp user "+ player.getName() + " meta setsuffix "+ badges_int +" §7§lʃ §f§lѺ");

Hi, I want to put a suffix of luckperm from the console but there are spaces so it doesn't put me the whole suffix.

austere wave
warped escarp
sterile token
tender shard
# austere wave Same error

did you actually use the new .jar? maven creates the compiled .jar inside <yourIntelliJProjectFolder>/target/YourPlugin-Version.jar

warped escarp
sterile token
#

Metadata*

sterile token
#

And then set the Prefix I think

tender shard
#

if you wanna get rid of it, remove the space?

warped escarp
tender shard
# austere wave Yes

then you're doing something wrong. If you upload your whole project to github, I can check it out. If you won't, I can't help you

sterile token
austere wave
#

Give me 30m

tender shard
warped escarp
sterile token
#

They will support better

warped escarp
sterile token
#

Because they are experience with their api

smoky oak
sterile token
#

Because doing vía code is better than harcoding it vía command

tender shard
#

lmao I'm stuck between 1199 and 1200 users

twilit roost
#

am I doing it right?
since I always get error: Unsupported class file major version 61

iron glade
mighty pier
#

if i have a message "# hi" or "# this is a message" how could i remove the # and all of the spaces that follow it?

tender shard
#

it's YAGPDB

tender shard
# twilit roost

where do you get this? while compiling? while running the plugin?

twilit roost
#

while packaging plugin in maven

hybrid pond
#

How can I get one persistent location from any of 4 blocks of the double door? Current block pointer already is pointing to the bottom block of the door

eternal oxide
#

all Doors are BiSected

#

cast to BiSected, gotTop

#

sorry getHalf(TOP)

#

or whatever it is

hybrid pond
#

I don't have problem with top/down

eternal oxide
#

you only have to find the second door with a search of BlockFace

#

N/E/S/W

tender shard
#

set it to "3.3.0"

#

or show your pom.xml

#

?paste

undone axleBOT
twilit roost
#

i somehow resolved it
I had wrong shade plugin code prob..
I just quickly swapped from remap plugin to shade so it wasn't working

I then tried using original shade plugin and it works greatly

tender shard
#

your problem was that you had an old maven-shade-plugin version

#

3.3.0 can do java 17 code, but the older versions, e.g. 3.2.2 can only handle up to java 15 or so IIRC

#

to stop it, just return "false" in "canUse"

#

yeah well, I dont know how you'd know how to stop it

#

when do you wanna stop it?

#

then you can just do something like this in canUse():

#
if(myMob.isNear(targetLocation)) return false;
return true;
#

so just check if it's already near the target. if yes, no need for your goal. if no, "canUse = true"

#

that will only happen if you didnt add any other goals

#

or if you deleted all other goals

#

normally you want to keep the vanilla goals, and only add yours "on top"

#

what priority did you use to add your goal?

#

it's zombie specific, right?

#

no, I meanwhen you do goalSelector.addGoal(NUMBER, ...)

#

what did you use for NUMBER?

#

should work fine then

#

the normal entity goals are 4 and 8

#

so if your goal returns "false" for "canUse", it should continue with the normal zombie behaviour

#

I'd do something like this:

if zombie is nearby where I want the zombie to go: return false for "canUse"
otherwise return true
and with nearby, I mean like +/- 2 blocks in every direction or so
#

no, that was pseudo code

#

just take your target location, and the actual location

#

then check if the actual location is inbetween targetLocation + and - 2 in every direction

#

and if yes, it's "near"

#

yeah well

#

1 minute

#
    public static boolean isNear(Location target, Location actualLocation, double radius) {
        return target.getWorld().equals(actualLocation.getWorld()) && target.distance(actualLocation) <= radius;
    }```
#

copilot

#

lm ao

hybrid pond
#

He's just best developer :>

tender shard
#

I only wrote the signature

#

copilot wrote the actual method content

#

copilot codes for you

#

just check this

#

I just wrote "isBettanationANicePerson" and it said "return true"

eternal night
#

if I see one more person using distance instead of radius * radius

#

imma grab my pitchfork

tender shard
#

ofc people should use distanceSquared instead

#

on the other hand

#

do some benchmarking and you'll see that it's totally neglibable on modern CPUs

eternal night
#

I mean, its free cpu cycles

tender shard
#

yeah you're right

#

as said, copilot wrote this

eternal night
#

to be expected

#

trash github

tender shard
#

I'd also go for distance squared instead

#

nah

#

copilot is awesome

#

have you tried it?

eternal night
#

I have tho It has not helped me much

tender shard
#

hm it has helped me very much

eternal night
#

mostly because I spend most of my time thinking how I design the solution to my problem

#

the implementation usually is trivial

eternal oxide
#

until some devs finds their code in another product, sues and finds out it was copilot that put it in there.

eternal night
#

so the speed up was negligible

tender shard
#

yeah it depends

eternal oxide
#

then they both sue Google

tender shard
#

sometimes its EXTREMELY USEFUL while sometimes it also just suggests bullshit

eternal night
#

yea I personally don't agree enough with github copilots moral point of view

#

to use it

#

for the little speed up it yielded me

tender shard
#

big companies and morals...

#

I mean

eternal night
#

does not mean I have to support them

tender shard
#

then you also must not order food at macdonalds or not order stuff from amazon or not buy books from <insert random book company> and stuff, I guess 😄

tender shard
eternal night
#

I do infact avoid amazon when possible

#

but yea I get your point

tender shard
#

I got copilot for free anyway so why not use it?

#

sometimes it's REALLY helpful

eternal night
#

student mail supremacy

tender shard
#

it can even detect that an "AIR" item is basically considered "kinda null"

eternal oxide
#

I don;t use it as I don't want to get into a habit of using it only for it to go premium.

eternal night
#

damn github copilot already failing again

#

to use .isAir()

#

smh

tender shard
#

well well well

#

depends

#

CAVE_AIR is never an itemstack

eternal night
#

depends

#

not server provided no

tender shard
#

some methods do return an ItemStack of AIR with amount = 0

#

but no method ever returns an itemstack of CAVE_AIR

eternal night
#

depends on what canUse does

tender shard
#

no

#
@Override
public boolean canUse() {
  return !isNear(myMob.getLocation(), myTargetLocation, 2.0D);
#

in the tick() function, you don't worry about whether you're already near or not

#

in tick(), you just move to target

#

and in canUse(), you check if you're already "there"

austere wave
#

@tender shard i'll send you the link in dm

tender shard
#

@somber pivot I cannot accept random friend requests for help-dev questions

#

just use this channel please

austere wave
#

ok

tender shard
#

erm

#

why do you have the kotlin maven plugin if you dont even use kotlin

austere wave
#

I need the plugin to compile kotlin

tender shard
#

but you do not have any kotlin code

austere wave
#

I have

#

The entire plugin is in kotlin

glossy venture
#

you need to put your kotlin in src/main/kotlin

#

not java

#

i think

austere wave
#

No

glossy venture
#

pretty sure you do

#

its in the jetbrains kotlin maven guide

#

unless you configured your kotlin plugin different

#

and changed the source sets

#

its there

austere wave
#

The plugin works fine with that configuration, its just the mongodb which causes the error

glossy venture
#

bruh then say that

#

oh i found old messagss

#

ok

glossy venture
austere wave
#

I need help with this error java.lang.NoClassDefFoundError: org/litote/kmongo/KMongo

glossy venture
#

you didnt shade mongo in correctly

#

i dont use maven so idk how to fix that

tranquil dome
#

I am using multi modules in maven to support NMS in multiple versions, and I need to use the plugin instance in the api module. How can I get this without using cyclic dependencies?

chrome beacon
#

The API should never depend on the implementation

tranquil dome
#

How should I get the Main plugin class then?

chrome beacon
#

You make an interface with the methods that you need

#

Your main class then implements said interface

kindred valley
#

Do you guys have information/links about models?

chrome beacon
#

What model format?

kindred valley
chrome beacon
#

There are many model formats. Which one do you need information about?

kindred valley
#

idk if its a format

chrome beacon
#
Minecraft Wiki

Block models are used to depict all the blocks in the game, whereas item models are used to display the items in the players, hand, on their head (helmets and hats), on the ground, in the inventory, in item frames and on armor stands. As there are different variants of some blocks, block states are used to link these with the corresponding model...

#

^^ That's what you want

#

You can use Blockbench to make it easier for yourself when making custom models

tranquil dome
# chrome beacon Your main class then implements said interface

That's not exactly what I wanted to do. The class I am talking about does not necessarily have to be in the api module, because it is just a regular class. It is a handler which loads and gets config files from the resources folder. Initially I put it in the main plugin module, but because I couldn't call it from the version specific modules, I put it in the api module and faced the same problem: cyclic dependency. Do you have any advice on what I should do in this situation? I'm new to pom projects.

eternal oxide
#

Your version specific modules can not depend in any other module. not API not your main plugin

sterile token
#
  1. plugin-api-module (Should mostly contain interfaces or abstract classes)
  2. plugin-core-module (Should contains api implementations and others things)
eternal oxide
#

If your version specific module needs a file it should expose a method in the API to provide that

sterile token
twilit roost
#

How to get rid of flying trees in custom Tree Populator?

for (int iteration = 0; iteration < 25; iteration++) {
            int x = random.nextInt(16) + chunkX * 16;
            int z = random.nextInt(16) + chunkZ * 16;
            int y = 319;
            while(limitedRegion.getType(x, y, z).isAir() && y > -64) y--;

            if(!limitedRegion.getType(x, y, z).isAir()
                    &&limitedRegion.getType(x,y,z)!=Material.WATER
                    &&limitedRegion.getType(x,y-1,z)!=Material.OAK_LEAVES
                    &&limitedRegion.getType(x,y-1,z)!=Material.OAK_LOG) {
                limitedRegion.generateTree(new Location(Bukkit.getWorld(worldInfo.getUID()),x,y,z),random,tree);
            }
        }

I also did check earlier for ending of Material name, not just for OAK

kindred valley
#

?paste

undone axleBOT
sterile token
eternal oxide
#

Depends what they are managing

#

remember there are two things API and implementation.

#

API is simply how you get access to the methods.

sterile token
#

Then you have probems....

eternal oxide
#

implementation is teh operation code behind the API

#

then you don;t do the user management in teh code

sterile token
#

?

eternal oxide
#

well depends what yoru core module is

#

if your core module is behind the API then its not an issue

sterile token
#

I mean

#

Let say:

  1. The api module contains something like an interface PluginNameAPI and there i want to expose a UserManager getter

  2. The core contains the UserManager and will do the api implementation

How do i do that? Because api wont even know what its UserManager

#

Do i explained ?

eternal oxide
#

the API only exposes method not implementation. it doesn;t need to know anything about the UserManager

sterile token
#

So there you have problems

#

I dont think im explaning well

hybrid pond
#

blockInteract on the door is invoked before or after door open state is changed? I mean in blockInteract method door.isOpen() == thue is open when player is opening the door?

eternal oxide
#

ok
Your UserManager depends on API.
Your Plugin depends on API.
Your API depends on nothing

tranquil dome
#

I understand that the API should have abstract classes/interfaces with methods for the main/version modules to use. In this case I want those modules to be able to use this abstract method, BUT the abstract method requires the plugin instance. This is the code in my Main class.

    private lateinit var version: String

    override fun onEnable() {
        Configs().loadConfigs(this)
    }

    fun getVersion(): String {
        return version
    }

And this is the method in the Config class of my API module.

    fun loadConfigs(plugin: Main) {
        if (plugin.getVersion() != "v1_8_R3") loadConfig("legacy-pvp", "legacy-pvp", plugin)

        loadConfig("config", "config", plugin)
        loadConfig("modules/bows/config", "modules_bows_config", plugin)
        loadConfig("modules/damage/config", "modules_damage_config", plugin)
        loadConfig("modules/projectiles/config", "modules_projectiles_config", plugin)
        loadConfig("modules/projectiles/entities/arrows", "modules_projectiles_entities_arrows", plugin)
        loadConfig("modules/projectiles/entities/eggs", "modules_projectiles_entities_eggs", plugin)
        loadConfig("modules/projectiles/entities/fireballs", "modules_projectiles_entities_fireballs", plugin)
        loadConfig("modules/projectiles/entities/fishingrods", "modules_projectiles_entities_fishingrods", plugin)
        loadConfig("modules/projectiles/entities/snowballs", "modules_projectiles_entities_snowballs", plugin)
    }

As you can see, the API depends on the main module and the Main class depends on the API module. Since I want to use the methods of this Config class in all other modules, I put it in the api module. But to use the Main class, it needs cyclic dependencies. Is there any way around this? Should I put the Config handler in my main module? If I do this, I cannot use it in version modules because of again cyclic dependencies. This might just be me not understanding exactly how pom projects work, but I really don't understand how to get this to work.

eternal oxide
#

API shoudl not depend on anything

#

not unless its a pass through

#

IE you add a depend in yoru API to Spigot-api so everything that implements your API can also access spigot

#

your API contains all the interfaces you are going to expose.

#

so Your core module depends on your API. Your API contains the interface for yoru core module

twilit roost
#

Does someone have default vannila Tree Populator?

tranquil dome
#

So if I were to create an abstract class for the Config handler, I would still need to override the method in my core module for it to work with the Main instance? So then, how should I get the Main instance in my version specific modules without cyclic dependencies?

eternal oxide
#

You don;t get an instance you pass an instance from your main when you ask for something from your module

#

eg, the Bukkit scheduler requires you pass a plugin instance when you use it

#

Think of the API as a firewall. It knows nothing beyond it. Anything you want it to know about you have to pass it through

quaint mantle
#

how would i change TimeAPI.Time.MS to Time.MS

eternal oxide
#

why?

quaint mantle
#

because it looks better

eternal oxide
#

that would break teh API as you would be setting Time static

quaint mantle
#

alr

#

so keep it like that

#

👍

mellow pebble
#

?paste

undone axleBOT
mellow pebble
#

Im trying to add setspawn command to my plugin and when i try to save values to config.yml it deletes the rest and that is it and i really dont know why since it doesnt make any errors in console my code is here https://paste.md-5.net/ofekuqifiw.java

eternal oxide
#

if you want the command to work for each player, they each need their own entry

eternal oxide
#

you only have one entry in the config

sterile token
#

Sorry for asking this noob question but how i do allow a player to break/place blocks when another plugin is calling it?

eternal oxide
#

world,c,y,z,pitch,yaw

sterile token
#

🤔

eternal oxide
#

its not under any key

mellow pebble
#

so it has to be under some key ?

eternal oxide
#

if you want more than one

eternal oxide
#

and you shoudl be using .set not addDefault

tardy delta
#

that sentence doesnt make sense

old cloud
eternal oxide
#

don;t store config in a variable, it always leads to stale references

sterile token
old cloud
eternal oxide
#

Yes inside the scope is fine

sterile token
old cloud
#

Calling getConfig 10 times is just bad

tardy delta
#

have a higher priority in your event

eternal oxide
#

Not really, its memory resident. its only reading from a Map

mellow pebble
old cloud
#

Yea but dont call this method again for each entry you add

tardy delta
old cloud
#

No I cant

mellow pebble
sterile token
tardy delta
#

hmm probably

sterile token
old cloud
tardy delta
#

then your listener will be called last so overriding other listeners with a lower priority

#

if those other plugin use highest priority too then fuck them

sterile token
#

So that will allow to place blocks no matter if other plugin cancel it right?

tardy delta
#

mye

sterile token
#

mye?

tardy delta
#

hmm yes

#

didnt conclure tell yo

sterile token
#

Are you are you are ayou sure?

kindred valley
#

Man

#

i tried to do something with switch

mellow pebble
tardy delta
#

im sure yes

kindred valley
#

and i accidentally fucked everything

#
int data = e.getCurrentItem().getItemMeta().getCustomModelData();
        if(data == 1) {
            p.openInventory(Pazar.swordGUI);
        }else if(data == 2) {
            p.openInventory(Pazar.foodGUI);
        }else if(data == 3) {
            p.openInventory(Pazar.blockGUI);
        }else if(data == 4) {
            p.openInventory(Pazar.toolGUI);
        }else if(data == 5) {
            p.openInventory(Pazar.mineGUI);
        }```
#
int data = e.getCurrentItem().getItemMeta().getCustomModelData();
        switch (data) {
            case 1: p.openInventory(Pazar.foodGUI);
            case 2: p.openInventory(Pazar.swordGUI);
            case 3: p.openInventory(Pazar.blockGUI);
            case 4: p.openInventory(Pazar.toolGUI);
            case 5: p.openInventory(Pazar.mineGUI);
        }```
tardy delta
#

man just grab some list and store those guis in there

old cloud
mellow pebble
kindred valley
tardy delta
#

i said highest

sterile token
tardy delta
#

yes

sterile token
tardy delta
#

so highest is last so they can override other listeners

sterile token
#

Ohh ok

tardy delta
#

and then you have monitor, which should not change the event anyhow

sterile token
#

But im mixed up haha

#

Because if a plugin blocks break right?

#

And my plugin has priority lowest will get executed after, so i will be able to break blocks in theory?

tardy delta
#

lowest gets executed first

sterile token
#

🤔

#

LMAO

tardy delta
sterile token
#

I have a nightmare

tardy delta
#

same

sterile token
#

HAHA

#

Let me translate it

#

Can u wait me please?

#

?translator

#

?deepl

eternal oxide
#

Lowest priority is executed first so higher priorities get the option of overriding it

tardy delta
#

that wont work mate

sterile token
#

?deeplp-translator

tardy delta
#

hmm love it when my screenshotting tool breaks

sterile token
#

HMNN

#

?TRANSLATOR

tardy delta
#

are you assuming that we have command for anything you want

sterile token
tardy delta
#

ofc not

sterile token
#

Oh

#

I thought it was a command

tardy delta
#

?where-to-get-weed wont work either

sterile token
#

Look I am making a plugin that will have a build mode which when you execute a command it should let you build. But the problem is that my plugin will not take care of protecting it from breaking, etc. But a separate plugin will do it.

#

Is it better now?

tardy delta
#

a separate plugin will handle whether or not you can break blocks?

tardy delta
#

whats the problem then

iron glade
#

sound like a bad way

tardy delta
#

you're willing to check if you can break a block?

sterile token
#

I just dont know how to allow breaking blocks them

tardy delta
#

you already have a plugin that allows or does not allow you to break blocks 💀

#

im confused

sterile token
#

I mean i cannot said much because its not for me i mean

eternal oxide
#

you don;t allow breaking. you prevent it or you do nothing

iron glade
#

true

sterile token
#

Let said you have a server with random protection plugin and this plugin im doing, the protection plugin wont allow to break/place blocks right? So when you enable the build mode you should be able to build

iron glade
#

and what's the problem now#

sterile token
#

That i dont know how to allow block breaking from my plugin side

#

🤔

tardy delta
#

override the listener of the protection plugin

#

so you have final say

#

by having a higher event priority

eternal oxide
#

listen on Highest and uncancel the blockbreak if it is cancelled

sterile token
#

🧐

eternal oxide
#

Not 100% reliable though

tardy delta
#

you sent a screen with lowest priority

sterile token
#

Or yes?

#

You burned my brains

#

😂 😂 😂

#

Sorry for being painful but its something confused what i explained

#

🤙

eternal oxide
#

The only way you can reliably override a cancelled BlockBreak is in your plugin break it manually and handle the drops.

tardy delta
#
@EventHandler(priority = EventPriority.HIGHEST)
private void onBlockBreakWhatever(BlockBreakEvent event) {
  event.setCancelled(false);
  // do whatever idk
}```
mellow pebble
eternal oxide
sterile token
#

lmao please use English-English

tardy delta
#

dont have ignoreCancelled cuz that will not fire if the event was cancelled before

sterile token
#

I dont understand that technical words

eternal oxide
#

you can;t guarantee you will be the last plugin running Highest

tardy delta
#

also that

sterile token
#

As it not for me

#

☝️

#

That is owner responsability

eternal oxide
#

leave the event alone, and do it yourself. breakNaturally and drop items

tardy delta
#

anyways breaking my head about an algorithm about how to parse math expressions based on their operator priority 🤓

mellow pebble
mellow pebble
arctic moth
#

anyone know what the operation is for setting it like this

#

in attribute modifiers

mellow pebble
tardy delta
#

show code

mellow pebble
# tardy delta show code
@Override
    public boolean onCommand(CommandSender sender, Command command, String s, String[] strings) {
        if(sender instanceof Player){
            Player player = (Player) sender;
            if(player.hasPermission("ghc.setspawn")){
                Configuration config = GermitHC.plugin.getConfig();
                config.set("Spawn.World", player.getLocation().getWorld().getName());
                config.set("Spawn.X", player.getLocation().getX());
                config.set("Spawn.Y", player.getLocation().getY());
                config.set("Spawn.Z", player.getLocation().getZ());
                config.set("Spawn.Yaw", player.getLocation().getYaw());
                config.set("Spawn.Pitch", player.getLocation().getPitch());
                GermitHC.plugin.saveConfig();
                player.sendMessage("§7[" + GermitHC.plugin.getConfig().getString("MainColor")+"!§7] §fYou have successfully set spawn");
            } else{
                player.sendMessage("§7[§c!§7] §fYou don't have permission to set spawn");
            }
        } else {
            System.out.println("[X] You have to run this commands as player!");
        }
        return false;
    }
arctic moth
#

rn i can only do things like this

mellow pebble
#

?paste

undone axleBOT
mellow pebble
#

however you like to read

young knoll
tardy delta
mellow pebble
#

in way

#

that it can be runned

#

and then

#

i deletes everything

#

from config.yml

#

and that is it

tardy delta
#

it removes the comments and fucks up indents i guess?

#

dont know why it would delete everything

mellow pebble
#

and everything else

#

keys and values

#

?paste

undone axleBOT
mellow pebble
hazy parrot
mellow pebble
#

this is the start

#

this is how it should be

#

this is default config

#

and content of config

hazy parrot
#

and also remove " from some strings if they dont have special characters because yaml doesn't need it

mellow pebble
#

this is what is in config after /setspawn

icy beacon
#

#Size can be: 9 - 18 - 27 - 36 - 45 - 56
No it cannot actually, 56 is invalid, 54 is

#

just a side note

icy beacon
#

nice

sterile token
#

How i can add a terminal to intellij

#

Im really idiot and i have closed it

#

And now i cannot find an option to set it back

icy beacon
sterile token
#

And i dont know how to put it back

mellow pebble
icy beacon
sterile token
icy beacon
#

np

sterile token
desert frigate
#

is it possbile to make it so only specific players can see blocks? basically im trying to make it so only certain people can see a campfire that is lit

sterile token
#
Caused by: org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping

 in 'reader', line 2, column 1:
    name: BuildMode
    ^
expected <block end>, but found '<block mapping start>'
 in 'reader', line 13, column 2:
     build:
     ^
#

Can someone explain what its wrong?

#

Haha

icy beacon
sterile token
#

I know the problem is inside the plugin.yml but not why

icy beacon
sterile token
icy beacon
#

it may be that you accidentally used tabs

sterile token
#

Hmn

sterile token
#

Weird

#

Its okay

#

🤔

icy beacon
#

can you send me the file

sterile token
#

yeah

#
name: BuildMode
version: '$[project.version}'
author: Alexito2060
main: x.x.BuildPlugin
api-version: 1.13
quiet ice
#

Worst case scenario you'll just use json

#

Version probably should be version: '${project.version}'

sterile token
icy beacon
#

line 13

#

there are 5 lines here

sterile token
icy beacon
#

lol

#

misindentation

quiet ice
# sterile token ?

YAML is a superset of json, using json is fully accepable in yaml space

icy beacon
#

don't you see

#

buildmode and build are on different indentation levels

sterile token
#

what?

#

Im lost

icy beacon
sterile token
#

OHHH

#

I never seen that

icy beacon
#

there should be 2 spaces

quiet ice
#

Enable the show whitespace characters in your IDE

sterile token
#

Cntains that?

icy beacon
#

just do this for now

quiet ice
#

I know eclipse does, and so does any text editor I know of

icy beacon
#

erase everything in the line before buildmode and put 2 spaces

#

the same for build

sterile token
#

Also its telling me an error in the name of the plugin

icy beacon
#

also you misspelt the usage for buildmode

sterile token
#

The name till doesnt work ps

#

Something its really wrong

desert frigate
#
BlockData data = (Campfire) Bukkit.getWorld("birchForest").getBlockData(new Location(Bukkit.getWorld("birchForest"),120, 94, -38));``` maybe i did smth wrong but i cant get the method data.setLit
tardy delta
#

dont get world twice

desert frigate
#

but

#

i still dont get the method

tardy delta
#

BlockData -> CampFire

desert frigate
#

doesnt casting it work?

tardy delta
#

youre declaring it as a blockdata, not as a campfire

#

java 🤓

queen apex
#

Me plugin isn't logging in correct format, expected behavior: [PluginName]: Message, [com.github.Dependency] is it now

icy beacon
#

oh it's the wrong log prefix

#

what do you use to log?

queen apex
tardy delta
#

hmm algorithms go brr

twilit roost
#

Does someone have advanced TreePopulator?
mine spawns trees in the air

tardy delta
#

makes it fun for gathering wood

sterile token
#

How i cancel a player to add things into some inventories like, Chest, Enderchest, Furnaces, etc?

twilit roost
#

cancel player? wdym

sterile token
#

I mean cancelling a user to put things into some inventories type, like chest, enderchest, furnaces, etc

twilit roost
#

InventoryClickEvent

sterile token
#

Ok

#

Thanks

sterile token
#

Because you can dupe

#

So i need to disable the interaction

noble forge
#

packets?

atomic swift
#

Does anyone know of a good minigame library

sterile token
sterile token
atomic swift
#

To make your own minigames

sterile token
#

So packets are off ancientking there

noble forge
#

oof

boreal seal
#

are you serious?

#

there no such a things

atomic swift
#

Bruv

#

Look it up

#

Spigot minigame lib

boreal seal
#

no

#

ew

noble forge
#

then put items back that are missing

sterile token
#

I was thinking disabling inventory type interaction

#

inventory type is chest, enderchest, etc cancel the event

hybrid pond
#

Hi, how can I execute all scheduled tasks on mod unload? (I have them all stored in Map<Vector, BukkitTask>)

desert frigate
#

<3

arctic moth
#

lol i chased a bunch of entities into unloaded chunks and my entire world unloaded

#

so im just chillin in the void

#

well spawn chunks are probably loaded

hybrid pond
sterile token
hybrid pond
#

Why do you think about forge?

arctic moth
#

is spigotcraft still down

hybrid pond
#

I program spigot plugin

arctic moth
#

nope

vocal cloud
sterile token
desert frigate
# desert frigate got it
Campfire campfire = (Campfire) Bukkit.getWorld("birchForest").getBlockData(120, 94, -38);
        campfire.setLit(true);```
nvm idk what im doing wrong
hybrid pond
#

Omg, I'm so sorry. But I said BukkitTask in the same message

sterile token
#

Just letting you know!

hybrid pond
sterile token
#

Also is there a page were i can find all 1.19 blocks including their id?

sterile token
#

Because im doing an enum with all the block which contains menus

sterile token
rapid vigil
#

Hello I have a quick question, when you change the player's display name using Player#setDisplayName, do you set it back to normal just using the same method but you set it to the player's name?
Like this I mean player.setDisplayName(player.getName());?

hybrid pond
#

How can I execute all scheduled tasks on plugin disable? (I have them all stored in Map<Vector, BukkitTask>)

sterile token
rapid vigil
hybrid pond
queen apex
#

My Dependencies are loging with there own groupid, how to force these to the plugin name?

sterile token
#

Can you be more detailed

glossy lily
#

is it possible to fix redstone lamps not showing up on maps using a spigot plugin

queen apex
sterile token
#

They are logging as [JDA] right?

boreal seal
#

?

#

</HTML>?

desert frigate
tardy delta
#

disable parent logger?

queen apex
sterile token
#

One way is to disable the dependency logger

boreal seal
#

verno i cant understand what the guy wants

#

oh

noble forge
sterile token
boreal seal
#

libs?

sterile token
#

so they log as [PluginName]

boreal seal
#

he cant really

sterile token
#

Yeah

sterile token
boreal seal
#

never did it before /; wish him gl

sterile token
#

Logger.getLogger("package.LoggingCLassName").setLevel(Level:OFF);

boreal seal
#

oh bukkit logger

#

lmao i dont use it

#

L

queen apex
#

Nice, i'll try it

sterile token
#

Its work with everything

#

Logger is from i think

#

Yup