#help-archived

1 messages · Page 222 of 1

median terrace
#

i dont even have that many outlets lool

#

or money xD

lone fog
#

I mean it should say which plugin is throwing the npe

frigid ember
#

anyone know a good anticheat like spartan but free

#

becus i am poor boi

#

does anyone know how to help with missing item display names on items? I heard it might be due to some weird new limit thingy

lone fog
#

What

balmy sentinel
#

I believe most good anticheats are paid resources due to the amount of effort that goes into coding them.

stoic shell
#

it does

#

I looked at the code and it looks fine

#

but the team is null for some reason

lone fog
#

I mean you can try the good old one at a time method

stoic shell
#

bruh

unkempt ridge
ionic hound
#

@balmy sentinel what would i do to put an item in it?

balmy sentinel
#

inv.setItem(int, ItemStack);

ionic hound
#

would that be an item id or name

balmy sentinel
#

wdym?

ionic hound
#

inv.setItem(1, Stone);

balmy sentinel
hybrid path
#

config.yml:

Example:
  Example1: Value1
  Example2: Value2

How can I read this as a Map<String, String> in Java through FileConfiguration?

subtle blade
#

ConfigurationSection#getValues()

#

(JavaPlugin#getConfig() is an instance of ConfigurationSection too)

hybrid path
#

Ok thanks I'll try

#

But #getValues only takes a boolean deep as a argument

#

Can I not get the subtree of a variable I already know?

#

Actually nvm

subtle blade
#

Yeah, just getConfigurationSection(String) to get that Example path, call on it getValues()

hybrid path
#

Oh

frigid ember
#

so... since we're on the topic of itemstack.. does anyone know anything about this apparent display name limitation in 1.16.1 spigot

subtle blade
#

getConfig().getConfigurationSection("Example").getValues(false) for instance would give you a Map<String, Object> of Example1:Value1 and Example2:Value2

ionic hound
#

@balmy sentinel I am confused i have only made simple commands in java could you send me what i need to make an item show up in the gui?

balmy sentinel
#
ItemStack stack = new ItemStack(Material.STONE);
inv.setItem(0, stack);
lone fog
#

*You don’t actually need meta for enchants

balmy sentinel
#

oh fuck right. You can change ItemFlags with meta

ionic hound
#

I am struggling to find the ones for lure and name @balmy sentinel

balmy sentinel
#

wdym like you’re trying to create lures and a name for it?

ionic hound
#

yes

lone fog
#

Check the meta documentation

#

they are pretty clear

balmy sentinel
#

^^^

ionic hound
#

is it meda block data

lone fog
#

One has lore the other has name

#

No

#

ItemMeta

#

We linked it

ionic hound
#

void setDisplayName();

balmy sentinel
#

yessir

#

meta.setDisplayName(“My CustomName”);

ionic hound
#

i have imported org.bukkit.inventory.meta.ItemMeta but it still does not like meta.setDisplayName(“My CustomName”);

balmy sentinel
#

?paste

worldly heathBOT
balmy sentinel
#

what does your method look like rn

ionic hound
balmy sentinel
#

because you never created an ItemMeta object

#

also after you change the ItemMeta it won't take effect until you #setItemMeta(meta)

ionic hound
#

like this?
ItemMeta meta = new ItemMeta() {
@Override
public void setDisplayName(String name) {
}

balmy sentinel
#

no

#

ItemMeta meta = stack.getItemMeta();

tough kraken
lone fog
#

It should

tough kraken
#

alright

ionic hound
#

@balmy sentinel I have this But it is not renaming a the stone
ItemStack stack = new ItemStack(Material.STONE);
ItemMeta meta = stack.getItemMeta();
meta.setDisplayName(ChatColor.RED + "Hi");
inv.setItem(0, stack);

lone fog
#

also after you change the ItemMeta it won't take effect until you #setItemMeta(meta)

balmy sentinel
#

lol thanks Coll

frigid ember
#

Why is it that all of these plugins that have been submitted after mine have been approved, but mine has not? It's been driving me crazy waiting.

tough kraken
#
stack.setItemMeta(meta);```
lone fog
#

Is yours bigger

#

Also it depends on who is chosen to review it probably

frigid ember
#

Mine is ~40kb not including Hikari, so I doubt that would be bigger than a Factions plugin

balmy sentinel
#

If you obfuscated your code it'll take longer to approve as well.

frigid ember
#

Nah, chose not to obfuscate for the first release for that exact reason lol

lone fog
#

Probably not anyway

#

They only allow name obfuscation

frigid ember
#

Yeah, planning to go OS at some point anyways

ionic hound
#

why does my setlure not work

#

meta.setLore("Hi");

balmy sentinel
#

?paste

worldly heathBOT
lone fog
#

It needs a list

#

Not a string

balmy sentinel
ionic hound
#

show me

#

sorry caps lock

balmy sentinel
#

create a list, add to that list, meta.setLore(listName);

#

add a ChatColor.RESET in there or something or else you'll get that ugly purple + italics lore.

lone fog
#

Or

#

Arrays.asList

tough kraken
#

why the hell doesnt my spawn prot. work?

looks right:

    @EventHandler
    public void blockPlace(BlockPlaceEvent event) {
        Location spawn = new Location(Bukkit.getWorld("world"), 1770.000, 68, -558.500);
        Location loc = event.getBlock().getLocation();
        if (spawn.distance(loc) < 30) {
            event.setCancelled(true);
        }
    }```
lone fog
#

Right world?

#

Register event?

balmy sentinel
#

IllegalArgumentException - for differing worlds add a check maybe.

lone fog
#

Also distanceSquared is faster

tough kraken
#

Right world?
@lone fog yes

#

Register event?
@lone fog yes

#

the event gets called... it stops at the cancel...

#

if (spawn.distance(loc) < 30) { is true, but it cant get cancelled...

lone fog
#

What

tough kraken
#

i dont get it... wtf

lone fog
#

I guess you can try a higher event priority

tough kraken
#

sending a message works... but cancelling the event doesnt...

lone fog
#

Maybe another plugin is un-cancelling it

tough kraken
#

there is no other plugin

#

now it works... WTF

lone fog
#

You’re welcome

#

Mind powers

tough kraken
#

i dont get it

#

i hate it

#

things doesnt work... without cause

balmy sentinel
#

sounds like developing tbh

tough kraken
#

i know but wtf

balmy sentinel
#

doesn't work 1 sec works the next

lone fog
balmy sentinel
#

thats the job description.

ionic hound
#

trying to pull a block out of my config. But it does not work my code is:
ItemStack stack = new ItemStack(Material.Reason_1_block);
String Reason_1_block = getConfig().getString("First_Reason_block");

#

@balmy sentinel

balmy sentinel
#

uhh I've never tried doing this before, but I don't think the way you're thinking about this will work logically speaking.

#

and you'll need to null check as well.

lone fog
#

Material.fromString

ionic hound
#

Does not work

plush nexus
#

ItemStack stack = new ItemStack(Material.valueOf(getConfig().getString("First_Reason_block")))

lone fog
#

Ah yeah it’s getMaterial

#

Not from string

#

Won’t throw an exception like value of

#

But you still need to null check

balmy sentinel
#

could just do a try and check for both IllegalArgumentException and NullPointerException.

lone fog
#

True but ehh

#

Best to avoid try catch as much as you can

balmy sentinel
#

I think the only time I ever use try/catch is with my database

lone fog
#

Can be useful with parseInt too

#

Although I think you can technically check it with regex

balmy sentinel
#

I usually have an UtilInteger class in big projects where I just do a check quickly

lone fog
#

Ah yeah you can also loop and check each char

ionic hound
#

@lone fog That did not work

balmy sentinel
#

"that did not work" doesn't really tell us anything. What are you trying to do, what errors are you getting, etc.

ionic hound
#

org.bukkit.command.CommandException: Unhandled exception executing command 'punish' in plugin Ban_Gui v1.0-SNAPSHOT
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.15.2.jar:git-Paper-350]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.15.2.jar:git-Paper-350]
at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchCommand(CraftServer.java:761) ~[patched_1.15.2.jar:git-Paper-350]
at net.minecraft.server.v1_15_R1.PlayerConnection.handleCommand(PlayerConnection.java:1861) ~[patched_1.15.2.jar:git-Paper-350]
at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1669) ~[patched_1.15.2.jar:git-Paper-350]
at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[patched_1.15.2.jar:git-Paper-350]
at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.15.2.jar:git-Paper-350] at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.15.2.jar:git-Paper-350]
at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18) ~[patched_1.15.2.jar:git-Paper-350]
at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.15.2.jar:git-Paper-350]
at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.15.2.jar:git-Paper-350]
at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.15.2.jar:git-Paper-350]
at net.minecraft.server.v1_15_R1.MinecraftServer.ba(MinecraftServer.java:1105) ~[patched_1.15.2.jar:git-Paper-350]
at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:1098) ~[patched_1.15.2.jar:git-Paper-350]
at

