#help-development

1 messages · Page 664 of 1

obsidian shore
#

i feel like minecraft tried so hard to remove magic numbers, just for them to come back haha

spare hazel
#

bump

hazy parrot
#

You shouldn't add jars to intellij

#

But to pom.xml

spare hazel
spare hazel
hazy parrot
#

Because... You are using maven to build

#

Or do you

spare hazel
#

it thinks the plugin is in a repo

hazy parrot
#

What

spare hazel
#

like it checks the .m2 folder to find the plugin instead of checking for external libs with com.amirparsa.hypixelcustomitems as their group id and artifact

remote swallow
#

is it shaded?

#

or in .m2?

spare hazel
#

wdym?

remote swallow
#

okay you arent understanding at all how maven works

#

it requries a repo or a system path to find it

#

it wont magically search your entire pc

spare hazel
#

no. the plugin is a .jar added as an external library

remote swallow
#

it shouldnt be

#

you should have it as a maven dep

hazy parrot
#

Intellij external library have nothing to do with maven

remote swallow
#

it being added there is adding it to INTELLIJS build system

#

not maven

spare hazel
remote swallow
#

its not recommened anyway, you should mvn install it

remote swallow
#

do you have it as another maven project

spare hazel
#

it is another maven project but its built

remote swallow
#

run the install goal

spare hazel
#

not source code

remote swallow
#

do you have source-code with pom.xml

spare hazel
remote swallow
#

run the install goal then

spare hazel
#

how? again...

remote swallow
#

on the right of your screen

spare hazel
#

im an idiot in java

remote swallow
#

open the maven tab

#

then open the lifecycles tab

spare hazel
#

its just an install lifecycle i cant add anything to it

#

like args and stuff

remote swallow
#

jusst run it

#

all you have to do

spare hazel
#

i did. it gives the error i said

remote swallow
#

which project are you running it on

#

you have Plugin A and Plugin B you want Plugin B in Plugin A you should run the install goal in Plugin B

spare hazel
#

what if i just create an interface with all the methods in the plugin B im adding and cast the getPlugin output to that? would that work?

remote swallow
#

sure but thats pointless

spare hazel
#

why?

remote swallow
#

mvn install the plugin, add its info to ur other plugin and you can now access the entire plugin

spare hazel
#

what if i create interfaces for everything i need?

whole surge
#

these are 2281337, 22813372, 22813373, 22813374 and i can't see any animation

spare hazel
remote swallow
spare hazel
whole surge
remote swallow
#

mvn install it, add the depend: Name to plugin.yml add the dep and boom

#

you just need to add somewhat to get the plugin instance

#

which doesnt require any changes to the other plugion

spare hazel
#

should i run nvm install in plugin B and it would work when adding the depend?

remote swallow
#

yes

#

thats literally what i told you 5 minutes ago

spare hazel
#

alr lemme try that

spare hazel
remote swallow
#

go to sleep

spare hazel
#

i only have a 1AM to 11AM infinite data plan and then i have got no internet for the rest of the day so i should use it as much as i can

chrome beacon
#

Time to flip your sleep schedule

spare hazel
#

so i will just use the internet till 5AM, sleep till 5PM. a 90degree change wouldnt damage me metally and physically... right?

smoky oak
#

yall sleep?

spare hazel
#

💀

#

@remote swallow UR A GENIUS

whole surge
#

It's just the first frame and i have no idea why

spare hazel
whole surge
#

i added idle frame as first and its working 💀

rare rover
#

display entities are non-ticking right?

sweet sonnet
#

did NMS change between 1.20 and 1.20.1?

rare rover
#

no

young knoll
rare rover
#

👍

#

thanks

#

also, would persistentdatacontainers be faster than nbtapi?

#

for items

young knoll
#

Doubt it makes much a difference

#

They are both just wrappers over raw NBT

rare rover
#

👍

orchid trout
#

boink

#

🔥firamoji

knotty shell
quaint mantle
#

what about the math behind spinning? Ik its basic math but im slow

orchid trout
#

1+2=×

echo basalt
#

yaw += angle

quaint mantle
#

I mean x its smth to do with Pi right

#

how to edit/adjust plugin page after i released it?

young knoll
#

Edit button should be near the bottom

#

Next to report

#

You need 2fa enabled

quaint mantle
#

oh

echo basalt
#

the base of all particle effects is ✨ trigonometry ✨

#

I'm shit at explaining it but see it as

#

Assume you have a circle of length 1, given a point at an angle, what would be the X and Y position of that point?

#

And do a basic x = sin(angle), y = cos(angle) and that's your answer

quaint mantle
#

so basically I just need to increase the angle each time

quaint mantle
river oracle
#

I've honestly been thinking about this. Why does ItemStack not just wrap the NMS ItemStack with NBT? I'm not quite sure how ItemStack is completely implemented, but I've been curious. (I get currently it wouldn't be easily possible anymore as we have the class ItemStack.class and we can create new instances of it

echo basalt
#

It works in a weird Adapter model

slender elbow
#

i mean there is CraftItemStack, but the problem is that ItemMeta exists and stuff needs to be read from and written to the NBT all the damn time when using it

river oracle
slender elbow
#

get meta does return a clone

#
  • all the deserialization involved etc
river oracle
#

what would a benefit of the clone be vs direct access to the NBT (granted with a semi nice wrapper you'd need as you wouldn't want the api to be abused) without all of that

slender elbow
#

the memory footprint isn't exactly minimal

#

mostly a smaller memory footprint and less cpu time spent on unnecessary deserialization of some things like lore/name components, skull profiles, banner patterns etc

river oracle
#

I've heard a few times that ItemMeta is "bad" though whats the flaw in how its currently designed

#

fairly new to actually working on server stuff starting to actually get really interested in this stuff

livid dove
#

Imagine if you will an inventory or custom items.

You call inventory click. Would you rather want it to regrab the nbt directly and figure out what it is via deserialising , or have a copy to hand to reference?

#

Now imagine a server with 100 players all clicking as part of their day to day

river oracle
#

I'm just trying to get into more how the server works, been trying to make prs and such to help my understanding by just going in and fixing stuff

livid dove
#

Thing you need to understand mate, as noone says nearly often enough.

This entire API framework we use.

From NMS all the way to Purpur and Foila, is built on rubber bands, PVA glue and dreams.

It's confusing because fundamentally it's flawed

#

I mean there is a reason the Material enum is a meme

river oracle
#

more so than the API sometimes

livid dove
#

Moment you take a step back and realise that, it becomes easier to manage

river oracle
#

the container stuff in NMS seems so convoluted to me I don't get it

livid dove
#

Approach it from the angle of "some muppet probably tried the most round about way of solving a problem" and it becomes much easier to understand

river oracle
#

I'm relatively new to java so a lot of my code is just me doing that xD

livid dove
#

My advice is learn how to make good code before going as deep as NMS.

#

Because you won't find good code in NMS

#

Or spigot for that matter (Enums ... *shudders)

river oracle
#

for example they tick signs

