#help-development

1 messages ยท Page 2194 of 1

tender shard
#

that looks good, it should work fine now

#

np

#

you could also listen to BlockPhysicsEvent and cancel it everytime

#

but if you can just use farmland, you should rather do that ๐Ÿ˜„

ivory sleet
#

register an event executor

#

@vale ember

tepid ore
#

It does not work btw lol :>

vale ember
knotty meteor
dry forum
#

how can i make a firework explode as soon as its summoned meta.setPower(0); wont work the firework still flys for about a second

tender shard
# tepid ore It does not work btw lol :>

hm then I also don't know. it looks like it's shading properly. are you sure you're using the "shaded" .jar and not the original one? if you have more than one .jar in the target folder, use the one with the largest file isze

tender shard
ivory sleet
#

Just implement it in a class that also implements the Listener (and delegate)

tepid ore
ivory sleet
#

and then check for it in the event executor

tender shard
tepid ore
#

Warnings, my bad

tender shard
#

those shouldn't do anything bad though

#

hm but it's weird. ยดwhat class exactly is missing?

tardy delta
#

fun call

quaint mantle
#

guys I need help

tender shard
#

we discuss the important things

tender shard
#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

tender shard
#

here's help

tardy delta
#

so there are no important things

#

๐Ÿ˜ข

quaint mantle
#

so I made a protection enchant (diff from vanilla) but after a certain point it does not even add the defense

#

like it lets me add it on the armor

tepid ore
tender shard
#

oooh

#

I see

#

the problem is that you are shading apache commons twice for some reason

quaint mantle
#

anyone can help pls?

tender shard
#

and you are using a newer version than the shaded version

tepid ore
#

Ohhh...

tender shard
#

you can try to relocate apache commons

ivory sleet
#

interface EventExecutorListener<E Event> extends Listener,Consumer<E>{
static <E Event> void register(Plugin plugin, Class<E> eventType, EventExecutorListener<E> callback){
plugin.getServer().getPluginManager().registerEvent(eventType,callback,normal,(event,listener) -> callback.accept((E) event),plugin);
}
}

@vale ember

tender shard
#

since IIRC spigot includes an old verison of it too

ivory sleet
#

Or sth

tepid ore
#

Sorry, maven newbie

tender shard
#

Add this inside your maven shade plugin's <configuration>:

                    <relocations>
                        <relocation>
                            <pattern>de.jeff_media.jefflib</pattern>
                            <shadedPattern>com.jeff_media.stackresize.libraries.com.jeff_media.jefflib</shadedPattern>
                        </relocation>
                      </relocations>
#

and replace the pattern with the apache commons package and the shadedPattern witrh something inside your package

tardy delta
#

smh why am i on windows

tender shard
tardy delta
#

i hate school

#

they dont even think of linux users

tender shard
tepid ore
tender shard
#

if your main class is called me.sniskus.someplugin.Main, then I'd use "me.sniskus.someplugin.libraries.commons" or sth

#

btw sniskus is a funny name lol

#

I do it like this most of the time

knotty meteor
#

How can i cancel seeds automaticly being broken with BlockPhysicsEvent?
Because i want it to be grown on another block then farmland, but it breaks itself every time after a few seconds

tepid ore
tender shard
knotty meteor
#

Thank you so much! I will try that :D

tender shard
#

I mean wtf ๐Ÿ˜„

#

do Ctrl+Alt+L pls ๐Ÿ˜„

tepid ore
#

I know lol, it looks fine in the IDE lol.

tender shard
#

oh wait you're on exlipse

tepid ore
#

Yeah lol

tender shard
#

weird lol

tepid ore
#

Mhm

tender shard
#

yeah anyway that looks good to me

#

it's probably fucked on the paste site because you mixed tabs and spaces

tepid ore
#

That seems like a logical explanation yes. I usually tab stuff, but sometimes it gets wonky so I just move them with spaces :>

#

Also

#

Umm

#

Still

#

It does not work

#

๐Ÿ˜ 

tender shard
#

huh

tepid ore
#

Stupid maven

#

What am I doing wrong

tender shard
#

does the error message now at least mention the "relocated" class name?

tepid ore
#

Ree

knotty meteor
#
    @EventHandler
    public void blockPhysics(BlockPhysicsEvent e) {
        if (e.getBlock().getType() == Material.CROPS) {
            if (e.getChangedType() == Material.AIR) {
                e.setCancelled(true);
            }
        }
        if (e.getBlock().getType() == Material.POTATO) {
            if (e.getChangedType() == Material.AIR) {
                e.setCancelled(true);
            }
        }
    }```
This is my code and it still drops the seeds
tepid ore
#

That is the stack trace

tender shard
knotty meteor
#

I also use crops for the placing of the seed so it should works

tender shard
tender shard
#

are you using legacy materials?

#

did you set "api-version" in your plugin.yml?

knotty meteor
#

I didnt set an api version because im on 1.12.2

tender shard
#

aah okay

#

yeah that makes sense then lol

iron glade
#

Guys are there any free economy plugins for 1.18+? I'm currently using gringotts and it's spamming my console like hell

tender shard
#

hm cancelling the event should work though

tender shard
quaint mantle
#

royale economy

#

๐Ÿ‘

#

not free

#

but goog

tepid ore
#

Idk if you missed it, I'm not trying to be annoying, but here is the stack trace I get: https://paste.md-5.net/kaceqogigi.cs. Also, ignore the plugin name lol, the client I am developing it for requested that name :>

#

mfnalex

quaint mantle
#

Sniskyks

#

core

tepid ore
#

Yes

#

They wanted that name lol

#

:>

quaint mantle
#

change mvn:commons-io:commons-io:2.5

#

whats the dependency version thing

#

for commona

#

commons

#

I hope im doing this right

tender shard
tepid ore
#

Oh, well you tried. Thank you so much!

quaint mantle
knotty gale
#

can someone help me with finding an event for if a target is activated (shot)

dry forum
#

what type of runnable would i use to run something every x seconds

tardy delta
#

#runTaskTimer

#

?scheduling

undone axleBOT
knotty meteor
#
    @EventHandler
    public void blockPhysics(BlockPhysicsEvent e) {
        if (e.getBlock().getType() == Material.CROPS) {
            e.setCancelled(true);
        }
        if (e.getBlock().getType() == Material.POTATO) {
            e.setCancelled(true);
        }
    }```
