#help-development

1 messages Β· Page 468 of 1

kind hatch
#

With item displays yes. Just apply a transform.

crude charm
#

or does that require a texture pack

crude charm
young knoll
#

Texture pack

#

Or item displays

verbal slate
#

I literally see chunks being loaded, but teleportation still doesn't happen

fluid river
#

you can format it your own way and hardcode the string modifying part

regal scaffold
#

Wait what do you mean

#

Using the builder?

fluid river
regal scaffold
#

And then just getting the string from config

fluid river
#

just change to /n or smth

regal scaffold
#

Not sure if it lets you

fluid river
#

and then read the string from config and change it back

regal scaffold
#

Oh I see

crude charm
fluid river
#

to what can be accepted by minimessages

misty ingot
#

this is what I am doing

warm igloo
misty ingot
#

this is inside a command

tardy delta
#

where are you using a org.bukkit.Command?

weak meteor
#

i wanna make more .yml files using YamlConfiguration, so i made this code:

Users.java

public class Users extends YamlConfiguration {
     private File file = new File(TenguCore.getInstance().getDataFolder(), getFilename());
     private Users config = null;

     public String getFilename(){
         return "users.yml";
     }
     public YamlConfiguration getConfig(){
         if (config == null){
             config = this;
         }
         return config;
     }
     public void loadConfig() throws Exception{
         if (!file.exists()){
             TenguCore.getInstance().saveResource(getFilename(), false);
         }
         this.reload();
     }
     public void reload() throws Exception{
         super.save(file);
         super.load(file);
     }
     public void save() throws Exception{

     }
}

main:

