#help-development

1 messages · Page 1983 of 1

trail pilot
#

really i dont get it its to define and declare thing on it

#

but wat

brave sparrow
#

Then you’re unlikely to get a great computer science course load, even universities are struggling to find competent CS faculty

trail pilot
#

cuz cost much

#

lel

brave sparrow
#

Then you’ll pretty much have to teach yourself

river oracle
#

Google is your best friend

brave sparrow
#

Because you’re not gonna learn very much in a high school CS course

trail pilot
#

im still an 15 kid so i have time to learn sht

maiden thicket
tall dragon
#

imagine using bing 😂

trail pilot
#

no gogle is bad

#

😄

late pilot
#

is there any way to figure out what plugin it is without knowing it?

#

on a general server?

maiden thicket
maiden thicket
#

no there isnt unless someone didnt block the dump commands and plugins commands

wanton remnant
#

it does not work

maiden thicket
#

i dont know if spigot has a dump command

maiden thicket
river oracle
trail pilot
late pilot
#

on a server there is a plugin but idk the name. so i want to understand it

maiden thicket
#

it is?

maiden thicket
#

xd

trail pilot
#

calculator

brave sparrow
trail pilot
#

KermitCrazy that crazy

maiden thicket
maiden thicket
wanton remnant
late pilot
#

the server isn't mine

maiden thicket
#

pov MC got me into CA

#

cs

river oracle
tall dragon
river oracle
#

For hex you need it

late pilot
maiden thicket
#

what does the plugin do

late pilot
#

because i want to insert in my server

maiden thicket
#

what does it do

late pilot
#

wait a moment

maiden thicket
#

plugin

#

🗿

trail pilot
# maiden thicket sure

tbh i search thing for skid- i mean took the code and understand what do, but i find only ppl talk about the thing and i cant skid- i mean took the code D:<

late pilot
trail pilot
#

hmm

maiden thicket
#

naming conventions tho

wanton remnant
# maiden thicket code?
@EventHandler(priority = EventPriority.HIGH)
    public void onPlayerChat(AsyncPlayerChatEvent e) {
        Player player = e.getPlayer();
        PlayerInfo playerInfo = new PlayerInfo(player);
        LuckPerms luckPerms = LuckPermsProvider.get();
        User user = luckPerms.getPlayerAdapter(Player.class).getUser(player);
        String prefix=user.getCachedData().getMetaData().getPrefix();
        String suffix=user.getCachedData().getMetaData().getSuffix();
        

        if (!e.getMessage().isBlank()) {
            e.setFormat(prefix +" "+player.getName()+suffix+ " §f » ");

            for (Player players:Bukkit.getOnlinePlayers()){
                e.getRecipients().remove(players);
                if (e.getMessage().contains(players.getName())&&!players.equals(player)){
                    players.playSound(players.getLocation(), Sound.ENTITY_EXPERIENCE_ORB_PICKUP,1.0F, 1.0F);
                }
                players.sendMessage(ChatColor.translateAlternateColorCodes('&',e.getFormat() + e.getMessage()));
            }
        }

    }```
maiden thicket
#

mans writing C# conventions in java

late pilot
trail pilot
#

i need to make a local database in .db format

tall dragon
#

and once again. i would not even use a var boolean but if you really want to use one, use the primitive type instead of the wrapper

maiden thicket
trail pilot
late pilot
brave sparrow
#

No @quaint mantle

#

You can’t assume the shooter is a player either

#

You can’t cast without checking

#

Or a dispenser

#

Or a Ghast

#

If you cast without checking it will also error

wanton remnant
brave sparrow
#

You have to check with instanceof first @quaint mantle

late pilot
#

@maiden thicket

wanton remnant
tardy delta
#

why do people clone itemstacks?

tall dragon
#

make sure you login as its premium

late pilot
#

aaah ok

#

wait i create an account

wary harness
#

So I got small problem I noticed storing player object to my BeastPlayer class
got some weird results for exampel I try to access player inventory and there diffrent result

#

then from Bukkit.getPlayer

brave sparrow
#

Why are you modifying the cancelled status at all if it’s null

wary harness
#

if inventory get changed there is no changes to player object in BeastPlayer class

#

should I not store player object

#

it that bad practice

#

I thing then I am better just with storing uuid

tall dragon
#

dont store the player object

brave sparrow
#

Return or just do nothing

tall dragon
#

always retrieve it lazily using the uuid

maiden thicket
#

use bungee's chat color api

#

not bukkit's

wary harness
#

and making method getPlayer in side class which will run Bukkit.getPlayer(uuid)

late pilot
wanton remnant
maiden thicket
#

oh

late pilot
wary harness
maiden thicket
#

because u use the wrong symbol

#

ur using §#

late pilot
#

k

maiden thicket
#

but translating &

late pilot
wary harness
#

@tall dragon I was reading on forum that it is ok to store Player object

#

so got confused there

maiden thicket
#

its ok but not good practice

brave sparrow
#

It’s fine as long as you clear the reference when the player disconnects

wary harness
#

in my case object stuck and dosent notice changes

late pilot
#

anyone have a pl with this description? "in this plugin you can create armors that give advantages (translated via google translator)"

wary harness
#

ok I get it

brave sparrow
#

As long as you remove the reference when the player leaves it’s fine

tall dragon
late pilot
wary harness
#

Thanks for info

tall dragon
late pilot
#

uh

#

ok thx

late pilot
#

rip

maiden thicket
#

login bro

late pilot
#

i just loggined

maiden thicket
#

make a new account if it doesnt work

late pilot
maiden thicket
#

click forgot password if it doesnt work

late pilot
brave sparrow
#

Did you verify your email?

late pilot
#

how?

maiden thicket
#

🦧

tall dragon
#

Idk new accounts might not be able to view premium

brave sparrow
#

You have to verify your email

late pilot
brave sparrow
#

Like every other internet site

late pilot
late pilot
wanton remnant
maiden thicket
wanton remnant
#

1.17, and i've test in 1.17.1 but before i does have this problem

tall dragon
maiden thicket
#

can i see ur imports

#

@wanton remnant

wanton remnant
tardy delta
#

imports

late pilot
tardy delta
#

was just going to say that :C

wanton remnant
tardy delta
#

what isnt working?

#

the hex colors translation i assume

maiden thicket
#

yeah

#

that

tardy delta
#

so no § before it

maiden thicket
#

dont u have to surround in parentheses

#

or no

vestal moat
#

hi im making a mod for client and a plugin for spigot, and im having problem with spigot one

tardy delta
#

surround what in parentheses

vestal moat
#
public void onEnable() {
        getServer().getPluginManager().registerEvents(this, this);
        this.getServer().getMessenger().registerOutgoingPluginChannel(this, "meteorclient:main");
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent e) {
        getServer().getScheduler().runTaskLater(this, () -> {
            ByteArrayDataOutput out = ByteStreams.newDataOutput();
            out.writeUTF("moduledisable");
            out.writeUTF("{\"modules\":[\"packet-canceller\"]}");
            e.getPlayer().sendPluginMessage(this, "meteorclient:main", out.toByteArray());
        }, 5);
    }```