#

why why do you need to tick signs you don't need to tick signs

livid dove
#

And as someone newer to java you will keep getting confused.

#

Best to make good , simple shit and then move on to other stuff when u have confidence

river oracle
#

by "relatively new" i mean I'm 2 years into my java experience which I think is pretty new compared to quite a few people in here

livid dove
#

Ah fair

river oracle
#

though I code pretty much every day

#

atleast 2 or 3 hours a day

livid dove
#

Ah if u ever want someone to do some code reviews holler me up

river oracle
river oracle
livid dove
#

I meant proper pr reviews lol

river oracle
#

though they are both 1 liners xD

livid dove
#

Link em and I'll look in the morning

river oracle
#

?stash

undone axleBOT
livid dove
#

4am vibes

river oracle
#

lazy vibes

#

legit used the command to open my browser

livid dove
#

Oh wait uve done spigot prs

#

Huh neT

#

Neat

livid dove
#

I meant more github stuff but aight lol

river oracle
#

ahhh

#

I do have some github stuff I'd love you to look at though trying to go about constructing an inventory api for myself, but Idk I feel like I'm doing something wrong with this structure it seems ridgid, but idk how to explain it

livid dove
#

Send me in dms and I'll look tommoriw

#

My team recently finished the inventory menu package in our library so good fortune all round

river oracle
river oracle
marsh crater
#

can anyone reccomend an open source plugins I can look through the github repo to learn more about plugin development? prefferably one thats easily digestible.
I tried essentials and although I can sortof follow everything, its easy to get lost in it

drowsy helm
#

The main things you want to learn are proper plugin structure then the specifics are usecase dependant

marsh crater
#

ok

sweet sonnet
#

BukkitRunnable vs Bukkit.getScheduler().runTaskLater()?

eternal oxide
#

no difference

sweet sonnet
#

thanks'

rare rover
#

how does Interpolation work?

#

i've never messed with it before

#

can't find any forums or anything

eternal oxide
#

interpolation is just calculating the change between two states

#

ie given two locations and a time factor with speed you can calculate the intermediate location between those two locations.

rare rover
#

i've got this?

#

just a test

#

which doesn't work

eternal oxide
wraith dragon
#
Player player = event.getPlayer();
        if (game.getPlayers().containsKey(player.getUniqueId())) {
            List<Pos> buildAbleLocations =
                    new ArrayList<>(LocationUtil.posFromTwoPoints(
                            game.getGameData().getBuildAbleCornerOne(),
                            game.getGameData().getBuildAbleCornerTwo()));

            Location blockLocation = event.getBlock().getLocation();

            Pos pos = LocationUtil.locationToPos(blockLocation);

            for (Pos buildAblePos : buildAbleLocations) {
                if (!LocationUtil.coordinatesMatch(pos, buildAblePos)) {
                    event.setCancelled(true);
                }
            }
        }

I have this code for checking if the blocks are in the buildable corners. Im just asking if there was a more performant alternative to the code above?

eternal oxide
#

There is pretty much no code in there to comment on

#

you are cancelling if ANY of your Pos are not a match

#

may as well break; when you cancel

#

finding more is not going to do anything different

river oracle
#

I can't wait to start playing with them

wraith dragon
#

basically

hybrid spoke
#

a boolean or anything with "isPossible = false"

#

and once one is possible, set it to true

#

and voilá

#

if its still false afterwards, then you can cancel

wraith dragon
#

alright thanks

#

I also have another code block I'd like you guys to look at

hybrid spoke
rare rover
#
                double yaw = Math.toRadians(player.getLocation().getYaw());
                Vector direction = new Vector(-Math.sin(yaw), 0, Math.cos(yaw));
                
                Vector offset = direction.clone().multiply(1).add(new Vector(1, 0, -1));
                Location petLocation = player.getLocation().add(offset);
                pet.setPosition(petLocation);``` i  have this, i'm making a pet system. It should always stay at `1, 0, -1` of the player's location (with yaw) but it rotates weird
#

and idk how to fix it

rare rover
eternal oxide
#

thats not how vectors work

rare rover
#

i figured it out

eternal oxide
#

ok

rare rover
#

yeah

#

goofy system

eternal oxide
#

why are you not using the players direction?

rare rover
#

idfk

eternal oxide
#

?paste

undone axleBOT
eternal oxide
#

this spawns a particle either left or right of the player

rare rover
#

ahh

#

yeah this is mine

#

cpp 🥶

eternal oxide
#

mines simpler 😉

rare rover
#

yep

#

i'll use it

#

thanks

#

goofy math

round finch
clear elm
#

Can I use the sellgui with every economy plugin ?

tender shard
#

is that a development question?

clear elm
#

No sry

#

But can you answer it anyways

tender shard
#

i can't

clear elm
#

Okay

quaint mantle
#

am i check player craftbukkit permission with bungeecord ?

eternal oxide
#

no

hard light
#

i have premium and skinrestorer no work

#

how fix

#

server papermc

eternal oxide
#

?whereami

zealous osprey
quaint mantle
#

i wanna make global ranks i mean bungeecord ranks

#

for players

zealous osprey
#

Why not use a global database then and make requests to it for quering the rank of a certain player

quaint mantle
#

but i don't know how works

#

i mean

#

luckperms works like this ?_

#

and how to query works for luckperms

zealous osprey
#

idk, maybe they have a bungee option.

#

check their website

tender shard
quaint mantle
tender shard
#

why don't you just get the groups directly from luckperms?

quaint mantle
#

ah

#

wait

#

luckperms

#

storing anything in db ?

#

i mean group name(rank)

#

and permissions

#

they storing this in database ?

#

or file

stiff knot
#

hey does anyone know how i would store a copy of a player inventory to set again later? right now im trying to create a new inventory and set the contents but the inventory size has to be a multiple of 9, while the player inventory returns 41 which, last time i checked is not a multiple of 9

tender shard
sullen marlin
#

getStorageContents

#

if youre trying to store in a chest or something

#

but otherwise like alex says, just array

drowsy helm
#
@Permission(value = RolePermission.VIEW_MEMBERS)``` 
someone remind me how i make it so i don't have to do value = in my custom annotation
#

its been a min lol

smoky anchor
#

I think if it has only one value, you can just ommit the "value ="
also, default for values exists

compact haven
#

if it only has one value name value it’s a single-element enumeration and you should be able to get rid of the explicit “value =“

drowsy helm
#

oh nvm it was my IDE shitting itself

#

yeah thats what i thought, it just wasnt updating the class definition for some reason

compact haven
icy beacon
#

e.g. responding to my question or asking me a follow-up question or a question on a topic in which i am clearly versed, but definitely not randomly asking if i can do something or not

#

the "randomly asking if i can do something" is also the case for ?ask

#

?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!

livid dove
astral adder
#

I'm trying to make a random kits server where everytime u die u get a random kit! Any plugins for it?

icy beacon
quaint mantle
#

Why do we create an object in a different class when making a query in the database?

livid dove
#

