#help-development

1 messages · Page 1542 of 1

dense goblet
#

using standard java serialisation

eternal oxide
#

So java serialization, not Bukkits

dense goblet
#

yep

granite trail
#

Why does your name reminds me "cactus"? đŸ€”

dense goblet
#

it's cactus in Hungarian 🙂

#

I'm not hungarian for the record

granite trail
#

JA OKÉ

#

XD

#

ÉRTEM

#

XD

dense goblet
#

magyar anyad kurtoskalacs

eternal oxide
#

It all depends on what is in yoru class. Every class must implement serializable

granite trail
dense goblet
#

I can't speak magyar that's the only words I know lol

granite trail
#

Ezek szerint Te egy Magyarorszåg szomszédos orszågaiban élsz.

dense goblet
granite trail
#

(the "turtoskalacs" one)

eternal oxide
#

but all fields must be primitives in the extending class

dense goblet
#

are other Serializables allowed?

eternal oxide
#

yes

dense goblet
#

okay so it does respect the super

#

that's good to know

eternal oxide
#

and no statics

dense goblet
#

statics just get ignored right

#

since they're not instance bound

eternal oxide
#

yep, same as transient

dense goblet
#

sweet

whole stag
#

Is there anyway to speed up the initial build time?

eternal oxide
#

have less code 🙂

granite trail
#

Best awnser of the year

whole stag
#

Unfortunately that's not something I have control over

quaint mantle
#

builds for java are pretty fast

#

but the best option is modularization so you can build multiple modules at once

#

Can someone tell me why this doesnt work

^([a-z][A-Z]){1,32}$([0-9]){1,4}

a#0001

sage swift
#

why $

quaint mantle
#

yeah why $

#

and [a-zA-Z] is how I see everyone do alphabet check

#

no reason to make 2 sets of characters

#

^([a-zA-Z]){1,32}#([0-9]){1,4}
With those 2 changes it works for me

sage swift
#

^

quaint mantle
#

can then remove the first grouping of () since you only have 1 character set matching

ivory sleet
#

\d instead of [0-9]

sage swift
#

and there has to be 4 lol

dense goblet
#

@eternal oxide just tested and can confirm you were right 🙂 Do you know if the serial version UID also inherits from the superclass? I don't want it changing whenever I add or remove a field, cause apparently java will handle those automatically as long as it's not a rename or type change

cyan bluff
#

basically its just to make so when you look at a player it does damage, then damage is exponential. Its a bukkit runnable and one of these is running for each player on the server. For some reason, where it says bukkit broadcast, it broadcasts the same variables twice before they change based on time. And yes I know the equation is still messed up, I'm currently trying to fix that aswell, but I dont need help for that

digital plinth
#

its possible to chaneg the texture of items with custom names, but is it possible to change texture of item with custom lore?

sage swift
#

CustomModelData?

dusty estuary
#

ok thats strange , cuz if i export the same code as a maven executable the stuff worked flawlessly
but when i put the same code in a plugin
it keep throwing error

[09:19:30] [Thread-38/WARN]: ai.djl.engine.EngineException: No deep learning engine found.
[09:19:30] [Thread-38/WARN]: Please refer to https://github.com/deepjavalibrary/djl/blob/master/docs/development/troubleshooting.md for more details.
[09:19:30] [Thread-38/WARN]:     at ai.djl.engine.Engine.getInstance(Engine.java:114)
[09:19:30] [Thread-38/WARN]:     at ai.djl.Model.newInstance(Model.java:71)
[09:19:30] [Thread-38/WARN]:     at ai.djl.Model.newInstance(Model.java:60)
[09:19:30] [Thread-38/WARN]:     at me.hasunemiku2015.buildingai.DataHandling.MLProcessor.lambda$init$0(MLProcessor.java:27)
[09:19:30] [Thread-38/WARN]:     at java.lang.Thread.run(Unknown Source)

the stuff worked fine in a standalone maven executable
i tried all the methods provided in the md , none of them work

digital plinth
#

do you deal an additional half a heart when you hit someone with a hoe?

#

answer: you dont

cyan oyster
#

. .

digital plinth
#

is anyone familiar with custom models

#
    "parent": "item/generated",
    "textures": {
        "layer0": "item/uncraftable_tipped_arrow"
    },
    
    "overrides": [
        {"predicate": {"custom_model_data":101938483}, "model": "item/garlic_arrow"}
    ]
}```
#

so whats the difference between parent and textures

#

they define the original texture of the item

#

that im using a custom model on?

hexed hatch
#

Okay so

#

Tipped arrows just don’t fucking work from what I understand

#

I’ve done a lot with custom model data, and no configuration I’ve made has been successful

#

Also, I recommend not having long CustomModelData IDs since it’s floating point and some values do not exist. Just start at 1 or 100 and go from there

sage swift
#

floating point???

sage swift
#

i'm like, 99.9% sure it's an integer

digital plinth
#

XD

sage swift
#

why would it be floating point

#

that would be retarded

digital plinth
#

tipped arrows cant have custom model data?

hexed hatch
#

Any tinted item doesn’t seem to support it

digital plinth
#

tinted item?

hexed hatch
#

Tipped arrows can be any color

#

Applied by a tint

#

Potions as well

quaint mantle
#

makes sense

#

does some secondary rendering already

hexed hatch
#

Yep

#

Also about the float thing, I might be holding on to some misinformation from a long time ago lol

digital plinth
#

oh yea thats right

#

does it?

#

wait no

#

the uncraftable arrow

#

is only pink

hexed hatch
#

It’s all the same thing, any of them can be colored

#

They’re all tinted by default

#

You can change that tint but it doesn’t change the fact that it’s tinted

#

But to answer your other question, parent determines how the item appears in the hand basically

#

generated makes it appear like a normal flat item

#

handheld will make it appear held like a tool

digital plinth
#

?

digital plinth
#

they are all the same?

#

all items?

hexed hatch
#

Yeah

digital plinth
#

well then what is it determining

digital plinth
#

tinted arrows?

hexed hatch
#

Item name, PDC, color, anything

digital plinth
#

with custom models?

hexed hatch
#

I don’t know if those use those arrows

digital plinth
#

what the author is Choco

#

XD

#

Mr. Choco, approve my premium resource~~~ Mr Choco, bring me money!!! --Lax

hexed hatch
#

Just tear apart his resource pack lol

#

I was never able to get tinted items working but then again, I was pretty stupid last I worked with it

digital plinth
#

where is choc's pack

#

uhh

hexed hatch
#

Is there a resource pack with that plugin?

digital plinth
#

not sure

#

checking

hexed hatch
#

It might just have custom model data support but not a sample pack

#

But I’m not at my PC so I can’t check

digital plinth
#

there doesnt seem to be one

#

so for the parent do i put the like

hexed hatch
#

Parent stays as generated

digital plinth
#

category of the original item

digital plinth
#

items/generated?

hexed hatch
#

Yup

digital plinth
#

or blocks/generated

hexed hatch
#

Items

digital plinth
#

okay

hexed hatch
#

item/generated*

digital plinth
#

okay thx

hexed hatch
#

In fact, you don’t really need to mess with the parent there

digital plinth
#

and for textures i put the category and name of the defualt item texture?

hexed hatch
#

Since that will change the override for the item type itself

#

Well

paper geyser
#

hey guys im new to coding java but i have a question about my code

hexed hatch
#

you’re going to need a garlic_arrow.json in your models/item folder

hexed hatch
#

?justask

paper geyser
# paper geyser hey guys im new to coding java but i have a question about my code

any idea why this isnt spawning in a slime? everything else works fine:


import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Slime;
import org.bukkit.util.Vector;

public class SpawnGerry implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {

        Player player = (Player) sender;
        Location location = player.getLocation();
        if (player.getWorld().getName().equalsIgnoreCase("flat1")) {
            player.sendMessage(ChatColor.DARK_GRAY + "" + ChatColor.BOLD + "[" + ChatColor.RED + "" + ChatColor.BOLD + "MCBT" + ChatColor.DARK_GRAY + "" + ChatColor.BOLD + "]" + ChatColor.GRAY + "Gerry is approaching...");
            Entity ent = Bukkit.getWorld("world").spawnEntity(location, EntityType.SLIME);
            Slime slimeboss = (Slime) ent;
            slimeboss.setSize(10);
            slimeboss.setVelocity(slimeboss.getLocation().getDirection().getMidpoint(new Vector(0, 1, 0)));
            player.setVelocity(player.getLocation().getDirection().getMidpoint(new Vector(0, 1, 0)));

        } else {
            player.sendMessage(ChatColor.DARK_GRAY + "" + ChatColor.BOLD + "[" + ChatColor.RED + "" + ChatColor.BOLD + "MCBT" + ChatColor.DARK_GRAY + "" + ChatColor.BOLD + "]" + ChatColor.GRAY + "You can't spawn this boss in your current world");
        }
    return false;
    }
}

digital plinth
#

i also have garlic_arrow.png

proud basin
#

so I have iPlayer.setKills(playerData.getInt("kills.amount")); in a class right and im doing iPlayer.getKills() in a different class. How come when I do get a value of 0

paper geyser
digital plinth
#

what is this

#

is this acommand

paper geyser
#

yes

hexed hatch
#

That’s the original json structure you sent I think

paper geyser
#

its a command just for now haha

digital plinth
#

wheres the cmd.getName.equalsIgnoreCase

#

what is the name for your command

paper geyser
#

my main.java is ```package com.mcbt.superflat;

