#help-development

1 messages · Page 885 of 1

remote swallow
#

you can break stone and get cobble

kind hatch
#

Refer to this

dawn valley
#

i used EntityDropItemEvent

remote swallow
#

no

dawn valley
#

getDrops methods does not work?

dawn valley
kind hatch
dawn valley
#

i was confused i didnt know what i was doing wrong

wintry lynx
#
        itemsFile = new File(getDataFolder(), "items.yml");
        structureDataFile = new File(getDataFolder(), "structureData.yml");
        deathMessagesFile = new File(getDataFolder(), "deathMessages.yml");

        Map<File, String> paths = new HashMap<File, String>()
        {
            {
                put(itemsFile, "items");
                put(structureDataFile, "structureData");
                put(deathMessagesFile, "deathMessages");
            }
        };

        for (Map.Entry<File, String> configFile: paths.entrySet()) {
            //System.out.print("Item in Config " + configFile.getValue() + " Exist: " + configFile.getKey().exists());
            if (!configFile.getKey().exists()) {
                configFile.getKey().getParentFile().mkdirs();
                saveResource(configFile.getValue() + ".yml", false);
            }
        }

        items = YamlConfiguration.loadConfiguration(itemsFile);
        structureData = YamlConfiguration.loadConfiguration(structureDataFile);
        deathMessages = YamlConfiguration.loadConfiguration(deathMessagesFile);
        items.save(itemsFile);
        deathMessages.save(deathMessagesFile);
        structureData.save(structureDataFile);
    }```
So anyone got any idea why these arent saving?
lone aurora
#

I am making a plugin for a friend, he wants it to prevent players from taking an item out of the offhand which he forces to be there. I was able to get it to block every action except the action of swapping the item from your offhand to the current inventory slot you are hovered over. (I want to be able to get the item that is swapped when you press the f (swap) key in a GUI)

young knoll
#

InventoryClickEvent

#

With action swap offhand

slender elbow
#

I swear I already answered that question in another server over an hour ago

wintry lynx
slender elbow
#

I must be deluded

worldly ingot
#

No, you're Emily, silly goose

dawn valley
wintry lynx
#

Something so simple was driving me to insanity

wintry lynx
#

my brain dying

dawn valley
#

maybe its better to handle exceptions within the method itself or propagate them up the call stack?

wintry lynx
#

This tho. This infuriates me. They are the same thing

young knoll
#

Are they tho

#

What is plugin declared as

dawn valley
wintry lynx
#

so it should (If java is like every code language I know) BE THE SAME

young knoll
#

Okay but what is the type declared as

worthy yarrow
#

Man I don't know what to work on D:

wintry lynx
young knoll
#

And thus it is not the same

#

If your main is called main you need to declare the variable as such

wintry lynx
#

interesting...

worthy yarrow
#

Alright so I've got some basic implementation so far. The goal of this one is to detect when a town is under an active siege, if so then it should change whatever permission that handles explosions in the town to false(to enable explosions in the town). When the siege ends, the permission gets changed back to true. I'm just not sure on how to actually change the permission...

 private static void disableExplosions(Location location) {
        TownBlock townBlock = TownyAPI.getInstance().getTownBlock(location);
        if (townBlock != null) {
            townBlock.getPermissions().set("explosion", false);
            
            townBlock.save();
        }
    }``` 
This was my initial thought, just a helper method to be called any time a town comes under an active siege... Though I'm not sure if I could just get the town from the active siege and check that way, then instead of a townblock just for each town found to be under an active siege set the flag that way
eternal oxide
#

you don;t want to change the TownBlock permission. Change it on the Town

#

If you change it on teh TownBlock it can be overridden by the Town

#

unless it's changed

worthy yarrow
#

Yeah I saw that as an issue as well, that was what I was going to do I just have no clue how to get / change the towns permissions

eternal oxide
#

There shoudl be TownBlock, Town and World permissions

worthy yarrow
#

This is like day 3 of trying to learn a bit of towny api so

eternal oxide
#

You should be able to get the Town from teh TownBlock, if not there is likely a helper method in the Universe

worthy yarrow
#
private static void disableExplosions(Location location) throws NotRegisteredException {
        TownBlock townBlock = TownyAPI.getInstance().getTownBlock(location);
        if (townBlock == null) return;
        if (!townBlock.hasTown()) return;
        Town town = townBlock.getTown();
        if (town.getPermissions().explosion){
            town.setExplosion(false);
        }
    }

    private static void enableExplosions(Location location) throws NotRegisteredException {
        TownBlock townBlock = TownyAPI.getInstance().getTownBlock(location);
        if (townBlock == null) return;
        if (!townBlock.hasTown()) return;
        Town town = townBlock.getTown();
        if (!town.getPermissions().explosion){
            town.setExplosion(true);
        }
    }```

How do we feel about this?
#

(forced to throw in order to get the town from the townblock)

young knoll
#

You could just not throw?

#

Have ya heard of try catch

worthy yarrow
#

Yeah but I'm just trying to get the damn permission functionality written first haha

#

I just wanted to know if I was going the right way with actually setting these permissions for the town

young knoll
#

I blame towny instead, checked exceptions are annoying

eternal oxide
#

It was written in a different era

worthy yarrow
#

Oh wait is it rather :

or
town.setExplosion(false);```
young knoll
#

Where’s towny 2 then smh

river oracle
#

I genuinelly wonder wtf this does

          public Pair<ResourceLocation, ResourceLocation> getNoItemIcon() {
                    return Pair.of(InventoryMenu.BLOCK_ATLAS, InventoryMenu.TEXTURE_EMPTY_SLOTS[enumitemslot.getIndex()]);
                }```
eternal oxide
#

setExplosion tru, if you want to enable them (I think)

river oracle
#

oh nvm I get it now

#

I wonder if I can abuse this

young knoll
#

Wha

river oracle
#

guess we will see

#

you know the little icons in like the enchantment table and stuff

young knoll
#

Why is the empty slot texture thing an array

river oracle
young knoll
#

Ah wait it’s like the armor slots

#

Yeah I see

river oracle
#

SLOT_IDS = new EquipmentSlot[]{EquipmentSlot.HEAD, EquipmentSlot.CHEST, EquipmentSlot.LEGS, EquipmentSlot.FEET};

#

I'm going to push custom menu system to its max I wonder if this could ever work in the Bukkit API lol

young knoll
#

Im gonna guess

#

No

#

Since textures are client side

river oracle
#

you never know tbh

#

There are some weird slot gimicks that work server side

worthy yarrow
#
private static void disableExplosions(Location location){
        TownBlock townBlock = TownyAPI.getInstance().getTownBlock(location);
        if (townBlock == null) return;
        if (!townBlock.hasTown()) return;
        try {
            Town town = townBlock.getTown();
            if (town.getPermissions().explosion){
                town.getPermissions().explosion = false;
                town.setExplosion(false);
            }
        } catch (NotRegisteredException notRegisteredException){
            notRegisteredException.printStackTrace();
        }
    }```
hmm I'm not sure which one to use haha
young knoll
#

Well yeah a decent amount of inventory handling is server side

#

But textures just aren’t :p

worldly ingot
#

You could always open the setExplosion() implementation and check

river oracle
eternal oxide
#

setExplosion is in teh permissions, so thats where you want to be

worthy yarrow
#

Ok gotcha

#

thank you guys

eternal oxide
#

I wrote most of Towny, but it's been many years and other devs worked on it since

young knoll
#

Shame we don’t have anyone like that around :p

eternal oxide
#

There is also an Admin override level of permission but you best no tmess with those

