#help-development

1 messages · Page 1816 of 1

ember estuary
#

it grows exponentionally, u know

ivory sleet
#

builder pattern is verbose

#

but thats one of its traits

ember estuary
#

true

ivory sleet
#

arguably a good one as it increases readability :p

ember estuary
#

doesnt intellij nowadays show the name of the parameters? xD

#

yeah it does

#

so not much of a difference when u got a good ide

#

xD

#

but i guess for creating the code the building pattern is nicer

ivory sleet
#

😎

gritty urchin
#

How do I set direction of glass pane block change to client using Block Change?

tacit drift
ivory sleet
#

probably been there for a long time

#

personally disabled it

spare prism
#

Why does the map isn't empty?
Code: https://pastebin.com/mt6Gm5iZ
Output:

[19:51:11] [Server thread/INFO]: TASK IS BEING EXECUTED!
[19:51:11] [Server thread/INFO]: EFFECTS: {10={}}
#

@ivory sleet

zealous osprey
#

Im playing a bit around with the #spawnParticle() method and I have the annoying thing that the particles disperse for some reason that I cannot seem to figure out. I'd rather want a continues "flawless" line

sharp bough
#

if you want to keep a particle alive

#

you need to reespawn it

#

if you want to make a line

#

get all the points in wich you want a particle

#

from x,y,z to x1,y1,z1 and spawn them there

zealous osprey
#

Rather the issue is that the particles disperse (fly all over the place) instead of being a continues line

sharp bough
#

show current code

#

and try antoher particle

zealous osprey
sharp bough
#

can you make a video showing what you mean by flying all over the place?

zealous osprey
#

You can clearly see the line, but there are particles like flying away from it, which I find weird

sharp bough
#

did you try debugging it?

#

printing all variables, both outside the for and inside

zealous osprey
#

It all seems in order

sharp bough
#

what about some other particle?

#

same thing?

zealous osprey
#

ye

#

When using command blocks you can set it's speed to 0, thats kinda what I want

sharp bough
#

seems similar to your problem

zealous osprey
#

Im gonna check it out

hasty prawn
#

You're not defining a deltaX, Y and Z

#

Set those to 0

zealous osprey
#

so thats the equivalent to setting speed 0 in the command block ?

smoky oak
#

shouldnt there be a function to set particle movement to zero?

#

the deltavalues are the vector its moving in

sharp bough
#

maybe the math is not correct

hasty prawn
sharp bough
#

the point.getX

zealous osprey
#
world.spawnParticle(Particle.FLAME, particleLoc, amount, 0, 0, 0);
hasty prawn
#

Yep, and if you want speed, add another int

smoky oak
#

how'd you make it blue tho?

zealous osprey
hasty prawn
smoky oak
#

ah

zealous osprey
#

yup

hasty prawn
zealous osprey
#

Oh yeah, I think "ashes" can change its colour depending on it

#

Noice, it works

hasty prawn
#

Yeah, DustOptions I believe? Only specific particles will accept the extra options though

smoky oak
#

error or just not accept?

hasty prawn
#

I think it throws an error but I'm not 100% sure

spare prism
#

Why doesn't it remove entries?

                                infectionEffects.entrySet().removeIf(entry -> {
                                    System.out.println("KEY: " + entry.getKey() + "; VALUE: " + entry.getValue());
                                    System.out.println("CHECK: " + entry.getValue().isEmpty());
                                    return entry.getValue().isEmpty();
                                });
[20:33:20] [Server thread/INFO]: KEY: 10; VALUE: {}
[20:33:20] [Server thread/INFO]: CHECK: true
quaint mantle
#

Depends on your map impl

stone sinew
spare prism
stone sinew
#

Can you post more of the code then cause that should work.

spiral light
quiet ice
#

The same applies to the keyset and values set

stone sinew
#

Unless you use an iterator.

quiet ice
#

It is delayed by a tick

#

even then, that'd produce a CME, you'd usually notice it

stone sinew
quiet ice
#

I would say the issue lies in that the element is removed but too late or something

spare prism
#
[20:39:34] [Server thread/INFO]: TASK IS BEING EXECUTED!
[20:39:34] [Server thread/INFO]: EFFECTS: {10={}}
[20:39:35] [Server thread/INFO]: TASK IS BEING EXECUTED!
[20:39:35] [Server thread/INFO]: EFFECTS: {10={}}
[20:39:36] [Server thread/INFO]: TASK IS BEING EXECUTED!
[20:39:36] [Server thread/INFO]: EFFECTS: {10={}}
[20:39:37] [Server thread/INFO]: TASK IS BEING EXECUTED!
[20:39:37] [Server thread/INFO]: EFFECTS: {10={}}
[20:39:38] [Server thread/INFO]: TASK IS BEING EXECUTED!
[20:39:38] [Server thread/INFO]: EFFECTS: {10={}}
[20:39:39] [Server thread/INFO]: TASK IS BEING EXECUTED!
[20:39:39] [Server thread/INFO]: EFFECTS: {10={}}
stone sinew
#

For the hell of it, try an iterator for loop.

spare prism
#

or what

stone sinew
spare prism
#

which

stone sinew
#

for(Iterator<k, v> it : infectionEffects.toIterator) I think

spare prism
#

u mean instead of this?

                                infectionEffects.entrySet().removeIf(entry -> {
                                    System.out.println("KEY: " + entry.getKey() + "; VALUE: " + entry.getValue());
                                    System.out.println("CHECK: " + entry.getValue().isEmpty());
                                    return entry.getValue().isEmpty();
                                });
stone sinew
#

yes

spare prism
#

ok

stone sinew
#

Another thing you can try (I think it might error though) is just running inffectionEffects.remove(key) since you delayed it by a tick.

spare prism
#

it throws me the CME

stone sinew
#

You also could switch the original forEach lambda to an iterator and you won't get an error for removing during the loop.

quaint mantle
#

Put it in an intermediary list

#

Alternatively Iterator#remove

spare prism
#
                                Iterator<Map.Entry<Long, Map<PotionEffect, Integer>>> entryIterator = infectionEffects.entrySet().iterator();
                                while (entryIterator.hasNext()) {
                                    Map.Entry<Long, Map<PotionEffect, Integer>> entry = entryIterator.next();
                                    if(entry.getValue().isEmpty()) {
                                        System.out.println("REMOVED!");
                                        entryIterator.remove();
                                    }
                                }
[20:53:23] [Server thread/INFO]: REMOVED!
[20:53:24] [Server thread/INFO]: TASK IS BEING EXECUTED!
[20:53:24] [Server thread/INFO]: EFFECTS: {10={}}

Same, @stone sinew

quaint mantle
#

So you add to the Set afterwards?

spare prism
quaint mantle
#

So you add to the map

stone sinew
quaint mantle
#

Like do you invoke Map#put

spare prism
#

should I?

quaint mantle
#

So a system.Out.println infectionEffects after your removeIf

spare prism
#

you mean to remove the iterator and change it back to the removeIf() method?

#

and then to add debug

#

after it

quaint mantle
#

I kinda doubt that removeIf is bork, it is more likely that you are regenerating the entry

#

Yea

spare prism
#
default boolean removeIf(Predicate<? super E> filter)

Removes all of the elements of this collection that satisfy the given predicate. Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller.

