#help-development

1 messages · Page 2263 of 1

shadow zinc
#

If it doesn't work, then I might pull out my hair and then give that a go tomorrow

paper viper
#

There isn’t special source for gradle which is honestly..

shadow zinc
#

gradle is sigma

ivory sleet
#

Fax

#

Gradle with kotlin dsl especially

tender shard
#

gradle is like "I'm faster than maven, but I also cannot really do anything without 3rd party plugins, not even shade anything lol"

river oracle
#

Forking🍴 🍴 🍴 fork

sudden violet
#
GitHub

Minecraft server mod/plugin to monitor TPS, MSPT, and other information in the tab menu, boss bar, and action bar. - TabTPS/SpigotReflection.java at d950c184d7de7c865fb4fafd0538de88041009a1 · jpeni...

ivory sleet
#

It’s just that no one bothers to write a task for that

#

Since we got epic plugins

tender shard
#

i always thought it requires this plugin from some random github dude

ivory sleet
#

Uh well I can send u an example once I get on my pc

#

hahahah

tender shard
#

because everyone is using it

ivory sleet
#

Yeah well people like to use that plugin since they don’t have to fuck with the volatile gradle api themselves

#

Good point

shadow zinc
#

ehhh, well I am making this plugin as a resource for spigot

#

i dont want to be like, oh and download this!

#

Could I shadow it?

tender shard
#

shadow what exactly?

ivory sleet
#

Shading spigot?

shadow zinc
#

done it, didnt work well

tender shard
#

lol

ivory sleet
#

Lol

shadow zinc
#

tabtps

#

oh wait

#

nvm

#

I saw plugin called tabtps, got confused

tender shard
#

I'll add a TPS method to my lib now lol

ivory sleet
#

KyTDK Alex is being a hero now

#

Holy

shadow zinc
#

omg

#

am I getting my own tps method?

ivory sleet
#

🥲

paper viper
#

Gradle superior

tender shard
#

but I need a bit because I gotta compile spigot 1.16 to 1.18 before I can recompile this >.<

paper viper
#

Gradle stans rise

ivory sleet
#

Yaaaa

#

@paper viper btw what’s ur rank on valorant

paper viper
#

I don’t play comp but bronze 3 cause that’s what I got in placements lol

ivory sleet
#

Ah nice

paper viper
#

My actual rank is probably gold or plat

ivory sleet
#

Professional I see

#

Holy

paper viper
#

Well I play against gold players and I beat them before

humble plover
#

Guys i am developing mc server

humble plover
#

can anyone say me best kill counter plugin

hybrid spoke
paper viper
#

^

humble plover
#

Can u say me pleas

tender shard
paper viper
#

Idk any plugins we are just coders

hybrid spoke
#

if you are developing it, just make your own?

humble plover
paper viper
#

Lol

ivory sleet
#

Skript?

tender shard
#

ugh

humble plover
shadow zinc
#

wtf is skript

paper viper
#

XD

ivory sleet
#

I have written Skript

hybrid spoke
shadow zinc
#

sounds bad

ivory sleet
#

And it’s quite limiting to say the very least

paper viper
#

Conclure I still use the obfuscated fields

#

In NMS

shadow zinc
#

ik I used it before I started to learn programming

tender shard
ivory sleet
paper viper
#

Idk

shadow zinc
#

bruh

ivory sleet
humble plover
#

what the hellllllllll

#

can you replyyyyyy

tender shard
shadow zinc
#

Its like using a bike, just why?

ivory sleet
hybrid spoke
#

kick him

paper viper
paper viper
paper viper
#

Lol

tender shard
#

compiling spigot on a dual care laptop is no fun

paper viper
#

How do you set the obfuscation thing on gradle

#

Paper weight?

#

Or do you something else

ivory sleet
#

I use paper weight

#

But like I get the paper api so ye if you don’t want that it gets a bit tricky

#

(You basically have to hack around to remove it from the classpath)

paper viper
#

It’s fine I don’t use any spigot classes

#

Only Bukkit

ivory sleet
#

Alright

shadow zinc
#

im trying to use paper rn, no idea what im doing

#

lots of red

quaint mantle
#

Use spigot 🤷🏿‍♂️

shadow zinc
#

gradle

#

cant

river oracle
#

Icky paper

#

Convert to maven

tender shard
#

i love how gradle always only causes problems for everyonne

ivory sleet
#

^ might be worth while to convert in your case

tender shard
#

yet they claim its so much better

ivory sleet
#

I know how it feels using a secondary tool but well

shadow zinc
#

paper and gradle, bow down to me

tender shard
#
    @Override
    public double[] getTps() {
        return new double[3];
    }

problem solved ig

#

wait whut

#
        return ((MinecraftServer)Bukkit.getServer()).recentTps;

#

does this actually work? Is the actual NMS server implementing Bukkit's Server interface?

paper viper
#

Check implementation to see if CraftServer implements it

tender shard
#

I always thought there's a separate bukkit server thing like in CraftPlayer vs NMS Player, etc

tender shard
#

CraftServer.getHandle() returns the MinecraftServer and simply casting the Bukkit Server wouldnt work at all lol

quaint mantle
#

Maybe it has a reflective proxy to allow casts 😮

#

Kidding

tender shard
#

oh wait I'm talking bullshit too

#

CraftServer.getHandle returns a DedicatedPlayerList? o0

tall dragon
#

if someone here has the time. how would one approach making a "quest" or "achievement" system, ive always been thinking about it but just find it very hard to come up with a good solution. because a quest/achievement can be many different things. anyone willing to point me in a good direction?

tender shard
#

it doesn't implement (or extend, whatever) neither Server, nor CraftServer

paper viper
#

Look at mods and how they check for crafted items, smelted items, etc

#

Like betterquesting

tall dragon
#

