#help-development

1 messages · Page 1591 of 1

quaint mantle
#

create schedule task

ivory sleet
#

You probably have to do some nms hack then, not exposed in api I’m afraid of

eternal oxide
#

Bukkit Scheduler and an TaskTimer

ivory sleet
#

?scheduling

undone axleBOT
quaint mantle
#

and then?

gritty urchin
#

I'm confused. Why is the length always 1.0?

ivory sleet
#

It isn’t, only if you normalize it

quaint mantle
#

and then change scoreboard's value

#

what do i do in scheduler ??

valid solstice
#

thanks!

grim ice
#

@eternal oxide btw how do u think i can get the spawn egg of 'creature'

#

i will have to use enums?

#

or what was it

ivory sleet
#

Ye

eternal oxide
grim ice
#

im trying to get t he spawn egg

#

of the spawner

#

content

eternal oxide
#

so when someone breaks a spawner or something?

grim ice
#

i got the creature now i have to get the spawner egg of it

#

exactly

eternal oxide
#

it drops an egg

grim ice
#

yep

gritty urchin
grim ice
#

in my plugin u can craft eggs and spawners and theyre expensive so them disappearing is cruel

eternal oxide
#

use the entity type.name().toUppercase().replace(" ", "_") + "_SPAWN_EGG"

grim ice
#

oh ty

ivory sleet
#

Not as easy, you have to know what direction also

hardy lagoon
#

Is there a scheduler thing that runs it x amount of times? Or do i need to use a normal java loop?

ivory sleet
#

It’s trivial to implement a stop after x runs using a repeating task

valid solstice
#

this doesn't work... it keeps responding to the command by outputing "/feed" in the chat

eternal oxide
# grim ice oh ty

then with that String you can Material.getMaterial(String) or something close

gritty urchin
#

Basically, I'm trying to get the player's line of sight.

quaint mantle
#

any idea why this isnt working

public void onLogin(AsyncPlayerPreLoginEvent e){
        if(!isPunished(e.getUniqueId().toString())) return;
        String[] punish = getPunishment(e.getUniqueId().toString());
        if(punish[2].split(": ")[1] == "BAN") e.disallow(Result.KICK_OTHER, ChatColor.RED + "You are banned for the reason: " + ChatColor.GOLD + punish[3]);
    }
#

its not disallowing the login

#

i've debugged aswell

quaint mantle
gritty urchin
quaint mantle
glad iron
quaint mantle
#

or == works too

#

.equals() == ==

eternal oxide
#

String comparison use .equals

quaint mantle
#

o k

#

thank you for the help

smoky oak
#

quick question, does setting objects to null in the onDisable prevent memory leaks on a reload? As in, FileConfiguration, HashMaps containing player data etc.

quaint mantle
#

Vibration class, SpigotAPI.

#

i'll try

eternal oxide
quaint mantle
#

or vibration particle

smoky oak
#

k thanks

#

on that note, i dont need to do that with final objects, but what about static ones?

maiden briar
#
@Override
    public Event callEventSync(Event event)
    {
        CompletableFuture<Event> futureEvent = new CompletableFuture<>();

        if(event instanceof BukkitEvent)
        {
            Bukkit.getServer().getScheduler().runTask(this.bukkitPluginLoader, () ->
            {
                Bukkit.getServer().getPluginManager().callEvent((BukkitEvent) event);
                futureEvent.complete(event);
            });
        }

        try
        {
            return futureEvent.get();
        }
        catch(InterruptedException | ExecutionException e)
        {
            throw new TvheeAPIInternalException(getClass(), "callEventSync", e);
        }
    }

This crashes my server, idk why

smoky oak
#

because i store a copy of the plugin object in a static variable to manipulate it easier

eternal oxide
#

just be sure to close any file handles and dispose of maps

smoky oak
#

ah ok

maiden briar
glad iron
ivory sleet
maiden briar
#

Ok, but how to fix that?

ivory sleet
#

Garbage collection is slick

eternal oxide
maiden briar
#

Yes, I am never using futures

smoky oak
ivory sleet
#

No

#

But if a dependent plugin holds strong references to your objects, then it may prevent garbage collection and lead to memory leaks

#

However usually when a reload runs every plugin reloads right so it should fix that.

smoky oak
#

So you are saying that setting to null makes things more secure, but isn't necessary? Also, it would be helpful to see if there was a reload / load / unload, can you differentiate between them?

#

Also I set a getInstance method so a reload of that plugin should not cause issues with dependencies

ivory sleet
#

I’m saying you don’t have to set up things to null or clear map 99% of the time. As Elgar said, if you’re running executors or do some other stuff like a db connection then handle shutdown for those properly.

eternal oxide
#

you can detect if your plugin is being reloaded or loaded for the first time. In onLoad check Bukkit.getWorlds().isEmpty() If empty its a fresh server start.

quaint mantle
#

i used scheduler but it didn't work

#

what is wrong with code?

ivory sleet
#

Hmm getInstance() can be dangerous if it isn’t a reload but rather just plugman unloading your plugin, if another plugin depends on that getInstance they will depend on an unneeded instance. Using JavaPlugin#getPlugin is safer.

bold kindle
#

Hey there (I'm pretty new to Java, sorry if I'm a bit slow, taking a full course next week). I have a VehicleDestroyEvent and I want to give the player some items when the event occurs. However, I can only get the attacker and it is an Entity, not a Player. I have tried using the following code to cast the Entity to a Player:

Player player = (Player) entity;

however, when I try and add an item with this code:

player.getInventory(new ItemStack(Material.TNT));

it says 'getInventory()' in 'org.bukkit.entity.HumanEntity' cannot be applied to '(org.bukkit.inventory.ItemStack)'
Can anyone help?

smoky oak
#

Well if the plugin is unloaded it returns null either way

ivory sleet
#

That assumes they haven’t cached it

#

Which they totally can

chrome beacon
bold kindle
#

I know that, but is there a different way of doing it?

chrome beacon
#

If you want to add stuff use the addItem method

bold kindle
#

okay, thank you :)

smoky oak
#

True, but i am referring to the getInstance method here. Its meant to be used mainly within the plugin, and if the plugin is unloaded but cached, thats not a great issue. The problem comes with other plugins would try to change permanent values of the playerData, as the plugin I'm working on is mostly providing static data, which only changes if a player interacts with specific things, like for example a value storing the coordinates of the last crying obsidian they interacted with.

#

which is handled by the plugin itself

#

On another note, which event fires when a player attempts to join versus when a player actually manages to join? I sometimes see 'Player left the game' when they attempt to connect but fail to.

eternal oxide
#

AsyncPlayerPreLoginEvent then PlayerLoginEvent, then PlayerJoinEvent

smoky oak
#

k thanks i only found the join event

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

hey

#

so