Implementation Requirements:
    The default implementation traverses all elements of the collection using its iterator(). Each matching element is removed using Iterator.remove(). If the collection's iterator does not support removal then an UnsupportedOperationException will be thrown on the first matching element.
Parameters:
    filter - a predicate which returns true for elements to be removed
Returns:
    true if any elements were removed
Throws:
    NullPointerException - if the specified filter is null
    UnsupportedOperationException - if elements cannot be removed from this collection. Implementations may throw this exception if a matching element cannot be removed or if, in general, removal is not supported.
Since:
    1.8 
quaint mantle
#

So?

spare prism
#

nvm, I just sent it for you to make sure that u are right

#

I mean to give u the possibility to check it out

#

@quaint mantle, lmao, [21:03:54] [Server thread/INFO]: AFTER REMOVEIF: {}

#
                                infectionEffects.entrySet().removeIf(entry -> {
                                    System.out.println("KEY: " + entry.getKey() + "; VALUE: " + entry.getValue());
                                    System.out.println("CHECK: " + entry.getValue().isEmpty());
                                    return entry.getValue().isEmpty();
                                });
                                System.out.println("AFTER REMOVEIF: " + infectionEffects);
#

I fixed it somehow

#

ty for trying to help me

iron tundra
#
private HashMap<String, UUID> chunks;
plugin.addChunk(chunkID, player.getPlayer().getUniqueId());
    public UUID getOwner(String chunk){
        return chunks.get(chunk);
    }

Error: getOwner returns null
Use: Trying to get the UUID of the chunk owner from the hashmap
If you know why I might not be able to get the UUID I would appreciate it!

hasty prawn
#

Whatever you're passing into getOwner doesn't exist in the Map

iron tundra
#

But I have UUID a part of the hashmap? Did I set it up wrong?

hasty prawn
#

You have to add them into the Map first

iron tundra
#

How?

#

Oh wait

#

public void addChunk(String chunk, UUID owner){
chunks.put(chunk, owner);
}

#

This is a part of the program

#

I just put the parts I think are the issue

#

If you might know why this is happening I would appreciate the help

frosty geyser
#

So working on a plugin that uses PlayerDropEvent on 1.12.2 and for some reason it cannot get the players opened inventory since i'm checking if someone drops an item and it will give them 10 levels of a custom enchants but i was first trying to get the inventory's name by sending a player a message and it doesn't even send a name

shut quail
#

Hi, can I check permissions for other plugin's command, and if player doesn't have it, interrupt command execution?

sullen marlin
#

Search the docs for getCommand and get permission or something

#

But they should already be stopped...

shut quail
#

Yes, but I ran into different error messages problem, so I want to unify it

#

Do you know how to intercept command execution before it goes to the other plugin?

sullen marlin
#

PlayerCommandPreprocessEvent

digital rain
#

what do you guys check for if looking for crits? i do
boolean crit = p.getFallDistance() > 0.0 && !((Entity)p).isOnGround() && !p.getLocation().getBlock().isLiquid() && !p.hasPotionEffect(PotionEffectType.BLINDNESS) && !p.hasPotionEffect(PotionEffectType.SLOW_FALLING) && !p.isInsideVehicle() && p.getLocation().getBlock().getType() == Material.AIR && p.getAttackCooldown() == 1.0; any other ideas?

#

its not 100% reliable so hats why im asking

digital rain
#

can you crit during slow fall?

#

i dont think so

#

let me try

digital rain
late sonnet
digital rain
#

oh ok

shut quail
#

Do you think something like this should work?

@EventHandler
public void onCommandPreprocess(PlayerCommandPreprocessEvent e) {
    getLogger().info(e.getMessage());
}
#

because it doesn't

frosty geyser
#

how do you get the top of an open inventory using PlayerDropEvent

#

because whatever i try it does not work

cold field
#

Hi guys, quick question. Does anyone know if it is possible, with gradle, redirect the output of the task "buildsNeeded" inside one single fat jar (Without using plugins like shadow)

digital rain
proven river
#

I'm making a plugin where if you die you get banned, But I want it so then if the player has not logged on before there will be a 12 hour grace period, how do I get it so then it ignores the event which gets you banned if you die?

frosty geyser
#

so when you have an chest open there is a command that you can do player.getOpenInventory().getTopInventory() which will get the top gui

#

which you can use for stuff like PlayerDropEvent to see if the item is part of the top inventory

#

but it does not work for some reason

hollow spindle
#

Oh you mean the Chest GUI compared to the player inventory?

frosty geyser
#

kinda, since i am trying to make a custom enchant plugin for a javarock server which with geyser it doesnt send the server the right click packet for inventories so i have to check if they drop an item

#

so using PlayerDropEvent and checking the OpenInventory.getTopInventory().getName() should get its name but it doesn't show up

hasty prawn
frosty geyser
#

it seems like the event doesn't even go off when you have an gui opened

proven river
hasty prawn
frosty geyser
#

this video demonstrate what happens

#

while trying to use the PlayerDropEvent

#

with a custom gui

hasty prawn
#

Well the event is being fired somewhere since it's being cancelled.

frosty geyser
#

it is not being used anywhere else

#

this is the first time its being used

#

and this is the code i'm using:

    public void onInventoryDrop(PlayerDropItemEvent e) {
        Player p = e.getPlayer();
        Inventory inv = p.getOpenInventory().getTopInventory();
        String isinvnull = inv.getName();
        p.sendMessage(isinvnull + "");
        p.sendMessage(i.getName());
        
    }```
#

it sends 0 errors in console

hasty prawn
#

You need InventoryClickEvent with ClickType of DROP

frosty geyser
#

okay

hasty prawn
#

PlayerDropItemEvent only fires if they drop something from their inventory.

frosty geyser
#

It works now ty very much DessieYT

proven river
# hasty prawn Subtraction

How would I log their time played though?
I have a general idea of getting the current time but past that i'm a little confused

hasty prawn
#

You don't have to log it, it's already logged for you.

#

Player#getFirstPlayed

#

Is it 12 hours from when they join or they have 12 hours of playtime?

proven river
hasty prawn
#

Yeah, Player#getFirstPlayed then.

proven river
#

Alright thanks

quaint mantle
#

Hi everybody. I am a minecraft developer with Russian )

#

How many maximum people were on your server without bungee?

leaden island
#
user@server:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-16-oracle/bin:/usr/lib/jvm/java-16-oracle/db/bin

Hi, does anybody know, where the file for the /usr/lib/jvm/java-16-oracle/bin:/usr/lib/jvm/java-16-oracle/db/bin section of the path is? My .bashrc file doesn't configure anyting path related and /etc/environment is just the default path.

leaden island
unkempt peak
#

Is it possible to detect when an entity plays an idle sound using events or packets?

chrome beacon
#

You'd have to use packets

#

Not all sounds are server side though. I'm not sure how idle sounds are handled

unkempt peak
#

Do you know what packets I'd need to listen too?

#

Sorry still not great with packets, especially in 1.17+

chrome beacon
#

It would be the NamedSoundEffect packet

unkempt peak
#

Ok Ill take a look and see if i can figure something out

misty current
#

can you clone an inventory?

#

or do I need to clone its contents

chrome beacon
#

contents probably

misty current
#

also is the name of the inv nullable?

chrome beacon
#

probably

misty current
#
    private Inventory cloneInventory(Inventory inv){
        Inventory cloneInv;
        if(inv.getType() == InventoryType.CHEST) {
            cloneInv = Bukkit.createInventory(inv.getHolder(), inv.getSize(), inv.getTitle());
        } else {
            cloneInv = Bukkit.createInventory(inv.getHolder(), inv.getType(), inv.getTitle());
        }
        
        cloneInv.setContents(inv.getContents().clone());
        return cloneInv;
    }
``` seems about right doesn't it
shut quail
#

