#help-development

1 messages · Page 321 of 1

remote swallow
#

ctrl + r and replace @urban grotto with empty

#

i would love for that to exist

tender shard
frank kettle
remote swallow
#

i couldnt find anything

frank kettle
#

ty

#

completely forgot that

remote swallow
#

if it doesnt exist i might just make on

#

could probably pr it to craftbukkit

tender shard
#

yeah do that pls

remote swallow
#

do i have to compile to pr stuff to craft bukkit

#

?contribute

remote swallow
#

ill read that later

tender shard
#

well you also gotta fork it so you can commit/push

sterile token
tender shard
#

1st: Epic was talking about the enchantment names, not the annotations
2nd: the annotations are extremely useful

foggy holly
#

yo

#

then

#

someone can help me

#

😿

tender shard
#

?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!

foggy holly
#

[11:16:45 ERROR]: [SQLite] File write error: table_name.db
[11:16:45 ERROR]: [SQLite] SQLite exception on initialize
java.sql.SQLException: path to 'plugins\SQLite\table_name.db': 'C:\Users\USER\Desktop\Mc Server\1.12.2 2\plugins\SQLite' does not exist

sterile token
#

Why are they so useful? I don't see it that way, they just cause me problems and crappy warnings, when it tells me that it may be null and I don't want to check if it is null or not. For example when you do a Config#getString()

sterile token
foggy holly
#

im trying that it works

remote swallow
sterile token
foggy holly
#

yikes

sterile token
#

So please use paste md5, to sent your code and ful stracktrace

foggy holly
#

?pastebin

remote swallow
#

?paste

undone axleBOT
foggy holly
#

fine

#

lemme see

wicked remnant
tardy delta
#

just use saveDefaultConfig

tender shard
remote swallow
#

i could use MinecraftName

#

been as thats what their called in game

tender shard
#

maybe fromIngameName or sth

#

because internally minecraft also uses the weird names iirc

sterile token
wicked remnant
foggy holly
#

[12:00:45 ERROR]: [SQLite] Unable to retreive connection
java.sql.SQLException: Values not bound to statement

tender shard
#

send the full stacktrace please

tardy delta
sterile token
tardy delta
#

im not sus at all

remote swallow
tardy delta
#

can ii see who gave me a like?

sterile token
# foggy holly uh, yes?

Its weird, because when you learnt java first things you must learn is how to read stracktrace

iron palm
#

i'm wondering how can i modify the permissiondefault of one command's permission (the command is directly registered via CommandMap not plugins.yml)
is it enough to use Bukkit#addPermission or what?

sterile token
iron palm
sterile token
#

CommandMap#getCommand() will return a PluginCommand, and then you can do PluginCommand#setPermission()

iron palm
#

oh

#

in that case ty

sterile token
#

That is a fast research over the docs, they are really useful i should recommend using them haha

tender shard
# iron palm i'm wondering how can i modify the permissiondefault of one command's permission...

just get the permission from the plugin manager?

        String permissionName = getCommand("myCommand").getPermission();
        if(permissionName != null) {
            Permission existingPermission = Bukkit.getPluginManager().getPermission(permissionName);
            if (existingPermission != null) {
                existingPermission = new Permission(permissionName);
                getServer().getPluginManager().addPermission(existingPermission);
            }
            existingPermission.setDefault(PermissionDefault.TRUE);
        }
remote swallow
#

@tender shard im just looking at bukkit source before i download it and the enchants are correctly named on their new EnchantmentWrapper it looks like a case of just getting this name

tender shard
livid dove
#

So how does one remove just a set boss bar that naturally occurs? cause this end dragon bugger is sitll being persistantly ... persistant

iron palm
livid dove
#

Also as the chap is really busy and has given me full reign to edit the code as and when, there is a portals plugin i use where it just utterly refuses to not cancel end gate normal functions

iron palm
#

I need to modify permissiondefault

livid dove
#

i.e. if the main portal doesnt work, it uses the end gate block

sterile token
livid dove
#

if i yeeted the listeners in hre could someone help and have a gander?

remote swallow
iron palm
sterile token
iron palm
livid dove
#

https://github.com/sekwah41/Advanced-Portals/blob/689d4a4fe9994ca6f02925e951e129ed33dfe97f/src/main/java/com/sekwah/advancedportals/bukkit/listeners/Listeners.java#L272-L288

So this is the awkward bugger, what is happening is: I have portals set up to function when a player walks into blocks that are end gateways but, if the portal doesnt work due to some base requirement not being met, the endgateway works as normal which is utterly against design

GitHub

An advanced portals plugin for bukkit. Contribute to sekwah41/Advanced-Portals development by creating an account on GitHub.

sterile token
iron palm
tender shard
remote swallow
#

it looks like it

tender shard
#

oh yeah indeed. how weird is that

#

proooobably, it used to be "DIG_SPEED" in vanilla / nms code, but got changed when 1.13 turned everything into resourcelocations

remote swallow
#

for this the wrapper looks like

tender shard
#

that means you can indeed name your methods fromVanillaName or sth

sterile token
remote swallow
#

its the spigot api

#

it has to be static

sterile token
#

oh ok

remote swallow
#

for most of the stuff

sterile token
#

I thought was ur code

remote swallow
#

nah lol

sterile token
#

That why spigot 1.19 is so shit has thousans of static calls

#

🤡🤣

tender shard
#

spigot 1.19 is not shit. spigot 1.8 is shit

#

well spigot 1.8 is shit compared to 1.19. when it came out, it wasnt shit

remote swallow
#

oh alex how do i actually get bukkit onto my ij, do i just download it or is there a better way

tender shard
remote swallow
#

what would the url on this part be?

tender shard
#

1 sec

remote swallow
#

ahh

tender shard
#

be sure to use the URL of your cloned repo, not the original one

#

otherwise yuo cannot push

remote swallow
#

yeah lol

iron palm
remote swallow
#

am i correct in saying i make a new branch for the stuff i pr

pseudo hazel
#

i dont think it matters if you forked it, but you can do so just in case

#

its harder to make one later than to remove one

tender shard
#

i always just commited to master on my fork, then create a pull request for that

remote swallow
#

okay so im guessing i would add this as an abstract method to Enchantment.java and add it as a method in EnchantmentWrapper

#

i dont trust myselft to not fuck it up

sterile token
remote swallow
tender shard
#

or similar

remote swallow
#

i was just looking at this lol

tardy delta
#

id just make an enum for vanilla names

remote swallow
#

dont need it

#

we already have all the names