I fixed it! Just removed the check for getChangedType
Thank you so much mfnalex for your help! :D
knotty meteor
tender shard
#

normally the changed type should have been air

crimson terrace
#

ProjectileHitEvent?

tender shard
#

I wonder what it actually was

#

but glad that it's working now ๐Ÿ˜„

crimson terrace
#

and then check if the hit block was a button @knotty gale

knotty gale
knotty meteor
#

Yep they now dont break anymore but they also dont grow haha

quaint mantle
#

anyone doing anticheat developing thing idk?

tender shard
#

as said, maybe just print out all the fields of the event to see what's going on

quaint mantle
#

anyone?

#

wait im the wrong channel

knotty meteor
#

Yes im going to try that now

crimson terrace
knotty gale
#

u know what the target block is?

crimson terrace
knotty gale
#

I wanna check if arrow hits that

crimson terrace
#

compare the blocks or their locations

knotty gale
#

oh

#

that is a good idea

knotty meteor
#

I dont get it
The seed does break with this

        if (e.getBlock().getType() == Material.CROPS && e.getChangedType() == Material.AIR) {
            e.setCancelled(true);
        }```
But it doesnt break with this
```java
        if (e.getBlock().getType() == Material.CROPS) {
            e.setCancelled(true);
        }

But then it also doesnt grow

granite owl
#
Caused by: java.lang.NoSuchMethodError: 'void main.Callbacks.onInventoryCloseTransmuteSmithing
```im using my method for quite a while and idk what could cause that? happend during reloads
#

affected method:

#
    public static void onInventoryCloseTransmuteSmithing(InventoryCloseEvent event)
    {
        if (event.getInventory().getType() == InventoryType.ANVIL)
        {
            if (event.getInventory().getItem(1) != null)
            {
                ItemWrapper item = new ItemWrapper(event.getInventory().getItem(1), null);
                
                if (!item.getOriginalMaterial().equals(""))
                {
                    item.getItemStack().setType(Material.valueOf(item.getOriginalMaterial().toUpperCase()));
                    event.getInventory().setItem(1, item.getItemStack());
                }
            }
        }
    }
#

any idea?

#

cause its like months ago i wrote that and it happend once within months

#

did i forget a null check?

quaint mantle
#

?paste

undone axleBOT
tardy delta
#

when are you learning to use early returns

granite owl
subtle folio
#

donโ€™t name packages main

granite owl
#

ok

chrome beacon
#

?main and this

chrome beacon
#
  • UpperCamelCase class names
dry forum
#

how do i cancel a bukkitscheduler .cancel() doesnt work it has an integer? and theres no method to get the id of the scheduler

granite owl
#

i guess ill just trial and error the problem

chrome beacon
dry forum
#

so i need to save the id?

chrome beacon
dry forum
#

also how do i get the id

tender shard
chrome beacon
#

?scheduling

undone axleBOT
dry forum
#

yes.. ive read that

tardy delta
#

or you just cancel it within the lambda

tender shard
#

nothing wrong in naming the main class Main. It doesn't have any disadvantage

dry forum
#

nothing is there on how to cancle it

#

i need to cancel it 10 seconds later

chrome beacon
dry forum
#

i have

granite owl
tardy delta
#
scheduler.runTask(plugin, task -> {
  if (true) {
    task.cancel();
    return;
  }
  // do your stuff
})```
chrome beacon
granite owl
#

its hard

#

cause the error did occur at 17:01:21

#

and ive issued the command /rl

#

at 17:01:22

#

sooo

chrome beacon
#

Sounds like that was the cause then

granite owl
#

but i doubt im fast enough to reload

#

at the same time as the file is being written

chrome beacon
#

That doesn't have to be the cause

#

Anyways just restart and you'll avoid random issues

granite owl
#

well in this case ill just ignore the issue for now since it never happend on the live server in months

#

but if it happens again ill check deeper

split smelt
#

I want to create a plugin whit a list in a custum .yml file of strings. I want that a admin can change the messages in the list by a command. I can read from the list that works fine. But now I want to write to it the tutorial that I was folowing stoped. I have tried get information form mulipel internet resourses but I can not get it working. I have tried to get it working: CustomConfig.get().getStringList("the name of the list").add(The word that must be added); Then I have tried to save it and reload it: Customconfig.save(); and customconfig.reload(); Does anywone know how to write to a yml file?

tardy delta
#

you have to re set it

tender shard
granite owl
#

and also, java itself is also using the main function as entry point by default

tardy delta
#

var a = getStingList(); a.add(); setStringlist(a)

tender shard
#

the whole forums post ranting about how someone has the opinion that you'll go to hell if you name sth "Main" is upper bullshit at best imho

granite owl
#

xD

#

same goes for how u set the scopes

#
int foo{
  ...
}