import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin {

@Override
public void onEnable() {
    System.out.println("Poggers loaded");

    getCommand("sethp").setExecutor(new SetHpCommand());
    getCommand("heal").setExecutor(new HealCommand());
    getCommand("spawngerry").setExecutor(new SpawnGerry());


}

{

}

}

digital plinth
#

the original item's json

#

i dont have it

paper geyser
#

everything else works

digital plinth
#

is it not in the default pack

paper geyser
#

like when i do the command it works and stuff

#

it just

#

doesnt spawn the entity

digital plinth
#

difficulty

#

check and see if its peaceful

paper geyser
#

ok give me a second

hexed hatch
#

@digital plinth I can help you get this set up tomorrow when I’ll have my PC if you don’t end up figuring it out tonight

digital plinth
paper geyser
#

no it is called

digital plinth
#

put something like

#

it is?

paper geyser
#

it sends the message to the player

digital plinth
#

oh then it does get called

#

:/

#

nice, i guess

paper geyser
#

what was your idea?

paper geyser
#

im always open to learning new stuff anyways haha

digital plinth
paper geyser
#

also slimes spawn in peaceful dont they?

digital plinth
#

for debug

paper geyser
#

anyways the difficulty is easy

digital plinth
#

but since you ahve the .sendmsg

digital plinth
#

when spanwing?

paper geyser
#

nope

#

just says i issued server command /spawngerry

#

launches the player too

#

im using 1.17 paper

digital plinth
#

so when you run the command it sends "genry is approaching" and then nothin happens

paper geyser
#

yeah

#

it does everything except spawn the entity

digital plinth
#

its test build

paper geyser
#

ahh so its paper's fault atm?

#

or

#

spigots?

#

somewhere along the line its not recognizing that got it

#

so i should program in 1.16.5

digital plinth
young knoll
#

Are you in a worldguard region

paper geyser
#

nope

digital plinth
#

okay put a sout like in the code

young knoll
#

Or using some other plugin that would block spawning

digital plinth
#

eg: after creating the entity

paper geyser
#

aight

digital plinth
#

Entity ent = Bukkit.getWorld("world").spawnEntity(location, EntityType.SLIME);

#

after that

#

see if the code below it runs

paper geyser
#

oh it does

#

player.setVelocity(player.getLocation().getDirection().getMidpoint(new Vector(0, 1, 0))); runs

digital plinth
#

uhh how do you know that

#

oh okay

#

hmm this is weird

young knoll
#

Wait

#

You are checking if the player is in a world called flat world

paper geyser
#

yeah im in that world

young knoll
#

And then spawning the slime in a world called world

digital plinth
#

yea

paper geyser
#

OH

digital plinth
#

ohhh

digital plinth
#

👏

paper geyser
#

THANK YOU

digital plinth
#

👏

paper geyser
#

👏

digital plinth
#

👏

paper geyser
#

sorry about that guys! thank you so much for the help

digital plinth
#

Coll is a genius

paper geyser
#

coll truly is

digital plinth
#

what kind of method is that

#

custom method?

proud basin
#

yes

#

setter

digital plinth
#

too little info

#

is playerData a yml file

#

FileConfig

paper geyser
#

yup! that fixed it

#

ty coll!

proud basin
#

yml

#
File playerKiller = new File("plugins/Core/PlayerDatabase", File.separator + uuid + ".yml");
            if (!playerKiller.exists()) {
                playerKiller.createNewFile();
            }

            FileConfiguration playerData = YamlConfiguration.loadConfiguration(playerKiller);
            if (playerData.get("kills.amount") == null) {
                playerData.set("kills.amount", 1);
            } else {
                int kill = playerData.getInt("kills.amount") + 1;
                playerData.set("kills.amount", kill);
            }


            playerData.save(playerKiller);
            if (uuid.toString().equals(playerKiller.getName().replaceAll("\\.[^.]*$", ""))) {
                iPlayer.setKills(playerData.getInt("kills.amount"));
            }
#

here this may help

young knoll
#

Why would a uuid put through that replace regex equal their name

digital plinth
#

NOOOOO my custom model data didint work

#

YYYYY

#

does anyone know what i should put in the Textures

proud basin
eternal oxide
#

change the getName method to something like getId Or you are going to constantly have this confusion.

proud basin
#

I can't

#

Ask File

eternal oxide
#

then change teh variable name

proud basin
#

no I like it

eternal oxide
#

killerFileHandle or anything that is a better representation

proud basin
#

ok happy

young knoll
#

Why not just save the uuid directly as a string

#

Anyway

#

Are you sure you have the same reference in both classes

proud basin
#

yea

quaint mantle
#

How can I Check server is running?

#

I don't have an idea for this

wet breach
quaint mantle
#

Nope

#

In Bukkit Plugin

sage swift
#

in bukkit???

#

if the server is down the plugin is not enabled lol

#

or are you asking about bungee

quaint mantle
#

Ummm...

#

I just wanna make Method which always Running while Server is online

sage swift
#

well it won't run if the server is offline, sooooo

wet breach
quaint mantle
#

No

#

I'm trying to make Logging Message if MySQL has disconnected

young knoll
#

You can use a repeating task

#

Probably an async one at that