database is a very broad term

#

i.e. what class

quaint mantle
#

with java objects

#

like this

#

and getting objetcs with getter setter

livid dove
#

That.... ive... erm... never seen someone do it quite like that 0-0

echo basalt
#

average mongo document

livid dove
#

Cant spell mongo without mong...

echo basalt
#

||Ra||z||iel||mart||elus||

#

zmart

inner mulch
#

Which event is used to listen if an entity turned into a block?

zealous osprey
#

When would that be the case? Which entity does that

native bramble
#

how can i generate sha1 for resourcepack?

inner mulch
#

gravel

#

anvil

zealous osprey
#

aaah, the faling block entities

smoky anchor
#

oh I thought you were talking about silverfish, that one does callEntityChangeBlockEvent

zealous osprey
# inner mulch Which event is used to listen if an entity turned into a block?
inner mulch
#

thank you

zealous osprey
rare rover
#

how'd one improve this?:

public static <T extends Comparable<? super T>> @NotNull Map<Object, T> getSorted(@NotNull Map<Object, T> map, int maxSize, boolean ascending) {
        if (ascending)
            return map.entrySet().stream()
                    .sorted(Map.Entry.comparingByValue())
                    .limit(maxSize)
                    .collect(Collectors.toMap(
                            Map.Entry::getKey,
                            Map.Entry::getValue,
                            (e1, e2) -> e1,
                            LinkedHashMap::new
                    ));

        return map.entrySet().stream()
                .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
                .limit(maxSize)
                .collect(Collectors.toMap(
                        Map.Entry::getKey,
                        Map.Entry::getValue,
                        (e1, e2) -> e1,
                        LinkedHashMap::new
                ));
    }``` i dislike how it looks
#

and very bulky

#

which is nooby

#
public static <T extends Comparable<? super T>> @NotNull Map<Object, T> getSorted(@NotNull Map<Object, T> map, int maxSize, boolean ascending) {
        Comparator<Map.Entry<Object, T>> valueComparator = ascending
                ? Map.Entry.comparingByValue()
                : Collections.reverseOrder(Map.Entry.comparingByValue());

        return map.entrySet().stream()
                .sorted(valueComparator)
                .limit(maxSize)
                .collect(Collectors.toMap(
                        Map.Entry::getKey,
                        Map.Entry::getValue,
                        (e1, e2) -> e1,
                        LinkedHashMap::new
                ));
    }``` this looks a bit better
#

still bulky doe

zealous osprey
#

separate it into 2 more functions

public static <T extends Comparable<? super T>> @NotNull Map<Object, T> getSorted(@NotNull Map<Object, T> map, int maxSize, boolean ascending) {
  if(ascending) return ascendingMap(map, maxsize);
  else return descendingMap(map, maxsize);
}

...

?

#

or just have an enum with your Collectors in them

smoky anchor
zealous osprey
rare rover
#

ima just do this for now

#

ain't the best

#

but it works ig

smoky anchor
#

longest.. what, method signature? (idk what it's called but the public static <T> @ returntype thing) I've seen so far lol

rare rover
#

idk but i need comparable

#

and it looks so dumb

smoky anchor
#

I was not asking to see a longer one
please don't

echo basalt
zealous osprey
#

JESUS

#

Why do you have Instanced extends InstancedGameMap in there, does that even do anything differently than just using Instanced?

echo basalt
#

Yes

zealous osprey
#

oh?

echo basalt
#

It's the difference between paste(BedwarsMapTemplate.class, "map-one") returning BedwarsMap and returning InstancedGameMap

zealous osprey
#

Ahh, ok

#

gotta do more stuff with generics and method signatures, got way too little experience with them

echo basalt
#

this is just me goofing around with my minigame lib stuff :)

#

generics are weird here

zealous osprey
#

in recent times this was the most I've done with generics

rare rover
# echo basalt

should i use what im using now or make a bubble sort algorithm. I feel like that would be overkill your only sorting like 15 values anyways

smoky anchor
#

I suggest keeping what you have
And whatever you do, do not create bubble sort
It's like one of the worst ones

echo basalt
#

just use what you got

rare rover
#

both meh

#

i'll keep it

#

ty

kindred sentinel
#

How to make tab completion that does not offer any specific option? like <message>

kindred sentinel
#

yeah

#

like in /tell nickname <message>

zealous osprey
#

Check out https://github.com/Mojang/brigadier
The image came from this repo though: https://github.com/JorelAli/CommandAPI

GitHub

Brigadier is a command parser & dispatcher, designed and developed for Minecraft: Java Edition. - GitHub - Mojang/brigadier: Brigadier is a command parser & dispatcher, designed and...

GitHub

A Bukkit/Spigot API for the command UI introduced in Minecraft 1.13 - GitHub - JorelAli/CommandAPI: A Bukkit/Spigot API for the command UI introduced in Minecraft 1.13

#

Though I think it only works with mc versions 1.13+

#

Cries in developing 1.12.2

chrome beacon
#

If you want to use Brigadier then I highly recommend Commodore

hybrid turret
#

If I put something along the lines of the folloing in my config.yml do I just get it with get() or is that getStringList()?

textFormat1: ["DARK_REED", "BOLD"]
textFormat2: ["RED", ""]
textFormat3: ["GREEN", "ITALIC"]
echo basalt
zealous osprey
#

what are you searching for...

hybrid turret
#

lmao that's some good regex xd

echo basalt
#

doing a regex replace for all the event listeners

#

it's wack

hybrid turret
#

bro wrote a whole method into the regex line

echo basalt
#

so yeah I just ran this for the entire project, ran my code formatter and fixed imports :)

echo basalt
#

that's a stringlist

hybrid turret
#

Okay so just a stringlist perfect thanks

smoky anchor
chrome beacon
#

Yeah it's command completion

#

Which is what most people want

gleaming brook
#

how i can change my nickname in spigotmc?

chrome beacon
#

?changename

undone axleBOT
#

Name changes on the forums are granted to those who have donated to the project. Donations are processed manually and generally take up to 24 hours. The donation widget can be found on the home page of SpigotMC at: https://www.spigotmc.org/.

gleaming brook
#

ty

near mason
#
@Override
    public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] strings) {
        final Player p = (Player) commandSender;
        
        PerlinNoiseGenerator perlinCosine=PerlinNoiseGenerator.
                newBuilder()
                .setSeed(3301)
                .setInterpolation(Interpolation.COSINE)
                .build();
        
        Location loc = p.getLocation();
        
        for (int x = -5; x<5; x++){
            for (int z = -5; z<5; z++){
                Location spawnLoc = loc.clone().add(x,perlinCosine.evaluateNoise(x, z) ,z);
                BlockDisplay display = loc.getWorld().spawn(spawnLoc, BlockDisplay.class);
                display.setBlock(Material.DIAMOND_BLOCK.createBlockData());
            }
        }
        
        
        return true;
    }

all the diamond blocks have the same y level

eternal oxide
#

PerlinNoise probably returns a value between 0 and 1