#

net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.15.2.jar:git-Paper-350]
at net.minecraft.server.v1_15_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1059) ~[patched_1.15.2.jar:git-Paper-350]
at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:974) ~[patched_1.15.2.jar:git-Paper-350]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]
Caused by: java.lang.IllegalArgumentException: No enum constant org.bukkit.Material.Material.stone
at java.lang.Enum.valueOf(Unknown Source) ~[?:1.8.0_251]
at org.bukkit.Material.valueOf(Material.java:85) ~[patched_1.15.2.jar:git-Paper-350]
at me.dash.pl.Pl.myInv(Pl.java:40) ~[?:?]
at me.dash.pl.Pl.onCommand(Pl.java:60) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.15.2.jar:git-Paper-350]
... 17 more

balmy sentinel
#

No enum constant org.bukkit.Material.Material.stone

lone fog
#

Upper case it

balmy sentinel
#

what does your config.yml look like @ionic hound ?

ionic hound
#

First_Reason_block: 'Stone'
First_Reason: 'Ping Spoofing'
First_Reason_lore: 'This fakes lag.'

balmy sentinel
#

capitalize it like Coll suggested.

ionic hound
#

still get this No enum constant org.bukkit.Material.Stone

lone fog
#

No

#

All uppercase

ionic hound
#

ow shit you have to do STONE not Stone

lone fog
#

String#toUpperCase

balmy sentinel
#

The string must match exactly an identifier used to declare an enum constant in this type.

hardy cedar
#

[19:33:11 WARN]: Event ServerConnectEvent(player=iiAhmedYT, target=BungeeServerInfo(name=lobby1, socketAddress=/0.0.0.0:25560, restricted=false), reason=PLUGIN, request=net.md_5.bungee.api.ServerConnectRequest@b400653, cancelled=false) took 326ms to process! im getting this error alot idk what is going on?

#

does it mean by a plugin

#

a spigot one

#

or a Bungee one

#

?

lofty meadow
#

Hello! Can I use a string data (in .yml file) to define an ItemStack type?

balmy sentinel
#

@lofty meadow if you’re talking about defining a Material then yes. If you read above you can figure out how it’s done.

lofty meadow
#

Ohh

lone fog
#

Itemstacks are serializable aren’t they? (If you need more than just a material)

lofty meadow
#

Yes, ok!

balmy sentinel
#

@hardy cedar I don’t know much about bungee so I can’t help you as to why you’re getting the warning, but that’s a warning not an error.

lofty meadow
#

What about enchants?

#

Enchantment.getByName("") is deprecated

lone fog
#

You can probably use .valueOf

lofty meadow
#

🤔

lone fog
#

Or you can serialize an entire item stack

lofty meadow
#

Ohh I don't know

#

You can probably use .valueOf
@lone fog Enchantment.valueOf("") ?

lofty meadow
#

Can you example me a bit?

lone fog
#

Enchantment.getByKey

#

Make a namespaced key from your plugin instance and the string in the config

#

Actually not your plugin instance

#

I assume it uses NamespacedKey.minecraft

lofty meadow
#

Is this right?

    NamespacedKey namespacedKey = new NamespacedKey(this.plugin, "PROTECTION_ENVIRONMENT");
    Enchantment enchantment = Enchantment.getByKey(namespacedKey);```
frigid ember
#

u would probably have to use minecraft instead of the plugin

#

dont quote me on that

lofty meadow
#

Ok!

lone fog
#

I assume it uses NamespacedKey.minecraft

ebon girder
#

when i put my start.bat file it doesnt turn into a terminal

frigid ember
#

hi

#

does anyone know any way around the weird spigot 1.16.1 item display name limiter?

lone fog
#

What limiter

raw arch
#

Is this not correct? Console says it's an unknown command ```

Bukkit.dispatchCommand(Bukkit.getServer().getConsoleSender(), "lpb user " + sender + " setprefix 10 " + args[0] + " ");

leaden coyote
#

Hi, so not sure if this is where I should be posting this but I need a plugin that will keep players from taking items out of there head slots. I am made a hat panel with command panels that allows you to add a hat to your head. It is a block. But players are able to duplicate blocks with this. Any way of preventing them from taking the block off there head? Anyone that can make a plugin or anyone know of a plugin like that?

solar spade
#

@marsh hawk and @wispy pewter thank you both for helping me a couple days ago. finally figured out my problem and it was just that the server version was too new for my old JDK. so i updated to JDK 14

balmy sentinel
#

@leaden coyote go on the forums and go under Services and Recruitment.

wispy pewter
#

Ahaha that happens

marsh hawk
#

No worries 🙂

buoyant path
#

!q test

pastel condor
#

Hi, so not sure if this is where I should be posting this but I need a plugin that will keep players from taking items out of there head slots. I am made a hat panel with command panels that allows you to add a hat to your head. It is a block. But players are able to duplicate blocks with this. Any way of preventing them from taking the block off there head? Anyone that can make a plugin or anyone know of a plugin like that?
@leaden coyote
You can cancel the event if they drag an item out of a slot: (in this case instead of canceling the off hand slot cancel the slot for the head)

buoyant path
#

where is that bot lol

pastel condor
#

Oh it’s on my test server xD

#

It loops through the spigot message history

leaden coyote
#

@pastel condor im not a coder...

pastel condor
#

Oh

#

There might be a plugin

#

Idk

leaden coyote
#

I was asking for a plugin.

#

xD

raw arch
#

How do I include args in a Console dispatchCommand?

marsh hawk
#

it's not a bot; it's just fierceeo typing really fast

pastel condor
#

😑