int foo
{
  ...
}
```all the same XD
chrome beacon
#

Main is more an issue when you have 50 different Main classes

granite owl
#

like 10 classes main

#

u call the main entry point main

#

not everything

chrome beacon
#

Yeah but multiple plugins

granite owl
#

so?

#

i have main in multiple plugins

#

so?

#

theyre still seperated by namespaces

chrome beacon
#

Yeah still messier than just naming the main class to something else

worldly ingot
granite owl
worldly ingot
#

Or, you know, your plugin's name

#

So it's unique. Not to mention that your plugin's class isn't actually the entry point

#

The server's Main class is

granite owl
#

and its merely being loaded by a classloader and its events hooked into the servers callbacks

#

i know

tender shard
#

am I missing sth?

dry forum
#

how do i spawn a single particle this .spawnParticle(Particle.FIREWORKS_SPARK, as.getLocation(), 1); makes the particles fly around everywhere even though i didnt add an offset

split smelt
granite owl
#

in the end bukkits plugin programming has little to do with "normal" application programming

#

the plugins are more like dlls

#

than executables

#

xD

chrome beacon
#

Add your thing to the list then set the list

tender shard
#

because for this interfaces exist

urban kernel
#

how would i use Bukkit.broadcastmessage om >1 args

dense geyser
#

wym

urban kernel
#

how would i broadcast several args

dense geyser
#

Bukkit.broadcastMessage(Joiner.on(" ").join(args));

#

assuming args is a list or array

urban kernel
#

args is whatever /command a b is

dense geyser
#

yeah, that would do it

split smelt
chrome beacon
#

You can call it anywhere after you added your string to the list

split smelt
chrome beacon
#

It's the list you want in the config

split smelt
#

So I can create a list. Add the things that I want in the config and than call the method addStringList(path, list) and than it wil work? If I typ the addStringList in the class that I am in working it turns red.

urban kernel
#

with joiner being smth from goodle>?

dense geyser
#

yep

urban kernel
#

ok

knotty meteor
#
    @EventHandler
    public void blockPhysics(BlockPhysicsEvent e) {
        if (e.getBlock().getType() == Material.CROPS) {
            e.setCancelled(true);
        }
        if (e.getBlock().getType() == Material.POTATO) {
            e.setCancelled(true);
        }
    }```
Now my seeds wont break itself on top of another block, but they also dont grow anymore, someone know how i can fix that?
Im on 1.12.2 btw thats why i use crops instead of wheat
worldly ingot
#

Why is it you're cancelling physics, exactly?

knotty meteor
#

Because i want my seeds to grow on top of another block, and with physics it breaks itself after a few seconds

tardy delta
#

vscode bruh

round elbow
#

how can I create a clickable message that makes the player execute a command on click?
here is my code but it doesnt seem to work properly
it shows the message but when i click nothing happens

                TextComponent text = new TextComponent("&7[&eClick here to show reports GUI&7]");
                text.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("").create()));
                text.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/playerReports"));

                MinilofeReportsPlugin.sendPlayerMessage(player, text.getText());
    public static void sendPlayerMessage(CommandSender sender, String message) {
        sender.sendMessage(ChatColor.translateAlternateColorCodes('&', "&8[&cMinilofeReports&8] &7" + message));
    }
#

note: this plugin is in spigot 1.8.8

chrome beacon
#

You're converting it back to a string removing all hover and click actions

#

Use player.spigot().sendMessage()

round elbow
dense geyser
#

when I was learning spigot, I was learning on a server where it seemed the jar they used, had all of the NMS classes variables public instead of private, does anyone know how to replicate this?

round elbow
#

bruh i cant send a picture

#

of the screenshot

#

i took

chrome beacon
#

Don't call toString on it

dense geyser
#

player.spigot().sendMessage(text)

round elbow
#

okay

chrome beacon
#

^^

round elbow
#

what if i want to send it with text

chrome beacon
round elbow
#

like this is the message i want to send + [clickable part]

chrome beacon
#

You just combine multiple TextComponents

round elbow
#

okeh

urban kernel
#

how do i stop ConsoleSrnder using commands which have player in them

dense geyser
#

not all the NMS classes are in the spigot repo though, should I just copy them from minecraft-server?

chrome beacon
dense geyser
#

buildtools didnt copy the entire class

knotty gale
#

so I am using an argument to set a global variable to a player using

if(Bukkit.getPlayer(args[0]) != null) {
``` but now how would I set the variable
dense geyser
#

when I control click them, it sends me to an uneditable minecraft-server repo that spigot shades

chrome beacon
#

Oh and you will need your modified jar to be on the server for your plugin to work

compact haven
#

Build Tools does in fact decompile the entire server

knotty gale
#

using something like ```java
(variabel) = (player)

compact haven
#

Thatโ€™s how patches are applied and then recompiled to the spigot jar

dense geyser
#

it didn't when I tried, ive got most of the packets missing

#

is there a way to fix it?

#

without deleting the entire thing

compact haven
#

If you want to make a patch that changes the accessibility of every NMS field, method, and class to public, itโ€™s completely possible

tardy delta
#

?learnjava lol

undone axleBOT
compact haven
#

honestly should just make the API patches you need and upstream that tho

dense geyser
#

yeah, but how do I resolve the issue of missing classes

urban kernel
#

how do i stop console from using my commands

#

as they throw an error

dense geyser
#

should I just copy them from minecraft-server

chrome beacon
chrome beacon
#

Use instanceof

urban kernel
#
if (sender.getName().toLowerCase() == "console") {
// no oi bad
return false;
}
#

?

round elbow
# chrome beacon You just combine multiple TextComponents
                TextComponent text = new TextComponent(ChatColor.translateAlternateColorCodes('&', "&7[&eClick here to show reports GUI&7]"));
                text.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("").create()));
                text.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/playerReports"));

                player.spigot().sendMessage(new TextComponent(ChatColor.translateAlternateColorCodes('&', "&8[&cMinilofeReports&8] &c" + reported.getName() + " &7was reported by &e" + reporter.getName() + " &7for &a" + reportReason + " " )  + text));