near mason
#

ye but the y level's difference is 0

eternal oxide
#

sysout the result of PerlinNoise

near mason
#

ok

#

how is this -0.0

#

xD

eternal oxide
#

not a lot of noise there 🙂

austere cove
#

so tweak it

#

octaves, amplitude, frequency

near mason
#

oh

#

it just doesnt work with integers

#

i'll try with double

rare rover
#

anyone have a better method for this?:

public String getFancyTimer() {
    long seconds = convertToSeconds();
    long minutes = convertToMinutes();
    long hours = convertToHours();
    long days = convertToDays();
    
    long remainingHours = hours % 24;
    long remainingMinutes = minutes % 60;
    long remainingSeconds = seconds % 60;

    StringBuilder formattedTime = new StringBuilder();
    
    if (days > 0) {
        formattedTime.append(String.format("%02dd %02dh %02dm %02ds", days, remainingHours, remainingMinutes, remainingSeconds));
    } else if (hours > 0) {
        formattedTime.append(String.format("%02dh %02dm %02ds", remainingHours, remainingMinutes, remainingSeconds));
    } else if (minutes > 0) {
        formattedTime.append(String.format("%02dm %02ds", remainingMinutes, remainingSeconds));
    } else {
        formattedTime.append(String.format("%02ds", remainingSeconds));
    }

    return formattedTime.toString();
}```
rare rover
#

oh ty

slim pier
#

I'm trying to remove the "§c+ Damage " from the "§c+ Damage 0.1", but the character "§" isn't being removed.

young knoll
#

ChatColor.stripColor

twilit creek
#

Hello is there an Event that is called after the player joined the Server and can interact with the world. It should be called after PlayerJoinEvent, because you can't send WorldChanging NMS Packets if you call it in PlayerJoinEvent.

ivory sleet
slim pier
young knoll
#

Show your code

#

?paste

undone axleBOT
slim pier
#
ItemStack newItem = a;
ItemMeta meta = newItem.getItemMeta();

List<String> lore = new ArrayList<>();

double i = 0;
if(meta.hasLore()) {
    String inputString = meta.getLore().get(2); // ChatColor.RED+"+ Damage 0.1"
    String prefixToRemove = "§c+ Damage ";

    String valueString = inputString.replace(prefixToRemove, "");

    i = Double.parseDouble(valueString);
}
young knoll
#

You shouldn’t be storing data in lore anyway

near mason
#

if it is the start of the string

young knoll
#

?pdc

hybrid turret
#

How do I give a player a door which can only be opened by a nametag that has a specific alphanumeric string as key in the lore?

timid hedge
#

Hey do you know why i am getting an error here at "Slag"?
.retain(ComponentBuilder.FormatRetention.NONE).append(Slag)

        BaseComponent[] Slag = new ComponentBuilder("S")
                .bold(false)
                .color(ChatColor.GREEN)
                .event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "broadcast 1"))
                .event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Tryk her for at jail for Slag").create()))
                .create();

And i am getting an error at ComponentBuilder builder = new ComponentBuilder(); it says that it cannot resolve componentBuilder()

hybrid turret
#

Also: is this the same as if i were to add the string list using failSafeFormat.add()?

  private static final List<String> failSafeFormat = new ArrayList<>(Arrays.asList("WHITE", ""));
young knoll
#

Pretty much

#

But the list will be immutable

hybrid turret
#

immutable?

young knoll
#

Yes

#

You can’t add or remove from it

echo basalt
#

Nah he's creating a copy

#

It'll work

young knoll
#

Oh right

#

I mean either way it looks like a constant so it doesn’t matter if it’s immutable

hybrid turret
hybrid turret
#
Arrays.toString(handleNameFormat(ownerNameFormat));

Does this make a String out of the elements of a String[]?

#

Or does it litterally do "["", "", ""]"?

kindred sentinel
zealous osprey
kindred sentinel
zealous osprey
#

idk, never used it before

kindred sentinel
#

Or in any case i should use brigadier?

hybrid turret
zealous osprey
#

all of them base of brigadier

kindred sentinel
#

oh ok

orchid trout
#

it doesnt feel right

#

should i make the insert into database sync with the main thread?

echo basalt
#

Nah

#

Just use futures

#

And a sort of user cache with a UserLoadEvent

near mason
#
for (double x = -count; x<count; x++){
            for (double z = -count; z<count; z++){
                Location spawnLoc = loc.clone().add(x,noisePipeline.evaluateNoise(x/scaler, z/scaler) ,z);
                BlockDisplay display = loc.getWorld().spawn(spawnLoc, BlockDisplay.class);
                display.setBlock(Material.DIAMOND_BLOCK.createBlockData());
                displays.put(new Vector2d(x, z), display);
                display.setInterpolationDuration(20);
            }
        }
        
        final int[] skipped = {1};
        final double y = loc.getY();
        $.setInterval(40, interval -> {
            skipped[0]++;
            for (double x2 = -count; x2 <count; x2++){
                for (double z2 = -count; z2<count; z2++){
                    Display disp = displays.get(new Vector2d(x2, z2));
                    Location newLoc = disp.getLocation().clone();
                    disp.setInterpolationDelay(0);
                    newLoc.setY(y+(noisePipeline.evaluateNoise((x2/scaler)+skipped[0], (z2/scaler)+skipped[0])*multiply));
                    disp.teleport(newLoc);
                }
            }
        }, PerlinNoise.getPlugin(PerlinNoise.class));

why does interpolation doesnt work?
$.setIntervak is repeated task with delay 40

kindred sentinel
#

Where is additional information about players usually stored for the plugin? In JSON files?

chrome beacon
#

?pdc

chrome beacon
#

Does depend on what you want to store though

grizzled oasis
#

Hi, how can i calculate fortune? (i need this for a prison server)

opal carbon
#

wdym "calculate fortune"

grizzled oasis
simple girder
#

I'm new to developer, my theoretical knowledge is not bad. Can you suggest open source projects that I can take a look to get ideas while improving myself?

orchid trout
#

5

#

0*

opal carbon
#

oh wait

#

i have dementia

#

oopsie

#

ignore me

hybrid spoke
hybrid turret
#

Can I somehow add Coloring to the plugin name so that i can get the pluginName using getDescription().getName() and have it colored in the console?

hybrid spoke
hybrid turret
#

yeah i was a little vague

#

I want different colors to parts of the name

hybrid spoke
#

you can get it, cut it, put a color code between and glue it together 🤔

hybrid turret
#

I mean ofc I can just write the name out in the onEnable-Message but that's boring and if I felt the need to change the name of the plugin yet again i'd have to change more than 1 line lmao

#

cut? isn't it split?

hybrid spoke
#

not really since you would substring

hybrid turret
#

hmmm i COULD add dashes instead of pascal case

#

and then use split

hybrid spoke
#

or just substring

hybrid turret
hybrid turret
#

ohhh interesting

#

i just read up on it

#

then again would it be easier to just write it out lmao

hybrid spoke
#

probably

#

more most likely

icy beacon
#

hey, not a spigot question, does anybody know a rust ide? i've started with rust and i'm using vscode with some extensions rn, i was wondering if there's an ide for it with stuff like intellisense, cargo support, etc

vital ridge
#

I\m creating a configurationsection using #createSection but it just doesn't create any section

#

nvm

#

I think I know what is wrong

#

Yep fixed it, forgot to save the configuration.

icy beacon
vital ridge
#

My bad. I would've sent, but it was just 1 line of code actually.

#

I was about to mention that I was creating it under PlayerJoinEvent but I already found the issue by then.

austere cove
#

vscode has been fine for my rust projects

#

but if you want to eclipse and intellij can both be used w rust

icy beacon
#

tyty, i'll see if i can get comfortable with vscode

young knoll
#

I thought you used rust to write rust

#

You know

#

The game

sterile breach
#

Hello. For a multiple server communication what is the best solution (without pluginmessages). Socket or redis ? Or other ?

wet breach
austere cove
#

if ur based u use vim

wet breach
#

I suppose one could use vim for communications

#

not sure if I would classify it the best though

austere cove
#

thats not what I was replying to

quartz pendant
#

anyone knows the event when experience is get when an players catchs an fish with an rod? 😄

austere cove
#

English pls

river oracle
river oracle
quartz pendant
river oracle
#

you can use the search bar in the docs

#

just type in keywords

tender shard
#

i fucking hate that it's called Exp and not Experience

#

call it XP or Experience but not Exp lol

#

EntityDmgEvent

echo basalt
#

reminds me of minestom

tender shard
#

PlrJoinEvent

echo basalt
#

Pos

#

Vec

#

Pos#mult

tender shard
#

BlckBrkEvent

echo basalt
#

Pos#sub

#

Entity#setVel

river oracle
#

@echo basalt I was looking at NMS and I'm kind of stumped what is the difference between an NMS Inventory (spigot) / Container (mapped) and Containers (spigot) / Menu (mapped)

#

the fact that containers are totally different things between mapped and unmapped make it so much more confusing lol

echo basalt
#

ah let's look at this

river oracle
#

then you also have like TileInventorys (spigot) / SimpleMenuProvider (mapped)

echo basalt
#

A menu is a container

river oracle
#

but whats an Inventory then

echo basalt
#

Inventory is an item container for entities

#

A menu is for tile entities

#

And I'll assume that a container is an abstraction of both

river oracle
#

because it has a Menu

echo basalt
#

don't think it does

#

It just holds block data

river oracle
#

ahh okay

echo basalt
#

The only icky one is MerchantMenu

#

But it's a unique menu so

#

These menus are basically just all the custom UI

#

So yeah I get it now

#

Menu = Custom UI, instanced by a MenuProvider
Inventory = General item container, rendered by a menu

#

Basically a menu is an inventory renderer

strong parcel
#

If I grab the PDC from an ItemStack, do I have to set the ItemMeta after I make changes?

echo basalt
#

Yes

strong parcel
#

Okay, thanks!

river oracle
void ember
#

Hey, I was trying to make an event listener, but event appears in red

#

I'm using intellij ide

austere cove
#

yea well learn some java cos if you do not see the mistake there you're not familiar enough

grizzled oasis
#

EnchantsManager: https://paste.md-5.net/hasotofoki.cs
EnchantGui: https://paste.md-5.net/muferavaca.cs

Hi strangest bug and im 5 hours trying to fix it, when i enchant a pickaxe with a vanilla enchant and try naming it like a normal enchant es DIG_SPEED to Efficiency (Im using an older version so i can't use getByNameKey and i have custom enchants too) just get the pickaxe

Efficiency and Dig_SPEED like separated enchants but linked by the Level

AlixEnchantment is a private version of XSeries, they are the same but i added something else, but the feature im using in this code are the same as the one

north nova
#

🤦‍♂️

grizzled oasis
lilac dagger
tepid acorn
lilac dagger
#

am i famous now? 😮

tepid acorn
lunar wigeon
north nova
#

that works on your machine?

#

WILD!

#

people reinventing java

lunar wigeon
#

I use CocosJDK 17

#

its has better features than kotlin

north nova
#

so CocosJDK supports functions within functions?

#

thats wild

lunar wigeon
#

yes

north nova
#

lmao

lunar wigeon
#

it supports way more than you think

lilac dagger
#

that's gonna get confusing

lunar wigeon
#

what

#

cocosjdk?

lilac dagger
#

functions inside functions

north nova
#

the top secret +5,000,000 social credits JDK

lilac dagger
#

in java they're called functional programing

lunar wigeon
#

CocosJDK improves java speed by 73% because I have benchmarked it

lilac dagger
#

but they make sense there

#

that's a lie

#

haha

north nova
#

i assume it only runs on temple os no?

north nova
lilac dagger
#

you know when you do something like Runnable runnable = () -> //something

lunar wigeon
#

create class in your method, you can do it in default jdk

lilac dagger
#

and run it

north nova
#

that is not what his code was about?

lunar wigeon
#

but still I recommend using CocosJDK with CocosGui

north nova
#

and it's called a functional interface, not functional programming

lilac dagger
#

i wasn't talking about that specific interface lol

lunar wigeon
lilac dagger
#

i was talking about functional programming as a capability

north nova
#

yea ok u the goat bro

#

💯

lunar wigeon
#

thanks

#

btw kotlin and python sucks right

queen niche
#

anyone knows a good API for images on map?

lunar wigeon
sturdy knoll
#

how would you check if tipped arrows have potion effects? I'm trying to use PotionMeta getCustomEffects() function but it's always empty

queen niche
lunar wigeon
#

google it

queen niche
#

already did.

echo basalt
#

cerus/maps

queen niche
#

didnt really came up with anything

echo basalt
#

on git

lunar wigeon
#

I dont think it supports images

echo basalt
#

It does

#

at work we just use the one I made

#

It's not really complicated

queen niche
#

you have to convert a java.awt Image to a graphics?

echo basalt
#

you can just call setPixel a bunch of times

#

At work we just use awt and move on with our lives

queen niche
#

I already found a API that supports images on maps but sadly that only supports 128x128 images only

echo basalt
#

Raycasting is probably the hardest part of rendering a map

#

Anyways if you want to use bigger images than 128x128 you can just segment that image and use something like this to get relative positions for proper rendering

lilac dagger
#

looks very similar to rotations at 90 degrees

echo basalt
#

That's because it is

lunar wigeon
#

The most simplified way:

  1. Create server that will create ready images asynchronously and send packets to client (plugin)
  2. Make client (plugin) that will send requests to server with callback using CompletableFuture.
  3. I recommend java sockets
    🙂
echo basalt
#

chatgpt moment

lunar wigeon
#

what chatgpt

queen niche
#

But thanks for the information, I will play around with both

echo basalt
#

ew

#

Here this might help

queen niche
echo basalt
lunar wigeon
echo basalt
#

wrote it years ago

queen niche
echo basalt
#

uhh

#

yeah

queen niche
grizzled oasis
#

EnchantsManager: https://paste.md-5.net/hasotofoki.cs
EnchantGui: https://paste.md-5.net/vovufupoyu.cs

Hi strangest bug and im 5 hours trying to fix it, when i enchant a pickaxe with a vanilla enchant and try naming it like a normal enchant es DIG_SPEED to Efficiency (Im using an older version so i can't use getByNameKey and i have custom enchants too) just get the pickaxe

Efficiency and Dig_SPEED like separated enchants but linked by the Level

AlixEnchantment is a private version of XSeries, they are the same but i added something else, but the feature im using in this code are the same as the one

echo basalt
#

thanks for copypasting the same message

grizzled oasis
echo basalt
#

gah static abuse

lunar wigeon
quaint mantle
#

how does that work?

grizzled oasis
echo basalt
#

Doesn't mean I should do it

grizzled oasis
#

lol

echo basalt
#

Average "ask for the entire plugin concept and hope someone spoon feeds you" moment

north nova
#

you dont spoonfeed people?

echo basalt
#

?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.

north nova
#

thats so rude!

#

how come you dont spoonfeed

ivory sleet
#

Are you trolling?

echo basalt
#

yeah it's bogdan he trolls

north nova
#

the fact that u asked

#

😭

lunar wigeon
echo basalt
#

still being a slave for that server that's never coming out?

north nova
#

@echo basalt yo sry for bothering can you help me quick really quick full hypixel skyblock clone

#

it will be quick

ivory sleet
#

Guys take this outside the server please

echo basalt
#

star my git project and when EP comes out I'll release it

north nova
lunar wigeon
echo basalt
#

it was meant to be out last december

north nova
#

i would show u a list of the devs we had

#

since u left

#

you'd be surprised

echo basalt
#

high turnover I see

lunar wigeon
north nova
#

we recoded literally everything

echo basalt
#

¯_(ツ)_/¯

#

how many abstract factories

ivory sleet
north nova
#

no use factory design pattern

#

i hate it

ivory sleet
#

lol what

lunar wigeon
opaque scarab
#

What mojang remapped packet controls potion effects?

lunar wigeon
#

its also thread safe

north nova
#

nvm

dusky crane
#

How can I create a world with a custom chunk generator that doesn't freeze the server?

north nova
#

nvm

opaque scarab
#

Potion effects on the player I mean

dusky crane
#

I've tried for 6 hours to do this.

echo basalt
#

jfc it's one worse than the other

ivory sleet
echo basalt
#

World generation has always been icky

lunar wigeon
north nova
#

o also illusion i have a question for u

echo basalt
#

At this point I wouldn't mind writing data to the chunks directly and loading them

north nova
#

can u check dm

ivory sleet
#

I mean sure but there are tons of other libs that have just as good reasonable apis and docs

lunar wigeon
#

javacord has lost support I think

dusky crane
#

I'm logging whenever the server generates a block

echo basalt
#

disappointment I might've removed you

ivory sleet
eternal night
#

Me

ivory sleet
#

I dont use javacord

eternal night
#

I am the people

lunar wigeon
dusky crane
#
Bukkit.createWorld(new WorldCreator("arena-"+worldCount).generator(new CustomChunkGenerator()));```
eternal night
#