is it open src?

paper viper
#

Or HardcoreQuestMode

#

It’s a mod

tall dragon
#

thanks. il take a look at that

paper viper
#

FTBQuests also good too

ivory sleet
#

heard BetonQuests is neat altho idk if it’s open source

clever musk
#

Whats the method for getting ChatColor for RGB values?

tall dragon
ivory sleet
tender shard
tardy delta
#

hmm /reload broke my own plugin

tender shard
#

just shut down the server on /reload and tell people not to use it

#

ok don't shut it down but print many warnings

#

or fix this problem 😛

tardy delta
#

System.exit(1)

#

or is there a java way to shutdown the whole pc lmfao?

tender shard
#

the best way to instantly stop the JVM is to use Unsage#putAddress

tardy delta
#

lmao

tender shard
shadow zinc
#

summon 1000000000 tnt

#

that should do it

twilit roost
#

any clues why it occures?

left swift
#

How can I get file from the resources folder in plugin?

paper viper
#

I think

tender shard
#

in case anyone still cares, here's how to get the TPS on 1.19

    @Override
    public double[] getTps() {
        return ((CraftServer)Bukkit.getServer()).getHandle().getServer().recentTps;
    }
shadow zinc
#

oh is that it?

tender shard
# twilit roost

this happens because you add or remove elements from a collection while iterating over it. Use an iterator or switch to a concurrent collectionn

quaint berry
#

I'm creating a discord bot in a minecraft plugin, which discord server do I ask since it isn't working? (Sorry for butting in)

shadow zinc
#

not great success

twilit roost
shadow zinc
#

oh its because im not using mappings because gradle is being a blank

tardy delta
#

balls.size() > 1

shadow zinc
tender shard
#

non

#

no*

#

you create a new iterator everytime

#

you have to reuse the same iterator all the time

twilit roost
tardy delta
#

he wants to collide his balls

twilit roost
tender shard
#

don't use a for loop, use a while loop

twilit roost
#

:))

shadow zinc
#

noice

twilit roost
shadow zinc
#

ngl it does