sterile token
remote swallow
#

thats the javadocs, this is a fork of bukkit

tender shard
#

by letting maven download the -sources and/or -javadoc .jar

#

or yeah, by using the actual source code lol

tardy delta
#

whats the warning?

remote swallow
tender shard
#

show the code

remote swallow
#

its the enchantment wrapper stuff

tardy delta
#

what

tender shard
#

cast the new block state to rotatable / directional / whatever it is

remote swallow
tender shard
#

weird lol

#

well if it's already like this, just don't touch it lol

remote swallow
#

dafuck? the hell is it getting the name from then

sterile token
tender shard
#
    @EventHandler
    public void onPlace(org.bukkit.event.block.BlockPlaceEvent event) {
        if(event.getBlockPlaced().getState() instanceof Directional directional) {
            System.out.println("Block " + event.getBlockPlaced().getType() + " is facing " + directional.getFacing());
        }
    }
#

Signs are Rotatable, while e.g. logs are Directional

#

rotatable is IIRC 16 directions (NORTH, NORTH_EAST ...), while Directional is SOUTH, WEST, NORTH, EAST, UP, DOWN

#

no. Well, you could manually check the logic by checking either which blockface was clicked, or which direction the player is looking at

#

IIRC e.g. logs check the direction you look at, while hoppers only care about the clicked face

#

not sure though, this might have changed

remote swallow
#

im gonna test this before i actually decide to compile bukkit

#

because it would probably end up in me compiling it a lot

#

if i remember correctly

tender shard
tender shard
#

it's full of bugs, requires paper api, and other problems

#

you basically even need paper-api as scope test to use it

#

that means you couldnt even test your own bukkit-api fork with that

#

MockBukkit 1.X still uses spigot but yeah the latest version for that is 1.16 IIRC

remote swallow
#

mockbukkit seemed really confusing when i looked at it efore

#

before

#

and i just never attempted to use it

tender shard
#

it's actually quite easy to use, but as said - it now requires paper, and also has some bugs sometimes regarding the maven resolver thingy

remote swallow
#

why would they even do that

tender shard
#

however for only bukkit api, you could probably just use surefire + junit without any mockbukkit stuff

#

if you only need to check the enchantment stuff

remote swallow
#

i have no idea what either of those are

tender shard
#

surefire is what actually runs your tests

#

junit provides the annotations needed, e.g. @Before and @Test etc

#

you can check JeffLib to see how it works

remote swallow
#

im guessing im not allow to supress deprecation warnints

#

been as i might need to use the .getName method if

#

if that actually returns the mc name

tender shard
#

can't you use getKey().getKey() ?

remote swallow
#

actually

#

idk

#

ill test that

tender shard
#

Enchantment.DIG_SPEED.getKey().getKey() should return "efficiency"

remote swallow
#

should™️

tender shard
#

@remote swallow I always use MockBukkit-v.1.18 version 1.24.1, that one still works with regular spigot-api so you could test your own stuff

remote swallow
#

i just use the server i have on ur vps lol

tender shard
#

but then you need to compile a spigot server.jar

remote swallow
#

i keep saying vps when its not a vps

tender shard
#

well the ptero is a VPS

remote swallow
#

i think ptero isnt having a good day

#

console seems blurry

tender shard
#

lmao the ptero is just idling since I kicked cazcez off the server

remote swallow
#

lmao

tender shard
remote swallow
#

it might just be me

hazy parrot
#

It's most likely you

tender shard
#

hm the screenshot also looks a tiny bit blurry to me

remote swallow
restive mango
#

?

tender shard
#

I am not sure whether it looks blurry or not lmao

remote swallow
#

it looks blurry on my 3 monitors, it looks blurry on that so

#

its probably blurry

#

ive seen and said blurry too much

#

it doesnt seem like a real work

#
[17:46:50 INFO]: [BukkitTestPlugin] Enabling BukkitTestPlugin v1.0.0
[17:46:50 INFO]: [BukkitTestPlugin] [STDOUT] Enchantment[minecraft:efficiency, DIG_SPEED]
[17:46:50 INFO]: [BukkitTestPlugin] [STDOUT] efficiency
``` it looks like it works
#

because i dont npe

#

and it has the dig_speed of it

tender shard
remote swallow
#

yeah

#

already tested what i needed

tender shard
#

might take a while, it waits until all servers are shutdown

remote swallow
#

thats fine

#

ill just start adding this to bukkit

#

how do i actually test this lol

tender shard
#

ok it's back up

remote swallow
#

i just thought about it

tender shard
#

does it still look blurry?

remote swallow
#

i think it does

#

its hard to tell

#

because its what ive seen for the past 10 minutes lo

tender shard
#

weird idk lol

#

it's funny how the ptero uses 1300 threads, but the proxmox host only has 300 threads running

remote swallow
#

lol

tender shard
#

kvm is like magic

remote swallow
#

also would i be correct sying i need @Contract("null -> null") and @Nullable on my 2 methods

tender shard
#

i remember, when I was in 7th grade, my IT teacher was like "in the future, everything will run in virtual machines and in the cloud. People will have virtual machines to visit shady websites or to run their services"

#

and he was sooo right

#

that was in 2007 or so

remote swallow
#

damn

tender shard
#

now he's the principle of a school in another city

remote swallow
#

lmfao

tender shard
#

he still owes me a pizza

livid dove
#

less than 24 hours before relaunch and its rpetty much the last hurdle

remote swallow
#

wwhats the issue with it

livid dove
# remote swallow wwhats the issue with it

The system as designed:

-walk through area designated as custom portal
-Get tp'd to desti if you interact with trigger block
-If requirements not meet or other issue, not sent anywhere
-Nothing happens

What happens
-walk through area designated as custom portal
-Get tp'd to desti if you interact with trigger block
-If requirements not meet or other issue, if trigger block is an end gateway block.... vanilla tps you as if gateway block was active

glass sage
#

Hello I've tried a lot of different way to get the messages receive by a player with protocollib packet listener
but I did not succeed

protocolManager.addPacketListener(new PacketAdapter(ConversationPlugin.getInst(), PacketType.Play.Server.CHAT) {
            @Override
            public void onPacketSending(PacketEvent e) {
                System.out.println("Packet " + e.getPacketType().toString());
                System.out.println(e.getPacket().getChatComponents().getValues().toString());
            }
        });

When I send a player message in chat the listener is triggered but I can't get the message

.... [19:28:41 INFO]: [Conversation] Packet CHAT[class=ClientboundPlayerChatPacket, id=49]
.... [19:28:41 INFO]: [Conversation] []

and with plugin message the listener is not triggered but there is no other chat PacketType

.... [19:28:46 INFO]: SuperMax_8 issued server command: /broadcast fqdsfdsljnh

sterile token
#

Totally diff things

buoyant viper
#

i think they want to get chat messages players are receiving, not plugin messages

sterile token
glass sage
#

I want to get all the message in chat of a player

regal scaffold
#

Question, if I want to make something that would automatically send mined items to a specific chest in a chunk

#

Do I need to have a list of chests in a player chunk, check for updates and then send the item?

glass sage
tender shard
#

but instead of a nested map, I'd create a new class like "ChunkChestMap" or sth

regal scaffold
#

What if a chest is added after the chunk was loaded?

#

async update every few seconds?

tender shard
#

then also listen to BLockPlace and BlockBreak event

tender shard
regal scaffold
#

Oh

#

That's actually

#

genius

#

oh damn that's even better idea

tender shard
#

however

#

instead of getting the chunksnapshot on chunkload...

#

just save the chest locations in the chunk's PDC

regal scaffold
#

Oh god

#

more pdc

#

alex you're gonna traumatize me

tender shard
#

well it's easy

#

one second

#

this allows you to save a List<Location> on the chunk

regal scaffold
#

yes yes already using your thing lol

#

Ok but question

tender shard
#

so just listen to blockpalce and blockbreakevent, and then save a List<Location> of all chests in the chunk

regal scaffold
#

If I save the location of the chests

tender shard
#

e.g. namespacedkey "chest-locations"

regal scaffold
#

Can I get a chest object from the location?

tender shard
#

sure

#
World#getBLockAt(...)#getBlockState()```
#

