#help-development

1 messages ยท Page 174 of 1

next stratus
#

To me, that's gross

#

But that's my opinion

quiet ice
#

In gradle you'd need to write it from the bottom up

#

This means either depending on maven maven or doing all the maven publish logic yourself

#

Libraries will only help you for the FTP part of the thing, but not the mavne part of the thing

glossy venture
#

you can specify a maven repo by url in gradle too or does it not support the FTP protocol

#

by default

quiet ice
#

You still have no


                        <relocation>
                            <pattern>org.bstats</pattern>
                            <shadedPattern>de.geolykt.enchantments_plus.bstats</shadedPattern>
                        </relocation>
next stratus
#

Poms are just a mess of arrow code

glossy venture
quiet ice
#

                        <relocation>
                            <pattern>de.jeff_media.jefflib</pattern>
                            <shadedPattern>de.jeff_media.customdrops.libs.de.jeff_media.jefflib</shadedPattern>
                        </relocation>

Yes.

next stratus
glossy venture
#

im not joking

quiet ice
#

Also you have two shade plugins

next stratus
#

All the kids in this discord suck off maven

quiet ice
#

OH you have three shade plugins

tender shard
glossy venture
next stratus
#

Likely the only users lol

quiet ice
#

You can merge all three shade blocks into one

grand pebble
#

Hi everyone i have a little question :
How i can clear the chat for only one specific player please ? Like when the player press F3+D

glossy venture
wind tulip
#

Hey, I have these items and I want to read data from them and display particles with said data.
Here's my interpretation of this data in a class: https://paste.md-5.net/ogadatotiy.java

Setting up an instance of the class is not an issue, playing the particle is: The player#spawnParticle method takes in a class that varies from particle to particle called "data", and this fluctuating class can be used to change the color, material, and motion fields of a particle.

This is probably just a simple java question, but how can I do this without writing horrible dry code with a switch statement/if statement per particle?

glossy venture
quiet ice
grand pebble
tender shard
#

yes

sterile axle
#

gradle > maven ez, i stand with you @next stratus

glossy venture
#

that it doesnt support FTP?

quiet ice
#

Yes

#

If Y doesn't support X and you need X, then you can't use Y

#

It's as simple as that

glossy venture
#

yeah

quiet ice
#

Primary reason I am writing sl-brachyura

glossy venture
#

didnt know it didnt support FTP

#

does it support sftp

quiet ice
#

Partially

#

i.e. only with password

#

But not with keys

sterile axle
#

am i the only one wondering why the fk anyone needs ftp over some other more actual sane solution to hosting artifacts

serene sigil
#

why does the sword not show up?

next stratus
quiet ice
grand pebble
next stratus
quiet ice
#

Works well enough, but means that you cannot use PUSH

grand pebble
sterile axle
#

i mean, you can use even a github repo for it at that point lol

#

and im sure gradle supports that

quiet ice
grand pebble
#

If i make :

for (i in amount)  {
 Player.sendMessage(" ");
}

That send how many message ?

torn oyster
#

i have come to the conclusion that BlockGrowEvent cannot be cancelled

serene sigil
sterile axle
#

you can't download from a github maven repo?

quiet ice
sterile axle
#

eh idk, this stuff is beyond me, i just run a simple artifactory in docker

glossy venture
#

they want to publish

sterile axle
#

not problematic for me in either case

serene sigil
grand pebble
serene sigil
torn oyster
# alpine narwhal it can
    @EventHandler
    public void onGrow(BlockGrowEvent e) {
        System.out.println("grow");
        MinigameManager minigameManager = MinigameManager.get();
        ChunkMinigame cm = ((ChunkMinigame) minigameManager.getMinigameFromLocation(e.getBlock().getLocation()));
        if (cm != null) {
            System.out.println("grow2");
            if (!cm.getModifiedBlocks().contains(e.getBlock().getLocation())) {
                System.out.println("grow3, list size: " + cm.getModifiedBlocks().size());
                e.setCancelled(true);
            }
        }
    }```

[07:20:31 INFO]: [ChunkDefence] [STDOUT] grow
[07:20:31 INFO]: [ChunkDefence] [STDOUT] grow2
[07:20:31 INFO]: [ChunkDefence] [STDOUT] grow3, list size: 0```

explain this then

glossy venture
#

@next stratus can you send your build.gradle idk if you sent it already but if so it has been buried

undone axleBOT
torn oyster
#

grass still grows

#

trees still grow

#

the event is fired whenever grass grows

rigid bone
#

I am currently making PVP map with different character that have different abilities. I want to change player's skin depending on his tag so you can see which characters are other players playing. Is there plugin that could help?

#

1.19

glossy venture
#

to FTP

next stratus
#

I mean, my friend has a maven repo right? And I wanna work out how to publish to it lol

glossy venture
#

just a bunch of files?

#

found this on gradle plugins btw

next stratus
glossy venture
#

are you using maven-publish or publish

next stratus
quiet ice
#

Here is the thing little gradle fanboy: You'll need to publish it yourself

next stratus
quiet ice
#

These plugins are merely libraries

serene sigil
sterile axle
#

damn you guys get real heated over this stuff

#

lmao

next stratus
next stratus
serene sigil
#

true

glossy venture
serene sigil
#

no maven or gradle

glossy venture
#

python build script

#

Makefile

quiet ice
#

Thse publishing blocks only work for sftp with password, https, http and probably a few other formats though

next stratus
glossy venture
#

btw you could try to make a custom task which just uploads to ftp

next stratus
#

My friend hosts his own repo but I just can't work out how to publish to it lol

serene sigil
glossy venture
#

youll have to include some FTP client shit idk how

quiet ice
#

For FTP/SFTP I recommend publishing to a file:// repo and pushing it to the actual maven repo

serene sigil
serene sigil
#

lol

sterile axle
#

is smithing inventory an anvil or smth different

serene sigil
#

ye

next stratus
#

You need to get patience

quiet ice
#

1.16 I believe

sterile axle
#

its an anvil?

quiet ice
#

it isnt

glossy venture
serene sigil
#