quaint mantle
#

Thx

young knoll
#

Or use something like HikariCP which will log disconnections as far as I know

wet breach
burnt current
#

Hey quick question: Does anyone know how to query in a gui or an inventory whether there is a certain item in a certain slot?

young knoll
#

Get the item in that slot and do a standard comparison

burnt current
#

okay but how can i get the item in that slot?

burnt current
#

okay thank you very much

quaint mantle
#

Hello i need help in my first plugin make basic, i getting this error

package org.bukkit.configuration does not existïżœ

someone know how to fix that?

jagged monolith
#

You shouldn't need the actual package for it, you just need to add it as a dependency and just import it

earnest sonnet
dense remnant
#
                sco = Bukkit.getServer().getScoreboardManager().getNewScoreboard();
                obj = sco.registerNewObjective("Stats", "s", "s");
                obj.setDisplaySlot(DisplaySlot.SIDEBAR);
                obj.setDisplayName(color("&7[&fTribe Wars MyStats&7]"));
                Team wins = sco.registerNewTeam("wins");
                wins.setPrefix(color("&eWins:&f "+Main.sql.getWins(uuid)));
                wins.addEntry(ChatColor.GREEN + "" + ChatColor.WHITE);
                obj.getScore(color(ChatColor.GREEN + "" + ChatColor.WHITE)).setScore(6);
                Team tkills = sco.registerNewTeam("tkills");
                tkills.setPrefix(color("&eTotal Kills:&f "+Main.sql.getTotalKills(uuid)));
                tkills.addEntry(ChatColor.GREEN + "" + ChatColor.WHITE);
                obj.getScore(color(ChatColor.GREEN + "" + ChatColor.WHITE)).setScore(5);
                Team lkills = sco.registerNewTeam("lkills");
                lkills.setPrefix(color("&eLast Fight Kills:&f "+Main.sql.getLastFightKills(uuid)));
                lkills.addEntry(ChatColor.DARK_AQUA + "" + ChatColor.WHITE);
                obj.getScore(color(ChatColor.DARK_AQUA + "" + ChatColor.WHITE)).setScore(4);
                Team bkills = sco.registerNewTeam("bkills");
                bkills.setPrefix(color("&eBoss Kills:&f "+Main.sql.getBossKills(uuid)));
                bkills.addEntry(ChatColor.YELLOW + "" + ChatColor.WHITE);
                obj.getScore(color(ChatColor.YELLOW + "" + ChatColor.WHITE)).setScore(3);
                Team tdeaths = sco.registerNewTeam("tdeaths");
                tdeaths.setPrefix(color("&eTotal Deaths:&f "+Main.sql.getTotalDeaths(uuid)));
                tdeaths.addEntry(ChatColor.RED + "" + ChatColor.WHITE);
                obj.getScore(color(ChatColor.RED + "" + ChatColor.WHITE)).setScore(2);
                Team ldeaths = sco.registerNewTeam("ldeaths");
                ldeaths.setPrefix(color("&eLast Fight Deaths:&f "+Main.sql.getLastFightDeaths(uuid)));
                ldeaths.addEntry(ChatColor.WHITE + "" + ChatColor.WHITE);
                obj.getScore(color(ChatColor.WHITE + "" + ChatColor.WHITE)).setScore(1);

I have this code. When executing it, I see a scoreboard but with only 5 entries instead of 6. (Wins are missing)
Can anyone see my mistake?

#

Also when I switch the part with Team wins with the Team lwins, everything gets shown instead of the Total Deaths lol?

dense remnant
#

nvm found my mistake

mystic tundra
#

Hi I need help

#

Im implementing another plugin as an api, but eclipse doesn’t autocomplete anything

frosty tinsel
#

Are you using maven?

mystic tundra
#

It used to, when I was a serious plugin maker, but now not even the default spigot methods get completed

#

Im just using the spigot1.8.8 jar file

#

Not sure about maven cuz I just got back into plugin making after some time

#

Oh I use Eclipse

frosty tinsel
#

Use maven

#

There should be some tutorial in spigot

mystic tundra
#

But when I used eclipse in the past it fid autocomplete

#

Ok

#

My brother (the server owner) is an old timer and doesn’t want 1.17 or anything
 even if I removed the combat timer

clear fable
#

Hey guys I am pretty new to Protocol Lib and I'm running to some issues. I am looking at the documentation for the Team packet https://wiki.vg/Protocol#Teams (spigot PacketPlayOutScoreboardTeam) but I am getting a weird error. The second field in the packet is a byte which determines the structure of the following data. I looked at the spigot source and it is in fact reading a byte after the team name (in 1.17 its PacketPlayOutScoreboardTeam line 52), but when I try to write a byte I get the following error in my console:
com.comphenix.protocol.reflect.FieldAccessException: No field with type byte exists in class PacketPlayOutScoreboardTeam.
This is my code to send the team packet: ```java
PacketContainer packet = pm.createPacket(PacketType.Play.Server.SCOREBOARD_TEAM);
packet.getStrings().write(0, "transparent"); //Set packet's team name

packet.getBytes().write(0, (byte) 3); // Set the packet type (add entry) - CAUSES THE ERROR
packet.getIntegers().write(0, 1); // Number of strings in the following array
packet.getStringArrays().write(0, new String[]{player.getDisplayName()}); // Array of entries

try {
pm.sendServerPacket(player, packet);
} catch (InvocationTargetException e) {
e.printStackTrace();
}```

#

any help would be much appreciated Please ping me

quaint mantle
#
<dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.14.4-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
earnest sonnet
# quaint mantle Yes

if you're typing import org.bukkit.configuration; it's going to throw an error because that's just a package and you aren't including any class/interface, if you want to include all the classes/interface from the package type import org.bukkit.configuration.*; (the wildcard must be there) but it isn't suggested to import everything, if you just want to use the config use import org.bukkit.configuration.Configuration;

quaint mantle
#

when i try use conf.Conf;
it throw the error i sent above i didnt type only conf