@Override
    public void onEnable() {
        // Instance
        instance = this;
        saveDefaultConfig();

        // Load Files
        Users users = new Users();
        try {
            users.loadConfig();
            Bukkit.getConsoleSender().sendMessage(ChatColor.GOLD+"[Tengu Core] "+ChatColor.WHITE+"users.yml created.");
        } catch (Exception e) {
            throw new RuntimeException(e);
        }


        Bukkit.getConsoleSender().sendMessage(ChatColor.GOLD+"[Tengu Core] "+ChatColor.WHITE+"Plugin: "+ChatColor.GREEN+"Activated");
    }```

It does creates the file, but it doesnt writes the stuff i have in resources/users.yml
fluid river
#

is that some kind of commands api

weak meteor
#

I understand it should write what i have in the src users.yml file

#

isnt it?

serene sigil
#

hi, does any 1 know how to detect if a block played in BlockPlacedEvent has a lore? (so i need to get the ItemStack)

tardy delta
#

dont extend a fileconfig

misty ingot
fluid river
#

what is this mess lol

tardy delta
#

as your reload impl wont work

weak meteor
#

i do not extend yamlconfig?

tardy delta
#

wrap a FileConfiguration

kind hatch
fluid river
#

why don't you use what bukkit provided

#

?stash

undone axleBOT
tardy delta
#

also i have no idea why youre storing a reference to itself

#

youre basically doing YamlConfig getConfig() { return this }

weak meteor
#

but i get a empty file.

fluid river
fluid river
#

the only change you need to make is rename newConfig and configFile

misty ingot
#

this is basically my whole command

tardy delta
#

just wrap a FileConfiguration and a File

#

youll probably have to write delegate methods

tardy delta
#

the command is your method, the label is the annotation value and the string[] are your method params

misty ingot
#

never had this issue when I wasnt using acf, what are the possible fixes?

tardy delta
#

just remove that command, label and args param

weak meteor
tardy delta
#

instead of args[0] use a parameter of type Player

#

or OnlinePlayer, dont really remember good

fluid river
#

also javaplugin

#

but you don't need to touch it

#

at all

tardy delta
#

so void command(Player sender, OnlinePlayer target)

#

with your annotation stuff

fluid river
fluid river
tardy delta
#

legacy file writing πŸ€“

misty ingot
#

ohh so I just take the args in the function directly

tardy delta
#

filechannel where

misty ingot
#

and convert them too

tardy delta
#

yes

ivory sleet
fluid river
#

bukkit be like

misty ingot
#

ohhh this is just like making a discord bot but in java so its instantly worse but better than before but its still bad tho cuz java

#

yay

tardy delta
#

Files.newBufferedWriter ftw

misty ingot
#

so um what about CommandSender doe, like for some commands I wanna let console use em but for some only players
can I keep CommandSender sender and the check inside?

tardy delta
#

if its like that, both will be allowed

#

you can probably just create a method overload if you really want

misty ingot
#

so if I do Player player then its only for players

tardy delta
#

hmm

misty ingot
#

but CommandSender sender makes it for both?

tardy delta
#

ye cuz a player is also a commandsender

misty ingot
#

damn this shit is confusing

tardy delta
#

take a look at the docs

weak meteor
#

someone has a forum for custom config files?

misty ingot
#

what if I did OfflinePlayer target and just took a name as input
does it parse automatically?

#

because that would be the best thing ever

abstract sorrel
#

i am trying to make a crates plugin but i am unable to figure out how to calculate the random drops, can anyone help

kind hatch
torn badge
#

Anyone know why Damageable#damage works, but doesn't when I provide a player as the damage source?

weak meteor
#

more files

#

like users.yml

#

messages.yml

#

and stuff

kind hatch
#

Oh, well that's easy.

fluid river
#

call me

#

or listen to somebody here

weak meteor
#

lol

fluid river
#

that's literally ez

kind hatch
weak meteor
fluid river
#

call me

weak meteor
#

i just saw it

fluid river
#

or go to the link

weak meteor
#

yes i saw it

#

but there should i hard code everything?

fluid river
#

no

weak meteor
#

instead of writing it down in resources folder

kind hatch
#

You can do either or, but I prefer to just copy my configs using #saveResource()

abstract sorrel
#

oops meant to reply

abstract sorrel
fluid river
kind hatch
fluid river
#

that probably should be for another guy

misty ingot
fluid river
#

i have no troubles with configs

remote swallow
#

now you do

fluid river
#

oh noooo

verbal slate
#

@fluid river funny moment System.out.println(Arrays.toString(chunk.getEntities()));

#

For some reason there is no entity in the chunk))

fluid river
#

cool

kind hatch
fluid river
#

he already pasted

#

but like 5 mins before that message

verbal slate
#

Question.. why is there no one there when there really is.......

fluid river
#

idk you probably suck at mafs

#

or smth else

#

i can help you but later

verbal slate
#

eh

#

okay

fluid river
#

like 40 mins

#

goin outside

#

touch grass

lavish cliff
#

How can I cancel the jump event ( for example by setting the jump to 0 ) without canceling it directly in PlayerMovement?

eternal oxide
#

spigot has no jump event

#

but you can listen to teh statistics event for jump and set Y veolocity to zero

smoky forge
#

Looking for help to get the dependency/repository working for WorldEdit, would appreciate any help as I tried to go to the WorldEdit discord, they just took the piss out of me for not knowing much because im new to all of this.

eternal oxide
#

perhaps reassess if you actually need to use it then

smoky forge
#

what would you recommend?

eternal oxide
#

That depends on what you are trying to do

smoky forge
#

essentially create independent islands per a player, just messing around.

eternal oxide
#

so pasting templated islands?

smoky forge
#

Yeah with a command

eternal oxide
#

if you are using 1.18+ use the built in Structures API

smoky forge
#

has WorldEdit always been a problem?

#

just curious

eternal oxide
#

many discords are toxic to new commers

smoky forge
#

why though, that's so useless.

eternal oxide
#

developer ego

smoky forge
#

if i pm you can you have a look at my pom file, just to see if you can help me to get the WorldEdit API working?

I did follow a guide on spigot that was nooby friendly but seems to not work.

eternal oxide
#

?paste

undone axleBOT
smoky forge
#

cheers ill put it in there

flint coyote
# smoky forge why though, that's so useless.

It depends a lot on what people ask and how they ask. Some people don't show any effort and therefore get non effort answers aswell. That's not what you did tho. You asked just fine

smoky forge
flint coyote
#

usually people are willing to help if they can help you in here. Some people just come here and say "I don't know how to code but I got this code from chatGPT and it doesn't work" and expect a full guide on how to install an IDE, configure it, install maven etc

eternal oxide
#

the pom looks ok to me, without looking up versions

#

but then again I don;t use worldedit

#

what issue are you running into?

flint coyote
#

Do you get an error building the project with mvn clean package?

smoky forge
#

"Cannot resolve symbol 'sk89q'"

misty ingot
#
        // get user's bank data
        CompletableFuture<ResultSet> future = CompletableFuture.supplyAsync(() -> {
            ResultSet results = grabBankData(targetUUID);
            return results;
        });

        future.thenAccept((results) -> {more stuff here});
    public static ResultSet grabBankData(UUID targetUUID) {
        ResultSet result = null;
        try {
            PreparedStatement statement = plugin.getConnection().prepareStatement("SELECT purse, bankStored, bankLimit FROM mm_pdata WHERE uuid = ?");
            statement.setString(1, String.valueOf(targetUUID));
            result = statement.executeQuery();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }

this causes the entire server to stall out and crash and burn

lost matrix
misty ingot
#

Im pretty sure that I am using completeablefuture correctly

#

but probably not

flint coyote
remote swallow
smoky forge
lost matrix
misty ingot
remote swallow
#

is it just join and get that block

smoky forge
remote swallow
lost matrix
#

Else they get hidden

misty ingot
#

so just put a try catch in the CF?

flint coyote
#

mvn clean package *

lost matrix
smoky forge
#

?paste

undone axleBOT
vast raven
#

When you relocate something, independent of using maven, groovy or kotlin, you should expect the name of a dependency changed in the jar like the one you've putted

smoky forge
vast raven
#

My case is a gui dependency and I relocated it, but opening the jar on WinRAR I see the name of the packages doesn't change

lost matrix
# misty ingot so just put a try catch in the CF?
    CompletableFuture<ResultSet> futureResult = CompletableFuture.supplyAsync(() -> {

    }).whenComplete((result, exception) -> {
      if (exception != null) {
        exception.printStackTrace();
      }
    });

For example like this

misty ingot
#

doin dat rn

river oracle
#

I didn't know when complete existed lol

#

Plus you get exception damnnn

remote swallow
#

i was expecting a #exceptionally

misty ingot
#

ok so -

I run command
nothing happens
nothing in console
everything stalls, crashes and burns

misty ingot
#

wait wait wait

#

hold on

#

everything didnt die

#

actually, nothing at all is happening

#

like, nothing except console saying that I used X command

lost matrix
#

command registered properly?
Add debug messages

misty ingot
#

and server didnt die

flint coyote
lost matrix
misty ingot
#

debugging...

remote swallow
smoky forge
flint coyote
low tendon
#

Hello! I am having a problem with that if I start to write /server I get kicked immediately. How can I solve this?

vast raven
low tendon
smoky forge
kind hatch
# low tendon

That's cause there is no method. There is ProxyServer#getServers() though.

smoky forge
misty ingot
#
            plugin.getLogger().info("2");

            // Purse item
            ItemStack balanceItem = new ItemStack(Material.PAPER);
            ItemMeta balanceMeta = balanceItem.getItemMeta();
            balanceMeta.setDisplayName((plugin.lang.getString("bank-purse-item-name"))
                    .replace("&", "Β§")
                    .replace("{purseMoney}", String.valueOf(purse))
                    .replace("{currency}", plugin.currencyName)
            );
            balanceItem.setItemMeta(balanceMeta);
            inv.setItem(11, balanceItem);
            plugin.getLogger().info("bi");

for some reason, its getting stuck at this out of all things
(2 is printed, bi is not)

verbal slate
#

Guys, why does the chunk return an empty array from entity? I know for sure that I am getting the chunk I need and I know for sure that there are entities there.

lavish cliff
#

guys how i can cancel the event for teleport player to another dimension?

i tried to do this but idk

        if (waterLocation.getBlock().getType() == Material.END_PORTAL) {
            event.setCancelled(true);
        }
    }

kind hatch
low tendon
kind hatch
#

In your code? Are you not making a bungeecord plugin?

low tendon
kind hatch
low tendon
flint coyote
# smoky forge Screenie of the code incase you need to see the errors.
<repository>
            <id>enginehub</id>
            <url>https://maven.enginehub.org/repo/</url>
            <releases>
                <enabled>true</enabled> <!-- releases enabled: this specific repository also hosts release versions -->
            </releases>
            <snapshots>
                <enabled>true</enabled> <!-- snapshots enabled: we declare a SNAPSHOT repository because we need to download a SNAPSHOT dependency -->
            </snapshots>
        </repository>```

