#help-development

1 messages ยท Page 313 of 1

sage dragon
#
    private boolean isInFieldOfVision(LivingEntity e1, LivingEntity e2) {
        Vector direction = e1.getEyeLocation().getDirection();

        RayTraceResult result = e1.getWorld().rayTraceEntities(e1.getEyeLocation().add(direction).add(direction), direction, 10, 2,
                (entity) -> entity.getUniqueId().toString().equalsIgnoreCase(e2.getUniqueId().toString()));

        if (result == null)
            return false;

        return result.getHitEntity() != null;
    }

Is there a more reliable method? It doesn't seem to work all the time

velvet chasm
#

Not entirely sure. For some reason the wrapPlayer only works on a local player

hybrid spoke
#

look up their docs then

#

should be documented

velvet chasm
#

I had a look couldn't find much about players

hybrid spoke
remote swallow
hybrid spoke
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

sage dragon
hybrid spoke
#

also why are you adding the direction to the eyelocation? twice?

sage dragon
hybrid spoke
#

just use the default one

sage dragon
hybrid spoke
#

to look at the hitbox yes

sage dragon
# hybrid spoke to look at the hitbox yes

Since e2 is an invisible enderman, this would be a little hard, because you can only see it's particle effects and eyes ๐Ÿค”

I'd prefer it to have a little leeway so e1 doesn't have to look directly at the enderman

velvet chasm
velvet chasm
#

cannot resolve method getapplicableregions(location)

tender shard
#

you need a RegionQuery

#

it's all in the docs

buoyant viper
#

also public ProtectedRegion onKill(PlayerDeathEvent event, player) what

tender shard
#

lol

golden turret
#

why is it throwing StackOverflowError?

echo basalt
#

PlayerNPC does that

#

NPCs with ProtocolLib are... special

#

I mean you just need to send like 2 or 3 packets

#

not really

#

With NMS, metadata packets are simple

#

with protocollib stuff gets a bit more complicated

#

I have an NMS guide on my server profile that shows you how to send packets using ProtocolLib

#

Or here's an example on how to spawn a client-sided armorstand

quaint mantle
#

uhh anyone knows how to work with guardianbeamapi?

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!

quaint mantle
#

right

#

they dont have 1

#

something like that

#

is it possible?

topaz cape
#

this doesnt send anything to the player

#

o.o

#

here's how i inject (i changed it to addAfter)

#

and it does inject

#

it just doesnt work?

#

it sends the "Netty injected successfully" on join

#

so there's no exceptions thrown right?

frank kettle
#

Nms changes on every major version right?

remote swallow
#

iirc it changes somethings on major but then some things can change on patch versions

frank kettle
#

Or is there a stable older version we can use as a native api-version of the plugin that suits till now?

topaz cape
#

you're always welcome to use reflections

remote swallow
#

if you just need the api, use the lowest version you want to support

frank kettle
#

I feel like every plugin using nms has to make code for every different versions ๐Ÿค”

remote swallow
#

they can

#

sometimes they can use reflection

frank kettle
remote swallow
#

it depends what they do

frank kettle
#

Well, if I want to make a plugin with my own holograms without using an api, and if the holograms are per player, then I would need nms and the code for it would change every major version ๐Ÿค” so I would need to have different projects but same code for different versions or somehow put everything into the same which I've never done before ๐Ÿค” does anyone know what this is called or a good thread on spigot explaining it?

remote swallow
#

you could use multi module stuff for that

#

check how jeff lib works

lilac dagger
#

how do i disable this warning?

eternal oxide
#

assign to a variable

#

or just ignore it

eternal night
#

or just disable the inspection for that method

tender shard
#

And obv check if it exists before

lilac dagger
#

i guess i could do that

tender shard
#

Or just ignore it

lilac dagger
#

i can't just ignore it

#

i see it

young nimbus
#

Hi all! I got a problem with my plugin, i got two configs, config.yml and cooldowns.yml. I wanted to add 2 new commands, but i think i messed up with smth. i get the error File cannot be null. These are my neccessary classes:
Main: https://hastebin.com/arezaqitik.java
1st Command: https://hastebin.com/ikepafotad.java
2nd Command: https://hastebin.com/sobekoduso.java (not completely done yet)
3rd Command: https://hastebin.com/qaviwefipa.swift
Cooldown: https://hastebin.com/cevepewofe.java
I would be very glad if someone could help me with this, i am a bit new in programming ๐Ÿ˜„

#

oh sorry for the spam ๐Ÿ˜ฌ

chrome beacon
remote swallow
#

^^

chrome beacon
#

on load is fired before on enable

lilac dagger
#

i disabled the inspection ๐Ÿ˜„

chrome beacon
#

?main

chrome beacon
#

^^

#

And why is the formatting so bad

#

?di

undone axleBOT
young nimbus
#

im sorry haha, i am very new and trying just to get the plugin to work

remote swallow
#

andt hose events in your main class wont work

#

you dont register them, you dont impl listener or have them annotated

chrome beacon
#

That looks like a copy pasted mess

remote swallow
#

and you shouldnt be using Minecraft logger

young nimbus
remote swallow
#

?learnjava first

undone axleBOT
young nimbus
remote swallow
#

use your own

chrome beacon
#

Every plugin has it's own logger

young nimbus
remote swallow
#

dont load the file in onLoad

chrome beacon
young nimbus
#

in onEnable?

remote swallow
#

that would probably work

young nimbus
#

okay, thanks

chrome beacon
#

?learnjava!

undone axleBOT
young nimbus
young nimbus
chrome beacon
#

Don't skip the learning java part

#

You need it

young nimbus
#

thanks for the info

young nimbus
remote swallow
#

FileConfiguration cooldownconfig = YamlConfiguration.loadConfiguration(cooldownFile);

#

line 97 of cooldowns clas

young nimbus
#

you know a way how to fix it?

chrome beacon
#

sigh We're not going to spoon feed you everything

#

If you do not want to take the time to learn how Java works hire someone

mighty mica
#

Good day all,
Could someone lend me a hand with my plugin?
Every time I start up the test server, I get a message saying that my plugin doesn't have valid plugin.yml.
It's in there, and I've tried putting it into various locations within the plugin to try and get it to work, but still nothing
In the plugin.yml I have;
main, name and version, the 3 required lines according to the spigot guide.
Anyone have any idea as to why this is?

eternal night
#

can you provide the entire error ?

chrome beacon
eternal night
#

the plugin.yml should be at the root of your jar file (check if it is)

young nimbus
#