worthy yarrow
#

I don't think it should be needed, this plugin is just for a siegewar fix i think... something about towny explosions not being enabled when a town is under an active siege

eternal oxide
#

definitely on the Town object then. It overrides TownBlock permissions

worthy yarrow
#

Gotcha thats good to know

eternal oxide
#

just remember what the settign was before you change it, so you can change it back after

worthy yarrow
#

Well I was going to have two helper methods for that, enable / disable

#

Just call them accordingly when a town has either just been put under active siege / when the siege ends

young knoll
#

What if it’s already enabled

#

It will be enabled again when war starts, and then disabled after

eternal oxide
#

Towny supports meta on teh TownBlock so you could store it's original setting there

#

and on Town

#

But its been far too long ago for me to remember using meta

young knoll
#

Could also just pdc the home block chunk

#

Oh wait you can change towny plot sizes to stuff other than 16x16

worthy yarrow
# young knoll What if it’s already enabled

It's for a specific server so I was just writing this out for the functionality of their wars, ie: You may siege a town but the town doesnt actually become "actively sieged" until the battle session starts, by default unless a town is actively sieged, its explosions should be disabled.

worthy yarrow
eternal oxide
#

Why not make a PR for the SiegeWars project?

#

Fix the plugin itself rather than hot fix

worthy yarrow
#

I have literally 0 experience with github and tbf already am in contact with Llmdl so just kinda lazy

eternal oxide
#

ah ok

worthy yarrow
#

I was gonna get it working first before I presented it to them haha

worthy yarrow
eternal oxide
#

Are you sure this server doesn;t simply have explosions disabled at teh world level?

worthy yarrow
#

Yeah, from the information given to me, it's all pointing to siegewar just not enabling town's explosions

eternal oxide
#

?

#

Towny has it's own regen

worthy yarrow
#

I don't remember if it was this one or not, but a plugin along these lines. Something that regenerated blocks after explosions

worthy yarrow
eternal oxide
worthy yarrow
#

Alright well thank you for all the help, I have to get some sleep haha it's been a solid 22 hour journey now

worthy yarrow
#

I decided to push to 24 hrs haha

#
@EventHandler
    public void onSiegeStart(SiegeWarStartEvent event){
       if (event.getTargetTown() == null) return;
       if (event.getTownOfSiegeStarter() == null) return;
       Town siegedTown = event.getTargetTown();
       if (SiegeWarBattleSessionUtil.getFormattedTimeUntilNextBattleSessionStarts().equals(String.valueOf(0))) {
           if (event.getTargetTown().getPermissions().explosion) {
               siegedTown.setExplosion(false);
           }
       }
    }

hmmm

#

I'm not sure how to detect when the battle session is currently happening... I think siegewarstart is when a town decides to go to war with another town right?

icy beacon
#

How do I find out my public IP to whitelist in fail2ban? Running curl -s https://icanhazip.com gives me one result, running dig +short myip.opendns.com resolver1.opendns.com gives another result, going to https://myip.com on windows gives me yet another result

#

So 3 methods and 3 different results

#

I'm sshing into the server with Termius if that matters

cosmic loom
#

when i want to create a new project it just stuck in closing project for a long time

#

how do i fix

wet breach
#

I myself have like 3 connection points to the internet therefore something like this is typically not an issue for me

#

if my ip gets clobbered, I can just connect via the other two ways to undo it lmao

icy beacon
#

Ok that's fair, thx

wet breach
#

and you should see your ip

#

not sure why you didn't bother just looking to see what your server said XD

icy beacon
#

Fair enough lol

wet breach
#

but just like you I didn't really have much on the server so wasn't an issue

#

I misconfigured the firewall, forget what it was and it just denied all connections XD

#

normally I have a VM though where I test/setup stuff before applying it to the dedi

#

but I was being lazy

icy beacon
#

Yeah it's probably a good decision to test everything

wet breach
#

I keep a VM that is exactly setup the same as my production 😛

icy beacon
#

Well so far my setup has been going fine so I hope it will stay that way

wet breach
#

however, the difference though is that with OVH

#

I can use custom ISO's for rescues

#

they allow what is called IPMI

#

its a dedicated connection that is separate from the normal connection

#

and its for things like modifying bios stuff and uploading ISO's directly to the machine

wet breach
#

it wasn't necessary to start over

#

had we known that

#

you could have used a socks proxy for the ssh

tribal zephyr
#

I was working fine yesterday

icy beacon
#

I seemed to have blocked all connections

#

And tbh it was easier for me to restart. I barely had anything on the server

fluid river
#

sorry for the spam

#

but

#

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

fluid river
#

?paste

undone axleBOT
fluid river
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

fluid river
#

?xy

undone axleBOT
dry hazel
#

there's literally a bot command channel

wet breach
fluid river
#

i forgot that it exists

#

fr

#

haven't been on this channel for ages i'm sure

brisk harbor
#

im adding vault api and its giving this error. what am i doing wrong?

dry hazel
#

press the refresh button that's in the right upper corner of the editor

brisk harbor
brisk harbor
civic sluice
#

And recommend upgrading to 1.7.1 as it fixes a long standing issue with Vault-API transitive providing Bukkit 1.8.

wild roost
#

guys, how do I change my plugin version? cuz when I put a compiled plugin in a plugin folder an start a server it gives an error

quaint mantle
wild roost
tardy delta
#

it is 1.16, not 1.16.5 that doesnt exist

wild roost
#

tu

#

skill issue seems to be

quaint mantle
#

😭

chrome beacon
#

Yeah people don't read

icy beacon
#

Can I make gradle's starting point a non-class main function?

// scope of a file
fun main(args: Array<String>) {}

All I found was mainClass in application.

umbral ridge
#

hey

#

note a code related question, so you can see who played on a server by viewing world/playerdata folder right?

#

files in it

#

using nbtexplorer or something

#

arent there usernames in there?

#

only uuids?

icy beacon
#

1 sec i'll try my playerdata folder

umbral ridge
#

so i used to played w my friends on the server and now we cant remember which usernames we used to play on it

icy beacon
#

If your server is vanilla then not sure

tender shard
#

it's in the bukkit tag so I doubt vanilla stores it 😛

icy beacon
#

Yeah that's what i said xD

icy beacon
#

You seem to have been invested in gradle lately

tender shard
#

you can only add an etry to MANIFEST.MF for the main-class and it will always have to be named "main"

icy beacon
#

Well like I run gradle run and I want the starting point to be this file-scope function

icy beacon
#

Sounds crappy

#

Surely there's a way to start from a non-class main fun

tender shard
#

but why don't you just name the method main

icy beacon
#

You say it takes the main method

#

Can I specify where to take that mmethod

#

There's this:

application {
  mainClass = "someclass"
}

The execution will start from the main method in that class

tender shard
#

do you want to have a different main class for gradle run and for the "general" one ?

icy beacon
#

I want to start an execution in a method that's outside of a class

torn shuttle
#

yoooo intellij's ai thing can now write commits for me

#

big pog so real

icy beacon
tender shard
icy beacon
#

I just want to compile and subsequently start my rest api

tender shard
#

AnotherMainKt = AnotherMain.kt, doesnt have to be a class but ofc needs a fun main(...) method

icy beacon
#

Works like a charm, thx 🙂

#

It's mainClass not main btw

valid basin
#

How to get inventory name on spigot 1.20

#

Because currently you can't

tender shard
icy beacon
#

Probably getView then getTitle

valid basin
#

on inventory click event

icy beacon
#

If they didn't change it

#

But if you are trying to compare GUIs by names, then don't

tender shard
#