marsh hawk
#

how long did it take to make btw?

pastel condor
#

I mean if you want to see your yourself, I can send you the invite link.....

#

how long did it take to make btw?
@marsh hawk
Like a day

marsh hawk
#

oh nice

#

guessing you were just bored lol

pastel condor
#

Lol yeah

#

I’m going to collect data from some more servers and I’ll try to improve my question algorithm to get more revenant results

marsh hawk
#

is it actual machine learning or just matching search terms?

pastel condor
#

It just matches words

#

In the future if I have a big enough database I want to make it actually learn

marsh hawk
#

yeah that would be awesome

pastel condor
#

Yeah 🙂

marsh hawk
#

I've always wanted to start learning ML just don't have any relevant usecases

pastel condor
#

Lol

#

Well I mean if you want to help me, idk

#

Anyways

#

The bot hasn’t finished going through the spigot message history

#

It still has a long way to go

marsh hawk
#

how exactly are you caching all the data?

pastel condor
#

I’m using something called map db

#

It doesn’t load the map entirely on the disk

#

*ram disk

#

Which makes it really nice

marsh hawk
#

oh thats awesome

pastel condor
#

I’m storing it in question > answer

#

Where a question maps to an answer

marsh hawk
#

what are you querying? I assume most keyword matches?

pastel condor
#

Yes, I see how many words match in the query and in a question

#

Though when my database gets bigger I need to find a faster way

marsh hawk
#

Maybe partition into topic groups?

pastel condor
#

Hmm okay

#

Brb

#

I’ll be back in like 15 minutes

#

That might be a good idea though

pastel condor
#

back

marsh hawk
#

you reckon you'll open src the bot?

#

would love to check it out

pastel condor
#

I mean I could add you to the repo 🙂

marsh hawk
#

that would be awesome

pastel condor
#

whats your github username?

marsh hawk
#

Lickymoo

pastel condor
#

okay cool one sec

#

I kinda stuffed everything in to two classes which I really need to fix

#

but

#

anyways

marsh hawk
#

eh it works lol

pastel condor
#

okay just added you

frigid ember
#

How do i get to the spigot doc for 1.8.8 (yea i know the server is outdated af, but lots of servers are thanks to the combat update. Plz don't judge lol I'm just the developer)

Looking thru the docs I'm guessing most of the deprecated methods are pre-1.8 or pre-1.13 or whatever lol

viscid tundra
#

Is it possible to make a anti cheat using plugins?

sage summit
#

Whats a good land claiming plugin for survival servers?

rare prairie
#

plotsquared v5

proper cairn
#

What are some great open source plugins to learn from

ebon girder
#

do i need a start.bat for setting up a spigot server?

#

because once i had the spigot.jar in a folder i just ran it and accepted the eula

#

the start.bat never runs properly

#

it doesnt change into a .bat folder from a notebook folder

mellow wave
#

You probably saved it as start.bat.txt

ebon girder
#

how do i fix it?

grim halo
#

Change the ending from .txt to .bat?

mellow wave
#

We litterally told you how to fix it yesterday

frigid ember
#

i did that

#

but it didn't work

mellow wave
#

I can see the code is still there

#

Atleast in those links

grim halo
#

What exactly doesnt work?

mellow wave
#

What you need to do is delete InventoryMove and onInventoryClick

#

He has events to cancel item movements but he doesn't want them to be cancelled

#

That's the issue

bronze acorn
#

what's the issue

#

what do you mean move it

#

like move it to another slot?

mellow wave
#

"It's stuck in te 9th slot" I did read...

bronze acorn
#
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {

        if (event.getCurrentItem().isSimilar(netherStar)){
            event.setCancelled(true);
        }

    }
#

that's why my good sir

grim halo
#

"its stuck" implies that you want it to move. But i get your point.

bronze acorn
#

do a playerinteractevent

mellow wave
#

Alright fine

bronze acorn
#

if the item hashcode is equal to the netherstar item hashcode

mellow wave
#

I told you that yesterday too

bronze acorn
#

get the netherstarmenu

#

and run the openInventory method

mellow wave
#

^

grim halo
#

InventoryClickEvent -> if netherstar -> open GUI
PlayerInteractEvent -> if nether star in hand -> open GUI

mellow wave
#

Yeah if you just do that it will work

bronze acorn
#

next time instead of yelling and screaming no when we're trying to help, maybe actually remove the first bit

mellow wave
#

^

#

bruh why should we help you if you're rude

half marsh
#

i know this is probably very basic but i cant figure out how to get this to work

        if (!(new File(this.getDataFolder(), "monsters").exists())){
            this.saveResource("monsters", false);
        }

I'm just trying to save the folder "monsters" to my plugin directory, it works with all yml files but not folders, am I forgetting something to put in the path?

#

or do you have loop through every file in the folder and save every one individually

mellow wave
#

I don't think you can save a folder like that

bronze acorn
#

i think it'd be best to just create the folder probably manually then saving the resource? but you might just have to put a /

#

at the end

mellow wave
#

Try getting it's contents ^

bronze acorn
#

7smile7 big brains to the rescue 😎

half marsh
#

I was really hoping you could just save folders like that but i guess thats not the case lol

grim halo
#

So 2 things. new File(this.getDataFolder(), "monsters") is actually a flat File and not a folder
new File(this.getDataFolder() + File.separator + "monsters") will be a new folder
With the spigot API its not possible to save a complete folder. You can however traverse a jar file like every other file system.
If you give me a min ill show you how.

half marsh
#

that'd be really nice of you thank you

grim halo
#
  public void copyResourceDirectory(final JarFile source, final String path, final File target) throws IOException {
    final Enumeration<JarEntry> entries = source.entries();
    final String newPath = String.format("%s/", path);
    while (entries.hasMoreElements()) {
      final JarEntry entry = entries.nextElement();
      if (entry.getName().startsWith(newPath) && !entry.isDirectory()) {
        final File dest = new File(target, entry.getName().substring(newPath.length()));
        final File parent = dest.getParentFile();
        if (parent != null) {
          parent.mkdirs();
        }
        this.writeToFile(source.getInputStream(entry), dest);
      }
    }
  }

This will save a whole path from a jar to another file system (in your case just flat files)

#

You just need to write the writeToFile method

#

basically just a writeToFile(final InputStream input, final File target)

frigid ember
#

does someone here knownc

#

know c

grim halo
#
  private void writeToFile(final InputStream input, final File target) throws IOException {
    final OutputStream output = Files.newOutputStream(target.toPath());
    final byte[] buffer = new byte[ResourceCopy.BUFFER_SIZE];
    int length = input.read(buffer);
    while (length > 0) {
      output.write(buffer, 0, length);
      length = input.read(buffer);
    }
    input.close();
    output.close();
  }

This would be an example with a buffered reader -> outputstream

frigid ember
#

does someone here knownc
@frigid ember

#

plz

#

very urgen

#

t

half marsh
#

will this also work if the folder constains several subfolders with subfolders with those containing the files

mellow wave
#

Just ask here and we might answer

frigid ember
#
for ( i=0 ; i<4 ; i++){
        printf("Enter Number%d student's information:\n",i+1);
        printf("Enter name:");
        scanf("%c\n",s[i].name);
        printf("Enter Math Mark:");
        scanf("%d\n",&s[i].mathMarks);
        printf("Enter Science Mark:");
        scanf("%d\n",&s[i].scienceMarks);
        printf("Enter Art Mark:");
        scanf("%d\n",&s[i].artMarks);
    }