maiden thicket
#

the hex code

vestal moat
#

im not receiving it at all

tardy delta
#

uhn mo

vestal moat
#

on my client i only receive brand and register

maiden thicket
#

o

vestal moat
#

nothing else

#

if someone knows why bukkit doesnt send it please tell me

late pilot
tardy delta
#

this is an example: "#83c916You left the channel {0}"

viral crag
vestal moat
#

disable*

viral crag
#

good luck

vestal moat
#

they wont be enabled again until disconnecting

#

not the case

brave sparrow
#

@vestal moat I believe you have to register the channel for the player too

vestal moat
#

no

#

paper support told me its because client isnt registering the channel

viral crag
#

That is not how server-client works, you can only ask the client to do something and in almost all cases it will ignore the request. So the fallback is disconnecting them on the serverside with a message.

brave sparrow
#

It appears you’re correct

brave sparrow
brave sparrow
viral crag
#

If that were true, then the anticheats would use it

brave sparrow
#

Well no

#

A hacked client wouldn’t support it

vestal moat
#

the client is for anarchies not to hack on minigames and stuff

#

on anarchies you can limit dangerous hacks

#

thats what im doing

brave sparrow
#

Clients that are trying to get approved by servers to use will usually support this functionality so servers can turn disallowed things off

#

A hacked client is never going to be approved by a server so it wouldn’t support it

vestal moat
#

anarchies do approve them

sacred mountain
#

why is there no getFloat in FileConfiguration

viral crag
#

The only one that I am aware of that works that way is badlion when you install the anticheat on the client computer

brave sparrow
#

In the same way that a hacked client is going to send a vanilla brand but a legit client sends a modified brand

vestal moat
#

but they wish to limit them, for example flight could be so fast that it could kick you, it could be better if client didnt even increase speed from the first place

brave sparrow
vestal moat
#

Could not find org.spigotmcspigot1.17-R0.1-SNAPSHOT.

#

ok

#

why is gradle not resolving spigot

#

but resolves spigot api

#

i wanna use nms rn

tall dragon
#

did you run buildtools

brave sparrow
#

You have to use buildtools

tall dragon
#

on that version

brave sparrow
#

Spigot can’t host spigot in a publicly accessible way

vestal moat
#

oh

#

so it goes to maven local?

tall dragon
#

yh

#

exactly

sacred mountain
#

:D

raw ibex
#

when an event happens, say BlockBreakEvent, and someone breaks the block below them (they start falling into a hole underneath that block they broke) and i use setCancelled(), will it tp them back up to that block after it replaces it or will it keep them falling

brave sparrow
#

The movement never happens because the break is cancelled

#

As far as the server is concerned the block was never broken so there was never empty space to fall into

#

And therefore the server will just autocorrect the movement

raw ibex
#

@brave sparrow Thank you :)

#

Helps a lot

vestal moat
worldly ingot
#

instanceof BlockProjectileSource

tall dragon
#

what do you want to achieve tho

#

and how do you know that dispenser is property of that same player

#

unless you want to remove all damage to players from dispensers

sacred mountain
#

can someone help me with lombok getters? im trying to get values from a config using a library and its just throwing null exceptions and invocation exceptions. basically im creating a getter class that will return values from the config, but its currently returning null

worldly ingot
#

No, the shooter can be a block

#

getShooter() returns a ProjectileSource, which can be one of many things

tall dragon
#

could even be Choco

#

who knows :D

worldly ingot
#

Of which includes BlockProjectileSource

fervent gate
#

can you get the gameprofile of someone who has never visited your server?

#

I have some names, I just need to grab their skin and use that. I need a gameprofile for that

#

thx, I'll try that

sacred mountain
#

my getter is returning null, im using lombok

before the screenshot is just more private finals, and it has a static Config config and @Getter for lomnbok

#

but none of those values are returning anything

#

my paths are correct

ivory sleet
#