tender shard
#
Iterator<Thing> it = whatever.iterator();
while(it.hasNext()) {
  Thing thing = it.next();
  // Do thinngs
#

this should work fine

twilit roost
#

right thx

tender shard
twilit roost
#

weird ppl

paper viper
#

Anyone know any good JavaDocs generators so I can auto generate docs and then go back and edit some things

tardy delta
#

uhh

shadow zinc
#

?paste

undone axleBOT
shadow zinc
#

need help with my gradle build

#

fff

twilit roost
#

my man just requested paste site
so he can paste into discord xDDD

eternal oxide
# twilit roost

you are adding or removing from the collection in your collided method

shadow zinc
#

keep getting - Plugin Repositories (could not resolve plugin artifact 'io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.3.3') Searched in the following repositories:

twilit roost
tender shard
#

I bet you remove or add elements inside there

eternal oxide
tender shard
#

just use a copyonwritearraylist or a concurrenthashmap lol

twilit roost
#

collided checks if it collided
thats all
but calls different method that does:

Location loc = as.getLocation();
World w = as.getWorld();
w.spawnParticle(Particle.EXPLOSION_NORMAL,loc,10);
w.playSound(loc,Sound.ENTITY_GENERIC_EXPLODE,6,1);
shotBalls.remove(as);
List<Entity> nearby = as.getNearbyEntities(5,5,5);
nearby.forEach(entity -> {
    if(entity instanceof Player){
        ((Player) entity).setHealth(((Player) entity).getHealth()-4);
    }else if(entity instanceof LivingEntity){
        LivingEntity le = (LivingEntity) entity;
        int remove = 8;
        if(le.getHealth()>=remove)
            le.setHealth(le.getHealth()-remove);
        else
            le.setHealth(0);
    }
});
as.remove();
tender shard
#

or stop manipulating your collection while iteratinng

#

see? you call "shotBalls.remove"

#

while iterating

#

stop doing that

young shell
#

Does Bungeecord have an API way of loading Plugins at Runtime? Or do I need to use reflection

eternal oxide
#

Change your collided method to return a bool, then use if (CannonBallEventManager.collided(as)) it.remove();

small current
#

Hello guys i have a problem
in one of my old codes there is a bug that i don't understand at all

so its a knockbackffa plugin's jumppad system that if players place a gold pressure plate with a tag,
it will start a task that will reload the thing and give the player the item back

and because of 1.8, if you place a jumppad it can turn into air quickly for some reason in some condition

If you say change to a new version you will be blocked cause im getting payed to do it in 1.8

so i will add the task id to a list that will be looped and make all the tasks in it cancelled when a player dies or leaves or map resets

a new Reload object would be made so it's value will be shown in scoreboard
for some reason the task won't start

eternal oxide
#

change to a new version

small current
flint coyote
twilit roost
#
  1. do it in newer version
  2. ViaBackwards
small current
#

that one is already blocked

flint coyote
#

I don't even know what you mean by the turn into air quickly

small current
#

for some reason

#

if you place it right next to a rose

#

it will turn into air

#

and in the blockplacevent

#

block.getType still returns gold_plate

quaint mantle
small current
#

so i will do the check 1 tick later

tender shard
#

I'm definitely not lol

twilit roost
quaint mantle
#

i do too.

eternal oxide
#

In teh place event it shows as a gold_plate because you are testing the Block you are about to place (cancellable)

small current
#

but for some reason this task won't start

#

in it's constructor

#

i create a new Reload

#

that will be addet to a list

eternal oxide
#

If you get the actual world Block not event.getBlock it will be air

small current
#

shown in scoreboard

#

but it won't

twilit roost
small current
#

somehow this object won't be created

tender shard
#

anyway if you ask people to not tell you to update, then of course people tell you to update anyway. especially if it's 1.8. I mean that's so old, there have been more releases since 1.8 came out then before it came out

small current
#

and then

#

getBlockAt

#

and it will be fixed ?

eternal oxide
#

if you want to see what block is currently IN the world

small current
#

so i should try getting the actual block

#

and not event.getBlock

#

it might be fixed and the 1 tick will go away

#

?

eternal oxide
#

event.getBlock will be the plate you are about to place

small current
#

since its 1 tick before the event realy happening

#

it will always return air ig

tender shard
paper viper
#

Block me pls

tender shard
small current
#

people won't understand

paper viper
#

I don’t wanna see your face

#

Lol

#

Your fault

small current
#

i cannot go and say

#

hello

paper viper
#

If you took a task that’s 1.8

small current
#

the shit you asked me won't work in 1.8

#

so update to 1.18

twilit roost
small current
#

and stop worrying about performance

#

and also use ocm

#

or this purpur option

#

so 1.8 pvp that kids hate will return

tender shard
#

what the heck are you talking about

small current
#

i don't understand

tender shard
#

me neither. just update lol

limber owl
#

oh no, debate against 1.8, someone is getting death threats again

small current
#

why you care

tender shard
small current
#

what version i use

#

if you can

#

help

#

if you cant

#

don't

#

stop shittalking

#

and being like a jerk

paper viper
#

Update to 1.19 🙂

tender shard
#

or 1.19

small current
#

and make it so people wont even see my shit

limber owl
#

some people just need to make something for 1.8 and need help with something, why do you have to be such rude

small current
#

being a jerk

#

not like it

#

being it

tender shard
small current
#

like the word jerk

#

came from them

paper viper
#

That’s how it works lol

small current
#

will it make you happier to

tender shard
#

are you currently having a stroke or sth? because this makes no sense to me

small current
#

bullshit about someone's version ?

limber owl
paper viper
#

No, not just me. We don’t support it

paper viper
eternal oxide
#

Things that never happened

small current
#

if someone uses 1.8

limber owl
tender shard
small current
#

don't reply to them

#

does it make you happier

#

this dude literally goes and yells around "love is love support me"

limber owl
#

I didn't reply to anyone who sent me death threats, I usually block and delete them, why bother with such smooth brains

small current
#

yeah i want to say version is version

paper viper
small current
#

won't ever ask for help in a server with you jerks

small current
#

not wanting to help

tender shard
small current
#

but what if i...

#

installed betterdiscord

#

and installed a plugin that

paper viper
#

That’s outside our scope

small current
#

won't show this annoying thing

limber owl
tender shard
#

betterdiscord will not magically fix all the quirks of the 1.8 API

small current
#

and will remove this mfnalex

#

from existance

paper viper
shadow zinc
#

need help with gradle paper weight

paper viper
#

You don’t have to be so sensitive

#

Lmao

shadow zinc
#
Plugin [id: 'io.papermc.paperweight.userdev', version: '1.3.7'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin:1.3.7')
  Searched in the following repositories:
    Gradle Central Plugin Repository
tender shard
eternal oxide
#

You never know, they may take the hint and update. Some actually do

small current
#

you are trashtalking

#

about 1.8

twilit roost
small current
#

a version that im asked to use

paper viper
#

Trash talking?

limber owl
small current
#

and being payed to use it

paper viper
#

All I said is to update

small current
#

and it worked

#

until now

paper viper
#

Not trash talk

small current
#

no problem at all

small current
#

instead of this

shadow zinc
#

update

unreal quartz
#

Why is it whenever I open this server it's in utter shambles

limber owl
eternal oxide
#

Great timing? 🙂

paper viper
#

Lol someone drag 7smile here heeheehaw

limber owl
#

@small current why are you spamming?

tender shard
# small current from existance

just come to my place and try to "remove me from existance", my address is on my website. but I won't be home until july 17th

limber owl
#

🍿

tender shard
paper viper
#

Lol

twilit roost
limber owl
#

🍿 <- salt | sugar -> 🍿

tender shard
#

this dude looks weird

limber owl
#

👀

tender shard
#

erm

#

I meant salt

#

shit

#

Salt > Sugar

twilit roost
limber owl
#

🤨

tender shard
#

👁️ 👅 👁️

#

this one is weird af too

twilit roost
#

"Good Night"

tender shard
opal juniper
#

this is the spigot discord

#

more specifically, help dev

limber owl
twilit roost
#

cech brasko

tender shard
limber owl
twilit roost
#

ty taky ne

limber owl
#

sk

#

😄

twilit roost
#

jaj neva

shadow zinc
#

I fixed my problem while I waited for your version war to end

tender shard
#

btw there's no war, everyone knows that 1.8 sucks

twilit roost
#

fax

shadow zinc
#

i mean the combat tho

tender shard
#

even 1.8 users know it. they just call the lack of features "better performance"

#

and they call "I'm too bad for real PvP so I just wanna spam left-click" "better combat"

shadow zinc
#

Just because its true doesn't make it correct

twilit roost
#

can I raycast x blocks forward?
and get the furthest location

shadow zinc
#

people got their opinions

small current
#

i will just do a debug

tender shard
#

yeah it was you

#

nice

twilit roost
eternal oxide
twilit roost
#

nah

twilit roost
#

I do that but if I aim at nothing
it return null as RayTraceResult

eternal oxide
#

yes

tender shard
#

isn't getTargetBlockExact what you're looking for?

#

or am I missing sth

twilit roost
#

the player is maybe looking into air
therefore no block

tender shard
#

it will return the last air block within distance then

eternal oxide
twilit roost
#

oh thx

tender shard
#

weirdly this isn't documented but I once tried it just for fun and it ALWAYS returned a block for me

#

I basically used getTargetBlockExact (or maybe just getTargetBlock? not sure) to display a hologram to the player and it worked fine

eternal oxide
#

If you just want the block at X distance then don;t raytrace

tender shard
#

yeah just get the player's locationn and normalize and multiply their facing direction with the desired distance

#

does someone have a maven settings.xml quickly, with repository credentials?

twilit roost
tender shard
#

Perfect! Thats definitely way faster than raytracing

twilit roost
#

was aiming there
but my projectile that was flying to the location landed ~ where my hand is

eternal oxide
#

um, thats long windedjava Location l = shooter.getLocation().add(shooter.getLocation().getDirection().normalize().multiply(distance));

old cloud
#

Is it possible to asynchronously register a command?

paper viper
#

Is there a purpose for doing it async?

old cloud
#

Yes if I want to do some IO stuff before registering it

#

for example

eternal oxide
#

do the IO Async then use Bukkit.getScheduler().runTask to run it sync

old cloud
#

so its not possible i suppose, thats bad, but thanks

#

how is it with bungeecord?

eternal oxide
#

the scheduler jumps back sync, or just a Future

formal bear
#

I'm using RDS MariaDB, how to pass SSL HandShake?

Caused by: javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
paper viper
#

I guess

subtle folio
#

Is it possible to add color codes to an npc's name?

#

using game profiles

eternal oxide
#

yes

subtle folio
#

GameProfile gameProfile = new GameProfile(UUID.randomUUID(), "&cBadger"); Like this?

eternal oxide
#

you may need to translate it first

subtle folio
#

translateAlt right?

eternal oxide
#

not sure it will auto translate

subtle folio
#

or is there an nms method

eternal oxide
#

be aware any profiles you do create will be added to the servers playercache

paper viper
#

CraftChatMessage.fromString

eternal oxide
#

they will expire, but they do get added

paper viper
#

Wait

#

No

#

I’m stupid

subtle folio
#

lol

tender shard
paper viper
#

Don’t listen to me with that one second

subtle folio
tender shard
#

translateAlternateColorCodes... why not just "translateColors" or sth lol

subtle folio
#

fr

#

tC

eternal oxide
paper viper
#

Because the normal one is the weird symbol and you are using alternate characters to resemble it

#

I guess

eternal oxide
#

so don;t go creating hundreds of profiles

subtle folio
#

ooo

#

can I like

#

lag out a server

#

with that?

tender shard
#

Erm wait

eternal oxide
#

no

tender shard
#

just creating a GameProfile won't touch the player file at all IIRC?

eternal oxide
#

but you can decrease performance

subtle folio
#

i c

eternal oxide
#

not player file, usercache

subtle folio
#

restarting clears cache?

eternal oxide
#

no

subtle folio
#

how 2 clear

tender shard
#

yeah that's what I meant. But if you only create the Profile, will it still touch that file?

eternal oxide
#

yes

tender shard
#

oh didnt know that

eternal oxide
#

{"name":"Test","uuid":"d8d5a923-7b20-43d8-883b-1150148d6955","expiresOn":"2021-09-27 17:22:03

tender shard
#

then I should change some things in some plugins

subtle folio
#

works

#

why did my skins stop working

tender shard
#

did you properly sign the texture?

subtle folio
#

im using the mojang api

#

to fetch it

eternal oxide
#

correctly applying it?

tender shard
#

but you create a gameprofile with a differennt nname

subtle folio
#

yeah

#

but I have the uuid of a user i want to copy

#

texture wise

tender shard
#

btw sorry about my typing, my n and b keys are stuck so I sometimes miss those letters or send them twice lol

subtle folio
#
GameProfile gameProfile = new GameProfile(UUID.randomUUID(), ChatColor.translateAlternateColorCodes('&', "&cBadger"));

            JSONArray array = SessionRequest.getJsonArray("f232b11be35542eea524b14a658e2240");
            String value = SessionRequest.getValue(array);
            String sig = SessionRequest.getSig(array);

            gameProfile.getProperties().put("textures", new Property("textures", value, sig));```
eternal oxide
#
profile.getTextures().setSkin(new URL(getURLFromBase64(base64Texture)));```
```java
    private String getURLFromBase64(String base64) {
        
        return new String(Base64.getDecoder().decode(base64.getBytes())).replace("{\"textures\":{\"SKIN\":{\"url\":\"", "").replace("\"}}}", "");
    }```
subtle folio
#

oh so i found the issue

tender shard
#

also isn't there now an API for this?

subtle folio
#

ps.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, npc));

subtle folio
smoky oak
tender shard
subtle folio
#

oh what

subtle folio
#

i have no seen that

tender shard
#

it was added in 1.18.0 IIRC

smoky oak
#

either 1.18 or 1.19

subtle folio
#

ooo fun

eternal oxide
tender shard
subtle folio
#

1.19 added barely anything

smoky oak
#

ah ok. On a different topic im looking at decompiled spigot code and i saw this as import: org.jetbrains.annotations.NotNull;
Is that actually there or is that added by my IDE? Im on intellij

tender shard
#

or I was too stupid to properly name this class back then

subtle folio
#

who is jeff

tender shard
smoky oak
#

alex

subtle folio
#

i thought u were alex

tardy delta
#

jeff alex

tender shard
tardy delta
#

its not even alex either

smoky oak
#

ah ok. I'm trying to make an event rn

subtle folio
#

mfw alex

tender shard
#

no idea why

subtle folio
#

name twins what??

tardy delta
#

owo

smoky oak
#

why are so many people named Alexander in this generation anyways

tender shard
smoky oak
#

i know like ten

subtle folio
tardy delta
#

hmm is reloading the server calling onDisable and onEnable after e/o?

smoky oak
#

yes

#

afaik

tardy delta
#

sucks

tender shard
subtle folio
#

funny

#

:)