then cast that to Chest

regal scaffold
#

Ur the man

#

Thanks

tender shard
#

or COntainer if you also wanna allow barrels etc

regal scaffold
#

Nope it's my custom chest

tender shard
#

kk

regal scaffold
#

Which actually turned out sick

tender shard
#

how did you make it invisible?

#

with hideEntity or with setVisible?

#

does the invisible armorstand have a custom name that's shown`? because if so, I'm 100% sure that you can detect right clicks.

sterile token
tender shard
#

try whether it works with a custom name and setCustomNameVisible true

#

if that does work, you probably HAVE to have a custom name, maybe you could use "&c" as custom name so that there is a name, but nothing that's visible

#

you could also try whether PlayerArmorStandManipulateEvent works

#

I use this to check whether a hologram was right clicked, not sure whether it works for invisible armorstands without a name, but you could try

#

note it's PlayerInteractAtEntityEvent

tender shard
#

why the heck do I have a random empty c++ file in angelchest lmao

remote swallow
#

why do you

tender shard
#

idk lol

#

you tell me

remote swallow
#

no you tell me

tender shard
#

probably I created it by accident

bold crane
#

Is there anyway for you to run a command and see if their hunger is full?

#

So like a feed command if the users hunger is already full then it sends a message

sterile token
#

You need to parse CommandSender into a Player object and then you can read the docs about Player object to see the methods you can use

bold crane
#

okay

tender shard
#

you wanna code a /feed command?

sterile token
tender shard
#

just cast the sender to player, then check if they are hugnry, then set the food level

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(!(sender instanceof Player)) {
            sender.sendMessage("This command can only be run by a player");
            return true;
        }
        Player player = (Player) sender;
        if(player.getFoodLevel() < 20) {
            player.setFoodLevel(20);
            player.sendMessage("You've been fed a tasty filet mignon with sauce bernaise.'");
        } else {
            player.sendMessage("You are not hungry you fool");
        }
        return true;
    }
bold crane
#

and thanks

#

i was just using 20 instead of < 20

tender shard
#

np

restive mango
#

I’d like to search all inventories on a server for an item, anyone know how to do that?

rotund ravine
#

Well that seems like a task

#

You can listen to chunkloadevent and look for all chests etc. and search them that way.

#

Or you can simply listen to inventoryopenevent / hopper event and check items there.

wicked remnant
#

anyone know off hand which server version added javax.inject

tardy delta
sterile token
# tender shard np

I need your hand again with maven, but now having the trouble to replace things but with multi-module project

I have the next arch:

Command:
  --> Core (depends: nothing)
  --> Spigot (depends: Core)
  --> Bungee (depends: Core)
  --> Example (depends: Spigot)

When im compiling all the project via "mvn clean package", the example plugin,yml doesnt replace the properties with the ones taken from example module pom

regal scaffold
#

@tender shard

#

To make a chunk pdc like you said do I need to do the same thing I did with the Chest pdc?

#

Make a object, serializable, etc

restive mango
#

Is tht not possible?

rotund ravine
#

I just told you how to do it.

urban mauve
#

what maximum size of premium plugin i can upload?

rotund ravine
tardy delta
#

Integer.MAX_VALUE before it overflows hehe

#

that would be fun

#

there arent probably that many plugins on the whole site

urban mauve
rotund ravine
urban mauve
rotund ravine
#

I told you two ways.

regal scaffold
#

How can I access and store a PDC <Location> in a chunk

remote swallow
#

@tender shard go

urban mauve
#

you're not answered to my question

rotund ravine
#

-> For player inventories, you can check them on player join.
-> For others there are 2 ways. Check with InventoryOpenEvent and the hopper event
-> Or check on ChunkLoadEvent and loop over the tileentities and scan them.

You are not able to scan the whole world easily, so you do it procedurally.

remote swallow
#

thats a different person

restive mango
rotund ravine
restive mango
#

Bruh

rotund ravine
#

But i did indeed answer it too @urban mauve

rotund ravine
# restive mango Bruh

-> For player inventories, you can check them on player join.
-> For others there are 2 ways. Check with InventoryOpenEvent and the hopper event
-> Or check on ChunkLoadEvent and loop over the tileentities and scan them.

You are not able to scan the whole world easily, so you do it procedurally.

urban mauve
upbeat hornet
#

how can I detect when a player places my customblock?
customblock = normal block but with a name and lore

tardy delta
#

what have i been doing

wicked remnant
tender shard
#

instead of name and lore

tardy delta
regal scaffold
#

Hmmmm

tender shard
regal scaffold
#

Yes but

#

Where do I store it

tender shard
#

chunk.getPersistentDataContainer()

regal scaffold
#

oh

#

that simple?

#

wtf

tender shard
#

yes

regal scaffold
#

Ok let me try

remote swallow
#

alex are you cooking bacon

