#help-development

1 messages · Page 1821 of 1

thorny python
#

I need that jar file for agent stuff

glossy scroll
#

are you trying to use it as a dependency?

#

why the literal jar?

thorny python
#

well, sort of dependency but cannot be flatten

#

it have to be stay in jar form

glossy scroll
#

?xy

undone axleBOT
glossy scroll
#

this is not something you want to accomplish, thats for sure

thorny python
#

It is indeed my problem, because java agent need to use jar form

glossy scroll
#

ok but you cannot package a jar file into another jar file

smoky oak
#

it tells me to implement methods for structure manager?

eternal oxide
#

stop instancing objects, getStructureManager

thorny python
#

xd I can manually drag jar into jar to make it work

#

indeed solve the issue, I just have to do it manually

glossy scroll
#

and just access it that way

#

i dont understand why you need this

thorny python
#

sorry which folder you mean ' same folder'?

crude hound
#

use 1.18.1 javadocs

glossy scroll
#

just put the agent jar file into the same folder

thorny python
#

hmm let me try

smoky oak
#

um there's no documentation for either of the Structure.place(...) methods?

#

like

#

what's that int for?

#

or that float

#

or that boolean

glossy scroll
#

its all right here

smoky oak
#

what

#

i got a 404 page not found earlier

severe marsh
#

So I made an empty list using:

private static List<ItemStack> itemsList = Collections.<ItemStack>emptyList();
``` and I want to add element to it using `indexesList.add(something);` but it throws me an exception. How do I fix it?
thorny python
#

thanks, put the jar into /target/classes make it work

glossy scroll
smoky oak
#

shouldnt the javadocs be in there?

glossy scroll
#

im telling you

thorny python
#

xD

smoky oak
#

i mean the bukkit javados are there?

glossy scroll
#

you do NOT want to do whatever youre doing this way

thorny python
#

ya ty for help

glossy scroll
#

this is literally the purpose of jar files

eternal oxide
#

website javadocs are superior and easier to check

thorny python
#

I wasnt understand your answer sorry

glossy scroll
#

simple as

glossy scroll
#

ArrayList<MyClass> myArraylist = new ArrayList<>()

severe marsh
#

Thanks

smoky oak
#

though even that does not tell me how the palette works. If i dont want to change the blocks i leave that at 0 right?

#

also thanks for your answers

golden turret
#

how coul i access that variable?

smoky oak
#

k thanks

glossy scroll
mortal hare
thorny python
#

well, some fancy stuff really have to do this way to make it work I guess

#

INFO]: [STDOUT] [org.bukkit.craftbukkit.v1_17_R1.inventory.CraftItemStack] Test
ya it finally worked

#

;_;

glossy scroll
#

i still have no clue what youre trying to do

thorny python
#

insert own code into craft bukkit method body

#

so I just managed to run a print message inside CraftItemStack static method

glossy scroll
#

that sounds dangerous

#

why not just make a fork of CB?

mortal hare
#

also it would be hella lot slower doing it at runtime

thorny python
#

hmm it in form of plugin would be easier for me to distribute actually, and I can add certain new events using this

mortal hare
#

i would rather make wrapper classes

glossy scroll
#

this still is a red flag

#

?xy

undone axleBOT
mortal hare
#

version control would be pain in the ass

thorny python
#

static method cannot do wrapper class ig

glossy scroll
#

?xy

undone axleBOT
glossy scroll
#

?xy

undone axleBOT
glossy scroll
#

?xy

undone axleBOT
thorny python
#

otherwise I will attempt easier solution

mortal hare
#

dont spam

glossy scroll
#

i feel like youre not telling us what you actually want to do

mortal hare
#

he's just tinkering around

#

out of curiosity

thorny python
#

that's what I am doing, a way for me to add new events

glossy scroll
#

ok but i still dont think thats a very effective nor good idea

eternal oxide
#

?contribute

eternal oxide
#

Much better way to add events

vale ember
#

can someone help with parsing location from 3 strings

#

i have 3 strings, x, y, z

mortal hare
#

use regex

eternal oxide
#

why not serialize and deserialize?

vale ember
#

how?

glossy scroll
#

Double.parseDouble?

vale ember
#

including relative coordinates

#

~ ^

#

like 230 ~-4 ^3

maiden thicket
#

wat

#

cant u just look at uh

#

mc's code

#

thru nms and see the code for tp

mortal hare
#

it already includes it

maiden thicket
#

then jus rewrite

mortal hare
#

register your command via vanillaCommandDispatcher

vale ember
#

won't that be version dependent?

maiden thicket
#

i dont understand the diff between brigadier and the one everyone is so used to cmd systek

#

what even is brigadier

#

is it better or something

glossy scroll
#

mojangs command parsing thinghy

chrome beacon
#

Brigadier is Mojangs command framework

mortal hare
#

brigadier is the new command parser, which contains new parsing of commands since 1.13

chrome beacon
#

It's what Minecraft uses internally

glossy scroll
vale ember
#

will that work on every version 1.14.4+?

mortal hare
#

yes

#

Brigadier is fully utilised since 1.13

#

but that would involve some NMS to make your commands work

maiden thicket
#

hmmm interesting

#

is this what people are switching over to

mortal hare
#

also your commands will get minecraft: namespace, since that's how bukkit registers commands

maiden thicket
#

it seems a bit confusing from the usage

mortal hare
eternal oxide
vale ember
#

any non nms way?

maiden thicket
#

ok cool xd

#

it doesnt look that fun to use

vale ember
#

i rly don't want to involve NMS here

maiden thicket
#

seems like tis would be a pain

maiden thicket
#

or can u just have it execute the good old dispatch cmd minecraft:tppos

crude hound
#

use spigot javadocs in vscode

maiden thicket
#

wat

mortal hare
#

what i would do, i would split the string into 3 pieces with delimiter of space ' '

#

try to use Integer.parseDouble() for these split strings

#

if one of them fails

#

read the first character of the failed string

glossy scroll
#

Double*

eternal oxide
#

Is the string coming from a command or elsewhere?

maiden thicket
#

why people use other ides when intellij exists 🥲

mortal hare
#

if its ~ char and the string's length is only 1, handle it as relative location, by getting the relative location coord, depending on the order of the split strings

glossy scroll
#

perfectly reasonabe

maiden thicket
#

ya idk why people dont use intellij

glossy scroll
#

and because of that it takes up so much memory

maiden thicket
#

oh

mortal hare
#

16gb ram gang

#

i actually upgraded my ram

#

just because of intellij

glossy scroll
#

same

mortal hare
#

ROFL

maiden thicket
#

true when i updated to intelij 2021 my ide would freeze trying to load Material enum

glossy scroll
#

i couldnt run mc and intellij at the same time with 8ghb

#

and a chrome tab

maiden thicket
#

i was like bro ima use eclipse

#

cus intellij was so unusable at the time for me

#

and i have 16gb ram 💀

glossy scroll
#

right so you just answered your own question

maiden thicket
#

well yeah but i havent had these issues for months

mortal hare
maiden thicket
#

what are the different types of inputs a location can parse anyways

#

like ^ and others

mortal hare
#

wtf does ^ do?

#

it powers the location by math function or what

glossy scroll
#

its relative to your location

#

but uses your facing vector

mortal hare
#

how is that different from ~

maiden thicket
#

i know u can do like +2 or smthn to args cant u

glossy scroll
#

instead of using hte world vector it uses the player vector

#

so its to the right/left instead of x/z

maiden thicket
#

can we please have right left in spigot

#

instead of east west

mortal hare
#

so it playerX + 3?

glossy scroll
#

no

maiden thicket
#

im not good at vector math

#

💀

mortal hare
#

right could be from any direction

glossy scroll
#

if you take the cross product of the player's facing direction and (0,1,0) youll get the right vector

mortal hare
#

its not as if you rotate in real world and the planet earth rotates to your right lol

glossy scroll
maiden thicket
#

yeah i mean get player right or left

glossy scroll
#

spigot is more for accessing cb

#

not providing utility methods

#

it does in some cases but not anymore

#

if mojang had a left/right system im sure itd be in spigot

maiden thicket
#

sadge

crude hound
#

so someone can help me access the javadocs even if I have the remapped, build tool version of spigot?

#

like even on the base bukkit functions

smoky oak
#

?paste

undone axleBOT
smoky oak
#

what is a no such element exception

mortal hare
#

in C++ we have something like this
void myFunction(int (&arr)[ARRAY_SIZE]);
if we want to pass fixed size array at compile time

#

do we have something like this for java in compile time?

smoky oak
#

I have a function trigger onChunkLoad, but it requires enough computing power to crash the server. How can I delay those, so that for example there is only one instance of the function running?

vale ember
#

how to fix Plugin [id: 'org.jetbrains.kotlin.jvm', version: '1.6.0'] was not found

unreal quartz
#

i’m curious: how does that actually work? what if you pass an array of random size?

mortal hare
#

it only allows to pass only provided size array

#

that means if its bigger or smaller it wouldnt compile

#

you specifically need that provided size array

unreal quartz
#

so the size of the array must be determined at compile time then?

mortal hare
#

yes

unreal quartz
#

interesting

mortal hare
#

Arrays in C++ are just technically pointers to linear memory addresses on the stack

#

by determining the base pointer before and after the array allocation you can get the array size in compile time by just subtraction: oldBasePointer-BasePointer/sizeof(dataType), or in cpp to get the size of fixed array we do, sizeof(arr)/sizeof(arr[0])

smoky oak
#
long time = 0;
for(Chunk chunk : Bukkit.getWorld("world_nether").getLoadedChunks()){
  try {
    Thread.sleep(time);
    time = handleChunk(chunk);//Returns how long function took
    } catch (InterruptedException e) {e.printStackTrace();}
}

This still causes a server crash. Anyone knows why?

ivory sleet
#

what does handle chunk do?

#

it looks like your threads get in some sort of hang mode/dead lock

smoky oak
#

it basically copies the bottom half of that chunk onto the top half and does a bit extra

#

?paste

undone axleBOT
smoky oak
#

@ivory sleet

#

the reason im so confused is that i specifically tell it to WAIT for as long as it took the previous iteration

#

and if that process is called ONCE nothing happens but whats intended

modern sluice
#

where do i learn how to fork spigots

quaint mantle
golden turret
rustic mica
#

Heya, i am making a plugin and was wondering if there is some centralized storage of plugins that developers are able to access and use it as something like a maven repository in order to pull plugin jars

quaint mantle
#

For what purpose

rustic mica
#

Mainly just not cluttering my pom.xml with lots of repositories

#

Or having to sort jars one by one from each download location

#

Because i have about 6 plugins which are softdepend and keeping track of what version each is a mess

quaint mantle
#

no not really

quaint mantle
#

if you depend on those plugins, you should keep track on them. They can easily change and break your plugin

analog fjord
#

How can I convert world time to second?
time % 1000 * 3600 / 10000?

rustic mica
#

You mean how long is a second in game?

#

Normally 20 ticks is a second if that's what you are looking for

ancient whale
#

Hey, I'm looking for a way to set final damage in entitydamagebyentityevent (basiclly a fixed damage that ignores armor or any kind of reduction)
Only thing I can find is setDamage()
Couldn't find anything on google 😒

analog fjord
fringe latch
#

Hey, my entity is not getting teleported. Any idea what might be causing it?

Location loc = new Location(world, x, y, z, yaw, pitch);
debugLog("---");
debugLog("seat before: " + mainSeat.getLocation().toString());
debugLog("tp: " + loc.toString());
mainSeat.teleport(loc); //THIS IS NOT WORKING
debugLog("seat after: " + mainSeat.getLocation().toString());
glossy scroll
#

what kind of entity is it

fringe latch
#

armor stand

glossy scroll
glossy scroll
quaint mantle
#

bla bla bla

arctic moth
#

how do you get what a skeleton or stray is trying to shoot at and launch a projectile at a realistic trajectory

sonic phoenix
#

Hey, I was wondering, are events thread safe? Can I rely on calling events inside a runnable?

quaint mantle
#

Only if you Mark them as async

sonic phoenix
#

My use-case would be loading a map from a map template and throwing an event when it finishes, does it make sense? is there a better way to do it?

quaint mantle
#

wait for load and when its done call the event on main thread?

sonic phoenix
#

hmm, wouldn't that block the main thread?

arctic moth
#

how do you check what a mob is aggroed onto

ivory sleet
arctic moth
#

btw its checking inside of a runnable

waxen plinth
#

LivingEntity#getTarget

arctic moth
#

well ig it technically doesnt have to

arctic moth
#

well there is in docs but for some reason its not showing up in intellij

#

@waxen plinth

waxen plinth
#

Don't ping me please

arctic moth
#

srry

waxen plinth
#

What version are you using

arctic moth
#

its 1.17

#

but i thought it also worked there

#

lol

waxen plinth
#

Should

#

Wait can you show your actual code

arctic moth
waxen plinth
#

That should work

arctic moth
#

but it doesnt

#

lol

waxen plinth
#

¯_(ツ)_/¯

arctic moth
#

Its in CreatureShootBowEvent but idk if that has anything to do with it

#

since its supposed to be showing up anyways

#

cuz its livingentity

quaint mantle
#

do you have any depenencies except spigot

arctic moth
#

nope

quaint mantle
#

hello, i need some help,
i created a hammer, but i can break in protected zones (worlguard...)
i fixed priority to lowest and returned if event get cancelled
anyone can help me ? (please ping)

chrome beacon
arctic moth
#

o

#

thx

smoky oak
#

is there a line of code that lets the server catch up in case it is running behind?

mortal hare
#

ah yes

#

server is lagging

#

just execute this line of code

#

and it would not lag again

arctic moth
#

btw how do u trace a vector to a block ik its like vector - loc or smth but i cant remember

hexed hatch
mortal hare
hexed hatch
mortal hare
#

is there any way to generate UUID based from objects instance (not random UUID) easily?

smoky oak
#

no what i meant is that after running the code it lags behind and tells me 'is catching up'

#

i was curious if i could force that to happen midway through to reduce impact on players

mortal hare
#

you cant just tell it when for server to lag

smoky oak
#

i want to know if i can check how many ticks the server is lagging behind

#

on another tangent are there non deprecated methods to create asynchronous tasks

mortal hare
#

use bukkitrunnable

#

Bukkit.getServer().getTPS()

#

iirc to get the amount of ticks/second

#

subtract that from 20

#

and you'll get how much the server is behind

smoky oak
#

ah thats helpful

#

is BukkitRunnable async?

mortal hare
#

it could be both ran synced and asynced

ivory sleet
#

?scheduling :p

undone axleBOT
smoky oak
#

dammit

#

cant remove blocks in async task

#

wait does running a synchronous task still slow down the main thread?

#

yes

#

yes it does

#

DAMMIT

ivory sleet
#

Well create a workload distributor

paper viper
#

^

smoky oak
#

wdym

#

i am asking pretty much that question since likek 3pm

paper viper
#

In very simple terms, it seems to distribute the large load into smaller increments executed one after another

#

Rather than executing multiple asynchronous operations

smoky oak
#

I cant do async

#

since i have to edit blocks

paper viper
#

That’s not what I said

smoky oak
#

but that causes a lot of lag

paper viper
#

I said small increments executed one after another

#

That’s synchronous

#

Not asynchronous

#

For example, do blocks 0-20 on tick 1, 21-40 on tick 2

#

Etc

arctic moth
#

for some reason this is always making it shoot in one specific direction, and all knockback is done towards that direction, no matter what it is from

 LivingEntity target = ((Mob) event.getEntity()).getTarget();
                    Vector motion = event.getEntity().getLocation().toVector().subtract(target.getLocation().toVector());
                    Arrow arrow = event.getEntity().launchProjectile(Arrow.class, motion.multiply(3));
paper viper
#

To reduce the lag

analog fjord
#

Do I have to remove player onLeave from BossBar via bossBar.removePlayer(p)?

smoky oak
#

issue with that its fairly slow. I need to change ~10k blocks on each ChunkLoad

paper viper
#

Then use worldedit api

#

That’s my only other way

smoky oak
#

issue with that being is that doing it with world edit would require me doing that for every chunk manually

#

which is a lot worse

#

since the affected area are 55 region files

paper viper
#

Tbh, 10k blocks per chunk load does not seem like a great idea…

smoky oak
#

its only once per chunk

#

but it still crashes the server

paper viper
#

Well then you have no other options

#

I suggest to still use the worker distributed thing

#

And I strongly discourage against using FAWE

arctic moth
smoky oak
#

how would i distribute a loop then?

int x,y,z;
Material m;
BlockData d;
for(x=0;x<16;x++){
  for(z=0;z<16;z++) {
    for (y = 1; y < 126; y++) {
      block = chunk.getBlock(x,y,z);
    m = block.getType();
    if(set.contains(m)){
      if(m == Material.BONE_BLOCK){
        d = block.getBlockData();
        block = chunk.getBlock(x,y+128,z);
            block.setBlockData(d);
    ...                    }
mortal hare
#

is it safe to generate type 3 UUID based on object's hashcode

#

UUID.nameUUIDFromBytes(Ints.toByteArray(object.hashCode()))

#

something like this

#

i want to generate object instance UUID since some objects that im working with could have prebuilt UUID's while some could not

arctic moth
#

*is

#

but the launchprojectile doesnt make it shoot up

#

if u jsut use it

#

so it needs a vector

young knoll
#

up?

arctic moth
#

?

#

wdym

arctic moth
#

the thing launches the projectile in the direction they are facing

#

but for some reason mobs dont look at a pitch when shooting (or is it yaw idk what its called)

#

oh i just found out its spamming null pointer exceptions

#

fun

smoky oak
#

okay does anyone have an idea why this happens?

[22:13:32] [Server thread/INFO]: Handling chunk (699/1131) ... it is 1639430012532 Slept for: 330
[22:13:33] [Server thread/INFO]: Handling chunk (700/1131) ... it is 1639430013060 Slept for: 528
[22:13:33] [Server thread/INFO]: Handling chunk (701/1131) ... it is 1639430013418 Slept for: 358
[22:13:34] [Server thread/INFO]: Handling chunk (702/1131) ... it is 1639430014019 Slept for: 601
[22:13:34] [Server thread/INFO]: Handling chunk (703/1131) ... it is 1639430014334 Slept for: 315
[22:13:34] [Server thread/INFO]: Handling chunk (704/1131) ... it is 1639430014664 Slept for: 330
[22:13:34] [Server thread/INFO]: Handling chunk (705/1131) ... it is 1639430014991 Slept for: 326
[22:15:46] [Server thread/INFO]: Handling chunk (706/1131) ... it is 1639430146602 Slept for: 131611

Why does it need like 2 minutes to paste a frigging 16*8*16 structure?

#

time is in milis

arctic moth
#

idk probably doesnt wanna work until all the chunks needed are loaded

#

im not very good with generation lol

#

so i have no idea

smoky oak
#

cant be it

#

i desinged it so that the structure stays inside the chunk its generated in

arctic moth
#

o

smoky oak
#

generating the structure is the only difference between 706 and the others

#

can someone look at this and tell me why it takes like 2 minutes? both red and blue are roughly 16³ block structures

Biome biome = chunk.getWorld().getBiome(chunk.getX() << 4, 64, chunk.getZ() << 4);
boolean warped = biome == Biome.WARPED_FOREST;
Structure struct;
File file;
if(warped){
  struct = blue;
}
else{
  struct = red;
}
struct.place(chunk.getBlock(0,(int) (128 + 100*random.nextDouble()),0).getLocation(),false,StructureRotation.NONE,Mirror.NONE,0,1,new Random());}
glossy scroll
#

gonna need to see slightly more coe

#

where exactly is blue and red defined

#

?paste

undone axleBOT
smoky oak
# glossy scroll gonna need to see slightly more coe
static Structure blue=null;
static Structure red=null;
//in method before loop
blue = getServer().getStructureManager().loadStructure(this.getResource("nether_house_blue.nbt"));
red = getServer().getStructureManager().loadStructure(this.getResource("nether_house_blue.nbt"));
glossy scroll
#

what method is that

smoky oak
#

thats directly before the other code

glossy scroll
#

when do you call that method

#

and what is it looping

smoky oak
#

it's calling that method on a subset of the chunks total

#

it needs around half a second without calling that method and two to three minutes if calling that method

#

and i just dont get why

#

its literally just placing a structure

#

and checkign what biome is at 0 64 0 in that chunk

glossy scroll
#

have you actually tested what specific part of the code is slow

#

also i dont understand why you define a static variable in a method when the static variable is the same

smoky oak
#

its outside of the method because i thought maybe its the loading of the structures

#

but its still slow

glossy scroll
#

ok but you still load the structures in the method

#

doesnt that make sense

smoky oak
#

i load it since i cant be sure its loaded already

#

i can fix that

dense geyser
#

would HashMap<UUID, WeakReference<List<Punishment>>> more or less equal WeakHashMap<UUID, List<Punishment>>

lavish hemlock
#

yeah

#

that's basically exactly what a WeakHashMap is

dense geyser
#

ah okay, thanks!

sullen marlin
#

is WeakHashMap not keys also?

#

and perhaps does cleanup under the hood

ivory sleet
#

believe its key based yeah

#

and lazily cleans it up

worldly ingot
#

PES_Think What reason do you have to weakly reference a list?

quaint mantle
#

how can i use the ClientboundAddEntityPacket Class with a empty constructor?

worldly ingot
#

I mean... if it doesn't have an empty constructor, you can't

merry bluff
#

Hi

quaint mantle
merry bluff
#

Can you guys help me

#

I’ve never made a plug-in but wanna make one

eternal oxide
#

Which is your preferred IDE?

merry bluff
#

for 1.17 or 18

paper viper
#

doesnt matter

merry bluff
#

Can anybody help

paper viper
#

We are literally helping you rn

#

Lmao

#

I am saying that the IDE does not matter based on the mc version you use

ancient plank
#

10 cents they don't know java

paper viper
#

^

merry bluff
#

oh

#

wait does anybody here know dream smp

paper viper
#

dude..

#

you arent going to make a stupid dreamsmp plugin right

lunar folio
paper viper
#

??

merry bluff
#

I’m making a plug-in which give a certain player a totem right before detah

#

death*

eternal oxide
#

IDE makes it easier to recommend a tutorial

lunar folio
#

oh sorry i answered rhe wrong message

lunar folio
ancient plank
#

does eclipse have native maven support yet

paper viper
ancient plank
#

without a plugin

eternal oxide
merry bluff
#

wait does a plug-in like TAHT already exist

#

that*

eternal oxide
ancient plank
#

ic ic

lunar folio
ancient plank
#

I swapped from eclipse to intellij because of the lack of native support for maven when i used it

eternal oxide
#

I actually found the first thing I dislike about Eclipse today. No nested module support 😦

ancient plank
#

vscode is garbage even for the languages its meant for

merry bluff
#

Is it hard to make a plug-in

sullen marlin
#

Netbeans is the only ide with actual native maven support

eternal oxide
buoyant viper
sullen marlin
#

Neither eclipse nor intellij are 'native'

merry bluff
#

well fuck now I gotta learn Java

ancient plank
#

I mean

buoyant viper
#

theres a command for that

#

?learnjava

undone axleBOT
ancient plank
#

tbh I just consider 'native' as in I don't have to install an external plugin to use it

sullen marlin
#

Well you don't with eclipse either

#

Never have

merry bluff
#

How long would it take to learn

quaint mantle
#

how can i get a net.minecraft.world.entity.Entity ?

eternal oxide
ancient plank
#

idk when I used eclipse I had to go to one of their plugin pages and do smth funky to get it to work, either that or I was being dumb

merry bluff
buoyant viper
#

think ive just always used gradle tbh

lunar folio
eternal oxide
#

I like Eclipse for home use and single dev projects

buoyant viper
#

recently ive been trying to migrate to a vsc dev env

#

to uninstall some programs

#

pretty good handling gradle projects i got but its intellisense is.... subpar

ancient plank
#

I like eclipse when I need to develop on something with less-than-decent hardware

#

since it has a lot less overheard

glossy scroll
lunar folio
#

^

buoyant viper
#

i think i used it use it for 4gb of ram and it worked just fine

#

hotswapping took ages but... hotswapping /shrug

glossy scroll
#

id like to think i use most things that intellij offers but idek ll

#

feels like i always find something new

paper viper
#

Yeah

#

its also actually only 1 out of the 2 IDE's that support full kotlin dsl gradle too

#

the other is android studio

eternal oxide
#

Eclipse is terrible for Modules though. Have to use working sets and they are stored as separate projects.

paper viper
#

Im going to be honest here. I used to complain about how intellij only allows 1 project instead of multiple. I am starting to like 1 project view better

ancient plank
#

I need to actually look into how modules work in intellij because I've tried like twice to make 'em but I always frick them up somehow!

#

smh

paper viper
#

Cause of how many files and everything

paper viper
#

lol

ancient plank
#

idk man

#

I'm stupid ok

#

it doesn't look right when I do it

smoky oak
#

how to import nms?

paper viper
#

buildtools

#

?bt

undone axleBOT
paper viper
#

Run that first

smoky oak
#

i did that

paper viper
#

then import into your gradle/maven

#

its the exact same

#

except remove the -api part

buoyant viper
smoky oak
#

i did that too but its not recognizing the method

buoyant viper
#

beats whatever the fuck eclipses "workspaces" are

paper viper
paper viper
#

or pom.xml

#

or build.gradle.kts

#

lol

smoky oak
#

1sec im reloading the ide atm

eternal oxide
paper viper
#

seems like hell looking at it

#

lol

smoky oak
#

its indexing rn

paper viper
#

that doesnt tell me anything

#

i need a full file

#

smh lol

#

we need to make sure everything is right

smoky oak
#

i dont suppose you know the correct import for setBlockInNativeChunkSection()?

paper viper
#
public static void setBlockInNativeChunkSection(World world, int x, int y, int z, int blockId, byte data) {
    net.minecraft.server.v1_14_R1.World nmsWorld = ((CraftWorld) world).getHandle();
    net.minecraft.server.v1_14_R1.Chunk nmsChunk = nmsWorld.getChunkAt(x >> 4, z >> 4);
    IBlockData ibd = net.minecraft.server.v1_14_R1.Block.getByCombinedId(blockId + (data << 12));

    ChunkSection cs = nmsChunk.getSections()[y >> 4];
    if (cs == nmsChunk.a()) {
        cs = new ChunkSection(y >> 4 << 4);
        nmsChunk.getSections()[y >> 4] = cs;
    }
    cs.setType(x & 15, y & 15, z & 15, ibd);
}
smoky oak
#

yea thats where i am

paper viper
#

Yeah

#

Just wait for it to index

#

Btw i dont think you need <type>jar</type>

smoky oak
#

was like that on the spigot page iirc

#

new issue

#

it indexed

paper viper
#

havent touched maven for a while so idk, but i didnt need it before

smoky oak
#

but still doesnt find it

paper viper
#

did you create the method?

smoky oak
#

create?

#

wait a sec

paper viper
#

b r u h

smoky oak
#

a.h.

#

thought that was a nms method

paper viper
#

No lmfao

#

its a method that uses nms code

smoky oak
#

ok

#

is the data important if i want to essentially just do fast Block.setType()?

paper viper
#

Well according to the forum

  1. it is unstable
  2. Does not perform light update
  3. Does not send updated blocks to player (requires a relog)
  4. Does not work if specified coordinate is in a not loaded chunk
smoky oak
#

idfc, i just need the blocks there

#

its supposed to block up the upper half of the nether

paper viper
#

well the client wont see it then

#

Lol

smoky oak
#

the reason im doing this in the first place is because for SOME reason even setting like 9k blocks per second causes my server to lag behind massively

#

and its not like its a bad one

#

4G ram and a cpu that's usually at like 9%

#

aaaaaaand scrape there's no such thing in the 1.18 nms anymore

#

@paper viper is the full NMS list avilable somewhere? I dont want to spend like 2 hours searching for the correct path

misty current
#

can you somehow make LivingEntity#damage not call damage events?

vapid oriole
#

Hello,
someone know how detect if player is behind block during TNT explode?
Everything works but is player is behind block then is also pushed...
This is my code:

public class ExplosionEvent implements Listener {

    @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false)
    public void Explosion(EntityExplodeEvent event) {
        Location loc = event.getLocation();

        double radius = SettingsStorage.getInstance().TNT_RANGE;

        if (loc.getWorld() == null) {
            return;

        }
        List<Entity> nearbyEntities = (List<Entity>) loc.getWorld().getNearbyEntities(loc, radius, radius, radius);
        if (event.getEntityType() == EntityType.PRIMED_TNT) {
            double hf = SettingsStorage.getInstance().TNT_HEIGHT / 2;
            double rf = SettingsStorage.getInstance().TNT_RANGE_FORCE / 2;


            for (Entity entity : nearbyEntities) {
                if (entity instanceof Player) {

                    pushAway((LivingEntity) entity, loc, hf, rf, event);
                    Common.broadcast("You are pushed");
                    return;
                }
            }
        }


    }

    void pushAway(LivingEntity player, Location l, double hf, double rf, EntityExplodeEvent e) {


        final Location loc = player.getLocation();
        double distance = e.getYield() * 8.0f;
        distance *= 1;

        double hf1 = Math.max(-4, Math.min(4, hf));
        double rf1 = Math.max(-4, Math.min(4, -1 * rf));

        player.setVelocity(l.toVector().subtract(loc.toVector()).normalize().multiply(rf1).setY(hf1));

        final EntityDamageEvent DamageEvent = new EntityDamageEvent(player,
                EntityDamageEvent.DamageCause.BLOCK_EXPLOSION, distance - loc.distance(player.getLocation()));
        Bukkit.getPluginManager().callEvent(DamageEvent);
    }

}
sullen shale
#

I am having auto completion/hints issues on intelliJ idea. It works for some namespaces but for others does not work.
any clue how to resolve it, I created multiple projects, re imported libs but no luck

civic adder
#

Hi, I'm trying to update a plugin that was discontinued and I noticed they use the import org.spigotmc.SpigotConfig, which is throwing an error since it doesn't exist in the API. Is there a way to add a gradle dependency that has SpigotConfig, or will I need to find a way to rewrite whats there? I can send a github link to the file if needed, since the plugin is open source.

eternal night
#

The spigot config is implementation detail /shrug

#

it is pretty just a plugin accessing server internals

civic adder
#

I might just try commenting out the code and the import and see how much it breaks things lol

modern sluice
#

why does paper not have async chat

eternal oxide
#

This is Spigot not paper

ancient plank
#

you're in spigotmc

ivory sleet
young knoll
#

So does vanilla

quaint mantle
#

Hey,

I'm currently trying to make pigs follow a player when hit.

I was able to cancel out the panic state, but using setTarget does nothing.

The pig just walks around normally instead of following the player.

Any ideas?

young knoll
#

setTarget requires them to be attacking mobs

#

You probably need NMS, or some weird runnable logic

hexed hatch
#

Does anyone know of a good data structure for storing a group of strings, and each of these strings would be weighted

paper viper
#

do you want order?

#

with the weighted strings

hexed hatch
#

I'm struggling to put this to words. I just need a group of strings, and I need certain strings to be picked more often than not

#

I don't need order, nope

paper viper
#

You could have each string have a specific range from 0 to 1

#

then pick a random decimal between 0 to 1

#

for example:

hexed hatch
#

This is for a custom structure handler for handling variants of the same structure, need to grab some namespaced keys more often than others

sullen marlin
paper viper
#

"dog" -> 0.0 - 0.7

young knoll
#

Iirc I used NavigableMap for this

hexed hatch
#

I'll take a look at that

wide solstice
paper viper
#

There is slimjar which supports java 16

#

and repos other than central

#

but it currently has a gson issue

#

i made a mini library that supports relocation, dependency installation, and loading

#

but it doesnt get dependencies of dependencies

#

Im assuming you cant use the libraries feature

#

in plugin.yml

#

but nowhere near as many features lol

wide solstice
wide solstice
paper viper
quaint mantle
paper viper
#

was working a bit ago, but the author is busy in college right now

#

i used to use it. it was perfect and supported java 16 and everything

#

so i had to develop a mini subsitute

wide solstice
#

Oh

paper viper
#

You have to make some changes to the source

quaint mantle
#

from what I see the repo that was down, is now up

#

is the issue still happening

paper viper
#

yeah

quaint mantle
#

your entire project depending on your own repo is opposite of what you'd want tho

paper viper
#

wdym

hexed hatch
#

is there a spigot method for simulating placing bonemeal on a block?

modern sluice
#

why doesnt spigot make c++ version

#

software

hexed hatch
#

ah yes

#

just port spigot to c++

#

that's how it works

ivory sleet
eternal night
#

c++ is just too slow for a game server like minecraft

modern sluice
#

huh

eternal night
#

maybe python to get a little performance boost

#

but thats about it

ivory sleet
#

lol

paper viper
#

lol

modern sluice
#

...

young knoll
#

Skrigot

hexed hatch
#

I think minecraft should be written in node

ivory sleet
#

But seriously aid, why would spigot port over to cpp

#

It’s an unrealistic goal

eternal night
#

The project is maintained by a single dude

paper viper
#

Bukkit is written in Java anyways

modern sluice
#

minecraft should be rewritten

ivory sleet
#

Why?

hexed hatch
#

it was

#

they call it bedrock edition

young knoll
#

^

eternal night
#

^

paper viper
#

^

modern sluice
#

^

ivory sleet
#

Java works very good

modern sluice
#

but java edition is more expensive

ivory sleet
#

In terms of?

paper viper
#

And?

modern sluice
#

price for account

hexed hatch
#

java kinda sexy tho

modern sluice
#

so why they not optimize the game

paper viper
#

do you have any coding experience

#

🙂

ivory sleet
#

They do?

modern sluice
#

no

#

LOL

paper viper
#

Lmfao

#

so zip your mouth xD

eternal night
#

or business experience for that matter

modern sluice
#

but ik a thing or 2

ivory sleet
#

Yes they optimize the game all the time?

#

(Speaking of Mojang devs)

modern sluice
#

I cant code shit but ik the answers to some things

#

I dont have patience thats my struggle

eternal night
#

the amount of work to rewrite the entire java version into c++, keeping 100% compatibility with each current quirk

paper viper
#

Guys i know how to walk but i dont want to do it

eternal night
#

could just as well deprecated java version

#

and drop it

modern sluice
#

Pulse

paper viper
#

aid

modern sluice
#

keep ur mouth closed

ivory sleet
#

Obviously you’re just guessing a lot of stuff aid.

hexed hatch
#

woah

paper viper
#

No, you need aid

#

Lol

modern sluice
#

dont start shit it this discord

hexed hatch
#

that's powerful

ivory sleet
#

aid keep a friendly tone please

modern sluice
#

all I said is this game needs too me more optimized

#

conclure

hexed hatch
#

they're constantly optimizing it

eternal night
#

they are working on optimizations basically every update

#

yea

ivory sleet
#

^

hexed hatch
#

and spigot is more optimized than vanilla

modern sluice
#

what was not friendly

#

?

hexed hatch
#

and paper is more optimized than spigot

ivory sleet
modern sluice
#

cap

paper viper
#

XD

modern sluice
#

Conclure yes thats friendly if ur disrespect

eternal night
#

tbf, pretty disrespect to expect mojang to recode their game in cpp

#

ngl

modern sluice
#

u know thats being biased and you're getting reported 🤣

ivory sleet
#

Anyways aid, since you seem to be knowledgeable about these optimizations, why not tell mojang yourself?

hexed hatch
#

we have ourselves a game development expert right here

modern sluice
#

I did

eternal night
#

LOL

modern sluice
#

mojang didnt respond

eternal night
#

a surprise

paper viper
#

i wonder why

eternal night
#

your suggestion probably was over their heads

#

they don't know what they are doing obviously

#

not on your level

hexed hatch
#

you guys just lack the brain water to even begin to comprehend aid's insight

modern sluice
#

The content is way different than what they offer

paper viper
#

Aid just needs to "aid" mojang

#

But don't give me aids

#

😏

modern sluice
#

some disrepect in here

eternal night
#

content ?

#

are you talking about java being more expensive ?

modern sluice
#

yes

eternal night
#

is this what this is about

#

lol

#

you are paying like what

#

30$ ?

hexed hatch
#

24.99 one time purchase

#

wow

eternal night
#

yea

hexed hatch
#

so expensive

eternal night
#

25$ and you get free updates forever

paper viper
#

Just wash the dishes my guy

hexed hatch
#

I bought this game once and I've put well over 20k hours into it in the last 11 years

#

talk about replayability

modern sluice
#

its more expensive though tf u on about they should focus on java edition if anything

hexed hatch
#

I paid $0.00004002 for every hour I spent playing this game

quaint mantle
#

ive played like 10 hours of minecraft this year

ivory sleet
#

Anyways aid, surely Java, or well the jvm has some overhead, however features like garbage collection make the production much faster which allows the game to develop quicker, personally I prefer more updates of content being delivered faster rather than the game use 10% less resources or something.

eternal night
#

The community also developed some seriously sick performance optimizations

#

both client side and server side

modern sluice
#

ye

ivory sleet
#

Tru

eternal night
#

so idk what the issue is

modern sluice
#

but the real question is where is the sound going from all the mobs being ticked

hexed hatch
#

what

modern sluice
#

like the sound of mobs

hexed hatch
#

I feel like

#

you're extremely confused

modern sluice
#

I am

#

lmfao

hexed hatch
#

clearly

hexed hatch
modern sluice
#

no like what im trying to say

#

does sound take up server resources

hexed hatch
#

sound

modern sluice
#

like explosion sound

hexed hatch
#

as in game sounds

#

no

ivory sleet
#

Negligibly

hexed hatch
#

not really

modern sluice
#

no like 10k + tnt

ivory sleet
#

What takes up server resources most is probably ai and world related stuff

eternal night
#

⚡️✨(FREE) spigot sound optimization [ASYNC] ✨⚡️

modern sluice
#

dude

#

stop

#

PLEASE

#

I didnt mention a thing about async

eternal night
#

no but people asking about 0.5% of a tick sounds sending take might

#

so I am just promoting my fork here

modern sluice
#

or just disable it ?

#

if its not recommended for the gamemode

#

Where do I test this shit

eternal night
#

sound packets are so incredibly cheap, worrying about them is just not good

modern sluice
#

Lynx

#

but lets say 10k tnt going off non stop

hexed hatch
#

tnt is a different story

modern sluice
#

yes

young knoll
#

I don't think the sound would be the main issue there

ivory sleet
#

^

eternal night
#

^

modern sluice
#

Im not talking about the main issue

eternal night
#

the sound would still be completely irrelevant

hexed hatch
#

the sound wouldn't be the issue, the performance issue would come with it modifying an area of blocks and entities in the explosion radius

eternal night
#

the amount of block lookups, entities that spawn and need ticking etc

hard path
#

i return again asking for help.

I was having issues with chunk loading in 1.18 and when i asked about it here the suggestion was that it was a 1.18 issue, not a spigot issue, and that 1.18.1 fixed it. I am on the newest 1.18.1 spigot version and the problem is persisting.

My tps is not dropping. htop is fine. running a fresh timings rn.

But basically, anything that forces the server to load chunks chokes the server. everyone rubberbands back about a second. so every player join, death, portal..... moving in a boat over water...

All of my chunks are pregenerated.

This is on a server, ive capped the player limit at 12 for the time being, bc around 15 it begins to fall apart. too much movement from players. Is this a bug we know about/are working on? or should i be reporting it somewhere?

modern sluice
#

😄

hard path
#

i rent a datacenter machine btw, its not a hardware issue. we used it for 1.17 and could hold about 20-25 players before tps started to drop.

ivory sleet
#

But yes aid, speaking of performance and saving resources, disabling sounds in the client will decline the usage of resources by 0.01% so might wanna do that

modern sluice
#

because 1 thing I noticed

#

even ingame options of the client

#

send packets to the server

ivory sleet
ivory sleet
hard path
ivory sleet
#

Sure, though I’d suggest using spark 🍿

modern sluice
#

but what im trying so say f 3 with all that info of chunks and shit the server is constantly updating it so what if I delay the client info by 3s so its not updating every sec

hard path
#

i can add that in before the next restart. which is at the hour 🙂

ivory sleet
#

Or well the other way around could possibly also be the case if you got a weird client

modern sluice
#

ye i got 1 xd

#

see I just need to work with a dev and I can come up with weird optimizations I love problem solving

ivory sleet
#

Anyways I need to head off, be a good guy and someone might pick you up on your request concerning spigot in cpp

modern sluice
#

ye ye

#

they all are busy

young knoll
#

Why not do those optimizations in java

#

Maybe paper wants them

remote gazelle
#

how should i make shield reduce damage only by 50%?
since damage modifier is deprecated, i have no idea to do that

sullen marlin
#

Reduce all damage?

remote gazelle
#

umm i mean

#

currently, shield disable whole damage right?

sullen marlin
#

Not sure

remote gazelle
#

but i want it to reduce only 50%

#
e.setDamage(EntityDamageEvent.DamageModifier.BLOCKING, e.getDamage(EntityDamageEvent.DamageModifier.BLOCKING) / 2);```
#