smoky oak
#

the alexanders i know range in size and statue from waif to wrestler

#

so it got nothing to do with that i fear

subtle folio
#

im a wrestler

tender shard
#

i'm more a waifu person lol

subtle folio
#

mfw

tender shard
paper viper
#

😵‍💫

tender shard
subtle folio
#

im going back to paper

tender shard
#

pepperspigot

subtle folio
#

nachos

tender shard
subtle folio
#

we

#

ew

#

i h8 lombok

tender shard
#

I like lombok

#

well, some things

#

e.g. SneakyThrows is very useful SOMETIMES

tardy delta
#

@Cleanup

paper viper
#

Weirdos

tardy delta
#

im not usin it

smoky oak
#

only annotations i know are @Override and @EventHandler

old cloud
paper viper
#

CompletableFuture.runAsync

subtle folio
#

i hate packets

#

so cringe

smoky oak
#

wait isnt Eclipse jetbrains? Why doesnt it recognize the imports?

tardy delta
eternal oxide
# smoky oak
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>20.1.0</version>
            <scope>compile</scope>
        </dependency>```
smoky oak
#

thanks

tardy delta
#

23.0.0 is latest

eternal oxide
#

probably

subtle folio
#
new BukkitRunnable() {
                @Override
                public void run() {
                    ps.send(new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, npc));
                }
            }.runTaskLater(Npctdi.getInstance(), 20);```