Do you know why .getPermission() called on default server command is working well, but when this command is from other plugin it returns null?

chrome beacon
#

Did said plugin define a permission

shut quail
#

I think that plugins like essentials or luckperms has defined permissions on commands

chrome beacon
#

Check their plugin.yml

shut quail
#

oh, they don't have in plugin.yml :v
In that case how can I manage permissions for their commands?

chrome beacon
#

The name can be null

#

In that loop it's probably fine

#

When the server doesn't have a username stored

shut quail
#

I want to check permissions for command before the other plugin does it, so how can I check it in that case? They must somehow check permissions because I can set they in permission plugin

eternal oxide
#

if a plugin has assigned a permission to a command it never executes the onCommand

#

it never gets to check the permission. Spigot does it

shut quail
#

Yeah, but the plugins doesn't have permissions in plugin.yml

eternal oxide
#

bad plugin then

shut quail
#

So where they have it? If I ran .getPermission() it returned null, so I think the Spigot doesn't check permissions for these commands

eternal oxide
#

you ran .getPermission() on what?

shut quail
shut quail
eternal oxide
#

do you mean that threw an NPE or you checked the returned value?

shut quail
#
@EventHandler
public void onCommandPreprocess(PlayerCommandPreprocessEvent e) {
        String commandName = e.getMessage().substring(1);
        Command command = server.getPluginCommand(commandName);
        if (command == null) command = commandMap.getCommand(commandName);
        server.getLogger().info(command.getPermission());
    }
eternal oxide
#

Essentials registers the command but no command perms

sullen marlin
#

Love essentials for that

chrome beacon
#

CMI is even worse

shut quail
#

So from where LuckPerms can autocomplete perms from essentials?

eternal oxide
#

the perms are registered, but not with each command

shut quail
#

LuckPerms command's permissions return null too :v

eternal oxide
#

as I just said

shut quail
#

Is there any chance to check permissions for command from these plugins?

sullen marlin
#

Not automatically

#

Yell at their authors

#

Maybe one day they will fix them

shut quail
#

So I must manually create a file with every permission listed?

sullen marlin
#

Pretty much

#

Blame the plugin authors for checking permissions with custom code

shut quail
#

So there's why they have custom deny messages :v

sullen marlin
#

Yes

ancient plank
#

😔

#

Blame me too because i'm silly and do the same thing

shut quail
#

This is my main problem, so I read that any permission is handled by Spigot and I have an idea to create plugin to unify those messages... but it turned out that it isn't that easy....

shut quail
#

Are there real advantages from that?

young knoll
#

I mean I do like having a custom no permission message

#

Plus you can make it editable and therefor translatable

ancient plank
#

^

#

its also just a habit i have

young knoll
#

Can’t easily edit that though

#

It’s in the jar

shut quail
young knoll
#

It’s uhh

#

Optimization

shut quail
#

And if you use for example paper, you can set your own message for lack of permissions :v

#

So I have an another idea 😅
Can I just remove Multiverse-Core commands form tab autocomplete? Because even if player doesn't have permission they still appear :v

sullen marlin
#

There's an event you can use

#

Command send or whatever for 1.13+

#

Tab complete for older

shut quail
#

I'm making it for 1.18

young knoll
#

Yeah the is an event where the command list gets sent to the client

#

You can remove entries from it

proven river
#

I'm making a plugin where if you die you get banned, But I want it so then if the player has not logged on before there will be a 12 hour grace period, how do I get it so then it ignores the event which gets you banned if you die?
I've got this so far:
Date firstPlayedDate = new Date(player.getFirstPlayed());

vague oracle
#

You just need to check if (player.getFirstPlayed() + TimeUnit.HOURS.toMillis(12)) <= System.currentTimeMillis(); is true and if so ban them

proven river
vague oracle
#

yes

native gale
#

Am I allowed to ask basic things about Java here?

proven river
#
        {
            player.getInventory().clear();
            player.banPlayer("You have died", Date.from(now.plus(duration)));
        }```

Its telling me it has an empty body but it dosent?
proven river
#

oh thanks

#

:D

sullen marlin
native gale
#

Oh, how dare you, md5, I code my things myself

#

I just have weird problems while trying to build one library from github and idk what to do actually

#

It says

#
C:\the_path\GetPlatform.java:8: error: unmappable character (0x8F) for encoding windows-1252
 * platform. Possible values: *'ios' — iOS,, *'android' — Android,, *'winphone' — Windows Phone,, *'web' — приложени�? на vk.com. By default: 'web'.```
sullen marlin
#

Idk looks like gradle to me

native gale
#

SO didn't give any meaningful answer, so perhaps people here are slightly smarter?

#

Idk

native gale
sullen marlin
#

Google gradle utf8 or something then

native gale
#

Sure, that's the first thing I did actually

golden turret
#

how could i set a custom serializable to the root config path

quaint berry
#

Can someone help by writing a code that creates a config

golden turret
#

something like config.set("", myObjectHere)

quaint berry
#

Oh

#

What

#

I'm stupi

#

d

drowsy sapphire
#

yo how do i set my plugin version as 1.8.8 with maven (using IntelliJ)

golden turret
#

and to get, config.get("")