chrome beacon
#

sender instanceof ConsoleSender

urban kernel
#
if (sender instanceof ConsoleSender) {
return false;
}
#

would that work

chrome beacon
tardy delta
#

im wondering how to fix this stupid thing?

dense geyser
urban kernel
#
if (sender instanceof ConsoleSender) {
return false;
}

this?

compact haven
#

I mean you donโ€™t even need to make a patch

tardy delta
#

that will tell if its the console who executes

compact haven
#

You can literally copy the class content & change the visibility with the ASM library

#

probably easier than manually setting things to public

urban kernel
dense geyser
#

yes, but can I copy the missing NMS classes from minecraft-server to that package?

urban kernel
#

because i use playerentity

dense geyser
#

since buildtools didnt create them

tardy delta
compact haven
#

I can write you a quick Java executable to public everything in a jar when I get home if you want

round elbow
#

thank you

chrome beacon
#

Accesstranformers from Forge and Accesswideners from Fabric. They are quite neat

quaint mantle
#

how do i set t he default value of a database

dense geyser
#

its alright, I can do that, I just need to know its safe to copy/paste classes from minecraft-server into that jar and have them still work since buildtools didnt create them

compact haven
#

I guess, lol? I donโ€™t know BuildTools in larticular

dense geyser
#

alr

urban kernel
dense geyser
#

Ill try it first

compact haven
#

try it, yeah

dense geyser
#

whats an easy packet to send lmao

compact haven
#

out chat maybe?

chrome beacon
#

So why do you need all fields to be public? @dense geyser

tardy delta
#

i tried to beat java but nah

chrome beacon
#

I mean they're usually not public for a reason

dense geyser
compact haven
dense geyser
#

yeah, but stupid reasons usually

urban kernel
#