earnest sonnet
torn oyster
#
                for (int i = 10; i > 0; i--) {
                    if (parkourLeaderboard != null) {
                        if (parkourLeaderboard.size() >= 10 - i) {
                            new Hologram("" + ChatColor.DARK_GRAY + (10 - i) + ". " + ChatColor.GRAY + parkourLeaderboard.get(10 - i).replace("null", "N/A") + "s",
                                    new Location(world, x, y + (increment * i), z));
                            continue;
                        }
                    }
                    new Hologram("" + ChatColor.DARK_GRAY + (10 - i + 1) + ". " + ChatColor.GRAY + " N/A - 0.0s",
                            new Location(world, x, y + (increment * i), z));
                }```
#

why is this saying

eternal garnet
#

Is there a doc about spawning a npc?

torn oyster
#

indexoutofbounds

#

i am literally gonna cry

#

this is so annoying

torn oyster
earnest sonnet
#

are you sure it should be 10 and not 9 and be above 0 and not above or equal to ?

torn oyster
#

i have no idea

#

i am confused

#

with this

quaint mantle
earnest sonnet
earnest sonnet
#

?paste and use this please 😄

undone axleBOT
eternal garnet
#

Does anyone know how to spawn a npc? (I searched on google, didn't work...)

earnest sonnet
quaint mantle
eternal garnet
earnest sonnet
# quaint mantle Yes

that's really weird, can you upload your class? or at least part of it? that contains the imports?

wraith rapids
#

@clear fable

#

no need to thank me

clear fable
#

i-

quaint mantle
# earnest sonnet that's really weird, can you upload your class? or at least part of it? that con...
package pvp.pvp;

import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;
import pvp.pvp.commands.Test;

import java.io.File;
import java.io.IOException;

public final class PVP extends JavaPlugin {

    public static PVP plugin;
    private File customConfigFile;
    private FileConfiguration customConfig;

    @Override
    public void onEnable() {
        plugin = this;
        createCustomConfig("derpy.yml");
        this.getCommand("test").setExecutor(new Test());
    }

    @Override
    public void onDisable() {

    }



   public FileConfiguration getCustomConfig() {
        return this.customConfig;
    }

    private void createCustomConfig(String file) {
        customConfigFile = new File(getDataFolder(), file);
        if (!customConfigFile.exists()) {
            customConfigFile.getParentFile().mkdirs();
            saveResource(file, false);
         }

        customConfig = new YamlConfiguration();
        try {
            customConfig.load(customConfigFile);
        } catch (IOException | InvalidConfigurationException e) {
            e.printStackTrace();
        }
    }
}
wraith rapids
#

what is the exception exactly

earnest sonnet
#

the full stack trace please

clear fable
#

Update: I figured it out. Not at all what I thought would do it, but looking back at the spigot code it kind of makes sense? anyways here is my code: ```java
PacketContainer packet = pm.createPacket(PacketType.Play.Server.SCOREBOARD_TEAM);
packet.getStrings().write(0, "transparent"); //Set packet's team name

packet.getIntegers().write(0, 0x03); // Set Mode to 0x03 (Add entity)
packet.getSpecificModifier(Collection.class).write(0,
Collections.singletonList(player.getDisplayName())
); // Add name strings to a collection