#

it messes up

#

sec

#

once we type the name

#

it spams the rest

grim halo
#

No this wont work with sub folders. You would need to add a recursion to the method.

half marsh
#

figured yeah

#

thank you very much though

frigid ember
#

we need the answe in 25 mins

#

pls

#

sorry not tryna be rude

#

but

#

its quite urgent

#

almost like a now or never

mellow wave
#

You need to wait before sending the next scan

frigid ember
#

ok

mellow wave
#

Wait until someone enters a value

frigid ember
#

how do we wait

#

i thought so

#

i thought by default

#

it waits

#

like in cpp

#

it pauses the main thread

#

not so in c?

#

how do we pause the main thread until someone enters a value

grim halo
#

It should wait with scanf

frigid ember
#

ok ive fixed it

#
#include <stdio.h>
struct student {
    char firstName[50];
    int mathMarks, scienceMarks, artMarks, roll;
} s[10];

int main() {
    int i;
    printf("Enter information of students:\n");

    // storing information
    for (i = 0; i < 5; ++i) {
        s[i].roll = i + 1;
        printf("\nEnter Number%d student's information,\n", s[i].roll);
        printf("Enter first name: ");
        scanf("%s", s[i].firstName);
        printf("Enter Math marks: ");
        scanf("%d", &s[i].mathMarks);
                printf("Enter Science marks: ");
        scanf("%d", &s[i].scienceMarks);
                printf("Enter Art marks: ");
        scanf("%d", &s[i].artMarks);
            }

}
grim halo
#
#include <stdio.h>
#include <stdlib.h>

struct student {
    char name[20];
    int marks[3];
} students[4];

typedef struct student Student;

int main() {

  for (int i = 0; i < 3; i++) {
    printf("Enter student name\n");
    scanf("%s\n", students[i].name);
    printf("Enter math mark\n");
    scanf("%d\n", &students[i].marks[0]);
    printf("Enter math mark\n");
    scanf("%d\n", &students[i].marks[1]);
    printf("Enter math mark\n");
    scanf("%d\n", &students[i].marks[2]);
  }

}

@frigid ember

timber prairie
#

Someone knows a plugin with fly feature and supporting MySQL?
(Example: Hypixel, because why not)

frigid ember
#

ok i am back with the nether star thing,

    public void NetherGUI(PlayerInteractEvent event) {
        if (event.getItem() != null && event.getItem().isSimilar(netherStar)) {
            new NetherStarMenu().openInventory(event.getPlayer());
        }
        
    }```
i did this but when i click the nether star it doesn't work...

@frigid ember @mellow wave

#

do i actually have to make a trigger for it to open

#

because i think i only defined it

mellow wave
#

How do you click it? in inventory

grim halo
#
#include <stdio.h>
#include <stdlib.h>

struct student {
    char name[20];
    int marks[3];
} students[4];

typedef struct student Student;

void sumStudent(Student *st, int *dest) {
  int sum = 0;
  for (int i = 0; i < 4; i++) {
    sum += st->marks[i];
  }
  *dest = sum;
}

int main() {

  for (int i = 0; i < 4; i++) {
    printf("Enter student name\n");
    scanf("%s", students[i].name);
    printf("Enter math mark\n");
    scanf("%d", &students[i].marks[0]);
    printf("Enter math mark\n");
    scanf("%d", &students[i].marks[1]);
    printf("Enter math mark\n");
    scanf("%d", &students[i].marks[2]);
  }

  int sum;
  
  for (int i = 0; i < 4; i++) {
    sumStudent(&students[i], &sum);
    printf("Student nr %d sum: %d", i, sum);
  }

}

@frigid ember

mellow wave
#

Because if that's what you did it's wrong

#

kk

frigid ember
#

thanks

#

@grim halo

#

idk why it doesn't open

mellow wave
#

Probably won't

ebon girder
#

@grim halo didnt work

grim halo
#

What didnt work?

tiny dagger
#

can someone tell me why that c student needs help with basic syntax 👀

ebon girder
#

i cant turn a start.bat

frigid ember
#

@grim halo

#

it didnt work

mellow wave
#

Save it as a bat file not a txt file

frigid ember
#
#include <stdio.h>
#include <stdlib.h>

struct student {
    char name[20];
    int marks[3];
} students[4];

typedef struct student Student;

void sumStudent(Student *st, int *dest) {
  int sum = 0;
  for (int i = 0; i < 4; i++) {
    sum += st->marks[i];
  }
  *dest = sum;
}

int main() {

  for (int i = 0; i < 4; i++) {
    printf("Enter student name\n");
    scanf("%s\n", students[i].name);
    printf("Enter math mark\n");
    scanf("%d\n", &students[i].marks[0]);
    printf("Enter math mark\n");
    scanf("%d\n", &students[i].marks[1]);
    printf("Enter math mark\n");
    scanf("%d\n", &students[i].marks[2]);
  }

  int sum;
  
  for (int i = 0; i < 4; i++) {
    sumStudent(&students[i], &sum);
    printf("Student nr %d sum: %d", i, sum);
  }

}

@frigid ember

#

the calcs are wrong

grim halo
#

als you can remove \n from the scanf

mellow wave
#

It's recommended for them to be there since it's in a loop

#

Just found that while doing some research earlier

light stone
mellow wave
ebon girder
#

how do i do that

#

i renamed it start.bat

#

it doesnt work

light stone
#

"Serious Spigot and BungeeCord Help"

grim halo
#
#include <stdio.h>
#include <stdlib.h>

struct student {
    char name[20];
    int marks[3];
} students[4];

typedef struct student Student;

int sumStudent(Student *st) {
  int sum = 0;
  for (int i = 0; i < 4; i++) {
    sum += st->marks[i];
  }
  return sum;
}

int main() {

  for (int i = 0; i < 4; i++) {
    printf("Enter student name\n");
    scanf("%s", students[i].name);
    printf("Enter math mark\n");
    scanf("%d", &students[i].marks[0]);
    printf("Enter ir mark\n");
    scanf("%d", &students[i].marks[1]);
    printf("Enter kon mark\n");
    scanf("%d", &students[i].marks[2]);
  }

  for (int i = 0; i < 4; i++) {
    printf("Student nr %d sum: %d\n", i, sumStudent(&students[i]));
  }

}

This is easier

#

Not that fancy pointer thing but it works

ebon girder
#

to get a start.bat i moved it from a diff pc

#

i got this message now:

#

whenever i try to run

bronze acorn
#

cant see that file

ebon girder
#

the ss?

bronze acorn
#

yes

#

can't view it

mellow wave
#

Yeah you sent an invalid link

#

(Protected)

half badge
#

Bro just use Rust

grim halo
#

Oh! and in sumStudent its i < 3 not i < 4

light stone
#

Rust is too immature to be used.

bronze acorn
#

in the directory of the start.bat

#

there is no file named spigot.jar

mellow wave
#

^

ebon girder
#

also why cant i just create a start.bat

#

is it because its not finding a spigot.jar?

bronze acorn
#

uh

ebon girder
#

so it has nothing to actually start?

bronze acorn
#

looks like u have file extensions off

#

so im guessing

ebon girder
#

oh good lord

bronze acorn
#

it's actually called spigot.jar.jar

#

xd

ebon girder
#

how do i enable it ;-;

mellow wave
#

yeah I think so

ebon girder
#

fml

bronze acorn
#

just remove the ".jar" at the end

#

or one of them

#

actually yeah

#

oh here

#

uh

light stone
#

Typh00n, a few things: 1. You can use 4G in place of "4000M" 2. 4 GiB is 4096 MiB, not 4000

bronze acorn
#

at the top of file explorer

#

click view

#

and enable file name extensions

#

or smthn

#

that thing on the right

#

and then u'll prolly see ur jar file is named spigot.jar.jar

ebon girder
#

uh\

bronze acorn
#

?

ebon girder
#

well it worked

#

i think

bronze acorn
#

did u rename the spigot jar file?

ebon girder
#

yah

#

just spigot now

bronze acorn
#

did u turn on file name extensions

#

or no

ebon girder
#

i cant

bronze acorn
#

oh

#

ok

ebon girder
#

i didsnt get option to

bronze acorn
#

yeah then just rename it to spigot

#

and it should normally start up

#

also change "4000M" to either 4096M or 4G

light stone
#

Why are you forcing him to change it?

bronze acorn
#

sorry i didnt mean to sound forceful but i'm just saying

#

lol

#

because 4000M is 3.9 gigs

proud sierra
#

and?

light stone
#

Actually, 4000 MB is 4 GB.

bronze acorn
#

idk why you both are attacking me i just suggested it

#

lol

proud sierra
#

"attacking"?

light stone
#

No, I want him to change it as well, but 4000 MB is 4 GB.

ebon girder
#

is a gigabyte 4000 or 4096

#

sorry

bronze acorn
#

you literally

#
AsdewToday at 2:34 AM
Typh00n, a few things: 1. You can use 4G in place of "4000M" 2. 4 GiB is 4096 MiB, not 4000```
#

