#help-development

1 messages · Page 172 of 1

remote swallow
#

get the time for it and save to config then scheduler to check if its that time every minute or so

#

there is probably a better way for that but it works

lavish wing
#

Hey guys, can someone help me with craftbukkit beta 1.7.3 events?

hasty prawn
#

1.7.3 wtf

remote swallow
#

1.7.3 isnt supported anymore

hasty prawn
#

What is your question

#

?tas

undone axleBOT
hasty prawn
#

But it probably works tbh

unborn kiln
#

hmmm, it very weird how it works

lavish wing
unborn kiln
#

I somehow randomly got it to work without disconnecting the player

lavish wing
#

I cant make events

hasty prawn
#

Send what you're doing

#

?paste

undone axleBOT
unborn kiln
#

nvm, fun

hasty prawn
unborn kiln
#

I think I know how to do it now

hasty prawn
#

Team prefix and suffix time for you

lavish wing
crimson terrace
#

do you think a debug setting that spams console with info is sensible? (Off by default, of course) Just in case people cant figure out why something doesnt work about your plugin?

hasty prawn
#

Easiest way to fix your problem is to not use such a dinosaur version

radiant umbra
#

Someone know how to fix this? I get a FileNotFoundException Error. Seems like it doesnt really download the file with the bearer token

public static void main(String args) throws IOException {
        URL url = new URL("https://github.com/ole1011/Newsc-master/releases/download/release/newscTEST.jar");
        HttpURLConnection client = (HttpURLConnection) url.openConnection();
        client.setConnectTimeout(0);
        client.setRequestMethod("GET");
        client.addRequestProperty("Accept", "application/octet-stream");
        client.addRequestProperty("Authorization", "Bearer [token]");
        client.setDoInput(true);
        client.setDoOutput(true);
        client.connect();
        try {
            InputStream in = client.getInputStream();
            Files.copy(in, Paths.get("newscTEST.jar"), StandardCopyOption.REPLACE_EXISTING);
        } catch (IOException e) {
            throw new IOException();
        }
        client.disconnect();
    }
wary topaz
#

build

remote swallow
wary topaz
#

alr

lavish wing
radiant umbra
hasty prawn
wary topaz
#

It didnt work.

remote swallow
#

without using a keybind how do you build the project?

wary topaz
#

build > build artifacts > build

grim ice
#

imagine 1.7.x

remote swallow
#

press crtl twice then type mvn clean package then try the keybind

grim ice
#

older than some teenagers

radiant umbra
wary topaz
#

didnt work

golden turret
#

?paste

undone axleBOT
golden turret
#

guys what is wrong with this code? I am writing this on my phone so I cant use things like devtools

remote swallow
wary topaz
#

alr all good

hasty prawn
golden turret
#

aaaaaaaa

#

thanks!

hasty prawn
#

Send the Main class

#

?paste

undone axleBOT
remote swallow
#

?main as well

radiant umbra
hasty prawn
#

Send the whole class, and why do you have a main method in a spigot plugin PauseChamp

radiant umbra
#

just called it main, will change it later anyway

unborn kiln
#

How would I go down a line when setting an armor stands custom name?

hasty prawn
#

Does \n not work

hasty prawn
#

If it doesn't then you'll have to use multiple armor stands

unborn kiln
hasty prawn
# radiant umbra https://paste.md-5.net/kaquloroxo.java

Hm, honestly I'm not sure. Maybe try making it public temporarily and then making sure that part is working. Once you can download it publicly you can re-make it private and then mess with the tokens. Just kind of breaks your problems up so you can really narrow down whats wrong.

radiant umbra
#

Yea, i already tried it with a public repository and it worked

hasty prawn
jaunty crag
#

is there a way to call a bukkitrunnable for a certain amount of time but have that time be adjustable

#

im not sure how to explain it but sort of like a while True for python

radiant umbra
hasty prawn
#

I have no idea then Sadge all that error gives me is that it's either failing to create the input stream or it's failing to read it

jaunty crag
hasty prawn
lost matrix
# jaunty crag how would u go about it

Do a for loop and run it i*delta
Or create a repeated runnable which starts a new runnable at the end of its run method
Or create a repeated runnable which has a counter and stops after a certain amount of runs

radiant umbra
jaunty crag
lost matrix
#

So like normal loops you can approach this iteratively and recursively. Its just async.

radiant umbra
jaunty crag
#

wait can we make a thread for this real quick

lost matrix
jaunty crag
#

its kinda hard to explain im gonna make a thread and add u

hasty prawn
jaunty crag
#

Make a Runnable run for a dynamic amount of time

radiant umbra
hasty prawn
#

this one would probably work, if not, then read:packages too

radiant umbra
#

still the same error, weird

#

Also, I need the personal access token right?

hasty prawn
#

Yeah

#

What are you trying to do, anyways?

radiant umbra
#

download a jar file to kinda auto update the plugin

hasty prawn
#

Ah

radiant umbra
#

gonna try it again with a public repo

#

yea, it works with public ones

#

then the issue should be smth with the auth token, idk

azure hawk
#

Hi guys. I wanna maka a plugin so everytime you shoot an arrow tnt spawns every tick and ignites when the arrow hits the ground. But i dont know how to summon tnt with a timer and how to check if the arrow has landed. Anyone know?

chrome beacon
#

Tnt every tick :kekw:

#

You really want an arrow to spawn that many tnt

azure hawk
#

yep :)

remote swallow
#

wont that just cause really really unnecessary lag

chrome beacon
#

It would

azure hawk
#

idc about lag if its satisfying <3

chrome beacon
#

But it's not satisfying if it's lagging

azure hawk
#

i just wanna do it ok

#

so how can i spawn tnt with a delay

chrome beacon
#

use the ProjectileHitEvent and the World#spawn method

azure hawk
#

ok thx

lost matrix
azure hawk
#

no like you shoot and its a tnt rainbow

#

xd

#

it spawns tnt where the arrow flighs in

lost matrix
#

Then you need a runnable which keeps track of the shot arrow. So ProjectileLaunchEvent and a runnable.

chrome beacon
#

?scheduling and ProjectileLaunchEven then