#

idk how this is even being set off

#

every string[2] is accessible

#

& in userSystemName

ivory sleet
#

Btw moterius you could run a profiler if you wanna find out if something is leaking 😉

smoky oak
#

well i want to know how to make it right the first time lol

#

also

#

1.17 is REALLY heavy on the RAM, so I'd rather be as efficient and CPU heavy as possible

#

like

#

a server eats 2GB even without anyone online

#

'recommended for small modpacks' my ass

amber vale
#

I mean yeah

#

Towny is a good plugin

#

I dunno what u laughing at it does it's job for my server

#

You don't even know what my server is about so your bitch ass -8 player server and you can stfu you dumb ass

smoky oak
#

and then it needs like 100mb per player

#

the values online are not reliable

#

they say a player needs half a GB

#

i just gave up and took 4 GB

quiet ice
#

You do realize that a GB is a fucking huge amount of data?

ivory sleet
#

Sounds somewhat unrealistic but I guess could be possible

maiden briar
#

I now changed it into a void method, but the event field does not change:

@Override
    public void callEventSync(Event event)
    {
        if(event instanceof org.bukkit.event.Event)
            Bukkit.getServer().getScheduler().runTask(this.bukkitPluginLoader, () -> Bukkit.getServer().getPluginManager().callEvent((org.bukkit.event.Event) event));
    }

For example, if I cancel the GameInteractEvent, this won't detect it is cancelled:

@EventHandler
    public void onPlayerInteract(PlayerInteractEvent e)
    {
        GameInteractEvent gameInteractEvent = new GameInteractEvent(getPlayer(e.getPlayer()));
        TvheeAPI.getInstance().getPluginManager().callEvent(gameInteractEvent);
        System.out.println("GameInteractListener " + gameInteractEvent.isCancelled());
        e.setCancelled(gameInteractEvent.isCancelled());
    }
@EventHandler
    public void onGameInteract(GameInteractEvent e)
    {
        if(!e.getPlayer().hasPermission("dogleader.interact") && !state.isRunning())
        {
            e.setCancelled(true);
            System.out.println("DogLeaderGame " + e.isCancelled());
        }
    }
[12:33:54] [Server thread/INFO]: GameInteractListener false
[12:33:54] [Server thread/INFO]: DogLeaderGame true
quiet ice
#

nvm, read it wrong

quaint mantle
#

i get players by uuid via Bukkit.getPlayer(uuidstring);

#

where uuidstring is getUniqueId().toString(), from something

maiden briar
#

What would you do then?

ivory sleet
#

I mean checking if Event instanceof Event or what

frank steeple
ivory sleet
#

Event is at the top of its hierarchy

quaint mantle
#

appearently not

#

considering op is null

maiden briar
#

Event is my own api class, that's why I check if it is a bukkit event

frank steeple
#

Thats weird...

quaint mantle
#

where op === an online player

#

from Bukkit.getPlayer(their uuid);

gritty urchin
#

Does anyone know how I would get the points between two 3d xyz positions?

ivory sleet
#

But bukkit events won’t inherit your event api class

maiden briar
#

But do you know a solution?

quaint mantle
ivory sleet
#

No tvhee I barley know what you’re doing tbf

quaint mantle
#

abort! abort!

hybrid spoke
#

-8 player server xD

#

at least it has players

quaint mantle
#

: o

hybrid spoke
#

...negative players

quaint mantle
#

without Towny

ivory sleet
#

Altho I would suggest creating your own event system

#

Your own event bus if it’s going to be multi platform based

gritty urchin
#

How would a Bezier curve help

hybrid spoke
#

A bezier curve would get you the points between the start and the end point.

maiden briar
hybrid spoke
smoky oak
#

can you not subtract one from the other, halve the resulting vector, and add it to the point its pointing from to the other

#

like

willow oar
#

does anyone know why in my plugin commands work but listeners dont?

smoky oak
#

vector = a - b;
vector *= .5;
result = b + vector;

quiet ice
#

Technically you could just calculate the y/z difference for every x increase/decrease (via Pythagoras) and then just add every location for every x increase/decrease

smoky oak
#

well since it's static points

#

you dont even need that

#

just add the difference in x, y, and z to a point as i did

#

also i think there is a ray tracing function in bukkit

grim ice
#