homie

#

lol

ebon girder
#

1000 or 1024

#

oh

#

its 6 am man gimme a breka

#

break

bronze acorn
#

not directed at you typh

#

was talking to asdew

#

sorry i don't say GiB i say GB lol because im ✨ uncultured ✨

grim halo
#

doesnt matter use 4000M of 4G its almost the same

light stone
#

It's good practice to use 4 GiB, not 4000 M(i)B.

grim halo
#

btw GiB and GB are totally different units

bronze acorn
#

yeah uh i just reference them the same because i am ✨uncultured ✨

proud sierra
#

MB = * 1000
MiB = * 1024

light stone
#

KiB, MiB, GiB, and TiB are the ones that should always be used.

ebon girder
#

i can run my servers using the spigot.jar folder

bronze acorn
#

wym typh

ebon girder
#

by executing it right? i did that before i fixed the issue with the .jar

bronze acorn
#

wdym

ebon girder
#

it would work fine and id just connect by localhost

bronze acorn
#

run multiple servers using the same spigot.jar?

grim halo
#

You cant execute a folder

ebon girder
#

nonono

bronze acorn
#

yeah uh you can't execute a folder xd

proud sierra
#

just double click the jar (if it is a testserver on windows)

bronze acorn
#

like smile says

ebon girder
#

ye

#

i can run the .jar and the server'll startup

#

thats normal id assume?

bronze acorn
#

yes

ebon girder
#

could i copy/paste the spigot.jar onto my desktop so i can just run it at the click of a button

grim halo
#

you could double click the jar if you have a version that supports the vanilla gui.
Most versions (i think prior to 1.15) ar headless

bronze acorn
#

but if i recall it doesnt start with a gui?

frigid ember
#

i don't want to be annoying but why does this not work:

    public void NetherGUI(PlayerInteractEvent event) {
        if (event.getItem() != null && event.getItem().isSimilar(netherStar)) {
            new NetherStarMenu().openInventory(event.getPlayer());
        }
        
    }
   ``` whenever i click on the nether star @grim halo
ebon girder
#

it does

bronze acorn
#

oh

ebon girder
#

the start.bat doesnt

proud sierra
#

double click the jar -> console opens up

ebon girder
#

its just console ye

bronze acorn
#

@frigid ember elaborate

frigid ember
#

so

bronze acorn
#

@ebon girder i believe then the files of the server will be spread out on your desktop

#

unless you have it inside of a folder

ebon girder
#

i do

bronze acorn
#

if u just double click it

#

yeah then you're good lol

ebon girder
#

i had my blastercraft server

grim halo
#

@frigid ember add a sysout on the top of the method and one inside your if clause. Then tell us how far the code went

proud sierra
#

@frigid ember rename your method
also, you registered the event?

ebon girder
#

and the .jar as a copy on my desktop

frigid ember
#

sysout?

bronze acorn
#

wouldn't make a copy of it i think it's a shortcut i believe?

#

you mean

#

System.out.println() palm i believe

frigid ember
#

o

#

i am confused

bronze acorn
#

or a Bukkit.getLogger().info("");

#

System.out.println("");

frigid ember
#

why tho?

bronze acorn
#

and in betwen those quotes

#

write a message

proud sierra
#

they want you to print a line at the top of the method
to check if the method gets invoked

bronze acorn
#

to see if the event fires

proud sierra
#

its the "spigot way of debugging"

frigid ember
#

hm

#

ok

bronze acorn
#

on top to see if the event fires, in the if statement to see if the if statement is true

#

also

#

uh

#

i believe event.getItem()

#

returns Item ?

#

or does it return ItemStack

#

i forget

proud sierra
#

no

#

ItemStack

frigid ember
#

so just above the NetherGUI?

bronze acorn
#

oh itemstack

#

yeah

#

what palm

proud sierra
#

The ItemStack in the hand

bronze acorn
#

in the event

frigid ember
#

so lie this

#
    public void NetherGUI(PlayerInteractEvent event) {
        if (event.getItem() != null && event.getItem().isSimilar(netherStar)) {
            System.out.println("working");
            new NetherStarMenu().openInventory(event.getPlayer());
        }
        
    }```
bronze acorn
#
    @EventHandler
    public void NetherGUI(PlayerInteractEvent event) {
        System.out.println("PlayerInteractEvent fired");
        if (event.getItem() != null && event.getItem().isSimilar(netherStar)) {
           System.out.println("Item is not null and the item is the netherstar");
            new NetherStarMenu().openInventory(event.getPlayer());
        }
        
    }```
frigid ember
#

mk

proud sierra
#

you registered the event

bronze acorn
#

also you're making a new instance of netherstarmenu everytime lol

frigid ember
#

o

#

shall i do final instead of new

bronze acorn
#

that's not the best way to do it because then bukkit creates an inventory for it everytime

#

i think that's how it works?

#

store the class as a variable, perhaps in your main class

#

`

#

one sec

#

in your main class at the top before the @Overrides and stuff