ye

glossy venture
#

try slot index 0

serene sigil
#

the item just doesnt show up

serene sigil
sterile axle
next stratus
quiet ice
#

?jd-s

undone axleBOT
glossy venture
sterile axle
#

this mf said "ye" to me twice

glossy venture
sterile axle
#

well wiki.vg doesnt have a slot layout for "smithing"

quiet ice
serene sigil
#

i want to set an item in the gui

quiet ice
#

The smithing table has three slots

sterile axle
#

im guessing its similar to anvil in that 0 is the left ingredient, 1 is right ingredient, and then there's result. and you're trying to put a diamond sword in the right ingredient, which yeah is prob not gonna work

quiet ice
serene sigil
#

and what number is the result?

glossy venture
#

what the fuck the inventory is split up

#

but that shouldnt matter

quiet ice
#

It's #setResult

serene sigil
#

oh

glossy venture
sterile axle
#

cast to SmithingInventory

glossy venture
#

you can see it in the stash

#

CraftBukkit source

sterile axle
#

and use setResult

quiet ice
#

I'd use setResult anyways

glossy venture
#

yeah

quiet ice
#

Better be safe than sorry

golden turret
#

hey python devs. Is there any package manager like gradle or maven for python?

#

a good one

sterile axle
#

SmithingInventory inv = (SmithingInventory) Bukkit.createInventory(...) or something

tender shard
#

pip?

glossy venture
#

oh wait i remember a bug with setting items in an anvil

#

pip?

quiet ice
#

Anvils are nasty

quiet ice
#

On paper they are semi-fine though

glossy venture
golden turret
glossy venture
#

so maybe it has a similar bug?

quiet ice
#

As long as the recepie is declared it shouldnt be an issue

golden turret
grand pebble
#

Why my code don't pass into this boucle ? ๐Ÿค”

            for (int i = 0; i>10; i++) {
                player.sendMessage("test");
                System.out.println("DEBUG");
            }
quiet ice
#

pip's requirements.txt?

glossy venture
#

what the hell

quiet ice
#

wha

serene sigil
#

lol

glossy venture
#

do you have your API version specified

#

idk if that would matter

golden turret
#

pycharm does not seems to generate it

golden turret
#

hm

#

alright

#

but

#

it is so simple

quiet ice
#

Getting the dependencies installed is just a subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-r', 'requirements.txt']) after than

golden turret
#

i want something near maven or gradle

glossy venture
#

bet you can use gradle

#

with some python plugin

#

you can use it for C++ so someone must have made smth for python

quiet ice
#

I have not heard about gradle supporting python

golden turret
#

well, it is technically possible

glossy venture
quiet ice
#

Quality is another thing after that

glossy venture
#

you could just use java ProcessBuilder to use pip through gradle too

quiet ice
#

Write in Java, C++, Python or your language of choice. Package for deployment on any platform. Go monorepo or multi-repo. And rely on Gradle's unparalleled versatility to build it all.
Okay, gradle supports python natively

glossy venture
#

interesting

serene sigil
hazy parrot
hollow pelican
#

Is it possible to have an arraylist under a hashmap and then add to the arraylist in the hashmap?

quiet ice
#
logging.info("Making sure pip is installed...")
try: # Debian and Ubuntu require pip to be installed differently because they disable ensurepip
    import distro
    linuxDistro = distro.linux_distribution()
    if linuxDistro[0] == "Debian" or linuxDistro[0] == "Ubuntu":
        try:
            subprocess.check_call(['apt', 'install', 'python3-pip', '-y'])
        except subprocess.CalledProcessError:
            logging.fatal("You need to be the superuser to install pip and the dependencies")
            sys.exit(-4)
except ModuleNotFoundError: # If the system is not Linux, the module "distro" will not load, causing a ModuleNotFoundError exception and the normal "ensurepip" module will work
    subprocess.check_call([sys.executable, '-m', 'ensurepip']) # The module ensure pip check if pip is installed and installs it if it isn't
logging.info("Pip is installed")

# Make sure that dependencies are installed
logging.info("Installing dependencies...")
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-r', 'requirements.txt'])

And "just" invoking pip isn't a thing either

glossy venture
grand pebble
#

I fixed that thank for response ๐Ÿ˜‰

hollow pelican
# quiet ice What do you mean there?

I know HashMaps contain a key and value, would it be possible to have an array list as the value and then interact with the list inside of the HashMap?

quiet ice
#

Something like HashMap<Object, ArrayList<Object>>?

hollow pelican
#

Something like that, yeah.

quiet ice
#

That is fully possible yes

hollow pelican
#

But would it be possible to get the value and interact with it?

quiet ice
#

It works like any other object

hollow pelican
#

Such as adding new elements or getting different ones.

glossy venture
#

yes, its a reference so it will 'reflect' its changes in the map

quiet ice
#

So

List<Object> list = myMap.get(myKey);
list.add(new Object());

would work

hollow pelican
#

Would that do what I'm looking for then?

quiet ice
#

Although you need to create the arraylist if it does not already exist

hollow pelican
#

That's pretty easy to do.

#

I just create a blank ArrayList on join.

glossy venture
#

yeah or create it when you need it with computeIfAbsent

#
List<?> l = map.computeIfAbsent(key, __ -> new ArrayList<>());
hollow pelican
#

Thanks. ๐Ÿ™‚

serene sigil
torn oyster
#

How do I cancel grass growing

serene sigil
#

i think this