i want this but without DamageModifier

#

any idea?

hard path
#

if anyone is around that would be able to assist 🙂

hard path
#

im dumb. i found the profiler/dump summary. i got this now XD

quaint berry
#

?paste

undone axleBOT
quaint berry
#

When the return false is activated it says /trust in chat

#

Does anyone know why?

#

On line 28

young knoll
#

return false prints the usage message in chat

wicked lake
#

Return true instead

quaint berry
#

Ok

#

I'll try it

#

Oh wow thanks it works

#

Also

#

Whenever I build the artifacts I have to stop the server then start it or else the files won't replace, Is there a way for me to update the plugin but not have to stop and start the server?

paper viper
#

are you using maven or gradle?

#

cause you can specify build target

young knoll
#

Replacing works fine for me

#

On windows

paper viper
#

and not restart server

#

and new changes are applied?

#

how lmfao

young knoll
#

/reload

paper viper
#

ur weird

hexed hatch
#

my server yells at me for using System.out.print and I try using JavaPlugin#getLogger and it doesn't work

#

why

young knoll
#

Define doesn't work

eternal oxide
#

paper complains not spigot

paper viper
#

doesnt paper do that

#

Yeah lol

quaint berry
#

How do I send an image?

hexed hatch
#

Oh

#

logger.log(Level.ALL, "yo");