#

so weird

#

but fixs issue

#

in a runnable

smoky oak
#

jetbrains is the company that made eclipse and i was confused why it didnt know the import

paper viper
#

Eclipse? Huh

smoky oak
#

wait

#

im dumb

#

intellij i mean

paper viper
#

You talking about the IDE?

#

Yeah lol

#

No that’s a separate dependency

#

It’s not automatically added

#

However, it is made by jetbrains too

old cloud
paper viper
#

runAsync just runs it asyncroniusly

#

Doesn’t block

old cloud
#

I want to run some IO stuff and if the operations were successful I want to register a command

paper viper
#

Then you could do the normal run method that accepts a runnable and runs it on the main thread

smoky oak
#

iirc you can register and deregister commands and events outside of enable code

old cloud
#

that is not the point here

tender shard
paper viper
#

Here’s what I’d do

paper viper
#

CompletableFuture.runAsync(IO Stuff).thenRun(Registering Command)

tender shard
#

I mean sure, IO stuff should be done async at runtime, but during onLoad... just go sync lol

paper viper
#

Yeah is there any reason for what you are doing?

old cloud
eternal oxide
#

If I wanted to do a db query as I startup I'd CompletableFuture Async in onLoad, then use teh data in onEnable

worldly ingot
tender shard
#

btw does anyone know if one can tell MySQL to "fake" lags?

paper viper
old cloud
tender shard
#

anyway I'll go swimming now, have a nice day everyone ❤️

smoky oak
#

wait how are you a programmer and can stand the sun

paper viper
#

I’m on vacation right now too lmao

tender shard
paper viper
#

0

smoky oak
#

eh fair's fair

#

world's not entirely stereotypes

tardy delta
#

DIE();

limber owl
#

how do i generate caves with perlin noise?

hushed spindle
#

does anyone happen to know of a way to prevent an entity taking damage without cancelling the event or reducing the damage through the event

#

preferably also not using stuff like resistance potion effects

hushed spindle
#

ohh right

#

i could try that

#

though i still kinda need them to take the damage tick for natural knockback reasons

flint coyote
#

So why don't you want to reduce the damage then?

hushed spindle
#

im making a custom damage system, it currently works by reducing the damage to a very low value and then setting the health lower manually

humble tulip
hushed spindle
#

issue is it doesnt work with damage indicator plugins/mods

flint coyote
#

you could use the EventPriority so your custom damage system can still overwrite the damage after your knockback plugin set it to 0

hushed spindle
#

is there like a way i can set the damage back to its original value specifically with the MONITOR event priority

eternal oxide
#

No changes in Monitor

hushed spindle
#

i know the changes dont reflect in the game which is good or is it actually just not possible to edit events in monitor

#

or would i need to do some packet editing shenanigans so the packet sent to the player still reflects the amount of damage dealt

tardy delta
#

is bossbar::getPlayers::clear reflected ingame?

hushed spindle
#

i believe so

limber owl
smoky oak
#

3d perlin noise spits out a 0-1 double value for every coordinate, differing depending on your seed for it. You declare above which value you're filling in that coordinates with air

thin shore
#

So im setting client side blocks and im using player#sendBlockChange() however when doing large scales of changing it causes large amounts of lag on the client side. I want to disable the lighting calcs etc and I need to do this with nms, does anyone know how to do this?

smoky oak
#

lightning is calculated server side. there should be something akin to not doing a physics update for lightning

limber owl
smoky oak
#

you'll have to look how to generate perlin noise. if it is seemingly random i think your scale is too big

#

youre supposed to see a gradient

#

ill look into it later

formal bear
#

Can someone help me rebuild one project? I just wanted to add three lines to the Hikari MySQL connection, but i cannot build it

tender shard
limber owl
#

help, my perlin nosie/any noise is really random and idk what to do
code:

    private ArrayList<Block> makeCave(World world, Random random, Chunk chunk) {
        ArrayList<Block> cave = new ArrayList<>();

        int blocks = 0;
        final int maxBlocks = 10000;

        SimplexNoiseGenerator perlinNoise = new SimplexNoiseGenerator(world);
        for(int x = chunk.getX(); x < 20; x++)
            for(int z = chunk.getZ(); z < 20; z++)
                for(int y = 0; y < 20; y++){
                    if(blocks > maxBlocks)
                        return cave;

                    Block block = getBlock(perlinNoise, world, x, y, z);
                    if(block != null)
                        cave.add(block);
                    blocks++;
                }
        return cave;
    }

    private Block getBlock(SimplexNoiseGenerator perlinNoise, World world, int x, int y, int z) {

        final int octaves = 3, frequency = 8, amplitude = 64;
        double e = perlinNoise.noise(x, y, z);
        if(e <= 0 && y > 4) {
            Bukkit.getLogger().log(Level.INFO, x + " " + y + " " + z + " " + e);
            return world.getBlockAt(x, y, z);
        }
        return null;
    }