why do you need the inventory title in the first place

lost matrix
valid basin
tender shard
#

you dont need a custom gui holder

lost matrix
#

Custom GUI holders are even worse

tender shard
#

just store the inventory instance

valid basin
#

but I have to check it because I was using 1.8.8 and it was working fine. But now on 1.20 the method to get name doesn't exist anymore

icy beacon
#

If you are comparing GUIs by titles I can rename a chest in an anvil and then I have your cool GUI where you didn't intend it to be

#

Afaik there are more pitfalls than just this

lost matrix
#

Anyways. Get the InventoryView and call getOriginalTitle()

#

Yeah checking inventories by name or having a custom holder are pretty abysmal. One is unsafe the other can cause lag really fast.

proud badge
#

Is checking if a chunk has PDC on LeafDecayEvent gonna cause a log of performance issues?

chrome beacon
#

Should be fine

#

Assuming it's the chunk that the leaves are in

icy beacon
#

I'm dockerizing my api that works with a database, should the database and the api be 2 different containers or should (can they?) run in the same one?

eternal night
#

Two containers

icy beacon
#

Another question then, let's say I have two images, one that sets up my api and one that sets up the database, do I start them separately e.g. docker run -p 8080 --name api api and docker run -p 3306 --name db db, or is there some way of managing multiple containers?

eternal night
#

Check out docker compose

icy beacon
#

Will do

proud badge
#

will EntitySpawnEvent work for when an item frame is placed by a player?

#

ah wait I cant get the player who placed the item frame then, what should I do

icy beacon
#

Wouldn't BlockPlaceEvent be sufficient?

proud badge
#

well an item frame isnt a block

icy beacon
#

You place it though

proud badge
#

BlockPlaceEvent

icy beacon
#

I have an inkling feeling it'll get called but I'm not sure

#

If you could just try to see if it gets called that'd be awesome

#

I understand why you believe it won't

native ruin
#

Let's find out

icy beacon
#

^

proud badge
#

it doesnt

#

doesnt fire

icy beacon
#

Ah, bummer

proud badge
#

thx

elder harness
#

Would it be possible to have some sort of localized item displayname and lore? The only thing I can think of is to run some sort of global tick system that adjusts all items in the game (of all inventories and dropped items)

#

Obviously that tick system would be incredibly inefficient

chrome beacon
#

you can just use a resource pack

#

with a language file

elder harness
#

How would that work?

chrome beacon
#

Minecraft has translatable chat components

icy beacon
#

I ran docker-compose build --no-cache on a docker-compose.yml with 3 services, but for some reason only 1 docker image is in docker images, is that supposed to happen?
docker-compose.yml: https://paste.md-5.net/uzawakuneg.cs

chrome beacon
mellow edge
#

Is it possible to change player nametag (above head) in 1.8 with teams, because I tried it and player's name was always white

#

To a different color

#

And text

elder harness
grim hound
#

How can I open the book signing gui for a player?

chrome beacon
#

I'm not sure if you can do that

#

I believe it's just handled client side

south mason
#

I am trying to use Protocollib in my project, but I ran into the problem that if I use api version 5.1.0, then this version does not work in minecraft, and if I use dev version 5.2.0, then I do not know how to get a link to the API

icy beacon
#

It actually errors (?) but the errors are for some reason invalid strings:

time="2024-02-05T19:09:54+05:00" level=warning msg="The \"mC\" variable is not set. Defaulting to a blank string."
time="2024-02-05T19:09:54+05:00" level=warning msg="The \"j\" variable is not set. Defaulting to a blank string."
time="2024-02-05T19:09:54+05:00" level=warning msg="The \"mC\" variable is not set. Defaulting to a blank string."
time="2024-02-05T19:09:54+05:00" level=warning msg="The \"j\" variable is not set. Defaulting to a blank string."
#

Not an error but a warning*

next plume
next plume
#

Normally, you shouldn't have to change the version for using the API.

#

I still use 4.7.0

#

But ProtocolLib isn't working for me on 1.20.4

chrome beacon
#

Well 4.7 doesn't support 1.20 so that makes sense

icy beacon
shadow night
#

bruh

icy beacon
#

Yeah but kinda makes sense

shadow night
#

Sounds exploitable to me

icy beacon
#

Docker probably was trying to replace them with env variables

shadow night
icy beacon
#

Exactly

south mason
#
public class ProtocolLib {
    private final ItemLore plugin;

    public ProtocolLib (ItemLore plugin){
        this.plugin = plugin;
    }

    public void openBook(Player player){
        int slot = player.getInventory().getHeldItemSlot();
        ItemStack old = player.getInventory().getItem(slot);
        player.getInventory().setItem(slot, createBook());
        ProtocolManager manager = ProtocolLibrary.getProtocolManager();
        System.out.println(manager);
        PacketContainer packet = manager.createPacket(PacketType.Play.Server.OPEN_BOOK);
        try {
            manager.sendServerPacket(player, packet);
        } catch (Exception e){
            e.printStackTrace();
        }
    }

    private ItemStack createBook() {

        ItemStack book = new ItemStack(Material.WRITABLE_BOOK);
        BookMeta meta = (BookMeta) book.getItemMeta();

        meta.addPage("Delete and write somethings");
        book.setItemMeta(meta);

        return book;
    }
}
#

I was trying to do something like this

zealous osprey
#

doesn't the player have a method called #openbook ?

south mason
zealous osprey
#

Oh you want to use it as an input tool

south mason
next plume
#

I know next to nothing about ProtocolLib, so don't ask me.

south mason
#

The book as an interface looks great

zealous osprey
#

Sorry, idk currently.
Btw, you shouldn't call your class "ProtocolLib" if that's the library you are using

south mason
#

kk)

slender elbow
#

no, it has to be a written book, the client will ignore it if it isn't

slender elbow
#

'?'?

#

it has to be a written book
the client will ignore it if it isn't

south mason
#

Is there no way to simulate clicking on a book?

slender elbow
#

no

worldly ingot
#

That writeable book UI is client-sided as far as I'm aware :p

#

You can ask them in chat to open the book. Prevent them doing anything else I guess

river oracle
#

Or take the forceful approach steal their items and put a book in their hand then force open ir with the API

#

Replace their items when they close it or disconnect

worldly ingot
#

Well that's kind of what I mean

#

Give them really no other option but to open the book

south mason
#

I don't need to receive data from the book in real time, I just need to simulate a click on the book and read the information only after signing

worldly ingot
#

I feel like you're just ignoring what we're saying KEKW

slender elbow
#

man

#

you cannot do that

river oracle
#

Maybe not native English??

slender elbow
#

it is not possible

south mason
#

kk

river oracle
#

That'd be my only guess

south mason
#

I understand everything, but it seems strange to me

river oracle
south mason
#

🥲

worldly ingot
#

It might be strange but it's just one of those things the server isn't really capable of allowing the client to do. It's a client-sided UI that only sends its contents once it's edited

river oracle
#

fun fact you can put other items besides a book in a lectern inventory.

#

It's weird

#

Then it gives you that item when you press Take Book

south mason
#

i like mc)

#

good game

icy beacon
#

do you need a middleman

worldly ingot
#

Chiseled bookshelves restrict it to books and enchanted books

torn shuttle
#

8 years of doing support and today I've gotten the most encouraging message from a support ticket ever

#

it's... beautiful 🥲

worldly ingot
young knoll
#

Fake news that never happens

torn shuttle
#

I take it back, they didn't learn shit

ember estuary
#

I’m doing a Job-Plugin where you get points for breaking specific blocks, for example as a woodcutter for breaking wood.