#
public NetherStarMenu netherStarMenu;```
#

or you can do private

#

whichever

#

in onEnable

#

netherStarMenu = new NetherStarMenu();

copper star
#

I need help

#

I have this error

frigid ember
#

done

#

tah

bronze acorn
#

and then make a method or you can just reference the variable when your reference the class

copper star
#
public void onPlayerAnvil(InventoryClickEvent event){
        List<String> wordblacklist = getConfig().getStringList("BannedWords");
        for (String blacklistedItem : wordblacklist) {
            if (event.getCurrentItem().getItemMeta().getDisplayName().toLowerCase().contains(blacklistedItem)) {
                int blockedcount = getConfig().getInt("WordsBlocked") + 1;
                getConfig().set("WordsBlocked", blockedcount);
                saveConfig();
                
                String hiddenword = blacklistedItem.toLowerCase().substring(0, 1);
                if (getConfig().getBoolean("HideFirstLetter") == true) {
                    hiddenword = getConfig().getString("HideWordSymbol");
                }
                for (int n = blacklistedItem.length() - 1; n > 0; --n) {
                    hiddenword = String.valueOf(hiddenword) + getConfig().getString("HideWordSymbol");
                }
                
                String oldmessage = event.getCurrentItem().getItemMeta().getDisplayName().toLowerCase();
                event.getCurrentItem().getItemMeta().setDisplayName(oldmessage.replaceAll(blacklistedItem.toLowerCase(), hiddenword));
            }
        }
            
    }```
#

I have error on this code

bronze acorn
#
public NetherStarMenu getNetherStarMenu()
{
       return netherStarMenu;
}```
#

what's the error welcome?

copper star
bronze acorn
#

what's line 148

copper star
#

if (event.getCurrentItem().getItemMeta().getDisplayName().toLowerCase().contains(blacklistedItem)) {

mellow wave
#

You're using a null value on 148

bronze acorn
#

the item meta is null

#

check if the item is not null

copper star
#

ok

bronze acorn
#

and if the item's item meta is not null

mellow wave
#

Also check if the item has a display name

bronze acorn
#

on top of everything

#

ye

copper star
#

ok

frigid ember
#
public NetherStarMenu getNetherStarMenu()
{
       return netherStarMenu;
}```

@bronze acorn you mean

    {
           return getNetherStarMenu();
    }```
copper star
#

if (e.getCurrentItem().getItemMeta().hasDisplayName()) {

bronze acorn
#
if (event.getCurrentItem() == null)
{
        return;
}

if (event.getCurrentItem().getItemMeta() == null)
{
        return;
}
if (event.getCurrentItem().getItemMeta().getDisplayName().isEmpty())
{
        return;
}```
#

i believe

#

no @frigid ember

frigid ember
#

hm

#

it's red tho

bronze acorn
#

because you're just calling the method

#

inside of the method

#

you just made

frigid ember
#

mk?

bronze acorn
#

return netherStarMenu;

frigid ember
#

it says

#

"netherStarMenu cannot be resolved to a variable"

bronze acorn
#

show me your class

#

paste it into a hastebin

#

your main class

timber prairie
#

Someone knows a plugin with fly feature and supporting MySQL?
(Example: Hypixel, because why not)

bronze acorn
#

now that one

copper star
#

Now this error occurs on line 157

bronze acorn
#

not*

#

your main class

#

the one that extends JavaPlugin

copper star
#

if (event.getCurrentItem().getItemMeta().getDisplayName().isEmpty())

frigid ember
bronze acorn
#

welcome

copper star
#

That line has an error

bronze acorn
#

it might be getDisplayname

#

idk

mellow wave
#

Check if it has a display name

#

That's not how you do it

copper star
#

.hasDisplayName()

mellow wave
#

use hasDisplayName();

bronze acorn
#

oh there's a hasdisplayname oop-

#

lol

#

also palm if you're using intellij right click the main class and click reformat code

#

make sure everything is unchecked

#

and click ok

#

lol

copper star
#

Now error occurs on line 161

#