this generates 202020 big cube that should have open spaces inside, but instead it looks like if I'm doing

if(random.nextBoolean())
  cave.add(block);

idk where else should be the mistake because everything else works

twilit wharf
#

I am getting this error when trying to unload a world. Any ideas? Thanks in advance[18:26:01 ERROR]: Couldn't save chunk; already in use by another instance of Minecraft? net.minecraft.server.v1_8_R3.ExceptionWorldConflict: The save for world located at ./gm_game0 is being accessed from another location, aborting at net.minecraft.server.v1_8_R3.WorldNBTStorage.checkSession(WorldNBTStorage.java:73) ~[patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.World.checkSession(World.java:2976) ~[patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.ChunkRegionLoader.a(ChunkRegionLoader.java:121) ~[patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.ChunkProviderServer.saveChunk(ChunkProviderServer.java:278) [patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.ChunkProviderServer.unloadChunks(ChunkProviderServer.java:384) [patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.WorldServer.doTick(WorldServer.java:234) [patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:830) [patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:378) [patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:713) [patched.jar:git-PaperSpigot-"4c7641d"] at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:616) [patched.jar:git-PaperSpigot-"4c7641d"] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]

formal bear
limber owl
twilit wharf
#

thanks!

zenith gate
#

How can I increase a players health? even when they die? they keep it. I want to make an Item where they can boost their own health points..

acoustic pendant
#

why tf is this not working

#

i reloaded maven

limber owl
zenith gate
#

Yeah I know that way, but im talking about like eating this apple, and the health boost applies and it keeps...

acoustic pendant
zenith gate
#

is there a way to do that with a plugin? or is that more mod territory.

acoustic pendant
zenith gate
#

OKay..

acoustic pendant
#

i think there is setHealth but is deprecated

#

now you can use Attribute i believe

limber owl
acoustic pendant
#

oh true

limber owl
acoustic pendant
#

thanks

twilit wharf
#

although I did set save=false

limber owl
#

the add this to pom.xml

        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.11.0</version>
            <scope> provided </scope>
        </dependency>
zenith gate
# acoustic pendant now you can use Attribute i believe

Yeah It's just if i do it this way it will kind of take away some of the purpose of my other armor. Because If i use attributes I can only see it being on armor, holding an item is just going to be anoyying and my friends wont like that.

limber owl
twilit wharf
#

I already have it added

#

it just created the same error

limber owl
#

so what's the error and where, is it runtime or editor?

#

@twilit wharf

limber owl
#

but what error

#

?paste

undone axleBOT
limber owl
twilit wharf
#

that is all

zenith gate
#

I think I found away. Instead of doing an item i will just use their level.

faint perch
#

can someone help me why my groupmanger not show the ranks prefix

limber owl
acoustic pendant
twilit wharf
limber owl
faint perch
#

Why does my prefix not show?

limber owl
faint perch
# limber owl ?

i have createde a groupmanger but the prefix i set is not showing

limber owl
acoustic pendant
faint perch
#

its plugins

twilit wharf
faint perch
zenith gate
acoustic pendant
#

No

zenith gate
#

so i though a better way to make it perm is through levels and it can be auto applied.

acoustic pendant
#

Attribute

zenith gate
#

I cant make a player have an attribute without putting it on something

limber owl
faint perch
acoustic pendant
#

Wait, mb you can use #setHealth

sinful rapids
#
        ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
        String sus = "op" + args[0];
        Bukkit.dispatchCommand(console, sus);

In the console it writes that it cannot find the command, why?

iron glade
#

Is there a way to display an actionbar for a certain amount of time or is a runnable the only way?

twilit roost
#
Vector l = shooter.getLocation().toVector().normalize().multiply((shooter.getLocation().getDirection().multiply(shootDistance))).toLocation(shooter.getWorld()).toVector();
            
``` this always points in same direction no matter player Location/Rotation
any clue why?
Im trying to get Location of blocks x distance from player in player look  direction
limber owl
faint perch
#

with groupmanger

acoustic pendant
#

I did a plugin with attribute and sethealth and I remembered I didn't use attribute for that @zenith gate

limber owl
iron glade
faint perch
eternal oxide
acoustic pendant
#

I believe

twilit roost
limber owl
#

but you want help in development of plugin?? go to #help-server

faint perch
#

plugin

eternal oxide
acoustic pendant
#

I used it at least

limber owl
sinful rapids
limber owl
#

this is purely for using spigot api and developing plugins

twilit roost
eternal oxide
#

neither did mine

#
Location l = shooter.getLocation().add(shooter.getLocation().getDirection().normalize().multiply(distance));```
twilit roost
zenith gate
# acoustic pendant I believe

Why is getHealth depricated then?? im trying to set the health of the player but i want their current max health so i can add on to it. but getHealth is depricated. SetHealth and GetHealth are together are they not? so why would one be now and not the other.

twilit roost
#

?paste

undone axleBOT
acoustic pendant
#

Yea

#

Gethealth is deprecated

#

You have to use Attribute to gethealth

#

I confused before

zenith gate
#

my goodness... so many loopholes....

acoustic pendant
eternal oxide
twilit roost
#

I tried changing the Location from ur code to Vector, and also without turning it into Vector
but both didn't work