"everything" huh, didnt know that figuring out how to not making it null completely is everything, and how could i fix this quick if i would start learn java now

#

Dont be so rude to someone new tf

#

just needed a quick tip on that and you are blowin all up

mighty mica
# eternal night can you provide the entire error ?

[15:40:56 ERROR]: Could not load 'plugins\Emoticons1.0.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:154) ~[Spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [Spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugins(CraftServer.java:292) [Spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:198) [Spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [Spigot.jar:git-Spigot-db6de12-18fbb24]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_351]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 6 more

mighty mica
#

I've been working on the plugin this morning, it was working fine last evening, so I'm not sure what could've changed or went wrong..

chrome beacon
#

I haven used Eclipse in over 4 years so shrug

#

Try adding the yml directly if that's possible

mighty mica
#

What do you mean?

chrome beacon
#

In the export menu

#

can you specify files to include

#

if so specify the plugin.yml

mighty mica
#

See, it doesn't show in the selection menu, but nor does the config.yml, but I know both are there and get exported correctly as it's in the .jar itself

#

If I open the jar with Winrar, they're there

chrome beacon
#

ah it's named plugins.yml

#

It should be plugin.yml

mighty mica
#

Yep... it's.. it's working now...

weak bear
#

Do you know why the function addDefault don't work ?

mighty mica
#

Genuinely don't know when I renamed it from plugin.yml to plugins.yml.. Like it worked yesterday and I only worked on the code xd

mighty mica
weak bear
#

I just use it but when I reload the config.yml don't want save it

#
        System.out.println("cbon");
        this.saveConfig();
        this.saveDefaultConfig();
        this.getConfig().options().copyDefaults(true);```
#

That's dont write in my config file

mighty mica
#

So, you want to use your config.yml, but when you reload the config, you don't want to save it? Just, reload it?

#

"Close it without saving" and "open it" back up in your code?

undone axleBOT
weak bear
#

Thank you but that don't work

#

Do you have idea that dont work

primal goblet
#

Hey! i have a map reset every 20 minutes, but the reset map have to teleport all the players to the new map
and my server can have like 80 players in one game so when the teleport happens the server lagged very hard and stopped for 30 seconds then the server back normal
how can i fix it? and is that normal or i'm overthinking?

chrome beacon
orchid gazelle
#

hello. I would like to ask how I can get the rotation of a player's body when just having the rotation of the normal location?

tawdry parcel
#

hey, i want to stop the vines from growing, my code:

package com.koner.konerutils;

import org.bukkit.Material;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockGrowEvent;

public class NoVinesGrowing implements Listener {
    public void onVinesGrow(BlockGrowEvent event) {
        if (event.getBlock().getType() == Material.VINE) {
            event.setCancelled(true);
        }
    }
}
``````java
package com.koner.konerutils;

import com.koner.konerutils.chat.ChatFormat;
import com.koner.konerutils.nickname.NicknameCommand;
import com.koner.konerutils.npc.NPCInteract;
import com.koner.konerutils.ranks.RankCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class Main extends JavaPlugin {
    @Override
    public void onEnable() {
        getCommand("nickname").setExecutor(new NicknameCommand());
        getCommand("rank").setExecutor(new RankCommand());
        getServer().getPluginManager().registerEvents(new ChatFormat(), this);
        getServer().getPluginManager().registerEvents(new NoVinesGrowing(), this);
        getServer().getPluginManager().registerEvents(new NPCInteract(), this);
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}
```but for some reason, the vines are still growing? Why?
tender shard
#

you didnt add EventHandler

tardy delta
#

@EventHandler

tender shard
#

also it might be BlockGrowEvent instead of BlockSpreadEvent

tawdry parcel
tawdry parcel
tender shard
#

ugh then the other way around

tawdry parcel
#

oh okay i'll try that too

tender shard
#

it's BlockSpreadEvent

remote swallow
#

do i need to use async chat on monitor to set the format?

tawdry parcel
tender shard
remote swallow
#

Bukkit.broadcast prob

tawdry parcel
#

oh thank you

tender shard
#
    @EventHandler
    public void onSpread(BlockSpreadEvent event) {
        if(event.getNewState().getType() == Material.VINE) {
            Bukkit.broadcastMessage("BlockSpreadEvent @ " + event.getNewState().getLocation());
        }
    }
tender shard
#

just use NORMAL

#

or HIGHEST

remote swallow
#

you say

#

smh

tender shard
#

yes that's because we wrote ALL plugins ourselves, and already had something running on highest

remote swallow
#

ah

tender shard
#

it's shit

#

don't do it

#

use highest

remote swallow
#

for some reason its adding the message twice

#

ill add the highest stuff rq

tawdry parcel
#

When I use .setDisplayName() the name becomes italic, how can I fix this?

package com.koner.konerutils.npc;
import net.citizensnpcs.api.event.NPCRightClickEvent;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

public class NPCInteract implements Listener {
    @EventHandler
    public void click(NPCRightClickEvent event) {
        Player player = event.getClicker();
        Inventory inventory = Bukkit.createInventory(null, 3*9, "Select Map");

        if (event.getNPC().getName().equals("knockbackffa")) {
            ItemStack islandMap = new ItemStack(Material.OAK_SAPLING);
            ItemMeta islandMapMeta = islandMap.getItemMeta();

            islandMapMeta.setDisplayName("Island");
            islandMap.setItemMeta(islandMapMeta);

            inventory.setItem(13, islandMap);
        }

        player.openInventory(inventory);
    }
}
remote swallow
#

ChatColor.RESET + "name"

tawdry parcel
#

and ยงr as a color code?

tender shard
#

ChatColor.RESET is ยงr

tawdry parcel
#

thank you :D

tender shard
#

btw @remote swallow you're going to use adventure for the gradients right?

#

because the other plugin used &x&f&f&0&0&0&0 notation

remote swallow
#
private static LegacyComponentSerializer LEGACY_SERIALIZER = LegacyComponentSerializer.builder().character('&').hexCharacter('#').hexColors().useUnusualXRepeatedCharacterHexFormat().build();

    public static String format(String toTranslate) {
        return ChatColor.translateAlternateColorCodes('&', LEGACY_SERIALIZER.serialize(MiniMessage.miniMessage().deserialize(toTranslate)));
    }
tender shard
#

it provides a CallBack of Future or sth

#

or you can directly use teleportAsync

primal goblet
tender shard
#
PaperLib.teleportAsync(myPlayer, targetLocation)
#

HOWEEEVER

#

the async stuff will only work on Paper. On Spigot, it falls back to sync chunk loading