undone axleBOT
fluid river
#

depends

#

If you just run sql executor in browser you do

#

in java

"""SELECT *
FROM cringe
WHERE id = '123'
"""```
#

alr

azure hawk
midnight shore
#

Hi, how can i make an area effect cloud with a really really small hitbox to make a kind of raycast? I tried setting its radius but it doesn't seem to do anything and other than that i want to remove the particles

azure hawk
#

like the fuseticks are all the same

#

idk

chrome beacon
midnight shore
#

because i need to get every single block on the line

#

like this it works but i still get the annoying mob spell particle

#

how can i remove it

#

?

chrome beacon
#

Look in to raytracing algorithms instead of spawning a bunch of entities

midnight shore
#

anyways

#

how can i remove the mob spell particle from the area effect cloud?

azure hawk
#

and the server casually crashes

remote swallow
#

i wonder if its because your spawning insane amounts of tnt

crimson terrace
#

maybe a non terminating loop?

azure hawk
remote swallow
#

send your code

azure hawk
undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
crimson terrace
#

try spawning entities sync

untold jewel
#

buildtool

remote swallow
#

would love to know why TNT is public

untold jewel
#

i hate buildtools I cant get remapped mojang shit to work

#

#

:|

crimson terrace
#

and why its called TNT and not something thats more descriptive and in camel case

remote swallow
#

also why main class is called main

#

?main

chrome beacon
crimson terrace
#

that doesnt spawn

#

that sets ticks for fuse

chrome beacon
#

Yeah I'm blind

#

but anyways that is the problem

crimson terrace
#

true

#

having a non terminating loop is bad

azure hawk
#

why

chrome beacon
#

^ That would be an infinite loop

crimson terrace
#

you might wanna put that in a task to check every tick

crimson terrace
#

server cant proceed

jaunty crag
#

this is more of a java question but is there a way to detect if a pixel is empty on a BufferedImage

untold jewel
#

?google

undone axleBOT
quaint mantle
#

Hey is it possible to check how many blocks a player fell from?

quaint mantle
untold jewel
#

This link is useful but depends on what you are doing.

quaint mantle
#

I tried serching it but I didnt really get anywhere

quaint mantle
untold jewel
#

No problem boss

azure hawk
#

the server crshes again

#

althought i changed asnyc to sync nothing changed

edgy ice
#

Can anyone help me with the terra plugin?

crimson terrace
jaunty crag
crimson terrace
#

you want a repeating task that runs every tick, not always

#

while does the "Always" part

edgy ice
jaunty crag
#

ok

azure hawk
jaunty crag
#

are you on paper or spigot?

edgy ice
#

spigot

jaunty crag
#

use a paper server

crimson terrace
edgy ice
#

all my plugins are spigot though

#

it wont work on spigot?

jaunty crag
#

they usually transfer smoothly

#

paper is an extention of spigot

jaunty crag
#

everything should work

edgy ice
#

ah alright

crimson terrace
#

bad advice then

azure hawk
#

i think we both went brain afk

jaunty crag
# edgy ice ah alright

btw common "issues" with paper is not being able to dupe tnt, break bedrock with glitches, and some mob farms might not work like they do in vanilla due to the amount of optimizations done

young knoll
#

You can re-enable both of those

edgy ice
quaint mantle
#

I am trying to do @EventHandler for Entity but it gives me this error
"Paramater is not a subclass of org.bukkit.event.Event compiling and running this listener may result ina runtime exception" How could i fix it then?

jaunty crag
edgy ice
#

is gaea necessary?

jaunty crag
#

im sure u know what to add to the bukkit.yml

jaunty crag
edgy ice
#

yes I do

#

ah alright

young knoll
edgy ice
#

do I need to launch the server first?

jaunty crag
#

yes

edgy ice
#

ok

jaunty crag
#

are u running on minehut?

fluid river
#

i got trolled by YT

crimson terrace
#

typical case of tas lmao

jaunty crag
quaint mantle
jaunty crag
fluid river
#

cuz you need to listen to event

#

not to entity

young knoll
#

Because entity isn’t an event

fluid river
#

?learnjava

undone axleBOT
fluid river
#
private static final int EVEN_AMOUNT_OF_DOORS = 100;
    
public static void main(String[] args) {
    IntStream.range(1, EVEN_AMOUNT_OF_DOORS + 1).filter(i -> Math.sqrt(i) == (int) Math.sqrt(i)).forEach(System.out::println);
}
#

Have no connection to actual challenge

stuck flax
#

How do you unregister a command?

fluid river
#

but is the way to find answer

edgy ice
#

is this rigfht?

zealous osprey
jaunty crag
edgy ice
#

ok

jaunty crag
#

just letting you know it may crash if its on minehut

edgy ice
#

and then i delete the original world folder?

jaunty crag
#

or server tps will be low low

jaunty crag
edgy ice
#

its aternos

jaunty crag
fluid river
#

setExecutor(null)

#

idk if it's gonna throw error

#

but actually parameter is @Nullable

zealous osprey
fluid river
#

Programming challenge: find all perfect squares from 1 to given even number

zealous osprey
#

@stuck flax could you be more specific?
Are you trying to unregister one of your own commands or one from a different plugin?

azure hawk
#

this doesnt work

#

it doesnt set the fuse tick for the all already spawned tnts

stuck flax
zealous osprey
edgy ice
jaunty crag
#

try TERRA

#

instead of Terra

fluid river
azure hawk
#

https://paste.md-5.net/qasimuquno.java

Can pls someone help me. I wanna shoot an arrow and spawn tnt where it go's and when the arrow lands it all explodes. But idk how to do that and my brain is fked up bc its 11:30pm at my time and im really tired and wanna get this done

azure hawk
fluid river
#
for (String s : getConfig().getConfigurationSection("COW.drops").getKeys(false)) {
    String type = getConfig().getString("COW.drops." + s + ".item.material");
    int amount = getConfig().getString("COW.drops." + s + ".item.amount");
    ItemStack item = new ItemStack(Material.valueOf(type), amount);
}```
fluid river
# azure hawk