young knoll
#

To be fair

hexed hatch
#

simply does not work

young knoll
#

It is right

paper viper
#

Yeah

hexed hatch
#

I don't care, I don't want them bullying me in to using better practices

#

logger.log(Level.ALL, msg); but this does absolutely nothing

young knoll
#

I've never tried the ALL level

quaint berry
#

Here

hexed hatch
#

what level works

quaint berry
young knoll
#

warning and severe work

hexed hatch
#

is that it

#

I just need some debug shit man

young knoll
#

idk those are the only one's I've used

hexed hatch
#

okay apparently INFO works

#

very good

hard path
# hard path i return again asking for help. I was having issues with chunk loading in 1.18 ...

ok. if anyone can help with the above issue. I have two different spark profiler reports. one where i let the server run normally. and one where i had a player log in and out a couple times very quickly to force the issue.

I dont know if this is an issue I can solve. but something is wrong.

Normal gameplay - 8-10 players
https://spark.lucko.me/KPBHnV2Bu2

Forced issues - 9 players
https://spark.lucko.me/KPBHnV2Bu2

#

it seems to filter down to
jdk.internal.misc.Unsafe.park()34.52%
so half the used tick during the problematic report

quaint berry
#

if (target == "accept", "deny") { } This doesn't work what would?

#