can you try to configure the repo like this?
tribal quarry
smoky forge
#

?paste

undone axleBOT
tribal quarry
kind hatch
smoky forge
lavish cliff
smoky forge
#

?paste

undone axleBOT
smoky forge
#

oops deleted their message

#

lol

smoky forge
tribal quarry
#

to see if it opens it or not

#

this link

smoky forge
#

yep it does

tribal quarry
#

bruh

smoky forge
#

yeah also opens

tribal quarry
#

restart idea

smoky forge
#

restart as in close Intellij?

tribal quarry
#

close and open

smoky forge
#

okay okay

#

yeah still having all the same problems.

tribal quarry
#

does it build?

smoky forge
#

Nope, it doesn't recognise a single piece of code from WorldEdit API

tribal quarry
#

strange

#

canyou send your full pom.xml again?

smoky forge
#

?paste

undone axleBOT
tribal quarry
#
            <releases>
                <enabled>true</enabled> <!-- releases enabled: this specific repository also hosts release versions -->
            </releases>
            <snapshots>
                <enabled>true</enabled> <!-- snapshots enabled: we declare a SNAPSHOT repository because we need to download a SNAPSHOT dependency -->
            </snapshots>

try removing these lines and reload maven see if it helps or not

fluid river
#

or if world has different id/name

tribal quarry
flint coyote
fluid river
#

freejavalessons

tribal quarry
#

try using 7.2.9-SNAPSHOT and 7.2.9 for both of them and reload check and see if that helps or not

smoky forge
tribal quarry
#

last of all, if you couldn't add it as dependency then you can download its jar and install it locally

smoky forge
#

the refresh button for Marven isn't appearing anywhere is there a way to make it reload the whole pom file again?

tribal quarry
#

which is it

smoky forge
#

no more errors with imports

smoky forge
#

some of them are greyed out though

#

is that normal?

tribal quarry
#

if you wanna get rid of that then you shall enable auto import optimization feature on idea

smoky forge
tribal quarry
#

or just right click file -> optimize imports

#

you can also ignore grayed out imports (if its not too much), since its not necessary in java

smoky forge
#

figured it out cheers

#

that's all for now πŸ™‚ just gotta fix the actual code errors now lol

thank you both

fervent robin
#

Is the MC session server down for anyone else?

tribal quarry
#

optimize imports on fly*

smoky forge
tribal quarry
fervent robin
tribal quarry
#

ok so its much longer than i knew

misty ingot
#

how can I edit the usage message in ACF?

regal scaffold
#

@strong rapidsage

verbal slate
#

@fluid river I think I've done with this. I got the wrong coordinates, and in order for FAWE to copy entities, it was enough for me to load chunks with the correct coordinates. This method gives the correct coordinates of chunks:

BukkitWorld out, BukkitWorld in, ProtectedRegion pr
final CuboidRegion region = new CuboidRegion(out, pr.getMinimumPoint(), pr.getMaximumPoint());
Bukkit.getScheduler().runTask(Main.getInstance(), () -> loadChunks(out.getWorld(), region.getChunks()));

    private void loadChunks(World from, Set<BlockVector2> blockVector2Set) {
        List<Chunk> chunks = new ArrayList<>();
        blockVector2Set.forEach(blockVector2 -> {
            Chunk chunk = from.getChunkAt(blockVector2.getX(), blockVector2.getZ());
            chunk.addPluginChunkTicket(Main.getInstance());
            chunk.load();
            chunks.add(chunk);
        });
        for (Chunk chunk : chunks) {
            chunk.unload();
            chunk.removePluginChunkTicket(Main.getInstance());
        }
    }
regal scaffold
#

I can’t from mobile

regal scaffold
fluid river
#

cool

regal scaffold
#

@@

misty ingot
#

@Usage isnt a thing

#

also not @CommandUsage

tribal quarry
#

does anybody knows how can i prevent players to insert any items in craft slots? (4 craft slots of player)

fluid river
#

?jd-s

undone axleBOT
tribal quarry
fluid river
fluid river
#

cancel 1

#

cancel 2

#

depends on your particular case

fluid river
tribal quarry
fluid river
#

and well, i don't wanna google

fluid river
tribal quarry
regal scaffold
fluid river
regal scaffold
#

Or not possible

misty ingot
#

seems like it is infact @Syntax

fluid river
#

❀️

regal scaffold
misty ingot
#

only like 2 params

regal scaffold
#

But yeah

misty ingot
#

i just dont want it to say <arg1> and stuff

regal scaffold
#

Then syntax is what you want

#

Change the name of the argument

remote swallow
#

?paste the onCommand method

undone axleBOT
regal scaffold
#

The variable name in the method is the name that will be used

#

And it’s not recommended to use args1 especially if you’re working with act

fluid river
#

you need to register the command

tribal quarry
regal scaffold
#

Acf

fluid river
#

in both plugin yml and in plugin code

#

show

#

plugin.yml + your code

#

seems fine but

#

shouldnt there be two spaces in yaml

#
command:
  uhcconfig:
    description: shit
#

strange tho

terse ore
#
foo:
 a:
#

that will make that all the indentation levels need to be of 1 space

#

espera

#

es tu on enable