dry forum
#
[07:05:02 WARN]:        at java.base/java.io.UnixFileSystem.createFileExclusively(Native Method)
[07:05:02 WARN]:        at java.base/java.io.File.createNewFile(File.java:1034)```
 is there a reason why my file isnt creating?
                   ``` if (!f.exists()) {
                        try {
                            f.createNewFile();
                        } catch (IOException e) {
                            e.printStackTrace();
                        }```

its saying it doesnt have permission and yes the directory is correct
sullen marlin
#

so the permission is not then?

dry forum
#

no like the file isnt creating its saying it cant create the file because it doesnt have permission

sullen marlin
#

so check your permissions

#

make sure the folder is writable as the user you are running as

dry forum
#

it is

#

some files create some dotn

sullen marlin
#

there's a nearby entities method, or just check their position with location.distance (squared)

#

whatever you pass as params

dense geyser
#

is there a way to create an entity, but completely remove all methods of saving it so when a world is reloaded/server restarts/crashes, the entity no longer exists? I mean other than from sending packets to users that are close to the entity. In any normal case I'd just store them in a list and remove then when the plugin disables, but if the server or plugin crashes, those entities will still be present causing issues

visual tide
#

how did spigot patch the log4j thing if it's shaded into the vanilla server?

buoyant viper
#

magic

#

😎

quaint mantle
#

Does anyone recieve ``` Pulling updates for C:\Users\DevCow\Desktop\Build\BuildData.git
Successfully fetched updates!
Checked out: 0630ea462a82fdbd93018de7d5ec5e9d3b3c732b
Pulling updates for C:\Users\DevCow\Desktop\Build\Bukkit.git
Successfully fetched updates!
Checked out: 1d2509b99fb10b3bd6f597e63805f85b49d5a055
Pulling updates for C:\Users\DevCow\Desktop\Build\CraftBukkit.git
Successfully fetched updates!
Checked out: 7019900e276b7c9f6e940debf8529094c7f4da0c
Pulling updates for C:\Users\DevCow\Desktop\Build\Spigot.git
Successfully fetched updates!
Checked out: 550ebace4b43adc73854d7d5976e1343eba6fb98
Attempting to build Minecraft with details: VersionInfo(minecraftVersion=1.8, accessTransforms=bukkit-1.8.at, classMappings=bukkit-1.8-cl.csrg, memberMappings=bukkit-1.8-members.csrg, packageMappings=package.srg, minecraftHash=null, classMapCommand=null, memberMapCommand=null, finalMapCommand=null, decompileCommand=null, serverUrl=null, mappingsUrl=null, spigotVersion=null, toolsVersion=0)
Exception in thread "main" java.io.FileNotFoundException: work\minecraft_server.1.8.jar (The system cannot find the file specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at org.spigotmc.builder.Builder.main(Builder.java:411)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)

sullen marlin
#

please try a version other than 1.8.0

#

that is REALLY outdated

buoyant viper
#

didnt even know buildtools built anything lower than 1.8.8

#

couldve sworn it autoupgraded 1.8 to 1.8.8

quaint mantle
#

ok

#

ima guess and say 1.8 is now Obsolete

sullen marlin
buoyant viper
quaint mantle
#

ok

#

::)

sullen marlin
#

fkn 1.8 gonna be older than the kids asking how to run it soon

ember estuary
#

will this trigger an endless loop?

sullen marlin
#

probably

buoyant viper
sullen marlin
#

fix your permissions

dry forum
#

wdym

sullen marlin
#

what are the permissions on the folder

dry forum
#

there are none

buoyant viper
ember estuary
#

any way to not make it run in a loop?
How can i add xp without that event getting called?
(I am trying to sync all players xp)

sullen marlin
#

what OS?

dry forum
#

for the server?

sullen marlin
#

yes

dry forum
#

not sure where to find that on my server host

sullen marlin
#

what file/folder are you trying to make

#

what is the path

buoyant viper
dry forum
#

plugins/<my plugin name>/stats/data.yml

sullen marlin
#

does the stats folder exist

dry forum
#

yes

buoyant viper
#

or actually, maybe theres a way to see the source the exp?

#

so if source is plugin itd b ignorable

ember estuary
#

lemme see

buoyant viper
#

doesnt look like it, rip

#

oh wait, interesting line in documentation

#

"Called when a players experience changes naturally"

#

so maybe it wont loop?

quaint berry
#

Can someone hop into a call to help?

#

I still don't get this

quaint mantle
#

thanks md_5 for the help

hasty prawn
ember estuary
#

wym?

#

i want to change it for every player

#

besides the one that the event originated from

hasty prawn
#

What are you trying to do

#

Like, why

ember estuary
#

i am trying to sync the xp of all players

#

so everyone has same level/xp

#

if i pick up an xp, it also gets added for everyone else

#

if i spend xp, everyone else also looses it

hasty prawn
#

You can probably safely call Player#setExp and it won't trigger the event.

#

Not sure about giveExp, you'll just have to try it I suppose.

ember estuary
#

why wouldnt that trigger the event :o

hasty prawn
#

Because the event states "naturally"

#

And that would not be natural

ember estuary
#

oh, then setAmount also wont trigger it i guess

hasty prawn
#

setAmount definitely would not

ember estuary
#

oh wait, i mean giveExp

#

xD

hasty prawn
#

It probably wouldn't.

ember estuary
#

gotta get a friend to help me test

balmy pilot
#

Hey, I was wondering if there's a way to get the translatable name from an item stack/material/etc that can be used in a translatable component? E.g. "item.swordDiamond.name" for a diamond sword.

hasty prawn
#

Like, getting what the name of "Diamond Sword" would be in Spanish for example?

balmy pilot
#

No, much simpler, like getting the literal string "item.swordDiamond.name" if like the current material was indeed a diamond sword.

quaint mantle
#

nms

#

in mojang it is translatable component i think

balmy pilot
#

sigh I was afraid of that. I was using NMS for it before, but with the whole remapping component to using server internals, I was hoping there was an API way.

delicate loom
#

Is there a serverbound packet for when a player stops using a spyglass? There has to be right? How else would other players see the original player put down the spyglass?

balmy pilot
# ivory sleet there is an api

Yes I know about translatable component. The issue is I need the specific locale key for the itemstack/material (given an arbitrary item) to construct the translatable component.

hybrid spoke
dry forum
#

how/why though? its using a plugin

hybrid spoke
dry forum
#

idk how to check

hybrid spoke
#

windows... linux... anything

dry forum
#

um windows i think? its a host

hybrid spoke
#

can you somewhere adjust the permissions?

dry forum
#

no

#

except for subusers

quaint mantle
#

How hard would it be to create a plugin that just prevents learning Recipes from the world (requiring knowledge books) ??

#

Its implemented in 3 commandblocks right now... is something like that an easy translation to plugin ?

buoyant viper
#

@dry forum do u have ssh access to ur server

dry forum
#

yea

buoyant viper
#

ssh into it, and see what happens when you run uname -a

#

if it fails, ur on windows, if it succeeds, ur on some variant of linux probably

dry forum
#

its linux

opal sluice
#

Hi, I have a little problem, I'm trying to change the spawner entity type, but it doesn't seem to want to be changed 😢
Does someone knows what I'm doing wrong here ?

ItemStack itemToDrop = new ItemStack(Material.SPAWNER);
BlockStateMeta itemToDropIM = (BlockStateMeta) itemToDrop.getItemMeta();
CreatureSpawner spawnerState = (CreatureSpawner) block.getState();
spawnerState.setSpawnedType(EntityType.valueOf(getProbabilityEntityType()));
itemToDropIM.setBlockState(spawnerState);
itemToDrop.setItemMeta(itemToDropIM);
sullen marlin
#

does spawnerState need .update() ? I forget

opal sluice
#

Tryed the .update()

#

Just need it when it's an already placed block

#

otherwise, it shouldn't, or at least, here it doesn't seems to work

sullen marlin
#

are you in creative/op. Usually you need that to place tile entity with data

opal sluice
#

Nope, the fact is that I get a normal spawner dropped, not the one with the actual entity in it

#

Always a pig spawner

#

I tryed giving to me a spawner with essentials for example, and it works well, I can place it and the entity is the correct one

#

So I guess, there's something wrong with my code :/

sullen marlin
#

its EntityType.valueOf correct?

#

ie returning correct type

#

otherwise code looks fine to me so idk

opal sluice
#

ZOMBIE should be a valid entity (I placed some debug lines, cause I thought about the same, that the valueOf was incorrect)

#

Wait, am I stupid, just gonna check how essentials does it x)

#

Ok they do the same 😭

opal sluice
rough basin
#