@EventHandler
    public void yourmother(BlockGrowEvent event) {
        if (event.getBlock().getType() == Material.GRASS) {
            event.setCancelled(true);
        }
    }```
torn oyster
# serene sigil i think this ```java @EventHandler public void yourmother(BlockGrowEvent eve...
    @EventHandler
    public void onGrow(BlockGrowEvent e) {
        System.out.println("grow");
        MinigameManager minigameManager = MinigameManager.get();
        ChunkMinigame cm = ((ChunkMinigame) minigameManager.getMinigameFromLocation(e.getBlock().getLocation()));
        if (cm != null) {
            System.out.println("grow2");
            if (!cm.getModifiedBlocks().contains(e.getBlock().getLocation())) {
                System.out.println("grow3, list size: " + cm.getModifiedBlocks().size());
                e.setCancelled(true);
            }
        }
    }```

[07:20:31 INFO]: [ChunkDefence] [STDOUT] grow
[07:20:31 INFO]: [ChunkDefence] [STDOUT] grow2
[07:20:31 INFO]: [ChunkDefence] [STDOUT] grow3, list size: 0```

explain this then

serene sigil
#

?

torn oyster
#

read

jaunty crag
#

how can i do like an "everyone but a certain player" thing

#

i am trying to send a RemoveEntitiesPacket and i only want one player to see the entity

echo basalt
#

filter on a for loop

hazy parrot
#

or stream ig

echo basalt
#

ew no

hazy parrot
#

why

serene sigil
torn oyster
hazy parrot
#

i like streams

echo basalt
#

I'm not going to go into this argument again

tender shard
#

streams are overkill for this

sterile axle
#

streams are just repeated for loops ๐Ÿคทโ€โ™‚๏ธ

#

if you've seen the source of them, that's literally what they do kekw

echo basalt
#

Streams are O(n) for every chain operation you do

tender shard
#
for(Player other : Bukkit.getOnlinePlayers()) {
  if(other.equals(thePlayerWhoMaySeeTheEntity)) continue;
  Packet<?> packet = new Packet.......
}
echo basalt
#

instead of init every iteration

sterile axle
#

these peeps are highly unlikely to be compsci majors, and probably have no idea what big O notation is let alone care about time complexity kek

#

stream everything

echo basalt
#

I care about not doing many iterations

#

Let's say you stream, filter, map and collect

sterile axle
#

yes i know

sterile axle
#

im with you on this, im just saying most of these ppl have no idea what you're talking about

echo basalt
#

it:

  • loops through the entire set, filters
  • loops through the entire set, maps
  • loops through the entire set, collects
floral drum
sterile axle
#

they just want minecraft go brrr

echo basalt
#

You can just loop once

torn oyster
#

hey purple

floral drum
#

Hiii

#

was just boutta say hi quared

#

lmfao

sterile axle
#

yes i know

echo basalt
#

I mostly just hate most java 8 things

#

optionals are a fancy nullability wrapper that provides 0 value

fresh timber
#

In a bungeecord postLoginEvent, how do I get the player's version

echo basalt
#

I guess they tried redefining the standard but failed

echo basalt
#

Functional interfaces and lambdas are nice, anything else can go home

sterile axle
#

we should all just go back to using C and having nothing provided by the stdlib

need an arraylist? ok, make it yourself

๐Ÿ˜Ž

floral drum
#

wooo consumerss

echo basalt
#

Suppliers, Consumers n all are great

torn oyster
echo basalt
#

also

#

use block locations

torn oyster
echo basalt
#

or block keys

fresh timber
echo basalt
#

locations can have decimals

echo basalt
fresh timber
#

for

torn oyster
#

and it adds a block.getlocation into the list

#

on break or place

#

and the size is 0, it doesn't matter

echo basalt
floral drum
#

no need for math

torn oyster
#

it checks if it is not in there

floral drum
#

only for loops

echo basalt
#

3x3 is 3 in diameter etc

torn oyster
# echo basalt show code
    @EventHandler
    public void onGrow(BlockGrowEvent e) {
        System.out.println("grow");
        MinigameManager minigameManager = MinigameManager.get();
        ChunkMinigame cm = ((ChunkMinigame) minigameManager.getMinigameFromLocation(e.getBlock().getLocation()));
        if (cm != null) {
            System.out.println("grow2");
            if (!cm.getModifiedBlocks().contains(e.getBlock().getLocation())) {
                System.out.println("grow3, list size: " + cm.getModifiedBlocks().size());
                e.setCancelled(true);
            }
        }
    }```
#

this

echo basalt
#

3 diameter = 1.5 radius

torn oyster
#

it says grow3

echo basalt
#

because it's e m p t y

torn oyster
#

so therefore it should cancel...

#

it doesn't cancel

echo basalt
#

๐Ÿคฆ

floral drum
#

fix it

torn oyster
echo basalt
#

fix it then

torn oyster
#

if it's empty then it should cancel??

#

i want it to cancel??

#

it's not cancelling??

floral drum
#

contact md_5

#

ez

echo basalt
#

can we just take a moment to appreciate how terrible single letter variable names are

tender shard
#

yes

#

they suck

floral drum
#

except for x, y, z and i

echo basalt
#

not i

floral drum
#

well

#

index

echo basalt
#

you aren't doing quantum physics

floral drum
#

I use index for i

echo basalt
#

index

#

yes

#

good

#

index good, i bad

floral drum
#

I forgor I used index

#

I thought I still used i

#

nah fuck that

torn oyster
#

yall are telling me how to fix everything but my problem istg

echo basalt
#

yes

torn oyster
#

๐Ÿ˜ญ

echo basalt
#

because you tried being obnoxious asking for help at the worst time

sterile axle
#

@torn oyster all i can think is that perhaps there is some other plugin that is not behaving properly and is allowing it to continue even if you previously set it to cancelled

floral drum
#

try set eventpriority to HIGHESTs

#

no cap

sterile axle
#

so yes

torn oyster
floral drum
#

hm

#

fuck

echo basalt
#

start at the block center, subtract diameter/2 to all axis and loop

#

or just do like

torn oyster
#

i have no non-dependency plugins things

tender shard
#
void onKill(EntityDamageEntityEvent e1) {
  try {
    Entity e2 = e1.getEntity();
    Entity e3 = e2.getKiller();
    // ...
  } catch (Exception e4) {
    // ...
  }
}

very useful

sterile axle
#

i mean, dont keep it there, but try eventpriority MONITOR. if that works then for sure something is misbehaving, you're not supposed to cancel events with MONITOR priority but...you can try it

floral drum
#

I agree dessie

torn oyster
jaunty crag
#

not just people who have joined the server or people who are online

torn oyster
#

what?

echo basalt
#
public void breakBlocks(Location location, int diameter) {
  double offset = diameter/2d;
  Vector offsetVector = new Vector(offset, offset, offset);

  for(int x = 0; x <= diameter; x++) {
    for(int y = 0; y <= diameter; y++) {
      for(int z = 0; z <= diameter; z++) {
        Location target = location.clone().add(x, y, z).subtract(offsetVector);
        Block targetBlock = target.getBlock();

      }
    }
  }

}
#

I hate fuckin spoon feeding, feels dirty

remote swallow
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

echo basalt
#

^ this is why we shit on noobs

#

scare them into not asking for help anymore

sterile axle
#

what a nice interaction

torn oyster
#

ok i'm convinced BlockGrowEvent doesn't get called for grass

torn oyster
#

if so then what is it

tender shard
#

it's BlockSpreadEvent

torn oyster
#

what event is for grass

floral drum
#

woo

torn oyster
floral drum
#

ty alex ily โค๏ธ

torn oyster
#

also trees still grow

#

because why wouldn't they

torn oyster
echo basalt
#

try it and see

torn oyster
#

i cannot see

#

any event

echo basalt
sterile axle
#

theres a LeavesDecayEvent if you're trying to stop leaves from decaying

torn oyster
#

ok thank you

torn oyster
sterile axle
torn oyster
#

oh okay

#

why is tehre a structuregrowevent and a blockgrowevent

sterile axle
#

go on that javadoc and search both

#

read the description

torn oyster
#

yeah i did

#

strucutre is for saplings -> trees

sterile axle
#

yes because a tree is made up of more than just a single block

torn oyster
#

the other is for blocks growing naturally

chrome beacon
#

Because a pumpkin isn't a structure

sterile axle
#

so it's a structure

torn oyster
#

ok

grand pebble
#

Yeahhh i did it ! ๐ŸŽ‰

#

๐ŸŽ‰

serene sigil
grand pebble
#

Yes ๐Ÿ˜‚

serene sigil
#

lol

#

btw how do u choose a chatcolor and make it bold?

grand pebble
#

For the prefix ?

serene sigil
#

ye

grand pebble
#

Its bytemap, in texturepack

serene sigil
#

oh nvm

#

i meant in like normal p.sendmessage()

#

i want to make the message gold and bold

grand pebble
#

Yes i a p.sendMessage but with a specialCharacter

grand pebble
#

I think in dev the ChatColor. is better than ยง

#

but it's only my review

serene sigil
#

like this? ๐Ÿคจ

grand pebble
#

not &

serene sigil
grand pebble
#

What is the error ?

serene sigil
grand pebble
#

wait

serene sigil
#

oh

grand pebble
#

Oh yes sorry

serene sigil
#

oh tysm!

grand pebble
#

You cannot put two ChatColor. with + at the same time

#

u need to separate it

serene sigil
#

ohh

#

okay

grand pebble
#

because ChatColor. as the role of ยง

#

In this case ยง6 + ยงb = ? ๐Ÿ˜‚

onyx fjord
#

Why not just translate color codes

serene sigil
grand pebble
hollow pelican
#

Another option is to use ChatColor.translateAlternateColorCodes()

serene sigil
serene sigil
onyx fjord
hollow pelican
onyx fjord
#

I can send it tomorrow

grand pebble
#

@serene sigil work for me in 1.19

hollow pelican
#

ty ๐Ÿ™‚

onyx fjord
#

If it's static you don't need the Util. Part

#

But that's personal preference

serene sigil
hollow pelican
#

I might try to make my own method for it then since it's really just taking in a string value either way.

serene sigil
hollow pelican
#

Made a colorCode method to replace translateAlternateColorCodes lol

#

Way nicer now.

sterile token
#

public class Chat {
  
  public static String style(@NotNull String text) {
    return ChatColor.translateAlternateColorCodes('&', text); 
  }

  public static List<String> style(@NotNull List<String> text) {
    return text.stream().map(Chat::style).collect(Collectors.toList());
  }
}


player.sendMessage(Chat.style("&6&lHello")); // Single line
player.sendMessage(Chat.style());

#

?

fresh timber
#

I am trying to add a storage to my plugin so when I save a variable it doesn't reset its value when the plugin is disabled and enabled (when the server stops). Anyone know some websites or anything that I can use to learn how to do this?

sterile token
#

What store are u using?

fresh timber
#

nothing

sterile token
#

There different types for them, you have flatfile one or databases one

fresh timber
#

I have basic spigot plugin and im looking to add a storage and learn how to put stuff in it

#

I need a really big storage for like hypixel skyblock type stuf

#

f

sterile token
#

It depends on what you are wondering to do

sterile token
#

Well so if you are creating a big plugin a database will be your option

#

No, they have their own

#

I mean they have their own machines

fresh timber
#

not that big yk but I just want somethign that can store a lot of variables for like stats and stuff

sterile token
#

basically having own machines == do what their ass sings

fresh timber
#

yeah I have my own machine

glossy venture
#

yeah they most likely have their own server hardware

fresh timber
#

I have a server in my house that I run my mc server on

glossy venture
fresh timber
#

it runs vmware

glossy venture
#

for basically everything

sterile token
glossy venture
sterile token
#

or a custom impl of mongo

glossy venture
#

that will slow stuff down

#

just dual boot linux or smth

fresh timber
# glossy venture why

so I can create a lot of computers and run a mc server on all of em and link em together so I can get a server network

#

w/ bungeecord

#

is what im doin rn

glossy venture
#

you dont need a seperate vm per server

sterile token
#

orby maybe they use something like firebase but based on json documents

glossy venture
#

you can run multiple servers on one computer

fresh timber
#

well then how do I get a different ip for each one

river oracle
#

you don't need a different IP for each one

sterile token
glossy venture
#

you dont need a diff ip for each

fresh timber
#

yea ig

glossy venture
#

only different port

sterile token
#

Each sever must have a diff port not ip address

fresh timber
#

ok whatever

river oracle
#

you have like 25565-3000 for ports you'll be fine only time you need to modularize is with minigames

#

in that case you can spinup with docker

glossy venture
#

no vmware will fuck your server from behind so hard trust me its so slow

#

use something like docker

fresh timber
#

how do I change the port of each server

glossy venture
#

anyways hypixel uses mongodb for basically everything i read it on the dev blog

fresh timber
#

mk

#

also wont it be confusing if I have like 10 mc servers running on 1 computer

#

or vm

glossy venture
glossy venture
#

less confusing than 10 vms

fresh timber
#

because I wont be able to find the right one

#

nah

#

idk

#

whatever

river oracle
#

docker :P

glossy venture
#

istg if you use the vmware anyways

past vapor
glossy venture
#

yeah

glossy venture
#

expect like 5 tps with 4 players

sterile token
river oracle
#

kotlin :(

fresh timber
#

my server I got runs vmware as a default os so I cant change anyway that easily

stuck rover
past vapor
river oracle
#

I can't help you with trashlin , but look at line 29 HackCheckMenu.kt:29

sterile token
glossy venture
river oracle
#

so much for null safety ๐Ÿ˜‚

past vapor
#

Chad kotlin enjoyer

river oracle
#

looks like a null error there

glossy venture
#

physical pc you should be able to reinstall it with ubuntu

fresh timber
past vapor
#

Virgin java supporter

stuck rover
#

honestly man if you use java, just switch?

glossy venture
#

and install docker, configure some ufw ports and run a server

river oracle
#

java is going nowhere hate to break it to you guys :)

fresh timber
#

install docker on what?

glossy venture
#

ubuntu pc

river oracle
sterile token
glossy venture
#

if you reinstall it with ubuntu

river oracle
#

oh wait

#

your not shading it

#

fuck

#

yea you aren't shading it

glossy venture
#

lets gooooo

#

lets fucking goooo

fresh timber
#

I literally cant keep up with how much stuff is being said lol

sterile token
glossy venture
#

damn

past vapor
river oracle
#

I don't know gradlew either so Ican't help you there

#

but if your shading it and your still getting an error ask the api dev

sterile token
#

But those machine make my billls going from $30 what we normally consume in summer to $60-70 with the machines active

glossy venture
sterile token
#

?verify

#

On the right channel

glossy venture
#

heheeha

past vapor
#

๐Ÿ˜ข

sterile token
#

๐Ÿ˜‚

river oracle
#

oh lordie

past vapor
river oracle
glossy venture
#

lmao google

river oracle
#

phone moment

#

๐Ÿ˜ญ

past vapor
#

Honestly went off java when i tried out kt

river oracle
glossy venture
#

you need to link it to a spigotmc acc

#

you got one?

#

yesh

#

yeah

past vapor
#

hi @quaint mantle

#

Alright well

#

I got it working but not how I wanted

#

Actually

#

This is fine

#

I'm not 100% sure why I was trying to do it the other way

river oracle
#

yk I tried kotlin once than I was like yk what I don't feel like spending hte next 50 hours of my life learning new syntax for a java reskin and went back to using java

glossy venture
#

java just looks good

#

kotlin is fucking moon runes

river oracle
#

something so satisfying about this

MenuItemBuilder.builder()
                        .item(Items.getInstance().getAxe()))
                        .event((e) -> {
                            e.getWhoClicked().sendMessage("Hello, world!");
                        })
                        .slot(0)
                        .make());```
glossy venture
#

i hate that there isnt a way to return this automatically without generics

sterile token
#

inded kotlin is engorrous for reading the syntax

sterile token
river oracle
sterile token
#

oh ok

glossy venture
#

.create()

sterile token
#

y2k are you doing your own menu api?

river oracle
#

yes

#

I've finished it

glossy venture
#

nice

river oracle
#

I'm just testing it

sterile token
#

Shit i cannot implement the fucked authorization sever from oAuth - fucked oAuth

#

๐Ÿ˜ก

past vapor
sterile token
glossy venture
sterile token
#

Use vanilla Java

past vapor
#

that is beautiful

#

idk wys fam

#

so much more readable imo

river oracle
glossy venture
#

how

sterile token
#

I dont know why u use kotlin if then is compile to java ๐Ÿ˜‚

glossy venture
#

is it more readable

sterile token
past vapor
#

you guys don't have extension functions :3

jaunty crag
#

does anyone know how to send the client a packet to make it look like a chest opened

past vapor
#

java fanboys ๐Ÿ˜‚

glossy venture
hazy parrot
glossy venture
#

show example

#

jvm is best and java was the original language for the jvm so java is best

#

logic

past vapor
# glossy venture tf is that

also

fun async(task: (BukkitTask) -> Unit) {
    Bukkit.getScheduler().runTaskAsynchronously(HackChecker.instance, task)
}

fun sync(task: (BukkitTask) -> Unit) {
    Bukkit.getScheduler().runTask(HackChecker.instance, task)
}

fun syncDelay(delay: Long, task: (BukkitTask) -> Unit) {
    Bukkit.getScheduler().runTaskLater(HackChecker.instance, task, delay)
}```
#
        async { 
            println("hello world")
        }```
undone axleBOT
hazy parrot
sterile token
glossy venture
past vapor
#

That's from an old thing

#
fun String.translatable() : String? {
    return config.getString(this)
}```
past vapor
#

this is a neat little extension function

glossy venture
#

nonononono not the question marks

flint coyote
#

Anyone knows a decent guide for custom (pathfinder) goals with the new remapped stuff?

past vapor
#

i can just call

"path.to.string".translatable()```
to get a string from a config
glossy venture
#

ok thags nice

sterile token
river oracle
# echo basalt

mmmm so focking beautiful something about builder pattern just makes me so happy to look at it

glossy venture
#

though it might add some confusion

#

but thats nice

past vapor
#
syncRepeat(10) {
  game.getEntityManagement().registerPlayer(player)
}
#

๐Ÿคทโ€โ™‚๏ธ

glossy venture
#

and it might clash with other functions

echo basalt
floral drum
#

fuck what's that youtuber called again??? ๐Ÿ˜ญ

glossy venture
past vapor
river oracle
#

holy shit is this schedule builder open sourced

echo basalt
#

uhh not really

sterile token
river oracle
#

sadge I'll remake it myself then

echo basalt
#

it's very nice to use but it internally just calls bukkit's methods lol

sterile token
#

I have some money on my wallet

glossy venture
#

69 dolar

sterile token
#

๐Ÿ‘€

floral drum
#

BRANDON FARRIS!!

echo basalt
#

I made this like 3 years ago

floral drum
echo basalt
#

think imma just use a table

floral drum
#

that's the video

river oracle
sterile token
river oracle
#

you can commit if you want just make sure they are good or they won't get accepted

sterile token
#

y2k commons

echo basalt
#

@sterile token 500$ bitcoin

#

I was thinking on remaking the schedulebuilder to follow a more CompletableFuture style

#

thenCompose(otherBuilder)

#

type deal

safe copper
sterile token
#

Because 1.12 itself is outdated

safe copper
#

?

sterile token
#

I mean if the version 1.12 is really outside of road map

#

Logic explains that it wont be any updated tutorial if the version itself its outdated

echo basalt
#

you just copy the value tag

safe copper
#

GameProfile does not exist it appears

echo basalt
#

you gotta import authlib

safe copper
#

ah

sterile token
echo basalt
safe copper
echo basalt
#

uhh gradle stuff

#

it has the url for the authlib repo

#

com.mojang:authlib:1.5.25

sterile token
safe copper
#

maven

hexed mesa
#

Who do I talk to cuz I payed 2 time for the rank me up and I didn't get anything in my account so now I'm down 14 something

hexed mesa
#

The 7.40 someone I for got the name

#

It was the hunter one

#

I don't care if they just give me the 14.99 rank I payed for it anyway

#

My name in the server is MoNsTeR6076 and I'm on the Rayquaza server

#

I have the proof if you need it

brisk shard
#

You must ask those server members as unfortunately it is outside of our capabilities to assist you.

hexed mesa
#

It's in your server the Rayquaza is the world on in

#

So miss typed

remote swallow
#

we are not that server

#

?whereami

oblique wigeon
#

I'm working on making some custom recipes, but for more flexibility I tried to create more implementations of RecipeChoice, to allow for my custom item crafting as well as different amounts of items. Attached below are those implementations. This works without error, except for when you actually try to craft. At least to my understanding, the RecipeChoice#test method is what controls whether an item is valid for the recipe, and I've modified it accordingly, to no avail. Perhaps it's an issue with the RecipeChoice#hashCode function, as I didn't really change anything about that and instead copied the ShapedRecipe version of it. If anyone could give me any insight as to why this doesn't work, then that would be great.

https://hastebin.com/ejimunuxos.kotlin

#

(The other alternative if this doesnt work would be making a custom Crafting GUI but I'd rather stay away from that as long as possible.

sullen marlin
#

you cannot extend bukkit clases

#

I'm not even sure how you could register a recipe like that without throw new IllegalArgumentException("Unknown recipe stack instance " + bukkit);

worldly ingot
#

And just so we're all clear

#

lol

#

If you want more types of recipe choices you can always PR to Bukkit, however I'm uncertain as to what a "ComplexItem" is

echo basalt
#

I extended craftblock

worldly ingot
#

Sir

echo basalt
#

And CraftBlockState

worldly ingot
#

This is a Wendy's

echo basalt
#

Then fired events

flint coyote
#

What class do I have to extend in order to register CustomEntities? So they keep their pathfinders and added attributes on a server restart?

echo basalt
#

You gotta make your own entity tracker

#

Or add pdc and respawn entities

flint coyote
#

So I have to add everything again after a restart?
https://www.spigotmc.org/threads/creating-custom-entitys-with-pathfindergoals-1-11.236443/
I found this thread where they registered them by extending RegistryMaterial
is this no longer a thing?

echo basalt
#

1.11 is dated

#

No need to register them anymore

#

Since 1.14

flint coyote
#

So that means they will always lose their pathfinders and I have to re-add them?

echo basalt
#

Yeh

flint coyote
#

๐Ÿ˜

#

Let me guess. In order to prevent respawning them completely I have to do it by reflection
There is probably no way to add those things to an already spawned entity (without reflection)

torn oyster
#

is there a way to make two same-material item stacks different

#

so .equals() doesn't work

#

i'm making custom items but i have to deal with taking and removing items

#

and whenever i do that

#

and add it back

#

it listens for two items

#

and when that player clicks, it runs twice

echo basalt
#

Pdc

vocal cloud
#

Why not set a PDC value for it

echo basalt
#

Metadata

vocal cloud
echo basalt
#

Nbt

torn oyster
vocal cloud
#

?pdc

flint coyote
echo basalt
#

๐Ÿคฆ

worldly ingot
#

It's present on ItemMeta, yes

#

That was the first thing it was added on

torn oyster
#

god damn it i thought it meant player data container i'm actually stupid

echo basalt
#

Chunk pdc

flint coyote
#

๐Ÿฅน

torn oyster
#

i think i'm stupid

#

anyways thanks lol

echo basalt
flint coyote
#

Stupid question:
When doing the remapped thingy for nms...
Which jar is the correct one to publish?
<name>-<version>.jar
<name>-<version>-remapped.jar
<name>-<version>-remapped-obf.jar
?

#

The default one I suppose?

sterile token
#

Im not sure

#

But doesnt make sense publishing the remapped obfuscated one

flint coyote
#

I thought the point is to publish the obfuscated one since Mojang does not allow to use those mappings?
Or is the point to not use their obfuscated mappings with .a() .b() etc since that's not allowed?

sterile token
#

I mean they care when you push their source code itself

flint coyote
#

You mean by forgetting scope provided?

sterile token
#

No no

#

I mean they just care about remppaed jar

#

Because is they pure code in other words deobfuscated

#

let me use the translator so you understand better

flint coyote
#

Yeah I'm a little confused now xD

sterile token
#

Mojang only cares when you publish their source code since it is obviously their property and they have their own rules. So when you publish a plugin with remapped you could have problems since remapped is basically their source code but deobfuscated.

#

Is it more clarify now?

flint coyote
#

But the -remapped has the same size as the base one. So there is no way that it contains mojangs code?

#

Only some method names probably

sterile token
#

Im not really sure

#

I just know that

#

Sorry :d

flint coyote
#

Alright, np ^^ Maybe someone else knows.
Sadly I'm never able to find the original post from md5 about the whole remapping

golden turret
fluid river
#

guys

#

how do i write predicate here

#

e instanceof LivingEntity

#
world.getNearbyEntities(loc, 64, 64, 64, /*e -> e instanceof LivingEntity*/).forEach(/**/);```
flint coyote
#

x -> x instanceof LivingEntity

#

world.getNearbyEntities(loc, 1,2,3), 64, 64, 64, x -> x instanceof LivingEntity); in full

#

Or did I understand the question wrong?

fluid river
#

BRO WHAT

#

It literally didn't work

flint coyote
#

I thought you wanted to know how to do a predicate xD

fluid river
#

but i erased comment i placed

#

And it worked

flint coyote
#

lol

fluid river
#

i literally deleted comment

#

ide has mental issues

#

i guess

sterile token
#

List<LivingEntity> entities = world.getNearbyEntities(location, 64, 64, 64. entity -> entity instanceof LivingEntity);

fluid river
#

yeah i know

#

predicate just didn't work for some reason

#

then i commented and uncommented it

#

and it worked

#

idk why

#

probably i had e -> e ->

#

and erased it when commented

sterile token
#

oh probably

fluid river
#

do i have to cancel tasktimer in onDisable

#

or it's getting cancelled automatically

#

with plugin disable

flint coyote
#

it's automatic

#

atleast on a reload. I never checked what happens if you just call disablePlugin()

oblique wigeon
# worldly ingot If you want more types of recipe choices you can always PR to Bukkit, however I'...

Oh, this makes sense then I guess- but my "ComplexItem" RecipeChoice is a recipechoice that checks for a specific NBT tag instead of a material or exact itemmeta, but it's specific to my plugin and my plugin only, so it wouldn't really be fit for Bukkit in general. I suppose at the end of the day I could also use PrepareItemCraftEvent to check it, but I wanted to see if there was a way I could implement it so that it would be in-line with Bukkit/Minecraft

oblique wigeon
fluid river
#

how do i modify arrow direction

#

do i .teleport() it?

golden turret
#

I am writing a simple 2d collision detector. How can I detect collision between multiple objects?

oblique wigeon
fluid river
#

there is no .setLocation()

#

on arrow

oblique wigeon
#

oh wait

#

i mean

fluid river
#

teleport probably

#

i will handle velocity later

oblique wigeon
#

for direction you can setVelocity iirc

fluid river
#

myself

#

will it work

#

well might try that

#

tell you result

golden turret
wind tulip
#

Anyone know what's happening here?

flint coyote
#

Is there a way to set an nms entities yaw before spawning it? I tried .setXRot(50); but it doesn't seem to do anything.

fluid river
#
else arrow.setVelocity(target.getLocation().toVector().subtract(arrow.getLocation().toVector()).normalize().multiply(getConfig().getDouble("arrow-speed-multiplier")));
#

i like that

oblique wigeon
#

but has a getlocation

#

and teleport

fluid river
#

tho entites don't have setLocation iirc

#

.teleport() is the only way

oblique wigeon
#

i swear i remember something had setlocation

#

yeah idk im having a stroke then ig

eternal oxide
#

You are probably thinking about Location in teh move event being mutable

rigid loom
#

how would i create a Iterable<Map.Entry<K, V>>?

fluid river
oblique wigeon
fluid river
#

how do i check if arrow hit entity

#

like arrow.isInEntity()

oblique wigeon
eternal oxide
#

you could use teh methods of their BoundingBox

fluid river
#

i just made if distance between them is less than 0.5

#

stop my thingy

#

idk if gonna work tho

sterile token
#
public void onEnable() {
  BuiltsPlugin builts = (BuiltsPlugin) getServer().getPluginManager().getPlugin("BuiltsPlugin");
  if (builts == null) return;
  BuiltsAPI api = builts.getApi();
  WandSelection selection = api.getSelections().getSelection(uuid);
  if (!selection.hasBothPos()) return;
  Structure structure = api.getStructures().getStructure("hub-server");
  if (structure == null) return;
  api.getWorker().work(() -> structure.load(selection)).complete((event) -> getLogger().info("Structure " + event.getStructure().getName() + " has been loaded");
}
fluid river
#

yeah made it

#

was kinda easy

eternal oxide
#

yep

quaint mantle
#

Anyone have a forum for tips and tricks on improving your plugin performance?

fluid river
#

anyone has 1.19.2 local server running

hasty prawn
#

I can click 4 buttons and have one running

fluid river
#

alr test my plugin

hasty prawn
fluid river
#

just shoot arrow at random mob

#

tried to write the simplest homingarrows ever

sterile token
#

docker run -d --name=spigot -p 25565:25565/tcp -v ./spigot:/spigot -e ACCEPT_EULA=true qmcgaw/spigot

eternal oxide
#

There would be almost no code to a homing arrow

fluid river
#

yeah that's why it's 6.89 kb

eternal oxide
#
    public void setTarget(final Projectile projectile, final Location targetLoc) {
    
        final Vector velocityVector = targetLoc.toVector().subtract(projectile.getLocation().toVector());
        velocityVector.normalize().multiply(projectile.getVelocity().length());
        projectile.setVelocity(velocityVector);
    }```
fluid river
#

entity can move tho

#

that's why my arrow is homing arrow

eternal oxide
#

you call that in a runnable every tick

fluid river
#

that's what i made

#

also made arrow stop when mob is dead

hasty prawn
#

Yeah but you just pass in the new targetLoc every tick

fluid river
#

or if it's in a block somehow

#

bad homing

eternal oxide
#

just stop calling when teh hit event fires

fluid river
#

i just remove arrow from a map so it's not triggered by scheduler

eternal oxide
#

yep

fluid river
#

idk if entity can be null somehow tho

#

but just in case it is

#

added a check

remote swallow
#

is that ij with eclipse format or eclipse with ecplise format

torn oyster
#

what InventoryAction is right clicking
and also shift clicking

fluid river
#

eclipse

torn oyster
#

i'm too stupid to think

remote swallow
#

ij better

fluid river
#

it loves moving actions to the next line

#

when if statement has no {}

#

togglable tho

#

i'm just too lazy

fluid river
#

BRUUUUH

#

i had < 1

#

and tried to figure out why arrow goes random direction

#

added print mob arrow is aiming at

#

was random creeper underground

#

somewhere behind me

#

...

torn oyster
#

can you use Bukkit.unloadWorld() asynchronously?

earnest socket
#

Is there any way to find the part of my code that's causing the most lag?

#

I know it's my plugin that's causing the lag but I just don't know why. I can't seem to find any active tasks that could be lagging the server and it's not a memory problem as my server shows at least 2gb of ram free. But the cpu is always at high utilization

fossil lily
#

or attach a profiler

wet breach
#

there are some things in the API that if you used enough can generate lag

#

however as said above if you want to do it yourself you are going to need a profiler and two different kinds possibly

earnest socket
#

Not rn though cuz I am not on my computer

wet breach
#

one to see methods being used and the other is a GC profiler

#

also, it could be just that you are not using optimal JVM flags for the server as well

remote swallow
#

?akairs

#

?akair

#

i thought that was a command

wet breach
#

or allocating too much ram without changing any of the JVM flags. giving java a lot of ram tends to do the opposite of improving anything unless you tweak other settings

#

?aikars

#

?aikar

remote swallow
#

?flags

undone axleBOT
earnest socket
wet breach
earnest socket
#

So I don't think jvm flags are the issue

wet breach
#

alright, well was just letting you know. Lots of people come here and they tend to think they really know java ๐Ÿ˜›

quaint mantle
#

Hey so I have this code,

 @EventHandler
    public void onFall(EntityDamageEvent e) {
        if (e.getEntity() instanceof Player p) {
            if (e.getEntity().getLastDamageCause().equals(FALL)) {
                int i = (int) e.getEntity().getFallDistance();
                p.sendMessage(String.valueOf(i));
                int max = 5;
                if (i < 5) {
                    p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 99999999, 1));
                }
            }
``` Which is supposed to basically get the fall distance of a player when the player takes fall damage from falling and if its greater than 5 then give them slowness, but it returns null?
fluid river
quaint mantle
#

In console it just says cannot get object (object) equals because returns null

#

So the damage cause line

fluid river
#

then lastDamageCause returns null i guess

quaint mantle
#

Yes but like why does it return null

fluid river
#

cuz it's nullable

#

use this instead i guess

quaint mantle
#

I tried that too

#

It didnโ€™t work

fluid river
#

EntityDamagEevent#getCause()

quaint mantle
#

Returned null for some reason

fluid river
#

?notworking

undone axleBOT
#

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

quaint mantle
#

It returns null as well

fluid river
#

it can't return null tho

quaint mantle
#

I will try and play around with it, maybe Iโ€™m reading the error wrong

fluid river
#

try this and send error stack trace

#

your code is kinda garbage tho

quaint mantle
#

Well ouch

fluid river
#

you used pattern match in if statement

#

and didn't use variable you got

quaint mantle
#

Wdym I used pattern match

fluid river
#

o instanceof <T> t

#

you can use t variable after that

quaint mantle
#

Yeah I used p

#

I used the variable?

fluid river
#

here you do e.getEntity() again

#

2 times tho

quaint mantle
#

Oh

#

Good pointโ€ฆ

fluid river
#

also don't nest if's

quaint mantle
#

No really other way to do this?

fluid river
#
@EventHandler
public void onFall(EntityDamageEvent e) {
    if (!(e.getEntity() instanceof Player p)) return;
    if (e.getCause() != DamageCause.FALL) return;
    int i = (int) p.getFallDistance();
    if (i > 5) p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 99999999, 1));
}
remote swallow
#

@Override
public void yourEventName(Event Event) {
Entity entity = event.getEntity();

if (!(Entity instanceof Player p)) return;
ect

#

what nuker said

fluid river
remote swallow
#

forgot to do it

fluid river
#

what's the point tho

#

of having max variable

quaint mantle
#

Give me a break man ๐Ÿ˜ญ

#

I never get scolded this much over code

fluid river
#

and you are actually applying SLOW when player's fall distance is less than 5

#

not greater

#

changed that in my code

quaint mantle
#

WELLLLL

#

It STILL RETURNED NULL SO

fluid river
#

full stack trace please

quaint mantle
#

Iโ€™m not at my laptop anymore Iโ€™ll send it tomorrow hopefully but

#

IS there anything else I should be aware of ?

fluid river
#

goodnight then

#

no, nothing

quaint mantle
fluid river
#

next time use JavaDocs

quaint mantle
#

But fr thank you I appreciate it man, Iโ€™ll make sure to fix those and goodnight!

fluid river
#

for both java and spigot

quaint mantle
#

I doooo

#

I do use javadocs

#

But idk still new to this whole spigot programming thing

fluid river
#

FREE JAVA LESSONS tho

checkmybio

quaint mantle
#

In dms?

fluid river
#

yes

quaint mantle
wary topaz
#

The weirdest thing is happening, when I execute a command I made in chat it says It errors.. The console is clear! I checked logs too!

remote swallow
#

any response iin chat

wary topaz
#

Dont understand what this means

#

I cant find this in my code.

remote swallow
#

best bet is to add debug statements

wary topaz
#

true

#

alr ill try

remote swallow
#

sender.sendmessage system.out bukkit.broadcast all work

fluid river
#

what minecraft version do you code for

#

tho

wary topaz
#

latest

fluid river
#

bro

#

then your code is even more stupid then it looks...

wary topaz
#

dude i'm asking for help not for a lesson

fluid river
#

you args.length checks don't always match your args[...] getters

#

That's causeing valueOf to return null