#
    
    public void OnEnable() {
        Bukkit.getConsoleSender().sendMessage(name+"Ha sido activado (version: "+version+")");
        
        Comandos comandos = new Comandos();
        
        getCommand(comandos.cmd2).setExecutor(comandos);
    }```
#

OnEnable -> onEnable

fluid river
#

truee

remote swallow
#

and add @Override

terse ore
#

np

#

what did you change?

#

(commands will appear just by adding them to the plugin.yml)

#

can you send it again

#

you still haven't changed

pseudo hazel
#

what IDE are you using?

#

if you use intellij with the mincraft dev plugin it should make the main class automatically so you cant make a spelling mistake

hazy parrot
#

Well you shouldnt make that mistake anyway, if you start typing onEnable (or any other method that can be overriden) intellij will complete it for you

misty ingot
#

in what type should I store the "inventory of items" of the player? (in db)
its really just a list of items that the player has "bought from the plugin store" which cannot manually be altered with by the player

I would just use a list and if statements but thats like.. boring
its basically an inventory but the player cant alter it themselves, just the plugin can
(and will be shown to player when they want)

pseudo hazel
#

I see

#

also adding the @override annotation to methods you inherit will help you spot these kinda of mistakes easier too

#

ow awesome

#

I will use your lib for sure

#

thanks for making it public

remote swallow
#

alex strikes again

fluid river
pseudo hazel
#

lmao

kindred valley
#

What

remote swallow
#

im going to judge you hard for this

kindred valley
#

What did you say i didnt understand

fluid river
#

cmd2 = "uhcconfig" he has

#

somewhere in his code

remote swallow
#

snapshot means you can publish twice

kindred valley
#

Can you show us that class

remote swallow
fluid river
#

he pasted the code

misty ingot
#

is there a way to just show a list of all offline players in @CommandCompletion ?
cant find anything for it on the acf wiki

kindred valley
#

Why O is big

#

Implement your methods defaultly

misty ingot
#

I am aware.

kindred valley
#

it should be onEnable()

mellow edge
#

can I manually load a specific chunk programaticlly like the player would

kindred valley
#

Can you debug onEnable if Comandos object is being defined

#

Also get the string by getter methods

kindred valley
#

May be plugin yml

terse ore
#

show plugin.yml

kindred valley
#

Do you get any respond on console

#

Bout pluginyml

terse ore
#
main: UHCProyect.UHCProyect
version: 1.0.0
name: UHCProyect
api-version: 1.19
author: SoyElRafin
description: plugin
command:
 uhcconfig:
  description: ola
  usage: /<command>```
kindred valley
#

Yes

#

πŸ˜…

terse ore
#

lol

tall dragon
#

its preference but id advize intellij

terse ore
#

they changed the UI tho

#

I liked the old one but this one is more efficient

#

i dont think so

#

they changed it after the new ui

fervent robin
#

?paste

undone axleBOT
fervent robin
tribal quarry
fervent robin
tribal quarry
#

remove maven-assembly-plugin

#

And add this under plugins section

fervent robin
#

thanks

remote swallow
#

need to relocate bstats in that too