primal goblet
tender shard
#

is that a server software?

primal goblet
#

yep

tender shard
#

then no clue

primal goblet
#

i will get mute if i give you the link?

tender shard
#

no

primal goblet
#

thats it

#

i'm gonna ask them of this

tender shard
#

i dont really see any information there lol

remote swallow
#

found that

primal goblet
#

oh there's async chunk loader

tender shard
#

you should be able to use CompletableFuture<Chunk> getChunkAtAsynchronously(Location location, AsyncPriority priority)

#

e.g.

#

!verify

undone axleBOT
#

Usage: !verify <forums username>

tender shard
#

read the rules

undone axleBOT
tender shard
remote swallow
#

register the command

tender shard
#

it should be not red even for non-existing commands? o0

#

that makes little sense

remote swallow
#

you would have to register all commands

tender shard
#

i doubt that it's possible since the command list is client side

#

and how did you make this show up in blue?

#

IIRC 1.8 didnt even have proper tab complete so that's probably the reason why it "works" on 1.8

river oracle
#

1.8 :(

#

1.8's tab complete is complete and utter shit

tender shard
#

just like everything else in that version

#

1.8 was the best version - until 1.9 came out

river oracle
#

lmao

remote swallow
river oracle
#

๐Ÿ’€

eternal night
#

Damn you javadoc creation

river oracle
#

look at viaversions code

#

there you go

tender shard
#

it is, but not for 8 year old versions

river oracle
#

problem solved

tender shard
#

yeah like new features, new mobs, better world generation, more structures and items and blocks, ...

remote swallow
river oracle
remote swallow
#

amazing team

#

theres like 40 of them

tender shard
eternal night
#

The kyori team ?

remote swallow
#

theres like 15 or somethgin

tender shard
eternal night
#

How many do you think have perms to manage the domain

tawdry parcel
#

Hey, I want to put some stuff in a json file, but I don't know how (read comment)

package com.koner.konerutils.ranks;

import com.google.gson.Gson;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

import java.io.FileWriter;

public class RankCommand implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        Player player = (Player) sender;
        Gson gson = new Gson();
        try {
            gson.toJson(123456789, new FileWriter("/konerutils/ranks.json"));
            // Output should be {["uuid": "data", "uuid": "data"]}, instead of 123456789, I think that I somehow need to use classes for that?

        } catch(Exception exception) {
            exception.printStackTrace();
        }
        return true;
    }
}
eternal night
#

And that is java

tender shard
#

even if that'd be the case, what's the problem with a few tiny files?

eternal night
#

Iirc known javadoc bug

remote swallow
eternal night
#

Aha

remote swallow
#

lynx go ping mini

#

i require the kyori docs

eternal night
#

He does not have perms either I believe

tender shard
eternal night
#

Spigot compiles API to java 8

#

That's why lol

remote swallow
#

i thought mini is lead kyori

eternal night
#

No lol

remote swallow
#

is kyori lead in paper discord

tardy delta
eternal night
#

They have been notified XD just wait

remote swallow
#

smh

#

what if i need the docs

eternal night
#

Compile them yourself

#

Idk

remote swallow
#

that takes effort

#

and the funny this is that they worked earlier

river oracle
eternal night
#

Well your DNs probably was cached

tender shard
#

that's bukkit's javadocs compiled with target and source 17

eternal night
#

Iirc they use a rather old version of the annotations lib

#

I think it's a javac issue

#

And then javadoc picks it up

#

So using libraries compiled before it exploded fixes it

#

Tho don't quote me on that, it's off the top of my head

#

Don't have the sources on hand to back it up

tender shard
#

jetbrains annotations-java5 23.0.0

#

that's from nov 2021, not the latest but also not old

eternal night
#

I mean, doesn't matter how old it is

#

Depends on what it is compiled with iirc

#

Urfh lemme see, we discussed that somewhere

tender shard
#

i remember that spigot also had this bug back in 1.9 or so

#

and yeah I've also read about this javac bug, weird that it hasn't been fixed yet

#

I just also switched from annotations to annotations-java5 to fix it for my stuff lol

remote swallow
#

adventure jank

tender shard
#

yeah it's quite a pain to use

eternal night
#

Ah there

tender shard
remote swallow
#

earlier using black + darkblue or dark_blue the gradient worked perfectly

#

now it refuses to

tender shard
#

except that they are forced to use adventure

#

and doesnt support & codes

tender shard
eternal night
#

Probably? Its on linked in a discussion I had

tender shard
#

oh yeah there's one from 2017

#

funny how this still didnt get fixed

eternal night
#

i guess not too much of a priority ยฏ_(ใƒ„)_/ยฏ

dire marsh
#

anyone know if there's some easy way to spawn a fake beacon, even if it's an external library

river oracle
#

i swear I've seen a fake beacon guide on spigot

eternal night
#

Isn't beacon client side ?

river oracle
#

I must find this

dire marsh
#

yes

wet breach
#

beam is clientside in how far it can be seen

dire marsh
#

hmm

#

how does wynncraft do theirs?

wet breach
#

if you want it seen everywhere

tender shard
#

probably just sending fakeblocks

wet breach
#

is to make a fake beacon within the max distance the client will render

#

and just keep updating it

#

as they get closer

#

until they are within the real block distance

tender shard
#

Player#sendBlockChange(...). I dont see any packets related to beacons except for "recalculate beacon beam"

dire marsh
#

hmm shame, kind of needed it to be fake so there wouldn't be visible blocks

tender shard
#

you could send the BlockChanges to show a beacon, call the BlockAction update packet, then send another blockchange and not send the block action packet again

#

the client seems to only update the beam when this packet gets send

remote swallow
#

time to write down all the colour options

tender shard
remote swallow
#

and their actual color

wet breach
#

just didn't know if you wanted the beam of an actual block visible further

#

but, yeah you could definitely just use fake blocks for the entire thing and just update as necessary to keep the beam at whatever distance and direction

quaint mantle
#

HI , Why do I not understand anything when I see Minecraft plugin writing tutorial?

tender shard
#

maybe the tutorials are shit

#

what exactly don't you understand?

#

the actual coding, or do you already struggle with setting up the project in your IDE etc?

quaint mantle
tender shard
#

oh you definitely need to learn the basics of java first

#

?learnjava

undone axleBOT
tender shard
#

if you start with minecraft plugins without ANY coding knowledge, you'll have a really, really bad time

#

the learnjavaonline thing looks interesting

quaint mantle
tender shard
#

you can also check out video tutorials, of course

#

but choose one that's about the basics of java first