#

i just smelt some

upbeat hornet
tender shard
#
myChunk.getPersistentDataContainer.set(new NamespacedKey(plugin, "chest-locations"), DataType.asList(DataType.LOCATION), myListOfLocations);
regal scaffold
#

Tyyyy

sterile token
#

Is posible to use maven enviroment variables, while working with multi module maven projects?

rotund ravine
regal scaffold
#

Are chunk pdc by default empty @tender shard ?

#

Like completely empty

rotund ravine
#

why does that matter

remote swallow
#

on your key yes

regal scaffold
#

Cause can use that as a feature

#

Cool

#

Suddenly .getKeys() returns a array with size of how many separate block data I added to the chunk 🙂

upbeat hornet
remote swallow
#

tile entities only

#

or item stacks and that

tender shard
# upbeat hornet Are PDCs only for tileentities likes chests or can they be applied over to a sto...

only tile entities. for stone blocks, you can use my CustomBlockData library: https://www.spigotmc.org/threads/custom-block-data-persistentdatacontainer-for-blocks.512422/

tender shard
# regal scaffold Suddenly .getKeys() returns a array with size of how many separate block data I ...

you can also use CustomBlockData.getBlocksWithCustomData(yourPlugin, chunk) to get a list of blocks where you added custom data: https://hub.jeff-media.com/javadocs/customblockdata/com/jeff_media/customblockdata/CustomBlockData.html#getBlocksWithCustomData(org.bukkit.plugin.Plugin,org.bukkit.Chunk)

regal scaffold
#

Oh no alex

#

I'm really really tempted

#

cause that's exactly what I need

#

but no

#

I will say no to alex

remote swallow
#

how could you

regal scaffold
#

Oh

#

Big question

humble tulip
regal scaffold
#

Do nsk need to be unique?

remote swallow
#

if you want to store multiple datatypes yes

regal scaffold
#

What's the pdc to update a chunk>

remote swallow
#

otherwise your plugin handles the rest, eg 2 plugins can have key "amogus"

regal scaffold
#

chunk.update() isn't a thing

remote swallow
humble tulip
remote swallow
#

just set

regal scaffold
#

Or automatic?

remote swallow
#

auto

regal scaffold
#

Alr ty

humble tulip
#

can u blame me tho

ancient plank
#

Yes

tender shard
#

everyone can blame you

#

btw what does github's blame button do? i never understood it

bronze notch
#

Would this be a way to register a custom event?
`class EntityListener : Listener
{
@EventHandler
fun onEntityDamage(event: EntityDamageByEntityEvent)
{
if (event.damager is Player)
{
Bukkit.getPluginManager().callEvent(EntityDamageByPlayerEvent(event, event.damager as Player, false))
} else if (event.damager is Projectile && (event.damager as Projectile).shooter is Player)
{
Bukkit.getPluginManager()
.callEvent(EntityDamageByPlayerEvent(event, (event.damager as Projectile).shooter as Player, true))
}
}
}

class EntityDamageByPlayerEvent(event: EntityDamageByEntityEvent, val player: Player, val indirect: Boolean) :
EntityDamageByEntityEvent(
event.damager,
event.entity,
event.cause,
event.damage
)`

tender shard
#

nice I got 42 stars

humble tulip
tender shard
#

that's the answer to everything

rotund ravine
#

Else you'd have to implement that.

river oracle
tender shard
river oracle
#

Ahh that's a good one

restive mango
#

I can code it myself

tender shard
#

MorePDCTypes is also nice, if I may say this myself lmao

river oracle
tender shard
#

but NBT is version dependant

rotund ravine
restive mango
#

It’s as easy as creating a bukkit runnable and loading chunks scanning them and then unloading them

river oracle
tender shard
river oracle
#

It's not actually built into the server it's like reading a data file

tender shard
#

oh no, my vacuum robot got stuck again

#

it' shouting "help stepbro" now

river oracle
#

Rip

#

Lpl

tender shard
#

what do you people think about those buttons? do they look okay or are they too ugly?

tardy delta
tender shard
#

nice

tardy delta
#

