#help-development

1 messages Ā· Page 2262 of 1

formal bear
#

can i go with

#

headBlock.getOwningPlayer.getUUID == and then take the generated profile

fossil nebula
#

Having a bit of a weird problem. I'm trying to unpower a lever by setting powered=false in the lever-block's blockdata. It's working (like visually flipping the lever) but nearby redstone are not getting updated until a block gets placed/broken nearby them and triggers a block update. Is there a way to flip the lever so that it actually updates the surrounding blocks?

formal bear
#
        Skull headBlock = (Skull) event.getClickedBlock().getState();

        SkullMeta head = playerHead.checkCustomHead(headUrl, headName, headDisplayName);

        if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
            if (headBlock.getOwningPlayer().getUniqueId().equals(head.getOwningPlayer())) {
                //code
            }
        }
sterile token
#

Ba patient

#

As i always say instant support == paying someone or a team

#

You are not paying anyone to get fast help

formal bear
#

I'm just showing my code if there's something wrong with it chill

sterile token
#

Lmao what a lovely sociente we have

formal bear
#

I'm not expecting anyone to help me

sterile token
#

You already share the code

#

So be patient

#

You do it some minutes ago

#

If want to persis your message open a thread

fleet comet
#

im using the lamp framwork
and im using this java public class TestCommand { @Command("echo") public String echo(@Default("") String message) { Bukkit.getLogger().info("it gets here"); return message; } } Right, it logs that when i do that command. but the message does not get returned? anybody know why?

manic bison
native nexus
wintry badger
#

hi guys. i am trying to create a plugin that switches the player's server in bungeecord by commands

#

I get this

#

Attempted to send a plugin message through the unregistered channel BungeeCord'.`

#

here is my code:

#

`ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF("survival");

    if (sender instanceof Player) {
        Player player = ((Player) sender).getPlayer();
        player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray());
    }`
#

I found that:

getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");

#

should i do that in my spigot plugin?

eternal night
#

Indeed

wintry badger
#

awesome, im on it. thanks

signal ether
#

From a "best practice" standpoint, which revisions of each game version ought a multi-version plugin support? All of them, or just the final minor version (eg R3)?

For instance should 1.13 be supported as well as 1.13.1 even though the former is considered obsolete? Or should both of them be tossed out for 1.13.2 only?

lost matrix
lost matrix
signal ether
#

So, the standard is only the most recent minor version of each?

river oracle
river oracle
#

You van also skip versions

#

Like 1.14 and 1.13

signal ether
#

The major blockers are 1.8 and 1.12 which I might not even support

buoyant viper
#

feel like the best way to go is last version of every major update

river oracle
#

Not worth it

lost matrix
#

Dont bother with anything below 1.16

#

With 1.16.5+ you cover >75% of the community

signal ether
#

It's been a few years since I've been into spigot stuff so I'm glad the paradigm has finally shifted. I was once hired for a 1.8.8 server and I literally cried

paper viper
#

You are probably going to hate yourself

river oracle
#

I quit coding in 1.8 after I finished my first plugin

buoyant viper
lost matrix
#

1.8 is a bubble. People in there think they are the biggest community and everyone just plays 1.8

signal ether
#

yeah no i have no intention of supporting 1.8

river oracle
lost matrix
river oracle
#

Simply put they are the biggest community who actively believes they are the biggest community

buoyant viper
#

xd

#

yatopia 0%, just as god intended

river oracle
#

Wtf is yatopia

buoyant viper
#

wtf is CatServer

delicate lynx
#

yatopia was bad

buoyant viper
#

i wish i never looked that up

delicate lynx
#

oh no

signal ether
#

sponge is noticeably missing from the chart

buoyant viper
#

that was the bukkit / spigot chart

signal ether
#

ah

buoyant viper
#

sponge has its own category on bstats

#

jeez sponge

#

wtf spigot stats were 50/50 on the offline mode

#

what are sponge players doing

paper viper
#

Shady shit

signal ether
#

might be offline mode because they're on spongeforge?

#

idk

buoyant viper
#

what about spongeforge requires offline though

#

ive never actually used sponge at all

manic bison
delicate lynx
#

1.9 šŸ’€

signal ether
buoyant viper
#

huh, weird

fossil nebula
#

I'm writing a plugin in a modern version, fully aware that there's a decent chance none of the people I'm writing it for will use it, since they basically only play on 1.8 lol

buoyant viper
#

why not build towards the target audience then?

fossil nebula
#

I was half joking lol. People are interested in playing an old gamemode in new versions, so I'm making a proof of concept so that people can test it.

#

but there's a decent chance most people wont want to update even if there was a functional plugin for a current version

signal ether
buoyant viper
#

is protosupport better than via? :poggers:

paper viper
#

Both bad

signal ether
#

well no, my point is that viaversion generally allows new clients on an old server, vs protocol support supports old clients on new servers

paper viper
#

They keep the evil alive

river oracle
signal ether
#

i was commenting on server owners hate updating sometimes

buoyant viper
#

via also allows old clients on new servers though

signal ether
#

last i heard it was unmaintained

river oracle
#

Someone lied to you

buoyant viper
#

it got an update 5 days ago on git

manic bison
river oracle
#

Change it to 1.18.2 you can through the launcher

buoyant viper
#