#

dont start with minecraft plugins

quaint mantle
tender shard
#

why the heck do most "dependency information" NEVER tell which scope to use lmao. in gradle they are ofc forced to tell us, but e.g. ProtocolLib doesn't tell whether to use provided or compile lol

tender shard
tender shard
# quaint mantle Maybe before learning Java, I should learn the basics of programming it's true ?

idk this doesnt look too bad https://www.youtube.com/watch?v=eIrMbAQSU34

Java tutorial for beginners - Learn Java, the language behind millions of apps and websites.
๐Ÿ”ฅ Want to master Java? Get my complete Java mastery bundle: http://bit.ly/2tKoy8C
๐Ÿ‘ Subscribe for more Java tutorials like this: https://goo.gl/6PYaGF

๐Ÿ“• Get my FREE #Java cheat sheet: http://bit.ly/2JNlQnw

โญ๏ธ Want to learn more from me? Check out thes...

โ–ถ Play video
quaint mantle
tender shard
#

nah, fuck visual basic

#

get started with java

#

java is good for beginners, as well as for complex stuff

#

when I was in school, we also started coding using java

tender shard
#

java is great for beginners because it's strictly typed and has awesome IDEs like IntelliJ that have proper tab completion, unlike PHP or python etc

#

check out the video I sent

quaint mantle
#

I had started learning 23 programming languages in every way but I failed in the end * xD Like Go and React and PHP and Lua and C and C Family :/

quaint mantle
tender shard
#

well maybe do it again, write exactly what the dude in the video is writing, and if you don't understand anything specific, feel free to ask here

quaint mantle
tender shard
#

at least for me, I find them way more useful

remote swallow
#

yt tuts are awful

tender shard
#

they stop you from copy / pasting everything and also usually explain stuff way better

remote swallow
#

especially without source code

tender shard
#

yeah YT tutorials suck

#

?learnjava

undone axleBOT
tender shard
#

these are all good ^

#

(except the last one, it requires prev knowledge)

wet breach
#

otherwise compile for all other things

tender shard
#

however there's little reasoning in shading WorldGuard

wet breach
#

doesn't mean you couldn't do it

tender shard
#

in gradle they tell you whether to use "compileOnly" or "implementation", so why not for maven too

wet breach
#

I just told you

#

dependencies don't need to be in your jar

tender shard
#

what bothers me is that they tell gradle users "you need to shade it" but to maven users they say "yeah whatever"

wet breach
#

well most people don't follow licenses either

tender shard
#

tbh if licenses wouldn't always be a huge text wall, maybe people would read them

wet breach
#

blame laws for that and people always trying to find some hidden meaning

tender shard
#

and I also think "if someone wouldn't want others to use it, they wouldnt have uploaded it publicly to github where everyone can fork it and stuff"

wet breach
#

well what you think isn't really relevant to the license

pseudo hazel
#

well usually a license has a name which you can just learn the meaning of, like they actual license text is mostly copy paste from somewhete

wet breach
#

the reason I brought it up is because while although you could shade something, doesn't mean the license permits it

#

if it does, usually have to provide the license along with your project

#

almost all plugins are in violation of that

#

technically a license file is supposed to be provided in the plugins data folder too

#

and any others you are supposed to provide so that the user can read them ๐Ÿ™‚

frank kettle
#

for some reason getType().getMaxDurability() is always returning 0 ๐Ÿค” any other way of checking durability?

wet breach
#

on what?

frank kettle
#

of a tool

tender shard
wet breach
#

anyways, as far as the maven shading goes. There is no requirement to shade libraries

#

since libraries can function outside of the jar just fine as long as you have a class loader

#

which by default there is always one

tender shard
#

you're missing the point of what I was upset about

wet breach
#

you are upset because maven provides flexibility and doesn't enforce which scope something must use because really it doesn't matter because it is up to the user to decide which they want to use

#

which scope you use for a dependency has no bearing on whether the dependency works or not

remote swallow
#

alex how do i make maven stop caring if var plugin is initalized or isnt

tender shard
wet breach
remote swallow
tender shard
wet breach
#

it kinda isn't

tender shard
wet breach
#

you are either going to shade it in or you are not, doesn't have anything to do with the function of the dependency

tender shard
remote swallow
wet breach
tender shard
#

nobody ever said that

wet breach
#

show me one that is the case and I will believe you

#

otherwise it is user choice in maven

tender shard
wet breach
#

then you are upset over a non-important thing because of personal preference that has nothing to do with functionality

tender shard
#

again, you are missing the point of what I'm upset about.

I don't like that all readme's tell gradle users which scope to use, but not maven users.

They should either leave it open for gradle users too, or tell maven users which scope to use, too.

wet breach
#

its not important in maven

tender shard
#

it is as important in maven as it is in gradle

wet breach
#

therefore why specify something that is up for the user to specify

tender shard
#

yeah anyway, this is leading nowhere, I'll continue to write my archetype

wet breach
#

yeah because you are complaining that maven users don't specify scope on something that isn't their decision anyways

remote swallow
#

wouldnt spigot-api break if you had scope compile

wet breach
#

no

#

API that you depend on is implemented and provided in spigot. If you shaded the API into your jar as well, it won't change anything other then the API is in your jar as well as the spigot jar and basically you increased the size unnecessarily lol

tender shard
wet breach
#

its like shading in the mysql driver

#

you can do it, but spigot already provides it. It would make sense if you are depending on a higher version of the driver

frank kettle
#

just use a blockplaceveent?

#

and then take all the lava way in a cube around and transform the sponge into a "web sponge"

quaint mantle
#

This might be a dumb question, but i've never made an api before. How do you locate or create the maven dependancy for your own plugin?

frank kettle
#

open game and test it?

frank kettle
#

wdym decompile

remote swallow
#

minecraft

#

they want the mojang code

tender shard
#

then it's in your local repo and you can just add it as <dependency> in other projects

wet breach
frank kettle
#

@last temple

wet breach
#

this is how I do api's for my projects most times

frank kettle
#

a quick google search would find this

wet breach
#

or when I want to provide an API

frank kettle
remote swallow
#

@tender shard how do i make javac stop caring that it might not be initalized

tender shard
remote swallow
#

but its initalized by acf

tender shard
#

the plugin?

#

no

#

it's not

remote swallow
#

if i add a constructor it says to remove the required args constructor thing

tender shard
#

it's filled in by REquiredArgsConstructor

#

you have three options:

#
  1. private final MyPlugin plugin = MyPlugin.getInstance();
#