someone just removed a star for me :(

tender shard
#

i think 42 is the most stars i ever got

tender shard
tardy delta
#

i got 1 now 💀 and thats orbyfied

tardy delta
#

thicc

tender shard
#

but yeah a button couldnt hurt

#

oh fuck off github

#

why does it also select hte line numbers

regal scaffold
#

World#getBLockAt(...)#getBlockState()

#

Need a little explanation

rotund ravine
#

it's method calls

regal scaffold
#

I know that

tender shard
regal scaffold
#

Is it as long as I think it is?

remote swallow
tender shard
rotund ravine
# regal scaffold World#getBLockAt(...)#getBlockState()
    private fun getPDCAndBlockState(location: Location): Pair<BlockState, PersistentDataContainer> {
        val blockState = location.block.state
        val pdc = (blockState as? PersistentDataHolder)?.persistentDataContainer!!
        return Pair(blockState, pdc)
    }

    private fun createMasterChest(location: Location, colorCode: ColorCode) {

        val blockStateAndPDC = getPDCAndBlockState(location)
        val blockState = blockStateAndPDC.first
        val masterPDC = blockStateAndPDC.second

        masterPDC.set(isMasterKey, PersistentDataType.BYTE, 1.toByte())
        masterPDC.set(masterLocationKey, DataType.LOCATION, location)
        masterPDC.set(slaveLocationsKey, DataType.LOCATION_ARRAY, arrayOf<Location>())


        masterPDC.set(inventoryKey, DataType.BYTE_ARRAY, InventoryUtils.toByteArray(Bukkit.createInventory(null, 27)))
        masterPDC.set(colorCodeKey, DataType.STRING_ARRAY, colorCode.getColors())



        blockState.update(true)
        instantiateStorageChest(location) // Reads to make sure they were added and also saves them to the lookup tables.
    }
upbeat hornet
#

Whats wrong?

PersistentDataContainer pdc = meta.getPersistentDataContainer();
pdc.set(new NamespacedKey(GenCore.getPlugin(), "name", PersistentDataType.STRING, GenLoader.genlist.get(name).toString()));

Error at Gencore.getPlugin()
Expected 1 argument

regal scaffold
#

Wait

rotund ravine
#

?jd-s

undone axleBOT
regal scaffold
#

If I know a List<Location> contains my location cause I already checked

tender shard
#
pdc.set(new NamespacedKey(GenCore.getPlugin(), "name"), PersistentDataType.STRING, GenLoader.genlist.get(name).toString());
regal scaffold
#

How can I easily return that location from the list

rotund ravine
paper viper
rotund ravine
#

Think it's related.

upbeat hornet
#

GenCore is my main class

rotund ravine
#

See Iam so smart

tender shard
#

still they missed a brtacket to close the NamespacedKey constructor

rotund ravine
#

yeye many issues haha

paper viper
#

Nevermind, I thought they had a method getPlugin or smthing

#

to get the plugin instance

regal scaffold
#

(Chest) world.getBlockAt(loc).getState();

#

?

#

That the right way of doing it?

rotund ravine
#

I guess

tender shard
regal scaffold
#

Yes I made sure

#

7 ifs lol

tender shard
#

then that's correct

rotund ravine
#

As long as it's the correct chest import too.

regal scaffold
#

It is

rotund ravine
#

which one is it?

bronze notch
rotund ravine
#

i see

tender shard
#

what is a smart cast?

rotund ravine
#

kotlin stuff google it'

#

kind autocasts

#

kinda*

tender shard
#

ah it's kotlin's version of java's enhaced instanceof

upbeat hornet
regal scaffold
#

Question:

I have a List<Locations> containing the locations of my chests.

How can I check if a broken block is in the same chunk as the List<Locations> which contains all the chests in a specificed chunk

tender shard
#

you throw in 4 things

regal scaffold
#

I don't need to check if it's a chest broken. I need to check the broken block is in the same chunk as my Locations

rotund ravine
tender shard
rotund ravine
#

Well we got safecasts which can be used same'ish way. Tho we had smart casts first.

regal scaffold
#

yeah nvm just figured it out

#

is it .equals or ==?

tender shard
#

equals

upbeat hornet
regal scaffold
#

I'll take an explanation on that ❤️

rotund ravine
#

I use == on my inventories and it works, fight me @tender shard

regal scaffold
#
    public void onBlockMine(BlockBreakEvent e) {
        if (!verifyBlockMined(e)) return;
        List<Location> locations = Keys.getLocations(e.getBlock().getChunk());
        if (locations == null || locations.isEmpty()) return;
        for (Location loc : locations) {
            if (!loc.getChunk().equals(e.getBlock().getChunk())) {
                return;
            }
        }
#

If a block broken isn't in the chunk list then do nothing, right?

tender shard
rotund ravine
#

yeye i know.

#

Tho it would work in kotlin.

tender shard
#

how so?

tender shard
#

what even is Keys?

tardy delta
wicked remnant
#

Was the most/least format used from at least 1.8 to 1.16?

tender shard
tardy delta
#

scroll up a bit

tender shard
#

yeah I know but

#

what is that class

#

what does it do

tardy delta
#

idk lol

#

probably holds constants

tender shard
#

i wonder why they used 4 ints instead of 2 longs anyway

wicked remnant
#

im writing instead of reading so i think my only option is to check the player protocol (the context is that im using protocolize)

regal scaffold
#

What's a good way of preventing a broken item from dropping a block but for me to still be able to use that block

#

and it get removed

#

For example if I wanted to do autopickup when mine is what I mean

primal goblet
#

help 🥲

livid dove
ember crag
#

hi im making a spawn protection plugin and i want to know how to make a smoke particle effect that plays after the block is broken (akin to worldguard)

regal scaffold
#

How can I convert a Collection<ItemStack> to ItemStack or change Collection<ItemStack>

tardy delta
regal scaffold
#

There should always be only 1 element no?

#

BlockBreakEvent

tardy delta
#

you could test if it actually is a list, cast it and call get

#

no clue tho

#

or .iterator().next()

regal scaffold
#

It is a list

hazy parrot
#

Why would blockbrake event return collection tho

#

Tnt I assume

regal scaffold
#

exactly

#

But how can I just get 1 then

#

ItemStack items = e.getBlock().getDrops().iterator().next();

#

Technically it'll work

tardy delta
#

ye its a slist

upbeat hornet
#

What would be the smartest way to store data about placed blocks?
PersistentData(Containers) is only for entities/tileentities/itemstack, but not for placed blocks.
Would making a json file as a databse be the only option?

hazy parrot
#

Don't use json file as database

upbeat hornet
#

what else?

tardy delta
#

store it in the chunk if you need

#

thats what alex' lib is doing iirc

tender shard
#

?cbd

#

aaw

tardy delta
#

depends on what you want to store too, i wouldnt place a bunch of data inside the pdc

upbeat hornet
#

okay...

tardy delta
#

i tried to look into the pdc impl but it seems to be nms or smth

#

wanted to see what datastructure it uses

tender shard
tardy delta
#

another command name noone will remember lol

tender shard
#

cbd = CustomBlockData

#

not so hard to remember

#

lol

tardy delta
#

at 2am it is

tender shard
#

or maybe ?blockpdc

#

?blockpdc makes sense

#

thats easy to remember

tardy delta
#

hmm

upbeat hornet
#

blue name now

remote swallow
#

?morepdc

tender shard
#

now get pink

remote swallow
#

add

tender shard
remote swallow
#

dm him

tender shard
#

he also added ?nms and?switchmappings

upbeat hornet
#

?nms

tardy delta
#

and ?learnjava!

tender shard
#

I gotta say, imajin is a nice dude, although he sucks #imajinsuckzZ

tardy delta
#

🤔

#

||isnt that what you like?||

tender shard
#

erm

quaint mantle
#

?blockpdc

undone axleBOT
tardy delta
#

#mod-chat

#

i know it exists

quaint mantle
tardy delta
#

fuck

#

once saw it on conclures screen

remote swallow
#

imaij

quaint mantle
#

que

remote swallow
#

can we get a ?morepdc too

quaint mantle
#

no

#

like custom pdc?

remote swallow
#

do you only get to add 1 command a day

tardy delta
#

give him money

quaint mantle
#

mfnalex basically rules spigot

tender shard
#

MorePDC allows to use Lists, Arrays, Maps, etc, and adds new PDC types like Location, BlockData, etc

tender shard
#

e.g. MorePDCTypes allows you to store a HashMap<Location,HashMap<String, List<BlockData>>> in PDC

#

here it is ^

quaint mantle
#

?morepdc

undone axleBOT
quaint mantle
#

someone fix that last part

minor garnet
#
String value = "testStringBigSize";```
how do I create a string with a width of another string with a a number of characters at the beginning and end of string, i refer to it like this:
zealous osprey
#

Might someone enlighten me, why this isn't working?
The repo seems online/available... so why is the dependency being rejected? I hope that I'm just being a dum-dum and it's a simple fix.

quaint mantle
#

value.substring(start, end)

minor garnet
quaint mantle
#

yes

minor garnet
#

alr

tender shard
zealous osprey
#

yup

#

numerous times

tender shard
#

Send the repo url as text pls

zealous osprey
tender shard
#

Without code tag pla

#

Pls

#

Im only on the phone

tardy delta
#

hes on his phone remember 😂

tender shard
#

I need a clickable link lol

remote swallow
#

did you reload maven

tender shard
#

Repo offline?

remote swallow
#

guess so

zealous osprey
#

tf

final monolith
#

Its possible to reproduce that "charging" effect on every item?

#

maybe with packets?

#

🤔

remote swallow
#

guess i wont be working on better item config after @compact haven is avaliable

tender shard
zealous osprey
#

ahhh ffs

final monolith
tender shard
#

Then do mvn install

#

Then you can use it

#

Even without the repo

compact haven
#

@remote swallow im basically done, hope u get the idea

tender shard
zealous osprey
compact haven
#

didnt actually implement the handler though, u tagged me too early

remote swallow
#

ah, sorry

final monolith
final monolith
#

damn material 💀

tender shard
#

No packets needed 🙂

compact haven
tender shard
#

Yes its per material

compact haven
#

lmk if u dont get the idea from that

tender shard
#

Not possible for custom itemstacks, only per material

compact haven
#

u might have errors, did it in Notepad++

remote swallow
final monolith
#

better than nothing

remote swallow
#

because not everything has lore

final monolith
#

😢

compact haven
#

wdym

#

no the DEFAULT should have every single handler

#

and the handler's should return gracefully if it doesn't apply to the ConfigurationSection provided

remote swallow
#

ahhhhh

compact haven
#

you can also make a method with signature boolean doesApply(ConfigurationSection section) if you want to know beforehand if it's supported, just like I did with doesSupportRead() and doesSupportWrite()

#

mm I didnt add it to the paste but if the handler has a doesSupport... for the target action, it should continue the loop ofc

remote swallow
#

im gonna attempt to make my brain understand whats going on

compact haven
#

because the guess is that they'll override the Handler read/write with a throw new OperationUnsupportedException

#

(and you don't want the program to exit just because one handler doesn't support writing, when it might not even apply to the target ItemStack to be written)

#

but you can also catch the exception instead of a boolean doesSupport method, but that'll require generation of a stack trace and that might be expensive

remote swallow
#

explain that to me later if i ping you, my brain has just been handed a few too many things to brain over

compact haven
#

u want me to finish the handler & base processor rq so you get the full picture?

remote swallow
#

i think i get that

compact haven
#

alright

remote swallow
#

if not ill give you a ping

compact haven
#

sounds good

tardy delta
#

ah now i see where that code is used for

compact haven
#

should I ask why the name of that method and the parameters it takes make no sense

#

oh mb

remote swallow
#

hes judging my code

compact haven
#

thought that was @Override

remote swallow
#

i just realised

compact haven
#

my guess is that it's from a commandframework?

remote swallow
#

acf

compact haven
#

makes sense now

tardy delta
#

acf best thing

compact haven
#

cloud is superior

#

only because it was made by incendo

tardy delta
#

never used it, so idk if the syntax is ok

#

oh this stuff?

compact haven
#

thats the regular one

#

I use that sometimes or the annotations addon other times

#

but yes, that's the framework

tardy delta
compact haven
#

is the one

tardy delta
#

thats more like acf

#

acf be like

compact haven
#

yeah ik it's pretty similar at that point

#

some people use cloud because they dont like the annotations acf

tardy delta
#

and then you have the builder pattern 💀

compact haven
#

kekw

tardy delta
#

im not a big fan of that, especially not the IntegerArgument.newbuilder() stuff

compact haven
#

well thats because of how argument processors work

tardy delta
#

when are we finally getting the C++ style of default arguments 🥺

#

im just writing 5 methods that call eachother atm

remote swallow
#

whats was i meant to be doing

#

i got a dm

#

oh yeah

#

better item config

compact haven
tardy delta
#

who are we simping for today?

compact haven
#

@vagrant stratus is simpable

#

maybe Choco

#

but im scared to tag Choco

#

might send his dog after me

tardy delta
#

two nerds

#

uh oh

vagrant stratus
compact haven
#

whats that mean

tardy delta
#

i sounds like oui and thats yes in french

compact haven
#

!

robust light
#

is there a way to check if an event has been cancelled from another plugin? For example a blockbreak event getting cancelled from a plugin like worldguard. I tried to check using event.isCancelled(), but that doesnt work. Are there any alternatives?

tardy delta
#

it should work when using EventPriority.HIGHEST assuming that plugin isnt using highest too

#

@EventHandler(priority = EventPriority.HIGHEST)

#

monitor is a thing too but you shouldnt modify the event then

#

you cant see who cancelled it tho

robust light
#

its cancelled from worldguard, Im pretty sure it has highest priority

onyx fjord
#

what do i need to spawn a virtual sign?

i am currently sending a block update and open sign editor packet

#

but player sees the sign and then it closes itself

#

just flashes for a split second

wicked remnant
#

Has the Id in a SkullOwner tag ever required to represent an actual player if textures is present?

quiet ice
#

that being said it doesn't work for absolutely all plugins

wet breach
# onyx fjord just flashes for a split second

You need to cancel updates for the chunk and block of the virtual sign. There is a few packets involved with this. Essentially what is happening is an update of some kind is getting sent to the client after the open editor and the client realizes the sign doesnt exist and thus closes the editor

quiet ice
wet breach
#

You are better off using a real sign for this though and then removing the sign once done

onyx fjord
#

when did the behavior change

#

im assuming somewhat recently

wet breach
#

Probably

bronze notch
regal scaffold
#

When creating a new plugin

#

Do you straight up use intelliJ maven archetype generator?

remote swallow
#

if you use maven sure

regal scaffold
#

Or minecraft and then change the stuff

remote swallow
#

i use minecraft plugin + gralde

#

gradle

#

if you use maven you could probably use alex's maven archetype

regal scaffold
#

Which is

#

And why

#

What does it affect

remote swallow
#

a maven archetype makes the project pretty much

regal scaffold
#

The desired archetype does not exist (com.jeff_media:spigot-plugin:1.0.0-SNAPSHOT)

remote swallow
#

did you download it

quiet ice
#

Did you use mvn install?

regal scaffold
#

I don't

#

want to talk

#

About this

#

plz

quiet ice
#

Or however the fuck you install maven archetypes anyways

quiet ice
#

I myself never use it (especially since I am an eclipse user but even then I don't use eclipse's counterparts)

regal scaffold
#

Wait a second

#

I don't think I have mvn installed on my pc

quiet ice
#

then go ahead, you'll need it quite often - I'll tell you that much

remote swallow
#

i use gradle

#

so

#

fuck maven

regal scaffold
#

wtf is this installation guide

quiet ice
#

even as a gradle user maven is quite necessary to have installed on the system

regal scaffold
#
Detailed steps are:

Have a JDK installation on your system. Either set the JAVA_HOME environment variable pointing to your JDK installation or have the java executable on your PATH.

Extract distribution archive in any directory

unzip apache-maven-3.8.7-bin.zip
or

tar xzvf apache-maven-3.8.7-bin.tar.gz
Alternatively use your preferred archive extraction tool.

Add the bin directory of the created directory apache-maven-3.8.7 to the PATH environment variable

Confirm with mvn -v in a new shell. The result should look similar to

Apache Maven 3.8.7 (b89d5959fcde851dcb1c8946a785a163f14e1e29)
Maven home: /opt/apache-maven-3.8.7
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.8.5", arch: "x86_64", family: "mac"
#

It's terrible

quiet ice
#

Macos?

#

Or are you on windows? (Or on linux, but at that point you'll use your package manager instead)

regal scaffold
#

Windows, I'm doing it rn

#

Ok I got it

#

@remote swallow How do I rerun the startup

#

If if failed half way lol

quiet ice
#

Basically the essence of it is that you unzip the jar somewhere, install the JDK correctly (i.e. JAVA_HOME and PATH) and the add the "bin" directory to your PATH

remote swallow
regal scaffold
#

What

remote swallow
#

what startup

regal scaffold
#

I was making a new project

#

And it failed cause I didn't have the thing install

remote swallow
#

file -> new project

regal scaffold
#

Do I gotta create a new project lol

#

...

quiet ice
#

Don't work with archetypes

#

Chances are you have no idea what you are doing, at which point it is perfectly correct to work with sticks and stones

regal scaffold
#

I actually do, a lot. Just never ever used maven before

#

But thanks for the tip

mighty mica
#

Could someone point me in the right direction..

I'm trying to get strings from my config.yml, the layout is like so: (end of the message)

The name of the ranks (rank1, 2, 3) can be changed to whatever by the user, how do I import permission and priority into the code?
Like for instance, if a player does /plugin rank (rank) it would return the permission and priority for that rank. How would I go about doing so?

Any help would be appreciated. Thank you <3

Ranks:
  rank1:
    permission: ''
    priority: '' 
  rank2:
    permission: ''
    priority: '' 
  rank3:
    permission: ''
    priority: '' ```
humble tulip
#

config.getConfigurationSection("Ranks").getKeys(false)

#

It'll give a set with rank1, rank2, rank3

#

@mighty mica

foggy holly
#
    public boolean exist (String id) {
        Boolean error = false;
        try {
            PreparedStatement st= connection.prepareStatement("SELECT * FROM test WHERE id = ?");
        } catch (SQLException e) {
            getLogger().severe("Error: " + e.getMessage());
            e.printStackTrace();
            error = true;
        }
        return error;
    }
#

yo guys

#

how can i do a exist

hazy parrot
#

Return rs.next

#

If its true, it means it was able to move cursor

#

Which means there is at least one entry

foggy holly
#

lemme see

hazy parrot
regal scaffold
#

[19:44:27] [Server thread/ERROR]: Could not load 'plugins\BorderRealm-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.tomisanhues2.borderrealm.Plugin;'

#

Confirmed that the jar contains the path as well as main class
Checked all possible type typos

remote swallow
#

?paste plugin.yml and main class

undone axleBOT
regal scaffold
#

It's empty lol I just created it

foggy holly
# hazy parrot Return rs.next
PreparedStatement st= connection.prepareStatement("SELECT * FROM test WHERE id = ?");
ResultSet rs = (ResultSet) st;
return rs.next();
#

?

#
[17:42:32 ERROR]: [SQLite] Error: Values not bound to statement
[17:42:32 WARN]: java.sql.SQLException: Values not bound to statement
regal scaffold
remote swallow
regal scaffold
#

Doesn't matter i'll remove them was just testing

remote swallow
#
  • you dont need to super.on them
regal scaffold
#

Intellij generated

remote swallow
#

judge intellij

regal scaffold
#

Doesn't solve the issue

#

Could it somehow be maven related?

remote swallow
#

?paste the full error rq

undone axleBOT
regal scaffold
#

Maybe using alex mvn thing was mistake

remote swallow
#

take a look at the name and group id

regal scaffold
#

Oh

#

Blame alex

#

Still didn't work anyways

remote swallow
#

how are you building and what jar do you use

regal scaffold
#

And the shaded one

hazy parrot
#

Plus I'm not sure that your code would even compile

foggy holly
#

it do

foggy holly
#
            PreparedStatement st= connection.prepareStatement("SELECT * FROM test WHERE id = ?");
            ResultSet rs = st.executeQuery();
            return rs.next();
#

whats wrong

hazy parrot
#

You last code makes no sense

worldly ingot
#

That won't work because you don't pass the argument to the statement

#

You have a ?, but you never set it. st.setInt(1, id); before you execute your query

#

Whatever id it is you want to look for

regal scaffold
worldly ingot
#

The main in your plugin.yml doesn't point to the correct main class name

regal scaffold
#

It does tho

hazy parrot
regal scaffold
#
name: BorderRealm
version: '${project.version}'
main: me.tomisanhues2.borderrealm.Plugin;
api-version: 1.19
description: Custom core plugin for Border Realm
depend:
  - Vault

worldly ingot
#

If me.tomisanhues2.borderrealm.Plugin is actually your main class, then make sure you're exporting your classes correctly

regal scaffold
#

me.tomisanhues2.borderrealm

foggy holly
#

ty guys

regal scaffold
#

I checked the .jar with winrar

foggy holly
#

it works

regal scaffold
#

Everything is there

worldly ingot
#

Can you upload the .jar file here?

regal scaffold
#

Wait a second a bunch of stuff just got added

worldly ingot
#

(I think you can upload files if you're verified)

regal scaffold
#

wtf is all that

remote swallow
remote swallow
worldly ingot
#

You're shading dependencies most likely

regal scaffold
#
                    <relocations>
                        <!-- MorePersistentDataTypes start -->
                        <relocation>
                            <pattern>com.jeff_media.morepersistentdatatypes</pattern>
                            <shadedPattern>me.tomisanhues2.borderrealm.morepersistentdatatypes</shadedPattern>
                        </relocation>
                        <!-- MorePersistentDataTypes end -->
                        <!-- CustomBlockData start -->
                        <relocation>
                            <pattern>com.jeff_media.customblockdata</pattern>
                            <shadedPattern>me.tomisanhues2.borderrealm.customblockdata</shadedPattern>
                        </relocation>
                        <relocation>
                            <pattern>com.github.Despical.CommandFramework</pattern>
                            <shadedPattern>me.tomisanhues2.borderrealm.CommandFramework</shadedPattern>
                        </relocation>
                        <!-- CustomBlockData end -->
                    </relocations>
#
<dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>${spigotVersion}-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.jeff_media</groupId>
            <artifactId>MorePersistentDataTypes</artifactId>
            <version>2.3.1</version>
            <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>com.github.MilkBowl</groupId>
            <artifactId>VaultAPI</artifactId>
            <version>1.7</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.github.Despical</groupId>
            <artifactId>CommandFramework</artifactId>
            <version>1.1.5</version>
            <scope>compile</scope>
        </dependency>
remote swallow
#

that is called relocating so you are shading stutff

regal scaffold
#

I need to shade alexs stuff tho no?

#

As well as CommandF

remote swallow
#

yes

#

upload the jar file here

regal scaffold
worldly ingot
#

Oh

#

You have a semicolon after your main lol

#

main: me.tomisanhues2.borderrealm.Plugin;

regal scaffold
#

I swear

#

Bro

#

IntellIj even said it

#

Thanks choco

worldly ingot
#

o/

regal scaffold
#

Not good looks considering I just finished a pretty big plugin lol

#

Makes me look 100% new

remote swallow
worldly ingot
#

All good. I still forget to register listeners and command executors from time to time

#

I've been doing this for 8 years

remote swallow
#

i forgot about commands a lot

compact haven
#

I also forget to annotate with @EventHandler

remote swallow
#

i did that once

#

i was so confused

#

i thought it was intellij dying

worldly ingot
#

I made a template so I can just write "listener" and have an event listener automatically generated for me

#

Handy

remote swallow
#

get on intellij

regal scaffold
#

lol

#

Don't even show him

#

What you can do on intelliJ

#

You rarely need to type

buoyant viper
regal scaffold
#

Just lay back and use your mouse

worldly ingot
#

You don't really have to type much on Eclipse either if you know how to use it 🙂

regal scaffold
#

IntelliJ still has more features, it's nuts

worldly ingot
#

I make a conscious choice to stay

remote swallow
regal scaffold
#
  • you can use it with IntelliJ datagrip
#

And they link in the same app

worldly ingot
#

I could have simplified the event typing with PJE + Enter, but meh. I've just been so used to typing out event names and I type fast enough anyways

compact haven
#

You can use template in IntelliJ as well

#

I’m sure eclipse isn’t all that inferior feature wise to IntelliJ

tardy delta
#

whats a template

compact haven
#

that

tardy delta
#

the only ones i use are todo and fori

remote swallow
#

i should figure out how to make one of them

tardy delta
#

i thought you could insert lua syntax

worldly ingot
#

Those that mock it tend to do so for one of two reasons. Either (a) their IntelliJ elitism gets in the way and it's the cool thing to do, or (b) they last used Eclipse Mars or something from 8 years ago

#

Admittedly however, I still refuse to use its Git integration outside of just the visual symbols in the file list. It's really not great. That and its Gradle integration can very much be better, but meh

#

I do hope Eclipse adds some new template placeholders variables. I'd love more. I feel like they haven't added any since its initial release

kind hatch
#

I still remember the Eclipse Juno days. I hated it.

#

It got better with Luna, Mars, and Neon, but IntelliJ just did things better for me at the time.

sterile token
#

Okay while debugging my command framework i have find some bugs, one of then is caused by the next i have 2 classes SimpleCommand (for normal command class) and SimpleExecutor (for sub command or arguments). What its happening well i have done the command parser, which is not well designed because im assuming that args lenght < 1, is normal command and if args lenght > 1 is sub command

quaint mantle
#

?doc

sterile token
undone axleBOT
quaint mantle
#

ty

sterile token
#

Your welcome

quaint mantle
#

also wait

#

would you know by chance

#

the event the on player kill

remote swallow
quaint mantle
#

oh

#

and you can just do

#

event.getattacker

#

or sum alogn those lines right?

sterile token
#

Its bad designed, because normal commands can access to arguments too, issues came when in parsing because how i would know when to treat it as normal or sub command

remote swallow
#

event.getPlayer().getKiller()

quaint mantle
#

right ok

#

also

#

making a public hashmap is posible right

remote swallow
#

public Map<Type, Type> map

#

yeah

quaint mantle
#

k

#

and

#

for the first type

#

i can just put a players uuid

#

and the second one i can put like

#

number of kills right?

remote swallow
#

yeah

quaint mantle
#

then add +1 after every kill

remote swallow
#

mhm

quaint mantle
#

then make a new channel for the command

#

i mean class

remote swallow
#

make sure to save that so it saves over restart

quaint mantle
#

wdym

remote swallow
#

the kills can be tracked by statistic

remote swallow
quaint mantle
#

but i want it to stay in the map

remote swallow
#

you have to save it then

#

or just track the statistic

quaint mantle
#

how

#

hi

#

nrej

#

breh

#

did bro just delete his message 💀

sterile token
#

Sorry i raged LMAO

quaint mantle
#

can you tell me how to save a hash map

#

save*

sterile token
#

What?

quaint mantle
#

how to save a hasmap

#

sorry

sterile token
#

Maps are in memory

quaint mantle
#

k how do i save it then?

sterile token
#

Database? Flatfile?

quaint mantle
#

how do i save it in a flatfile

sterile token
#

What flatfile are u using? Json? Yaml? h2?

quaint mantle
#

json

sterile token
#

So right, first of all take in care you will have to use a library for working with Json (Spigot already include one which is really great, called Gson)

#

Please tell me your map<?, ?> replace the "?" which your params, so i can see whats is your map keeping

quaint mantle
#

HashMap<UUID, Long>

sterile token
quaint mantle
#

did

sterile token
#

okay, what will keep your hashmap value?

quaint mantle
#

wdym

sterile token
#

yeah because there you will keep long type values

quaint mantle
#

yes