If the targets name equals accept or deny then activate

proud basin
#

first off

buoyant viper
#

idk what language ur smokin but that doesnt fly in java

quaint berry
#

Yeah...

proud basin
#

why are you comparing to a string with ==

quaint berry
#

Idk

proud basin
#

what are you trying to do

buoyant viper
#

if (target.equalsIgnoreCase("accept") || target.equalsIgnoreCase("deny")) {} u gotta compare them individually with ||

quaint berry
#

Oh

#

Thanks

proud basin
#

|| means or btw

quaint berry
#

Oh thank you

proud basin
#

alerithe i got a new error today

quaint mantle
#

?learnjava

undone axleBOT
quaint mantle
#

yeah but that would be a life changing with it does something like target.equalsIgnoreCase("accept", deny) lol

#

or just look into their code then made a String... string method hmmm

buoyant viper
bitter sentinel
#

hi, i want to make a skript that allows that when you step on a specific block, it spawns an item with a specific delay and spawn count. Thanks

young knoll
#

Ask in the skript discord

bitter sentinel
wicked lake
#

Literally just google "skript discord"

cedar oyster
#

Does anyone know if there is a more efficient way to check for an inventory click event for a gui, than I used in my plugin here: https://github.com/Code12x/WorldTP-For-Multiverse/blob/master/src/main/java/com/code12/worldtp/listeners/InventoryListener.java ? I was using the timings command in spigot and the inventory click event looked to be higher than it should be https://timings.spigotmc.org/?url=piziqagafu. I'm trying to improve the efficiency of my plugin, and whenever someone uses the gui to teleport to another world, it lags for a bit.