🍿

eternal night
dusky crane
lunar wigeon
#

imagine not using JDA for discord bot in java

eternal night
#

imagine using java for a discord bot tho

lunar wigeon
#

is it? the naming looks like paper

ivory sleet
#

Fr

eternal night
#

when you could be using, kotlin

queen niche
#

I have another quick question. What would be the best way to store an image in cache/memory while waiting for a onclick event on a block where the image would be placed?

So currently I have an command that takes in a image url, does some basic validation and then places it in a hashmap, Then on every clickEvent after some validation I check if there is a Image in the hasmap linked to the executor and grab it. But im not sure if this is efficient

ivory sleet
#

Rust :-)

vapid grove
#

How do I apply trims to an itemstack for 1.20.1 armor pieces?

lunar wigeon
dusky crane
eternal night
#

OCaml

lunar wigeon
#

js is the most used, second one is jda

grizzled oasis
eternal night
dusky crane
eternal night
#

True, I heard any method naming following the fluent naming convention belongs to paper

#

you are out of luck bud

lunar wigeon
echo basalt
#

this is a big troll fest

eternal night
#

I love it

echo basalt
#

should've charged an entry fee

#

100 doge

eternal night
#

the brain cells you loose

vapid grove
eternal night
#

are the entry fee

dusky crane
eternal night
#