I tried this to make a dataFolder, but anything happend :(

#

Is there anything wrong?

opal sluice
#

Looks good to me

rough basin
#

I expected that a new folder would be created where the plugin's .jar file was located.

#

am I thinking about the folder location wrong?

opal sluice
#

That's it

#

"this" is your plugin instance right ?

golden turret
#

mkdirs

#

maybe

rough basin
opal sluice
#

oh yeah

#

mkdirs

#

woops

rough basin
#

I'll try it

#

wait a sec

#

um

#

nothing changed :(

opal sluice
#

You just want to make a dir with the plugin name into the plugins folder to put some files ?

golden turret
#

wait

#

remove the if check

#

and try it

rough basin
#

oh shit

#

i forgot my project folder

#

🤦

opal sluice
#

x)

golden turret
#

🤡

summer scroll
#

With SQLite, should I keep the connection open?

opal sluice
#

Never keep a connection open

#

if you need to make more than one statement at a time, just use transactions

sullen marlin
#

Not sure that’s true

#

I think with sqlite especially keeping the connection open is better

summer scroll
#

I'm having problem with saving multiple data at once with SQLite, connection getting closed etc, and sometimes I get SQLITE_BUSY error.

opal sluice
#

Making sure to close the connection and opening when needed, will just avoid any problem

summer scroll
#

So just store it in the field, and if the connection is closed or null, open the new one?

sullen marlin
#

Pretty sure that’s what I do

opal sluice
#

Anytime you make a query, just get the connection, your connection getter should check if the connection is still opened since you can't open two connection at a time in SQLite

#

if it's already open, then just return the open connection

summer scroll
#

I already do that, but I still received error, saying that connection is closed

opal sluice
#

Well, you're doing something wrong somewhere

summer scroll
#

Could be, I'll try something

opal sluice
#

Maybe, you're trying to read a result while your connection is closed ?

#

When you read a result, the connection must still be open

summer scroll
#

I'm using hikari for the mysql

opal sluice
#

You can use it also for SQLite

summer scroll
#

really?

#

how can you do that

opal sluice
#

yup

#

Just set the engine to SQLite

#

You have a lot of information about that on their doc

summer scroll
#

do i need to set it on the HikariConfig?

opal sluice
#

i guess so

#

lmck

#

yup, get the config, and change the JdbcUrl

#

That's what I use to check my connection

    public Connection getSQLConnection()
    {
        try {
            if (getDs() == null || getDs().isClosed()
                 || getConnection() == null || getConnection().isClosed())
            {
                setConnection(getDs().getConnection());
            }
            return getConnection();
        } catch (SQLException ex)
        {
            plugin.getLogger().log(Level.SEVERE, "SQLite exception on initialize", ex);
        }
        return null;
    }
summer scroll
opal sluice
summer scroll
opal sluice
#

you can port some config from your mysql to the sqlite

#

like the poolname

summer scroll
#

what are the required config?

opal sluice
#

I would set a leak detection threshold

#

The connection timeout, the test query

#

on SQLite if you use foreign keys, add an init sql such as "PRAGMA foreign_keys=ON"

summer scroll
#

how much should i set on the leak treshold?

opal sluice
#

10k should be good

summer scroll
#

alright, perfect

upper vale
#

if youre using hikari, you should be closing your connections iirc

summer scroll
#

i use try-with-resources, so it should close by itself

opal sluice
#

Oh, here you have your problem with the connection closed error then ^^

summer scroll
#

ah

#

so i really need separate code for mysql and sqlite

opal sluice
#

Don't use that while getting results if you have methods that makes the queries, the results need the connection to be open

stone apex
#

slf4j sounds a lot like log4j... It's for database connection pooling. Could that also be vulnerable? I don't understand the exploit and it just reminds me daily that anything can happen, I wish I had the tools to fix this myself / secure the code. Ugh I do not wanna write my own connection pooling class though

upper vale
#

theyre logging libraries, have nothing to do with database connection pooling

stone apex
#

I was just sitting there after a brrrrutal quarter in computer engineering and I was like did spigot really just like use a random infected library? Like is this entire exploit just because no one looked at some code?

upper vale
#

im also still stunned by the fact that a logging framework managed to create an rce exploit

#

this isnt just spigot btw, other online services were also effected including miencraft itself

summer scroll
opal sluice
#

@summer scroll You're using try-with-resources on results queries

stone apex
#

It was just like so many discord @ notifications during finals week and I have to say, it was pretty alarming. Every server was like "we patched it" but some POM got updated and that was it? Literally just look at the code next time?

summer scroll
opal sluice
#

You can't

upper vale
#

sol they just bumped the version in pom

summer scroll
upper vale
#

its a bit more complex than just "looking at the code"

#

i mean even apple has stuff like this from time to time

opal sluice
upper vale
#

iirc IOS 14.7 and 14.8 patched 2 remote 0-click iMessage exploits

summer scroll
opal sluice
stone apex
#

True in high school there was dumb stuff like sending some characters via text and the persons phone would just restart

summer scroll
upper vale
quaint mantle
#

:lmao:

#

I wish i could find that

#

hmm my pc lab use windows 7

opal sluice
summer scroll
opal sluice
#

well, close it on disable

summer scroll
#

true xd

#

yeah i closed it on disable

opal sluice
#

Still nope

#

Don't use try-with-resource x)

#

closing the preparedstatement, will close the connection

summer scroll
#

like at all?

opal sluice
#

Just use your ResultSet, and then, close the connection

summer scroll
summer scroll
#

what

opal sluice
#

Looks good to me x)

summer scroll
#

okay, thanks

#

i'll try it out and let you know

opal sluice
#

btw, closing the ResultSet will close the ps

tired dagger
#

Hey, can someone help me out with Streams? I've never worked with them before.
I'm trying to loop through a list that contains a list of commands and get the
respective subcommands but my current stream seems to only return the commands from the first list. I.e: it's not grabbing the subcommands from each object but rather the command from the main object. I saw something online about a flat map but couldn't really make sense of it. Is that what I need to use or...?

sullen marlin
#

Regular map instead of peek should be fine

#

And no need to collect if your just forEaching after

tired dagger
#

Yeah, I was trying a map but I guess I'm doing it wrong bc its not bringing up the respective methods

buoyant viper
#

.map(AbstractObscureCommand::getSubCommands).forEach(cmd -> @tired dagger

#

?

tired dagger
#

Hmm?

buoyant viper
#

o wait

#

what r u trying to do again

tired dagger
#

So I have a List<abstractCommand> (each abstract command will be implemented and has getName() and getSubCommands()). I'm trying to iterate through each abstract command and run the getSubCommands() for each

#

I know I can just use a regular for loop but I feel like it would be better to use streams for 1.) efficiency and 2.) practice/understanding of streams

buoyant viper
#

if youre just trying to list them in console

#

u should be fine to just do "Found command: " + cmd

#

oh actually maybe it would be