try {
pm.sendServerPacket(player, packet);
} catch (InvocationTargetException e) {
e.printStackTrace();
}``` Apparently this works and I also did not need to include the length of the array because the collection takes care of that for me.

quaint mantle
earnest sonnet
quaint mantle
#

Oh, wait

wraith rapids
#

there is no guarantee that the world named 'world' is located at/world

#

use server.getworldcontainer or something

#

also

#

you can't force unload chunks

#

also

#

unloading the chunks doesn't unload the world

#

also

#

you can't unload the primary worlds

#

unload the world itself

#

for that, you need to create a new world that isn't a primary world

#

you can not unload the primary world

earnest sonnet
granite stirrup
#

F got a ping :(

twin venture
#

iam trying to make a prestiege system , i guess this is the best way

#

didnt finish it , and didnt test it ..

#

but before i proceed with it can anyone tell me if its the best lagless way?

#

i asked for help first so..

burnt current
#

oh yeah sure sorry

ivory sleet
#

strauss tutorial for a ban plugin you say, well ideally you’d need to have some sort of set to keep track of banned players

#

or maybe just load from a file on the async pre login event

ivory sleet
dusty herald
earnest sonnet
ivory sleet
#

Also for the record finish it and test it

burnt current
#

and if the player is in the list, do you kick him from the server directly when he joins?

earnest sonnet
ivory sleet
#

Don’t get me wrong but you would use a Set then

#

Although preferably just skip that part

burnt current
#

what do you mean with set?

wraith rapids
#

learn java

ivory sleet
#

A set is a collection of objects where every object in that collection is uniquely distinctive from any other object within the same collection

#

so it doesn’t allow duplicates with other words

burnt current
#

Oh ok thanks

ivory sleet
#

Actually you probably don’t need to optimize performance there

#

iirc long switches get compiled to maps

twin venture
#

thx ;)

#

but its for somereason not save players prestiege

ivory sleet
#

How do you save it ?

#

Pebkac issue probably

granite stirrup
#

Best app

#

Had to download the apk to install tho

twin venture
ivory sleet
#

Not what I meant

#

I mean in code obviously

dusk flicker
#

Dear lord

earnest sonnet
#

F it ,I don't know how those tags works -.-

tardy delta
#

hey I made an inventory where most of the slots are filled with glass,
so i made an array with the slot numbers , is there something like inv.setItems() or do i need to loop over the slots and put it with inv.setItem()?

noble spire
#

Okay, I did not know how wrong I was, that wrapper is so nice

#

thanks for that

minor vapor
#

np

tardy delta
#

okay

hardy swan
#

or .toList(T[] a).forEach(Consumer b)

tardy delta
#

uhh seems difficult that last one

hardy swan
#

consumer is just a functional interface which you can express in a lamba like element -> watever you wanna do with that element

#

fk that's not a really good explanation

#

just do for loop lol

tardy delta
#

xd

hardy swan
#

guys, let's say i have a chest shop plugin that I want to store sth, like pending transaction messages, into database

#

do yall prefer:

  1. retrieve all at plugin enable, storing it in-game, save when server stops/disabling plugin
  2. retrieve and save in real-time/immediately
#

maybe pending transaction message is a bad example, say sth that we will need to query from the database and with the result, execute sth in server thread

wraith rapids
#

don't do network IO on the main thread

hardy swan
#

ofc not

wraith rapids
#

then it doesn't matter

hardy swan
#

which would you have picked

quaint mantle
#

Guys was the invincible ender crystal bug patched in spiggot 1.17 too or only on paper.

hardy swan
wraith rapids
#

assuming it is bound to a player, i'd probably preload it during async prelogin

#

if not, i'd probably have the command or whatever requires the query to complete to wait off the main thread until the query completes

hybrid spoke
#

does any1 know what "Qlutch" is xD

wraith rapids
#

kind of like a clutch

#

but with a q

hybrid spoke
#

hmmmmm

#

seems like its kinda malware

#

found someone who injected one of my plugins with it xD

sweet crystal
#

does spigot have a ticket system?

hybrid spoke
#

what do you need?

sweet crystal
#

basically I looked through my purchases of my teams plugins and i have linked a purchase, spigot ID and name to a leaker from what it seems

wraith rapids
#

i should start leaking plugins

hardy swan
#

but must first have money for plugins to leak ;-;

wraith rapids
#

money isn't an issue

#

i have money

#

i just don't want to give it to the disgusting capitalist swine who sell plugins

next stratus
peak yacht
#

can someone help me identify if this is a virus/trojan
https://www.spigotmc.org/resources/pixelonmap-revision.93319/
this guys claims its a imageonmap reborn that works for 1.17 and he have a link to the original github, I installed it its a 1:1 copy of the imageonmap with no improvment, same error same lines of code, than what's the point of this single upload and the fake review? a trojan probably?
I scanned it with antimalware.jar and it says it could be a false positive
I reported it to sipgot

dusk flicker
#

@vagrant stratus that is prob a thing for you

earnest sonnet
#

Was just gonna comment it đŸ€Ł

peak yacht
#

fishy upload I know for sure optic fusion said it will take a long time to work on the new version cuz of 1.17 changes, than this dude reupload, probably a trojan

vagrant stratus
#

or it's actually working, certain plugins update faster than others đŸ€·â€â™‚ïž
I'd have to look 👀

#

One of my own resources don't need any changes and can work from 1.17 to a certain old version. If i were to support a specific event it could work on even older versions

peak yacht
#

didn't work

hollow haven
peak yacht
#

^ thanks, that's what I though

hollow haven
vagrant stratus
#

proof @hollow haven ?

#

ah

peak yacht
#

time for a restart I hope it didn't inject to another jar

hollow haven
peak yacht
#

can u tell me if it inject it self to something elese

#

or just a standalone

vagrant stratus
#

Ah, i just looked at the jar myself :p

paper viper
#

What does it do

#

Lol

peak yacht
#

I knew it 😛

paper viper
#

Like the back door

peak yacht
#

but guys am I safe for just deleting it

#

or should I replace every single jar

#

just to be safe

vagrant stratus
#

Stupidly simple to add a detection method to my Anti-Malware command

hollow haven
peak yacht
#

I did thanks

#

but damn I am smart, I knew it was fishy

#

I reported to spigit but please report again so they can really look into it, they might think I am just trolling

hollow haven
#

I reported it

peak yacht
#

thanks man

cosmic patrol
earnest sonnet
#

Who the heck names the backdoor backdoor

vagrant stratus
#

You'd be surprised

cosmic patrol
#

Gotta find they way to your own back door ofc

#

Otherwise you can't use it

hybrid spoke
#

lmao

#

Backdoor.class

vagrant stratus
#

We got a UUID!
ab044426-bfe4-4347-842b-6fb5e9dda265 -> Meecka

hybrid spoke
#

did he at least obfuscate it a bit?

cosmic patrol
#

😂 what an idiot hahaha

hybrid spoke
#

damn

#

even my plugins have a better backdoor

#

wait what

cosmic patrol
#

A 0 for effort, that's for sure

vagrant stratus
#

Most malicious plugins don't have obfuscation đŸ€·â€â™‚ïž

hybrid spoke
#

@vagrant stratus do you know what "Qlutch" is?

vagrant stratus
#

ye, ran into it a few times already

hybrid spoke
#

what does it do?

vagrant stratus
#

malware, variety of malicious commands

hybrid spoke
#

ah

#

found someone who injected it to a copy of my plugin and uploaded it somewhere lol

stone sinew
#

I remember a plugin on spigot that had a force op. Instead of removing the resource staff just put a warning on the resource page saying it has a force op in certain versions xD

earnest sonnet
vagrant stratus
#

not the first time

stone sinew
#

Yeah it was a kingdom plugin. When I get on PC later I'll see if it's still up

vagrant stratus
#

there was what... 73 others i found..

rocky glacier
#

Does any1 know how i could do something like that:

#

with colors and placeholders

#

like the stock banners on websites yk what i mean

frosty tinsel
#

Do you have any mods?

rocky glacier
#

no need it with plugins or texturepack or a combo

spring river
#

With hidden armor stand whoes are teleport each tick to be placed on the top screen of the targeted player i think @rocky glacier

hybrid spoke
#

ew

#

that would cancel every interaction, block place, hit (...) the player could make

hybrid spoke
#

would use a custom texturepack and modify the bossbar

hybrid spoke
dire marsh
#

what the fuck

rocky glacier
hybrid spoke
#

googled for my plugin and found it. had to laugh xD

dire marsh
#

and why would anyone get plugins on shady sites

hybrid spoke
#

"literally took under 5 minutes to inject"

dire marsh
#

for a free plugin

hybrid spoke
#

he flexxed with it

#

felt good

nova notch
#

is there any simple way to raycast or do i have to make my own?

soft dragon
#

!paste

#

!help

#

?paste

undone axleBOT
hybrid spoke
nova notch
#

basically shifting a location forward until it hits something

hybrid spoke
#

ah nvm

nova notch
#

oh

hybrid spoke
#

Ray casting is the methodological basis for 3-D CAD/CAM solid modeling and image rendering. It is essentially the same as ray tracing for computer graphics where virtual light rays are "cast" or "traced" on their path from the focal point of a camera through each pixel in the camera sensor to determine what is visible along the ray in the 3-D sc...

nova notch
#

uhhh

hybrid spoke
nova notch
#

ok

marble granite
#

PortalCreateEvent doesnt seem to be called for end portals, is there another way i can achieve the creation being cancelled?

wraith rapids
#

depends on your definition of raycast

frosty tinsel
wraith rapids
#

if you mean searching for blocks or entities or shit, there are the World::rayTrace methods and others

nova notch
#

ok cool

#

so i guess its called raytracing on here

#

same thing

wraith rapids
#

semantically not quite the same but practically synonymous

keen kelp
#

?spoon

undone axleBOT
#

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

torn frost
#

can prefix have spaces like this? or no space?
prefix: test 1

earnest sonnet
#

Daaam I like this bot, good bot

hybrid spoke
torn frost
#

plugin.yml

torn frost
bright jasper
#

What you guys think so far

#

Based on the screenshots on the git

ivory sleet
#

You want code review or what exactly?

compact haven
#

well packages should be lowercase

#

that I can tell u from first glance

bright jasper
#

Well based on the screenshots does it look nice

compact haven
bright jasper
#

It should?

compact haven
#

yes

#

but the design itself looks good (the screenshots)

bright jasper
#

The design in the screenshots is modifiable (on the minecraft end)

#

so the formats can be changed actually, those are just the defaults i put

#

which use the lesser known &x hex thingy

wraith rapids
#

hmm a reimplementation of an enermous plugin by a guy who doesn't know the java naming conventions

bright jasper
#

I don't primarily do java

compact haven
#

dont be mean to the guy :<

wraith rapids
#

i am mean to whomever I deem fit

ivory sleet
#

Riku may I make some points?

bright jasper
#

I'm not new to programming, I just don't use java often unless its for minecraft and even then its rarely

#

Yeah sure

bright jasper
#

But yeah I agree i wouldnt trust it if it wasnt mine either 😆

ivory sleet
#
  • The class constants is weird (with the nested class), I know this is a common practice in other stuff but not in Java.
  • For the JDA instance, maybe provide custom executors since a lot of other plugins might be using the common pool.
  • frozenPlayers could be a Set<UUID> also remember to follow SOLID (Liskov Substitution Principle) so a Map map = new HashMap is preferred over HashMap map = new HashMap.
  • Also pointing out lombok might be trippy to use if others are going to depend on that (without an API?).

There was probably more stuff but this is just some stuff 😄

unreal quartz
#

only looked at the first few lines of your main class but your use of Objects.requireNonNull is incorrect as it will throw an exception if it's null, not a check if it's null

bright jasper
#

I need to look through it more though

#

If something is wrong i would prefer to throw a simplified error as well as print the exception though in most cases

stray halo
#

Hello, i've just moved to 1.17, and, has the way we send packets changed?

#

cause it gives me some errors

bright jasper
unreal quartz
#

if you want it to fail gracefully and give the user a nice error message then you can check if the config options == null before trying to initialise the bot

#

because the end user won't understand what NullPointerException means

bright jasper
#

I should also most likely make a config class since some options go hand in hand

#

I shouldnt be querying YamlConfig in the commands lmao

#

This was a quick 3 day draft as it stands

#

Also whats the issue with Lombok or is it one of those super opinionated type things

ivory sleet
#

No I am not talking about using it internally

#

I mean for interfacing like an API

#

Imo you shouldn’t enforce the Lombok dependency on your api users.

bright jasper
#

Oh right because lombok uses an intellij plugin to even recognize the fields

#

đŸ€Ą

#

I forgot that

ivory sleet
#

Uh yeah people who don’t use lombok will get some source not matching issues and other incompats

bright jasper
#

I was thinking about moving this plugin over to kotlin(I come from rust, wont be a huge curve)

ivory sleet
#

No

bright jasper
#

But not sure how people will react to that if it gets popular

ivory sleet
#

Lmao sure

#

I mean you can still provide interfaces to make a solid API

bright jasper
#

Yeah true

#

Welp id say its ok for a first draft but yeah needs some cleanup for sure

ivory sleet
#

Anyways not too bad (:

stray halo
#

can someone reply? It's really important

ivory sleet
#

I said no

bright jasper
#

In reply to lombok, what about AutoValue which doesnt use plugins and is vanilla?

#

Or is it simply unconventional to use annotations for that so merge mixups will happen

ivory sleet
#

Haven’t looked at that

stray halo
bright jasper
#

most people have no idea exactly what changed lmao

stray halo
#

thx riku

quasi flint
#

How can i remove the collison from my custom villager nms entity?

#

tried setting boundingbox but not workin

wraith rapids
#

the bounding box is reset every tick

quasi flint
#

;7

#

well then back to building a pen for him

hybrid spoke
#

isn't there a #setCollidable method?

#

oh custom nms mh

#

not sure if it still works

wraith rapids
#

entity collisions are two way

#

if you don't want your entity to collide with another entity, both entities must have collisions set to false

#

though apparently there is some sort of an exception list now

#

i've never used it so i don't remember how it works exactly but you could look into it, it might do what you want

quaint mantle
#

dude didn't even check if the very same method they named exists

#

why

#

and with what

wraith rapids
#

not a development question

quaint mantle
sage swift
#

Leave Server

quaint mantle
#

you leave the server

#

lol

hardy swan
#

what is not a developer question

vital swift
#
    @EventHandler(ignoreCancelled = true)
    public void onBuild(BlockPlaceEvent e) {
        if (e.getBlock().getType().equals(Material.MOB_SPAWNER)) {
            e.setCancelled(true);
            Bukkit.getScheduler().runTaskLater(Main.getPlugin(), () -> {

                e.getBlock().setType(Material.MOB_SPAWNER);
                e.getBlock().setData((byte) e.getPlayer().getItemInHand().getDurability());
                ItemStack i = e.getPlayer().getItemInHand().clone();
                i.setAmount(1);
                e.getPlayer().getInventory().removeItem(i);
            }, 2);
        }
    }```