2.```java
@RequiredArgsConsturcor
public class CommandClass {
private final MyPlugin plugin;
}

quaint mantle
#

Like I can't see the repo and dependancy of my plugin

remote swallow
#

do you not know your artifactId or groupId

tender shard
#

or 3, which is the same as 2:

public class COmmandClass {
  private final MyPlugin plugin;

  pulic CommandClass(MyPlugin plugin) { this.plugin = plugin }; 

wet breach
tender shard
remote swallow
tender shard
tender shard
#

it's how final fields always work

#

and REquiredArgsConstr is from lombok, not acf

wet breach
remote swallow
#

doesnt Requiredargs come from acf

tender shard
tender shard
remote swallow
remote swallow
wet breach
tender shard
#
public class MyClass {
  final String name;
}

this is definitely not fine

remote swallow
#

this is your code lol

remote swallow
#

thats the repo but they shouldnt need to add anything to their repo list in maven to use it

tender shard
#

yeah

#

maven local is included by default

wet breach
#

so yes it is fine

remote swallow
#

now ij is complaining

tender shard
#

frostalf sometimes I think you simply WANT to disagree with people

#

I sent code of a class that obviously won't compile

#

and you say "it's fine" - if one changes things

#

yeah obv everything is always fine if you fix it

wet breach
#

it will if you assign it in the constructor of the class

quaint mantle
#

Yeah i'm not saying I can't find it, I was reffering to @wet breach's as he has repository in his to so was confused

tender shard
#

yeah but as you can see, there is no constructor that assigns that field

wet breach
#

but also it has no bearing on if something like lombok is used

remote swallow
tender shard
wet breach
#

install, installs your jar there

quaint mantle
#

Yeah I know

quaint mantle
wet breach
#

how the dependency gets installed is dependent on the org tag

quaint mantle
#

ahhh

#

I see

wet breach
#

so if the org tag is org.spigotmc for example, it creates a directory call org. and then spigotmc

#

and then under there your dependency would be there

#

for example

quaint mantle
#

I get you

wet breach
#

oh well I should clarify it will then create a directory of the artifact id

#

and then version

carmine urchin
#

Would anyone recommend citizens api over using nms for npcs?

quaint mantle
#

and the dependency is inside version?

wet breach
#

yep

quaint mantle
#

I see these again

wet breach
quaint mantle
#

That would be it wouldn't it?

wet breach
#

I don't know how the groupId was originally

#

but all the other stuff looks right

quaint mantle
#

Does it matter?

wet breach
#

is that how it is listed in .m2?

wet breach
#

order is like so

quaint mantle
#

says org.example in the original m2 path

wet breach
#

then when you compiled your project, you set org.example as the groupid

#

now if you want to depend on it, you would use org.example for groupid

#

if that isn't the groupid you want, change it in the project and then recompile lol

quaint mantle
#

If i re compile though then re install it will be to what I set it?

#

Yhyh

#

no probs thanks

frank kettle
#

i found a problem with my plugin that is multi version. Netherite item is seen as type "AIR" in versions below no netherite which does make sense but the server is on 1.19.3 so i thought it would work since the server has that material... guess i was wrong and need to make a way of making my plugin have different versions ๐Ÿ’€ anyone has a tutorial for it?

remote swallow
#

xmaterial if its just material stuff

wet breach
wet breach
#

instead of trying to use netherite on versions below it existing, you would just simply detect that and just use a block that does exist instead

#

not sure what your plugin is so can't say that is a viable solution but it keeps your plugin working though ๐Ÿ™‚

frank kettle
#

im using on my plugin spigot version 1.9. can i make a plugin version 1.19 but work on older versions if I don't put api-version on plugin.yml?

frank kettle
#

and i have to get their durability to cancel it if pickaxe is breaking

wet breach
#

well obviously they are not going to be mining netherite in versions that don't contain netherite

frank kettle
#

well but server is on 1.19.3

#

since plugin is on version 1.9, it doesnt know what netherite is

river oracle
#

Want a big hint

wet breach
#

you need to depend on higher API versions

river oracle
#

Material.valueOf isn't version dependent :)

wet breach
#

as in depend on multiple api versions lol

river oracle
#

Also use reflection for newer api

wet breach
#

or use reflection or both

tender shard
wet breach
#

if its not specified the server automatically assumes lowest api version that it knows

#

which is 1.13

#

since that is when that stuff came about

tender shard
#

no, if it's not specified, it enables legacy material support and you'll end up with different material names

wet breach
#

isn't 1.13 where legacy materials are at?

frank kettle
#

plugin is on 1.9 tho.

wet breach
#

why is that important?

#

either you are going to depend on higher api versions or you are not. But if you don't, then you can't make use of methods that your plugin can't see

twin venture
#

Hello , iam trying to download 1.9.4 into buildtools

wet breach
#

unless you start using reflection everywhere

#

and generics

twin venture
#

i finished other versions , only this one

tender shard
#

update your buildtools

twin venture
#

i tried bo

#

1.9 , 1.9.4 , 1.9.2

#

nothing works

#

other verions works too

tender shard
twin venture
#

my internet is fast & stable

remote swallow
#

update buildtools

tender shard
twin venture
#

weird i downloaded it a month ago

river oracle
river oracle
#

Not what I'm asking

tender shard
#

oh

#

sorry my bad

#

one sec

frank kettle
#

if anything ill update plugin to 1.13+

#

nobody using old versions anyways

remote swallow
#

dafrick? ```java
@EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerChat(AsyncPlayerChatEvent event) {
Player player = event.getPlayer();
String playerNickname = PlaceholderAPI.setPlaceholders(player, plugin.getConfig().getString("format.nickname-placeholder")).replace('ยง', '&');
String color1 = plugin.getChatColor1(player);
String color2 = plugin.getChatColor2(player);
String serverName = plugin.getConfig().getString("server.name");
String serverColor = plugin.getConfig().getString("server.color");
String messagePre = plugin.getConfig().getString("format.gradient");
String messageFormatted = messagePre
.replace("%server_color%", serverColor)
.replace("%server_name%", serverName)
.replace("%nickname%", playerNickname)
.replace("%color_1%", color1)
.replace("%color_2%", color2)
.replace("%msg%", event.getMessage());
event.setFormat(Utils.format(messageFormatted));
}

tender shard
#

as I said, legacy material support

river oracle
#

Hmm

remote swallow
#

ill fix the plugin.getConfig()'s later

tender shard
#

api-version HAS to be 1.13

#

if you wanna access post-1.12.2 materials

twin venture
twin venture
# tender shard