you need ((TNTPrimed)allTNTs).setFuseTicks(0); i guess

#

cuz i see no use in your entire loop

azure hawk
#

ok

#

bruh true

#

omg im dumb

#

see

#

im tired xd

#

still doesnt work though

fluid river
#

learnjava then probably

#

i'm not in the conversation tho

#

just saw your last piece of code

edgy ice
#

@jaunty crag

#

website says 1.19

#

thats what im using

jaunty crag
#

hm

#

truly, i dont know

#

it worked fine for me but i used my own server

edgy ice
#

hm

jaunty crag
#

there may be some other places u can ask

edgy ice
#

what do you suggest I do

#

or where

jaunty crag
#

you could go into the paper discord

#

or terra may have their own discord idk

edgy ice
jaunty crag
#

try paper

#

i dont have any solutions sorry

#

yeah ik

#

they just asked in here and i didnt feel like moving channels

wheat cape
#

bonjour, y a t il qqn qui parle francais svp

vocal cloud
#

English please

wheat cape
#

Okay, I download the totem faction plugin (event) but I can't break it

#

I am a beginner 😅

twin venture
#

Hello friends i asked twice , and non answered!
i am getting this error , the werid thing ,
i have 2 vps servers ,
i host this plugin on 2 diffrent hosts
1- the first vps , give me this error :
2- the second vps dosen't give me any error

#

its related to a plugin i worked on

#

its working fine on one of my vps's , the other vps it get disconnected after a while

untold jewel
twin venture
#

but its related to a plugin i worked on ..

untold jewel
#

You are saying this is plugin related HOWEVER you are oslo saying its the other vps that is getting disconnected

twin venture
#

its related to both server + development

untold jewel
#

I don't know enough about MYSQL to help you out brother, someone will answer you when they have time

quiet ice
wheat cape
#

that's the principe of the totem event

quiet ice
#

What do you even mean with that

wheat cape
#

the totem is an event where you need to be the first fac to break the totem to win some rewards
but in my case, I cant break the totem so I request some help

quiet ice
#

Although I'd contact the plugin maintainers, should the plugin be maintained

fresh timber
#

How can I move a player to a different server inside the console in a BungeeCord server?

#

like run a console command that moves a player

#

is x the player?

#

mk

#

oh is that only for the connector?

#

can I run this command in the console of the individual servers?

#

hm ok

#

it does work on the bungeecord console tho

#

ig ill just make a plugin for the bc connector

#

thx

#

also, is there a way to remove the "Summoned to <server> by console" message?

#

or is there a way to change all of the bungeecord error messages

#

like You are already connected to this server!

nimble hill
#

In general the inCanceled method is a great way to check if like a blockbreak is canceled, but on something like PlayerInteract, or EntityDamageEntity etc... Thats not viable, and so on. Is there a better way to detect if a player has permission to build/do something for those events?

#