oh :( just a build system update

fossil nebula
wintry badger
#

what is the proper way to add aliases to a command?

buoyant viper
#

oh laast common's update was 21 days ago

paper viper
signal ether
river oracle
#

Bukkit command api šŸ’€

wintry badger
paper viper
#

No

paper viper
river oracle
#

Iirc

formal bear
#

How to build jar file with name like {name}-{version}.jar?

<finalName>${project.name}-${project.version}</finalName>
river oracle
#

Depends

paper viper
#

Are you using anything like maven shading

#

Cause it will depend yeah

river oracle
signal ether
paper viper
# river oracle Is brigadier nice

It’s provided into the server and it’s fine. It doesn’t use annotations (and personally I prefer not to use annotation)

paper viper
river oracle
fossil nebula
formal bear
wintry badger
#

is there any way to override bungee commands in a spigot plugin? if players dont have access to ./server command, then it doesnt go through my spigot plugin

paper viper
#

One of the cool things you can do with brigadier is that you can add argument coloring (like LuckPerms)

#

You just use commodore

#

LuckPerms uses brigadier btw

smoky oak
#

lmc

buoyant viper
#

oh bukkit command registry already adds the aliases from plugin.yml and im just stupid, nice.

#

couldve sworn i remember having to manually call setAliases

river oracle
paper viper
#

Because brigadier is used by both the client and server

river oracle
#

Ahhh

buoyant viper
#

bc bukkit commands bad

olive lance
river oracle
#

You don't have to shade brigadier right

paper viper
#

You shouldn’t have to in newer versions

river oracle
#

No

#

I answered my own question by thinking

buoyant viper
#

use commodore ezpz

paper viper
#

Well commodore itself isn’t a command API

buoyant viper
#

ik

paper viper
#

You just use it to add the nice colored arguments

#

Yeah

lost matrix
fossil nebula
olive lance
#

how is that relying on minecraft to bring new features?

river oracle
#

All minecraft pvp systems are bad

olive lance
#

by removing a feature they added

lost matrix
fossil nebula
#

minecraft sword mechanics have always been kinda shallow but like anything else people have put a massive amount of time into them and now like them

olive lance
#

shit im not even trying to do this lmao

#

tell Oc_

lost matrix
fossil nebula
#

I think a whole new combat system sounds cool, you don't need to convince me

#

but that's a hard sell to a bunch of old timers that are very attached to 1.8 combat mechanics

olive lance
lost matrix
olive lance
#

Mojang already designed a entirely new combat system in 1.9, and people didnt like it

smoky oak
#

they just added crits

lost matrix
olive lance
#

thats true i guess

#

its still a lot of people though

lost matrix
#

Meh. Going towards <5%
Thats not a lot of people in my books.

fossil nebula
#

at the crux of the issue I guess is that the core of the pvp community stayed behind and the casual player base kept going. And so now you have to pick sides, and leaving behind either is not that great

olive lance
#

5% of minecraft users is a lot of people I would have to disagree

lost matrix
#

In comparison to 75% 1.16+

olive lance
#

we should run a poll

lost matrix
paper viper
#

Those 1.8 people are going to die out eventually

#

They are slow of dying out but eventually they will be too deprived

#

Stupid mobile autocorrect

olive lance
#

yea i was one of them but im not a player anymore so i guess that is most folks but im sure a lot of people still dev on spigot and keep the same opinions

#

the only servers running 1.8 now are hardcore factions

paper viper
#

I see why people stayed on 1.8 for a while when I just play normally, but I felt that I always liked newer versions not just development wise, but also it’s just the best to play SMPs on

#

It’s not fun to play 1.8

#

With SMP

olive lance
#

yeah

#

now the case for a pvp focused server

#

pre 1.9 combat is preferred because 1.9 shrinks 'skill'(CPS) gap

wet breach
#

1.8 takes less skills combat wise then the other versions after it

fossil nebula
#

I just don't have the confidence that there's a community for this gamemode in new versions. The gamemode here is very archaic, for a lot of people the only reason they're still playing it has atleast something to do with nostalgia. People have gotten incredibly good at a certain set of skills and changes to the game (improvements I mean). It's been in this situation for years and years and has only survived on the fact that the people who do play it, play a shit ton. Updating the gamemode would mean dropping almost the entire existing playerbase (which albeit is small) and replacing it with an entirely new one

lost matrix
olive lance
#

lmao i never even thought of that wtf

lost matrix
olive lance
#

all my days

fossil nebula
lost matrix
#

I have one of those wheels that can be unlocked and spun for ever

wet breach
#

same

olive lance
#

either way we shouldnt argue over these opinions... the whole argument is whether or not people want to play on 1.8

#

and they do

#

because we have seen them

formal bear
#

Could anyone explain it to me why is it not working?

CraftBlockState cannot be cast to class Skull
Block block = event.getClickedBlock();
Skull head = (Skull) block.getState();
wet breach
#

I have a 7 button mouse

lost matrix
#

Well... a minority does

olive lance
#

a minority of people play any kind of server

eternal night
#

Nor is spigot the server software to use for 1.8

olive lance
#

doesnt mean they shouldnt exist

lost matrix
#

org.bukkit.block.Skull

wet breach
# olive lance doesnt mean they shouldnt exist

the main problem of those that run 1.8 is the majority of those minority still keep coming here for support because they don't have a clue in what they are doing, or simply don't or refuse to understand that any problems encountered in obsolete versions, is solely on them to fix or resolve themselves

eternal night
#

Yea, if you wanna run older versions it is a necessity to find a fork of spigot that is maintained for that version

paper viper
#

I tried to update a 1.8 forge mod to 1.19 and I gave up heeheehaw

olive lance
#

I think the solution to that problem would be add 1.8/1.7 combat as some kind of option in spigot by default perhaps?

wet breach
#

there is plugins that exist already for it

olive lance
#

then everyone would run newer versions

paper viper
#

Plugins already exist as said above

lost matrix
#

And another problem is that they always come here for the same reasons.
Hey i wanna write a [KitPvP, GenericMinigame, FFA] plugin. How i do that? The other 24 plugins on spigot are not enough.

paper viper
#

Adding a feature would not help

olive lance
#

true

kind hatch
olive lance
#

at least with 1.7

eternal night
#

I mean, /pray that Mojang goes forward with the combat snapshots one day lol

olive lance
#

idk why nobody ever comes in here asking about 1.7. its better than 1.8

ivory sleet
#

Oh no

olive lance
#

when 1.8 came out it was a big deal cause they took out block hits

fossil nebula
ivory sleet
#

Don’t

paper viper
ivory sleet
#

1.7 is worse by all means

wet breach
olive lance
#

block hits are so satisfying

paper viper
#

The only reason it would be better is modded play style lol

eternal night
#

1.7 didn't even get the log4shell fix did it

paper viper
#

But never ever in any other circumstance

lost matrix
#

Isnt asking for 1.7 a bannable offense?

fossil nebula
#

we had a hard time updating from 1.7 to 1.8 because water pushing tnt entities was too big of a change for people lol

eternal night
#

Lmfoa

signal ether
#

guys guys, hear me out.... 1.0

olive lance
#

1.7 got a log4j patch on something

#

not spigot tho ithinlk

eternal night
#

Good

wet breach
#

was 1.7 even using log4j?

eternal night
#

Still sad spigot patched 1.8

formal bear
#

I have only this import

import org.bukkit.block.Skull;
lost matrix
#

I still think that the log4shell could have been a great cleansing

lost matrix
eternal night
#

It could have been

paper viper
#

The purge

eternal night
#

Someone should have made a movie

formal bear
lost matrix
ivory sleet
#

Lmao

paper viper
#

Kekw

wet breach
#

with as much history there is involving MC that isn't in MC, there is enough material for like 2-3 movies XD

eternal night
#

It's gonna be a fitmc video isn't it XD

lost matrix
fossil nebula
paper viper
#

Lol

paper viper
lost matrix
eternal night
#

server

paper viper
#

in

lost matrix
#

minecraft

eternal night
#

I hate this

lost matrix
#

i love it

ivory sleet
#

I like that

fossil nebula
lost matrix
#

i like and subscribe that. Migh even hit the notification button

wet breach
# eternal night server

if I make a movie, it wouldn't really be much of a movie, but rather single player maps that you have to play through and you get to learn about historical stuff

olive lance
#

when hypixel was a mapper

#

them maps were crazy

lost matrix
fossil nebula
#

I think that's kinda what I'm already doing?

Block block = location.getBlock();

BlockData data = block.getBlockData();
Switch sw = (Switch) data;

sw.setPowered(powered);
block.setBlockData(sw,true);
block.getState().update(true);

Block attached = block.getRelative(sw.getFacing().getOppositeFace());
attached.getState().update(true);
#

(I'm also trying to update the block that the lever is attached to in hopes that would help)

trail oriole
#

How do I get the name of an inventory ?
getName() doesn't exist

#

or not anymore idk

ivory sleet
#

InventoryView

kind hatch
trail oriole
#

I'll google that, thank you

trail oriole
#
ItemStack head = new ItemStack(Material.PLAYER_HEAD,1);
SkullMeta headMeta = (SkullMeta) head.getItemMeta();
headMeta.setOwner(player.getDisplayName());
head.setItemMeta(headMeta);``` is it normal to use skullmeta for a player's head and not skull ?
paper viper
#

Lol

trail oriole
#

i'm comparing strings to titles

kind hatch
trail oriole
#

It requires a string and not a UUID though

kind hatch
#

Oh right. SkullMeta#setOwningPlayer(UUID uuid) is what you'd want to use.

trail oriole
#

still no

#

it requires an offline player

#

not an UUID

paper viper
#

Just create it from the uuid

trail oriole
#

okay

kind hatch
#

Bukkit#getOfflinePlayer(UUID uuid)

trail oriole
#

getOfflinePlayer() gets both online and offline players right ?

kind hatch
#

No, it just gets an instance of OfflinePlayer .

trail oriole
#
        OfflinePlayer headed = Bukkit.getOfflinePlayer(player.getUniqueId());
        headMeta.setOwningPlayer(headed);``` I have that
#

i know I can optimize it but my point is does this work ?

kind hatch
#

Try it and see. It should as long as #setOwningPlayer accepts a OfflinePlayer instance.

trail oriole
#

okay

#

thank you

kind hatch
#

You do if your method calls for an OfflinePlayer instance. Which SkullMeta does.

formal bear
#

Is there a way to store Gameprofile? I dont want to generate it for Skull because i have already placed some, I want to generate it once then load it everytime i reload the server

#

Or is it better to store positions of placed Skulls

buoyant viper
#

if ur just trying to set the playerhead from a player u just... do it

formal bear
#

I use NMS for custom texture

buoyant viper
#

ah

#

oh wait i was sending that for @trail oriole anyway

#

not U smh

#

but also i think theres something on spigot forums for nms heads

last swift
#

How can I optimize reading a text file/make it asynchronous? I have a really large text file that’s about 30mb and upon reading it, the entire server freezes because it’s so large (it contains a 50x50 map). How can I optimize this or at least have it run in the background to prevent server lag?

kind hatch
#

Why do you have a map, that's most likely in string form, saved to a single file?

#

Also, depending on what you do with that data, you may need to split the process up synchronously as some functions such as block modifications are not thread safe.

paper viper
#

If you need to make it asynchronous (for file operations), use CompletableFuture and then use callSync on the asynchronous thread

buoyant viper
#

is it like a schematic file lol

kind hatch
formal bear
buoyant viper
#

woo

quaint mantle
#

šŸ˜„

somber hull
#

Ok

buoyant viper
quaint mantle
#

šŸ› ļø

#

šŸ‘šŸæ

kind hatch
#

Would have saved me some time trying to find it. lol

royal nest
#

what events would I need to cancel if I wanted a skulker box to be unable to be placed? Just player placing and dispenser dispensing? or are there other events?

willow widget
kind hatch
royal nest
willow widget
#

Yup I could

kind hatch
#

I'm pretty sure it does as long as you use ChatColor#translateAlternateColorCodes()

willow widget
formal bear
#

How to change Material of BlockData when chaning Skull? It works with any other normal block just not with Skull

eternal oxide
#

Skull IS a Material

karmic stirrup
river oracle
#

Your importing classes that can't be found and it's getting confused on runtime iirc you can't structure code like that

#

Also If your telling the owner they need it anyways just send logging with the error that's readable

eternal oxide
#

The Listener is fine, but you import Protocol stuff so you have imports. Move everything into your Listener class

vast musk
#

is there a way to call a datapack mcfunction from a plugin?

jagged shoal
#

Hi I'm extremely new to coding and trying to find a working replacement for vault as it doesn't work with 1.18.2 currently, not unless it has a dependency that I'm not aware of? Please and thank you!

eternal oxide
#

Vault works fine

lost matrix
#

vault works well for 1.18

jagged shoal
#

If i put it in it doesn't show up using plugman

lost matrix
#

Dont use plugman. Dont reload your server.
Restarting is the only thing that is supported.

#

And if its not listed in the spigot plugin list (/pl)
then its not in the plugins folder. Its either red or green.

jagged shoal
#

Red or green?

lost matrix
#

Text color of the plugin name

jagged shoal
#

Thank you! I don't really know what I'm doing šŸ˜…

craggy cosmosBOT
#

:dynoError: The Fun module is disabled in this server.

agile quest
#

Listen please, I'm a beginner in plugin creation and I have an error. It's a very simple error to fix but I don't understand people who explain how to fix it. If someone wants to help me, please, can I send you the code and can you just tell me what to write and where to do it

lost matrix
lost matrix
#

Alright then paste your code here

vocal cloud
#

?paste your code

undone axleBOT
lost matrix
#

And tell us whats wrong

eternal oxide
#

Looks to be typing a book

#

We just need the error

agile quest
#

i have this Exeptions:
Caused by java.lang.NullPointerException: Cannot invoke "fr.sniper.developer.developer.db.Database.findPlayerStatsByUUID()" because "this.database" is null

lost matrix
#

The classic Nullpointer...

agile quest
#

i know it's simple to fix

eternal oxide
#

Then "this.database" is null

lost matrix
#

Well... make sure you initialize the "database" variable before you use it.
Otherwise the content will be "null" and doing anything with a null object results in a null pointer.

eternal oxide
#

If you show us the full error we can tell you what code we need to see

agile quest
eternal oxide
#

two constructors taking different args

lost matrix
eternal oxide
#
    public Listeners(main main) {
        this.main = main;
        this.database = main.getDatabase();
    }```
lost matrix
agile quest
#

i know

eternal oxide
#

Synchronous database queries.

agile quest
#

Just allow me to test something

lost matrix
#

IO should never be done on the main thread.
No writing/reading files, no database requests, no http requests.

eternal oxide
#

No shame in making mistakes. The best way to learn is to make them and be told what's wrong.

agile quest
eternal oxide
#

if database is available from main just get it in teh constructor as I showed

quaint mantle
#

whats your plugin name

agile quest
#

SkyCoins

eternal oxide
#

Then rename Main to SkyCoins

earnest forum
#

looks like your class name starts with a lowercase? that's not good either

eternal oxide
#

apps have a Main class. Plugins are extensions so should have no Main

agile quest
#

It's correct to write this in my main class ?Objects.requireNonNull(getCommand("mmcc")).setExecutor(new Listeners(this));

eternal oxide
#

kind of. You need to store the reference to teh new Listeners as you also need to register it.

lost matrix
eternal oxide
#

as your Listeners has a command and Listeners

agile quest
eternal oxide
#

Where do you create your database in main?

agile quest
eternal oxide
#
getServer().getPluginManager().registerEvents(new Listeners(database), this);
Objects.requireNonNull(getCommand("mmcc")).setExecutor(new Listeners(this));```
#

You are creating two instances of Listeners

agile quest
#

ok

#

What should I write instead ?

eternal oxide
#
Listeners listener = new Listeners(this, database);
getServer().getPluginManager().registerEvents(listener, this);
Objects.requireNonNull(getCommand("mmcc")).setExecutor(listener);```
#

or fi you changed yoru constructor...

#

edited

agile quest
#

this the changements that i made

#

is this good ?

agile quest
#

database is available from Database.java

vocal cloud
#

I wish intellij would stop recommending Objects.requireNonNull people don't understand it's purpose YanSigh

eternal oxide
agile quest
#

ok ok

agile quest
eternal oxide
#

Listeners listener = new Listeners(this, database);

agile quest
#
        at fr.sniper.developer.listener.Listeners.getPlayerStatsFromDatabase(Listeners.java:48) ~[?:?]
        at fr.sniper.developer.listener.Listeners.onCommand(Listeners.java:165) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
        ... 20 more```
dusty herald
#

i dont know why

iron glade
#

Any creative people here have an idea what I could call a troll command that spawns an entity twice after it has been killed?

dusty herald
#

martyrdom

iron glade
#

does it have a meaning? :D

dusty herald
iron glade
#

xD

#

sounds good

iron glade
#

whats wrong?

agile quest
#

Ƭ have this error Caused by: java.lang.NullPointerException: Cannot invoke "fr.sniper.developer.db.Database.findPlayerStatsByUUID(String)" because "this.database" is null at fr.sniper.developer.listener.Listeners.getPlayerStatsFromDatabase(Listeners.java:48) ~[?:?] at fr.sniper.developer.listener.Listeners.onCommand(Listeners.java:165) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?] ... 20 more

dusty herald
#

because "this.database" is null

#

show code

dusty herald
#

ok now main class code

agile quest
#

i have this error when i tried the command: /mmc add <player_name>

dusty herald
#

problem lies here

#
    private Database database;

    public Listeners(main main) {
        this.main = main;
        this.database = database;
    }
eternal oxide
#

because you didn;t do as I said

dusty herald
#

database is never initialized here

#

oh my god

iron glade
#

Why is main lowercase

dusty herald
#

thats why i said

#

oh my ogd

#

this is

agile quest
#

don't beat me guys

dusty herald
#

its

#

ok

iron glade
#

You should stick to java naming conventions tho

eternal oxide
#

in your main add java public Database getDataBase() { return this.database; }Then use the constructor I showed you right at the beginning.

quaint berry
#

Sorry to butt in again but does anyone know a good way for plugins to talk to each other

#

?

dusty herald
quaint berry
#

Lemme explain

vocal cloud
#

?jd-s

undone axleBOT
quaint berry
#

I have 4 custom made plugins but I need to share a boolean between them all

dusty herald
#

apis?

vocal cloud
dusty herald
#

i want tacos now

#

thanks bro

#

😭

vocal cloud
#

šŸ‘

dusty herald
#

im too high to drive

quaint berry
#

I'm guessing just adding a discord bot could also work?

#

And having a specific discord text channel?

#

Sounds overkill but I know how to make discord bots with JDA easy

#

?

iron glade
#

Now that you mention it

#

Are there any good tutorials on how to implement a discord bot to your plugins? To log stuff to a text channel or smth like that

vocal cloud
#

It's pretty easy. Just make a thread and run it on that

quaint berry
#

Yeah

iron glade
#

oh okay

quaint berry
#

Thanks, (I forgot how threading works in Java lmfao)

agile quest
#

is this ok ? ```public final class Main extends JavaPlugin implements Listener {

public static Main INSTANCE;
private HashMap<String, Integer> scplayers;

public String prefix = "[SkyCoins] ";
private Database database;

public Database getDataBase() { return this.database; }


@Override
public void onEnable() {

    scplayers = new HashMap<>();

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

    saveDefaultConfig();
    this.database = new Database(
            getConfig().getString("database.host"),
            getConfig().getString("database.port"),
            getConfig().getString("database.user"),
            getConfig().getString("database.password"),
            getConfig().getString("database.database_name"));
    try {
        this.database.initializeDatabase();
    } catch (SQLException e) {
        e.printStackTrace();
        System.out.println(prefix + "Could not initialize database. Check the config.yml file");
    }

   
   
    Listeners listener = new Listeners(this);
    getServer().getPluginManager().registerEvents(listener, this);
    Objects.requireNonNull(getCommand("mmcc")).setExecutor(listener);
iron glade
#

?di

undone axleBOT
eternal oxide
#

yes, so long as you also fixed your Listeners constructor

#
    public Listeners(main main) {
        this.main = main;
        this.database = main.getDataBase();
    }```
agile quest
#

thank you so much bro

vocal cloud
#

also if your database fails to init you really should shut your plugin down too otherwise you'll just be stacking errors

agile quest
#

ok

iron glade
#

I'm kinda confused atm, isn't there a way to get an entity's health?

eternal oxide
#

what type of entity?

iron glade
#

Mobs

#

Do I have to use LivingEntity or smth?

eternal oxide
#

cast to LivingEntity getHealth

iron glade
#

makes sense, ty

#

Is this how to set a living entity's health back to full health since #getMaxHealth() is deprecated?
livingEntity.setHealth(livingEntity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue());

eternal oxide
#

yes

iron glade
#

I'm having some problems in the EntityDamageByEntityEvent when the player hits critical. Every time the player hits critical the entity is killed instead of running this code

                    if (e.getFinalDamage() > livingEntity.getHealth()) {

                        livingEntity.setHealth(Objects.requireNonNull(livingEntity.getAttribute(Attribute.GENERIC_MAX_HEALTH)).getValue());
                        p.getWorld().spawnEntity(e.getEntity().getLocation(), e.getEntityType());

                    }```
random gust
#

The ServerConnectedEvent in BungeeCord is executed when the connection to the server is established. This does not mean that the player has successfully logged in, it only means that the request has been accepted. I would need to know when the player has actually joined the server, is there an event or a method to find out?

vocal cloud
#

= to cover edge cases? If they have 10 health and you deal 10 damage that won't fire

iron glade
vocal cloud
#

Did you cancel the event?

#

Cause setting it to max health doesn't stop the damage from killing it

#

Or set the damage to something less than lethal

iron glade
#

Cancelling seems to do the job, thanks! :)

quaint berry
#

With a discord bot you need to use maven for it to work but will my minecraft plugin complain about it?

lost matrix
quaint berry
#

Maven

lost matrix
quaint berry
#

So this is going to be painful?

lost matrix
#

No? You should be using maven anyways.

#

So this is just standard

quaint berry
#

Wait what

#

Do you use maven for making a minecraft plugin?

vocal cloud
#

You can use any package manager to do it. Maven is the most common

lost matrix
quaint berry
#

Ohh

lost matrix
quaint berry
#

Oh

#

I'll try it then

lost matrix
# quaint berry I'll try it then

I recommend the minecraft dev plugin for intellij.
It generates a clean maven, spigot project for you where you can add more dependencies if you want.

quaint berry
#

Oh I have that

#

I just don't know how to start

#

Do I start a new project like this or use maven?

lost matrix
quaint berry
#

What's group and artifact ID again?

quaint berry
#

Thanks

agile quest
#

Hello, simple question ``` if (args[0].equalsIgnoreCase("check")) {
if (args.length >= 2) {
Player target = Bukkit.getPlayer(args[1]);
try {
PlayerStats tStats = getPlayerStatsFromDatabase(target);
sender.sendMessage("§6" + main.prefix + "§e" + args[1] + " §ehas§6 " + (tStats.getSkycoins()) + " §6Mistycoins§e.");
} catch (SQLException e) {
}

lost matrix
agile quest
#

like this ? } catch (SQLException e) { sender.sendMessage("§6" + main.prefix + "§cThe player (" + args[1] + ") not exist in the database."); }

lost matrix
tardy delta
#

Or you handle cases where no data is present by returning null in the getstats method

lost matrix
agile quest
#

ok ok

quaint berry
#

This very much the wrong place but would just add another dependency for JDA?

quaint berry
#

Perfect

#

I just have to find it

#

Thanks

lost matrix
quaint berry
#

Wow thanks

formal bear
eternal oxide
#

you are sending a fake block change

formal bear
#

Yessir

eternal oxide
#

Skulls have tile Entities but I don;t believe the fake block change accounts for

formal bear
#

I want to make skull to disappear after player event

#

Only for that player

lost matrix
#

*Because then you might need to send it one tick later

formal bear
#
        Block block = event.getClickedBlock();

        if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
            if (!(Objects.requireNonNull(event.getClickedBlock()).getType().equals(Material.PLAYER_HEAD))) return;

            Skull headBlock = (Skull) block.getState();
            String headBlockUUID = Objects.requireNonNull(headBlock.getOwnerProfile()).getName();
            player.sendBlockChange(block.getLocation(), air);
formal bear
#

I mean Scheduler

lost matrix
lost matrix
formal bear
#

Works perfectly TYSM! šŸ’œ šŸ’œ šŸ’œ šŸ’œ

#

Why does sendingBlockChange need 1 tick delay

#

Just being curious

quaint berry
#

Do you need the plugin.yml with maven?

#

I'm just double checking

lost matrix
# formal bear Just being curious

Because if you click a block the server sends the information of that block to the player.
And your package is sent first. This means the client gets 2 packets in a short time with the
original block always overwriting your change.

lost matrix
quaint berry
#

Oh I'm special

dense crow
#

hey guys, how do i let the plugin count up? like i want to count how many reports come in

vocal cloud
#

Use a database or config to store that information

dense crow
#

yeah yeah but how do i let it count up

vocal cloud
#

By incrementing a value and storing it in a database?

lost matrix
dense crow
#

ty

lost matrix
#

what?

dense crow
#

thank you*

lost matrix
#

I know the meaning of "ty"
That was more of a baffled "what"

vocal cloud
#

I love this discord sometimes

dense crow
#

oh you just made my brain something clear, so i got the idea

#

and for that i just wanted to say thanks ^^

zealous edge
#

do you know how to make a plugin that exchanges player positions with other players?

honest echo
#

do anyone know how do i send a chunk packet to client ?

glass mauve
#

do you mean smth lik that?

dense crow
#

uhm how do i get this ```yml
589998538key:
repmessage: fehler mit meinen geld ich bin zu arm
bugtype: Sonstiger Bug
name: YuuqiiiIsMyMommy
date: Fri Jul 08 11:24:57 CEST 2022
id: 589998538key

loud junco
loud junco
#

i guess that's what you mean?

dense crow
#

i mean

#

that i can get it with config.getkeys

torn oyster
#

how do i regenerate certain chunks

honest echo
agile anvil
# zealous edge death swap

Save one's player's cloned location, teleport him to the current player, and then teleport the current player to the temp location

dense crow
#

yeah

torn oyster
loud junco
#

Bukkit.getWorld("").regenerateChunk(int, int)

torn oyster
honest echo
#

it does that stuff

torn oyster
#

i also want to regenerate a chunk with a certain chunkgenerator

#

forgot to mention that

agile anvil
agile anvil
dense crow
#

my plan is that im saving reports with a random number in front so i can get it with getKeys

torn oyster
dense crow
#

so i can list it in a inventory

agile anvil
#

But Bukkit World's generation as always been an issue

torn oyster
#

vanilla has a single biome version

#

why can't i do that on bukkit

zealous edge
loud junco
#

Explain yourself and i will explain back, but i don't know what you don't know.

#

NBTTagCompound @sweet pike

zealous edge
chrome beacon
#

player1.teleport(player2);

Like that

loud junco
#

No

agile anvil
loud junco
#

Store the 2 locations in variables, clone() them and then teleport the players

torn oyster
loud junco
#

so the locations won't refer to the live locations

agile anvil
#

You can't just say : i want a forst biome

torn oyster
#

i just need trees and ores

#

corresponding to the biome

agile anvil
tardy delta
#

why would you clone them

loud junco
#

Because if you're gonna teleport player to another player, his location changes

tardy delta
#

so?

loud junco
#

You can't teleport the second player to the old location unless you save it

chrome beacon
#

You should already be getting a clone

loud junco
#

From my experience you aren't

#

šŸ˜„

tardy delta
#

arent locations immutable by now?

chrome beacon
#

They should be iirc

loud junco
#

Not sure if it's changed in latest versions

#

Didn't look into that

tardy delta
#

doesnt look really immutable in 1.17.1

chrome beacon
#

Hm okay

tardy delta
#

ah lol that was my problem

buoyant viper
#

singleUUID

#

my brother in christ

#

vanished.get(0)

#

?!

tardy delta
#

hashset you noob

buoyant viper
#

i was afraid u would say that

#

šŸ”Ŗ

#

in a way its genuinely dumb sets dont have get by index

tardy delta
#

im wondering why they say that sets and stuff arent accessible by their index but they are all backed by an array ://

buoyant viper
#

time to PR to oracle to just make Set extend List

#

smh

sweet pike
#

any quick wikis/threads on how to use them?

loud junco
#

NMS

#

Google

tardy delta
#

triggering too many tnt at the same location be like

#

ah after 10 minutes it finally exploded

vocal cloud
#

wait ur running that on a pi?

iron glade
#

Anyone here happens to know how to add a line break to a discord embed?

#

tried \n and \u200B

#

doesn't work

vocal cloud
#

Works for me in the description. Not sure if other areas can be line breaked

iron glade
#

hmm weird

#

with \n I get java.io.IOException: Server returned HTTP response code: 400

tardy delta
#

yes lol

iron glade
#

with \u200B it just doesn't put it in the next line

tardy delta
#

it works

chrome beacon
#

Show the entire code

#

?paste

undone axleBOT
iron glade
# tardy delta it works

Yeah I believe you, somehow this is still not working

new DiscordMessageBuilder(plugin).withDescription("The **" + StringManager.capitalize(getTrollCommand().toString()) + "** troll has been stopped on **" + p.getName() + "**\n**Duration**: **" + getDuration() + " seconds**")
                .withColor(new java.awt.Color(0, 170, 170))
                .withAuthor("TrollBossPlus", null, StringManager.DISCORD_WEBHOOK_IMAGE_URL).build();
tardy delta
#

i was talking bout my pi

#

and wtf please do that in multiple lines

iron glade
#

wdym multiple lines?

#

ahh yeah

#

Does your IDE show any errors?

#

Did you register the listener?

limpid bronze
#
if(!damagedBlock.containsKey(event.getBlock()))
            damagedBlock.put(event.getBlock(), List.of((double) Math.round(event.getBlock().getType().getHardness() / event.getBlock().getBreakSpeed(event.getPlayer())), new BukkitRunnable() {
                @Override
                public void run() {
                    damagedBlock.put(event.getBlock(), (List<Object>) damagedBlock.get(block)/*HERE NULL POINTER EXCEPTION*/.set(0, (double) damagedBlock.get(block).get(0) - event.getBlock().getType().getHardness()));
                    if((double) damagedBlock.get(event.getBlock()).get(0) <= 0)
                      cancel();
                    Bukkit.getServer().getOnlinePlayers().stream().filter(player -> player.getLocation().distanceSquared(event.getBlock().getLocation()) < 121)
                            .map(player -> ((CraftPlayer) player).getHandle().connection)
                            .forEach(connection -> connection.send(new ClientboundBlockDestructionPacket(connection.player.getId(), ((CraftBlock) event.getBlock()).getPosition(), (int) (((double) damagedBlock.get(event.getBlock()).get(0) / (event.getBlock().getBreakSpeed(event.getPlayer()) / event.getBlock().getType().getHardness())) * 10))));
                }
            }));
((BukkitRunnable) damagedBlock.get(block).get(1)).runTaskTimer(SunderiaSkyblock.getInstance(), 0, 1);
#

Hey, I'm trying to do a custom breaking block system with a Map<Block, List<Object>> where the first element of that list of object is the number of ticks spend on the block (used for damage block) and the second element is the BukkitRunnable related to the block.
Here above the code i'm trying to use but I catch a NullPointerException where is the comment in the code.
I don't know if this approach is the right one. Can someone explain me why I catch a NPE here?

chrome beacon
#

You made a new frozen variable

chrome beacon
tardy delta
#

wtf

limpid bronze
chrome beacon
#

Yeah you have two frozen variables

chrome beacon
twilit roost
#

LivingEntity#friction doesnt exist?

iron glade
#

you made it static

#

do you get an error in the runnable now that the boolean has to be effectively final or smth like that?

#

Did you change it to frozen = false in the runnable?

dawn plover
#

guys, i am struggeling with saving stuff in yml.
so i made these 2 classes. my goal is to save a bunch of ncArea's inside a yml.

but all i cant seem to get a Area inside a yml, only parts

#

i just cant seem to figure out why i cant save an area, but i can save a part

iron glade
#

It won't be working like that, you're creating a new boolean

limpid bronze
quaint mantle
#

[15:13:49 ERROR]: Error occurred while enabling DeepSmpPlugin v1.0-SNAPSHOT (Is it up to date?)
java.lang.IllegalArgumentException: Symbol does not appear in the shape: [s]
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:180) ~[guava-31.0.1-jre.jar:?]
at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:130) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:115) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at deepsmpplugin.deepsmpplugin.Main.getWartPick(Main.java:89) ~[DeepSmpPlugin-1.0-SNAPSHOT.jar:?]
at deepsmpplugin.deepsmpplugin.Main.onEnable(Main.java:25) ~[DeepSmpPlugin-1.0-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:536) ~[paper-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:561) ~[paper-1.19.jar:git-Paper-41] at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:475) ~[paper-1.19.jar:git-Paper-41]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:633) ~[paper-1.19.jar:git-Paper-41]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:419) ~[paper-1.19.jar:git-Paper-41]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:306) ~[paper-1.19.jar:git-Paper-41]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1121) ~[paper-1.19.jar:git-Paper-41]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:302) ~[paper-1.19.jar:git-Paper-41]
at java.lang.Thread.run(Thread.java:833) ~[?:?]

#

there's somehting wrong

echo basalt
quaint mantle
#

what do you mean?

echo basalt
#

example:

SHAPE:

XXX
X.X
XXX

and you call
setIngredient('A', ...)

#

A is not in the shape

quaint mantle
#

oh

#

lemme check the code

limpid bronze
echo basalt
#

Clean up your code a bit

#

by reusing variables

#

Also you're a lot better if you use packets instead of this damagedBlock system

#

as the client sends block dig packets for:

start-dig
abort-dig
finished-dig

#

and some other statuses

#

you call every single possible getter like 15 times and don't reuse the values, but you're also doing a Map<Block> which is plain wrong

quaint mantle
#

i fixed it

echo basalt
#

Use a vector or a location, Block is just a temporary instance that is made whenever you call getBlock

limpid bronze
#

Okay

candid sorrel
#

Hi, first of all, if an admin sees this can we talk about my other account and how it got banned, secondly, I need help compiling a plugin using the 1.19 spigot API using java 8. I can this error when I try to compile using gradle dsl

#
                           ^
  bad class file: /home/kyan/.m2/repository/org/spigotmc/spigot/1.19-R0.1-SNAPSHOT/spigot-1.19-R0.1-SNAPSHOT.jar(net/minecraft/server/MinecraftServer.class)
    class file has wrong version 61.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.```
#

I understand the error, I just need help fixing it

agile anvil
candid sorrel
#

I have found some resources online as well, however, they are all for maven, which is no use to me atm

manic bison
#

hey, does anyone know how to open a villager trade with custom trades using a command?

candid sorrel
#

not if you put your cardano and bitcoin address on your bio lol

agile anvil
manic bison
#

nope, i'm coding a plugin

candid sorrel
candid sorrel
#

its an amazing resource

manic bison
#

already used it, cant find an answer

candid sorrel
candid sorrel
#

he is literally spoonfeeding you

candid sorrel
#

other plugins do it, what is their methodology?

#

also

candid sorrel
#

np

#
org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: com/neomechanical/neoperformance/NeoPerformance has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:131) ~[patched_1.12.2```
#

this is when I tried to use my plugin on 1.12.2

#

so I clearly need to use an older java version

#

Which is also what I have read numerous times

agile anvil
#

It will still be compatible with other mc versions, they just have to update java

#

Which is great.

candid sorrel
#

Struggling? I literally changed one line of code to make it compatiable with java 8, one line. Now I just need to figure out how to compile the spigotapi part in java 17 and the rest in java 8 to allow for these so called 'old people' to use the plugin.

#

And using older versions do have their benefits

#

Such as performance boosts, which is ironic when my plugin is meant to combat lag

#

but anyways

loud junco
#

java 8 is not better in performance

#

the exact opposite

earnest forum
#

older mc versions have better performance

candid sorrel
#

not java 8 specially, the versions of minecraft

earnest forum
#

prob the only reason why ppl use it

candid sorrel
#

like 2b2t

earnest forum
#

if 2b2t was on 1.19

loud junco
#

2b2t trying to update so that's stupid lol, anyways you don't know how to compile your plugin on a lower version?

earnest forum
#

forget about eating

candid sorrel
#

lol

#

I do, but there is an error

loud junco
#

or what exactly?

agile anvil
loud junco
#

it's better

earnest forum
#

they want it to be multi version compatible

#

mc versions

loud junco
#

what

candid sorrel
#

i was lol, but I wanted to make it run on most mc versions

#

yes, what yada said

#

it was on java 17 before, now I'm trying to COMPILE it on java 8

loud junco
#

using newer java wont make your plugin not run on older version? .. okay, well what ide do you use?

#

and are you using gradle or maven?

candid sorrel
#

gradle on intellij

#

and using older java versions does make your plugin run on older versions

candid sorrel
loud junco
#

sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
Settings -> Project -> SDK: 1.8
Settings -> Modules -> Language Level: 8

#

because you're running a old java

#

that's stupid

#

no reason to use a old java version

loud junco
#

no it only makes your plugin run on older JAVA versions

#

people dont have to use java 8 on a old version

candid sorrel
#

I think they do if its an extremely old version

loud junco
#

no they dont

#

lmao

#

Java is extremely backward compatible

#

you can literally run java 7 compiled plugins on java 17

#

you can run into some issues but they are easy to solve

#

so i see no reason to use old java versions

agile anvil
#

Stop allowing people to use outdated versions please

candid sorrel
#

I don't think we are talking about the same thing here...

loud junco
#

you can run your 1.8 server on Java 17

#

you can run your 1.5 server on Java 17

#

what else is the issue

chrome beacon
candid sorrel
#

Well I will be damned, I do remember having trouble running some version of minecraft on java 17

loud junco
#

you will get some issues and warnings which can all be solved

candid sorrel
#

I mean it didn't even boot

#

but

chrome beacon
#

All can be solved if you modify the code yes

candid sorrel
#

I just ran a test server and it does work alright

chrome beacon
#

But otherwise no

loud junco
#

what mc version?

#

i managed to run 1.7 on java 17 without issues

candid sorrel
#

I believe the mc version was 1.16

loud junco
#

the fuck

#

1.16 supports java 17 without any issues

#

i though you're going back to like 1.8

#

lmao

#

you did something wrong then

candid sorrel
#

idk man, just telling you what happened with me

loud junco
#

human error

chrome beacon
#

1.16 has a java version check

#

Not sure if it allows Java 17

loud junco
#

it does

#

i literally have a 1.16 server on java 17

ivory sleet
#

Anyway you better use the java toolchain rather than setting source and target version with those variables

candid sorrel
#
Unsupported Java detected (61.0). Only up to Java 16 is supported.```
#

is it a paper thing?

ivory sleet
#

You might wanna change java version

#

But weird image

#

Feels like that should be shipped along with the container

candid sorrel
#

this is 1.16 on java 17

loud junco
#

the check can be disabled

#

dont remember how now, i think a startup flag

candid sorrel
#

I'm not bothered tbh

#

just something

#

and Conclure, a quick question, who do I talk to about unbans?

ivory sleet
#

?support ideally

undone axleBOT
candid sorrel
#

k thanks

ivory sleet
#

But if you know who banned whom then you can go directly to said person

candid sorrel
#

i don't, it was when my main got hacked

#

i got no message or anything

ivory sleet
#

Oh you probably got your token stolen then

#

But yeah contact me in DMs

agile quest
#

hello

#

i just want to register a expensions with PlaceholderHolderAPI but it won't work

#

?paste

undone axleBOT
dawn plover
#

how do i send a simple msg to all players?

agile quest
daring maple
#

loop through that

#

and send each player a message

shadow zinc
#

Hi I get java.lang.NoClassDefFoundError: net/minecraft/server/MinecraftServer when I run my plugin on 1.12.2

#

I think I understand the error, just wondering what I do to fix it?

#

would I need to somehow shadow net.minecraft.server into my plugin?

daring maple
#

?paste the code causing the issue

undone axleBOT
shadow zinc
#
    default double getTPS() {
        MinecraftServer mcServer = (MinecraftServer) Bukkit.getServer();
        double tps = mcServer.recentTps[0];
        if (tps <= 0) { //0 normally means the server is still starting, so we'll just return 20 as a default value as the server can continue to load without interruptions.
            tps = 20;
        }
        return tps;
    }
#

its small

dawn plover
#

wait really, cus i already thought about this

#

but then i thought, no this cant be it

shadow zinc
#

and its just the import ```java
import net.minecraft.server.MinecraftServer;

dawn plover
#

this is in efficient

agile quest
#

someone can help me ?

distant basin
#

hi, i use worldedit and worldguard api for my plugin but give me this error while running server

[05:59:02 ERROR]: Could not load 'plugins\AFKPool.jar' in folder 'plugins'
org.bukkit.plugin.UnknownDependencyException: Unknown/missing dependency plugins: [worldedit, worldguard]. Please download and install these plugins to run 'AFKPool'.
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:290) ~[patched_1.17.1.jar:git-Paper-411]
        at org.bukkit.craftbukkit.v1_17_R1.CraftServer.loadPlugins(CraftServer.java:419) ~[patched_1.17.1.jar:git-Paper-411]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:287) ~[patched_1.17.1.jar:git-Paper-411]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1220) ~[patched_1.17.1.jar:git-Paper-411]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-411]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
#

plugin.yml

depend:
  - worldguard
  - worldedit

how to fix it?

upper vale
#

By downloading worldedit and worldguard

distant basin
#

worldedit-bukkit-7.2.11-beta-01.jar
worldguard-bukkit-7.0.7-dist.jar

upper vale
#

It might be case sensitive, use [WorldEdit, WorldGuard]

distant basin
#

depend: [WorldEdit, WorldGuard]?

daring maple
#

do /plugins and check their names there

upper vale
#

yes

distant basin
distant basin
#

i rename it to WorldEdit.jar?

upper vale
#

its WorldEdit and WorldGuard

#

no

#

its not the file name

#

its the plugin name as in plugin.yml for that plugin

distant basin
young shell
#

Does Bungeecord have a Singleton like Bukkit has?

#

something like the Bukkit Class only for Bungeecord

rugged gust
#

hello so i am creating a join/leave msges plugin and i made it so itll print the msg from the config as the join msg and the placeholder %player% or %player_name% isnt working..

tardy delta
#

bruh

shadow zinc
#

oof

tardy delta
#

i gave you the link yesterday

upper vale
tender shard
rugged gust
tender shard
#

String#replace

ivory sleet
#

Bungeecord doesn’t have a mono state design like Bukkit with the Bukkit class in particular

tardy delta
#

well he wants to use papi placeholders

ivory sleet
#

Altho it does as demeng pointed out have singletons iirc

rugged gust
#

yea

tender shard
rugged gust
tender shard
#

then read the PlaceholderAPI's github readme file, it's explained there

tardy delta
#

i gave you the the way yesterday, why didnt you use it?

distant basin
#

Code:

                    RegionContainer container = platform.getRegionContainer();
                    RegionManager regions = container.get((World) player.getWorld());
                    if (regions == null) return;
                    ProtectedRegion region  = regions.getRegion(Objects.requireNonNull(pl.getConfig().getString("region-name")));
                    if (region == null) return;

Error:

java.lang.NullPointerException: Cannot invoke "com.sk89q.worldguard.bukkit.BukkitWorldGuardPlatform.getRegionContainer()" because the return value of "ir.skidded.AFKPool.access$000()" is null

how to fix this error?

rugged gust
tardy delta
#

what are you trying to do then

rugged gust
# tardy delta what are you trying to do then

imma explain fully so uhh im trying to get the string ("Join") from the config as the join message so in that string i have "%player% has joined the game! Welome back." so it isnt using the placeholder its just sayin %player% in the chat..

shadow zinc
#

jesus my plugin is 16mb

river oracle
#

How

#

Did you shade bulkiy

#

Bukkit*

ivory sleet
shadow zinc
#

I thought it would fix the error I was getting

#

but nope

#

It just made it fat

river oracle
#

No don't shade bukkit

shadow zinc
#

thanks gradle

river oracle
#

You don't need to

shadow zinc
#

how do I fix this then?

river oracle
#

It's a waste and actually causes errors likely

shadow zinc
#

java.lang.NoClassDefFoundError: net/minecraft/server/MinecraftServer

river oracle
#

?paste

undone axleBOT
ivory sleet
#

Actually shaded Bukkit 🄲

distant basin
# distant basin Code: ```java RegionContainer container = platform.getRegio...

i change contaianer to RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
fixed
but now give me error for RegionManager regions = container.get((World) player.getWorld());
error:

java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_17_R1.CraftWorld cannot be cast to class com.sk89q.worldedit.world.World (org.bukkit.craftbukkit.v1_17_R1.CraftWorld is in unnamed module of loader 'app'; com.sk89q.worldedit.world.World is in unnamed module of loader 'worldedit-bukkit-7.2.11-beta-01.jar' @38358b1c)
river oracle
#

There's a maven plugin to do that

rugged gust
shadow zinc
#

idk how to with gradle

ivory sleet
#

Shadow jar

river oracle
#

I can't help you because gradle is for beta males but yea you need to reobufscate using the maven plugin

shadow zinc
#

I wanted to be trendy and use it, but now i got no idea what im doing

#

my main plugin uses maven

#

but ehh

river oracle
#

Use maven it's nice

#

And lobely

shadow zinc
#

ik

ivory sleet
#

Well Gradle is better if you know what you’re doing

shadow zinc
#

so how do get the mappings working for gradle dsl?

river oracle
#

Shut up conclure get our of here nerd

ivory sleet
#

But provided that your plugin ought not to need an advanced setup stick with maven as you already have knowledge

ivory sleet
shadow zinc
#

facts

ivory sleet
#

Oh you wanna do the mojang mappings thingy?

shadow zinc
#

yeah

#

if it fixes my thing

ivory sleet
#

Well may I ask what are you trying to do?

shadow zinc
#

get the stupid tps

young shell
river oracle
shadow zinc
#
    default double getTPS() {
        MinecraftServer mcServer = (MinecraftServer) Bukkit.getServer();
        double tps = mcServer.recentTps[0];
        if (tps <= 0) { //0 normally means the server is still starting, so we'll just return 20 as a default value as the server can continue to load without interruptions.
            tps = 20;
        }
        return tps;
    }```
#

this thing

#

ruined my entire plugin

rugged gust
tardy delta
#

why printing the raw

#

print the raw thing then

#

whats difficult bout that

#

thats what youre currently doin

shadow zinc
#

why, because of errors?

#

NoClassDefFoundError

ivory sleet
rotund pond
#

Ah

shadow zinc
#

the way I do it or because it ruins the plugin?

#

So conclure, where do I start with my remapping journey so I can fix a single import?

rotund pond
shadow zinc
#

yeah true

ivory sleet
#

You have two choices now
Switch to maven and use special source
Persist with gradle and use paperweight-userdev

The issue with staying with gradle is that the paper api will be added to your classpath, altho that afaik is the only alternative for gradle in terms of remapping atm

#

Actually

shadow zinc
#

ohhhhh

tender shard
ivory sleet
#

A third option is to use a library

shadow zinc
#

lol

ivory sleet
#

Which provides the tps for you

shadow zinc
#

hmm

#

the third option is enticing

rotund pond
shadow zinc
#

I hide my stuff in it

river oracle
#

Personally I use 2000 libs for each plugin just in case

shadow zinc
#

just in case

ivory sleet
#

KyTDK it’s a cheap alternative and not a bad one either i don’t know if @tender shard can offer it with his outstanding library

shadow zinc
#

you never know when you need those libs

ivory sleet
#

Since my library isn’t publicly available

#

So ye Ik redempt also got some good stuff in his library

sudden violet
#

Im late to the party. whats broke

river oracle
#

Redlib vs bluelib the ultimate battle

ivory sleet
#

🄲

shadow zinc
#

no class found

#

need mappings or class

#

and im using gradle

river oracle
ivory sleet
shadow zinc
#

my entire plugin relies upon this stupid nms class

tender shard
ivory sleet
#

Yeah

sudden violet
#

which nms class are you using, why, and where

shadow zinc
#
    default double getTPS() {
        MinecraftServer mcServer = (MinecraftServer) Bukkit.getServer();
        double tps = mcServer.recentTps[0];
        if (tps <= 0) { //0 normally means the server is still starting, so we'll just return 20 as a default value as the server can continue to load without interruptions.
            tps = 20;
        }
        return tps;
    }```
#

that should answer your question

sudden violet
#

getServer().spigot().getTPS();

shadow zinc
#

invalid

paper viper
shadow zinc
#

yeah idk why people keep bringing that up, its confusing

paper viper
#

It’s cause of a forum post

#

Lol

shadow zinc
#

lol thats why

#

ive seen it as well

river oracle
#

Why did the guy on the forums post it lol

paper viper
#

Idek

tender shard
sudden violet
#

nah i was reading a javadoc. turns out im reading the doc for 1.8

#

my bad

paper viper
#

LMAO

shadow zinc
#

bukkit.makecoolplugin()

ivory sleet
#

Forums people do be trolling

tender shard
ivory sleet
shadow zinc
#

I got a fork of a plugin that uses paper to remap

#

might just use that

#

quick and easy

#

hopefully

tender shard
#

you can also just run the special sauce plugin manually