not much you can do there

#

it'll create and load a world

#

that is expensive at runtime

#

faster, if these worlds already exist on the disk

echo basalt
#

I should just make my own world manager at some point

lunar wigeon
dusky crane
# lunar wigeon maybe show chunkgenerator implementation?
    public ChunkGenerator.ChunkData generateChunkData(World world, Random random, int chunkX, int chunkZ, BiomeGrid biome) {
        ChunkData chunkData = createChunkData(world);
        world.setBiome(16,64,16, Biome.BIRCH_FOREST);
        world.setSpawnLocation(new Location(world,32,64,32));
        for (int x = 0; x < 16; x++) {
            Bukkit.getLogger().info("x: "+x);
            for (int z = 0; z < 16; z++) {
                Bukkit.getLogger().info("z: "+z);
                chunkData.setBlock(x,0,z,Material.BEDROCK);
                for (int y = 0; y <= 64; y++) {
                    Bukkit.getLogger().info("y: "+y);

                    if (y > 0 && y < 7){
                        chunkData.setBlock(x,y,z,Material.LAVA);
                    }
                    if (y > 3 && y < 35) {
                        if (random.nextDouble() < 0.2) {
                            int i = random.nextInt(10);
                            if (i == 0){
                            chunkData.setBlock(x, y, z, Material.DIAMOND_ORE);
                            } else if (i < 6) {
                                chunkData.setBlock(x, y, z, Material.IRON_ORE);
                            } else if (i > 6 && i < 9) {
                                chunkData.setBlock(x, y, z, Material.GOLD_ORE);

                            }else {
                                chunkData.setBlock(x, y, z, Material.LAPIS_ORE);

                            }


                        }
                    }
                    if(y >35){
                        chunkData.setBlock(x, y, z, Material.DIRT);
                    }
                    if (y == 64){
                        if (random.nextInt(5) == 0) {
                            world.generateTree(new Location(world, x, y, z), TreeType.BIRCH);
                        }
                    }
                }
            }
        }

        return chunkData;
    }```
orchid trout
#

should i push my project to github when i make small changes or should i do it at 3pm every day

north nova
#

uh oh

orchid trout
#

got it

echo basalt
dusky crane
orchid trout
#

ok

lunar wigeon
#

who cares about tests, if it works on your machine then push it

echo basalt
#

imagine testing your code lmfao

north nova
echo basalt
north nova
#

where do u see that

echo basalt
#

I hacked the matrix

orchid trout
north nova
#

omg

#

stop it

orchid trout
dusky crane
#

Any real solutions for fixing my problem?

lunar wigeon
#

debugging

dusky crane
#

After my generation stops the server is still frozen

north nova
#

have you tried figuring out why?

dusky crane
north nova
#

what did you try 🙂

dusky crane
#

I've found to slightly make it faster

north nova
#

in these past 5 hours

dusky crane
#

I've atleast found this optimizationjava // old: chunkData.setBlock(x, y, z, Material.STONE); chunkData.setRegion(0, y,0,15, y, 15, Material.STONE);

#

Or I hope it's an optimization

north nova
#

why are you trying to optimize code that does not work

#

what exactly are you optimizing if the code doesn't work

#

and you can't generate worlds in separate threads

#

u can load the chunks asynchronously, but you can't generate the world asynchronously

dusky crane
#

Can I generate chunks asynchronously?

north nova
#

how is that relevant if your code does not work?

dusky crane
north nova
#

have you tried seeing how long it takes ... ?

dusky crane
north nova
#

im so confused

#

how did you log it if the server freezes

dusky crane
#

The logging part doesn't freeze

#

The command part does

#

I can't join my server

#

Commands don't work

#

But logging works fine.

north nova
#

try removing the prints

#

x y z prints

dusky crane
#

Even without them it's the same issue

north nova
#

send your full code

dusky crane
north nova
#

unlucky

#

good luck then

dusky crane
#

I can remove spaces

north nova
#

?paste

undone axleBOT
dusky crane
north nova
#

send your full code

#

not just the chunk generator

dusky crane
timid hedge
#

Why does it say Cannot resolve constuctor ComponentBuilder() at ComponentBuilder builder = new ComponentBuilder(); and at .retain(ComponentBuilder.FormatRetention.NONE).append(Slag) at (Slag) it says append(java.lang.string() in net.md_5.bungee.api.chat.ComponentBuilder cannot be applied to net.md_5.bungee.api.chat.BaseComponent[]?

        ComponentBuilder builder = new ComponentBuilder();

        BaseComponent[] Slag = new ComponentBuilder("S")
                .bold(false)
                .color(ChatColor.GREEN)
                .event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "broadcast 1"))
                .event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Test - (1)").create()))
                .create();

        BaseComponent[] SlagVagt = new ComponentBuilder("SV")
                .bold(false)
                .color(ChatColor.GREEN)
                .event(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "broadcast 2"))
                .event(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Test - (2)").create()))
                .create();

        builder
                .retain(ComponentBuilder.FormatRetention.NONE).append(Slag)
                .append("§7, ")
                .retain(ComponentBuilder.FormatRetention.NONE).append(SlagVagt)
dusky crane
north nova
#

only the relevant code

dusky crane
# north nova only the relevant code

public void createArenaWorld(){
updateCounter();
Bukkit.createWorld(new WorldCreator("arena-"+worldCount).generator(new CustomChunkGenerator()));
Bukkit.getLogger().info("Generating world");

}
#

Also called in onEnable()

#

worldCount is an int

north nova
#

does it print generating world

eternal night
#

I mean, again, generating a world on the main thread is going to be a lot of work for the server.
If your server is not on the strongest hardware, it is going to take a while.
While generating the world, the main thread is blocked, preventing pretty much any meaningful interaction with the server.

#

A whole minute however is quite a while

eternal night
#

are you generating multiple ones ?

dusky crane
#

How many chunks does it generate?

north nova
#

can you surround the createWorld with try catch

#

and see if it logs any exception

dusky crane
#

or how many times does it call generateChunkData?

dusky crane
north nova
#

any

#

bro have u even looked at the definitions of the methods you're using

eternal night
#

Well, the default spawn area, iirc 10*10 chunks ?

dusky crane
north nova
#

🤦‍♂️

#

so what have u done these past 5 hours then

river oracle
#

tbf I don't download sources most of the time either lol I just use docs

north nova
#

key word use

eternal night
#

Yea but then you gotta trust spigot javadocs

buoyant viper
river oracle
buoyant viper
#

dont the bungee chat docs straight up not match up with the source

#

feel like ive had many issues specifically with the TextComponent class LOL

dusky crane
#

generateChunkData is called

#

Quite a lot.

eternal night
#

I mean, bungee is fucking rip iirc, it isn't delomboked

#

maybe that changed

river oracle
#

lombok is awesome 😈

north nova
#

it really is tho

dusky crane
north nova
#

SO true

dusky crane
#

If you're using Java17

river oracle
north nova
#

IT DOES!

#

lmao

ivory sleet
#

Lombok sucks then

chrome beacon
#

Lombok has more uses than record type classes

ivory sleet
#

I mean it already did but yeah

eternal night
#

@Delegate

buoyant viper
#

who needs lombok when u have a keyboard

eternal night
#

Truee

#

Free WPM trainer

north nova
#

why annotate a 15-field class with @builder when u can build the methods yourself

#

true

river oracle
#

I will say lombok is nice unlesss your doing open source stufff I feel like you should be extra clear about method definitions and such for open source projects

buoyant viper
#

just stop being lazy, write the boilerplate Blinker

eternal night
#

it works somewhat in internals I guess

#

jep the fucking bungeechat source jar is not delomboked

#

fml

ivory sleet
#

Lombok devs became creative tho, now its like annotations on annotations on annotations from what I heard

dusky crane
river oracle
#

I'm way to lazy to do that xD

eternal night
#

Before I commit a single thing to bungee KEKW

river oracle
#

plus like yk velocity exists

eternal night
#

yes

buoyant viper
river oracle
#

I don't work with proxies so I don't get the difference between bungee and velocity

dusky crane
# dusky crane No.

This only prints "Start of generation"

        updateCounter();
        Bukkit.getLogger().info("Start of generation");
        try {
            Bukkit.createWorld(new WorldCreator("arena-" + worldCount).generator(new CustomChunkGenerator()));
        }catch (Exception e){
            Bukkit.getLogger().severe(e.getMessage());
        }
        Bukkit.getLogger().info("Generating world");
}
#

The data and region folder are empty

#

Session.lock is 3 bytes and uid.dat 16 bytes

ivory sleet
#

@eternal night do u know why structured concurrency jep isnt shipped with virtual threads j21? Pretty sad its in preview still

eternal night
#

have not been in that mailing list for a while skully

sterile breach
cobalt thorn
#

Trying to remove duplicate lore but its not working (i cannot describe why but i know it doesn't work)

    private List<String> removeDuplicate(List<String>lorelist) {
        for (int i = 0; i < lorelist.size(); i++)
        {
            for (int j = i + 1; j < lorelist.size(); j++)
                if (lorelist.get(i).equals(lorelist.get(j)))
                {
                    lorelist.remove(j);
                    lorelist.remove(i);
                    j = j - 1;
                }
        }

        return lorelist;

    }

My lore is like

  • ChatColor.GRAY + "a"
  • ChatColor.Gray + "b"
  • Chatcolor.Gray + "a"

(the code needs only to delete the last in theory)

eternal night
#

they had some rather active changes in regards to naming and logic even. Even talks about exception handling in here, so yea. Understandable its in preview

eternal night
ivory sleet
eternal night
#
Why doesn't fork(...) return a Future?
When the StructuredTaskScope API was incubating, the fork(...) method returned a Future. This provided a sense of familiarity, by making fork(...) resemble the existing ExecutorService::submit method. However, given that StructuredTaskScope is intended to be used differently from ExecutorService — in a structured way, as described above — the use of Future brought more confusion than clarity.
ivory sleet
#

Oo

#

Yeah fairs

eternal night
#

Can only suggest subscribing to the mailing lists 😏

#

you can get like, a daily little mail

ivory sleet
#

I def should

#

Where do I do that 😅

eternal night
#

just make sure to recieve list mailing batched in a daily digest

#

or make a custom mail just for that KEKW

opaque scarab
wooden hedge
#

hello

#

i tried usin javalin library

#

it works and all

#

even after reloading

opaque scarab
wooden hedge
#

but

#

when i hotswap it and reload

#

javalin throws alot of errors

#

why is that?

#

the code works and all

#

but when i hotswap, it just loses its mind

opaque scarab
cobalt thorn
vital sandal
#

how can I convert between these net.minecraft.advancements.Advancement from org.bukkit.advancement.Advancement

chrome beacon
#

See if there's a get handle in CraftAdvancement

opaque scarab
#

^

opaque scarab
cobalt thorn
burnt current
#

hi im very new to plugin development, i know a bit of java but not enough.

how do i import dependancies i want to use? like bukkit packages, packages that have githubs, etc?

#

i could use like, a quick rundown of pom.xml, all ive been able to do so far is import spigot stuff

chrome beacon
#

There are plenty of maven tutorials online

#

If there's anything specific you don't understand then feel free to ask here

cunning osprey
#

Can smbdy help i dont get the wand when i execute the command in game


import org.sveaty.techno.ITEMS.TutoralEvents;
import org.bukkit.inventory.ItemStack;
import org.bukkit.entity.Player;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.CommandExecutor;

public class WandCommand implements CommandExecutor
{
    public boolean onCommand(final CommandSender sender, final Command command, final String s, final String[] strings) {
        if (!(sender instanceof Player)) {
            sender.sendMessage("Only players can run this command");
            return true;
        }
        final Player player = (Player)sender;
        if (command.getName().equalsIgnoreCase("givewand")) {
            player.getInventory().addItem(new ItemStack[] { TutoralEvents.wand });
        }
        return true;
    }
}```
chrome beacon
#