would this stop a n err

            sender.sendMessage(ChatColor.RED + "Ea");
            return true;
        ```
compact haven
#

though really you should just improve the API instead

urban kernel
#

with } oc

#

ofv

#

ofc

chrome beacon
urban kernel
#

why cant i type

compact haven
#

Visibility is in Java for a reason

tender shard
tardy delta
#

i hate enums from now on

tender shard
#

get a new keyboard that's not drunk

tender shard
#

are you abusing them again?

tardy delta
#

yes

tender shard
#

oh then I ca nunderstand the hate

tardy delta
tender shard
#

do not abuse enums and then you will love them :3

tardy delta
#

doesnt work either cuz values() is null grr

tender shard
# tardy delta

yeah you are doing this "cycling dependency" thing again

#

that can't possibly work

urban kernel
tardy delta
#

any way i can abuse that?

humble tulip
#

?paste

undone axleBOT
compact haven
#

you canโ€™t

#

Thatโ€™s not how it works lol

tardy delta
#

or maybe just storing a string instead of a gamemove and converting it when i actually need it

tender shard
tardy delta
#

lets go performance

urban kernel
#

okie

tender shard
urban kernel
tender shard
tardy delta
#

mye it works

chrome beacon
humble tulip
compact haven
#

Why donโ€™t you just have a map of game mode to game mode of winFrom lol

urban kernel
tardy delta
chrome beacon
#

It's really that simple

compact haven
#

Or a simple .winsFrom() method which uses a switch internally

humble tulip
#

made a util to get and set skull textures, I'm not accustomed working with reflection so i wanna know if it's good enf?

compact haven
#

I mean itโ€™s not the best but thatโ€™s how itโ€™s done

cinder river
#

guys is it possible to get plugins into a singleplayer world?

#

voor spigot

tender shard
# tardy delta mye it works
public enum RPS {
    ROCK, PAPER, SCISSOR;
    
    public boolean beats(RPS other) {
        switch (this) {
            case ROCK:
                return other == SCISSOR;
            case PAPER:
                return other == ROCK;
            case SCISSOR:
                return other == PAPER;
        }
        throw new IllegalArgumentException();
    }
}

cinder river
#

from*

compact haven
#

exactly that

tender shard
#

or paper

#

or whatever

chrome beacon
tardy delta
#

mmh thats something too but i just tried to avoid a switch ๐Ÿ˜…

chrome beacon
tardy delta
#

lets use java16 switch kekw

humble tulip
#

why you trying to avoid a switch?

tender shard
#

so PAPER would have to created while creating SCISSOR which won't work because SCISSOR will refer to ROCK and ROCK refers to PAPER again

#

or whatever

#

you know what I mean

urban kernel
#

can anyone help me test

crude estuary
#

But Spigot Wets the Paper

urban kernel
#

i cant open mc it lags too much

humble tulip
#

paper creates scissors which creates rock which referers to paper?

tender shard
cinder river
humble tulip
#

ah ok

humble tulip
#

yeah paper wont be fully initialized

chrome beacon
humble tulip
tardy delta
#

i love those switches but rust is even better

tender shard
humble tulip
#

it works but i'm not used to using reflection normally

tender shard
humble tulip
#

just wanna know if i did anything stupid

tall dragon
#

?paste

undone axleBOT
tender shard
humble tulip
#

older v support D:

tender shard
#

yeah then it's fine

tall dragon
#

https://paste.md-5.net/medeneqoju.java would anyone know why this does not work? im not that familliar with Adventure
tryna send a message looking like this "<color:#737373>Primary Point set to <color:#113aab>{location}</color></color>"

tender shard
tall dragon
#

its just not sending it.

tender shard
#

what method do you call to send it?

humble tulip
#

isnt it "bad" to get the field every time?

#

i saw ppl on forums said to cache the field

tall dragon
#
public static void tell(CommandSender sender, Component... messages) {
        Audience audience = toAudience(sender);

        for (Component message : messages) {
            audience.sendMessage(message);
        }
    }

this one

tender shard
#

that could be improved

tender shard
#

let me check my message api's code

tall dragon
#

what the heck then

compact haven
#

What you have looks good, maybe fry MiniMessage.get() or whatever it is?

#

Add a debug and ensure thatโ€™s being called

tardy delta
#

seems to work uwu

compact haven
#

And also print out the component

tender shard
compact haven
#

LOL

#

@young vine wonโ€™t even know, he could be drinking right now

#

anyways I meant get() or whatever the default MiniMessage instance is

tender shard
#

minidigger once told me I got issues because I sent a pic of me having 0.69โ€ฐ BAC but in his bio he says that he himself is probably drunk right now, soooooooooo I guess he has issues too

young vine
tall dragon
#

nvm

#

turns out im just stupid

young vine
brittle lily
#

Ah really?

lost matrix
#

*probably

brittle lily
#

nope its correct

#

probably its about version of java

#

spigot*

lost matrix
#

Forget all the time that people still use outdated versions for some reason

brittle lily
#

Is it always better to use the latest version?

dry forum
#

why does this not work it makes 0 sense ArrayList<Particle> particles = new ArrayList<>(Arrays.asList(Particle.values())); if (!particles.contains("FIREWORKS_SPARK")) { Bukkit.broadcastMessage("why does this not work"); } its broadcasting why does this not work but FIREWORKS_SPARK is a particle

lost matrix
lost matrix
dry forum
#

.values()

#

is string

brittle lily
dry forum
#

nvm\

#

read it wrong

tardy delta
#

why not just streaming the values and checking for none match

lost matrix
#

Performance

#

Why not use an EnumSet for contains?

dry forum
tender shard
lost matrix
lost matrix
dry forum
#

particle is configurable in config

tender shard
lost matrix
#

The rest wont be data driven in the forseeable future

tardy delta
#

oh god

tall dragon
lost matrix
#

Oh really. I missed that.

tall dragon
#

hence the error

tender shard
#

but not sure about which exactly he meant

dry forum
tall dragon
#

yea. but that will still throw an error

tender shard
#

everything that's "Keyed". no idea whether particles are keyed

dry forum
#

but why if it doesnt exist it should broadcast the messgae

#

because FIREWORK is not in the arraylist which is the particle enum

brittle lily
#

When I create a high version server, my computer gets very hot, does anyone have any advice?

lost matrix
#
        ArrayList<Particle> particles = new ArrayList<>(Arrays.asList(Particle.values()));
        if (!particles.contains(Particle.FIREWORKS_SPARK) {
            Bukkit.broadcastMessage("particle does exist");
        }
dry forum
tender shard
dry forum
#

its configurable

lost matrix
clever musk
#

1.16.3 is 1_16_R2 right?

dry forum
#

just check if a particle exists or not

tender shard
lost matrix
#

So you want to check if a specific String is mappable to a Particle?

dry forum
#

but the particle needs to be a string since its configurable

#

yes

tender shard
humble tulip
#

is it safe to create and modify itemstacks async?

#

and maybe even create an inventory and populate it async?

tender shard
#

no but it would probably work

#

I wouldn't call it "safe" though

humble tulip
#

No player would have access to it

#

it's kinda just initialzing it

hybrid spoke
#

it would work

lost matrix
# dry forum yes
    fun toParticleOrElse(input: String, defaultParticle: Particle = Particle.FLAME): Particle {
        return try {
            Particle.valueOf(input)
        } catch (exception: Exception) {
            defaultParticle
        }
    }

Do something like this

tardy delta
#

why would you

hybrid spoke
#

"safe" depends on the usecase

tardy delta
#

return try aaa

hybrid spoke
#

but there is no reason to create itemstacks async

tardy delta
#

wait kotlin

hybrid spoke
#

neither inventories

tardy delta
#

i think it works in java too

dry forum
#

uh alright ill try it ty

brittle lily
#

Which Spigot Version Are You Guys Using?

eternal night
#

latest

tardy delta
#

1.17.1 ๐Ÿฅบ

lost matrix
#

I mean ik kt you can also

    fun toParticleOrElse(input: String, defaultParticle: Particle = Particle.FLAME): Particle {
        return runCatching { Particle.valueOf(input) }.getOrElse { defaultParticle }
    }
brittle lily
eternal night
#

if you can you should always use latest

tardy delta
#

isnt it true that older versions always consume more memory?

eternal night
tardy delta
#

server jar then i mean

tender shard
tardy delta
#

or you guys were talking about api version?

tender shard
eternal night
#

in general, newer versions tend to consumer more memory as chunks grew etc

tender shard
#

which makes sense because they also have more features

brittle lily
#

But like to said When I try to use 1.16+ version my laptop getting hotter.

humble tulip
#

wait i do create itemstacks async in my plugin where i store inventories as a byte[] converted to base 64

#

and it works

tender shard
lost matrix
brittle lily
tardy delta
#

๐Ÿ˜…

tender shard
tardy delta
#

i dont need the features as im just testing stuff so im staying at this version x)

brittle lily
#

thanks guys I will try somethng

crisp steeple
#

why is try catch an expression but not variable assignment

#

thats the one thing i prefer java over kotlin for

undone crescent
#

Hello!
Looking at the compilation and build of Spigot core, I began to question the need for mappings from Spigot, because Mojang already provide them themselves. After checking the Spigot mappings and Mojang mappings I noticed that the Spigot elements are mostly just renamed, but what prevents you from using the Mojang names, why do you need your own mappings?

tender shard
brittle lily
#

BT?

undone axleBOT
tardy delta
#

?bt

undone axleBOT
tardy delta
#

omg

crisp steeple
#

but not kotlin

brittle lily
#

oh thanks

tender shard
eternal night
#

๐Ÿ‘€

tardy delta
#

reject kotlin switch to rust

tender shard
#

the only thing that's useful in kotlin is the ? operator

eternal night
#

rust is just a big pile of shit pretending to be better than cpp while it actually doesn#t add anything useful Kapp

tardy delta
#

rust is nullsafe brr

crisp steeple
tender shard
#

I had to deal with kotlin way too many times writing android apps and everytime I have to use it I want to kill myself

tardy delta
#

๐Ÿ˜…

tender shard
humble tulip
tardy delta
#

let variable = "sus"

lost matrix
#

And elvis aka :?

crisp steeple
#

i personally wouldnt use kotlin for something such as making a server, but for something like modding where it doesnt need to be as strucutred its good for efficiently making features

crisp steeple
tardy delta
#

thats just for println!({:?}, variable)

undone crescent
# tender shard I also wondered about this

I'm thinking of removing this and refactoring the patches in the fork, as much as the license allows.
Waiting for the mapping to be provided at least for RC1 is already unbearable.
Is it worth doing?

tender shard
tardy delta
#

let variable: &str = "sus"

lost matrix
#

Oh and safe cast is nice: as?

crisp steeple
#

i seriously cant believe people use var and val in java

tender shard
tardy delta
#

oh i didnt know about as?

tender shard
tardy delta
#

i love the rust enums

crisp steeple
#

you see python is much better than java because you dont have to type as much stuff out

tardy delta
#

for things that java cant do

lost matrix
#

For example this saves me some lines of instance checking and casting

    @EventHandler
    fun onAdd(event: EntityAddToWorldEvent) {
        (event.entity as? LivingEntity)?.let(mobLimitationListener::registerMobAppearance)
    }
tender shard
undone crescent
crisp steeple
#

extension functions in kotlin are neat

tardy delta
#

rust enums constants need to be constructed and they can have different numbers of params

tender shard
humble tulip
#

does anyone have a "placeholder item" class, basically a class that can take in itemstacks with placeholder values in the name and lore and return an item with replaced placeholders?

lost matrix
tardy delta
#
enum Sus {
  Sus,
  VerySus(level: u32),
  Broke(yes: bool),
}``` doesnt make any sense but ye
humble tulip
tardy delta
#