I'm trying to make spawners placeable
#

and it's becoming Pig

wraith rapids
#

that's not how spawners work

vital swift
#

\o/

hardy swan
#

since spawners can spawn any entity, and Item is an Entity. It can spawn any items?

ivory sleet
#

yes

hardy swan
#

wow

ivory sleet
#

or I believe so

vital swift
#

wait no

#

Without this code

hardy swan
#

spawn arrows and fireballs?

#

XD

vital swift
#

when i place for example Zombie spawner

#

it becomes Pig if im not OP

#

im trying to fix this

ivory sleet
#

actually it might only be for certain spawn groups solarrabbit

hardy swan
#

hmm

wraith rapids
#

i'm fairly sure they can spawn just about anything

#

back in the day there were contraptions that worked by using spawners that spawned fallingsand entities to build structures and shit

#

not totally sure about projectiles, though

vital swift
#

What im trying to do is make spawners placeable

#

because for example if i place Skeleton it becomes Pig

#

Without having OP

wraith rapids
#

that is caused by paper or essentials item filtering

vital swift
#

Paper

#

how to fix it?

wraith rapids
#

disable it in the settings

vital swift
#

which settings?

wraith rapids
#

i don't remember, ask them

vital swift
hardy swan
wraith rapids
#

the people at help server don't know about paper settings

#

majority of the people here are bumbling buffoons who couldn't run a server even if their life depended on it

vital swift
#

😂

#

im just going to code

#

can't restart my server

#

so basically this is advanced help-server 😂

hardy swan
#

I think

#

you can

#

approach papermc's discord

vital swift
#

ill do it in code

quaint mantle
#

Hey! So at the moment I am using this as my MOTD class (down there) to set the network's MOTD via a Bungeecord plugin I'm working on, I noticed if I space out the motd text I can get it centred on my screen, but when other screen sizes ping the server, the MOTD is no longer centred.

To fix this, I am looking for a way to set a perfectly centred MOTD every time but I can't seem to find a way to do it. Anyone got any solutions? Thanks 🙂

Current code:

    @EventHandler
    public void onPing(ProxyPingEvent e){
        ServerPing serverPing = e.getResponse();
        serverPing.setDescription("Motd text here");
        e.setResponse(serverPing);
    }
mortal hare
#
    @SafeVarargs
    @SuppressWarnings("varargs")
    public static <T> List<T> asList(T... a) {
        return new ArrayList<>(a);
    }
#

my life is a lie

#

asList is just an ArrayList

#

with capacity set

bright jasper
#

Im thinking for my plugin i should make a few new classes, PlatformPlayer for example

#

or PlatformPlugin

mortal hare
#

wait no

#

it has its own implementation of array list

bright jasper
#

Would be cool if I could support both spigot and sponge using those

mortal hare
#

wat

mortal hare
bright jasper
#

They need to, I know plot2 does it too

#

Well, it doesnt implement sponge but has the platform class

mortal hare
#

well sponge is dead

#

i wouldn't support it

bright jasper
#

Its not, its just not as active

mortal hare
#

i would rather keen on fabric instead

#

with sodium and phosphor

bright jasper
#

does fabric do server stuff at all?

#

like a good server api

mortal hare
#

yes

#

its a server

#

like a forge server, but more optimized

bright jasper
#

đŸ€Ą This knowledge might make me entirely move to fabric even for vanilla

mortal hare
#

its focuses on vanilla

#

aspects

#

more

bright jasper
#

I already use fabric in my client

mortal hare
#

it promises non breaking mob farms

#

that work both on single player and multiplayer

bright jasper
#

Fabric is a mod API, like FML but entirely server sided in most ways unless you dont want it to be server sided

#

thats what makes it really good

mortal hare
#

Forge is pretty much dead

#

due to its implementations fabric is taking over its popularity

bright jasper
#

Forge is yeah

mortal hare
#

i havent used forge since 2017

bright jasper
#

Forge has LOTS of modpacks on it though

mortal hare
#

ever since i used rift or fabric

bright jasper
#

Forge is a lot easier to make big client modpacks for

#

Stuff with custom models and shaders and stuff like that

#

Fabric is more client experience tuned

chrome beacon
#

Forge is better if you want modpacks and stuff
Fabric is better if you want client or server side only mods

this is what I've found at least...

#

Fabric also patches less of vanilla so the experience is closer

fickle shadow
mortal hare
#

i prefer fabric

#

100%

dusk flicker
#

Stop asking in multiple channels

mortal hare
#

even if its harder to make mods for

#

its still better in my opinion

wraith rapids
#

ban

bright jasper
#

Fabric straight out just replaces a shit ton of bad MC code with close to vanilla results
Which is the good way to do this

fickle shadow
dusk flicker
#

It says how to build it.

fickle shadow
#

i do that and it denies me

#

look up in general like 3 lines

dusk flicker
#

then you did something wrong ¯\_(ツ)_/¯

mortal hare
#