#
abstractCommands.forEach(cmd -> abstractCmd.getSubCommands().forEach(subCmd -> Utils.msgConsole("Found " + subCmd)));```
tired dagger
#

Well, the list to console was more for debug purpose. I was going to run setExecutor on each

tired dagger
buoyant viper
#

because your getSubCommands() returns a List<String> ...

tired dagger
#

Ahh, hmm.

#

Okay, got it w/ java abstractCommands.forEach(cmd -> cmd.getSubCommands().forEach(subCmd -> Utils.msgConsole(Utils.INFO + "Found Command: " + subCmd)));

buoyant viper
#

hm

wicked lake
#

persistent data is pretty chill, been using it to store some stuff for custom mechanics for me :D

hidden cloak
#

is there a way to set the entire chat message in AsyncPlayerChatEvent without the string formatting?

#

because when using setFormat when players send a message with % it breaks

worn tundra
#

You need to escape the % and other special symbols

#

with \

quaint mantle
#

Anyone have a Util to save Player inventories?

worn tundra
#

Abstract question

#

how and where do you want to save them

quaint mantle
#

Base64

hidden cloak
quaint mantle
worn tundra
hidden cloak
#

that doesnt work

hidden cloak
worn tundra
#

Print out the string that you're sending

#

shouldn't have the same error

hidden cloak
#

im just testing it rn but

        String foo = "foo";
        String test = "test";

        System.out.println(String.format("aaaa %s mmmm %s, eeee replace".replace("replace", "\\%"), foo, test));```
worn tundra
#

Wait what

#

What are you doing

hidden cloak
#

i want to make a custom chat format like event.setFormat("%s: %s"); which will do playername: message but if the player sends a message with % it breaks

waxen plinth
#

They are often cleaner but they are a bit slower than regular iteration

waxen plinth
#

It'd be better to use flatMap

buoyant viper
#

im still not sure what hes trying to do anyway

waxen plinth
#
abstractCommands.stream().flatMap(c -> c.getSubcommands().stream()).forEach(s -> Utils.msgConsole("Found " + s));```
worn tundra
#

Why are you working on the whole format

hidden cloak
#

because it doesnt change anything

worn tundra
#

Take the message string and replace the special symbols in it

waxen plinth
#

Though...

hidden cloak
#

itll still translate to %

waxen plinth
#

That is a really, really verbose way to do commands @tired dagger

worn tundra
waxen plinth
#

The savings you're making in lines of code from using streams in iterating over them is lost tenfold in the verbosity of the actual code it takes to implement one command

tired dagger
waxen plinth
#

Ok but look at all the code it takes to define a command

#

This is the screenshot you posted

#

That's insanely verbose

tired dagger
#

Reco then?

waxen plinth
#

I've got a much better alternative, can I DM you

tired dagger
#

I hope its not ACF, Idk how to use that

waxen plinth
#

It's not ACF

tired dagger
#

Continue

waxen plinth
#

How about a little demonstration

#

Let's say you want to write a command like this:

#

It's run with /smite

tired dagger
#

mmhmm

waxen plinth
#

You can run /smite to just smite yourself

#

But it can only be run as a player like that

#

Otherwise, you can run /smite <player> to smite a specific player

#

Which can be run from console

#

And it requires the smite.use permission to be run

#

How would you implement this?

tired dagger
#

Constructor overloading?

waxen plinth
#

How so

#

You don't have to write up all the code

#

But it'd be a fair bit of code, right?

tired dagger
#

I suppose

waxen plinth
#

I can do it in 4 lines of java

#

And 4 lines of rdcml

#
smite player:target?(context self) {
  permission smite.use
  hook smite
  help Smites a player, or you
}```
#
@CommandHook("smite")
public void smite(CommandSender sender, Player target) {
  target.getWorld().strikeLightning(target.getLocation());
}```
#

The top there is rdcml, my custom file format for command metadata

#

It lays out all the necessary information about the command: name(s), help message, permission, arguments

#

player:target?(context self) is the most complicated part here

#

But it's basically just saying "take a player as an argument, optionally, and if no player is specified then use the sender"

tired dagger
#

a ternary

waxen plinth
#

Not quite

#

player is the type, target is the name

#

? specifies that it is optional

tired dagger
#

mm

waxen plinth
#

And (context self) tells it to use a context provider called self to fill in the default value

#

Interested?

waxen plinth
#

My command library

#

It's my custom format, rdcml

#

(has an intellij plugin for error checking and syntax highlighting)

lavish hemlock
#

what's the overhead

waxen plinth
#

Haven't really measured it but I've used it on big servers without issue

tired dagger
waxen plinth
#

Yep that's the one

sullen marlin
#

Skript is a command library too :3

waxen plinth
#

Skript 🤢

#

Mine is very much not a scripting language, it's a markup language

#

All it does is try to minimize the amount of error checking and conversions you need to do, then pass the arguments off to your hook method which can do whatever

tired dagger
#

One of the reasons I did mine like so was bc I didn't want "partial commands" i.e. every command I create must have a name, desc, perm, etc.

waxen plinth
#

Yeah you can very easily do that with this

#

Including for subcommands

#
basecommand,alias {
  help This is the command description
  permission permission.node.here
  subcommand,alias {
    help This is the subcommand description
    permission another.permission.here
  }
}```
#

Will create a command with a subcommand

sullen marlin
#

plugin.yml with extra steps :3

waxen plinth
#

It's really, really not

#

lol

#

It automatically handles argument type conversions, tab completion, permission checks, help menu generation, optional arguments and default values where applicable, and cuts through the boilerplate of writing commands like a hot knife through butter

#

You can't specify arguments in the plugin.yml other than saying the usage, and it won't make the checks and conversions for you

#

hey

#

why'd you delete that top tier message

tired dagger
#

But wouldn't you have to remember that syntax every time? Thing I like about mine is it forces you to implement all the methods. I.e. the IDE will throw an error so you don't forget

waxen plinth
#

What do you mean

#

For the syntax of the command file there is an intellij plugin that will check errors and do syntax highlighting for you

#

It's very nice

tired dagger
#

Does it support color codes?

waxen plinth
#

What do you mean

tired dagger
#

Like

waxen plinth
#

Do you mean for help messages?

tired dagger
#

uh huh

waxen plinth
#

No need

#

The only thing you need to specify is the message

#

It handles everything else for you

#

Example

#

All of the messages seen here are configurable

#

So you can change the colors or format if you want

#

Individual commands shouldn't be specifying the colors for their help messages, it should be consistent

#

Though you can if you really want to for some reason

tired dagger
#

Interesting

maiden thicket
#

what would be the best approach of creating a wither boss type of spawn (4 blocks, 3 heads, same positioning) but with different block materials and skull textures

waxen plinth
waxen plinth
#

It's pretty annoying

maiden thicket
#

😔

waxen plinth
#

I can show you the code if you want, but it uses lots of stuff from my library

maiden thicket
#

anything would help i just need a step in the right direction pls and ty

waxen plinth
#

This plugin would let you make configurable "crafting structures"

#

You could make them out of any blocks and use skulls with custom textures

#

And then set custom commands to be run when the player placed all the blocks

#

Would account for different orientations, mirroring, etc

tired dagger
#

And md_5, your thoughts on the lib?

sullen marlin
#

Idk

waxen plinth
#

Give it a shot and see if you like it

#

If you have any questions feel free to DM me or join my support discord and I'll answer them

tired dagger
#

Let me re-phrase: is my current method overkill and/or what would you do differently

waxen plinth
#

It's overkill but there's not a great way to make it a whole lot better without some very high-level abstractions

#