let sus_level = Sus::VerySus(32)

tender shard
tardy delta
#

anyways lets stop talking bout rust

tender shard
humble tulip
tardy delta
#

nah imajin will

lost matrix
tender shard
tardy delta
#

conclure is a good boy

tender shard
#

I always confuse them because they have the same color

tardy delta
#

๐Ÿ˜…

humble tulip
tender shard
#

okay so reminder to myself:
conclure is the dude who banned me
imajin is the dude who always mentions rust
adelemphii is the person who had birthday recently
optic fusion is the dude who kicks everyone not using english

lost matrix
humble tulip
#

cloning and modifying the stack every time feels hacky

#

well not hacky

#

but inefficeint

lost matrix
tender shard
humble tulip
#

i may have to do this a few hundred times in a tick, every time a player joins

lost matrix
#

For me its #3 now

tardy delta
chrome beacon
#

They both mention rust quite a bit

humble tulip
#

to create inventories for their menu

quaint mantle
#

guys pls help me with database

tardy delta
#

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

humble tulip
#

i'd rather create the inventories once than create it every time it's opened since it may be opened alot by every player

tardy delta
#

my screen is soo small that it looks like spamming when i do the ?ask

#

well 13 inch but still

quaint mantle
#

how do i make a database and connect to it from my spigot plugin

humble tulip
#

?database

#

ah that needs to be a command

chrome beacon
#

?db

humble tulip
#

just google it bro

lost matrix
tardy delta
#

you cant be serious....

humble tulip
#

oh make a database

#

well you need sqlite

tardy delta
#

stop ninja'ing me ๐Ÿฅท

humble tulip
glossy venture
#

if u want to create a database in your plugin use sqlite otherwise require people to use mysql or smth

lost matrix
# quaint mantle no

Ok. Next question: What is the reason you want to use a Database instead of saving data in Files?

humble tulip
#

cuz yml files are shit for storing data

glossy venture
#

ye

humble tulip
#

you have people being touchy and trying to edit it

quaint mantle
#

or am i wrong

tardy delta
#

not using hikari :c

glossy venture
#

to support multiple servers o na networkl

humble tulip
#

sqlite connection can stay open

tardy delta
#

oh i use h2

quaint mantle
#

this is going to be a plugin for only my use on one server

warm light
#

It didn't fixed .-.

lost matrix
humble tulip
warm light
#

:/

tardy delta
#

any explenation about which databases to use? aaaaa

#

i just thought h2 and mysql would succeed

lost matrix
warm light
tardy delta
#

mwoa fine

tender shard
#

like why in hell would they name it like that lmao

quaint mantle
rough drift
#

I wanted to implement rope like swinging but for players, where's a good starting place?

tardy delta
#

same in dutch lol

tender shard
#

I refuse to use MongoDB until they choose a different name lol

tall dragon
tardy delta
#

MonkeDB

tender shard
#

yeah

#

Monkey

#

DB

#

that sounds good

#

and cute

tardy delta
#

๐Ÿคฃ

#

no u

quaint mantle
tender shard
#

๐Ÿ˜—

humble tulip
lost matrix
quaint mantle
#

ok thank you