due to its fast maintainability forge will never win the race of releasing first

#

heck even mods update more quickly on fabric

#

not because the update taking long on forge side

fickle shadow
#

i did literally everything it says to do

chrome beacon
#

Well it fails to find the PlotSquaredAPI

fickle shadow
#

mvn clean install -f pom.xml -Denv.BUILD_NUMBER=1000 = 5.0-BUILD-1000 -Denv.JOB_NAME=SimplePets_v5

ivory sleet
#

or not rly

#

but they piss me off

dusk flicker
#

I'm going to be using Fabric for my lastest gen servers in the next few months

chrome beacon
bright jasper
ivory sleet
#

Well what if I told you Fabric is walking towards what Forge is as of now, for instance all their useless refactors of names with the yarn mappings

dusk flicker
#

That's what I was planning for my private stuff cause I need vers for Spigot, Bungee, and multiple vers

bright jasper
#

I mean... forge was never meant to be used for regular servers the way bukkit is. Fabric atm is currently still trying to be useful to people who just wanna run a normal server

#

And its really good for it. Now would i CAN see happening is the same shit that happened to sponge

#

SpongeForge/SpongeVanilla

#

Two separate versions that internally functioned differently for different uses

#

The big reason Bukkit is kind of... outdated right now is the stupid legal shit that happened in 2016 that has left the entire main API in a state of unmoving limbo

#

đŸ€Ą

#

Never change your license lmao

wraith rapids
#

more like just blatant stubbornness to not change anything in fear of causing api breakage and breaking those 1.8 plugins that everybody still totally uses

bright jasper
#

That is the other reason yes

tardy delta
#

is this slot 0 or 1?

slim kernel
#

0

wraith rapids
#

java is zero indexed

tardy delta
#

okay

wraith rapids
#

all indices start from 0 unless explicitly stated otherwise

bright jasper
#

tfw some asshat makes skript but with lua instead

#

Oh actually I thought of something a little stupid but what if someone makes an agnostic API for plugins that uses Graal

#

Literally write plugins in any language, would be a cool project with a bit of a... skewed practicality

proud basin
#

Mr Skull head it still returns 0 even if its set and the file is saved

hardy swan
#

works for literally any EntityType wow

dusk flicker
#

Lmao

tardy delta
#

when you forget to to put slot 1 smh

dusk flicker
#

That's interesting

hardy swan
#

can make an indoor snow with this

dusk flicker
#

What is that glass pane texture holy

tardy delta
#

idk I thought it was the default one

hardy swan
#

maybe barebones

hardy swan
tardy delta
#

kinda weird i made a gui and it uses the same clickevents as the previous one

#

ah its using the same event

kind coral
#

hi guys one question, i have a luckyblock plugin and it executes commands in a list, tho i would like for it not to spam in the console, is there a way so i can hide the executed commands by the plugin?

dusk flicker
#

Woops didn't mean to tag you

dusk flicker
#

Weird

stone sinew
#

The above method is exactly the same but like I said... only shows DARK_OAK_LOG

#

And that method checks the result item for recipes... I want to check if the item is smeltable.

lunar schooner
#

Hi there, anyone know if it's possible to change the mining speed of a block through a plugin?

tardy delta
dusk flicker
tardy delta
#

I've a question: is there a way to get the name or something of the inventory in the InventoryClickEvent

#

bcs i have multiple custom inventories and they all have the same functionality

eternal oxide
tardy delta
#

and wdyml compare it to yours? they're all the same class the custom ones

eternal oxide
#

when you create an inventory you create an instance

quaint mantle
#

how to get main class's things (that are possibly private) to listener? (using listener registration + without getInstance)

eternal oxide
#

You then make the player open that inventory

tardy delta
#

yes

eternal oxide
#

when he clicks inside the inventory the event passes back an Inventory reference

#

so compare the Inventory to the instance you told him to open

regal moat
#

i tried to change the f in false to t to make it true lmao đŸ€Ł

lucid bane
regal moat
#

i am a dumbass