as an example:

    @EventHandler
    public void on(EntityDamageByEntityEvent e) {
        if (e.isCancelled()) {
            return;
        }

Even when this event is canceled it still goes through

#

Do i need a higher priority?

#
@EventHandler
    public void on(PlayerInteractEvent e) {
        if (e.isCancelled()) {
            return;
        }
#

Or this event

desert loom
#

you should refactor this to use configuration sections instead

#

lot easier to read/maintain and less error prone.

#

something like this

        for (String mobSectionKey : config.getKeys(false)) {

            final ConfigurationSection mobSection = config.getConfigurationSection(mobSectionKey);

            final ConfigurationSection dropsSection = mobSection.getConfigurationSection("drops");

            // now calling dropsSection.getX(...) is like calling config.get(mobSectionKey + "." + "drops")

            if (dropsSection != null) {
                // code
            }

        }
#

final 😀

#

refactoring your code to use ConfigurationSection will likely solve your issue. It's way easier to read using ConfigurationSection instead of what you're doing but yeah I get you. I'm not sure what's causing your current code to bug

quartz basalt
#

i have ``` Location loc = location;

            x = Math.cos(a) * radius;
            z = Math.sin(a) * radius;

            Particles.spawn(loc.add(x, 0, z), Particle.FIREWORKS_SPARK, 0, 1, 0, 0, 0, true);

            a++;

            if(a >= 360){
                a = 0;
            }``` to spawn a spiral of particles which works but if i make the size bigger the particles are spread really far apart, how can i make it so they dont do that?
torn oyster
#

how would I go about making a particle spiral around a player

#

all i need is the maths part

#

i'm well aware how to spawn particles

fresh timber
#

I'm getting an error while loading my BungeeCord plugin. Anyone know why?

torn oyster
#

wait

#

someone asked that above me

torn oyster
delicate lynx
#

probably wrong import

fresh timber
#

hmm

#

oh wait

quartz basalt
#

kinda need to find a way to add more points if that makes sense

fresh timber
#

what is the thing I use to run a console command on a BungeeCord server?

torn oyster
#

it puts them closer together and adds more

quartz basalt
#

ah alright ill try it thanks

rigid loom
#
        at org.bukkit.plugin.java.JavaPlugin.getProvidingPlugin(JavaPlugin.java:428) ~[spigot-api-1.18-R0.1-SNAPSHOT.jar:?]
        at games.kingdoms.kingdoms.publiccmds.kingdoms.KingdomsConfig.<init>(KingdomsConfig.java:19) ~[?:?]
        at games.kingdoms.kingdoms.Kingdoms.<init>(Kingdoms.java:36) ~[?:?]```
how would i fix this?
#

?paste

undone axleBOT
rigid loom
torn oyster
#

how would i open a book

#

for a player

#

with no real book

undone axleBOT
worldly ingot
#

I don't remember if the book has to be in the player's inventory or not. If it does, set it to a slot temporarily, call that method, remove the book again

hazy parrot
worldly ingot
#

We don't want to make it a forum because... well...

golden turret
#

any idea on why this is always false?
this.acceleration = 10, 0
this.radius = 10
other.acceleration = 0
other.radius = 50

#

full code

noble lantern
#

javascript hates instances

#

type typeof

golden turret
#

that is not the problem

rigid loom
vocal cloud
#

KingdomsConfig kc = new KingdomsConfig(Kingdoms.getPlugin()); Why don't you just DI this?

#

Also, did you register it in your plugin.yml and your enable

rigid loom
#

is registering it the same as for a CommandExecutor?

#

@vocal cloud

vocal cloud
#

Wait why are you using a command over a commandexecutor?

rigid loom
#

Hempfest from spigotmc suggested it. He owns a spigot account and a discord server

vocal cloud
#

For what purpose?

rigid loom
#

"oh youre doing it the kody way with executors
man just switch out command executor for Command.class directly
use the CommandUtils.register static method to register it on your enable
boom
extends Command
then remove the commandexecutor from your implements"

#

im not seperating into seperate lines

#

but thats his words

vocal cloud
#

The kody way? Aka the way you're supposed to

#

If you are using a third party lib to register it then use that

round finch
#

?mns

vocal cloud
#

you good bro?

round finch
#

How to make it comprehendible?

#

Mappings?

#

Idk this stuff

round finch
#

Yes maven

#

Ah build tools

#

@round finch special ping 📌

#

Is it possible to load an API jar from a specific folder location in java?

wary topaz
#

if ((Player) sender).isInvulnerable() {

                return true;
            }
Incompatible types. Found: 'org.bukkit.entity.Player', required: 'boolean'
worldly ingot
#

You're missing a closing bracket

wary topaz
#

I am?

worldly ingot
#

Yes

#

if ((Player) sender).isInvulnerable() {

wary topaz
#

Ohhh

#

I was just using intellij suggestions

rigid loom
#

im literally just running the main command

wary topaz
#

If I were you I would delete that textwall

#

?paste

undone axleBOT
rigid loom
wary topaz
#

Could you send the file?

#

Not the file

#

but in paste

#

?paste

undone axleBOT
rigid loom
wary topaz
#

Can you send the plugincommand.java one?

worldly ice
#

then on line 77 it gives you an ArrayIndexOutOfBoundsException

wary topaz
#

You should use a switch, it would also make the code run much faster.

worldly ice
#

what is the point of that switch statement

wary topaz
#

Youll have to fix the rest

worldly ice
#

oh ok

#

i thought that was the final thing

wary topaz
#

I dont like doing peoples work 😉

worldly ice
#

that command doesn't exist

wary topaz
#

?

worldly ice
#

did you put it in your plugin.yml

wary topaz
#

i do this every time!;

#

god EthanGarey
god EthanGarey
god EthanGarey

Now it's not returning anything ;-;

#

omg finally fixed

rigid loom
#

where would a break; go if i were to make multiple cases?

#

it breaks the case right?

#

out of the*

#

@wary topaz

worldly ice
#

i mean at this point i would just use a command handler

#

@rigid loom

rigid loom
#

nvm

#

i giugred it out

#

figured*

rigid loom
worldly ice
#

me too

#

instead of using a more fleshed out command handler i decided to make my own

#

it kinda sucks but whatever

#

it does what i need it to do

rigid loom
#

thats all you need

worldly ice
#

exactly

honest echo
#

what packet is sent to remove player from tab ?

digital plinth
#

question do you need to mess with nms to do complex particles

#

i remember theres like a plugin that makes nm access easier?

#

is it protocalib?

stuck flax
#

Using an ORM (OrmLite), is it better to cache data and write that and then save it or just write it directly to the database?

torn oyster
#

how would i set the randomtickspeed to 0 in some places

#

but normal in the other

#

is tehre an event

honest echo
# digital plinth is it protocalib?

yeah protocolLib makes life easier with NMS, and it will be probably last thing youll need. about particles no idea but particles are included in API that does works perfectly. but totally depends how do you handle them

young knoll
river oracle
#

are you required to shade brigadier?

young knoll
#

No

rich orchid
#

Hi there! I am trying to send a simple packet from a spigot server to a fabric client, but the server doesn't seem to be sending the packet. This is the code I have. Any help would be greatly appreciated!

public class TestPlugin extends JavaPlugin implements PluginMessageListener, Listener {
    private static final String channel = "test:main";

    public static Logger log;

    @Override
    public void onEnable() {
        log = getLogger();

        this.getServer().getMessenger().registerOutgoingPluginChannel(this, channel);
        this.getServer().getMessenger().registerIncomingPluginChannel(this, channel, this);
        this.getServer().getPluginManager().registerEvents(this, this);
    }

    public void onDisable() {
        this.getServer().getMessenger().unregisterOutgoingPluginChannel(this);
        this.getServer().getMessenger().unregisterIncomingPluginChannel(this);
    }

    @Override
    public void onPluginMessageReceived(@NotNull String channel, @NotNull Player player, @NotNull byte[] message) {
        log.info("Message received on channel " + channel + " for player " + player.getDisplayName());
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        var player = event.getPlayer();
        log.info("Sending test packet to player: " + player.getDisplayName());

        var bytes = ByteStreams.newDataOutput();
        bytes.writeUTF("Test");

        player.sendPluginMessage(this, channel, bytes.toByteArray());
    }
}
torn oyster
remote swallow
#

Would i be correct in saying

List<String> TYPES = null;

for (String s : plugin.getConfig().getConfigurationSection("punishments").getKeys(false)) {
            TYPES.add(s);
        }

should all all sections in punishments to TYPES list

abstract sleet
#

if your punishments looks like this:

punishments:
  punishment-a: ...
  punishment-b: ...

then punishment-a and punishment-b will be added to TYPES

#

if you want it to look like

punishments:
  - "punishment-a"
  - "punishment-b"

then use TYPES.addAll(config.getStringList("punishments")) iirc

#

@remote swallow

remote swallow
#

thanks

silk mirage
#

The code after .thenAccept() is not reachable for some reason

tardy delta
#

Should be using sneakythrows too but i refuse to use lombok

silk mirage
#

anyways any idea what's going on there?

tardy delta
#

Im just rethrowing them uhh

silk mirage
#

I meant in my code

#

this is so annoying

#

my eyeballs are hurting

tardy delta
#

ThenAccept assumes the computation was succesfull

#

Try with whenconplete and print out ex and result

silk mirage
#

I tried

#

It's the same

#

I moved from whenComplete to thenAccept

tardy delta
#

What happens when you join it and call it sync?

silk mirage
#

🤣 I don't want a thread block

tardy delta
#

Not likely to include that into production but anyways

#

What's your executor tho

silk mirage
#

It's a threadpool of 10 threads

tardy delta
#

Hmm dunno

silk mirage
#

wait

#

does closing statement

#

close resultset

tardy delta
#

Ig not

#

I always use try with resources

silk mirage
#

It's impossible in this case

#

I thought of it

#

and I have a memory leak

#

that i'm aware of

#

and 1.19.2 just makes it worst

tardy delta
#

Be sure to close everything

silk mirage
#

I hope I'm

tardy delta
#

You arent closing your resultset now

silk mirage
#

yeah i know but if I do that I can't compute the value

#

it's closed at application level

#

rather at api level

tardy delta
#

Use a try w resources

silk mirage
#

Yeah, I'm thinking of that

#

Converting ResultSet to a JsonARray

#

and closing the statement

#

and returning the completed JsonArray

#

I think it'd be performance efficient

tardy delta
#

Dunno how to remove damn embed on phone

#

No need for a jsonarray ig

modern vigil
#

Where does the PersistentDataContainer store data?

tardy delta
#

Hoping you're not saving json into a DB brr

tardy delta
silk mirage
tardy delta
#

Ah lol

grave lagoon
#

good beans

silk mirage
#

uhh how do i generate flat worlds again starting a test server takes a great time now

grave lagoon
#

does anyone know an open source AI training model

silk mirage
#

what are u looking for

grave lagoon
#

im making an ai to detect if something is a taco and i dont wanna make it myself so im stealing it rn

silk mirage
#

Well, I'm like most amazed by Stable Diffusion (it's a trained model with dataset available ig)

grave lagoon
#

no

#

i have the dataset

#

wait

#

LMAO

#

i actually use stable diffusion

#

and know some contributers

#

lol

#

1 sec

silk mirage
#

oh

sterile axle
#

isn't that (one of) the AIs that takes natural text and makes pictures

#

gpt-3 go brrrr

silk mirage
#

it works damn good

grave lagoon
#

i made gpt-2 print hello world in python

sterile axle
#

i tried to generate a logo for my prior school's chess club and it summoned horrors from dimensions unknown

grave lagoon
# silk mirage You need a dataset or a model?

Exploring how neural networks learn by programming one from scratch in C#, and then attempting to teach it to recognize various doodles and images.

Source code: https://github.com/SebLague/Neural-Network-Experiments
Demo: https://sebastian.itch.io/neural-network-experiment

If you'd like to support me in creating more videos (and get early acce...

▶ Play video
silk mirage
#

but you don't need to classify image on different basis

#

it's just a Yes or No kind of prediction needed

sterile axle
#

imagine being a neural network looking at a doodle of a windmill and saying "yeah im 1.45% sure thats an octopus"

grave lagoon
#

shut up

#

ok so

silk mirage
#

@grave lagoon You using tensorflow?

#

Keras?

#

Pytorch?

grave lagoon
#

just pure javascript

#

i mean

#

node js

silk mirage
#

the uck

silk mirage
sterile axle
#

mans on another level coding brains from scratch

silk mirage
#

wait the fuck

#

you aren't using tensorflow?

grave lagoon
#

should i

silk mirage
#

how are you gonna import the model

#

how are you planning to train the model?

grave lagoon
#

i havent gotten that far

#

alr the fs of that github is weird

silk mirage
#

object_detection

grave lagoon
#

how do i train it

#

i dont use tensorflow

sterile axle
#

very carefully

sullen marlin
#

give it treats when it does the right thing

sterile axle
silk mirage
grave lagoon
#

thats tru

#

but loke

#

is there a function there

#

in the api

#

that trains it

#

tenserflow

#

or wahtever

sterile axle
#

yeah lol

#

check the docs

tardy delta
#

Who we got there

sterile axle
#

you will find what you need

#

im pretty sure its even .train(...)

#

couldnt say what the args are but check the docs

grave lagoon
#

ok

silk mirage
#

here

grave lagoon
#

WHAT THE FUCK

#

I HATE MY LIFE

silk mirage
#

someone had stupid idea

#

before

grave lagoon
#

aa90usduihasdhnxzc

silk mirage
#

and wrote about it

grave lagoon
#

I HAD THIS IDEA IN 2021

silk mirage
grave lagoon
#

this was in 2017

#

WHT

#

WHY

silk mirage
#

Food keras models

#

You can easily identify tacos

#

dont even need to train

sterile axle
#

i dont need an AI to identify tacos. i have my brain. i am expert taco identifier. 100% accuracy

#

the only problem is that i eat them when im sure its a taco

#

so 100% loss

grave lagoon
#

k

#

see the training guide

#

is 404

silk mirage
#

AI is weird

#

and ur trying to train on js

#

train on python

grave lagoon
#

on python

#

i just saw that

#

lemme do

silk mirage
#

also btw do you know the side of the food dataset i gave u

#

4.7 GB

#

🤣 requires intense hardware

grave lagoon
#

lmao i just bought a 3070 ti for training AI

silk mirage
#

are u kidding

#

me

grave lagoon
#

no

silk mirage
#

but u should have gotten like a TPU

grave lagoon
#

i mounted it in my system like 3 days ago

#

its aklso for gaming

#

and stuff

#

goodnight

#

ima sleep

remote swallow
#

Is there a post online anywhere that shows a way to get sections in a configuration section, getkeys false, and add them to a List<String>

civic wind
#

Its like getConfigurationSection(“”) and get keys, is this what you mean?

#

Its all in that method im pretty sure im not at my pc or i would show you

remote swallow
#

yeah, its getConfigurationSection("path") i just cant figure out how to add any sections to a List<String> that could be used in tab complete

civic wind
#

Ahh, sorry, not sure

remote swallow
#

Im guessing its a for loop but all the ways i can think of dont work

silk mirage
#

@grave lagoon I trained the model and attained about 93% accuracy

remote swallow
#

i just realised what the issue is and i want to die

#

i never saved default config

silk mirage
#

🤣 happens

#

personally wasted countless hours with that issue too

civic wind
remote swallow
#

ill try and make this work later and after i have some sleep. Bet ill fix it instantly when i wake up

civic wind
#

Yeah sleep is important

torn oyster
#
    @EventHandler
    public void onGrow(BlockGrowEvent e) {
        System.out.println("grow");
        MinigameManager minigameManager = MinigameManager.get();
        @Nullable Minigame m = minigameManager.getActiveMinigames().stream().filter(mini -> ((ChunkMinigame) mini).getActiveLocation().getWorld().getName().equals(e.getBlock().getWorld().getName())).findFirst().orElse(null);
        if (m != null) {
            System.out.println("grow2");
            ChunkMinigame cm = ((ChunkMinigame) m);
            if (!cm.getModifiedBlocks().contains(e.getBlock().getLocation())) {
                e.setCancelled(true);
            }
        }
    }
#

why doesn't this work

#

ahghagw

#

grass

icy beacon
#

"doesn't work" is a very broad concept

torn oyster
#

grass

#

grass still generrats

icy beacon
#

does your debug get to grow2?

torn oyster
#

generates

torn oyster
icy beacon
#

why don't you put a debug inside the inner if-statement?

#

it is probably why it fails

torn oyster
icy beacon
#

did you check?

torn oyster
#

it's an empty list

icy beacon
#

yeah you didn't

tribal cypress
#

Anyone here experienced with integration of economy in Vault? I'm having trouble with my plugin. I'm trying to make my own economy plugin for practice. Plugin runs correctly - no errors, but when I execute the command /vault-info, then Vault returns a NPE (I've already tested it without the plugin, and it works correctly). This is just a prototype, that's why it doesn't use databases & stuff

TEconomy.java (main)

public final class TEconomy extends JavaPlugin {

    public Economy econ;
    public HashMap<UUID, Double> money = new HashMap<>();
    public EconomyImplementer economyImplementer;
    private final VaultHook vaultHook = new VaultHook(this);

    @Override
    public void onEnable() {
        // Plugin startup logic
        vaultHook.hook();
        economyImplementer = new EconomyImplementer(this);
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
        vaultHook.unhook();
    }
}

EconomyImplementer.java

public class EconomyImplementer implements Economy {

    private final TEconomy plugin;
    public EconomyImplementer(TEconomy plugin) {
        this.plugin = plugin;
    }


    @Override
    public boolean isEnabled() {
        return true;
    }

    @Override
    public String getName() {
        return "TEconomy";
    }

VaultHook.java

public class VaultHook {

    private final TEconomy plugin;
    public VaultHook(TEconomy plugin) {
        this.plugin = plugin;
    }

    private Economy provider;

    public void hook() {
        provider = plugin.economyImplementer;
        Bukkit.getServicesManager().register(Economy.class, this.provider, this.plugin, ServicePriority.Normal);
        plugin.getLogger().log(Level.INFO, "Hooked into Vault");
    }

    public void unhook() {
        Bukkit.getServicesManager().unregister(Economy.class, this.provider);
        plugin.getLogger().log(Level.INFO, "Unhooked from Vault");
    }

}
#

I've left out the rest of EconomyImplementer.java because it's basically empty, but contains all the necessary methods (may supply if requested for)

tender shard
torn oyster
#

because why not

#

private final @Getter List<Location> modifiedBlocks;

civic wind
#

I'm having trouble figuring out how i can call for this itemstack as I need it inside this event for the whowashit, whohit variables...

#

It gives the head, just working on right click event and then removing it upon right click from the inventory

grim ice
civic wind
#

I need killed :/

tall dragon
#

getEntity()

#

is the victim

civic wind
#

This is how I was planning on doing it

#

then i can call the itemstack whenever i want

tall dragon
#

so what is the problem

civic wind
#

I need to get the player who has been killed display name??

#

Like I said, I can get the killer, but not the victim

tall dragon
#

u did in your code...

#

event.getEntity

#

is the victim

chrome beacon
#

Just pass the victim as an argument?

tall dragon
#

yea..

civic wind
tall dragon
#

u trying to do it in your method...

#

where it does not exist

#

use the passed in player there

civic wind
#

That's what im saying...

#

Read my original post.

tall dragon
#

yea i read it

#

still dont rlly understand what the problem is

civic wind
#

I can't use the ItemStack in the listener, as i cant call for it in another event, so I need to make the ItemStack seperate to both so i can call for itemstack in both events but i have no idea how I can do this as i dont' know how to make the owningplayer of the skull the player who has died.

tall dragon
#

just make a method that gets you a skull of the passed in player?

civic wind
#

Yeah... I know that but I've been saying I don't know how to make it of the player who has died...

chrome beacon
#

?learnjava

undone axleBOT
chrome beacon
#

Pass the player as an argument and use it

#

That's it if you do not know how to do that take a look at the links above

civic wind
#

You just link me java docs

#

Nevermind.

civic wind
#

1.19

orchid portal
#

Help plz, I made a Discord bot using this tutorial: https://www.spigotmc.org/threads/create-a-discord-bot-within-a-spigot-plugin.368423/ However, when receiving a message, the following error occurs: java.lang.IllegalStateException: zip file closed
at java.util.zip.ZipFile.ensureOpen(ZipFile.java:831) ~[?:?]
at java.util.zip.ZipFile.getEntry(ZipFile.java:330) ~[?:?]
at java.util.jar.JarFile.getEntry(JarFile.java:518) ~[?:?]
at java.util.jar.JarFile.getJarEntry(JarFile.java:473) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:189) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:587) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:129) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:124) ~[paper-api-1.19.2-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
at org.javacord.core.util.handler.message.MessageCreateHandler.handle(MessageCreateHandler.java:52) ~[SecretPlugin-1.0-198.jar:?]
at org.javacord.core.util.gateway.PacketHandler.lambda$handlePacket$0(PacketHandler.java:51) ~[SecretPlugin-1.0-198.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

#

What should I do? I am confused

chrome beacon
orchid portal
#

I was doing

tall dragon
# civic wind 1.19

try this

    public ItemStack getPlayerSkull(Player player)
    {
        
        PlayerProfile profile = Bukkit.getServer().createProfile(player.getUniqueId());
        
        ItemStack playerHead = new ItemStack(Material.PLAYER_HEAD, 1);
        SkullMeta meta = (SkullMeta) playerHead.getItemMeta();
        meta.setDisplayName("blablabla");
        meta.setPlayerProfile(profile);
        playerHead.setItemMeta(meta);

        return playerHead;
    }

civic wind
tall dragon
#

the player you pass in is the player that died

#

e.g getPlayerSkull(victim);

civic wind
#

ahhh i see...

#

Thanks, this was helpful instead of someone typing ?learnjava lmfao. Cheers man will give it a go

chrome beacon
#

Well that is basic Java

#

You would have known what to do if you decided to learn it by going through the tutorials

civic wind
#

I'm new, so obviously, I wouldn't have known.

chrome beacon
#

?

civic wind
#

Just saying ?learnjava doesn't help anyone. That's exactly what i'm doing

chrome beacon
#

You shouldn't learn Java and Spigot at the same time

civic wind
#

and before you say "LeArN JaVA FiRsT" I'll learn better this way.

#

Knew it was coming LOL

#

Typical.

molten hearth
#

?learnjava

undone axleBOT
molten hearth
#

@civic wind

grim ice
#

so this method isnt as efficient as you think

civic wind
#

It is. I've got a full time job, been coding about a month. I'd say i'm doing decent. I know tons of devs who learnt this way.

grim ice
#

I dont think youre as decent as that but sure

echo basalt
#

I, myself, learned both at the same time

#

now I teach my homie

civic wind
#

Everyone learns in different ways. Just like everyone has different hobbies, interests, hair colour, size, so on and so on.

#

No one is the same.

echo basalt
#

What took me 2 years to learn, he's taken about 4 months

grim ice
#

but it's not the efficient way

civic wind
grim ice
#

💀

echo basalt
#

you really just sound like someone who doesn't want to learn java

grim ice
#

then your way is to annoy people with meaningless questions

#

and then complain when they tell you to learn java

civic wind
#

Hmm dunno aboit that one

#

Looks like I don't want to learn java

echo basalt
#

Go brainless ye

#

I don't want to learn C yet I've read like 4 2000 page books

grim ice
#

and like

#

how would you get a fulltime job

#

when you have no experience with java, im seriously doubting that

echo basalt
#

bagging groceries

grim ice
#

lol

civic wind
#

Lool

#

I'm a bricklayer

echo basalt
#

based

grim ice
#

then why did you mention that

civic wind
grim ice
#

I mean

#

"It is. I've got a full time job, been coding about a month. I'd say i'm doing decent. I know tons of devs who learnt this way."

#

in this context anyone would understand that its something to do with coding

#

otherwise why would you mention it

civic wind
#

Nope, I was referring to the fact I haven't got a lot of time and i'm doing fairly good.

echo basalt
#

Y'all just nitpicking fr

civic wind
#

Read it properly lol

#

You can code, but can't use common sense

echo basalt
#

kilo you lack basic OOP knowledge, you seem to have functional programming skills

grim ice
#

💀

echo basalt
#

That's your weak spot

#

Work on it

civic wind
echo basalt
#

2Hex you have daddy issues, grow up and stop picking on this guy

grim ice
#

he lacks basic knowledge to form a sentence, that's one thing to say

#

lmao

civic wind
#

But i've formed many in this conversation? Another stupid thing you have said.

#

You can't teach common sense, sadly, so unfortunately for you, you are doomed.

echo basalt
#

I got more things to do with my life than watch you 2 fight over nothing

grim ice
#

What-

#

you brought up having a bricklaying job in a coding conversation out of nowhere

chrome beacon
#

2Hex time for a discord break

echo basalt
#

let the dude lay his bricks before he lays the dirt over you

grim ice
#

anyone would be confused?

molten hearth
#

are you sure you have a job

#

also I didnt know they teach python at gcses lmao nice

civic wind
civic wind
echo basalt
#

Studied Python at GCSE Level
This is your biggest plague

grim ice
#

you not having enough time has nothing to do with the conversation either

echo basalt
#

And I've witnessed it on your code

civic wind
echo basalt
#

Unlike python where everything is a def, java uses return types and access modifiers for "functions"

civic wind
#

Yeah, I'm new and still learning. I'll get there eventually 🙂

grim ice
#

and you can do that in a much faster way by learning java

echo basalt
#

So that's where that mistake was coming from

#

You do you, you'll get there in a year

molten hearth
civic wind
#

yeah i needed ItemStack

civic wind
chrome beacon
echo basalt
grim ice
#

what

civic wind
#

@molten hearth you made yourself look very stupid

molten hearth
echo basalt
#

I made c# bots for flash games

grim ice
#

wtf

molten hearth
#

even if I work with a C++ developer I sure hope they at least know how to stitch some html together

echo basalt
#

and dabbled with some C

molten hearth
#

even if it looks like ass lol

civic wind
#

html is easy, css is a bit harder

molten hearth
#

nah hear me out <center></center>

echo basalt
#

I'd just appreciate the effort that kilo is taking to learn while y'all are trying to put him down

grim ice
#

not trying to put him down

#

just saying that theres a much more efficient way to learn

echo basalt
civic wind
#

How old are you guys?

molten hearth
#

<center><table></table></center>

echo basalt
#

around 18

molten hearth
#

ez fix

#

im 20

echo basalt
grim ice
#

welp

echo basalt
#

just let the man take 3 years to learn how to do OOP, his problem not mine

#

I also took 3 years so who am I to judge

civic wind
#

I won't take 3 years

grim ice
#

for me i just like

#

gave up on doing spigot and java at the same time after a while

#

and then learnt java on itself

civic wind
#

@grim ice What did you use to learn java?

grim ice
#

the websites in ?learnjava

civic wind
#

I switch between the two as it keeps me interested, I like seeing things i've made in mc

grim ice
#

and spending most of my day on stackoverflow and intellij

echo basalt
#

I did a basic refresher course in jetbrains academy

grim ice
#

tbh

#

i kinda wanna make a game with unity

#

it looks fun

#

but i dont know what to make

civic wind
#

Yeah i saw somethings on youtube on unity, looks well cool

echo basalt
#

make 50 cent's game but for pc

grim ice
#

lmao

#

nah too complicated

civic wind
#

I’m hoping to do thag in a couple years if i can learn enough

chrome beacon
#

React isn't a programming lang though ;/

grim ice
#

mc 1.8.9

#

is almost 2500 days old

#

6 days away

#

and by coincidence, that's also the minecraft mob vote 2022 opening

#

and by coincidence, that's also my sister's birthday

chrome beacon
#

I recommend extending AbstractEconomy

#

also try registering it in onLoad instead

tribal cypress
#

the class has all of them afaik

tribal cypress
echo basalt
#

pretty sure you just register it with the RSP and that's all

#

make sure it loads before other econ plugins

#

or after idk how the chain works

tribal cypress
#

I dont have any other installed

echo basalt
#

so yeah onLoad should work

tribal cypress
#

will try when im at the pc and give feedback

#

thanks in advance

spring minnow
#

Is there an efficient way to check to all players in a server if they have a certain item with certain properties?

#

doing directly
for(Player p : Bukkit.getOnlinePlayers())
and then do for every player in a server
for(ItemStack item : p.getInventory().getitems())
looks a bit inefficient and could cause lag

#

especially if multiple players trigger that algorythm at the same time

tall dragon
#

depends how often you're doing that

spring minnow
tall dragon
#

if its player triggered. you probably need a result right away

#

so you cant do much

spring minnow
#

i'm italian so my english is bad

tall dragon
#

well an option would be to run this async with a callback

spring minnow
#

but i'm not sure

tall dragon
#

what are you even trying to do?

#

like whats the end goal

#

maybe there is some other way to achieve it

spring minnow
#

before, the algorythm worked that every player was stored with a number, but i can't do it anymore since now i have to do that player numbers depend on the phone and not on the players

#

so basically it has to check items not players

tall dragon
#

hmm well maybe you should just make some benchmarks using your current algorithm

#

loops are faster than some people think

#

this might just be fine

spring minnow
#

what if 30 players trigger this at the same time?

#

like fr the algorythm would have to check like 35(i think inventories are 35 or smth else) items for 30 players, its like 1500 calls

#

btw since i think there isn't an other way i'll just do that, if my user that asked me this private plugin thing complains about performance, i'll try something else, thanks anyway 🙂

tall dragon
spring minnow
lost matrix
spring minnow
#

i already said i can't, that's the current algorythm but i have to change it xD

spring minnow
tall dragon
spring minnow
#

i'll try the non-performace thing, if it makes lag too much i'll try this way

tall dragon
lost matrix
#

And then do an async check. 2-3 players per tick or something

spring minnow
#

i'll use that

#

thanks for the help

serene sigil
#

guys, why cant i import TextComponent???

#

i have installed this module

#

(spigot-api-1.19-R0.1-20220710.051022-43.jar)

vestal moat
#

Are spigot libraries shared between plugins? What if a plugin wants to use API of another plugin which has some of the libraries

opal juniper
#

am confused. are we talking about plugin.yml libraries?

vestal moat
#

Yes

eternal oxide
#

My understanding is they are limited to your plugin class loader

opal juniper
#

i mean, yes. it would download all the necessary dependencies of that API and if they we’re referenced specifically they would be loaded by the plugin classloader

vestal moat
#

I looked in source code and looks like plugins can see libraries of other plugins only in the case the one depends on the other

#

Which makes sense

opal juniper
#

yes

serene sigil
opal juniper
serene sigil
#

where can i find it?

opal juniper
#

google

serene sigil
#

damn best answer in 2022

#

lol

serene sigil
#

where?

eternal oxide
#

Its included in teh Spigot-api

serene sigil
eternal oxide
#

yes it is

tribal cypress
serene sigil
#

intellij

eternal oxide
#

import net.md_5.bungee.api.chat.TextComponent;

tribal cypress
#

when u type TextComponent won't it come up to import itself?

#

it normally does for me

eternal oxide
#

Yes

serene sigil
#

aint working

eternal oxide
#

literally type TextComponent.

serene sigil
#

unless its java.awt

opal juniper
#
<dependency>
    <groupId>net.md-5</groupId>
    <artifactId>bungeecord-chat</artifactId>
    <version>1.19-R0.1-SNAPSHOT</version>
</dependency>
#

i think

tribal cypress
eternal oxide
#

no its not java.awt

serene sigil
#

ik lol

tribal cypress
#
import net.md_5.bungee.api.chat.TextComponent;
serene sigil
#

doesnt work

eternal oxide
#

?paste your pom

undone axleBOT
serene sigil
eternal oxide
#

Maven pom

serene sigil
#

i use external jars 😛

eternal oxide
#

Thats JUST spigot-api

serene sigil
#

i think

#

i just hate gradle

serene sigil
eternal oxide
#

you can;t use external jars with maven

#

not properly

serene sigil
#

i use plain

eternal oxide
#

what is plain?

serene sigil
#

like default

eternal oxide
#

you mean manual imports and exporting final jars?

serene sigil
#

(not maven or gradle)

serene sigil
#

im oldschool

tribal cypress
#

why would you for gods sake do that

eternal oxide
#

What jar are you importing?

eternal oxide
#

You linked to the repo but not the specific jar

serene sigil
lost matrix
#

You mean old school as in 1999?

serene sigil
#

and where do i find it?

serene sigil
#

1998

serene sigil
#

replace with the old?

eternal oxide
#

yes

serene sigil
#

kk

#

yay!!

#

works!

#

tysm

#

@eternal oxide

drowsy helm
#

not using maven isnt oldschool

#

its just inefficient

serene sigil
#

also, how do u send a message to the player if they clicked the message?

#

does it have to be a command?

drowsy helm
#

Yeah

serene sigil
#

isnt there an easier way?

drowsy helm
#

Nope

#

Json component can only execute commands, open link or copy to clipboard