There's no need to create an array like that

#

Also show your wand itemstack

#

also did you register the command correctly

cunning osprey
# chrome beacon also did you register the command correctly

I did in plugin.yml


import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.enchantments.Enchantment;
import java.util.List;
import java.util.ArrayList;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;

public class TutoralEvents
{
    public static ItemStack wand;
    
    public static void init() {
        createWand();
    }
    
    private static void createWand() {
        final ItemStack item = new ItemStack(Material.STICK, 1);
        final ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(ChatColor.GOLD + "Explosion Wand");
        final List<String> lore = new ArrayList<String>();
        lore.add(ChatColor.RED + "This Wand is to powerful...");
        meta.setLore((List)lore);
        meta.addEnchant(Enchantment.LUCK, 1, false);
        meta.addItemFlags(new ItemFlag[] { ItemFlag.HIDE_ENCHANTS });
        item.setItemMeta(meta);
        TutoralEvents.wand = item;
    }
}```
near mason
vital sandal
#

what does that field String refer to?

cunning osprey
# near mason did you run TutoralEvents.init() in main class or smthing?

Here is my main class


import org.bukkit.plugin.Plugin;
import org.bukkit.event.Listener;
import org.sveaty.techno.listener.even;
import org.bukkit.command.CommandExecutor;
import org.sveaty.techno.commands.WandCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class Techno extends JavaPlugin
{
    public void onEnable() {
        this.getCommand("explosion").setExecutor((CommandExecutor)new WandCommand());
        this.getServer().getPluginManager().registerEvents((Listener)new even(), (Plugin)this);
    }
    
    public void onDisable() {
    }
}```
#