Using an existing library is the best way

#

And if you want to practice streams there are plenty of other opportunities

#

My library makes pretty heavy use of lambdas and streams

tired dagger
#

See, the reason I'm reluctant is I didn't necessarily want to rely on external APIs for my plugins

waxen plinth
#

Because you don't want a plugin dependency?

tired dagger
#

Essentially

waxen plinth
#

RedCommands and RedLib can both be shaded

#

RedLib can be used as a plugin dependency and shades RedCommands

tired dagger
#

Right, but in the case I continue to build more complicated commands I know how to update the code I wrote. Comparted to if, in a future case, the RedCommandsLib isn't maintained

#

*compared

waxen plinth
#

It's really not version dependent

#

It works for 1.8-1.18 with no changes because command logic really does not change between versions

#

And I have actively maintained it for almost 4 years now

#

And there's extensive documentation + a support discord if you need help building more complex commands

#

I have built all sorts of stuff, it's very flexible and powerful

buoyant viper
#

hm, i got one 4 u i think

#

why should i use it over aikar

#

say i dont need the custom scripting lang, just annotation processed commands

waxen plinth
#

It's much less verbose

#

rdcml is really easy to learn, since it's not a scripting language

#

Just markup basically

buoyant viper
waxen plinth
#

And your code will be a whole lot less of an annotation clusterfuck

#

Ok name it

buoyant viper
#

lets say i am a masochist that likes annotations, dont wanna use rdcml

waxen plinth
#

What command would you have me implement

buoyant viper
#

idk, something that aikar couldnt easily and red has the verbosity to

waxen plinth
#

I don't really know the capabilities of acf since I don't use it

#

I have several plugins on my GitHub that are good demonstrations of its capabilities

#

PlugWoman and RedClaims

maiden thicket
#

would I be able to cast org.bukkit.block.Block to nms block or would i have to cast craftblock

waxen plinth
#

There's the command file and command listener for PlugWoman

maiden thicket
waxen plinth
#

I really wouldn't do that

#

The logic isn't hard to implement yourself

#

Don't lock yourself to one version and/or unnecessary maintenance effort even if you think it doesn't matter now

waxen plinth
#

You like the flags, eh?

#

I'm glad someone does lol

maiden thicket
buoyant viper
#

they are more or less something i wish more things with "commands" had but i guess the average user would prefer arguments?

waxen plinth
#

I use both

#

It very often does make sense to combine them

buoyant viper
#

yeah

waxen plinth
#

That one lets you specify any number of plugins to reload

#

And pass -c to not ask you to confirm

#

Also they can be combined like Unix flags

#

There's -c and -d so you can do -cd

buoyant viper
#

now we just need piping

waxen plinth
#

Lol

waxen plinth
#

They go over how everything works in detail

#

I'm going to bed now

#

Goodnight yall

tired dagger
#

Gn

maiden thicket
#

what was that one prefix for player skulls where u could get mob heads

#

it was like something_MobName

#

i.e. Prefix_Villager

#

it was mhf

#

but mhf_axolol is taken

#

sad

junior briar
#

is there a good way to store temporary player-related data?

sullen marlin
#

A map?

junior briar
#

):

vale ember
#

how to use remapped version of spigot in gradle, do i need to shadow it?

chrome beacon
#

Don't shadow it

vale ember
#

will it work on non-remapped servers then?

chrome beacon
#

You would need an alternative to the maven special source plugin

#

I'm not aware of one. So either use Paperweight or obfuscated names

quaint mantle
vale ember
eternal night
quaint mantle
#

Documentation wen

rough basin
tardy delta
#

It writes to a file

rough basin
#

Then it means pw will encode UTF-8 and possible to edit 'file'?

tardy delta
#

it has an UTF8 encoding and it will write to a file

twin venture
#

Hello , i have a problem with buildtools

vestal moat
#

does anyone know a good library that can replace protocolib and i can just shade it inside my plugin?

junior briar
#

why not protocollib

quaint berry
#

Does anyone want to get into a call and help me with my config file issue?

twin venture
#

its the same problem for all spigot version .

eternal oxide
quaint berry
#

I have a question about Java but I'm too lazy to actually formalize it in words unless there's someone on the channel who might be able to answer it

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. Create a thread in case the help channel you are using is already in use!

quaint berry
#

:)

eternal oxide
#

no one will jump to help you if you don;t ask an actual question

quaint berry
#

Ok

#

Can anyone help me fix my code because It's currently not creating a config file, I've looked at several tutorial including the one on the spigot website but non of them work.
There is probably and easy fix but I don't know what it could be.
Whenever I ask a group they just give me the same reply so I would like someone to hop into a call and help me fix it.
:)

quaint mantle
quaint berry
quaint mantle
#

😡

quaint berry
#

Oh crap sorry that was for a voting chat for a server that I'm on

#

I think I accidently sent it to you

eternal oxide
quaint berry
#

I did that but I didn't work

eternal oxide
#

it can't not work

quaint berry
#

I must be missing something

eternal oxide
#

either your plugin is not running at all, or there is no config.yml inside your jar

quaint berry
#

It is working and I also have a config.yml

#

So that's why I'm asking

eternal oxide
#

use an archiver like 7zip and open your jar. See if the config.yml is actually inside your final jar.

quaint berry
#

It's there but It's not working

eternal oxide
#

?paste your main class

undone axleBOT
quaint berry
#

Ok

#

Done

eternal oxide
#

paste teh link it gave you in here

quaint berry
#

Oh

#

Oop

#

There

eternal oxide
#

ok, now do the same for yoru servers startup log latest.log

quaint berry
eternal oxide
#

thats not what I asked for

quaint berry
#

Oh

#

Oh

#

Server Log?

eternal oxide
#

yes

quaint berry
eternal oxide
#

your plugi is not running getServer().getConsoleSender().sendMessage(ChatColor.GREEN + "[XTC]: Friend Plugin has started"); is never displayed

quaint berry
#

Oh

#

Tf

#

?

#

What went wrong

eternal oxide
#

to me it looks like you never put the plugin on your server

#

is yoru plugin called FriendTP?

quaint berry
#

Yes

eternal oxide
#

add an @Override annotation to your onEnable and onDisable

quaint berry
#

I thought it would be that

#

kinda

#

java: method does not override or implement a method from a supertype

#

And I get this

#

Again

chrome beacon
#

It's onEnable and onDisable

#

Not onEnabled and onDisabled

quaint berry
#

Your joking right?

#

You were not

eternal oxide
#

No, he's not

quaint berry
#

🤦‍♂️

#

I'm dumb

eternal oxide
#