tardy delta
#

i thought this was valid java?

rough drift
tardy delta
#

its tellin that close is undefined for type Object

rough drift
#

wut

lost matrix
rough drift
#

well yeah apart that

tardy delta
#

in the Scanner class its just public void close() {}

lost matrix
rough drift
#

bruh

tardy delta
#

vscode weird

lost matrix
hasty prawn
glossy venture
#

wont that just clal the same method

tardy delta
#

oohhh wait

#

bruh

lost matrix
tardy delta
#

no just this grr

tender shard
lost matrix
humble tulip
#

Scanner is final

glossy venture
tender shard
#

scanners are final, scammers are idiots

compact haven
tardy delta
#

if it put the close there, it will be closed no?

#

its saying nope

tender shard
lost matrix
compact haven
#

do you actually not use Mongo because of the name

glossy venture
tender shard
rough drift
# lost matrix Only works in a static context. Otherwise its ambiguous. Use Scanner.this.close(...
Bukkit.getScheduler().scheduleSyncRepeatingTask(Game.instance(), () -> {
  resolve(player.getLocation(), block.getLocation(), 6);
}, 0, 1)

void resolveStick(Location a, Location b, double maxLength) {
    Vector vector = b.toVector().subtract(a.toVector());
    double length = vector.length();
    if(length > maxLength) {
        vector.normalize();
        vector.multiply(maxLength);
        b.setX(a.getX() + vector.getX());
        b.setY(a.getY() + vector.getY());
        b.setZ(a.getZ() + vector.getZ());
    }
}
compact haven
#

ok good

rough drift
#

wrong reply

#

lol

#

well still, that ain't doing nothing

compact haven
#

thought we were going to have a problem here

tender shard
#

still they should choose a different name

compact haven
#

Mongo has like really bad Java support

#

at least the API is weird to me

#

like tf is BSON?

lost matrix
#

Binary Json. The actual format the DB stores its data in.

compact haven
#

disgusting

lost matrix
#

And the Java support is pretty good.

tender shard
#

I mean I also wouldn't create an open source project called NiggerDB so why is MongoDB fine? makes no sense to me. the people who made it probably didnt know that is has an insulting meaning in many languages

humble tulip
compact haven
#

do you have a public repo that you use it

lost matrix
#

They have an exclusive java API

compact haven
#

I've only seen it on old tutorial wikis

glossy venture
compact haven
lost matrix
glossy venture
#

appereantly

compact haven
#

like negro in Spanish is an insult in Italian

tardy delta
tender shard
compact haven
#

many words, not database/storage engine names lol

tardy delta
#

lets just use dat files

compact haven
#

let's save everything in NBT

lost matrix
tardy delta
#

๐Ÿ™

tender shard
#

RIP mongodb doesn't even allow people to open issues on github

tardy delta
#

issue: rename the damn thing to monkedb lol

tender shard
#

you can only send pull requests but no issues

tender shard
tardy delta
#

๐Ÿ˜‚

tender shard
#

if they don't allow people to create issues, they don't deserve any collaboration from the community anyway

#

so yeah fuck mongodb

compact haven
#

bro lol

#

the issues is closed because they use JIRA

tender shard
#

I know but it makes no sense

#

there are no "steps to reproduce" in my case

#

and "Affects Version" is every version

#

and it's also not a bug

tardy delta
#

that name will always remind me of monke now

tender shard
#

even urban dictionary knows that it's an insult so the argument "we cannot take every language into account" isn't even valid

crisp steeple
#

mongolian database

brittle lily
#

There should be Craft Bukkit? or I should use spigot

tender shard
#

spigot

brittle lily
#

okkay

tender shard
#

craftbukkit should (almost) never be used by anyone

tardy delta
#

i always forget to specify the --rev and then i have to do the whole thing again aa

tender shard
#

the only reason to ever run craftbukkit is to check whether a bugs exists in spigot but not in craftbukkit

tender shard
tardy delta
#

cuz i wanted 1.17.1 lol

#

im doing all my stuff on that version

vale cradle
limber owl
#

any idea how to implement uhc spawning platforms

tender shard
tardy delta
#

list of lcoations

humble tulip
#

Who creates craftbukkit?

tender shard
vale cradle
chrome beacon
vale cradle
#

mb

humble tulip
#

Hm but someone makes org.bukkit.craftbukkit

#

Ohh ok

#

So if spigot maintains craftbukkit why is craftbukkit standalone still a thing?

tardy delta
#

whats craftbukkit lol

#

i know the term but thats all

humble tulip
#

Implementation of bukkit

tender shard
tardy delta
#

craftspigot kekw

brittle lily
#

What do you think Guys How Many Gb Should I set for my server

humble tulip
#

Mine runs with 512mb lol

kindred valley
#

alex

tall dragon
#

download more ram ๐Ÿ˜„

tardy delta
#

lmao

vale cradle
brittle lily
kindred valley
#

do you know how can i clear the java console

vale cradle
#

I used to run 256MB 1.8 servers lol

humble tulip
#

I have 16 gb and still allocate 512mb

vale cradle
rough drift
#

if you do player.getLocation().setY() it should change the player Yright?

brittle lily
tender shard
limber owl
vale cradle
humble tulip
vale cradle
lost matrix
rough drift
#

then why does it sometimes work

tender shard
#

i'd always give every MC server at least like 4 GB

rough drift
#

I am confus

humble tulip
#

It never will

rough drift
#

anyways

vale cradle
# vale cradle 4

I had to manage between Browser, IDE, Minecraft Client and Server

humble tulip
#

Use player.teleoort

tardy delta
#

entity.setLocation(entity.getLocation().add(0, 1, 0))