i suggest using Xmaterial for that , i used it and it fixed my problem

frank kettle
#

i only see pvp as the reason

twin venture
tender shard
tawdry parcel
#

How to fix Incompatible types. Found: 'java.lang.String', required: 'boolean'?

package com.koner.konerutils.npc;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;

public class NPCInventoryListener implements Listener {
    @EventHandler
    public void onInvClick(InventoryClickEvent event) {
        if (event.getCurrentItem() == null) return;
        Player player = (Player) event.getWhoClicked();
        event.setCancelled(true);
        if (event.getCurrentItem().getItemMeta().getLocalizedName()) {
            switch(event.getCurrentItem().getItemMeta().getLocalizedName()) {
                case "knockbackffa-island": player.teleport(
                        new Location(Bukkit.getWorld("world"), -136, 28, 109)
                ); player.closeInventory(); break;
            }
        }
    }
}
remote swallow
#

?learnjava

undone axleBOT
tender shard
#

a string is not a boolean

#

you cannot do if("mfnalex")

frank kettle
twin venture
frank kettle
#

if your plugin can work with it, sure.

twin venture
wet breach
twin venture
#

not sure if its allowed to share links for github .

wet breach
#

its allowed

frank kettle
#

not allowed, we dont like github

twin venture
frank kettle
#

we use spigothub

tender shard
frank kettle
#

i will move the plugin to 1.13 and if anyone needs a older version i will just release on github that version

#

will see if that fixes the issue

twin venture
#

hi , a while back my plugin src was leaked by someone ..

#

is there a way i can make it hard to do it again?

frank kettle
#

everyone's plugins should be open source

twin venture
#

maybe , maybe not

#

my work i dont want to share it for free .

frank kettle
#

then sell the plugin and create ToS for its use

twin venture
#

i did , but still

frank kettle
#

i think most of whats allowed is to change the functions names to make it "less readable"

hazy parrot
twin venture
#

there are some way's

frank kettle
hazy parrot
#

As miau already mentioned, you can just make it less readable

twin venture
#

Secured FTP Server that a launcher plugin connects to and from there it grabs the latest updated plugin.
Once downloaded into MEMORY not disk, it injects it into Java Runtime Environment (JRE) and simply load it
the launcher will need to be obfuscated and highly encrypted

#

this what i have been searching about for the last month

frank kettle
#

read the thread i sent

twin venture
#

i know , i uploaded my plugin to spigot , but it got denied

#

and i never uploaded it again

#

bcz of lake of descriptons xd

frank kettle
#

i was very annoyed before by the opportunity of people being able to "copy" my code but i just stopped caring and maybe it helps newer programmers to learn what they have to do to reach certain points. just like you, who im sure you have searched on google and copied answers on stackoverflow for anything, pretty sure you liked to find the answers you so much desired for and wished not everything was behind a paywall or never be able to be discovered.

twin venture
#

i just made a better version , highly customizable

frank kettle
#

then why do you care if people check the code?

wet breach
#

second, it doesn't prevent a profiler from seeing it, and third neither heapdumps. 4th you have no way to prevent someone from using the credentials

twin venture
frank kettle
#

setting plugin to version 1.13 and adding api-version 1.13 fixed the issue. thank you guys.

twin venture
#

i remmber there is a custom minecraft server version did it , i guess its fox-spigot?

#

it did something simmaler

hazy parrot
#

What are enum voids

twin venture
remote swallow
#

you dont need the title

frank kettle
#

event.getview

remote swallow
#

compare inventory instance not title

tardy delta
#

getTopInv()

remote swallow
#

if (!(e.getInventory() instance of PlayerInventory))

frank kettle
#

e.getClickedInventory().getType()

tardy delta
#

bottom inv is player inv

#

ij will suggest

frank kettle
#

inventoryClickEvent?

remote swallow
#

that wasnt hard

frank kettle
#

why no?

#

checking clickedinventory is worse?

#

how so

#

please tell me why then

tardy delta
#

๐Ÿค”

frank kettle
#

i used it and works fine

#

to check if player is moving items in the player inventory or the menu i want

#

why would it

#

i check view title beforehand

remote swallow
frank kettle
tardy delta
#

if that man decides to use color codes, youre fucked up

frank kettle
#

oh I never released a plugin to others with that

#

i mean for my own private plugins

#

such "bugs" cant happen

ivory sleet
#

Two different inventories with the same title trollface

tardy delta
#

cry

chrome beacon
#

Can you rename items with colors on your server

frank kettle
#

whats the problem with using ยง? ๐Ÿค”

remote swallow
#

you have to go googling for it

#

ChatColor.translateAlternameColorCodes('&', "&5my cool string") easier

frank kettle
#

cant find anything, feel like ยง is a hard searching char

ivory sleet
remote swallow
#

or for me i only have to use Formatting.format("<red>my cool &5string")

remote swallow
ivory sleet
#

You mix <> and and & ?

frank kettle
#

so whats the issue with it?

ivory sleet
#

What a maniac

frank kettle
#

๐Ÿค”

remote swallow
#

it makes it easier imo

#

legacy serializer great

frank kettle
remote swallow
#

most of the time i just end up using mm format

frank kettle
#

how's those easier?

#

if u have to write way more

#

๐Ÿค”

ivory sleet
#

Its not about writing less

remote swallow
#

but i use it in public plugin so and people are dumb

remote swallow
ivory sleet
#

If thats the case, just install every 3rd library spigot has to offer

frank kettle
#

and then u have to use the util instead of a simple ยง

frank kettle
remote swallow
#

do you not have this popup when you type

ivory sleet
#

ยง is first and foremost pretty inexpressive, what does it mean?

frank kettle
remote swallow
ivory sleet
#

Sure it might be a convenience to write

frank kettle
#

i use it for my private plugins when it's my own messages writing ๐Ÿค”

#

trying to understand why is it bad for "potential bugs"

#

so it's just a convenience issue? not really something bad?

quaint mantle
ivory sleet
#

Sounds like everything you do is for ur private plugins, and just because some obscure legacy practice does not involve conceivable bugs does not inherently imply that there exists no issues regarding that practice.

remote swallow
ivory sleet
#

But anyway, ยง at least works

#

Its just that there are better alternatives

frank kettle
ivory sleet
#

And support for ยง is thinkably gonna get yeeted

frank kettle
#

i feel like i need to work on a lot of other things before some ยง "not issue" thing

frank kettle
ivory sleet
#

Mye good luck

#

I use minimessage

native nexus
#

Arenโ€™t there 1000 of them on spigot

ivory sleet
#