What is the best way to check if that block was naturally generated (so one cannot just place and mine the same block over and over to get infinite points)?

My idea:
Make a new MySQL table in which i store every block position of blocks that were placed by a player or dispenser. if a block is moved via piston i change the saved positions. if a block is broken i check if its in the list, if yes you get no points for breaking it and I remove the database entry.

is this the best way of doing it?
Or does anyone have a better idea?

tender shard
#

?blockpdc

undone axleBOT
quaint mantle
#

@tribal zephyr but i don't know how to add the try and cath for that event

tribal zephyr
#

just send the player a message on join

#

you don't need try and catch

quaint mantle
slim gate
#

How do I make a player wrapper class and an adapter for paper (for minimessage bundled inside and paper-plugin.yml and more stuff) and spigot and bungeecord in future

quaint mantle
ember estuary
tender shard
ember estuary
#

👍🏼

quaint mantle
chrome beacon
tribal zephyr
undone axleBOT
tribal zephyr
#

Paste the code

quaint mantle
tribal zephyr
#

Oh wait I checked your previous code

#

use gui.open(player);

#

To open the GUI

glacial narwhal
#

Is there a way to use the warden sonic attack ?

quaint mantle
quaint mantle
tribal zephyr
#

public class Antibotevent implements Listener {
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event){
Player player = event.getPlayer();
Gui gui = new Gui(1,"Antibot");
ItemStack netherrack = new ItemStack(Material.NETHERRACK);
ItemMeta meta = netherrack.getItemMeta();
meta.setDisplayName(ChatColor.RED + "-");
netherrack.setItemMeta(meta);
GuiItem netherInGui = new GuiItem(netherrack , newevent -> {
newevent.setCancelled(true);
player.sendMessage("You Authorized !");
player.closeInventory();
});
gui.getFiller().fillBorder(netherInGui);
gui.setItem(1,netherInGui);
gui.open(player);

}

}

#

That should work if your code is correct

river oracle
#

hmmm I see a fatal flaw in this code 🤔 if you want to sotp bots wouldn't you want to kick them. Bots can click GUIs

river oracle
#

also by joining the server they're already intrinsically causing some lag

tribal zephyr
#

I was about to say that

river oracle
#

Entities Tick Every Tick

#

which is wild

quaint mantle
river oracle
tribal zephyr
#

lmao

river oracle
#

granted someone with a disability will click the buttons much slower than someone with a bot so 🤷‍♂️

quaint mantle
river oracle
quaint mantle
glacial narwhal
#

Is there a way to use the warden sonic attack ?

river oracle
#

let's see

#

wdym by use ig

quaint mantle
river oracle
#

I've always been in favor of open source clearly I need to make some contributions

quaint mantle
#

Do captchas

#

In map

tribal zephyr
quaint mantle
#

Google java captcha libs

#

then use bukkit map api

quaint mantle
river oracle
#

if they fail a captcha time them out for idk 10 or so seconds after x failed attempts

#

AsyncPlayerPreLoginEvent iirc

quaint mantle
river oracle
#

should beable to kick them before an entity is even created

tribal zephyr
#

probably should not talk about that

#

unless we want to get a timeout /ban

quaint mantle
glacial narwhal
#

Is there a way to use the warden sonic attack ?

quaint mantle
tribal zephyr
#

You are talking about nAntiBot

#

right?

quaint mantle
#

wait

tribal zephyr
quaint mantle
tribal zephyr
#

nah I am too tired to turn on minecraft

wide coyote
#

the term you are looking for is limbo

#

almost every plugin runs their anti-bot checks (including captcha) in a limbo server

wide coyote
#

send some screenshots, maybe?

#

explains nothing

tribal zephyr
#

I think you don't know how Antibot plugins work

wide coyote
#

the main thing you should focus is to send packets as less as you can

quaint mantle
wide coyote
#

and I don't think gui worth the cpu power

wide coyote
#

we really need more information to help you

#

firstly, what are you trying to achieve?

quaint mantle
quaint mantle
tribal zephyr
#

Captcha is to verify if the player is real

quaint mantle
wide coyote
#

pleaseeee I beg you

#

answer my questions man

tribal zephyr
#

lol

quaint mantle
#

i mean captcha can't protect if the bot send some bad packet in 2 sec with 1000 bot

wide coyote
#

thats the point

tribal zephyr
#

PaperMC left the chat

wide coyote
#

captcha is made in another server

#

or at least the packets doesn't affect the server

tribal zephyr
#

Most packet exploits have been fixed in Paper

quaint mantle
wide coyote
#

and for a while now (on the newest version of minecraft), there isn't much "bad packets"

quaint mantle
wide coyote
quaint mantle
wide coyote
#

why can't you use paper?

quaint mantle
wide coyote
#

yeah but why

#

paypal is also blocked in turkey but we can use papermc lol

quaint mantle
wide coyote
#

ah I thought Iran government blocked papermc for a second

shadow night
#

wtf

wide coyote
#

you can run this (or something similar) on your proxy

#

connect the players to limbo server and do your thing there

quaint mantle
quaint mantle
tiny prairie
#

Anyone got tips on how to use plugins to create prison cells for a prison server? I've tried a skyblock approach with bentobox, worldguard and luckperms, but doesnt seem to work as the skyblock islands (cells in my case) get generated in different places each time. Therefore its difficult to set permissions for newly generated cells.

wide coyote
#

not about using one

quaint mantle
#

i don't want use other plugins because i want learn and training for making a plugin with some api

tribal zephyr
#

ohh

#

you decided to start with coding a antibot

quaint mantle
#

yeah i am looking for testing for write a new thing !

#

with new method that anybody don't using if possible

wide coyote
#

protection plugins should be the last thing you make

#

or even think to make

tribal zephyr
#

yep

wide coyote
#

community, responsibilities, updates etc

#

everything is a problem

quaint mantle
quaint mantle
#

and was good antibot because we tested !

tribal zephyr
#

rewrite?

quaint mantle
tribal zephyr
#

well, try to understand how antibot plugins function. You can do this by reading the code of how other people do it

#

Checkout 2LS Antibot on github

wide coyote
#

or maybe Sonar, its for velocity but can help you understand

tribal zephyr
quaint mantle
tribal zephyr
quaint mantle
quaint mantle
#

and i use vulcan and i saw some times blocked bad packet

warm pine
#

Vulcan is a anticheat

#

And there is a difference between Bad packets and crash packets

quaint mantle
tender shard
#

is there a working checkstyle gradle plugin for kotlin?

dry hazel
#

ktlint probably has a gradle plugin somewhere

tender shard
#

Thx

zealous scroll
#

is there a way to get an inventory in the server by nms container id? currently trying to get the inventory a window click packet is manipulating

chrome beacon
#

If the server can from the packet

#

then so can you

worthy yarrow
#
public class EndSiegeEvent implements Listener {

    @EventHandler
    public void siegeEndEvent(SiegeEndEvent event){
        Town town = event.getSiege().getTown();
        if (town.getPermissions().explosion){
            town.setExplosion(false);
            town.save();
        }
    }
}```
```java
public class SiegeStartEvent implements Listener {