your code will also explode at the line if (!f.exists()) {

quaint berry
#

Yep

#

It just did

#

Thank you so much

#

In the end I'm just retarded

buoyant viper
#

trying to save myself some directories/space, do u guys think/know if itd be possible to bundle a server-side fabric mod and a spigot plugin in the same project?

i feel like it should be fine since i think theyd only try to load if they are called by Fabric or Spigot

quaint berry
#

Should I have saveDefaultConfig(); in the onDisable(); ?

quaint berry
#

Ok

eternal oxide
buoyant viper
#

im doing mixins on the fabric one, but i have a feeling that as long as something doesnt try to run something from a class not for that env (ex: fabric trying to load a spigot thing) it should work

#

i just dont want 2 projects for cores that im making essentially 1:1 for my fabric n spigot servers

#

like i am fairly certain that each side will only load in their respective enviroments, i guess i could https://tryitands.ee/ later when im on pc

#

im kinda thinking of it from how you can work on a bungee and spigot plugin in the same project and each will only load if bungee or spigot does it

quaint berry
#

Should I use a config.yml file to store data about the plugin to remember?

eternal oxide
#

depends on what data

noble lantern
#

I have an ItemStack im getting from config, and its given to a player when i restart the server and trigger this action again, the items arent stackable is there any reason why this could be?

buoyant viper
#

that is an awfully interesting texture u got there

noble lantern
noble lantern
noble lantern
opal juniper
#

lmao

noble lantern
#

I actually have this plugin to generate random resources nodes as well, working on crafting as well but this bug is rather hindering

opal juniper
#

the itemstacks won’t stack if something is different about them

#

are you setting lore or anything?

noble lantern
#

Theyre both exactly the same and created the same way

vale ember
#

Does paperweight support mc 1.13? Could not find io.papermc.paper:dev-bundle:1.13-R0.1-SNAPSHOT.

noble lantern
opal juniper
#

wrong server

opal juniper
noble lantern
#

let me see if i can get pieces of the code from github to show you

opal juniper
#

ok

buoyant viper
vale ember
#

how do i use 1.13

opal juniper
#

and btw i don’t think it does

#

go ask in paper

#

this is spigot

noble lantern
#
#

ItemWrapper is basically itemMeta and itemStack stored, edits them and then returns the stack, its from my API im not sure if you need that or not

#

Its just basically to edit the item stacks easier

#

And in game they are the same item with F3 + H is enabled

vestal moat
#

Plugin#isEnabled does this return true when plugin is still enabling?

eternal oxide
#

No, not until onEnable is finished

noble lantern
#

shows them as identical..

quaint berry
#

Player = valueOf(strings[0]); Would this check if string 0 is a player?

eternal oxide
#

no

noble lantern
quaint berry
#

What would that look like?

noble lantern
noble lantern
noble lantern
rough basin
#

How do I know if the received String value is an existing EntityType?

spare prism
#

Hello! I have a map with the following structure:
Key: Time (long) and Value: Map of potion effects and their count (Map<PotionEffect, Integer>)
I want my plugin to add these potion effects N times (count times) randomly before the next potion effects have to be applied (before the next time comes). If there is no other times - it should give me all the effects. My code: https://pastebin.com/Q7jAQyVB

My problem is that it gives me all the effects at the same time and it gives me them not randomly as I said before, but at the bound time

Config: https://pastebin.com/YpbK1ZXU

noble lantern
rough basin
spare prism
vale ember
#

how can i use spigot with mojang mapping with gradle without paperweight?

rough basin
lean gull
#

anyone have anything that could get me started on custom world generation? (note: i do not know too much java and spigot)

vale ember
lean gull
#

i don't remember what happend last time

vale ember
#

ok how much you know java?

lean gull
#

idk how to measure that

#

i know some basic stuff

noble lantern
vale ember
#

do you know what is class or interface?

lean gull
#

idk how to explain what i know about classes, and idk what interfaces are

quaint mantle
#

?learnjava i mean you dont need to know how to explain, but you need to understand what it is

undone axleBOT
vale ember
#

can you just learn some basic java before trying to write plugins on spigot? please

lean gull
#

this is how i learn

vale ember
#

please

lean gull
#

no, sorry

vale ember
#

learn java

quaint mantle
#

the last one have some explanation for classes and interfaces

vale ember
#

you can't write good plugins without deep understanding of java basic concepts

quaint mantle
#

derp, do you understand classes and interfaces?

noble lantern
#

The channel description says "Serious" and you kinda need to know java to be serious

quaint mantle
#

i dont care how you explain it, i just want to say if you think you understand it

lean gull
#

i don't think so

vale ember
#

without knowledge your maximum will be small shitty plugins

#

just learn java before using it

lean gull
vale ember
#

if you don't understand basic OOP and java concepts you can't progress

#

if you don't know what is interface or class, there is no way you can do something better than simple hello world

lean gull
#

oop is using objects to make more stuff happen with using less code, right?

vale ember
#

do you know at least basic concepts

lean gull
vale ember
#

inheritance, abstractions, polymorphism, encapsulation, aggregation?

#

if those words don't say anything to you, you are not ready

lean gull
#

im just gonna wait for someone that is a little more positive about my way of learning

lean gull
#

that's just the ?learnjava stuff

vale ember
noble lantern
#

wait hes wanting to make a worldgen plugin?

vale ember
quaint mantle
#

java is api...

#

so learn java = learn api like learn spigot 😂

noble lantern
# lean gull ye

Sorry but honestly good luck because on top of java you need to know how perlin noise/noise works in general on top of know your math

Theres reasons why not many world gen plugins dont exist/get discontinued

lean gull
#

damn everyone so positive here! (sarcasam)

vale ember
#

OH MY GOD

eternal oxide
#

Just facts

vale ember
#

DON'T YOU UNDERSTAND THAT YOU NEED KNOWLEDGE TO DO SOMETHING

noble lantern
#

I would be understanding if you were making a gui or something but... world gen? come on

lean gull
eternal oxide
#

You can learn by doing, so pick somethign you might actually be able to do

vale ember
#

can you make car without knowing how it works?

lean gull
#

i'm not even gonna bother to continue this argument, if you'd like to help me in my way, lmk

noble lantern
lean gull
#

i've made some guis and commands and stuff

vale ember
#

L-E-A-R-N J-A-V-A

#

you can't write english books without knowing english, right?

#

so you can't write plugins without knowing java

noble lantern
lean gull
#

you can't write them, but you can learn trying and then one day you will be able to

vale ember
#

learn JAVA, JAVA, J-A-V-A

lean gull
#

toxic boi

vale ember
#

or KOTLIN

#

if you don't like java learn kotlin

#

you can also write plugins via kotlin

hoary pawn
#

i have this simple code to autocomplete the first arg of the cmd /customgive, how would i add autocomplete for the second arg and so on?

quaint mantle
#

Dev encourages people to learn java before making plugins: 🤡
Dev encourages people to learn java but they havent learn java: 😎

vale ember
#

how can i use mojang mapping via gradle? (without paperweight)

grim ice
#

you definitely can progress even with 0 knowledge of java, u can just learn it along the way but it will be very slow

grim ice
#

@lean gull so lemme tell u what ur doing

grim ice
#

you're using a library of a language

#

without knowing the language itself

vale ember
grim ice
#

its like making a whole book

#

when you dont know the alphabet

vale ember
#

I really feel better when i understand java

grim ice
#

or installing a game, without a pc or a mobile

quaint mantle
vale ember
#

some here know gradle?

quaint mantle
#

nintendo switch

vale ember
#

how can i use mojang mapping with gradle but make it run on not-mapped servers

eternal oxide
#

Good luck with that, if its possible. I use Maven for a reason. Its simple and it works.

twin venture
#

hi i need help with maven , buildtools

eternal oxide
#

did you delete it and download a fresh copy?

twin venture
#

yes

#

i did

#

buildtools works fine