hollow arch
#

Is there a tag or something like that for transparent blocks? 👀

eternal oxide
twilit roost
#
if(res!=null && res.getHitPosition()!=null){
    to = res.getHitPosition().toLocation(seated.getWorld(),yaw,pitch);
}else{
    Location l = seated.getLocation().add(seated.getLocation().getDirection().normalize().multiply(shootDistance))
    to = l;
}

also no clue why even tho im looking at some blocks, it still uses else

eternal oxide
#

The code I gave you will give you an end Location (distance) blocks in the direction the origin Location is facing

#

That code you just posted is convoluted I can;t even tell what you are trying to achieve

twilit roost
#

first method is parabolic curve
second is usage of it

eternal oxide
#

dsitance, inertia, velocity drag. Thats not what you asked for

eternal oxide
#

You simply asked how to get teh Location X blocks distant from an origin

twilit roost
#

ye, ik
but idk why but it doesn't seem to work for me

eternal oxide
#

I can;t even tell what you are doing with it in that code

#

The code I gave you gives you the precise Location you asked for

twilit roost
#

therefore thx and imma go figure it myself

eternal oxide
#

X blocks from teh origin in teh direction it is facing

eternal oxide
tender shard
#

lol @eternal oxide are you drunk

#

Just wondering because you keep writing "teh" lol

paper viper
#

No he always writes it like that

#

Sometimes you type fast

#

And miss it

small current
#

dude wtf

paper viper
#

Lol

#

I’m going to add more

twilit roost
#

I bet that he keeps reading those messages anyway

paper viper
#

^

river oracle
#

Blocking people doesn't work I'm always so curious what they say I read it anyways

river oracle
eternal night
#

👀

smoky oak
mortal hare
#

can you store different kind of object inside private reflected field

#

lets say in code the variable is type Foo

#

and via reflection i try to set it as instance to Bar

eternal night
#

no

limber owl
mortal hare
#

Is there any way to extend class at runtime?

eternal night
#

What do you mean override ?

mortal hare
#

extend

#

without java bytecode libs

paper viper
#

Can you explain what you are doing

mortal hare
#

i want to inject my own code to specific NMS class

#

problem is that the class is package private

#

its inner class

#

i cant even instanciate it at compile time

noble mica
#

Depends on the purpose, but in this case you could probably just use reflection

river oracle
mortal hare
#

i can create new instance of it via Constructor#newInstance() which works well

#

but i need to add new functionality and override some methods

#

but because its package private i cant extend it in IDE

paper viper
noble mica
#

Ah I see

#

What is the class if you don't mind saying it?

#

Because there could be another way to solve your problem

mortal hare
#

BeaconMenu.PaymentSlot.class

#

it would fine if the type of field would be generic

#

like Slot

#

but its concrete class type

noble mica
#

Idk much about forge, but maybe you could just make a class in that package

mortal hare
#

that's spigot nms

river oracle
#

That's nms 😂

noble mica
#

Oh right I was looking at the wrong thing lmao sorry

mortal hare
#

i can instanciate that class via Reflection API

#

but I cant extend it

eternal night
#

that class isn't static even

river oracle
eternal night
#

like, you'd need the beacon instance

#

the easier way would be to just modify the tag it uses no ?

#

I presume that is what you are after

mortal hare
#

wdym the tag

#

private field type is Concrete class

#

not a slot

#

but it doesnt utilise any new methods inside that inner class

eternal night
#

what are you trying to do xD

#

mayPlace or getMaxStackSize

#

getMaxStackSize you are pretty fucked without bytecode

mortal hare
#

im trying to hook into mayPlace() and mayPickup()

eternal night
#

Yea, but mayPickup is just return stack.is(ItemTags.BEACON_PAYMENT_ITEMS);

mortal hare
#

yea but its called

#

multiple times

eternal night
#

So why not modify ItemTags.BEACON_PAYMENT_ITEMS 🤔

mortal hare
#

and i need to add new check

eternal night
#

ah

#

Well that might be a hard rip to you without bytecode mutation

river oracle
#

Couldn't you call the method and add logic in some sort of clas you use as a buffer

mortal hare
#

just for these methods

river oracle
#

Byte code time ig

#

No clue how to do that shit

eternal night
#

or mixins 5Head

river oracle
#

😳

mortal hare
paper viper
river oracle
#

Doesn't spigot have the whole don't modify the game stance though

zenith gate
#

Is there a web tool of some sorts to help make custom items a little less annoying to do?

river oracle
#

Maybe I'm wrkng

eternal night
paper viper
#

Lol the amount of issues

#

Tho

mortal hare
#

Spigot plugin marketplace is like google play store

river oracle
#

Shitty code everywhere instead of isolated instances of shit code

paper viper
#

Cause it will conflict with each other

mortal hare
#

bunch of shit, but bunch of goodies

eternal night
#

^

paper viper
#

Tbf Bukkit is already shit

#

I don’t think it can get any shittier

#

Lol

opal juniper
#

so

#

i dont want to make like 10 nms modules

mortal hare
#

spigot SHOULD really adapt adventure ffs

opal juniper
#

is it a bad idea to just put them all in one

eternal night
#

oh no

#

don't say that dovidas

mortal hare
#

why

#

its good

eternal night
#

people here love their §

#

yea it is

paper viper
#

Lol

river oracle
#

You'll awaken the symbol thingy lovers

eternal night
#

^

paper viper
#

Trust me we all secretly love adventure

#

But we are forced to abide to the symbol

river oracle
#

I use iridium chat color api

#

I don't know if I wanna shade adventire

#

Isn't it big

paper viper
#

If you’re on paper you don’t have to

#

It isn’t too big

river oracle
#

I use spigot api

paper viper
#

Don’t you have to also use the Bukkit platform

river oracle
#