if (event.getCurrentItem().getItemMeta().getDisplayName().toLowerCase().contains(blacklistedItem)) {

frigid ember
#

i have a small question. What is the best way to integrate a update checker on first release? As far as i know i need to provide a file when creating a resource.

copper star
#

The null check didnt work

#

It still executes that line

bronze acorn
#

did you

#

recompile

#

the plugin

copper star
#

yes

bronze acorn
#

oh

#

what's the error

copper star
#

Same

bronze acorn
#

it's most likely blacklistedItem

#

what's blacklistedItem

copper star
#
        for (String blacklistedItem : wordblacklist) {```
bronze acorn
#

in your config

#

on your server

copper star
#

yes

bronze acorn
#

is there a stringlist

#

specifically called

#

BannedWords

#

all it'd be is

#
BannedWords:
  - word1
  - word2
frigid ember
#

tah any solution

bronze acorn
#

something like that

#

palm

frigid ember
#

?

#

i have a small question. What is the best way to integrate a update checker on first release? As far as i know i need to provide a file when creating a resource.(Bearbeitet)

bronze acorn
#

copy that ode

#

code

#

all of it

#

and paste it in

frigid ember
#

ya

#

ok

bronze acorn
#

and remove that getNetherStarMenu() from your listener

#

sorry piston never made an auto updater 😭

frigid ember
#

oh ok

#

its really easy

#

its just a class

#

and creating a object in the main class

#

done now can i change it to final?

bronze acorn
#

idk why you'd want it as a final

#

lol

frigid ember
#

nvm

#

ok

bronze acorn
#

not everythng has to be final

#

xd

#

all g

mellow wave
#

Just submit and update I guess

#

That's easier Pistonmaster

frigid ember
#

i am making a player stats to web plugin. Which category should it be?

mellow wave
#

Is it a plugin or standalone

copper star
#

An error occurs if it doesnt have a name

frigid ember
#

a plugin

bronze acorn
#

i'd say use spring boot for that

copper star
#

.hasDisplayName() doesnt work

frigid ember
#

which hosts a webserver

bronze acorn
#

look into spring boot

mellow wave
#

@copper star Send your updated code

copper star
#

ok

frigid ember
#

no i use sun net httpsserver

#

it all works

bronze acorn
#

you'd need to make a Get request for it

frigid ember
#

i just wanna know what resource category it is

copper star
bronze acorn
#

oh idk

copper star
#

This is the code

bronze acorn
#

sorry

#

welcome

#

uh

#

add an exclamation mark

#

on that line

copper star
#

ok

#

on hasdisplayname

frigid ember
#

its just a handler

bronze acorn
#
            if (!event.getCurrentItem().getItemMeta().hasDisplayName())
            {
                    return;
            }```
naive goblet
#

DRY

frigid ember
#

which parses the query

#

and displays stuff

#

Misc?

mellow wave
#

You're making it cancel if it has a display name

#

Not if it doesn't have one

frigid ember
#

no

#

the oposite

#

because of the !

copper star
#

Ok the error is gone

mellow wave
#

He didn't have ! Pistonmaster

frigid ember
#

um

mellow wave
#

taahanis told him to add it

frigid ember
#

ah ok

#

sry

naive goblet
#

Please welcome, have consistent indentations

copper star
#

The word is not getting filtered

frigid ember
#

was out of context

mellow wave
#

And did the debugg message send

naive goblet
#

Script?

copper star
#

Why is the name of the item not getting filtered

frigid ember
#

lemme check rn

naive goblet
#

Methods start with non capitalized characters palm

frigid ember
#
> [12:07:31 INFO]: PlayerInteractEvent fired
> [12:07:31 INFO]: PlayerInteractEvent fired
> [12:07:31 INFO]: PlayerInteractEvent fired```
naive goblet
#

And you’re doing some very weird logic

mellow wave
#

Also you do know that you will make all capitalized characters lowercase Welcome

naive goblet
#

Use hasItem instead of null checking it

copper star
#

I logged it and it works

#

event.getCurrentItem().getItemMeta().setDisplayName(oldmessage.replaceAll(blacklistedItem.toLowerCase(), hiddenword));

#

This line doesnt work

naive goblet
#

Welcome what are you doing?

frigid ember
#

so if(event.hasItem(netherStar) { }

copper star
#

Making item names filter

naive goblet
#

Please make references instead of invoking getItemMeta 4 times in a row

mellow wave
#

Yeah that code is a mess

naive goblet
#

No palm

frigid ember
#

oof

naive goblet
#

PlayerInteractEvent#hasItem checks if an item is involved

frigid ember
#

oh

#

hm

bronze acorn
#

palm

#

because

#

you gotta uh

#

do

#

i believe

frigid ember
#

so if (event.getItem() != hasItem() && event.getItem().isSimilar(netherStar)) ?

bronze acorn
#

no ur fine

#

reference ur class

frigid ember
#

:_:

bronze acorn
#

main class

naive goblet
#

Wth palm, does creating a GUI with 6 slots work?

frigid ember
#

idk

bronze acorn
#

and call the getNetherStatMenu

mellow wave
#

It doesn't

bronze acorn
#

Star

frigid ember
#

i thought that meant 6 rows

naive goblet
#

That’s obviously inconsistent

#

6*9

#

Then

frigid ember
#

o

bronze acorn
#

inventories can only be multiples of 9 up to 54

#

but each slots number is one less ex. the first slot in a gui is 0

naive goblet
#

Unless you have your own fork and made everything up to work with 6 slots don’t use 6 👌

frigid ember
#

can it be because of that?

naive goblet
#

Pretty much I’d say

mellow wave
#

Interessting mod I would use that

naive goblet
#

Lol

bronze acorn
#

also because ur making a new reference to the class still

#

call ur plugins class and reference getNetherStarMenu()

orchid badger
bronze acorn
#

Material.AIR prolly ?

orchid badger
#

oh

mellow wave
#

Yeah

#

Air

orchid badger
#

Air for the win lol

frigid ember
#

how do i call it?

copper star
#

Item name now filters

bronze acorn
#

whats ur main class name

copper star
#

thx for help

frigid ember
#

Main

#

wait

bronze acorn
#

Main.getPlugin(Main.class).getNetherStarMenu().openInventory(player);

frigid ember
#

would it be

#

yeah that

naive goblet
#

Palm he means that you should have 1 menu instance stored in your main and then you call it from there so you don’t create a new one every other time

frigid ember
#

hm

naive goblet
#

And don’t use that

frigid ember
#

mk

naive goblet
#

Go for dependency injection

bronze acorn
#

yeah its not recommended

frigid ember
#

would a static main work?

naive goblet
#

Wym

bronze acorn
#

a static variable that references ur main class is fine

frigid ember
#

ok

bronze acorn
#

i usually do a private static variable

frigid ember
#
    public void NetherGUI(PlayerInteractEvent event, Player player) {
        System.out.println("PlayerInteractEvent fired");
        if (event.getItem() != null && event.getItem().isSimilar(netherStar)) {
           System.out.println("Item is not null and the item is the netherstar");
           Main.getPlugin(Main.class).getNetherStarMenu().openInventory(player);
        }
        
    }``` so is this okay?
naive goblet
#

Static is often not needed

bronze acorn
#

and then make a method like get()

naive goblet
#

But can save memory

bronze acorn
#

that is public static

#

yes palm

frigid ember
#

hm

naive goblet
#

Jesus

frigid ember
#

why would i need a getter?

naive goblet
#

Don’t use Plugin.getPlugin(Class<? Extends JavaPlugin >)

#

Use dependency injection

mellow wave
#

^

frigid ember
#

my IDE just allows me to directly use the variable

#

without a getter

bronze acorn
#

i just gave him an example its 3:17 am lol i didnt want to go thru that much

naive goblet
#

Use getters and setters because it gives you more control and flexibility of your own logic

frigid ember
#

Use dependency injection
@naive goblet why is the other one worse?

#

so what do i need to do now to make the gui open

bronze acorn
#

its not a recommended like

#

habit

#

piston

#

interact with your item.. lol

frigid ember
#

no work

bronze acorn
#

it just doesnt work whats the error

naive goblet
#

Well the getPlugin method is allowed and is probably in worst case scenario not that slower but the issue is that many people make a static singleton just because they need it which isn’t really why you should use one.

frigid ember
#

here are errors

#

i think

#

ah ok

#

so the people would start to completely centralize?

naive goblet
#

Looks like Skript

#

Wait wth why do you have Skript or something like that as a dependency?

frigid ember
#

idk my friend uses it

naive goblet
#

He disgusts me

frigid ember
#

amirite

#

it might be to do with this possibly

@EventHandler
    public void onInventoryClick(final InventoryClickEvent event) {
        if (event.getInventory() != inv) return;
        
        event.setCancelled(true);
        
        final ItemStack clickedItem = event.getCurrentItem();
        
        if (clickedItem == null || clickedItem.getType() == Material.AIR) return;
        
        final Player p = (Player) event.getWhoClicked();
        
        p.sendMessage("bruh bruh 69 " + event.getRawSlot());
        
    }``` it's in the netherStarMenu class
#

@bronze acorn

naive goblet
#

inv?

bronze acorn
#

no uh thats not it

naive goblet
#

What’s the value of that

bronze acorn
#

where is skript being used in ur plugin

frigid ember
#

no where

#

any ideas why it doesn't open?

bronze acorn
#

did you ever change the amount of slots

#

to 9 or whatever

frigid ember
#

yeah

#

to 54

bronze acorn
#

it has to be 9, 18, 27, 36, 45, or 54

#

ah

#

uh

frigid ember
#

inv = Bukkit.createInventory(null, 54, "Skyblock Menu");

bronze acorn
#

some dependency in ur plugin prolly using skript

#

what dependencies do you have

frigid ember
#

like

#

all i have is vault and skript

#

@bronze acorn

bronze acorn
#

remove skript lol

#

idk why u would need it for a skyblock plugin

frigid ember
#

no

#

i can't

#

he skripted something big

naive goblet
#

Man

#

Lol

frigid ember
#

he said it's "big"

bronze acorn
#

then add skript to ur plugins folder ig

frigid ember
#

it's there

#

do u have any idea why it doesn't work

rigid nacelle
#

Well the getPlugin method is allowed and is probably in worst case scenario not that slower but the issue is that many people make a static singleton just because they need it which isn’t really why you should use one.
@naive goblet We on about one's main class?

naive goblet
#

Yes?

frigid ember
#

:/

naive goblet
#

Palm wait, can you send your classes again?

rigid nacelle
#

Well.. ITO spigot, they're not real singletons.

naive goblet
#

Obviously?

#

What’s exactly your point zed?

rigid nacelle
#

You comment on singletons.

#

static singleton

naive goblet
#

That’s right

#

It doesn’t open the gui?

frigid ember
#

yeah

#

it doesn't

rigid nacelle
#

What issue are you having, palm?

naive goblet
#

Oh Wait

#

Why does your eventhandler for the interact event have 2 params

#

You can Get the player from the event

#

Try removing the second parameter

#

Looks exceptionally suspicious

#

event.getPlayer()

#

It sends both debugs?

pseudo crown
#

got a question, so bukkit inventories have to be multiples of 9 yes ? (up to 54)

rigid nacelle
#

Yes.

naive goblet
#

Did you even register?

rigid nacelle
#

So there's a stacktrace?

#

The exception thrown upon interacting - could you send it?

naive goblet
#

Send that error

pseudo crown
#

is there a way to create an inventory with 8 or 7 slots ?

naive goblet
#

You probably get some error which consists of dots and packages

#

Chriskool in spigot, no

rigid nacelle
#

A hopper perhaps?

pseudo crown
#

using nms could you ?

#

don't know what nms can do tbh.

naive goblet
#

Nope

rigid nacelle
#

I mean.. Hoppers has got 5 slots.

pseudo crown
#

a bit tragic they programmed it with multiples of 9

naive goblet
#

I mean you could make that work perhaps

#

But it wouldnt integrate nice with the end players

#

Makes sense

rigid nacelle
#

xx

naive goblet
#

Did you actually try out the new jar after changing the size?

#

Because it seems like spigot still thinks you’re trying to create that 6 inv slot menu

blazing burrow
#

@naive goblet adding from yesterday, do bukkit runnables only work with version 1.14.4 and below?

naive goblet
#

they work in all versions

mellow wave
#

They work ^

naive goblet
#

just that Consumer<BukkitTask> is preferrable

blazing burrow
#

OOf okay

#

but you did mention if i was making it pn 1.15.2 or up?

naive goblet
#

yeah I don't know exactly which version it was added but something like that.

pseudo crown
#

@naive goblet what is a Consumer class ?

#

fuck sake

naive goblet
#

@wraith thicket do you know when Consumer<BukkitTask> was added into the BukkitScheduler

#

it

#

s a functional interface

hot anvil
#

I sent mail message to unban spigotMC is this email active?

wraith thicket
#

I don't know

blazing burrow
#

@naive goblet so u reckon it would work better if i tried it on a 1.14 test server?

wraith thicket
hot anvil
#

I sent mail 3 day ago, i would love you to check this out please (:

#

Or talk here

mellow wave
#

Instead of asking us to spoon feed you all day please get a dev to make the plugin or watch a few java tutorials before starting with the spigot api

pseudo crown
#

also, you should learn how to read stacktraces palm it's very easy to do and it will do wonders when you're trying to figure out why your plugin isn't working.

rigid nacelle
#

I reckon it was added in 1.13.2. @naive goblet

naive goblet
#

oh well that's earlier than I thought

wraith thicket
#

Yes - it was between 1.13.1 and 1.13..2

frigid ember
#

when making a hashmap for unique inventories for this
static List<Player> playerList = new ArrayList<Player>();
for the List do i need to import java.ulil or java.awt

mellow wave
#

util

frigid ember
#

k

pseudo crown
#

wait should he be using static there ?

naive goblet
#

imagine not doing this List<T> list = new ArrayList<>();

#

necessarily its not needed

rigid nacelle
#

We must love Java 7 for that diamond operator.

#

@frigid ember What's the collection for btw?

frigid ember
#

?

naive goblet
#

I mean, Lists.newArrayList() was for that right?

rigid nacelle
#

Well, Lists is a part of Guava, no?

naive goblet
#

Yes iirc

rigid nacelle
#

Guava is actually really useful.

#

@frigid ember What is the list for?

frigid ember
#

to keep track of unique players

#

opening the menu

naive goblet
#

UUID :p

frigid ember
#

yep

#

static Map<UUID, Inventory> inventories = new HashMap<UUID, Inventory>();

naive goblet
#

wait

#

do you have a different menu for each player

frigid ember
#

no

#

it's the same inventory

#

but for every user that opens it it's going to be private for them

naive goblet
#

then why have a different inventory for each player?

#

but for every user that opens it it's going to be private for them
Does it show user based statistic?

frigid ember
#

yeah

naive goblet
#

that makes sense then I guess

rigid nacelle
#

to keep track of unique players
@frigid ember I'd definitely go for an identity hashset in that case.

frigid ember
#

hm

halcyon snow
#

Is that list just supposed to keep track of who has the inventory open?

naive goblet
#

List would allow duplicates

rigid nacelle
#

Apparently, hence my recommendation.

halcyon snow
frigid ember
#

i did this

#

what's hashset

naive goblet
#

and hash has a time complexity of O(1) iirc

#

in best case scenario

rigid nacelle
#

In your case, an identity hashset would work just fine and would be faster.

frigid ember
#

mk

naive goblet
#

Though I don't know if it's smart to keep an inventory for each player in a list or just create a new one when needed.

pseudo crown
#

hashset is just a hashmap yea ?

frigid ember
#

bruh i am confused

#

lmao

pseudo crown
#

like <uuid, inv> ?

rigid nacelle
#

@naive goblet I'd actually create a new instance of it when needed cause of the GC keeping clean ngl - might even be better.

naive goblet
#

yeah that's true, therefore he should go with a set most likely

frigid ember
#

shall i make a whole new class to store unique IDs

#

because i need to extend iterable

grim halo
#

If he has a static GUI then there should be only one instance in total.
If he needs per player GUIs then he should have one inventory per player (keep the instance)
And re-assemble it when the gui changes

naive goblet
#

negigible

frigid ember
#

hm

#

how would i do that?

grim halo
#

but i didnt follow the convo...

naive goblet
#

encapasulating?

frigid ember
#

eh

#

i hate encapsulating

naive goblet
#

smile well its just a mess anyways xd

#

why

frigid ember
#

idk

rigid nacelle
#

It's a part of OOP.

frigid ember
#

it's confusing

naive goblet
#

not really

rigid nacelle
#

I mean in general.. If they're immutable fields, encapsulation is.. uh..

grim halo
#

Encapsulating is just a big word for:
Make a new class with a new variable.
The variable is private and the methods that change the variable are public,

#

In simple terms

#

just a nitpick. immutable fields = final field
There are immutable datatypes. Encapsulating those can also be important

frigid ember
#

i need to make a variable for a unique viewer using getViewers() but idk where/how to store it

naive goblet
#

why you need that?

frigid ember
#

because i need to make a unique inventory for everyone

naive goblet
#

You only need the inventory instance in most scenarios

frigid ember
#

huh

#

ok

naive goblet
#

there is some exceptions why you'd go for an inventoryview but keep in mind an inventoryview is basically 2 encapsulated inventories

#

there is some additional logic to it

frigid ember
#

is this beginner stuff because idk what this all means

#

but yeah

grim halo
#

I mean... its not absolute beginner stuff but you should know the basics about the collection framework at least
So List Set and Map are pretty important to understand

frigid ember
#

hm

naive goblet
#

List is essentially an array which you can manipulate easier. Sets are Lists that is aimed to reduce duplicate elements. And Maps is a pair based datastructure where the K acts like a Set and the elements in the Set is used to access a value which is V.

frigid ember
#

ok

naive goblet
#

And an array is an object containing other objects or primitives