GitHub

A basic world menu for your worlds on your server. - WorldTP-For-Multiverse/InventoryListener.java at master · Code12x/WorldTP-For-Multiverse

hexed hatch
#
if (Biome.valueOf(element.getAsString()) == null) {
  continue;
}```
Can I not null check an enum? I keep getting an IllegalArgumentException for this, is there a good way to check to see if an enum exists? How much of a sin would it be to use a try catch to check if the enum doesn't exist?
young knoll
#

You can turn the enum values into a set and use contains

#

Or just catch the exception

bitter sentinel
#

is there a event called "standing" like give a item to a player when they are standing on a block for 10 sec

young knoll
#

No

bitter sentinel
#

what is it called then?

young knoll
#

There isn't an event

#

You would probably use either a runnable or the player move event

hexed hatch
bitter sentinel
#

but for example, i want to give a player an item for each 10 seconds he stands there, what do i do?

hexed hatch
#

runnable

hexed hatch
#

?scheduler

young knoll
#

?scheduling

undone axleBOT
bitter sentinel
hexed hatch
#

lol

bitter sentinel
#

srry im new

hexed hatch
bitter sentinel
#

i just stared now

young knoll
#

Do you know Java

hexed hatch
#

Do you have a solid grasp on Java?

#

If not, that's where you should start

bitter sentinel
#

no i am doing skript

#

with the skript plugin

hexed hatch
#

this is not the place to get support for skript

young knoll
#

Don't ask us about skript

bitter sentinel
#

ohhh

#

sorry

young knoll
#

None of us use it

#

(I would guess)

bitter sentinel
#

kk

civic adder
#

BuildTools is supposed to add craftbukkit to my local maven repo, correct? It was able to do that for 1.14 and 1.15, but no other version I try downloading seems to add it to the local maven repo.

glossy scroll
#

? What do you need it for

#

Should be installing all versions to your m2

civic adder
#

Well I don't need it now, but I was gonna need it to update a discontinued plugin that had a lot of NMS stuff from 1.14 to 1.17. I only needed to edit a few lines in a specific class, but seeing as I didn't have the dependencies, it wouldn't compile. I found a way to edit the bytecode of the class in question directly, so I didn't need to do any recompiling (which was super hacky and I'm surprised it even worked lol)

pliant tundra
#

when i add a vanilla enchant to an item with one of my custom enchantments, it removes the custom enchant
how can i prevent this

quaint mantle
#

"custom" enchantments are generally unsupported

young knoll
#

That being said, they shouldn’t just disappear

#

Are you sure it isn’t just visually disappearing

quaint mantle
#

There's no nbt ok bukkit itemstacks created with new ItemStack, right?

pliant tundra
quaint mantle
#

in the lore

pliant tundra
#

am i supposed to use nbt?

young knoll
#

I mean you probably should use PDC for enchantments

quaint mantle
#

ok

young knoll
quaint mantle
#

that wasnt related to his question though

#

Using pdc is at least supported

young knoll
#

Yeah

quaint mantle
#

I wanna code a pdc wrapper that supports 1.8-1.18 for poor legacy buddies

young knoll
#

I do prefer the hacky way myself tho

pliant tundra
young knoll
#

?pdc

young knoll
noble lantern
#

pdc is godsend

#

thats what it is

quaint mantle
#

hmm right

sonic phoenix
#

Hey! I am developing a simple maploader. I see bukkit doesn't like the world's directory name. But, why could be so?
This is the name: 9b9a6c37-c613-4806-a02a-8841cf27ac91__1639463605 it does not seem to be what the error message indicates. Could it be the length?

[03:33:25 ERROR]: Failed to load map. Temp map id: 9b9a6c37-c613-4806-a02a-8841cf27ac91__1639463605
[03:33:25 WARN]: net.minecraft.ResourceKeyInvalidException: Non [a-z0-9/._-] character in path of location: c:\users\jose\desktop\mctest\plugins\hardgaming-test\gamemaps/temp/9b9a6c37-c613-4806-a02a-8841cf27ac91__1639463605
[03:33:25 WARN]:     at net.minecraft.resources.MinecraftKey.<init>(SourceFile:41)
[03:33:25 WARN]:     at net.minecraft.resources.MinecraftKey.<init>(SourceFile:46)
[03:33:25 WARN]:     at org.bukkit.craftbukkit.v1_18_R1.CraftServer.createWorld(CraftServer.java:1118)
[03:33:25 WARN]:     at org.bukkit.Bukkit.createWorld(Bukkit.java:588)
[03:33:25 WARN]:     at loader.MapLoaderAsync.lambda$loadTempMap$0(MapLoaderAsync.java:46)
[03:33:25 WARN]:     at loader.MapLoaderAsync$MapLoadProc$1.run(MapLoaderAsync.java:107)
[03:33:25 WARN]:     at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftTask.run(CraftTask.java:82)
[03:33:25 WARN]:     at org.bukkit.craftbukkit.v1_18_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:415)
[03:33:25 WARN]:     at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1255)
[03:33:25 WARN]:     at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:428)
[03:33:25 WARN]:     at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1206)
[03:33:25 WARN]:     at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1034)
[03:33:25 WARN]:     at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:304)
[03:33:25 WARN]:     at java.base/java.lang.Thread.run(Thread.java:833)
young knoll
#

You are trying to make a resource key with a bunch of invalid characters

sonic phoenix
#

Why are they invalid? They are all of the format [a-z0-9/._-]

young knoll
#

\ isn’t

sonic phoenix
#

oh, that is weird, seems I will have to work with relative paths then

young knoll
#

Why not just use the ending part

sonic phoenix
#

yup, that is what I will do

#

thanks

sullen marlin
#

just use the other slash

peak gulch
#
String name = plugin.getConfig().getString("player-name");``` what i should put in plugin place
drowsy helm
#