And no i didnt

near mason
chrome beacon
#

Then that would be the problem

near mason
#

yes

chrome beacon
#

If the init method isn't called wand will be null

near mason
#

wdym?

chrome beacon
#

?

near mason
chrome beacon
#

oh I didn't see the typo

cunning osprey
#

Also one more thing do i need to add ItemManager... or it got removed in older versions as im learning from old tutorials

wooden hedge
quaint mantle
#

Is this a place to get help with making plugins?

quaint mantle
#

Oh

#

I have no idea how to make one

#

I have watched at least 10 tutorials and I am still confused

cunning osprey
quaint mantle
#

my plan is to make a plugin where everybody spawns in with a random positive effect and every time you kill them your effect upgrades by one

#

I also want every time a player kills you your effect gets subtracted by one.

#

can somebody help me with that

north nova
#

sure why not have somebody write it for u even

cunning osprey
opaque scarab
north nova
#

bro wdym

#

ill pay him and make him the plugin

#

thats how things go around here

cunning osprey
quaint mantle
#

no pay really

north nova
#

yeah

quaint mantle
#

and you don't need to pay me

north nova
#

no man i will

#

and ill write the plugin

opaque scarab
#

north nova
#

we'll all pay u

cunning osprey
#

...

quaint mantle
#

no need

north nova
#

so humble 💯

opaque scarab
#

💀

quaint mantle
#

can you make it for real

cunning osprey
# north nova so humble 💯

Also one more thing do i need to add ItemManager... or it got removed in older versions as im learning from old tutorials

Can you atlest answer my question

north nova
#

i wasnt talking to u

#

whats is the problem ur facing*

cunning osprey
north nova
cunning osprey
#

I just wanted to ask you taht question

cunning osprey
#

So dont talk about it

north nova
#

💀

cunning osprey
north nova
#

theres no fucking way u call yourself "prof skript dev"

#

there is just no way

#

you're joking right

quaint mantle
#

does anybody here know how to make a plugin?

cunning osprey
#

Im an avrage skript dev taht is having over 30+ costumers rn

north nova
cunning osprey
#

And im done with skript

north nova
#

@quaint mantle

north nova
quaint mantle
cunning osprey
#

Thats why im switiching

#

Im done with skript

opaque scarab
north nova
opaque scarab
north nova
#

fair enough i guess

north nova
#

maybe i should start being more friendly

eternal night
north nova
quaint mantle
#

If I'm struggling can I get help?

opaque scarab
#

But know the basics first

quaint mantle
#

ok

#

can somebody send me the download page it would not let me install it before

tender shard
#

download page for what

quaint mantle
#

the plugin creation thing

north nova
#

oh the plugin creation thing

north nova
#

.......

quaint mantle
#

ok thanks

vital sandal
#

for some reason weird things happened