if(Onceuncraftable.INSTANCE.getConfig().getBoolean("mine-spawners-with-silk-touch")){ is basically checking if the config mentioned is true, right?

smoky oak
#

it should be

#

assuming that variable holds a plugin instance

quiet ice
#

The asker didn't search for the point between (x1, y1, z1) and (x2, y2, z2) but rather the points (plural) between (x1, y1, z1) and (x2, y2, z2)

grim ice
#

} else { will run if it is false right?

smoky oak
#

uh

#

arent there infinitely many?

amber vale
smoky oak
regal carbon
#

sorry for the spoonfeeding but is there anyway to change the default world of the server, bascially the same world in level-name in server.properties

quiet ice
#

under normal circumstances yes, but this is minecraft so it is likely that the user means BlockPos points

smoky oak
quaint mantle
quiet ice
#

^

regal carbon
amber vale
quaint mantle
#

Quote my toxic messages please

grim ice
#

will if(e.getPlayer().getItemInUse().containsEnchantment(Enchantment.SILK_TOUCH)) { work with BlockBreakEvent?

#

??

amber vale
smoky oak
#

Well in most cases its already done, and probably better than you would do.
@grim ice can you not use SilkSpawners? Or look in that plugin's code?

quaint mantle
#

I didn't laugh at you using towny

amber vale
#

yea u did

quaint mantle
#

I just laughed at the idea of using towny, I didn't realize it was even still a thing

amber vale
#

Sure and im petri nygård

quaint mantle
#

I'm not sure what that means.

amber vale
#

u dont need to

quaint mantle
ancient whale
#

Hey is this a thing to run syncTasks in an asyncTask ? 🤔 from what I have tested so far I do not seem to have any error but it kinda feels weird

smoky oak
#

I think the syncTasks run on the main thread while the asyncTasks do not. Speak, if it's timing you need you should use sync, I guess

#

I could be completely wrong though

grim ice
#

@eternal oxide will if(e.getPlayer().getItemInUse().containsEnchantment(Enchantment.SILK_TOUCH)) { work with BlockBreakEvent?

young knoll
#

Use the item in their main hand

#

No idea if it counts as in use during the event

grim ice
#

cant they switch to a other pickaxe

#

after they break

ancient whale
ancient whale
grim ice
#

'getItemInHand()' is deprecated

young knoll
grim ice
#

'getItemInHand()' is deprecated

young knoll
#

?jd

young knoll
#

Read why

smoky oak
#

is the player object in that case dynamic or static? I don't know myself...
(speak, if the event is fired, is the player in it cached or the actual player in the world?)

eternal oxide
#

The Player object in all events is the world object, EXCEPT the death event. Then its a copy.

smoky oak
#

so handle it fast. Got it

grim ice
#

?paste

undone axleBOT
smoky oak
#

Do i have to reregister the commands when I'm reloading the pluign?

ivory sleet
#

Mye pretty sure

#

At least on a reload

#

Unsure how that works for individual plugins

young knoll
#

Should be in your onEnable anyway

eternal oxide
#

Not working is not a good error

grim ice
#

there is no error.

eternal oxide
#

Theres always an error, unles syou have no plugin

smoky oak
# young knoll Should be in your onEnable anyway

Reason: I'm trying to make the plugin efficient, and as such I'musing
if(!Bukkit.getWorlds().isEmpty()){
to run specific functions only when there is a reload (IE if there could be players online) but i wasnt sure if commands stay cached

eternal oxide
#

annotation

grim ice
#

OH

#

why am i

#

always dumb

smoky oak
#

I know that feeling

eternal oxide
#

so use it to set a flag field in your onLoad()

young knoll
#

Most things should be redone on a reload anyway

#

That’s kind of what they are for

eternal oxide
#

It is good to worry about reloads though. Not many plugin devs do and its the reason it breaks a lot.

smoky oak
#
static boolean reload = false;
    @Override
    public void onLoad(){
        reload = !Bukkit.getWorlds().isEmpty();
    }```
#

like that?

eternal oxide
#

yes

smoky oak
#

does this

File read = new File(this.getDataFolder(), "playerdata.yml");```
return the file `plugins/<Pluginname>/playerdata.yml`?
eternal oxide
#

yes, if it exists

smoky oak
#

ah crud

#

well time to create it

eternal oxide
#

you can simply do if (!read.exists()) read.mkdirs() or somethign close

young knoll
#

createNewFile

eternal oxide
#

or if you have a default of that as a resource in your jar saveResource("playerdata.yml")

smoky oak
#

is that IOException a severe or a warning, also, how do i get a ressource withotu saving it?

grim ice
#

@eternal oxide

#

btw

#

still doesnt work

#
  • no error
eternal oxide
#

registered the listener?

grim ice
#

wait

#

WHY

#

WHY

#

WHY

#

WHY

#

AM I SO DUMB

#

i hate events

#

i always forget stuff in them

quaint mantle
#

how can i send the player to another server in bukkit

eternal night
#

google "spigot bungeecord plugin channel"

grim ice
#

@eternal oxide

#

lmao still doesnt work

#

loll

#

config.yml:

#

mine-spawners-with-silk-touch: false

#

this is default ^

#

anyone?

eternal oxide
#

You are trying to drop a spawner and an egg?

grim ice
#

yes

eternal oxide
#

so what part does not work?

grim ice
#

if someone with the permission does /onceuncraftable minespawners true

grim ice
#

if u do the command u stil lcant break

drowsy helm
#

do you get an error?

grim ice
#

nope

eternal oxide
#

well you havn;t registered any commands

grim ice
#

..

#

fuck me

#

but even if i set it manually

#

i stil lcant

eternal oxide
#

add some sysout debug messages to your event and see if or how far it gets

smoky oak
#

is PlayerQuitEvent triggered when a player is kicked?

smoky oak
#

ok thanks

smoky finch
smoky oak
#

should be the same as in 1.17

#

1.17.1 only fixed a dupe bug as far as im aware

smoky finch
#

No some NMS stuff changed in 1.17.1

drowsy helm
#

things still have the potential to be remapped

smoky finch
#

Ah wait the page loaded after a few mins. I get Error while loading spigot mappings: Version not found but it loads, strange

smoky oak
#

doesjava if(commands.length!=0){ for(String s : commands){

#

bring any performance improvement if the list is empty over removing the length check?

drowsy helm
#

the lengtgh check isnt necessary

smoky oak
#

k

final monolith
drowsy helm
#

show code

#

its an npe

final monolith
#
    public void loadPlayer() {
        if (true) {
            Statement statement = createStatement();
            ResultSet result = null;

            try {
                result = statement.executeQuery("SELECT * FROM `wn_data` WHERE uuid = '" + player.getUniqueId() + "';");
            } catch (SQLException e) {
                e.printStackTrace();
                Main.broadcastWarn("Eita.");
            }

        }
    }
#

its SQLite

drowsy helm
#

you do realise if(true) is useless

final monolith
eternal night
#

Why are you not on java 16

#

is the better question

drowsy helm
#

can we see which line is throwing the NPE

eternal night
#

oh god

#

I see why

#

1.8

final monolith
#

🤔

eternal night
#

PlayerAPI.java:30

#

line 30 in the PlayerAPI class

#

if only people were using up-to-date software

final monolith
#
result = statement.executeQuery("SELECT * FROM `wn_data` WHERE uuid = '" + player.getUniqueId() + "';");

eternal night
#

and would get the amazing java 15+ null pointer exceptions

#

well either player is null

drowsy helm
#

statement is probably null

eternal night
#

or statement

drowsy helm
#

or player

eternal night
#

I'd take a guess it is the player

drowsy helm
#

why not pass Player as an arg

eternal night
#

my mans coding for 1.8, as if proper functional method design is their biggest issue

final monolith
#

i will check the statement

drowsy helm
#

just do a quick sout if null for both

#

will tell you where your issue is

final monolith
#

solved, the statement == null

#

thanks guys 😄

desert marten
#

Thank you have a nice day

final monolith
#

its only a prototype

#

thanks for the tip

hybrid spoke
desert marten
#

That is also an option

#

Every tick load the players data, just in case

#

On the main thread

dense geyser
#

How would I go about making a magma cube jump when it has no gravity/AI? Would I have to do some pathfindergoal clearing bs?

grim ice
#

?paste

undone axleBOT
grim ice
#

why?

drowsy helm
#

probably just a formatting error

grim ice
#

mine-spawners-with-silk-touch: false

/*
*

  • turn on if you want players to be able to break spawners with silktouch and drop them
  • (including the spawn egg)
    */
drowsy helm
#

thats it?

grim ice
#

yes

#

but for some reason

#

in the server

#

when i open config,yml

#

it doesnt havae a space

#

so its

#

mine-spawners-with-silk-touch:false

hybrid spoke
#

that doesnt matter

#

can you send us the code?

grim ice
#

okay

#

what code

#

the one that sets the config?

hybrid spoke
#

onEnable

#

line 18

grim ice
#

getConfig().options().copyDefaults();

#

..

#

u here?

eternal oxide
#

?paste your config.yml

undone axleBOT
drowsy helm
#

they did before

eternal oxide
#

in paste not in channel

grim ice
#

this is the default one

eternal oxide
#

it "looks" fine

#

however, delete teh line getConfig.options.copydefaults. You don;t need it

#

just saveDefaultConfig

grim ice
#

okay

#

done

eternal oxide
#

now try it

grim ice
#

alr'

eternal oxide
#

oh, yaml does not use java commenting

grim ice
#

WA

grim ice
#

its ##

#

or wat

drowsy helm
#

yeah just one hash

grim ice
#

knew it

quiet ice
#

there's only really two styles of commenting stuff:
// comment
and

comment

dense geyser
# eternal oxide no AI = no path finding

so I'd have to do stupid stuff with pathfinder goals then, do new pathfinder goals appear at random intervals or are they always there? (so I don't have to worry about it doing its own thing)

smoky oak
#

there's a reason this exists

eternal oxide
maiden cape
#

Why is e.getEntered() in VehicleEnterEvent an Entity but e.getExited() a living entity in VehicleExitEvent?

quiet ice
dense geyser
#

so extending CraftMagmaCube or whatever its cbukkit class is?

grim ice
#

it worked

#

thank you elgar

austere cove
#

using maven javadoc plugin, how can I link the spigot api in my docs?

#

also why does my javadoc have duplicates

eternal night
#

link as in URL reference to a webpage or linking the class directly

austere cove
#

yea url as part of links configuration

eternal night
#

I don't know of a valid way to link from your javadoc to the official spigot url using like {@link Player}

austere cove
#

not what I meant

#

e.g. if you have a function like
#doSomethingWithPlayer(org.bukkit.entity.Player player)
and you generate docs, it won't know what org.bukkit.entity.Player is.
When linked properly, clicking org.bukkit.entity.Player will redirect you to spigot docs

quaint mantle
#

how can i set the server motd in bungeecord event

austere cove
#

ProxyPingEvent

high pewter
#

I can't for the life of me figure out why my plugin thinks I never have permissions to use a command. I have defined my command and the permission nodes in my plugin.yml https://paste.helpch.at/oqegukutuj.php and I have gave myself several combinations of these permission nodes in LuckPerms, but when I do Player.hasPermission(...), it only returns true if the player is opped. Any ideas what I'm doing wrong? Here's my code https://paste.helpch.at/obosakarak.java

austere cove
#

that may be because you messed up with quotes here:

#

it doesn't do what you think it does

#

I think

high pewter
#

Hm I'll try putting a backslash before those

#

Nope, still doesn't work

#

And tbf, if that was the issue, gamemode.self should have still worked, which is the one that I'm testing mostly

eternal night
#

@austere cove oh sweet, so you answered your own question xD any difference between using link vs offlinelink ?

austere cove
#

no I didn't cos I can't get it to work

#

.-.

eternal night
#

oh

#

works splendid in gradle

austere cove
#

what link did you use for spigot

eternal night
#

I linked paper lol

#
(options as StandardJavadocDocletOptions).linksOffline(
        "https://papermc.io/javadocs/paper/1.17",
        "https://papermc.io/javadocs/paper/1.17"
    )
#

I used the root for both the url and package-list root

austere cove
#

https://hub.spigotmc.org/javadocs/bukkit/ does not work cos
https://hub.spigotmc.org/javadocs/bukkit/package-list does not exist

#

same w https://hub.spigotmc.org/javadocs/spigot/

eternal night
#

yeah use offline links

#
<configuration>
    <source>8</source>
    <offlineLinks>
        <offlineLink>
            <url>https://hub.spigotmc.org/javadocs/spigot</url>
            <location>https://hub.spigotmc.org/javadocs/spigot</location>
        </offlineLink>
    </offlineLinks>
</configuration>
#

works great for me

#

this is what you want right ?

#

redirects me to spigot entity docs

austere cove
#
[WARNING] Javadoc Warnings
[WARNING] javadoc: warning - Error fetching URL: https://hub.spigotmc.org/javadocs/spigot/
eternal night
#

am running ```xml
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>

#

using Apache Maven 3.8.1

shy wolf
#

how to make enttiy invisibility

hybrid spoke
austere cove
#

I'm running 3.3.0

shy wolf
ivory sleet
#

setVisible then

eternal night
#

works perfectly fine for me using javadoc 3.3.0

austere cove
#

?? just did a fresh clean & install and I still have the warns

eternal night
#

mvn clean install works well for me 😅

#

are you using offline links ?

austere cove
#

I copied that snippet

eternal night
#

welp this is wild xD

#

would be my entire javadoc config

#

but I don't think there is anything worthwhile in there

austere cove
#

retried it w the same phase and still got a warning

eternal night
#

Welp 😂 running javadoc 16.0.1 from adopt openjdk if that helps

heavy void
#

Hey, im making a bedwars plugin, my team generator are working, but, how can i make it check the amount of dropped items?

#

I want:

Iron only stack to 96
and gold only stack to 64.

#

How can i do that

wicked remnant
#

is there a way to get all the datapacks installed using the spigot api?

mental girder
#

i don't think the spigot api even acknowledges the existence of datapacks

austere cove
#

it worked when I ran it from command line and not through my IDE

#

I'm so confused

wicked remnant
mental girder
#

it's only been around for several years

#

you can't expect the api to actually reflect what's happening with the game

#

it'll probably take at least 5 more years

wicked remnant
#

wait lol this discord blocks outside emojis

#

why

eternal night
mental girder
#

external emojis are only allowed for nitro booster cucks

young knoll
#

External emojis are for boosters

mental girder
#

because md5 needs jew shekels to keep the guild banner and shit

high pewter
mental girder
#

what are you trying to do

high pewter
#

Test if a player has a permission, to put it simply

surreal agate
#

Is there a way to save data on blocks?

mental girder
#

on tile entities, yes

surreal agate
#

On normal blocks no?

mental girder
#

not really

young knoll
#

Chunk pdc technically

mental girder
#

only very technically

#

there is no reliable way of keeping track of when blocks are destroyed and moved around

quiet ice
#

events do exist for that

mental girder
#

the best you can do is have like 20 listeners and listen to all of the events, but that is gay and will still explode if other plugins do stuff that don't throw events

quiet ice
#

then their fault

mental girder
#

not really

#

the api doesn't really provide any events for plugins to fire in such cases

surreal agate
#

ok so probably is better storing it on external file right?

mental girder
#

so it isn't their fault that they aren't throwing any events about it

grim ice
#

eclipse or intelliJ

quiet ice
#

Well, you have to fire the event that is the closest to what it should do

#

Otherwise block protection plugins will not work as intended

mental girder
#

block protection plugins generally use player related events

#

and firing those without actual player interaction is kind of haram

quiet ice
#

The event system sadly does not have an intent system in place, so yes, there will be some issues

chrome beacon
mental girder
#

f.e most anticheat plugins will expode if you spoof a player block break event for a block that is out of reach

quiet ice
#

heh, I don't support AC plugins anyways

#

Heck, I did bork Spartan by creating an EntityShootBowEvent with a null entity not so long ago

mental girder
#

spartan is gay anyway

valid solstice
#
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args){
        if(sender instanceof Player){
            Player player = (Player) sender;
            // /heal
            if(cmd.getName().equalsIgnoreCase("heal")) {
                double maxHealth = player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getDefaultValue();
                player.setHealth(maxHealth);
                player.sendMessage(ChatColor.AQUA + "You have been healed!");
                return true;
            }else if(cmd.getName().equalsIgnoreCase("feed")){
                player.setFoodLevel(20);
                player.sendMessage(ChatColor.AQUA + "Your hunger has been set to max!");
                return true;
            }
        } else{
            System.out.println("Execute this command ingame");
            return true;
        }
``` Anybody know why if i execute "heal" on console, it gives me "execute this command ingame", but not when i execute "feed"?
eternal oxide
#

does feed even run at console?

valid solstice
#

no its not supposed to run, thats why its supposed to output "execute this command ingame", but its not giving me that

worn tundra
#

Did you register the command?

eternal oxide
#

That wasn;t my question. Does the feed command "attempt" to run when issued at the console?

mental girder
#

you probably have set a different command executor for heal and feed

#

i don't see any other way that'd happen

valid solstice
#

oh i didn't register the command

#

my bad

#

thanks for the help

worn tundra
quiet ice
#

It's probably them just being them

willow oar
#

does anyone know why listeners dont work but commands do?

eternal oxide
#

annotation EventHandler

unkempt ore
#

I kinda want to make a calculated arrow shooter with some math. Do you guys know what arrow firing power converts to in meters per second?

eternal oxide
#

1 block = 1 mtr. A projectile velocity is a vector. use getLength() to find its magnitude, which is distance traveled per tick

unkempt ore
#

Oooh

austere cove
#

what happens if you want to call Block#getType() on an unloaded block

smoky finch
#

Where can I get Spigot mappings? Spigot doesn't use Mojang's mappings right? So where can I get the mappings it uses?

quiet ice
#
    @Override
    public Material getType() {
        return CraftMagicNumbers.getMaterial(world.getType(position).getBlock());
    }
#

It loads the chunk I guess

mental girder
#

the Block object itself is just a wrapper over a BlockPos and a World

#

any calls made to any of its methods that retrieve any data about it delegate to the underlying chunk at those coordinates, and it will be synchronously loaded to retrieve that data if it isn't loaded already

gritty urchin
#

How to convert AxisAlignedBB to two vectors? NMS

smoky finch
#

Is there like no tool to help with this?

hoary knoll
#

how do you unregister a command programmatically?

eternal night
#

What are you even trying to do xD @smoky finch

eternal night
#

you can just access them to craft the vectors you want

#

I am assuming [maxX,maxY,maxZ] and [minX,...] respectively

smoky finch
#

trying to figure out how to send a spyglass packet

eternal night
#

there is no spyglass packet

#

xD

smoky finch
#

How are you so sure? I've seen an animation enum for it

eternal night
#

its an animation

#

but that is serverbound

#

you are trying to send (clientbound)

#

well, I guess you can trick other players into seeing players holding a spyglass

#

while they actually aren't

#

but that is as far as you'll get

#

cannot force a client to use a spyglass

smoky finch
#

I don't think that helps if I'm going to use reflection right?

eternal night
#

no.

#

reflection is just another way of accessing the server internals

smoky finch
#

Okay but how is this specialsource maven thingy going to convert my reflection code to that I wrote based on mojang mappings back to spigot's

eternal night
#

you don't use reflection with special source

#

reflection is pretty dead/hard to use in 1.17

#

as no tool is really capable of mapping reflection code yet

smoky finch
#

ah so by "no" you meant I can't use that tutorial

eternal night
#

Well, you aren't supposed to use reflection with 1.17 in the first place

#

you depend on the "mojang-mapped" spigot dependency

#

and code against that

smoky finch
#

We're not supposed to use reflection at all for any other version in general, but who am I kidding, it's minecraft. I prefer to support a few versions behind the current ver

eternal night
#

If you want to use reflection you will have to deal with the runtime names

#

e.g. checkout the server jar's content

#

it is an incredible pain tho

high pewter
waxen barn
#

when I try to reobf my plugin, it maps only classes and fields, but not methods, should I report it as bur or am I just doing something incorrectly?

quaint mantle
#

how to get enchantment name

#

?

#

enchan.getname is deprecated

waxen barn
eternal night
#

so your method calls do not get reobfuscated ? e.g. player.getName() would not get reobf to the correct runtime method name ?

waxen barn
eternal night
#

o.O

waxen barn
#

but last time I've done it, it was like

oe connection = ((CraftPlayer)player).getHandle().b.a;
        pk[] var3 = packetList;
        int var4 = packetList.length;

        for(int var5 = 0; var5 < var4; ++var5) {
            pk packet = var3[var5];
            connection.send(packet);
        }
#

and I used exactly the same command

#

(yep, I hnow, that I must map it back to spigot mappings, but mapping-obf whas the mapping where something went wrong and in spigot, it was just the issue from mapping-obf)

eternal night
#

issue was the send method right ?

waxen barn
#

yes

#

the send method is from mojang mapping

#

it should be a in the obfuscated form

eternal night
#

Well, not being able to replicate it is kinda bad xD

waxen barn
#

ik ;)

quaint mantle
#

how to get enchantment name
?
enchan.getname is deprecated

eternal night
#

closest is probably the key of its namespaced key

waxen barn
#

this is the description of getName

eternal night
#

did you just suggest people reading javadocs

#

you are crazy

waxen barn
eternal night
#

this is spigot help-development

#

no one reads javadocs

#

else this channel would be 30% as busy

waxen barn
#

btw

#

I tried to decompile whole custom entity class (idk why I didn't try it earlier)

#

and the obfuscation works only sometimes

#
public class Missile extends atw {
    Location mountingPoint;

    public Missile(Location l) {
        super(atk.f, ((CraftWorld)Objects.requireNonNull(l.getWorld())).getHandle());
        this.mountingPoint = l;
        this.setPos(l.getX(), l.getY(), l.getZ());
        this.bM = new MissileEngine(this, 10);
        this.bO = new MissileHomingSystem(this, this.level);
        this.setNoGravity(true);
        this.noPhysics = true;
    }

    protected void v() {
        this.bP.a(0, new PathfinderGoalFireMissile(this));
        this.bP.a(1, new PathfinderGoalTrackTarget(this));
        this.bP.a(2, new PathfinderGoalSelectMeteorite(this));
    }

    public void u_() {
        if (this.lerpSteps > 0) {
            double d0 = this.getX() + (this.lerpX - this.getX()) / (double)this.lerpSteps;
            double d1 = this.getY() + (this.lerpY - this.getY()) / (double)this.lerpSteps;
            double d2 = this.getZ() + (this.lerpZ - this.getZ()) / (double)this.lerpSteps;
            double d3 = ahb.f(this.lerpYRot - (double)this.getYRot());
            this.setYRot(this.getYRot() + (float)d3 / (float)this.lerpSteps);
            this.setXRot(this.getXRot() + (float)(this.lerpXRot - (double)this.getXRot()) / (float)this.lerpSteps);
            --this.lerpSteps;
            this.setPos(d0, d1, d2);
            this.setRot(this.getYRot(), this.getXRot());
        }

        if (this.lerpHeadSteps > 0) {
            this.yHeadRot = (float)((double)this.yHeadRot + ahb.f(this.lyHeadRot - (double)this.yHeadRot) / (double)this.lerpHeadSteps);
            --this.lerpHeadSteps;
        }

        this.level.ab().a("ai");
        if (this.eB()) {
            this.level.ab().a("newAi");
            this.ey();
            this.level.ab().c();
        }

        this.level.ab().c();
        this.level.ab().a("travel");
        this.move(aua.a, this.getDeltaMovement());
        this.level.ab().c();
    }

    public void knockback(double d0, double d1, double d2) {
    }
}
near crypt
#

?paste

undone axleBOT
near crypt
sharp bough
#
        if (this.eB()) {
            this.level.ab().a("newAi");
            this.ey();
            this.level.ab().c();
        }

        this.level.ab().c();
        this.level.ab().a("travel");
        this.move(aua.a, this.getDeltaMovement());
        this.level.ab().c();```
#

oh god

near crypt
#

?

timid kraken
#

is it possible to get the server minecraft version?

near crypt
vale cradle
waxen barn
sharp bough
#

a().b()

#

lol

vale cradle
grim ice
#

wat version should i code my plugins on

#

1.17 or 1.16.5

waxen barn
near crypt
#

@vale cradle i show it

ocean marsh
#

I will go step by step on what I do so if you see any problem you can hope fully help me

---- My Spigot plugin ----

First I register an outgoing plugin channel in my main class :
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");

Then I call the function load
load(pName, "Infractions");
load(pName, "Descriptions");

My function load :
public void load(String p, String name) {
ByteArrayOutputStream b = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(b);
try {
out.writeUTF("load");
out.writeUTF(name);
} catch (IOException e) {
e.printStackTrace();
}
sendToBungeeCord(p, b);
}

In this function I call the function sendToBungeeCord.
My function sendToBungeeCord :
public void sendToBungeeCord(String p, ByteArrayOutputStream b) {
Player pla = Bukkit.getPlayer(p);
pla.sendPluginMessage(Bobbies.pl, "BungeeCord", b.toByteArray());
pla.sendMessage("" + b);
}
Here is what my sendMessage gives me :

grim ice
#

?paste

undone axleBOT
waxen barn
grim ice
#

bruh

ocean marsh
#

---- My Bungee plugin ----

In my main class I extends Plugin and in my onEnable function I register listener :
getProxy().getPluginManager().registerListener(this, new onPlayerMessageEvent(this));

In this class I implement Listener and here is the event handler code :
@EventHandler
public void onPluginMessageEvent(PluginMessageEvent e) {
if (e.getTag().equalsIgnoreCase("BungeeCord")) {
DataInputStream in = new DataInputStream(new ByteArrayInputStream(e.getData()));
try {
String channel = in.readUTF();
System.out.println("chan " + channel);
if (channel.equals("load")) {
String name = in.readUTF();
loadConfig(getFile(name));
}
} catch (IOException ex) {
ex.printStackTrace();
}
}
}
Here Is what my sysout gives me

He says that the channel is Forward but never the channel load :(

So if someone can help me pls

near crypt
grim ice
#

?paste

undone axleBOT
grim ice
#

holy

torn shuttle
#

I've got a java question, say that I have (just pseudocode)

class A{
public A(boolean thing){...}
}

class B extends A{
public B(boolean thing){super(thing);...}
}

if I want

class B extends A{
public B(boolean thing, int blah){super(thing);...}
}

where my B class has a different constructor from class A, what is the easiest correct way of implementing this? I can think of at least a couple, but are there good ways to do this?

timid kraken
#

is it possible to get the server icon path?

vale cradle
near crypt
vale cradle
#

I don't see where you are struggling at

near crypt
torn shuttle
#

I could create a static method to force it somewhat but that doesn't sound like a clean or scalable way of doing it

#

ideally I'd want a setup where if I extend class b it would require all the constructors from a plus all the ones from b

vale cradle
torn shuttle
#

no, the one of class b

vale cradle
#

I mean, I don't know what is the actual problem

#

Just add more fields

#

That's it

near crypt
# vale cradle And? What do you get?

i get that but the user cant personalize the config (cant write something in the config) because everytime when the player joins the server the String resets

timid kraken
torn shuttle
#

if you extend class A it requires you implement a class with the same constructors

#

wait

#

fuck nevermind

#

I'm just being dumb

#

brain fart

vale cradle
#

idk, maybe try regex

torn shuttle
#

I'm gonna go get some more caffeine in me, clearly this isn't working out at my current levels

near crypt
#

.#

torn shuttle
#

thanks tommy

timid kraken
near crypt
timid kraken
torn shuttle
silk mirage
vale cradle
# near crypt .#

I mean, even if you explain me, I don't find many sense in the code you sent me, so show me an example: Either print the variables in the console or telling an example of the steps you're following and what you got

timid kraken
silk mirage
#

use new File("/server-icon.png)

#

check if it exists

#

otherwise you'll get a error

vale cradle
#

Just check the File#exists method

silk mirage
#

That is what I'm saying?

vale cradle
#

Yes, but no error is thrown

#

;p

silk mirage
vale cradle
#

nope

paper viper
#

Y’all bad use Path

#

Imagine using File

#

Smh

#

Mutable

vale cradle
#

neither the File constructor or the exists method throw an error if the file does not exist

timid kraken
silk mirage
#

use /

#

/ referes to the root

vale cradle
timid kraken
#

ok

silk mirage
vale cradle
near crypt
vale cradle
#

Because the file is not located into the root lol

silk mirage
vale cradle
#

And the file is on the CWD

paper viper
#

… use the provided methods

#

Why don’t you use the provided methods… lol

#

The getParentFile

silk mirage
#

hm

paper viper
#

To do whatever you need to do

#

And besides, anyways I’m not a big fan of file

faint lynx
#

so i have this code to register custom enchants but when i register the second enchantment(autoPickup in this case) it says that its already registered

vale cradle
paper viper
near crypt
# vale cradle ye

do you know how to do this i never worked with configs and dont understand it

vale cradle
paper viper
#

No they aren’t

vale cradle
#

I mean, both works good

paper viper
#

Java even mentioned to switch

#

They said that you should be sketching over to Path more

#

*switching

modest fog
#

I am new to spigot api, how to make a item disapear on right click on air
I added the events and also specified the custom item

paper viper
#

Mainly cause it’s immutable too

vale cradle
#

Mhm, I'd need to look more over it

vale cradle
#

Or System.out.println(msg) if you're lazy

near crypt
#

no it would always reset this is my problem

modest fog
quiet ice
#

if mutabillity is the concern then I do not see the actualy concern

vale cradle
near crypt
#

@modest fog no the type of the material

modest fog
#

K

#

thx

paper viper
#

And also I recommend to turning that into an enum

#

For the enchants

vale cradle
faint lynx
paper viper
#

Well I meant

#

Send the important parts

#

Like the EnchantmentWrapper

near crypt
faint lynx
#

    private final String name;
    private final int maxLvl;

    public EnchantmentWrapper(String namespace, String name, int lvl) {
        super(NamespacedKey.minecraft(namespace));
        this.name = name;
        this.maxLvl = lvl;
    }

    @Override
    public String getName() {
        return null;
    }

    @Override
    public int getMaxLevel() {
        return 0;
    }

    @Override
    public int getStartLevel() {
        return 0;
    }

    @Override
    public EnchantmentTarget getItemTarget() {
        return null;
    }

    @Override
    public boolean isTreasure() {
        return false;
    }

    @Override
    public boolean isCursed() {
        return false;
    }

    @Override
    public boolean conflictsWith(Enchantment enchantment) {
        return false;
    }

    @Override
    public boolean canEnchantItem(ItemStack itemStack) {
        return false;
    }
}```
near crypt
#

broooo

#

what are you doing

#

?paste WTF!!

undone axleBOT
vale cradle
modest fog
#

So I just have to add
Material.AIR;
right

#

also new to java

vale cradle
faint lynx
near crypt
#

@vale cradle ye

paper viper
#

Why do you register twice lol

vale cradle
paper viper
#

You are recalling the same method over and over again

vale cradle
#

It's kinda heavy method so try calling them the less as possible

paper viper
#

Oh wait nvm

#

My eyes are broken

#

It’s not recursive, but still you are registering it twice

vale cradle
paper viper
#

I need glasses

modest fog
#

Just asking to set material to air All i have to do is this right
Material.AIR;

vale cradle
near crypt
vale cradle
modest fog
#

*I didnt knew i had to keep ItemStack

#

Will keep in mind

vale cradle
near crypt
#

ok

#

but when i set it on server start it would reset on every server start...

modest fog
#

What does this mean, It came when I tried to set the Item as Air
Non-static method 'setType(org.bukkit.Material)' cannot be referenced from a static context

near crypt
#

?

vale cradle
#

Just do whatever fit to your needs dud

near crypt
#

okay

vale cradle
prisma needle
#

hey guys, I'm working with bungeecord config stuff atm, and I was wondering if it's possible to know if a boolean is set to false.
enabled: false
The thing is, if I simply get the boolean, it will return false if there is anything other than true, and I need to know specifically if the value is false. Is there any way to do this? :)

faint lynx
modest fog
#

Note I am Very Dumb | Srry for that
So how to get ItemStack as an instance

#

Wish Could right plugin in js

eternal oxide
prisma needle
#

but if it is false, why would it contain true?

#

Oh nvm I see what you are saying

eternal oxide
#

it would not, contains will tell you if there is really an entry stored for that boolean

vale cradle
prisma needle
#

Perfect, will give that a go

modest fog
#

New to Java

#

and no

vale cradle
#

JS also supports OOP

modest fog
#

I feel dumb being here

modest fog
#

I just kinda learnt by making discord bot

vale cradle
#

So ye, take a class about OOP

modest fog
#

time to go back to youtube

#

:(

vale cradle
#

I mean, will sound sad, but you can't do nothing so special if you don't know OOP in Java

modest fog
#

really gotta go to java now

eternal oxide
#

?learnjava

undone axleBOT
modest fog
#

time to go to my old buddy

#

codecademy

vale cradle
#

OOP is not a Java concept

#

Is a paradigm

#

Applies to the most of programming languages

modest fog
#

so

#

like in js

#

me making discord bot

#

but using different folders

#

to keep different things

#

like one for events
one for handler
one for commands

#

Thats what my one brain cell mind can think of

vale cradle
#
wikiHow

A well-written sentence is the foundation for both good writing and good written communication. There are several rules, as well as types of sentences, that a writer needs to be aware of in order to excel at writing, however. Once you have...

#

But I think yes, u right

#

You will know when you already learn it lol

modest fog
#

but i dont know

#

Intresting

prisma needle
sullen dome
#

is there actually an easier way to check if a block can be broken by the current tool than like this:

if (player.getInventory().getItemInMainHand().getType().equals(Material.IRON_PICKAXE)){
  // break block
}

smt like if(player.canBreakBlock(Block/Material))

dusk flicker
#

Not really because people can basically break every block using their fist if they take long enough

sullen dome
#

no i mean

#

like diamond ore needs an iron pick

eternal oxide
dusk flicker
#

I doubt there will be any methods like you want because you're looking for a way to check if the player's item is high enough to get a loot drop; not actually break the block

sullen dome
#

yea

dusk flicker
#

You could always make you're own util

#

Just, doubt it'll be clean

sullen dome
#

yeah sure, just wanted to ask if there already is a way

#

i'm not entirely sure tho, what this would do

dusk flicker
#

What class is that under?

sullen dome
#

Block

dusk flicker
#

That should work actually

#

So if you get a block from a material, you check the players hand itemstack with that method and if its true that tool is correct

sullen dome
#

i mean.. idk what it means by preferred tbh

dusk flicker
#

Try it; Looks like it would work

sullen dome
#

where it will break just faster

dusk flicker
#

Only one way to see ¯_(ツ)_/¯

sullen dome
#

well yea...

silk mirage
ivory sleet
#

I dont see any lambdas there despite what the link suggests thonk

ivory sleet
#

oh nice

modest fog
#

Note I am Very Dumb | Srry for that
So how to get ItemStack as an instance
Will Learn OOP In a While, Really gotta make this rn

chrome beacon
#

You keep saying that

ivory sleet
#

learn oop first

chrome beacon
#

Also read the javadocs

modest fog
#

Ok

ivory sleet
#

dont defer it anymore

modest fog
#

sad

#

Goes Away

silk mirage
#

OOP is easy

#

its really just a basic concept

ivory sleet
#

everything is easy once you understand it good enough

torn shuttle
quiet ice
#

"How to get ItemStack as an instance" is more of a "???" question that "learn OOP"

torn shuttle
#

is it just me or is the leather armor meta really odd

#

does minecraft actually render colors that aren't the pseudo-enums in the api?

quiet ice
#

pretty sure leather armour supports full RGB

torn shuttle
#

huh really?

quiet ice
#

Yes, why else would it show you the RGB values of it?

torn shuttle
#

ah that is one dangerous line of logic to follow lol

quiet ice
#

There are 12,326,391 (73.4% of sRGB) colors leather armor can be, as it is possible to put more than one dye on the crafting bench alongside the leather armor.

#

The logic isn't dangerous, it makes very much sense. Developers will not implement a rarely used feature just for fun

grim ice
#

why is my plugin config not saving when i reload

ivory sleet
#

it should only read from the file, not save tho?

grim ice
#

no like

#

if i make changes to it

ivory sleet
#

yeah exactly

grim ice
#

llike change true to false

#

and reload

#

it will disspaear

ivory sleet
#

oh send ur code then Ig

grim ice
#

no not the file

#

my changes

#

will dissapear

#

what code?

ivory sleet
#

the appropriate code

grim ice
#

okay

silk mirage
#

ahh yes

#

im killing my time doing things that i know

grim ice
#

public void onEnable() {
        INSTANCE = this;

        recipes.addRecipes();
        getServer().getPluginManager().registerEvents(new onJoin(recipes), this);
        getServer().getPluginManager().registerEvents(new Mineable(), this);
        getCommand("mineablespawners").setExecutor(new Changeconfig());
        getCommand("craftenchants").setExecutor(new Changeconfig());

        saveDefaultConfig();

    }```
#
mine-spawners-with-silk-touch: false
craft-enchants: true
#  turn on first option if you want players to be able to break spawners with silktouch and drop them
# (ncluding the spawn egg)
# turn off second option if you do not want craftable enchants.
#

@ivory sleet sry for pinging

ivory sleet
#

thats not all

grim ice
#

what do i add

#

?paste

undone axleBOT
grim ice
#

,

#

r u here

silk mirage
#

omg, singleton again

ivory sleet
#

yes but I cant read the code, barely

iron condor
#

is MaterialData depricated?

ivory sleet
#

mye

silk mirage
#

Construtor, setters are near to non existence for alot of people :/

iron condor
#

how can I check if item is a bed?

ivory sleet
#

thats not a singleton

grim ice
silk mirage
ivory sleet
#

just an exposed static field

grim ice
#

oh

ivory sleet
#

probably final

silk mirage
grim ice
#

what

#

where

ivory sleet
#

the name hints so

silk mirage
#

you can't assign value to final

ivory sleet
#

yes you can

silk mirage
#

waa

grim ice
#

oh u mean my instance?

#

I'm confused

silk mirage
#

aren't final supposed to be constant?

ivory sleet
#

static final Object OBJECT = new Object();

#

assignment right there

#

well yea you cant re-assign

silk mirage
ivory sleet
#

at least not without something like reflection

#

but even then, its quite limited

silk mirage
#

he is not using inline decleartion

#

he is doing late declaradtion

grim ice
#

?

ivory sleet
#

oh yeah you're right

grim ice
#

wdym

silk mirage
#

nothing hex

ivory sleet
#

I didnt pay attention to the former code

grim ice
#

is it something i should worry about

silk mirage
#

not really

#

but in real apps, YES

grim ice
#

if so please tell me

ivory sleet
#

probably non of your concerns as a spigot dev

grim ice
#

o

#

so

#

any solution

#

for my problem

silk mirage
#

just don't use unnecessary static words, use construtor, setters or some kind of dependency injection

ivory sleet
#

anyways you have to call Onceuncraftable.INSTANCE.getConfig().saveConfig() or saveDefaultConfig() after setting a value

silk mirage
grim ice
#

I did.

silk mirage
#

oh sorry, it was up

ivory sleet
#

just like if you were to change the file in an editor

grim ice
#

you guys flooded the chat

silk mirage
#

or manually make the file

ivory sleet
#

?

grim ice
#

its

#

Onceuncraftable.INSTANCE.saveConfig();

ivory sleet
#

yeah

#

call that after setting a value, should be enough for you

grim ice
#

so for my case

#
if (args[0].equals("true")) {
                        if (Onceuncraftable.INSTANCE.getConfig().getBoolean("mine-spawners-with-silk-touch")) {
                            sender.sendMessage(ChatColor.GREEN + "It's already true!");
                        } else {
                            Onceuncraftable.INSTANCE.getConfig().set("mine-spawners-with-silk-touch", true);
                            Onceuncraftable.INSTANCE.saveConfig();
                        }
                    }```
ivory sleet
#

yes

grim ice
#

Alright, thanks il try it

silk mirage
#

Why is jshell so dumb

#

oh well, time to do kotlin plugin development

quiet ice
prisma needle
silk mirage
# quiet ice I do not see any issue

intersting that you don't see issue,

class Test{
        public final String e = "eee";
        public static void main(String[] args) {
                new Test().e = "eaf";
        }
}
#

do u see the issue now?

ivory sleet
#

looks fine

#

its final so?

quiet ice
#

jshell is not meant as a class parser

silk mirage
#

but not on jshell

#

:/

ivory sleet
#

oh fair

quiet ice
#

I do not see why jshell would even be needed outside of a quick System.out.printf("%X", 45)

silk mirage
#

for basic testing?

#

i use vim or sublime sometimes and i don't have auto complete

quiet ice
#

So do I

silk mirage
quiet ice
#

But jshell likely does also not have autocomplete

silk mirage
#

kinda rude

quiet ice
#

I see

silk mirage
#

oh well, i wonder when copilot will support java

steady turret
#

How many developers needs to make a new spigot.jar?

silk mirage
#

i got it for other 5 lang but still sad cuz i just use kotlin and java mainly

vivid temple
#

how can i let something happen when a mob hits a player?

hasty prawn
steady turret
#

To make a new spigot like paper, bulkier and etc

steady turret
quiet ice
#

Ah, fork

vivid temple
silk mirage
#

spigot is bukkit fork

#

bukkit is mc fork

quiet ice
#

You mean something like Spongepowered or something like paper?

steady turret
#

Yes

#

How long it will take to make a fork v

#

?

hasty prawn
#

Depends on what you're doing

quiet ice
#

you don't randomly create a fork for no reason at all

silk mirage
#

first get a plan

#

like, just to fix dupes you won't have to create a fork of spigot when paper already has that feature

quiet ice
#

I personally have plans of creating a fork myself (with the goal of having bukkit with mixin support) - though this will take a very long time to get completed

steady turret
#

@quiet ice I dm you, I would like to talk to you 🙂

hasty prawn
#

Aren't patches kinda like mixins?