lost matrix
brittle lily
rough drift
humble tulip
kindred valley
rough drift
#

like the server warping back your camera due to latency

tender shard
lost matrix
#

No real reason to use 1.8 unless you are kid that likes to mutilate its left mouse button by clicking real fast

tardy delta
#

can someone pin that

rough drift
#

say you rotate left by 90deg if the server has been constantly tp'ing you without changing your rot, it does not look as smooth does it?

brittle lily
tardy delta
#

uhh idk

tender shard
tardy delta
#

nah

lost matrix
tardy delta
#

playin valorant

rough drift
tardy delta
humble tulip
vale cradle
humble tulip
#

I'd imagin in the next 2 years what minestom can do will be amazing tho

brittle lily
chrome beacon
#

If you want lightweight go Minestom

lost matrix
brittle lily
tardy delta
#

i will probably take a look at minestom when my exames are finished

#

learning somethin new

chrome beacon
#

I graduated 3 days ago

kindred valley
lost matrix
#

Problem with Minestom is: You need to write absolutely everything on your own and the eco system is still young

vale cradle
lost matrix
tardy delta
#

buts its last year highschool lol im going to do software development next year

lost matrix
humble tulip
vale cradle
#

:sadge:

lost matrix
chrome beacon
#

Same

humble tulip
#

Writing minecraft related stuff in a language other than java is possibly a mistake.

vale cradle
#

at least for me :P

chrome beacon
#

Have you seen the Bedrock edition server written in php

vale cradle
#

PocketMine?

chrome beacon
#

Yeah that's it

vale cradle
#

php. ew.

chrome beacon
#

Forgot the name

humble tulip
#

Isn't php a web dev language?

lost matrix
#

The devs of this probably

lost matrix
vale cradle
#

afaik

vale cradle
#

like, I rather just use node or go tbh

lost matrix
chrome beacon
#

What do you recommend?

lost matrix
#

Everything else

glossy venture
#

go is pretty epic

tardy delta
#

rust kekw

vale cradle
river oracle
vale cradle
#

using java would be like being a masochist idk

patent horizon
#

is there a way to change the material of an item without messing with its meta?

sacred mountain
#

jesus my discord is laggy

vale cradle
kindred valley
#

how to clear the java console, everything the system and i texted

tardy delta
#

random tag

vale cradle
glossy venture
tardy delta
#

bruh why would you want to clear the console

glossy venture
#

in ItemStack1

kindred valley
patent horizon
#

ah cool

kindred valley
tardy delta
#

just log empty strings or smth lol

#

or scroll up

lost matrix
# chrome beacon What do you recommend?

In all honesty: Im a fan of the classic Java backend (SpringBoot, Micronaut or Quarkus)
Python has something going for it with Flask or Django (Would only use for small to medium projects)
C++ is an option if you write code in the embedded eco system.
Ruby is a bit outdated but has its benefits.

But for enterprise or bigger applications i will always push for JVM languages like Java/Kotlin

kindred valley
glossy venture
#

idk if that works with mc tho

#

they probably prevent you from doing that

tardy delta
#

if you have linux terminal just ctrl L lol

lost matrix
vale cradle
#

only works on unix tho

glossy venture
limber owl
#

any idea how to use BlockPopulator?

vale cradle
river oracle
#

There's a Unix character that clears console and it's lightning fast

glossy venture
tardy delta
#

is there something as an Enum#get(index)?

sour brook
vale cradle
glossy venture
#

prob \b because then it special char

tardy delta
#

owh right

lost matrix
tender shard
#

java will not die just because kotlin now exists

vale cradle
golden turret
#

is that right?

river oracle
vale cradle
limber owl
lost matrix
urban kernel
#

@tender shard how do i add update checker

#

what do i import

golden turret
golden turret
vale cradle
golden turret
#

i was asking if that is recommended

humble tulip
#

I wanna try working with redis to have my plugins works better multiserver

lost matrix
# golden turret why

The API design is quirky and it lacks a ton of features that other APIs have.
Redisson > Lettuce >> Jedis

humble tulip
#

Redisson

#

Will check it out

golden turret
#

redisson

#

it seems like a name

#

Redisson de Sousa Rodrigues

sacred mountain
#

LMAO

tardy delta
#

heh

urban kernel
#

can someone halp me setup jeff media updae checker

vale cradle
sacred mountain
#

stop pinging people

urban kernel
#

ooh is it

sacred mountain
#

its not even his plugin

urban kernel
#

did you read this wiki

sacred mountain
#

ask mfnalex if you really need

urban kernel
sacred mountain
#

on the thread, it's literally all there

#

all the information you need

urban kernel
#

yeah did you even take a look at it

sacred mountain
sacred mountain
urban kernel
#

it won't however tell you WHAT TO IMPORT

sacred mountain
#

if you don't know how to even copy paste code then idk you probably should learn a bit of coding

sacred mountain
#

yeah you should probably

humble tulip
#

Is there any way to put an uodate checker for v1 of my plugin?

jagged quail
urban kernel
#

after adding in pom.xml it adds errs to that and makes the build fail

sacred mountain
river oracle
#

Learn some Java tbh

sacred mountain
#

what IDE are you using

urban kernel
#

intellij

sacred mountain
#

is your project a maven project

urban kernel
#

idea

#

commune

#

yes its maven

sacred mountain
#

did you add the repo and the dependency to your pom

urban kernel
#

yessir

tardy delta
#

whats not working then?

sacred mountain
#

reloaded changes?

river oracle
#

What's the maven error

sacred mountain
#

ctrl shift O or navigate to the maven tab

urban kernel
#

how does one reload

sacred mountain
#

1 step ahead

jagged quail
urban kernel
#

control

#

shift