    @EventHandler
    public void battleStartSession(BattleSessionStartedEvent event){
        for (Town siegedTown : SiegeWarAPI.getActivelySiegedTowns()) {
            if (!siegedTown.getPermissions().explosion){
                siegedTown.setExplosion(true);
                siegedTown.save();
            }
        }
    }
}```

Does this look alright to disable / enable town's explosion permissions on siege start / end?
lost matrix
# worthy yarrow ```java public class EndSiegeEvent implements Listener { @EventHandler ...
  1. Rename your listeners to FooListener instead of FooEvent.
  2. explosion is a public field. Make it private. (And i would not create fields for permissions, use an Enum and a Map/Set instead)
  3. I hope save() doesnt actually save the town to a file or DB (or at least does it async)
  4. The conditional check in your battleStartSession is a bit redundant. I would simply set all towns to true

Btw. Why do you save towns on each change?

worthy yarrow
#

Well because I thought I'd have to "update" the permission if you will

#

Also ehm this isn't a custom permission... this is already written into towny, I just had to grab it / change it

worthy yarrow
quaint mantle
#

Best anticheat?

#

I would never attempt to make my own, bc i dont understand minecraft mechanics all that well to know how to catch everything

proud badge
#

whats the gradle dependency for spigot?

#

or where may I find it

#

like the URL

remote swallow
#

kotlin or gradle

tender shard
remote swallow
#

how long has that existed

tender shard
#

2018

proud badge
#
Searched in the following locations:
  - https://repo.maven.apache.org/maven2/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/maven-metadata.xml
  - https://repo.maven.apache.org/maven2/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/spigot-1.20.2-R0.1-SNAPSHOT.pom
  - https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/maven-metadata.xml
  - https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/spigot-1.20.2-R0.1-SNAPSHOT.pom
  - https://oss.sonatype.org/content/repositories/snapshots/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/maven-metadata.xml
  - https://oss.sonatype.org/content/repositories/snapshots/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/spigot-1.20.2-R0.1-SNAPSHOT.pom
  - https://oss.sonatype.org/content/repositories/central/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/maven-metadata.xml
  - https://oss.sonatype.org/content/repositories/central/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/spigot-1.20.2-R0.1-SNAPSHOT.pom
  - https://maven.enginehub.org/repo/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/maven-metadata.xml
  - https://maven.enginehub.org/repo/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/spigot-1.20.2-R0.1-SNAPSHOT.pom
  - https://hub.jeff-media.com/nexus/repository/jeff-media-public/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/maven-metadata.xml
  - https://hub.jeff-media.com/nexus/repository/jeff-media-public/org/spigotmc/spigot/1.20.2-R0.1-SNAPSHOT/spigot-1.20.2-R0.1-SNAPSHOT.pom
Required by:
    project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html``` ye I tried
#

did I miss something

tender shard
#

spigot needs to be built with buildtools

#

spigot-api = publicly available
spigot = build it yourself

#

do you really need spigot instead of spigot-api?

proud badge
#

uh no

tender shard
#

then use spigot-api instead of spigot

proud badge
#

ok I fixed it

#

yay

dapper meadow
#

Hey guys, I have a quick question, so I have a plugin about clans and I'm trying to add placeholders (papi). (I am a new/young developer and am really new in this). How can I do this? Thank you :)

tender shard
dapper meadow
#

Maven

tender shard
#

and then: do you want to create a custom placeholder like %yourplugin_something%, or do you want your plugin to be able to parse other plugin's placeholders?

dapper meadow
#

I'd like to create a custom placeholder (%<pluginname>_clan_current%)

grim hound
#

what does this mean?

tender shard
#

(and then call register() on your instance of your PLaceholderExpansion class)

dapper meadow
#

FinnInvite is the name btw, since I'm making it for someone called "Finn"

kind hatch
#

?codeblock

undone axleBOT
#

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

}

}```
Becomes:

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

    }
}```
dapper meadow
#
public class YourPlaceholderExpansion extends PlaceholderExpansion {

    private final Plugin plugin;

    public YourPlaceholderExpansion(Plugin plugin) {
        this.plugin = plugin;
    }

    @Override
    public String getIdentifier() {
        return "FinnInvite";
    }

    @Override
    public String getAuthor() {
        return "__J3LT3_";
    }

    @Override
    public String getVersion() {
        return "1.6";
    }

    @Override
    public boolean canRegister() {
        return true;
    }

    @Override
    public boolean persist() {
        return true;
    }
}```
#

"FinnInvite" is the pluginname since I'm making it specificly for his server and the owners' name is "Finn"

hasty oyster
thick tundra
#

Helloo, I'm currently working on a custom entities plugin. but i want to do a distance check, from the player to each entity. This could possibly be 1000+ entities. I want to really optimize this project, so im figuring out what methods to optimize. I have heard that Vector.distance is relatively slow, what method could i use to save some calculation power?

sullen marlin
#

distanceSquared

thick tundra
#

thanks! is there any diffrence between the output?

tender shard
#

Its squared

#

Instead of checking distance < 10, you check if distanceSquared < 10*10

river oracle
#

pretty sure you can do some bit shifting operatins etc to make distanceSquared even faster

#

just ask the guys who made.. hmmm. what was it again? Doom or Quake

#

one of those

tender shard
#

I once ran JMH on distance and distanceSquared and it was almost the same tbh

tender shard
sullen marlin
tender shard
#

Let me try to find them

tribal quarry
river oracle
#

ahh that was it

#

wrong thing

tender shard
#

ok granted it doesnt use bukkit's distance() method

#

yeah there's a great video on youtube that explains this inverse square root thingy

slender elbow
#

that code contains UB :3

thick tundra
#

hmm interesting, will have to test both methods out and see the actual performance on my server once done.

tender shard
#

just use distanceSquared

#

its definitely faster on older CPUs

thick tundra
#

okayy will do, thanks!

worldly ingot
#

I mean not only is it faster, you're just avoiding a square root operation that you genuinely do not need lol

sage patio
#

I have a memory leak problem on my server that creates millions of Location instances and causes a huge memory leak, the only way to detect is to disable the plugins one by one? I mean, if I disable a plugin the data stored in the memory by that plugin will be deleted?

worldly ingot
#

Use the square root if you're display it to a player. Never any other time

thick tundra
sage patio
slender elbow
#

you could take a heap dump and track it down probs

sullen marlin
#

Just restart your server?

sage patio
#

well the memory leak happens too fast

#

like in 2 hours

thick tundra
#

a heapdump does not take 2 hours tho

sage patio
worldly ingot
#

lol. The ultimate move. Memory leak? Just restart before your server crashes 😎

sage patio
#

a lot of lag

quaint mantle
sage patio
quiet ice
#

could be anything that reads a .hprof file really

sage patio
#

its a plugin

#

well i didn't got my answer yet

#

if i disable a plugin using plugman, the data in the memory is gonna be cleared or not

quiet ice
#

Due to how classloading works - it is impossible for it to get cleared unless you nuke all references beforehand

tender shard
#

can't you just create a heapdump and check where those locations come from?

sage patio
#

how?

#

i know how to create a heapdump but i don't know how to check where they came from

tribal quarry
quiet ice
sullen marlin
teal venture
#

Does the Vault API work for everyone else? Ive been trying to figure out why when I add the dependencies its not working for me? Please tag reply

quiet ice
#

Yeah I was a bit unaware that the classloader can get GC'd too

sullen marlin
#

I'm sure the vault api works for thousands of people

#

what specifically is the issue

#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

worldly ingot
#

The pom.xml/build.gradle specifically

quiet ice
teal venture
#

Actually I think It might be all imports with dependencies maybe I have settings wrong

worldly ingot
tender shard
slender elbow
#

big words

teal venture
worldly ingot
quiet ice
worldly ingot
slender elbow
quiet ice
tender shard
#

after they bought it while it clearly said "1.16+"

quiet ice
#

That is very much akin to people asking me to support Java 5 in my projects

tender shard
#

yeah that message is totally fine. it's supposed to look like that!!