Maybe just no Lombok, like don’t use it (=

sacred mountain
#

every* value*

ivory sleet
#

Could basically write out the getter instead

sacred mountain
#

then i would have to do 100+ methods

#

that return

ivory sleet
#

Well depends on how your infrastructure looks like

sacred mountain
#

well its not too complicated, its pretty much just the normal bukkit fileconfiguration

#

but its annoying having to type the path

ivory sleet
#

Btw you probably want to avoid letting that input stream be there forever

#

Looks like a leak

sacred mountain
#

mk so only on startup?

ivory sleet
#

try (InputStream in = …) {

}

#

Yes that one

#

Use try with resources

#

Or at least invoke ::close on it

sacred mountain
#

alr

#

one sec

#

erm

#

the /config.yml is in my plugin files

#

it doesnt throw FileNotFound or anything

#

okay yk what maybe typing out the path is easier ._. ill try getters for 30 more minutes and if i cant find anything i will just type the path

sacred mountain
#

ok what does it offer

waxen plinth
#

You don't have to manually save or load anything

sacred mountain
#

so

waxen plinth
#

It does it all for you with just a few method calls

sacred mountain
#

setting and getting values

#

is easy

waxen plinth
#

It puts config values into fields

sacred mountain
#

does it support just yaml or

worldly ingot
#

Yes, though you can join those if statements.

sacred mountain
#

toml etc

waxen plinth
#

And it can automatically deserialize complex objects

sacred mountain
#

and does it keep comments

waxen plinth
#

It's yaml only but you could easily adapt it to toml or json

waxen plinth
#

Yes it supports comments

sacred mountain
#

sounds neat

#

can you give an exmaple?

#

of how you would setup

#

and get values

#

and set them

worldly ingot
#

There's really no way to do that. A dispenser could fire randomly as well, doesn't have to be from user input. e.g. a redstone clock. Or a comparator. Or a daylight sensor

inland siren
#

will i be attacked if i ask a very brief nms question 🥺

sacred mountain
#

no

inland siren
#

did mc just say go away to transaction packets

#

in 1.17

#

simply cannot find where they were remapped to

worldly ingot
#

Yeah that's probably fine

waxen plinth
#
@ConfigMappable
public class Config {
  public static int num = 5; // 5 will be the default value
  @Comment("stuff") // adds a comment in the config file
  public static Map<Material, List<String>> map; // it will automatically determine how to convert this
}```
#

Basic example

worldly ingot
#

Chestplate, yeah

waxen plinth
#

I can give you the wiki article if you want a full tutorial on how to use it

worldly ingot
#

PlayerInventory should have a getChestplate() method iirc

sour socket
#

What's the CoinfigurationSection method to get an array from config?

waxen plinth
#

I used a class with static fields in this case but you can also use an object

sacred mountain
waxen plinth
#

You would just access the fields

sacred mountain
#

just like Config.num

waxen plinth
#

Yup

sacred mountain
#

ok cool

waxen plinth
sacred mountain
#

can i import my own config tho

waxen plinth
#

There's the guide

sacred mountain
#

i have a file already

sour socket
#

Is this even an array:

messages:
  - "BLA"
  - "a"
  - "lmfao"```
sacred mountain
#

im fairly sure

#

idk

sour socket
#

Oh mk mk

#

String list oksi

#

Aightt

waxen plinth
sour socket
#

betbetbet

waxen plinth
#

But the idea is to not need that

sour socket
#

so getStringList is the function

#

it better be

waxen plinth
#

Just put all the default values in the fields and it will generate the default config as needed

sour socket
#

or else...🔪

#

Die spigot

waxen plinth
#

No

mint mesa
#

Hello folks. I feel like im extra stupid today. I am tryna make something start when 2 players are inside the server. so I used Bukkit.getWorld(e.getPlayer().getWorld().getName()).getPlayers().size however when I make it equal 2, it requires a third person joining to trigger the event. So I tried it with equals 1, and that only lets 1 player in, but it starts the event. What am I missing?

waxen plinth
#

You're comparing ItemStack to Material there

#

And use == for enums please

worldly ingot
#

No but you can do .getType() on ItemStack

mint mesa
#

^^

worldly ingot
#

I've a feeling getChestplate() is nullable though

#

it is

#
ItemStack chestplate = player.getInventory().getChestplate();
if (chestplate != null && chestplate.getType() == Material.ELYTRA) {
    // do your thing
}```
mint mesa
#

if(p.getInventory().getChestplate().getType() == Material.ELYTRA){

#

no u ad .equals

#

had*

waxen plinth
#
if (Optional.ofNullable(player.getInventory().getChestplate().map(ItemStack::getType).orElse(null) == Material.ELYTRA)```
mint mesa
waxen plinth
#

😎

inland siren
#

if it's just within the server

#

Bukkit#getPlayers()

mint mesa
#
@EventHandler
    public void onLogin(PlayerLoginEvent e) {

        World world = e.getPlayer().getWorld();

        List<Player> players = ((World) world).getPlayers();

        Integer size = players.size();

        if(size == 2) {
            e.disallow(PlayerLoginEvent.Result.KICK_FULL, "server is full");
            Bukkit.broadcastMessage("Starting game!");
            System.out.println(playerList);
            GameStart.Start(playerList.get(0), playerList.get(1));


        }else{
            e.allow();
            playerList.add(e.getPlayer());

        }
        System.out.println(Bukkit.getWorld(e.getPlayer().getWorld().getName()).getPlayers().size());
    }```
waxen plinth
#

getOnlinePlayers*

inland siren
#

oh

#

yeah

#

i'm smart

waxen plinth
#

Are you sure you don't want PlayerJoinEvent

mint mesa
#

smarter than me

waxen plinth
mint mesa
waxen plinth
#

I love optionals for that lol

#

It's kinda pointless here

worldly ingot
#

because optionals are ugly in return values most of the time, but they're even uglier in direct calls :((

mint mesa
#

would PlayerJoinEvent work better though?

waxen plinth
#

But it can save a ton of null checking boilerplates

quaint mantle
#

16

worldly ingot
#

Earlier than that iirc

#

14

quaint mantle
#

Optionals looks mich nicer rather if(smth == null)

woeful crescent
#

what packet is sent to the client for item meta?

waxen plinth
#

​        ​LORE​((a, b) ​-​>​ ​Optional​.​ofNullable(a​.​getItemMeta())​.​map(​ItemMeta​::​getLore)​.​equals(​Optional​.​ofNullable(b​.​getItemMeta())​.​map(​ItemMeta​::​getLore))),

#

This used to be like 10 lines

worldly ingot
#

Yeah that definitely doesn't look nice haha

waxen plinth
#

It's a bit ugly

mint mesa
#

lemme try playerjoinevent

worldly ingot
#

That's one of the least readable things I've seen in Java lol

quaint mantle
# worldly ingot 14

It was a preview feature then and you werent able to use it without a flag

waxen plinth
#

But preferable to 10 lines of just null check after null check

#

So I prefer it

#

I wonder if it would be simpler with a stream

worldly ingot
waxen plinth
#

Probably not lol

mint mesa
#

still only starts the game when 3 players join

quaint mantle
#

bruh bumping after 2 minutes

worldly ingot
#

am speshul

#

nah, server boosters can use 'em

woeful crescent
late pilot
#

have anyone the pls "ecoarmor"? can you upload to me pls?

woeful crescent
#

this is the place for development help, not cracked plugins lol

late pilot
#

yeah

#

._.

quiet ice
#

@Auxilor

tall dragon
late pilot
#

kk

#

can you accept ?

#

driend request

quiet ice
#

Also, pretty sure that that plugin is open source

late pilot
#

no only for dm after i do you can remove

quiet ice
#

I have no idea why you want to get a copy of that plugin from a potentially unsafe source if you can just compile it yourself

late pilot
#

sry for my english

#

how? sry

quiet ice
#

It's just as easy as installing https://adoptium.net/ and invoking ./gradlew build or something.
It probably requires NMS

Eclipse Adoptium provides prebuilt OpenJDK binaries from a fully open source set of build scripts and infrastructure. Supported platforms include Linux, macOS, Windows, ARM, Solaris, and AIX.

quiet ice
#

You probably shouldn't use that plugin then

late pilot
#

k

fossil lily
#

How can I do area damage?

sacred mountain
#

if i run somethjing once, can i change that value manually and get the value?

#

will it update i mean

quiet ice
#

what exactly do you mean there?

sacred mountain
#

for instance if i initialize a variable like

public int number = config.getInt("testpath.int");

and then i change it in my config, when i get the value like

System.out.println(String.valueOf(TestClass.number))

#

will it update

#

since im getting a path

#

or will it not change because its not getting the path again?

quiet ice
#

it will not update

vestal moat
#

rror: cannot access PacketLoginInCustomPayload
import net.minecraft.network.protocol.login.PacketLoginInCustomPayload;

#

how can i fix this

quiet ice
#

primitives do not denote a reference

vestal moat
#

gradle is too annoying

inland siren
#

is there a reference to server specific protocol changes in 1.17 anywhere

#

genuinely think mojang just did away with transaction packets

#

and im bout to be sad

#

unless spigot remapped them somewhere

quiet ice
inland siren
#

mc just making a wild change with that wtfrick

#

lame

viral crag
#

well, march 10th is coming

fervent gate
#

Anyone have any experience with LibsDisguises?

cloud current
#

Hi

#

I'm trying to serialize/deserialize ItemStack (red_sand here) and I get this error ```java
Caused by: com.fasterxml.jackson.databind.JsonMappingException: Infinite recursion (StackOverflowError) (through reference chain: net.minecraft.world.level.block.BlockSand["E"]
->net.minecraft.world.level.block.state.BlockStateList["b"]
->net.minecraft.world.level.block.BlockSand["E"]
->net.minecraft.world.level.block.state.BlockStateList["b"]
->net.minecraft.world.level.block.BlockSand["E"]
->net.minecraft.world.level.block.state.BlockStateList["b"]
->net.minecraft.world.level.block.BlockSand["E"]
->net.minecraft.world.level.block.state.BlockStateList["b"]
->net.minecraft.world.level.block.BlockSand["E"]
->net.minecraft.world.level.block.state.BlockStateList["b"]
->net.minecraft.world.level.block.BlockSand["E"]
->net.minecraft.world.level.block.state.BlockStateList["b"]
->net.minecraft.world.level.block.BlockSand["E"]
->net.minecraft.world.level.block.state.BlockStateList["b"]
->net.minecraft.world.level.block.BlockSand["E"]
->net.minecraft.world.level.block.state.BlockStateList["b"]
->net.minecraft.world.level.block.BlockSand["E"]
->net.minecraft.world.level.block.state.BlockStateList["b"]
->net.minecraft.world.level.block.BlockSand["E"]
->net.minecraft.world.level.block.state.BlockStateList["b"]
->net.minecraft.world.level.block.BlockSand["E"]
->net.minecraft.world.level.block.state.BlockStateList["b"]
-> ............. and it is infinite ..........................

#

my method is just ```java
public static String itemStackToBase64(ItemStack itemStack) {
try {
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
BukkitObjectOutputStream dataOutput = new BukkitObjectOutputStream(outputStream);

// Write the size of the inventory
dataOutput.writeObject(itemStack.serialize());

// Serialize that array
dataOutput.close();
return Base64Coder.encodeLines(outputStream.toByteArray());

} catch (Exception e) {
e.printStackTrace();
}
}

mint mesa
#

Alright guys

#

my brain isnt working and I think theres an easy solution to this

#
if(size == 2) {
            e.getPlayer().kickPlayer("Lol");
            Bukkit.broadcastMessage("Starting game!");
            System.out.println(playerList);
            GameStart.Start(playerList.get(0), playerList.get(1));


        }else if(size < 2){
            playerList.add(e.getPlayer());
            size++;

        }```
#

I need to get the game to start when the player count (size) reaches 2

#

however it only checks if its 2, when a third player attempts to join

#

since we only want two people joining, obviously needing a third to join isnt good

#

what do I do in order for the game to begin as soon as a second player enters the server

delicate lynx
#

what is playerList

mint mesa
#

its the list of players that are gonna be partaking in the game

delicate lynx
#

so you only want 2 people, then just if there are 2 people, don't add them to the list

mint mesa
#

well see. When the first player joins. The player count is 0, so the if statement skips to the "else" statement

#

same goes for the second player

#

since size is 1

#

it skips to else

#

now we are on 2

#

PlayerJoin

#

I tried using playerlogin

#

same result

#

see this is why

#

I come here

#

why didnt I think of this

sleek pond
#

The docs don't have anything, but does the respawn (or the spawn event) event get called when a player logs in?

fossil lily
#
                        Bukkit.getScheduler().scheduleSyncRepeatingTask(instance, new Runnable() {
                            @Override
                            public void run() {
                                hitground.put(p.getUniqueId().toString(), 0);
                                while (hitground.containsKey(p.getUniqueId().toString())) {
                                    if (p.isOnGround()){
                                        p.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 40, 100));
                                        // p.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 40, 0));
                                        Location location = p.getLocation();
                                        World world = p.getWorld();
                                        List<Entity> nearby = p.getNearbyEntities(4, 4, 4);
                                        for (Entity tmp: nearby)
                                            if (tmp instanceof Damageable)
                                                ((Damageable) tmp).damage(15);
                                        world.spawnParticle(Particle.EXPLOSION_LARGE, location, 10, 1, 1, 1, 1);
                                        hitground.put(p.getUniqueId().toString(), 0);


                                    }
                                }

Anyone know why this code would stop my server lol?

It has something to do with the while loop

tall dragon
#

probably an infinite loop?

tall dragon
fossil lily
#

it still doesnt work with this added :(

sleek pond
#

Why do you use string instead of the actual uuid object btw

delicate lynx
#

it depends what hitground is

#

what objects does it hold

sleek pond
#

Lmao

#

Valid

fossil lily
torn badge
delicate lynx
#

why are you scheduling a task with -1

#

yeah

#

that's the period to repeat

#

so -1 means it will never run lol

torn badge
#

And why nested tasks

waxen plinth
#

I'm pretty sure anything less than 1 is treated as 1

#

Wait

delicate lynx
#
hitground.put(p.getUniqueId().toString(), 0);
hitground.remove(p.getUniqueId().toString());
#

also that

waxen plinth
#

I know 0 is treated the same as 1

#

Oh yeah I think you are actually right

#

-1 means no repeat

#

Scheduling a delayed task just schedules a task with a period of -1

delicate lynx
#

I'm just guessing negative time would just never run

waxen plinth
#

No it runs once

#

But doesn't repeat

delicate lynx
#

ah

fossil lily
#

Yea its -1 so that it does it once

#

And idk how else to do the schedual

#

Is that the cause of the server stopping?

tall dragon
#

i mean, you should have some kind of error or thread dump if the server just stops

#

where you can find out what exactly is the problem

fossil lily
#

k il do that

waxen plinth
#

I mean the outcome is the same but it's more explicit in its purpose if you use the dedicated method

fossil lily
#

how :P

waxen plinth
#

BukkitScheduler#scheduleSyncDelayedTask or runTaskLater

fossil lily
#

Ive looked all over google and i cant find it lul

#

mmkay

#

il try that

somber hull
#

Just a thought that popped into my head

#

Can I make a plug-in like as a joke that literally just gives specifically me op

#

And put it on spigot?

somber hull
brave sparrow
#

That’s not a joke

#

That’s a back door

#

Lol

somber hull
#

Ok but like

#

They know it is

tall dragon
#

Thats just force op

somber hull
#

I’m not thinking of doing it

#

I’m just curious if you would get in trouble for that?

brave sparrow
#

Probably

tall dragon
#

I think it would not be allowed even when stated what it does

somber hull
#

Idk I just thought of it lol

tall dragon
#

Why would you even want to put that on spigot

brave sparrow
#

You’re not the first person to think of it and wouldn’t be the first person to do it

somber hull
#

Or wait

somber hull
#

What about blacklisting specific people from using your plugin

#

Is that allowed?

#

Off the top of my head say if someone stole your plugins and made YouTube videos for them

#

Could you make it so that username can’t excel Ute commands?

#

Or would that be against the rules?

fossil lily
#

I dont understand :(

tall dragon
somber hull
#

Is it a npe?

tall dragon
somber hull
#

Does it say null?

fossil lily
#

oop yep im blind

#

one sec

somber hull
#

Help

fossil lily
#

here we go

#

i still dont understand

somber hull
#

@quaint mantle join the thread

tall dragon
fossil lily
tall dragon
#

Yea looks like its still an infinite loop

#

You should have some kind of hard limit

fossil lily
#

but why?

somber hull
#

IsOnGroudn is depreciated

fossil lily
#

Yea i know

#

:D

somber hull
#

Is it through the paper api?

tall dragon
#

That woulnt matter tbh

fossil lily
#

No

somber hull
#

Hover over it and see the depreciation message

fossil lily
#

very helpful

somber hull
#

It’s bad

fossil lily
#

Okay thats not the problem

#

15 seconds is enough for it

somber hull
#

Got it

#

You should check the block below the player

tall dragon
#

@fossil lily add a hard limit. Then start with some debugging

somber hull
#

If you want to be accurate

tall dragon
somber hull
#

The isonground is one of those cases where you shouldn’t use it

#

But

#

Not the end of the world if you do

tall dragon
#

I mean for plugins like anticheat. No you shoulnt use it. But for a simple cosmetic effect. Why not?

somber hull
#

Idk I wasn’t paying attention to what he was making

sterile token
#

Oh really thanks. I didnt know it was that simply

somber hull
#

F

#

Glad you fixed it

sterile token
#

What problem do you have? i can help you

tall dragon
#

I mean thats your choice but i dont see any problem in this case

sterile token
#

Why a constructor on main class?

somber hull
somber hull
#

Perks of being new/bad at java*

tall dragon
#

Which woulnt matter for a simple effect

#

To me at least

sterile token
#

Hmn? i didnt understand

somber hull
#

If your not new then no copy@paste angry

#

😡

sterile token
#

Lmao i would never do that

somber hull
#

Cause you never make mistakes

#

That would be impossible

sterile token
#

I remember a friend injected a spywhere on his pc because he copy-paste a project from github and executed on his pc

worldly ingot
# somber hull Don’t use depreciated methods

For Player#isOnGround(), it's not a "avoid using, there's an alternative". It's just a warning saying that you should not rely on it as the client can spoof the value and lie to the server

#

You can use this method. You will achieve the same effect as looking at the block below the player

#

Remember, deprecated doesn't always mean removal. Use at your own risk, check the deprecation notice

somber hull
#

Alr

fossil lily
#

aight please dont hurt me for asking this 🐶 || how do you set a hard limit?||

dont read it if you're mean

tall dragon
somber hull
#

Why not make an api or library they all use

fossil lily
#

oh YES

#

i remember learning that

proud basin
tall dragon
somber hull
proud basin
#

ah

#

So I'm using a session connector with DriverManager to get the connection but for some reason I'm getting access denied for user even though all of the info is correct. What is weird about this is that I do it this way with other projects but for this one it doesn't like it. java connection = DriverManager.getConnection(String.format("jdbc:mysql://%s:3309/%s?useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=CET"))

fossil lily
#

AM I STUPID

proud basin
#

What?

fossil lily
#

That should set a hard limit right?

tall dragon
#

yea, thats a very short one but sure

fossil lily
#

ye

#

IT STILL

#

CRASHED

#

its not an infinite loop error

#

i dont think thats the problem

tall dragon
#

it could be...

#

i++ outside if statement

fossil lily
#

uGh

tall dragon
#

increment i outside p.isOnGround

fossil lily
#

oki

#

aight

#

it doesnt crash

tall dragon
#

indeed

fossil lily
#

so now I need to find the error?

tall dragon
#

so bassically you want to detect when a player hits the ground & perform some actions correct?

tall dragon
#

so you understand why your server was crashing right?

fossil lily
tall dragon
#

well bassically either p.isOnGround never returned true on time before it crashes

#

this is why you dont use a while loop

fossil lily
#

What would be a good replacment?

tall dragon
#

i used to do this with a repeating runnable on 1 tick

tall dragon
# fossil lily What would be a good replacment?

i can send you a method. but you're not gonna be able to directly copy me and i don't want you to. as im using some of my api methods to achieve it. but you can easily make it work for your case

fossil lily
#

Okay

tall dragon
#

/**
     * Runs a timer task with the tick period of 1 and will trigger your hit listener
     * when the given entity isOnGround. If the entity gets removed before it hits
     * the ground, nothing is called
     * <p>
     * The fly listener is called every tick
     *
     * @param entity
     * @param timeoutTicks
     * @param flyListener
     * @param hitGroundListener
     */
    public static void track(Entity entity, int timeoutTicks, Runnable flyListener, Runnable hitGroundListener) {
        if (flyListener == null && hitGroundListener == null)
            throw new FoException("Cannot track entity with fly and hit listeners on null!");

        Common.runTimer(1, new BukkitRunnable() {

            private int elapsedTicks = 0;

            @Override
            public void run() {

                // Cancel after the given timeout to save performance
                if (elapsedTicks++ > timeoutTicks) {
                    cancel();

                    return;
                }

                // Cancel when invalid
                if (entity == null || entity.isDead() || !entity.isValid()) {
                    if (entity instanceof FallingBlock && hitGroundListener != null)
                        hitGroundListener.run();

                    cancel();
                    return;
                }

                // Run the hit listener
                if (entity.isOnGround()) {
                    if (hitGroundListener != null)
                        hitGroundListener.run();

                    cancel();

                } else if (flyListener != null)
                    flyListener.run();
            }
        });
    }

now i know this might be close to spoon feeding. but you're still gonna need to figure some stuff out on your own.

lost sedge
#

Is the maven updated for 1.18.2, if there even is a build for it yet idk

fossil lily
#

hM

tall dragon
fossil lily
#

Still a little confusing but il try to figure it out

#

You've helped enough

#

yes

tall dragon
fossil lily
#

ik

#

i want to too

tall dragon
#

alright then. goodluck

#

any inventory?

olive lance
#

Armor stand maybe

#

But idk

tall dragon
#

you know you could just check javadoc yourself

#

javadoc is your friend

#

i mean, if you want to check if the whole inventory contains an itemstack of type elytra, yes

#

yea, then this check should work fine

somber hull
#

No…

#

@quaint mantle @tall dragon unless I’m incredibly stupid

#

The inventory is a list of ItemStacks

#

So you would have to check if it contains the item stack new ItemStack(Material.ELYTRA)

#

And even then, if the name is changed or it has any NBT data then that wouldn’t work

#

You would have to loop through the inventory and check if the material is elytra

tall dragon
somber hull
#

Thank you

tall dragon
#

your way is a possibility too tho

#

this does the same behind the scenes

somber hull
#

Yea

#

Didn’t realize spigot had a method for it

main dew
#

How I can check if player be on ground?

main dew
# tall dragon

Yea I shouldn't use this method but what method is good?

tall dragon
main dew
tall dragon
main dew
#

I want check it in PlayerMoveEvent

tall dragon
#

okay... that doesn't give me much information

worldly quest
#

what would be the best way to have like a 5 second timer per player?

main dew
tall dragon
#

what ru trying to achieve as end result

worldly quest
tall dragon
#

you don't need a scheduler for command cooldowns

main dew
tall dragon
main dew
warm stirrup
#

Hi guys, excuse me i made a simple plugin just to test if it was working in the server. After that i deleted it from the Plugins folder, but for some reason it still working .-.

main dew
# tall dragon yes. but why.

I mean, this is probably the most important information but I want check if Player land on ground to teleport player

warm stirrup
#

yea

#

i did

tall dragon
tall dragon
main dew
warm stirrup
main dew
main dew
tall dragon
#

all the isOnGround method does is check if there is a solid block under the player

#

so just do the same

#

but for getTo()

warm stirrup
#

How do you guys restart your server? just close the terminal o u do something else

tall dragon
#

i type /stop

#

then close the terminal

#

but that should not matter

main dew
tall dragon
#

why would those blocks result in a different outcome.

main dew
tall dragon
#

does it have to be this precise?

#

well i think you could also shoot a ray downward untill it collides with something and check its length

worldly quest
#

anyone know how i could make it so i could have a command on like a 5 second cooldown

tall dragon
main dew
main dew
tall dragon
golden turret
#

is there a way to make the fish bite the hook faster?

crisp arch
#

hey does anyone know how to get the two items to be combined from the PrepareAnvilEvent

golden turret
crisp arch
#

i thought it would be a method like getResult()

golden turret
#

inventory from here

delicate lynx
#

getResult() gets the end item, but if you want to get the 2 middle items, you would get the anvil inventory, then get item 0 and 1 as Wizardly said

#

0 being the most left item, 1 being the middle

crisp arch
#

ty wizarldy & hyperdefined

#

it feels a bit inconsistent tbh

golden turret
fossil lily
#

k so

#

im back

#

Im stuck again

golden turret
#

set the bite chance?????????

fossil lily
#

It just doesnt work

delicate lynx
#

I guess it doesn't exist then anymore

fossil lily
#

Everything around it works

delicate lynx
#

does the stuff in if (p.isOnGround()) run?

hasty prawn
#
new BukkitRunnable() {
  @Override
  public void run() {

  }
}.runTaskLater(this, 5); //You need to do something like this at the end
terse panther
# golden turret set the bite chance?????????

In Spigot words the method setBiteChance does: 'Sets the chance of a fish biting.
0.0 = No Chance.
1.0 = Instant catch.'
So it's for decrease the time catching, so maybe the methods 'setMinWaitTime()' and 'setMaxWaitTime' could help you

golden turret
#

yes, i guessed that

fossil lily
hasty prawn
#

Message below

delicate lynx
#

also shouldn't everything be put under run()?

fossil lily
#

It is

delicate lynx
#

oh nevermind I misread a bracket

#

read what DessieYT said

worldly quest
#

for checking if a player is in an area should i just check for x and y at the same time or x, then if they pass that check, check for y coords

#

i want to display a title when a player is in a certain range of coordinates but i dont know really how to keep checking without destroying my server, if that does destroy a server checking coords every PlayerMoveEvent

crisp arch
#

anyone know a way to make a pickaxe look enchanted without having any enchant, but not hiding any enchants

#

im making a custom enchant and i still want players able to see other enchants

tender shard
#

am I stupid or just blind? WHAT THE FUCK is the purpose of the Holder class?

tender shard
#

if you have a custom enchant, you can use that to make it glow

#

just add your custom enchant & you're done? I don't understand the problem

tender shard
#

I don't understand at all what you're trying to do - you want to enchant an item with your custom enchantment without adding any enchants and also you do not want to hide non-existent existing enchants?

#

whut

sharp flare
#

Confused

tender shard
#

me too

ornate heart
#

Is there any efficient way at storing the location of blocks that are placed. I suspect a sqlite database may be best for this? Not sure.

sterile token
#

What buffer amount would i need to allocate for writing/reading diff java types (string, int, double, etc)?

tender shard
tender shard
#

doesn't bufferedreader/writer do all that on its own?

ornate heart
tender shard
# ornate heart Yes.

I'd go for a "proper" DB like mariadb/mysql. sqlite is fine too, but definitely not yaml files for this one

#

normally I always say "yaml is fine to store data", but not for suuuuch a large amount of data

sterile token
tender shard
#

for a few thousands, yaml is no problem at all

#

just think about this - a location reference is maybe, idk... 32 bytes? now you have 5000 location references in your list - that'd be about 0.16 MB in total. No problem at all

#

yeah so you'll basically have some kinda list or set with a list of locations

#

and you have to check them in every blockbreakevent

#

if you don't have a million blocks, no problem at all

#

yeah no problem IMHO

#

just be sure to turn them into a location in onEnable() instead of comparing strings everytime

#

wdym?

#

what exactly is yuor question?

#
  1. Loop over getConfig().getConfigurationSection("stations").getKeys(false)
  2. It will return a list like '-374_77_1268', etc
  3. Now you can get ghat configurationsection and loop over all keys inside 'stations.' + stationName + '.blocks'
cursive crow
#

is there anything like ExactChoice but for shapeless recipes?

tender shard
cursive crow
#

the documentation says it's only valid for shaped recipes

tender shard
#

hm? where does it say that?

tender shard
#

no, it gives you a ConfigurationSection, obviously

#

you have to loop over the keys again (getKeys(false)), which returns a list of all "keys" inside that

cursive crow
tender shard
#

then you can get the value for each of that, using getString(key)

young knoll
#

The documentation is outdated in that regard

cursive crow
#

i heard exactchoice breaks them

young knoll
#

I believe it even works for furnace recipes and what not

tender shard
cursive crow
#

alright then

cursive crow
#

i'm just going recipe by recipe making it so if i use a custom item it returns air

tender shard
#

no idea why it says "Only valid for shaped recipes"

young knoll
#

It’s outdated

#

I’d update it but I’m not sure if there’s anything it still doesn’t support

worldly ingot
#

because it doesn't work for shapeless recipes

tender shard
#

I will check it again

#

my Recipy plugin uses it and it has always worked fine

valid solstice
#

how to make player undergo riptide animation without them moving or actually using riptide?

tender shard
#

what is riptide again?

valid solstice
tender shard
#

I think I never ever saw that one lol

valid solstice
#

you use a trident then it launches you, and also plays a spin animation

tender shard
#

oooh

#

okay

#

you'll probably need NMS for this

quaint mantle
#

Enchantment

tender shard
tender shard
#

SHapelessRecipes actually always just go by material

#

@cursive crow

golden turret
young knoll
#

Fix it

cursive crow
#

nevermind i did it with preparecraftingevent or whatever it's called

#

if the crafting inventory has an item with the same custom model data as my custom item it returns air

tender shard
#

isn't that event cancellable?

cursive crow
#

i have no clue what i'm doing, i'm just happy it works

tender shard
#

you should rather just do event.setCancelled(true)

cursive crow
#

i don't think PrepareItemCraftEvent has that

tender shard
#

oh well okay then I guess it's fine to use Material.AIR

young knoll
#

I believe that’s what I did

#

Or null

#

Idk

tender shard
#

erm what the

#

I have looked for the "Maven" button for hours

#

then I found out it's at the bottom lol

cursive crow
#

How can I constantly spawn torch fire particles near a player's feet?

young knoll
#

Use a runnable/the move event

#

And spawnParticle

cursive crow
#

Thank you

tender shard
#

if you wanna do it for all players - a runnable is the way to go. if it's only for a few players, I'd use the PlayerMoveEvent

cursive crow
#

yeah i'll probably just put it in my armor logic runnable

#

it'd be much better if i didn't constantly check the armor players are wearing and only checked when equipping/deequipping it but i don't care enough and i doubt it's going to impact performance, it's a survival server with 10-15 players at most

sterile token
#

Its hearts too much

hybrid spoke
sterile token
#

How to write a byte[] array to a simply byte?

young knoll
#

You want to turn an array into one byte?

sterile token
young knoll
#

Wat

sterile token
#

Because the shity ByteBuffer class doesnt support adding a byte[] array

young knoll
#

You can’t just turn multiple of something into one of something

sterile token
#

Oh its a better way to do it?

#

I explain what im doing, im trying to create a class for reading/writing primitives (String, int, byte, etc) so i was using ByteBuffer class

sterile token
#

Which class i can use?

tender shard
#

that's like asking "how can I turn my whole family into one person"

hexed hatch
sterile token
#

Because i need a class for storing indexes and primitive values

#

So what do you recommend?

young knoll
hybrid spoke
#

just eat them

sterile token
#

Oh im ignored 💔

#

Hahaha

hybrid spoke
#

2 blocked messages

worldly quest
#

is there a way to slowly change the color of a piece of glass

#

or not really "is there" but how would i do that

young knoll
#

Not really

hybrid spoke
#

smooth transitions? no

young knoll
#

You only got 16 colors to work with, you can’t interpolate between them

hybrid spoke
#

but you can change every x seconds, minutes, years the "color"

young knoll
#

Or do you just want rainbow glass

worldly quest
#

yea every few seconds

#

not really a fade i know that isnt possible sadly

young knoll
#

Store the locations and change them with a runnable

hybrid spoke
#

?scheduling and replace the block every x seconds

undone axleBOT
tender shard
worldly quest
#

what if i wanted it to always be changing color even if it was being held

young knoll
#

You’d have to have a runnable for that too

worldly quest
#

but how would i actually change the block

young knoll
#

In the world or the inventory

#

Actually it’s technically the same either way

#

setType

golden turret
young knoll
#

Yes

sterile token
#

so??

#

What i can use to store (read and write) primitve values??

young knoll
#

Like

#

In memory or on disk?

sterile token
#

Memory

young knoll
#

What’s wrong with the existing types

sterile token
#

Which ones?

#

I tried ByteBuffer couldnt do it

young knoll
#

byte int double float

sterile token
#

You are not understanding

sterile token
worldly quest
# young knoll setType

wouldnt it break the runnable if the chunk wasnt loaded/player went offline/server restarted

sterile token
young knoll
#

You need to store the block locations somewhere

brave sparrow
worldly quest
sterile token
#

I will traslate it

brave sparrow
#

An array which could accept any of the primitives

#

But the primitives are different sizes

#

Meaning that would have to be a pointer array

sterile token
#

Literally i need to store index and values, for then sending it and receiving it via socket

brave sparrow
#

So you may as well make it an Object[] and use the boxed types

sterile token
#

Hmn?

#

I dont still understand

brave sparrow
#

An int will always be 4 bytes

#

A long will always be 8 bytes

#

You can stitch them together inside a byte array

sterile token
#

My idea was to do something like this:

Buffer buffer = new Buffer(); // Custom class
buffer.write(0, "This my message"); // Wrriting
String string = buffer.read(0); // Reading

#

So i send that class via socket

brave sparrow
#

Java has Byte buffers

#

Lol

sterile token
brave sparrow
#

It does

sterile token
#

How make an example

#

I tried many times with no success

#

And sorry for losting your time :D

#

And ByteBuffer doesnt support adding strings

brave sparrow
brave sparrow
#

Yes it does

#

String#getBytes

sterile token
#

and that return a byte[] array

brave sparrow
#

Yes

sterile token
#

Which bytebuffer doesnt support

#

:/

#

😂

brave sparrow
#

Yes it does

#

Look at the code I sent you

sterile token
#

Allright

brave sparrow
#

buffer.put("This is my message to you.".getBytes(StandardCharsets.UTF_8));

sterile token
#

Dont disconnect please

young knoll
#

Looks supported to me

sterile token
#

LMAO

brave sparrow
#

Let’s see the error

sterile token
#

And the error say that i cannot add a byte[]

brave sparrow
#

You can though

sterile token
#

No

#

It doesnt allow me

brave sparrow
#

Get rid of the index

sterile token
#

rid?

brave sparrow
#

Just byte array

#

No index

young knoll
#

Put doesn’t take an index for byte[]

brave sparrow
#

^

tender shard
#

you have to do it in a loop

sterile token
#

Oh but i want to set multiple values

brave sparrow
brave sparrow
sterile token
#

How??

brave sparrow
#

Again, look at what I sent you

tender shard
brave sparrow
young knoll
#

put(firstArray)
put(nextArray)

tender shard
#

didn't know that

sterile token
#

Its always ordered?

brave sparrow
#

Once again, look at the code I sent you from stack overflow

#

It’s commented

young knoll
#

Looks like you need to keep track of the length of said array

sterile token
#

So:

ByteBuffer buffer = ByteBuffer.allocate("how much here?");

buffer.write("String".getBytes());
buffer.write(new List<String>);

String string = buffer.read();
List<String> list = buffer.read();```
#

??

young knoll
#

read reads a single byte

sterile token
#

Hee?

#

Oh its so confusing

#

I thought its was easier

young knoll
#

Minecraft has a nice class in NMS called PacketBuffer

worldly ingot
#

Note that the amount of bytes you allocate does matter as well. You're directly allocating a backing array so if you allocate too much you're going to run out of memory and crash the server ;p

young knoll
#

Which has a readUtf and writeUtf

tender shard
#

"probably"

worldly ingot
#

No, but in a snippet above they put 1000, which is far too much

young knoll
#

It also seems to handle the size for you

sterile token
#

So wait wait, how much do i need to allocate??

tender shard
#

ugh you still use the hardcoded 1000?

sterile token
#

I try with 4000 and jvm doesnt respond

tender shard
#

didn't you did that yesterday already and I told you not to do that?

sterile token
#

Its bugged

worldly ingot
#

No, you're just allocating too much ;p

sterile token
worldly ingot
#

To put it into perspective, if you want to write just a single integer, all you need is 4 bytes

sterile token
#

What its better here

young knoll
#

I wonder how Mojang handles it

worldly ingot
#

Do you actually need a ByteBuffer? Because if all you're doing is writing to a byte array, you can use the ByteArrayOutputStream instead which does have some convenience methods for writing various types, including strings

sterile token
#

What better sending/receiving your own object class or a custom class via socket?

young knoll
#

Probably just uses a dynamic collection of some type and then converts to a static array when you are done filling it

worldly ingot
#

Mojang uses a ByteBuf from Netty, yeah

tender shard
tender shard
#

?baos

young knoll
#

Ah Netty has their own ByteBuffer

sterile token
#

I dont use netty

#

I just using plain Java Socket

worldly ingot
#

The one I linked is Java

young knoll
#

Ignore my tangent

sterile token
#

Thanks

tender shard
#

do you people wanna see something "nasty"?