Bukkit platform?

paper viper
#

There is adventure API and also the Bukkit platform and platforms for other stuff

mortal hare
#

NMS server with no bukkit api and mixins as an option would be great

opal juniper
#

ew

#

no

paper viper
#

It just would give me package errors and stuff

opal juniper
mortal hare
#

it would be great for proprietary server code

opal juniper
#

why... i mean if i dont load the class surely it would be fine?

paper viper
#

No like the IDE would complain

#

The imports

smoky oak
opal juniper
#

oh wait yea the n.m.s.* would overlap

#

hmmm yea

#

shit

smoky oak
#

divide the input for your perlin noise function by five or so

paper viper
#

Lol

smoky oak
#

your scale was wrong

limber owl
#

so how can I change it?

paper viper
#

Make text files in the resources folder of each of the NMS Java classes

#

Then use ASM or something to load it into a class

smoky oak
#
if(generator.noise((loc.getBlockX()+x)/div,loc.getBlockY(),(loc.getBlockZ()+y)/div)>0){
  loc.clone().add(x,0,y).getBlock().setType(Material.STONE);
}
paper viper
#

Lol

mortal hare
smoky oak
#

whereever your function is that grabs the noise, divide that input by some number between five to fifteen

paper viper
#

I mean hey at least you don’t need BuildTools

smoky oak
#

depending on how big you want your scale

paper viper
#

Lol

eternal night
#

intellij iirc suggests you to use nullable parameters instead of optional

#

if you want to abide by that, up to you

opal juniper
paper viper
#

Nullability 🤢

opal juniper
#

im not sure lol

mortal hare
#

Nullables are faster and no memory footprint

smoky oak
#

if i change it to five for example this is the result

eternal night
#

for now nullability is a little faster

#

gimme that java 20 optional value types

lunar python
#

Hey, I'm making an open source 1.19 plugin that uses a lot of nms, and so I was wondering if I'm allowed to share code using the Mojang Mappings on GitHub

smoky oak
#

first image ten second image five

#

as said, the div is dependent on how big you want your features

paper viper
#

You should be fine

smoky oak
#

and the bigger than number dependent on how much coverage you want

lunar python
smoky oak
#

if you want 50% do >0

#

at least with this noise function

#

basically its this:

double percentage;
double biggerThan = -1 + percentage * 2;

double scale;

if(noise.get(x/scale,y/scale,z/scale)>biggerThan){
  block.setMaterial(Material.AIR);
}
#

take note that im using util.noise.PerlinNoiseGenerator

limber owl
#

?paste

undone axleBOT
limber owl
balmy fox
#

Im trying to get a list with all the warp names using the following code
String[] warp_name = warpSaveFile.get().getStringList("warps").toArray(new String[0]);
But for some reason warp_name is empty.
Does anyone know what I am doing wrong?

smoky oak
#

double e = perlinNoise.noise(x, y, z);
=>double e = perlinNoise.noise(x/noiseScale, y/noiseScale, z/noiseScale);

eternal oxide
#

You don't. Enums are compile time objects

twilit roost
#

is there a way to create atleast little bit similiar particles?

signal ether
#

No, enums are for when you know ahead of times exactly what your options will be

smoky oak
#

that depends on how you want the caves to scale

#

if you want them in 1.18 cave size i think around 12 to 15

#

but then again

#

thats far too big for a cube with 20 side length

#

for that scale I'd tell you to use a value between 4 and 7

limber owl
smoky oak
#

do a 50 cube at the very least

#

you need to see this stuff

limber owl
#

I'm going to do a whole world so 😄

#

I did 200

smoky oak
#

and?

#

what im doing is that im using a test command to generate it in front of me

#

i enter the scale i want in that command

#

that way i can test it really quickly

#

?paste

undone axleBOT
smoky oak
#

im only doing it in a plane rn tho so i can still see stuff

limber owl
#

i'm using this to generate world and thank, it looks amazing, I just need to swap the bigger tan/less than and it will make caves, thanks a lot

small wren
#

Can anyone help me with a Spark Profiler in DM?#

smoky oak
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

paper viper
balmy fox
#

Im trying to get a list with all the warp names using the following code
String[] warp_name = warpSaveFile.get().getStringList("warps").toArray(new String[0]);
But for some reason warp_name is empty.
Does anyone know what I am doing wrong?

mortal hare
#

show your yaml structure please

smoky oak
#

youre setting the length of the array to zero

mortal hare
#

zero provided here is for to represent for invoked method that the returned array should be the size of the list

balmy fox
mortal hare
# balmy fox

yaml list is not what you think. list in yaml is:

warps:
  - one
  - two
#

or ```
warps: [one, two]

agile anvil
balmy fox
iron glade
#

yep

#

or wait

limber owl
#

most effective way of getting blocks around one block but only the ones on top and around, none from below?

agile anvil
iron glade
#

getConfigurationSection("warps").getKeys(false) I think

iron glade
#

Haven't touched this stuff for a while :o

mortal hare
#
Set<String> keys = warpSaveFile.get().getConfigurationSection("warps").getKeys(false);
for (String key : keys) {
  ConfigurationSection section = warpSaveFiles.get().getConfigurationSection(key):
  String creatorName = section.get("createdBy");
}
balmy fox
#

Alright I will try that, thanks everybody

agile anvil
limber owl
mortal hare
#

fixed it

agile anvil
#

From x-1, y, z-1 to x+1, y+1, z+1

#

So it's a 3 for loop

#

@limber owl (forgot to mention you)

hot wolf
#

Hey there, I wanted to ask... Whats the best way to identify specific items?

agile anvil
hot wolf
agile anvil
#

?pdc

hot wolf
#

Sure will. Thx!

mortal hare
#

but this would only work for 1.14+

#

so the choice is yours