But thatโ€™s just me

quaint mantle
#

uhh

#

could i create a thread with one of u guys

#

need some help with an error I got

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!

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

uhh this is the error log

#

do I need to provide the source code?

frank kettle
#

Caused by: java.lang.IllegalArgumentException: Item cannot be null

remote swallow
#

spacehelm.dctrspacehelm.commands.DctrSpaceHelmCMD.onCommand(DctrSpaceHelmCMD.java:65) ~[?:?]

fluid cypress
#

how do i add an item to an armor stand? how do i get that EntityEquipment object?

ivory sleet
#

LivingEntity::getEquipment?

#

ArmorStand derives LivingEntity

fluid cypress
#

thanks

native nexus
#

Javadocs are always super helpful

tardy delta
#

do people call ( a bracket or parenthesis in math context?

native nexus
tardy delta
#

and what is bedmas

native nexus
#

Brackets exponents division multiplication addition subtraction

tardy delta
#

smh my error messages are fucked up then

native nexus
#

Itโ€™s used to remember the order of operations

#

But I think itโ€™s fine to use parentheses also?

tardy delta
#

"missing closing parenthesis" sounds better than "missing closing bracket"

native nexus
#

Then use missing parentheses

#

Also parenthesis is the American way of spelling so my bad

#

Oh wait nvm

tardy delta
#

whatever

native nexus
#

Itโ€™s grammer

tardy delta
#

whos gonna use this anyway

native nexus
#

Parenthesis is one bracket and parentheses is two

hazy parrot
#

iirc tuple is just type of data structure

#

so tuple with two elements would be pair

native nexus
#

Tuples are immutable and lists are mutable

echo granite
#

Does anyone know a way to convert a JPG/PowerPoint file into PDF in pure python? I can't download anything(e.g. modules) to the computer

hazy parrot
#

would be really hard ig

#

tbh

carmine urchin
#

Is there a way using citizens API to set the latency / ping of an NPC? For example set the ping of an npc to 10ms or 20ms so that when you hit the NPC there is a delay?

tardy delta
#

fun thing

#

bruh when after you leave your pc on for a few days, chrome stops working

echo granite
tardy delta
#

me wasting 19ยตs with a String#isBlank call ๐Ÿ’€

fluid cypress
#

well, after a bit of testing, spawning ~2k falling blocks causes big fps drops even with a good gpu.
but armor stands with blocks as helmet doesnt produce any fps drop at all.
the problem is that a block in an armor stand's head is smaller than 1x1 blocks, so is it possible somehow to make it bigger?

hazy parrot
fluid cypress
#

and about blocks with variants (like fences or glass pane connected to certain directions and stuff like that), is it possible to specify that somehow? if not i guess i could use falling blocks for that (assuming its possible to make the armor stand bigger)

#

is it any other way to create "fake" blocks that i can move freely at will? smoothly between blocks, with a natural transition basically

echo granite
fluid cypress
#

i want to make vehicles and things like that

hazy parrot
echo granite
#

I only have python installed and that's it

hazy parrot
#

ยฏ_(ใƒ„)_/ยฏ

echo granite
#

It's a computer at my work :/

patent sierra
#

anyone know how to make an animation trigger from a resource pack when i run a command

native nexus
#

Resource pack is client side

tender shard
#

huh sk89q repo down?

quiet ice
#

You need to use enginehub instead, sk89q was deprecated long ago

tender shard
#

yeah but that's missing the latest versions of WE and WG 6

tardy delta
#

ok letting copilot generate unit tests was a bad idea

quiet ice
#

Time to publish it on your own mirrior

twin elbow
#

how is the website with all the mapped names called (nms something)

twin elbow
#

tyyy

heavy prairie
#

hey i want a certain item to have a chance to be dropped when a block is broken but i have a small problem. i know how we get entity types but i dont know how we get broken block types so can anyone help me?

remote swallow
#

@EventHandler not @Override

heavy prairie
#

oh sorry im just used to using @Override

onyx fjord
#

It uses event handler annotation for priority and shit

remote swallow
tardy delta
#

Arrays.asList pls

heavy prairie
onyx fjord
#

Plz use normal variable names

#

b is not a good name for an event

heavy prairie
#

is block good

#

instead of b

remote swallow
#

use event

onyx fjord
#

But event is not a block sir

onyx fjord
mellow edge
onyx fjord
#

What if they need a variable for block itself

#

Imo we should all use human names for variables

#

Block block Event event Player player

#

Or contextual names

tardy delta
#

Player kacper

mellow edge
livid dove
#

So I have the code that will go chunk by chunk, recording every chunk in an array, then going back through that array , loading the chunk, detecting every tile entity and then deleting X item if that tile entitiy is a inventory holder.

But as you can probs imagine, timeout goes brt pretty quick, what can be done to resolve this?

#

async is obvs out of the question ofc

tardy delta
#

?workloadditro

#

?workloaddistro

chrome beacon
#

?workdistro

tardy delta
#

who made that command

#

๐Ÿ’€

naive bolt
#

anyone know with this if i can select multiple to allow the plugin to work on spigot and bungee yk?

lethal knoll
#

That is just where you select a template for your project

#

I never really worked with making it compatible for anything else other then spigot

#

But you could use multiple modules If I remember correct

chrome beacon
#

^^

#

You need to set that up yourself

naive bolt
#

ah yeah ive done it before just wondered if their is an easier way

quiet ice
#

Well you could do it in a monolithic fashion, but that is really asking for trouble

warped pulsar
#

Hello,
has anyone managed to generate maps by black listing biomes in 1.18.2?

torn shuttle
#

random question but anyone know what the going rate for an average very basic website is nowadays? Really simple front-end stuff with some info on it

mellow pebble
#

can i ask question about minecraft generally not about spigot development the problem is caused by plugin

torn shuttle
#

isn't that service costs?

#

I mean in a for-hire context

dire marsh
#

you can't get body rotation

final monolith
#

how i can disable that original- .jar from the maven build?

dire marsh
#

you can attempt to track it serverside but it will 100% desync at some point

remote swallow
final monolith
#

what you mean

remote swallow
#

the jar to use is the LvShopping 1.0-SNAPSHOT

final monolith
#

yeah, i know... But that other jar are getting me confused

orchid gazelle
#

It will always be the same pattern

final monolith
#

any way that i could remove it from the building?

#

ok xD thank you!!

atomic swift
#

Statistic.PLAY_ONE_MINUTE is in ticks right?

#

just making sure

#

should i divide it by 20 or by the tps

#

ye thx

wet breach
#

same price range

#

however you can find a lot of templates for like cheap though

#

and to build off of

tender shard
#

so yeah definitely need at least two classes for the main classes

tidal anchor
#

hi i'm creating a command that resets all hearts to 26 hp(13 heart) and how do i do it

tender shard
#

set a player's maxHealth to 26

#

Attributable#getAttribute(Attribute)

#

it's called Attribute.GENERIC_MAX_HEALTH

#

then set it's base value to 26

wet breach
tidal anchor
wet breach
#

BasePlugin for Libraries that don't act on their own though

#

bit of ancient knowledge for you

remote swallow
wet breach
#

that has now been bestowed

tidal anchor
#

i tried that but i can't get any player

#

with index

tender shard
wet breach
#

BasePlugin and JavaPlugin

#

been like that forever, but most people only use JavaPlugin and thus only know about that

tender shard
#

and which plugin loader would load that? Because JavaPluginLoader only accepts JavaPlugins

remote swallow
#
for (Player player : Bukkit.getOnlinePlayers()) player.getAttributes
tender shard
remote swallow
#

it extends PluginBase not BasePlugin

tender shard
#

I repeat the question - which plugin loader would load a plugin that's only a PluginBase but not a JavaPlugin

wet breach
wet breach
#

its from bukkit

tender shard
#

there is no pluginloader implementation in bukkit besides JavaPluginLoader

remote swallow
#
public String getJoinMessage(Player player) {
        String nickname = PlaceholderAPI.setPlaceholders(player, nicknamePlaceholder);
        String message = player.getPersistentDataContainer().getOrDefault(plugin.joinMessageKey(), PersistentDataType.STRING, messageData.joinMessage())
                .replace("%color_1%", plugin.getChatColor1(player))
                .replace("%color_2%", plugin.getChatColor2(player))
                .replace("%nick%", nickname);
        return Utils.format(message);
    }

    public String getLeaveMessage(Player player) {
        String nickname = PlaceholderAPI.setPlaceholders(player, nicknamePlaceholder);
        String message = player.getPersistentDataContainer().getOrDefault(plugin.leaveMessageKey(), PersistentDataType.STRING, messageData.leaveMessage())
                .replace("%color_1%", plugin.getChatColor1(player))
                .replace("%color_2%", plugin.getChatColor2(player))
                .replace("%nick%", nickname);
        return Utils.format(message);
    }
``` can anoyne see how dafork if its getting something from pdc
wet breach
#

PluginBase if you choose to extend it, is meant for libraries that don't need to do anything on their own and this lets the lib live in the plugins directory without the server complaining about it

eternal night
#

nothing loads plugin base lol

wet breach
#

because it doesn't need to be loaded

eternal night
#

pretty much

tender shard
wet breach
#

both of you have obviously never used it

eternal night
#

LOL

tender shard
#

frostalf why can't you, only once in your life, just admit that you're not always 100% correct

tender shard
#

there is no plugin loader for plugins other than JavaPlugin

tender shard
wet breach
#

no actually make a library that extends it

#

see if the server complains about it ๐Ÿ™‚

tender shard
#

lol

eternal night
#

you can create an instance of it and pass it around if that is what you mean

#

like

tidal anchor
#

can some one just help me

tender shard
#

?ask

undone axleBOT
#

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

wet breach
#

you don't get to use things like onEnable() or any of that

#

its literally for libraries that don't act on their own

remote swallow
tidal anchor
#

ok

eternal night
#

what the fuck would a library that does not need to act on its own require a plugin instance for kekw

tender shard
eternal night
#

if it schedules things on the server, it would have to clean up

wet breach
tender shard
#

no matter whether it contains a plugin.yml or whether the referenced main calss is a JavaPlugin

wet breach
#

if you think I am wrong you can always ask md5 about it though ๐Ÿ™‚

tender shard
#

then it tries to instantiate that class and cast it, and then it'll throw an exception if its not actually a ajvaplugin

eternal night
#

what is the point of PluginBase then

tender shard
#

just lok at the source code of the simplepluginmanager class

eternal night
#

if your lib does not need a plugin

wet breach
#

extending plugin base allows it to exist there without problems and be on the path

#

there is plenty of libs that don't need to do anything on their own

tender shard
#

so you create a .jar file, add a "main class" property to it, and that given main class then is NOT a java plugin?

#

that's what you're trying to say?

wet breach
#

public class MyPlugin extends PluginBase {

}

this is valid also libraries that extends plugin base don't require plugin.yml's either ๐Ÿ™‚

tender shard
#

no, it's not, that won't compile since you didnt override any of the abstract methods

tender shard
#

all the ones

wet breach
#

PluginBase doesn't have onEnable

#

doesn't even have disable

tender shard
#

a class that would actually extend PluginBase would have to implement all these methods

eternal night
#

when was the last time you tried to write a library like that

#

as a quick question

tender shard
#

it does

eternal night
#

frost realisting PluginBase is an abstract class

tender shard
#

ofc it does, PluginBase is abstract and implements Plugin, which is an interface

#

so you gotta implement all the methods declared in the interface

#

that's how it works

tidal anchor
tender shard
#
        Player player = null; // ...
        player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(26);
wet breach
# tender shard

anyways no issue, my IDE usually implements defaults for such things

eternal night
#

LOL

wet breach
#

point is, you can extend PluginBase

eternal night
#

no that was not your point xD

wet breach
#

yes it was

eternal night
#

also that is still wrong

tender shard
#

yeah I'm sure thi'll work juuust fine /s

tidal anchor
wet breach
#

want to prove that wrong that you can not extend PluginBase?

undone axleBOT
tender shard
#

loop over the collection

eternal night
#

the logic that reads the plugin dir literally checks for plugin.yml first

wet breach
#

I will wait till md5 is on and you can hear it from him

eternal night
#

and errors if it cannot find one

#

no check for anything else before

tender shard
#

I stand my ground though that it's totally pointless to extend PluginBase

wet breach
#

you said no

tidal anchor
#

i know java but it doesn't let me get the players when I do the for loop

tender shard
wet breach
#

anyways obviously you never used it

eternal night
#

nor does it add jars in the plugin folder without a plugin yml to the classpath

#

it breaks

tender shard
tender shard
#

I'm out, this discussion is pointless again

wet breach
#

yeah it is

#

you obviously never used it and are trying to explain it can't be used

eternal night
#

actually frost, want to code up an example of your "library jar"

#

that I can just yeet into my plugins folder

#

and have the server load it

tidal anchor
tender shard
tender shard
undone axleBOT
wet breach
tender shard