stone sinew
# dusk flicker Woops didn't mean to tag you
public boolean isSmeltable(ItemStack item) {        
    Iterator<Recipe> recipes = Bukkit.recipeIterator();
    while(recipes.hasNext()) {
        Recipe r = recipes.next();
        if(r instanceof CookingRecipe) {
            CookingRecipe<?> cooking = (CookingRecipe<?>) r;
            if(cooking.getInputChoice().test(item)) {
                return true;
            }
        }
        if(r instanceof FurnaceRecipe) {
            FurnaceRecipe fr = (FurnaceRecipe) r;
            if(fr.getInput().getType() == item.getType()) {
                return true;
            }
        }
    }
    return false;
}
``` Had to add `if(cooking.getInputChoice().test(item)) {`
whole stag
#

Is there a list of all spigot server versions somewhere?

ivory sleet
#

wiki page

whole stag
#

👍

lucid bane
#

Player.Spigot spigot = new Spigot();
BaseComponent message = new TextComponent("String");
spigot.sendMessage(ChatMessageType.ACTION_BAR, p.getUniqueId(), message);

#

console says Not Supported yet

#

anything wrong in my code?

torn frost
#

hi sir or ma'am, can i know if you can have spaces in prefix in plugin.yml ?

lucid bane
#

Im using spigot 1.17

worldly ingot
#

pls don't create new instances of Spigot subclasses lol

#

player.spigot()

tardy delta
bright jasper
#

if you know lua you know programming enough to use java

#

...

ivory sleet
#

Uhh

#

Yeah I guess

opal juniper
#

lua is a garbagio language that shouldn't exist

ivory sleet
#

Lua does have oo and is multi paradigm

tardy delta
#

oo

#

👀

opal juniper
#

object orientation

weary geyser
#

Lua's indexing starts from 1 lmao

tardy delta
#

thought this guy

opal juniper
weary geyser
#

^

tardy delta
#

true

ivory sleet
#

I like that

#

A lot

#

It makes more sense doesn’t it

opal juniper
#

NO

tardy delta
#

no

ivory sleet
#

Justify

opal juniper
#

it makes sense for stoopids who dont know computers

weary geyser
#

This is not spigot-related, but does anyone know how to detect when the mouse has stopped moving in java swing?

tardy delta
opal juniper
#

however if you are a computer intellectual then you would know that counting starts at 0 because the byte is:
00000000

ivory sleet
#

Can you use KeyListeners for it?

weary geyser
#

You need to use MouseInputAdapter

opal juniper
#

so starting from one just is a waste

weary geyser
#

I think that I can write a timer

#

To check if I'm not receiving events anymore

ivory sleet
#

Yeah either that or temp cache it

weary geyser
#

Yeah

tardy delta
#

stuck inside my code tutututut

woven epoch
#

Anyone have a good resource on patching plugins into a spigot jar?

opal juniper
#

why would you do that

tardy delta
#

does that makes sense

marble granite
#

to what event should i listen to detect an ender eye placement? blockPlaceEvent doesnt work..

tardy delta
#

-setstatus

#

owh

ivory sleet
marble granite
#

ohhhh

#

thx

tardy delta
#

i thought this was something from @queen dragon

woven epoch
quaint mantle
opal juniper
woven epoch
#

I don’t want to have to drag plugins into the folder when I deploy a new server, I could write a script to do it, but it’s more about the principle

hybrid spoke
#

so you want to have everything in your spigot jar?

opal juniper
#

yeah he wants his plugins patched into the jar

woven epoch
#

Well I would only be using one plugin and It’s one I’m writing now

#

Because I can easily deploy a new network server with pterodactyl to scale, but I want to patch it into one jar to be able to not have to use the plugins folder, just patch, build, restart, and it takes effect across all restarted servers

hybrid spoke
#

so for the protocol. you want to turn the server software, which contains the public api, into a giant unnecressary plugin to.. just don't have any plugins?

opal juniper
#

yep

woven epoch
#

Well, yes!

#

All I was asking was if someone had resources on something like that

opal juniper
#

Nobody does this lmao

#

They just download the plugins from some either local or remote repo

#

Preferably local for speed

woven epoch
#

It seems some people do

hybrid spoke
#

maintaining such a resource is a huge timewaste

woven epoch
#

Why? I’d just be maintaining my code and just updating to the latest build of spigot when it comes out

tardy delta
#

?paste

undone axleBOT
hybrid spoke
#

throw your idea away and dig it into the ground

#

put some lava on it

#

and let it become obsidian

opal juniper
#

minecraft joke hahayes

clear galleon
#

If you open a new inventory while a player already has one open does it call an inventorycloseevent ?

hybrid spoke
#

should

opal juniper
#

i imagine

#

its not the PlayerClosesInventoryEvent after all

#

I got an idea for a plugin.

Player opens inventory -> Close inventory again

Player Close Inventory -> Open Inventory again

#

(not a greifing plugin)

hybrid spoke
tardy delta
#

can someone please take a look at this, I made two classes: GUI and an eventlistener
The gui class makes specific ingame menus
it has a trail menu and a trade menu
the classs has a method register() that checks a string given at the constructor that looks for its function and binds the correct gui to it

and the listener gives an execution for it
but i need to check which gui is the user wanting in his command so i use gui.getID() which returns it function but i can only have 1 function so i always has the same slots where can be clicked on etc and i want to make it supports different actions so the problem is it when i make an object of gui it always has the same slots that can be used
https://paste.md-5.net/oqocijikad.cs

#

please tag me in response

clear galleon
#

What would be a good way to distinguish between whether the player is actually closing the inventory or a new one is being opened

torn frost
opal juniper
#

It’s fine until someone opens their inventory

hybrid spoke
#

and compare the inventories

clear galleon
#

Could i use player.getopeninventory in the close event handler to get the new inventory and check for null or something

hybrid spoke
#

if you want to have it exactly maybe compare the miliseconds between the closing and opening

#

since they should be pretty low

#

idk if there is a more efficient and better way, never did something like that

hybrid spoke
clear galleon
#

What would be returned for no inventory open then

#

What is "internal crafting view"

hybrid spoke
#

playerinventory

#

the crafting field

clear galleon
#

So if they have none open it returns their inventory?

hybrid spoke
#

yup

clear galleon
#

Got it ty

#

I'll try retrieving the new inventory in the event

twilit nexus
#

hey peoples

#

how would i get the keys from this: plugin.getConfig().getConfigurationSection("ShowSettings").getKeys(false).forEach(key ->{ });
and then put them into a list?

cyan bluff
#

What to do about this? in eclipse

bright jasper
#

How does one stop a plugin in onEnable

#

and say "this shit failed to load"

wraith rapids
#

early return and tell the plugin manager to disable your plugin

bright jasper
#

how does one get pluginmanager

quiet ice
#

Bukkit

bright jasper
#
        try {
            database = new Database(getDataFolder());
        } catch (SQLException e) {
            getLogger().severe("Unable to create database");
            e.printStackTrace();
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }
#

good?

quiet ice
#

myes

wraith rapids
#

if you have any logic in your onDisable, make sure that it knows that the plugin didn't enable fully

twilit nexus
quiet ice
#

If it is in your onEnable it is better to throw an exception like throw new RuntimeException(e);

wraith rapids
#

you for example don't want to try closing connections that don't exist to begin with, or save data that wasn't initialized at all

#

@twilit nexus no helping is forbidden

twilit nexus
#

oh

#

finnneee

quiet ice
#

Why not new ArrayList<>(plugin.getConfig().getConfigurationSection("ShowSettings").getKeys(false))?

eternal oxide
quiet ice
#

Otherwise you could do

List<String> list = new ArrayList<>();
plugin.getConfig().getConfigurationSection("ShowSettings").getKeys(false).foreach(list::add);

if you need to have the foreach, but it is a bit inefficent

wraith rapids
#

it's better to use the constructor with a collection as it avoids needless resizing

eternal oxide
#
List<String> keys = new ArrayList<>(blah.getKeys(false));```
twilit nexus
#

will this work with tab completion?

wraith rapids
#

if you make it work with it, yes

cyan bluff
#
package corePack;

import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;

public class EventCore implements Listener{
    
    @Override
    public void onEntityDamageByEntity(EntityDamageByEntityEvent e) {
        
    }
}

Then I get the error "The method onEntityDamageByEntity(EntityDamageByEntityEvent) of type EventCore must override or implement a supertype method"

quiet ice
#

just wanted to have the foreach alternative known since that is what the user asked, even if it is not ideal

wraith rapids
#

you don't add overrides for event handlers

#

you add @EventHandler

cyan bluff
#

dammit i might be drunk

wraith rapids
#

override is for when you are overriding a method, which you are not

cyan bluff
#

thanks

smoky oak
#

How to check if a player can interact with a block (IE open, mine etc?)? I'm using the PlayerInteractEvent, is that the right one?

#

^ referring to line of sight

quiet ice
#

@Override is always optional

granite stirrup
quiet ice
#

many sadly

#

far too many

granite stirrup
#

i like all lowercase

twilit nexus
#

thanks

granite stirrup
#

org.gstudiosx.core

twilit nexus
#

I just had it there because I thought I needed it

quiet ice
twilit nexus
#

oh

#

aight

quiet ice
#

It is more or less an oversimplified for (var a : iterable) { /* code */}

#

not great for performance too

cyan bluff
quiet ice
#

YES IT IS

granite stirrup
humble musk
#

What we tryna do here?

granite stirrup
humble musk
#

I might help while watching cringe intros

twilit nexus
#

oh lol, I am going for the best performance I can get, so thanks for that geol

granite stirrup
#

forEach performance wise you should just use for (var a : iterable) { /* code */}

cyan bluff
granite stirrup
hybrid spoke
granite stirrup
hybrid spoke
#

there is just the method call

#

which isn't performance abusive at all

quiet ice
#

no

granite stirrup
hybrid spoke
#

yep

granite stirrup
#

its much different

quiet ice
#

that is wrong

hybrid spoke
#

its not

granite stirrup
#

IT IS

hybrid spoke
#

proof me wrong

quiet ice
#

Bytecode

cyan bluff
quiet ice
#

Fine, I'll compile it myself

granite stirrup
#

searched google

wraith rapids
#

that doesn't really say anything about this case

hybrid spoke
#

Iterator and for-each loop are faster than simple for loop for collections with no random access, while in collections which allows random access there is no performance change with for-each loop/for loop/iterator.

#

yeah

#

searched google

granite stirrup
#

you can still use it but you wouldnt want to if you want to have better before

hybrid spoke
#

no performance change

granite stirrup
#

no

hybrid spoke
#

maybe a few nano seconds

granite stirrup
#

nah