your main class that extends JavaPlugin

smoky oak
#

net.minecraft.world.level.block.Block.a(int) -> returns IBlockData
Is there a list of mappings from int to block? I havent found anything

waxen plinth
#

Why do you need it though

smoky oak
#

the problem is that i cannot find those ids

#

and i need to use them for speed

waxen plinth
#

For speed

#

As in you think it will make your code faster

smoky oak
#

im fairly sure passing a int instead of a item is faster

waxen plinth
#

And what are you doing that is so performance critical that you can't even use an enum over an int

smoky oak
#

nothing

#

but i cannot pass that as an argument

#

to that function

#

so i need to either use int or another nms class as argument

waxen plinth
#

What function

#

What are you doing

smoky oak
#

im trying to get IBlockData

waxen plinth
#

No

#

What are you trying to accomplish

#

What is your goal

#

Spare me the details of your current attempt to solve it and tell me the actual problem

crimson terrace
#

?xy

undone axleBOT
smoky oak
#

im not asking for a written out solution

#

im asking for an inking of one

waxen plinth
#

You're not giving us details

#

Seriously just tell us what your goal is

smoky oak
#

I just want to set IBlockData to set a block in the world via nmsChunk.setBlockState, since the bukkit method is too slow (speak server crash).
The problem is that the function initializing IBlockData only takes weird arguments - which do NOT include ItemStack or Material. The functions basically all refer to either other IBlockData (probably for rotation and stuff) or an int as valid inputs.
The issue with that is that that int? There's no list ANYWHERE telling me what int to input for what block and I'D rather not iterate over all the ~1200 blocks Minecraft has manually

waxen plinth
#

Again

#

This is not your end goal

smoky oak
#

ah

waxen plinth
#

This is your current attempt to solve it

#

What is your ACTUAL GOAL

smoky oak
#

fill out a cube with blocks

#

ie every chunk in the nether

waxen plinth
#

You want to fill every chunk in the nether with specific blocks?

smoky oak
#

upper half with netherrack and one layer bedrock

waxen plinth
#

You should consider using the WorldEdit api

#

Or just make a custom world generator

smoky oak
#

ah

#

well

#

thats somehting that needs to be done with already existing chunks

#

not new ones

#

also can you use worldedit in 1.18 already?

waxen plinth
#

Yes

#

I don't know if they have full releases but dev builds are out