thick tundra
#

looks great, dont change anything about it.

teal venture
#

How do I send stuff as code in here?

chrome beacon
#

?paste

undone axleBOT
teal venture
worldly ingot
#

You're just missing the jitpack repo is all

#

Actually you're missing the Vault API dependency entirely :p

tender shard
#

what is that?

quiet ice
#

IDE-genned code?

worldly ingot
#
<repositories>
    <!-- ... -->
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <!-- ... -->
    <dependency>
        <groupId>com.github.MilkBowl</groupId>
        <artifactId>VaultAPI</artifactId>
        <version>1.7</version>
        <scope>provided</scope>
    </dependency>
</dependencies>
#

That's really all you're missing

tender shard
#

my favorite class in bukkit is SuspiciousStewMeta

worldly ingot
#

Mine is ChatPaginator because nobody knows it exists

#

Kind of irrelevant in age of components, but still handy 🙂

tender shard
#

i think I've seen it once

#

also Conversation API 🥲

#

nobody uses it

worldly ingot
#

Honestly? The conversation API was such a weird add by the Bukkit team

#

It's one of those things that should have just been a plugin

tender shard
#

i find it handy lol

river oracle
#

What is conversation api

young knoll
#

Api for asking players for text input in chat

river oracle
#

Why is that a bukkit api feature lol

#

Wack

sage patio
tender shard
#

ughm idk about viewing it in a browser or anything. and yeah VisualVM is free

sage patio
#

thanks

tender shard
#

could probably use x11 forwarding to run it on the server but view it at home

sage patio
#

well wish there is a tutorial for that

quiet ice
#

there probably is, X11 is decently ancient enough for that

sage patio
#

lol, great then

quiet ice
#

but I have never done it myself - I just happen to know that that is a thing

tender shard
#

it should be quite easy

sage patio
#

well this is the same thing which the ssh applications do right?

#

like bitvise or termius

#

i guess i can do this too

quiet ice
teal venture
tender shard
#

did you click the "reload maven project" button?

teal venture
sage patio
#

top right

#

in maven tab

tender shard
#

Sometimes, people suggest you to change something in your pom.xml, and then IntelliJ starts to complain: That is totally normal. You simply have to click the “maven reload button” in IntelliJ. Maven will then continue to download the required dependency/plugin, if it’s available. After a few seconds, everything should be fine. You can find the.....

teal venture
teal venture
tender shard
#

np lol

quiet ice
#