quaint mantle
#
public class PlayerDragonSpawn implements Listener {
    @EventHandler
    public void onPlayerDragonSpawn(EntitySpawnEvent e) {
        if (e.getEntityType() == EntityType.ENDER_DRAGON) {
            DragonBattle dragonBattle = ((EnderDragon) e.getEntity()).getDragonBattle();
            if (dragonBattle.getRespawnPhase() == DragonBattle.RespawnPhase.END) {
                Bukkit.getLogger().log(Level.WARNING, "Dragon is not finna spawn");
                e.setCancelled(true);
            }
        }
    }
}```

i need help, the code never reaches  Bukkit.getLogger().log(Level.WARNING, "Dragon is not finna spawn");
#

its supposed to cancel a player spawning a dragon

tall dragon
#

then the respawnphase is probably not END at the time of spawning

worldly ingot
#

Heh. See that's the hard part

#

We don't really have API for that

#

I suppose what you could do is check if Registry.MATERIAL.get(material.getKey()) == null

#

If it's null then it's not enabled

#

Probably works

carmine mica
#

no, that doesn't work afaik

worldly ingot
#

Yeah pretty much

carmine mica
#

its just a simple registry for the enum values

worldly ingot
#

Is it a simple registry?

carmine mica
#

yeah, it filters out legacy mats, but everything else is there

#

neither of the experimental annotations are runtime, so you can't check the enum field for an annotation either

worldly ingot
#

And I'm super hesitant to add Material#isExperimental() because I really hate adding new switch statements that need to be constantly updated and maintained lol

quaint mantle
#

too

carmine mica
#

πŸ™‚

worldly ingot
#

Listen if it were up to me I'd love to

#

I'd take my approach instead lol

#

Yeah or a Set or something

quaint mantle
#
p.playSound(p, Sound.AMBIENT_CAVE,1.0,1.0);

hey guy , can someone tell me whats wrong with me code ?

#

i dont wanna use world play sound , i wanna play it just for one player

#

like this ?

p.getLocation().playSound(p, Sound.AMBIENT_CAVE,1.0,1.0);
tall dragon
#

no

quaint mantle
#

oh oh

#

thx mate

fluid river
#

cuz there is no such method on inv now

#

tutorial is old as fuck

tall dragon
#

very much better

fluid river
#

use better one like the one on spigot

undone axleBOT
worldly ingot
#

Copilot, like in most other places, is wrong here lol

lost matrix
#

How about

#

You do what Choco said and create a Set

tall dragon
#

cant u detect this ?

#

how unfortunate

lost matrix
#

Why not?

#

Whats the RetentionPolicy of that annotation?

#

Eh ok then not

weak meteor
#

what?

worldly ingot
#

usersConfig is null

#

Β―_(ツ)_/Β―

lost matrix
#

this.usersConfig is null. Pretty descriptive stack trace right there.

weak meteor
#

should i replace usersConfig with getUsersConfig()?

twilit rivet
#

isn't it just @SuppressWarnings("deprecation")

#

I mean with the right arg ofc

#

but, that's how I remember it

lost matrix
# weak meteor

Create one file per player.
Dont throw all players into one file.
Name the files <UUID>.yml and put them in a userdata folder.

willow dove
#

Hey!
I made a reload command that probably isnt updating changes from config.yml why i need help :c?

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        // Load config if not exist
        plugin.saveDefaultConfig();
        config = plugin.getConfig();
        String noPermission = config.getString("messages.noPermission");
        String reloadMessage = config.getString("messages.reloadMessage");

        if (sender instanceof Player) {
            if (!sender.hasPermission("craftedby.reload")) {
                sender.sendMessage(noPermission);
                return false;
            }
        }
        try {
            config.save(new File(plugin.getDataFolder(), "config.yml"));
            plugin.reloadConfig();
        } catch (IOException e) {
            e.printStackTrace();
            return false;
        }
        sender.sendMessage(reloadMessage);
        return true;
    }
eternal oxide
#

Why does every create a field to store their plugin config?

#

it's the quickest way to break things

tardy delta
#

people not willing to listen

willow dove
#

πŸ™ƒ

eternal oxide
#

Nothign rude in that comment

willow dove
#

i already read the documentation

#

saying people not willing to listen?

#

no ones give me a response :s

eternal oxide
#

he was talking to me, so still nothing rude

#

tell us what is not working as you expect it to

willow dove
#

oh ok :s

#

sorry my bad

tardy delta
#

config.save(new File(plugin.getDataFolder(), "config.yml")); basically plugin.saveConfig()

willow dove
#

Yeah sorry im working with the help of chatgpt haha
But this thing dont work at all

eternal oxide
#

eww

tardy delta
eternal oxide
#

yep, change that save to the one Fb showed

willow dove
#

Ok

tardy delta
#

really have to change my name uwu

#

but cant think of one

eternal oxide
#

I keep thinking of Basil Brush when I see you type πŸ™‚

#

I doubt you know who that is though

tardy delta
#

i dont

weak meteor
# lost matrix Create one file per player. Dont throw all players into one file. Name the files...

k i did this:
@EventHandler
public void onJoinEvent(PlayerJoinEvent event){
UUID playerUUID = event.getPlayer().getUniqueId();
File userFile = new File(TenguCore.getInstance().getDataFolder()+"/userdata", playerUUID.toString());
FileConfiguration userConfig = null;
if (!userFile.exists()){
userFile.getParentFile().mkdirs();
TenguCore.getInstance().saveResource("userdata/"+playerUUID.toString()+".yml", false);
}
try {
userConfig.load(userFile);
} catch (Exception e) {
e.printStackTrace();
}

}
tardy delta
#

and maybe thats the best

weak meteor
#

should i use config.set(""); to set some paths?

eternal oxide
tardy delta
#

is this "bad code evening"?

weak meteor
eternal oxide
#

He is

#

ok comments...

#

don;t use / in files

remote swallow
eternal oxide
#

either use the system seperator, or use nested File

tardy delta
eternal oxide
#

🦊 πŸ’₯ πŸ’₯

tardy delta
#

this is really bad code evening

#

hm?

#

what is this crap

#

go atleast look for it then

worldly mountain
#

πŸ˜‚

tardy delta
#

you again

worldly mountain
#

You have to tell it β€œgo find it then”

worldly mountain
worldly ingot
#

The whole string iirc

#

Unless you mean in the actual expression itself

#

Yeah, $0 as the replacement is just the whole string

#

It's whatever was matched

rotund ravine
#

""$0".toUpperCase()" uh?

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
tardy delta
#

code without context hmm

#

for me its discord crashing

#

did you add the dependency?

#

are you using maven or gradle?

#

the dependency tool

#

are you using intellij?

#

fuck my life

#

do you have a build.gradle file?

#

lemme guess, the dependency you're trying to use does only have a jar

#

then somehow figure out how to add a jar as dependency on eclipse ig

#

bruh what can you import and what not

#

i have no clue without screens

eternal oxide
#

how are you exporting yoru jar (if you are)

tardy delta
#

assumed his issue was that external dependency that wasnt added

eternal oxide
#

or, in the project window do you see a pom.xml or a build.gradle file ?

tardy delta
#

eclipse user πŸ€“

eternal oxide
#

me πŸ™‚

tardy delta
#

is the tabcompletion still that bad?

eternal oxide
#

I've not had any issues

#

Then again I stick with Eclipse as it's my favorite IDE

tardy delta
#

you're used to it ig

eternal oxide
#

I guess

#

I dislike bells and whistles.

tardy delta
#

i was thinking of using neovim with some plugins but that doesnt really give the experience of a real ide

river oracle
tardy delta
#

i once had vscodium taking down my whole os πŸ’€

river oracle
#

wtf u using bro πŸ’€

tardy delta
#

idk i was having some issues with linux

river oracle
#

just switch to a stable OS like fedora or ubuntu and you'll be fine

tardy delta
#

i thought about wiping my os today but my backups didnt really like that

#

who even transmits 60 gigs of vms to some cloud provider πŸ’€

river oracle
#

backups πŸ’€ bro just don't backup anything

tardy delta
#

i kinda need them for college

#

so i wasted a whole day

tardy delta
#

you wouldnt be the first one

eternal oxide
#

I have like 20 years of backups. HD's just keep getting bigger so I get a bigger one each time and save it all

river oracle
tardy delta
#

pov: using linux

#

me who literally destroys everything

eternal oxide
#

I keep everything. Even game patches from the 90's πŸ™‚

river oracle
#

My OS ended up dying because of a GPU failure NVIDIA shipped me a broken 1050ti back when I bought my first PC

tardy delta
eternal oxide
tardy delta
#

check the logs

#

idk

river oracle
#

did you invalidate caches

tardy delta
river oracle
#

usually intellij starts magically working when you do that

rough ibex
#

most things start magically working if you invalidate cache

river oracle
#

as an avid vscode user I can not relate

#

I've only had to invalidate caches once uwu it was cuz I borked something though wasn't even my IDE's fault

tardy delta
#

i only invalidated caches once to realize it was me who cant write proper code

#

it was 8am bruh i was still sleeping

#

thought the compiler was doing dumb things

river oracle
#

Why am I making a spanish translation to my plugin when I barely speak spanish πŸ€¦β€β™‚οΈ

#

what am I eve ndoing

tardy delta
#

wasting your time

river oracle
#

spanish dictionary is my best friend :}

river oracle
#

bro I ain even speak german I can't update this shi

tardy delta
#

just leave it like that

#

or do the google translate move 😏

#

laughs in german at the end user

river oracle
#

which was originally made for English to German translation I believe

tardy delta
#

gotta keep it fun

rough ibex
#

deepl 🦾

tardy delta
#

πŸ’€

eternal oxide
#

lol

tardy delta
#

wait my english was confusing it with isOdd

eternal oxide
#

oh I thought for a second the asserts were their attempt

tardy delta
#

looks like my brain doesnt want to do maths today

echo basalt
#

if(test != 2 && test % 2 == 0) return false

#

and also start test at an odd number and += 2

#

to skip half the iterations

#

because any prime number above 2 is odd

tardy delta
#

yes

#

πŸ’€

#

randoms in c++ are also fun πŸ’€

hazy parrot
terse socket
#

[ViaVersion] You are running an outdated Java version, please consider updating it to at least Java 17 (your version is 16.0.2). At some point in the future, ViaVersion will no longer be compatible with this version of Java.

#

I updated to Java 17 and now I can't run the server

#

Unsupported Java detected (61.0). Only up to Java 16 is supported.

flint coyote
#

Which plugin does cause this error? Or is it spigot? What version are you on?

terse socket
#

1.16.5, the plugin named ViaVersion is causing this, but now I have run BuildTools and it's updating to Java 17

flint coyote
delicate lynx
#

why are you running 1.16.5 still

terse socket
terse socket
flint coyote
#

Well in that case I guess spigot 1.16 does not support java 17

terse socket
flint coyote
#

Yeah rebuilding with java 17 could also help

regal scaffold
#

@tender shard Jefflib has a hologramManager but it's deprecated

#

What's the alternative

remote swallow
#

iirc its deprecated bc its temp

regal scaffold
#

Oh that just means I need to make my own manager right?

#

It does say DraftAPI

remote swallow
#

you can probably use that one just expect some errors or bugs

regal scaffold
#

πŸ‘

serene sigil
#

hi, i am working on a /spawn command, you have to stay still and not move 10 seconds and then you will be teleported, whats the best way of doing it?

#

storing the uuid and the Sys.currenttimemillies in a hashmap?

#

and having a loop?

#

cuz doing it with a scheduler is very difficult

remote swallow
#

store their uuid in a set and check if their uuid is in that set on playermove event

#

also check if getTo and getFrom are the same

#

so you dont stop it from them looking somewhere

serene sigil
#

no, looking is alright

remote swallow
#

yeah

#

so check if getTo and getFrom is the same

serene sigil
remote swallow
#

and only cancel if it isnt

#

store the task and if they move cancel that

#

Map<UUID, BukkitTask>

serene sigil
#

how?

#

but u can spam it (with cancelling it and then doing it again) and u get a lot of bukkitschedulers

remote swallow
#

keep a task, in a map

terse socket
tardy delta
#

im starting to love c++ lol std::function<double(double, double)> whereas in java DoubleBinaryOperator

remote swallow
#

you can only store 1 value per key in a normal map

terse socket
#

I don't want 1.19 bro πŸ˜’

serene sigil
remote swallow
#
private Map<UUID, BukkitTask> playersTeleporting = new HashMap<>();
public void startTeleport(Player player) {
    playersTeleporting.put(player.getUniqueId(), Bukkit.getScheduler().runTaskLater(plugin, () -> {
        player.teleport(location); //idk what this actually is
    }, 20 * 10);
}

@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
    if (!playersTeleporting.containsKey(event.getPlayer().getUniqueId()) return;
    if (event.getTo() == event.getFrom()) return;
    playersTeleporting.get(event.getPlayer().getUniqueId()).cancel();
    playersTeleporting.remove(event.getPlayer().getUniqueId())
}
#

that could be improved

#

but thats the general concept

rotund ravine
#

lol the formatting

remote swallow
#

i didnt use an ide

#

too lazy

tardy delta
#

dont do three map lookups instead of 1

#

null check the return value of map.remove

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.

terse socket
#

How can I use Java 17 for 1.16.5

tardy delta
#

chatgpt just keeping itself busy writing a whole char table

nocturne steppe
#

hellooo what is the octave generator? can't find info on google

terse socket
#

I don't want to use 1.19

remote swallow
#

so you need to use java 8 or 11

#

isnt it 1.18+

#

16 is 1.17 iirc

terse socket
#

1.8 to 1.11 Java 8
1.12 to 1.16.4 Java 11
1.16.5 Java 16
1.17.1-1.18.1+ Java 17

remote swallow
#

1.18 and higher is java 17

#

1.17 is 16

#

anything prior is 8 or 11

young knoll
#

If I remember correctly 1.16.5 will happily run on java 16

terse socket
#

Yeah it is running on java 16

remote swallow
#

what does 1.16.5 even do better than 1.17 or 1.18

river oracle
#

uhh its older and has bigger number at the end

#

duh

#

if thats not a good reason to stay behind what is

tardy delta
#

i wish java had that 0...9 syntax kek

#

c++ doesnt have things java has and the other way around :(

young knoll
#

Oh that is nice

tardy delta
#

i still miss the -> tho

#

putting break everywhere kinda sucks

young knoll
#

Languages

#

Minecraft editions

#

Etc

tardy delta
#

true

#

and c++ cant have fields in an enum :(

#

so i gotta do it with a class instead

regal scaffold
#

I'm having some issues including submodules in the main export file

#

With maven I run package/install on tlib-parent

remote swallow
#

with maven you need a dist module

#

that just shades all sub modules

regal scaffold
#

Oh then I was doing it right

#

lol

#

Do I still run package on parent?

#

Or the dist module

remote swallow
#

iirc you run it on dist

regal scaffold
#

Thanks, will test

terse socket
#

Bro what is this. Now intellij is not opening

#

I'm done

regal scaffold
#

I still can't figure out how to actually shade all submodules

remote swallow
#

check jefflib

regal scaffold
#

I am

#

That's what I used for the structure

remote swallow
#

?paste ur dist pom

undone axleBOT
regal scaffold
#

Oh now it worked

#

....

#

After clicking package 3 times

remote swallow
regal scaffold
#

How convenient

regal scaffold
#
 java.lang.NoSuchMethodError: 'void net.minecraft.world.entity.Entity.setInvulnerable(boolean)'
eternal oxide
#

you didn;t remap

regal scaffold
#

Ugh

river oracle
#

?nms <3

regal scaffold
#

I did

#

?paste

undone axleBOT
regal scaffold
eternal oxide
#

did you do that in every module?

regal scaffold
#

This is for the version I'm using

eternal oxide
#

the modules contain the NMS so you need that in teh pom of every NMS module

regal scaffold
#

Wait I just thought of something

#

If my library includes nms

#

Do plugins that use it as a dependency also need to do the nms stuff?

remote swallow
#

shouldnt need to

eternal oxide
#

you shoudl be exposing an API

regal scaffold
#

I am

#

So that means

#

In plugins that use my lib, I use normal spigot dependency?

#

Without remapped

eternal oxide
#

yes, the plugin is just api access

regal scaffold
#

Cool

eternal oxide
#

all nms is hidden behind your api

regal scaffold
#

No errors now

#

Still doesn't work but i'll get there

#

What is

#

AreaEffectCloud

undone hamlet
#

Hello, I have a towny server and during pvp, if the pvp status is turned off in towns, the players cannot hit each other.

#

so they can escape to town

#

I installed the combatlogx plugin but it didn't work

eternal oxide
#

wrong channel, but thats correct, unless you force it worldwide as an admin

regal scaffold
#

Elgarl I just had an idea

#

I'm going to try to make Holograms compatible with adventure components

undone hamlet
eternal oxide
#

You need the Towny discord

#

there are a few different ways, depending on if you are using wars or not.

undone hamlet
#

Thank you

eternal oxide
#

ask in Towny Discord

trim bough
#

does anyone know if theres a server for protocollib developemtn help

#

or can I ask here

eternal oxide
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

trim bough
# eternal oxide ?ask

so that's a yes? i was unsure if i could ask protocollib questions which i why i asked if i could.
anyways:

for some reason when trying to getChatComponents() from the PacketContainer from the system chat message, it does not return the chat component whilst everything i've checked shows that system chat message should have that chat component.

subtle light
echo basalt
#

you can get it in vanilla

eternal oxide
subtle light
echo basalt
#

not how it works

trim bough
#

wait no

subtle light
trim bough
#

it returns an empty list

subtle light
#

is it a color code or what

eternal oxide
#

an empty list or a list with one entry which is null?

trim bough
echo basalt
eternal oxide
#

well read teh whole thread I'd suggest

trim bough
eternal oxide
#

I'm assuming as I don;t use protocol lib

trim bough
#

this is from 2019, basecomponent is not kyori and is deprecated

#

ill try with component tho

crisp mountain
#
public class blockPlace implements Listener {
    @EventHandler
    public void onPlayerPlaceBlock(BlockPlaceEvent event) {
        Player player = event.getPlayer();

        player.sendMessage(String.format("%s, the item you placed is %s", player.getName(), event.getItemInHand().getItemMeta().getDisplayName()));
    }
}
remote swallow
crisp mountain
#

Why does this send me

"MyName, the item you placed is"
#

the item name is blank

trim bough
crisp mountain
#

how do I get the item I placed

remote swallow
#

yeah, your saying basecomponent is deprecated, only paper do that

remote swallow
crisp mountain
#

minecraft normal items doesn't have display names?

trim bough
#

also it's net.md_5, isnt md_5 the spigot person

remote swallow
#

yeah

#

its bungee

#

bungee chat api is shaded into spigot

hazy parrot
remote swallow
crisp mountain
#

I was using normal items

#

I see

hazy parrot
trim bough
crisp mountain
#

that's weird xd

remote swallow
#

im telling you to ignore the deprecation warning, or not use paper api relating to that

wise mesa
#

does anyone know if you're allowed to use service providers in on load

crisp mountain
#

but

#
public class blockPlace implements Listener {
    @EventHandler
    public void onPlayerPlaceBlock(BlockPlaceEvent event) {
        Player player = event.getPlayer();

        if(event.getItemInHand().getItemMeta() == DirtGenerator.createDirtGenerator().getItemMeta()) {
            player.sendMessage("Right Item");
        } else {
            player.sendMessage("Wrong Item");
        }
    }
}
#

I did this

#

and it always say Wrong Item

#

even if I have placed the custom item

remote swallow
#

dont compare meta, use ItemStack#isSimilar

trim bough
remote swallow
#

so if (event.getItemInHand().isSimilar(DirtGenerator.createDirtGenerator())

regal scaffold
#

What is
AreaEffectCloud

crisp mountain
#

aight let me try

remote swallow
#

you know lingering potions

#

its that close

#

cloud

regal scaffold
#

tf

crisp mountain
#

Works now, thanks @remote swallow

regal scaffold
#

Alex made a hologram using that

trim bough
regal scaffold
#

Instead of armor standw

#

Is there a reason no one else does it?

remote swallow
#

it has some advantages

#

no idea what they are

regal scaffold
#

I'm interested

#

fk

#

Armorstand vs AreaEffectCloud

crisp mountain
#

why isSimilar tho not isEqual

hazy parrot
#

Because its not equal

#

But similar

hazy parrot
crisp mountain
#

ahh I understand it now

#

thanks

regal scaffold
#

Uhhh ebic

#

That thing shows only advantages

#

There's no way they're that much better than armor stands

#

Difference is AS has motion lol

remote swallow
#

thats all i could find lol

regal scaffold
#

Is it new?

remote swallow
#

dont think so

analog thicket
#

ggs getting error on a line with nothing on it lol

remote swallow
#

its existed ever since lingering potions probably

regal scaffold
#

Holy shit

remote swallow
regal scaffold
#

Ebic

#

I just made

#

Holograms

#

With MiniMessages

analog thicket
regal scaffold
trim bough
#

what would be the best way to store data for an offline player that resets when the server restarts without memory issues? I don't know if it would be a problem if many players joined and left and caused a lot of data in a hashmap.

remote swallow
#

run clean package or clean build if its gradle

crisp mountain
#

Hey, I wanna ask something, does the custom item become a normal item when placed, or when broken?

crisp mountain
#

I want to keep it custom

remote swallow
#

you would need to keep track of the block and drop your custom item when the block is broken

crisp mountain
#

what's the best way to keep track of it?

#

PersistentData?

remote swallow
#

yeah

#

?blockpdc

undone axleBOT
remote swallow
#

using that is somewhat easier

trim bough
#

how do i add clickable text to a component

remote swallow
trim bough
#

thanks

crisp mountain
#

does custom block items have TileState?

fresh timber
#

with .lore().add() it wants me to use a Component. How can I do this?

remote swallow
#

Component.text("stuff")

#

or ignore the deprecation and getLore().add

fresh timber
#

yea then I get nullpointerexception cus there isnt a lore

remote swallow
#

it should have a hasLore()

young knoll
#

?whereami

remote swallow
fresh timber
#

its a new itemstack that I just made and I want to add a lore to it

remote swallow
#

use set lore and a new string list

#

or papers adventure alternative

fresh timber
#

will .lore().add() work?

remote swallow
crisp mountain
tender shard
#

it's been like 3+ years now

remote swallow
#

i didnt even notice that lmao

tender shard
#

double annotations, everywhere

#

at some places, 4x annotations

#

@Nullable @Nulable List<@Nullable @Nullable ItemStack>

#

welcome to papermc :3

#

oh don't forget the deprecated annotations

#

I wonder why they don't add those 12 times too per method

#

ooooh and dont get me started abotu folia haha

#

"Oh, your plugin uses the regular BukkitScheduler? Ermmm....."

remote swallow
#

it needed 2 terabytes of ram for 300 players

young knoll
#

I believe spigot ran into the multiple annotation issue recently

#

It’s what happens if you mark collections and their contents with something like @urban grotto

remote swallow
#

@Nullable ItemStack @urban grotto [] stacks ?

tender shard
#

the issue in the spigot docs was fixed like 3 years ago

young knoll
#

Found it

tender shard
#

yep, it's when there's both TYPE and the other thingy

#

spigot used to switch to jetbrains java5 annotations

#

but meanwhile they use sth else

young knoll
#

I think they still use that

tender shard
#

they switched to other annotations IIRC

#

I talked to choco about it a few months ago

#

not 100% sure but like 99% sure

young knoll
#

<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations-java5</artifactId>
<version>23.0.0</version>
<scope>provided</scope>
</dependency>

tender shard
#

hmm maybe choco told me bullshit then

#

or I confused sth

young knoll
#

We better ask MD to discipline him

tender shard
#

lol yeah idk

#

anyway, I remember that I expenrieced the same issues, and then md_5 told me to use java5 annotations

#

but the downside is, those do not support type annoattions

#

e.g. List<@urban grotto String>

young knoll
#

Yeah there was a jira issue about it recently

#

How types are not annotated

tender shard
#

it's kinda weird that it still hasn't been fixed

trim bough
#

bump

regal scaffold
#

Ok so

#

Between .3 and .4

#
Connection playerConnection = entityPlayer.connection.connection
#

Broke

remote swallow
regal scaffold
#

There it is

#

Ty

#

Wait but

#

How can I search for what the new version of something old was

#

Or like, what exactly am I looking for

#

I know why it doesn't work, cause the field is private in .4

#

and public in .3

young knoll
#

Iirc there’s a getter

regal scaffold
#

Nope

#

Unless gotta go through more stuff to get to it

#

But it's not directly available from ServerGamePacketListenerImpl anymore

tender shard
regal scaffold
#

Well in .3 I did

tender shard
#

for what?

regal scaffold
#

But in .4 if I can just send a packet

#

I don't

#

What's the .4 way to send a packet to a ServerPlayer

tender shard
#

do you only send packets, or do you listen to imcomping ones?

regal scaffold
#

Send

#

At the moment

tender shard
#

then you never needed the now private field

regal scaffold
#

What's the correct way to send a packet then

#

before and now

#

Just

#

#send?

tender shard
#

you can just use the ServerGamePacketListnerImpl#send(Packet<?>) method

regal scaffold
#

....

#

I hate nms

#

Thanks

tender shard
#

or however it's called

#

np

regal scaffold
#

Yeah

tender shard
#

yeah NMS sucks

#

I decidided to call nms "slughurn"

#

idk why but it's kinda matching name

regal scaffold
#

I got more stuff to figure out if you wanna give a hand lol

#

And you wanna die

tender shard
#

yeah ik ik

regal scaffold
#

Wait nvm I got this

tender shard
#

anyway you can just do sth like ((CraftPlayer)player).getHandle().getConnection().,send...

regal scaffold
#

I can figure it out

tender shard
#

you dont have to get the "connection of the connection"

regal scaffold
#

Yeah fair

#

Alex

#

I made a hologram implementation

#

That supports MiniMessages

plush nest
#

why can it only go up to 1.12 and not 1.8.9 im not sure why because back in 2022 this plugin used to allow me to go to 1.8.9 can someone help

#

wait

#

i cant show image

#

bruh

#

on intellij

#

minecraft development plugin only goes to 1.12 and not 1.8.9

#

how can I fix this

tender shard
#

you can get verified to send screenshots

regal scaffold
tender shard
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

plush nest
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

plush nest
#

!verify JonsStuff

undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!