Context: I am writing a buildsystem in the style of maven (or gradle, I haven't made my mind up yet how the buildscript will look like)

I might have asked this question once before, but what do you think a good system looks like to transfer a collection of files between tasks?
Ideally "virtual" files should be supported, which means that at first glance I should avoid java.io.File and java.nio.file.Path - however is this actually a valid concern considering that you can just register your own filesystem under nio?
The other concern is whether I should use a different model for task inputs and outputs. As of now I use the same "SourceSet" approach, but I feel like that makes little sense - on the other hand I cannot think of anything else. This "SourceSet" approach basically has a bunch of logical file providers that can in turn provide a bunch of logical files. However, I feel as if that approach breaks apart once duplicate files come into play (META-INF/MANIFEST.MF comes to mind here) and allowing for duplicate files to be returned would cause a lot of headache at first glance.
The other concern is whether the task inputs and outputs should be named - I feel like yes but that would make initialization a bit harder.

#

I suppose I could copy the way gradle deals with this, but I have little experience with that system as I never quite understood it and just sneakingly bypassed it when developing my own tasks. So I am a bit torn on this matter

mellow edge
#

spigot 1.8 teams don't have a function setColor(ChatColor)

chrome beacon
#

ok

mellow edge
#

because I can basically do it with command on client side I assume I can send a raw packet to set it

#

(scoreboard teams opions <team> color <color>)

young knoll
#

Maybe

#

Idk old version is old

warped jasper
#

Good evening, I would like to ensure that when a player dies, it updates a scoreboard with the number of players alive. Problem, I can't set this up, can someone help me? Im coding in 1.8.

mellow edge
warped jasper
mellow edge
#

just and just for pvp

#

at least api

#

is so outdated

worthy yarrow
#

Having an issue with creeperheal(2) not detecting explosions by cannons plugin, creeperheal(2) is written in kotlin so I'm not sure how to fix that... would anyone know of a way to go about this issue?
I've been reading through creeperheal2 a bit and it's looking like

@EventHandler(priority = EventPriority.HIGH)
    fun onBlockExplodeEvent(event: BlockExplodeEvent) {
//        plugin.debugLogger("A block explosion has happened! ${event.block.toString()}")
        if (plugin.settings.types.allowExplosionBlock(/*event.block.blockData.material*/)) {
            if (event.block.location.world?.let { plugin.settings.worldList.allowWorld(it.name) } == true) {
                this.plugin.createNewExplosion(event.blockList())
            }
        }
    }```
this the only thing handling block explode event
https://github.com/pmdevita/CreeperHeal2/blob/master/src/main/kotlin/net/pdevita/creeperheal2/core/ExplosionManager.kt
this is the explosions manager class as well... It sucks I don't know kotlin haha

https://github.com/DerPavlov/Cannons/tree/master/src/main/java/at/pavlov/cannons/event

this would be the event package for cannons, specifically talking about the projectileImpactEvent
GitHub

Spigot plugin to automatically patch creeper holes and more - pmdevita/CreeperHeal2

GitHub

Fire block based Cannons in Minecraft. Contribute to DerPavlov/Cannons development by creating an account on GitHub.

#

I'm thinking the issue could be that cannons is using custom "projectiles" for cannonballs so perhaps that is why creeperheal2 won't detect the explosions? Please ping me if you have any ideas

peak depot
#

how to check if a map with name x allready exists without acctually loading it

young knoll
#

Like a world?

hollow beacon
#

any public api that serves images of minecraft blocks

#

so

/api/grass_block would return an image of a grass block

worldly ingot
#

The only one I can really think of is https://mcasset.cloud but I don't think it's really an "api" so to speak

#

I don't know if you can access its textures programmatically

#

Or how fast it will be. It downloads the textures from Mojang

#

I would personally opt to download texture assets from Mojang and store them locally to browse instead. This is probably the safest legal way to do it anyways

hollow beacon
#

i did find this however : https://minecraftitemids.com/item/64/respawn_anchor.png

worldly ingot
#

I would still exercise caution pulling textures and assets from a third party website 😅

young knoll
#

I believe mcasset.cloud uses some GitHub api

#

Without being logged in you get 60 requests per something

#

60 per hour, lol

kindred solar
#

Guys, I am building a plugin and I wanted that plugin to consume an API(with Post and Get requests) and I made some stuff successfully but it is being really hard to mantain that endpoint calls, I am using okhttp3, I don't know if it is the best way, if you know any best way tell me, but could you please tell me if there is any straight way to do this? I went through a lot of github repos but couldn't find anything.

#

(I build myself that API)

remote swallow
#

javalin is decent

kindred solar
#

Is it good for minecraft plugins? I am asking this because ChatGPT told me that get and post requests in minecraft can be hard to manage due to the way that a minecraft plugin runs.

remote swallow
#

iirc it runs everything async so it should be fine

kindred solar
#

Sorry about this but last question, I need to know this, for example, when a user joins I am making a get request to get their roles and permissions, am I able to say someway on the plugin "the user will wait until we get the data" or someway to handle that kind of stuff cuz I dont wanna ruin players experience neither server performance.

tender shard
#

does anyone know how to even "enable" an extension in vscode?

#

I downloaded the json extension and it just doesnt appear in the sidebar

young knoll
remote swallow
young knoll
#

You can block in the pre login event for up to 30 seconds

kindred solar
remote swallow
#

im going to make them wait 29 seconds then transfer to hypixel

tender shard
#

seems like extensions only work in "trusted" windows or sth

#

can I somehow tell it to allow certain extensions in all windows without having to "trust" it all the time?

kindred solar
#

whats the purpose of it? If its just make the json file prettier I recommend "prettier"

river oracle
tender shard
#

with extension

#

without

kindred solar
#

did you restarted the vscode?

river oracle
#

Why tf is it not pretified

tender shard
remote swallow
#

file > preferences > settings > security > trust something change to new window

#

or one of them i think

tender shard
#

I don't want it to trust all things automatically, Ijust want to allow this extension for untrusted files/windows

worthy yarrow
kindred solar
tender shard
#

hm how annoying...

#

guess I'll stick to XCode then

kindred solar
#

I am not 100% sure just making a kinda of a guess

orchid gazelle
#
    minecraft:textures/atlas/blocks.png:minecraft:textures/custom/m4a1.png```
any ideas?
tender shard
#

ugh and the json thing also shows up for every non-json file... is it normal that extensions are taht weird in vscode?

river oracle
#

Seems like a shit plugin

tender shard
#

hm it was the best rated one in the list

kindred solar
remote swallow
#

prittier is prob better

river oracle
orchid gazelle
#

wtf is this

remote swallow
#

i can spell that corretly

river oracle
#

Use notepad++ or brackets

orchid gazelle
#

this is supposed to work

remote swallow
#

n++ is prob better

#

there was a plugin for formatting json

#

1 line to multiple

kindred solar
remote swallow
#

yes

wintry lynx
#

I gotta question for texture and data pack nerds.
Is there any NBT that I can use in a Spawner block to give it a custom texture?

remote swallow
#

if your on 1.19.4 or higher use an inflated item display with custom model data prob

tender shard
#

anyway I got it to work by editing a settings.json manually (wtf)

orchid gazelle
#

yes, yes, yes, yes, yes, yes, yes, yes, yes, yes, yes

kindred solar
#

but I mean, I read json files in vscode but I dont use any extension but prettier to do so, I just prettify the file and read it manually

tender shard
tender shard
#

ah shift+alt+f

#

yeah I guess that works too, thx

kindred solar
#

well yeah, i was looking for the default keybind cuz I binded my vscode to the jetbrains keys but glad u got it

rare rover
#

why is jitpack saying this?:

 Gradle 'publishToMavenLocal' task not found. Please add the 'maven-publish' or 'maven' plugin.
 See the documentation and examples: https://docs.jitpack.io```
here's my `build.gradle`: https://pastes.dev/8kUK2VHwUk
#

jitpack hella annoying

kindred solar
#

I tried to log it and it is correctly formated but I just dont want the "<" neither the ">"

kindred solar
remote swallow
#

if anything its because of the afterEvaluate

rare rover
rare rover
remote swallow
#

is this mutli module

tender shard
rare rover
rare rover
tender shard
#
publishing {
    publications {
        create<MavenPublication>("maven") {
            from(components["java"])
        }
    }
}

just do it like this

#

without afterEvaluate

rare rover
#

I've tried that and same thing

#

Let me try again if

#

Ig

potent atlas
#

when josh is done I have an error

remote swallow
#

send it here anyway or make a thread

potent atlas
#

well it's "java.lang.IllegalArgumentException: The NamespacedKey key cannot be null" and I really just want a clue to help me debug it

undone axleBOT
tender shard
#

don't do that

potent atlas
#

I did? ._.

#

lemme paste

remote swallow
#

EventOnClickLlamaVariant.java line 53

potent atlas
#

so what you mean is when I set a value for the key, I'm putting in something that is null?

remote swallow
potent atlas
#

p.getPersistentDataContainer().set(llamavariantkey, PersistentDataType.STRING, variant.toString());

rare rover
remote swallow
rare rover
#

oop i might know why

#

hopefully it works now

potent atlas
#

public static NamespacedKey llamavariantkey;
llamavariantkey = new NamespacedKey(plugin, "LLAMAVARIANT");

remote swallow
#

?paste the whole class rq

undone axleBOT
potent atlas
#

ok

rare rover
#

there we go

#

thank you

potent atlas
#

I need to restore a backup or something, everything is doing it... I'll come back if I can't figure it out

glad prawn
#

for wat

violet delta
#

Build path specifies execution environment JavaSE-1.7. There are no JREs installed in the workspace that are strictly compatible with this environment.
The compiler compliance specified is 1.7 but a JRE 17 is used
what do i do im a noob

drowsy helm
#

what are you attemping to do?

violet delta
#

thats my "problems" when first generating a mavin project in vs code

drowsy helm
#

vs code pog

tender shard
#

Vscode with maven seems like a pain

drowsy helm
#

there should be a setting to change jre

river oracle
tender shard
#

Can jdk 17 even compile for java 7?

river oracle
#

IMHO its better than maven with intellij

river oracle
tender shard
#

Or is java 8 the lowest possible?

river oracle
#

I think 8 is lowest

tender shard
#

Specify <maven.compiler.target> and <maven.compiler.source> in properties of pom.xml and set both to 8

quaint mantle
#

how woudl i draw an image on a map

violet delta
#

ok so what jdk should i have and what is it saying i need to do?

#

oh in the pom

tender shard
#

?paste your current pom.xml file

undone axleBOT
tender shard
quaint mantle
#

i dunno

violet delta
quaint mantle
river oracle
#

And bytes and stuff

quaint mantle
#

how would i get a mapcanvas tho

river oracle
#

MapMeta iirc

#

Otherwise its likely a bukkit methond

tender shard
#

extend MapRenderer

#

it has a method render(...)

#

there you get an instance of MapCanvas

#

then you add the renderer to your map with MapMeta#addRenderer

tender shard
quaint mantle
#

i wanna draw an image on a map

tender shard
#

and you don't know whether that image is already existing as file or sth?

quaint mantle
#

its stored in a var

tender shard
#

what type does it have?

quaint mantle
#

Image img = ...

quaint mantle
#

yeah

#

i got that far

#

but i dont know how to get a map canvas

tender shard
#

I already told you

quaint mantle
#

ohhh

#

ok thanks

violet delta
tender shard
#

You don't create a MapCanvas yourself, you just use the one that gets passed to your MapRenderer instance

tender shard
#

in both things

violet delta
#

sheeeeeeeeeesh 🌊

tender shard
#

you can also set it to 17 if you don't need to support MC 1.17 and older

hasty obsidian
#

hi guys

#

so

#

i know alot of popular servers have their own minecraft domain the same as their website

#

but how? my dns collides it cant be the same

river oracle
#

anyone know if these two methods in Slot do anything server sided

    public boolean isHighlightable() {
        return true;
    }

    public boolean isFake() {
        return false;
    }```
#

I can't find any uses in craftbukkit but that doesn't include the entirety of NMS

echo basalt
#

prob client stuff

river oracle
#

Slot is for Containers

#

?paste

undone axleBOT
river oracle
#

not for spigot ofc I guarentee this shit would never get merged

kind hatch
#

Ooo, quick craft, what's that do?

river oracle
#

I don't fully understand it, but I decided I should prob expose it anyways

#

honestly no clue what it does its not used in CB

#

wish I had raw NMS source somewhere

#

should prob update Mache

#

@kind hatch stuff like this

    public ItemStack quickMoveStack(EntityHuman entityhuman, int i) {
        ItemStack itemstack = ItemStack.EMPTY;
        Slot slot = (Slot) this.slots.get(i);

        if (slot != null && slot.hasItem()) {
            ItemStack itemstack1 = slot.getItem();

            itemstack = itemstack1.copy();
            if (i == 2) {
                if (!this.moveItemStackTo(itemstack1, 3, 39, true)) {
                    return ItemStack.EMPTY;
                }

                slot.onQuickCraft(itemstack1, itemstack);
                this.playTradeSound();
            } else if (i != 0 && i != 1) {
#

excerpt from ContainerMerchant

kind hatch
#

Ngl, still can't tell what that does, even with that context. lol

young knoll
#

I think it controls what slot an item goes into when you shift click

kind hatch
#

Wouldn't that just be the next available one if not already matching an existing item?

river oracle
young knoll
#

For most inventories yes

#

You just showed quick move stack

#

Isn’t that what we are talking about

river oracle
#

nah we're talking about onQuickCraft

#
        int var2 = var1.getCount() - var0.getCount();
        if (var2 > 0) {
            this.onQuickCraft(var1, var2);
        }```
#

this is the default implementation

young knoll
#

Ah

river oracle
#

than an implementation from ResultSlot

    protected void onQuickCraft(ItemStack var0, int var1) {
        this.removeCount += var1;
        this.checkTakeAchievements(var0);
    }
young knoll
#

I think when you villager trade it can automatically refill the trade slots with items

#

So probably that

river oracle
#

I think it can be used on any crafting Menu

#

considering SlotResult inherits and uses it

young knoll
#

Ah wait wait

#

Is it the recipe book quick craft option?

river oracle
#

Probably if I had to guess

young knoll
#

Also smh I don’t see quickMoveStack in your api

river oracle
#

that was just SlotBehavior

#

MenuBehavior is next

river oracle
#

@young knoll do you think this impl would work with CraftItemStack I'm not exactly sure how these things work still lol

    @Override
    public void onTake(final Player player, final ItemStack item) {
        final CraftItemStack craftStack = CraftItemStack.asCraftMirror(item);
        if (behavior.onTake(player.getBukkitEntity(), craftStack)) {
            super.onTake(player, CraftItemStack.asNMSCopy(craftStack));
        }
    }```
young knoll
#

Hmm?

river oracle
#

I mean CraftItemStack is mutable right?

#

ig that's all I'm asking

young knoll
#

Yes

#

The mirror will automagically mirror all changes to the NMS stack

young knoll
#

Yes

river oracle
#

so then I don't need to asNMSCopy at the end

#

nice

river oracle
#

@young knoll are you happy now

public interface SceneBehavior {

    /**
     * Handles quick move behavior. "Quick Move" entails shift clicking items or using num keys
     *
     * @param context the context of the scene
     * @param player  the player who executed the quick move
     * @param item    the item quick moved, which could be air
     * @param rawSlot the raw slot number
     * @return the moved stack
     */
    @NotNull
    default QuickMoveResult quickMoveStack(@NotNull final SceneContext context, @NotNull final HumanEntity player, @NotNull final ItemStack item, final int rawSlot) {
        return new QuickMoveResult(item, true);
    }

    /**
     * Determines behaviors for certain slots
     *
     * @return a map of slot behaviors
     */
    default Map<Integer, SlotBehavior> getBehaviors() {
        return Map.of();
    }

    /**
     * Tracks the result of a QuickMove
     *
     * @param item     the item
     * @param delegate whether to delegate to the default chest quick movement
     */
    record QuickMoveResult(@NotNull ItemStack item, boolean delegate) {
    }
}```
young knoll
#

Maybe

wild roost
#

guys, how do I compile a plugin at the intelij? I just transferred my project data to my other computer, I downloaded a MC development plugin for intelij, and then opened my project from the folder. So, not it says "the file in the editor is not runnable" .

#

btw, I can't create a new Minecraft project

kind hatch
#

Depends on what you use to compile.

#

You use maven? gradle? artifacts?

wild roost
kind hatch
#

Use the maven controls on the right hand side of IntelliJ to compile.

#

package is what you'll want to use to get the jar file.

wild roost
#

thanks!

river oracle
#

?paste

undone axleBOT
river oracle
#

my most cursed creation

wintry lynx
#

What does DamageCause.CONTACT mean?

young knoll
#

Cactus

#

Probably some other things too

wintry lynx
#

OHHHHHH

young knoll
#

“Damage caused when an entity contacts a block such as a Cactus, Dripstone (Stalagmite) or Berry Bush.”

#

Yay javadocs

wintry lynx
#

:I

wintry lynx
#

So I cant find a way to decern the difference between these. Since its a Type I cant really check the origin. So I cant check if Cactus caused it, berry bush, etc

young knoll
#

EntityDamageByBlockEvent

#

Includes the block

wintry lynx
#

Oh neat. Didnt even know that was a method

#

Im guessing that also includes magma blocks

#

Which is weird cuz for some reason they arent counted as contact damage

young knoll
#

I think they have their own type

#

Hot floor or something

wintry lynx
#

Yea but it gets called in block damage

young knoll
#

Yes

#

It’s a block

wintry lynx
#

And technically they are both block damages so I was just saying it seems pointless to make two types

young knoll
#

Damage type has nothing to do with what event is called

#

It’s based off the internal damage types

wintry lynx
#

Yea I know

young knoll
#

Which control the death message among other things

wintry lynx
#

Im saying It seems pointless to have hot floor if contact damage exists since the hot floor is a contact damage in itself

young knoll
#

Yes but it’s a different damage type according to Mojang

#

And has a different death message

wintry lynx
#

So do cactus and berry bushes but their called the same type. Guess its just mojang being weird

young knoll
#

I thought they had the same message

wintry lynx
#

Nope, stalactites have their own too

#

Or stalagmites

#

And hot floor is pretty much a mix of cactus and stalagmite damage.

young knoll
#

¯_(ツ)_/¯

wintry lynx
#

¯_(ツ)_/¯

young knoll
#

Don’t think we have the damage PR merged yet

wintry lynx
young knoll
#

Maybe?

wintry lynx
#

I guess you wouldnt know off the top of your head lol

#

ignore me asking

young knoll
#

I checked

#

It does

wintry lynx
#

Oh noice

worthy star
#

what is the best way to store custom data for players, like vaults & levels system

drowsy helm
#

ideally a database

wraith dragon
#

Is it a good idea to have a class named Pos to store jusr x y z yaw pitch values instead of location?

drowsy helm
#

just use a Vector

spring stag
#

What event would I use for right clicking to activate?

drowsy helm
#

if you want it irrespective of world

#

PlayerInteractEvent

worthy star
drowsy helm
#

what

#

like in memory?

worthy star
#

yes

drowsy helm
#

a variable..?

#

idk what you're asking, it doesnt make sense

agile anvil
# worthy star what is the best way to store custom data for players, like vaults & levels syst...

Save the data as PDC (persistent data container), it will be automatically saved by the server. https://hub.spigotmc.org/javadocs/spigot/org/bukkit/persistence/PersistentDataContainer.html

The you can get the data from it and display on a scoreboard.

Attention: It's server side. It won't work if you have multiple servers -> Then you would need to use a database instead of PDC

worthy star
#

ight thanks

spring stag
#

How would I get the x/y/z of where the player is looking at?

agile anvil
#

Do you mean the composants of the Direction Vector ?

#

Get the Location of the player then Location#getDirection

spring stag
#

I'm trying to create an event that teleports the player where they are looking at

#

Would that be the best way of going about that?