#development

1 messages · Page 132 of 1

crisp robin
#

ur here

#

why dont u help me :>

#

nvm ur gone

#

looks like no1 gonna help me

#

great

#

!

tight junco
#

I don't wanna spoonfeed you code

#

cause you're not learning

#

but it's literally just telling you to do something you've already done in that class

crisp robin
tight junco
crisp robin
#

o god

#

ty man

#

sry

#

i just have 2 brain cells

#

my brain doesn't work well

pearl topaz
#

I'm trying to use MySQL in a maven project and I have this as mentioned by a thread I found:

<dependency>
     <groupId>mysql</groupId>
     <artifactId>mysql-connector-java</artifactId>
     <version>8.0.28</version>
</dependency>

I put this in pom.xml but when I compile and run it in a server it throws java.lang.ClassNotFoundException: com.mysql.cj.jdbc.MysqlConnectionPoolDataSource upon enabling

pearl topaz
#

nvm i fixed it

molten wagon
#

So I guess I need set up own code for it or use nms? For should be set someware in the Minecraft code :)

lyric gyro
#

=paste

neat pierBOT
lyric gyro
#

how the fuck

dense drift
#

?

lyric gyro
#

Just not sure why im getting the above error, can provide more code if necessary

dense drift
#

probably because the array is inside course-applications?

lyric gyro
#

I tried making it like

data class CourseApplications(
  @JsonProperty("course-applications") val courseApps:Array<JRCourseApp>
)``` and just got another error about not being able to map it correctly
dense drift
#

Can you not access course-apllications and tell jackson it is an Array of JRCourseApp?

lyric gyro
#
val data = makeRequest("url?party_id=$partyId", arrayOf<JRCourseApp>())```


```kotlin
    private inline fun <reified T> makeRequest(url: String, t: T?): T? {
        val headers = org.springframework.http.HttpHeaders()

        headers.contentType = MediaType.APPLICATION_JSON
        headers.accept = Collections.singletonList(MediaType.APPLICATION_JSON)

        headers.setBasicAuth("a", ACCESS_KEY)
        val entity = HttpEntity<T>(headers)

        try{
            val response = restTemplate.exchange("$BASE_URL/$url".trim(), HttpMethod.GET, entity, T::class.java)
            return response.body
        }catch(exc: HttpClientErrorException.NotFound) {
            return null
        }

    }```
dense drift
#

Is there something like JsonObject that you can turn the response body into, and then access the array?

lyric gyro
#

wdym

#

why is this way not working tho it works for other json objects and itd be easier if i cankeep it as consistant as possible across the whole program

regal condor
#

What gradle dependency/repo would I need to use to access the spigot packet: ClientboundInitializeBorderPacket
It doesn't seem to be in the org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT one.

sterile hinge
#

yeah, because it's not part of the api

regal condor
#

How would I access it via nms?

#

I've seen it used before

#

Oh. I found it! I needed maveLocal() + org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT

manic spindle
#

why would calling PlaceholderExpansion#register on a PlaceholderExpansion built-in to my plugin return false?

#

please ping me if you reply 🙂

kind granite
#

hard to tell without any code

manic spindle
#

(canRegister method is at the bottom)

kind granite
#

getVersion() is @NotNull annotated

manic spindle
#

oh, thats weird, i wonder how that happened. it def used to have a version 😄

#

would that be why?

#

also if it is, why does it only fail for one person?

#

just realized i forgot to mention, it only fails for one person. it works fine for everyone else

kind granite
#

most likely something is erroring out, in which case a stacktrace would be very helpful

#

or another plugin is cancelling the register event

manic spindle
#

i dont think there was a stacktrace, unless the user removed it for some reason

kind granite
#

not really sure to suggest tbh other than making sure that papi is up to date

manic spindle
#

ok, thanks

dense galleon
#

Alright say I got two branches: dev and master

dev was where I would develop new features, while master is the latest stable version of my mod... now though I got the issue that I want the version of the mod in dev to completely replace what's in master, since now it will be the new stable version of the mod

#

How do I do that?

surreal lynx
#

Could I just get the current durability and then remove 1 from it each time its used?

lyric gyro
#

checkout -m 🥺

dense galleon
#

Yeah I got it I got it

#

Thank you

lyric gyro
#

uh what I'm not sure about is how it counts the damage.. because there are places it means "durability" and the whole thing is backwards..

surreal lynx
#
                    Damageable damageable = (Damageable) item.getItemMeta();
                    damageable.setDamage(damageable.getDamage() - 1);
                    item.setItemMeta(damageable);

Does that seem right? I imagine not because it didn't seem to change anything

lyric gyro
#

Try increasing it instead I suppose lol, in that case damage would actually mean damage dealt to the item (how many times it was used)

surreal lynx
#

Oh

#

Right

wintry grove
#

does anyone know how to set the player's camera back to their own after sending a ClientboundSetCameraPacket without making them relog?

#

do I have to send another packet referring to the player?

dusky harness
#

so im guessing u can just put random number

#

and it'll go back to normal

#

or

#

To return control to the player, send this packet with their entity ID.

lyric gyro
#

yeah don't just throw random numbers in there 🥴

#

Also you can achieve all of that without using packets lmao

lyric gyro
#

With springs @Scheduled annotation can i make it run at a certain time every day and not break if the program stops and then starts?

dusty frost
#

possibly? but you're better off using a cron job or something

torpid raft
#

cron job best job

prisma briar
#

Does someone know why I can't use matt's triumph gui libs?

lyric gyro
#

it's on central now

prisma briar
#

Oh, where can I get the updated groupId, artifactId, etc.

lyric gyro
#

no idea lol should be updated in the documentation tho

#

but releases are published in maven central now

prisma briar
#

It's not updated there

lyric gyro
#

the group id and artifact id are updated yes

#

the repo isn't I guess

prisma briar
#

On the command and message framework, it doesn't show the repo anymore

lyric gyro
#

¯\_(ツ)_/¯

prisma briar
#

alright, thanks anyway

#

i think i got it

pulsar ferry
#

nO

atomic trail
#

What is the best way to create a command cooldown for pvp? Like if they havn't been hit for 5 sec they can use the command again

pulsar ferry
#

Store the timestamp of when the command was used, then when you try to use it again check if current timestamp - saved timestamp > 5 seconds

atomic trail
#

System.currentTimeMillies() or whatever? Or using a java Instant?

prisma briar
crystal scarab
#

hey, is there way to control refresh rate of placeholder? can't find any option PlaceholderExpansion class , I'm registering placeholder from my plugin. Some values are not updating too often, so it is too much waste to periodically update them.

atomic trail
prisma briar
pulsar ferry
#

Instant has nice util methods that you can definitely take advantages of, but if it's just simple cooldown then milis should be more than enough

icy shadow
#

Yeah that's your responsibility

brittle thunder
#

^

icy shadow
#

Or the consumer's

#

Depends on context lol

brittle thunder
#

lol

crystal scarab
#

so.. when does onRequest happen exactly?

#

looked at expansion code, and read wiki but still not sure when is it actually called

#

nvm it's really dumb question

#

I got it

atomic trail
#

Will this disable the command?

    @EventHandler
    public void onCommand(PlayerCommandSendEvent e) {
        Player player = e.getPlayer();
        Collection<String> commands = e.getCommands();
        
        if(!player.hasPermission("aurorapeaks.pvplog")) {
            commands.removeIf(str -> str.equalsIgnoreCase("spawn") || str.equalsIgnoreCase("home") || str.contains("tpa"));   
        }
    }
#

Or do I need to cancel the event

barren ore
#

I'm not sure what I have done but now when trying to build my plugin i get all these build errors saying my classes are not found? Any way to fix this
https://i.imgur.com/KHodHPE.png

pulsar ferry
#

Hmm try doing invalidate cache and restart or maybe do a clean build

restive isle
barren ore
#

I remember I accidently built the project using maven which I do not normally do as I have my own API attached as a dependency in the project structure which I do not know how to add with maven

pulsar ferry
#

Well you have a maven project, you should be building with maven

barren ore
#

How can I add my custom api to the plugin using maven in that case?

pulsar ferry
#

You would need to publish the artifact of the api (assuming it's something separate) to either maven local or some other repository like maven central or a personal one

#

And then add it as usual with the <dependencies> tag

barren ore
#

Alright I managed to add the api from system into maven now however even tho I have the spigot api in my maven added it throws package net.minecraft.server.v1_16_R3 does not exist

pulsar ferry
#

That is not present in the api, that's NMS, if you want NMS you need to add spigot instead of spigot-api (after running buildtools)

queen plank
#

I get this error when I start my server Tried to read NBT tag with too high complexity, depth > 512, is it the amount of chars in a tag that is too high? Or what does it mean?

sudden sand
#

Let me send my hikari code

#
HikariConfig hikariConfig = new HikariConfig();

        hikariConfig.setJdbcUrl("jdbc:mysql://" + host + ":" + port + "/" + database+"?useSSL="+useSSL);
        hikariConfig.setDriverClassName("com.mysql.jdbc.Driver");
        hikariConfig.setUsername(username);
        hikariConfig.setPassword(password);
        hikariConfig.addDataSourceProperty("cachePrepStmts", "true");
        hikariConfig.addDataSourceProperty("prepStmtCacheSize", "250");
        hikariConfig.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");
        hikariConfig.setMinimumIdle(1);
        hikariConfig.setAutoCommit(true);
        hikariConfig.setMaximumPoolSize(maxPoolSize);

        hikariDataSource = new HikariDataSource(hikariConfig);```
#

com.mysql.jdbc.Driver

#

this class is outdated

#

check for the new one

#

yep

#

but I use gradle

#

implementation 'com.zaxxer:HikariCP:4.0.2' (for java 8)
implementation 'com.zaxxer:HikariCP:5.0.1' (for java 9+)

#

with gradle or maven ?

#

I know nothing about maven sorry

broken elbow
#

you need to set the scope to compile I believe

sudden sand
#

no it's because this class is probably not included in hikaricp

ocean raptor
#

depends on the server version

atomic trail
dense drift
#

show some code

warm steppe
#

load chunk

atomic trail
queen mural
#

Does anyone know a good tutorial for holograms that are also saved?

worn jasper
#

uh is it normal for PlayerInteractEvent to fire twice with only one click???

#

to add to the above ^^ with empty hand it fires twice

lyric gyro
#

It may fire once for each hand

worn jasper
#

is it because we have two hands now?

#

oh ye

#

thought so

#

ty

#

uhm, I might be just stupid, but like, does uuid change when I relog to the server?

#

Because I store the owner of a certain block in an object, and check if the player interacting is the owner, it works fine, but when I relog, it says I am not the owner?

#

implying that the uuid isn't that same?

#

For context on the above, tried debugging it, and it's exactly the same, doesn't make any sense

#

gen.getOwner() which returns the uuid of the owner isn't the same as my uuid?

#

tf?

#

(and yes, they both return the uuid object, not a string)

#

And the weird part is it only happens when I relog

round sail
#

I'm not super well versed in it so this comment could mean nothing, but is your server in offline mode?

round sail
#

Then no idea.

worn jasper
#

ye lol

#

as confused as you are

torpid raft
#

if the uuid doesn't match your actual player uuid then something is wonky

worn jasper
worn jasper
#

that's the weird af part

grim oasis
#

ooh generators

#

nice

torpid raft
#

hmm

grim oasis
#

uuid should be .equals()

torpid raft
#

yes

#

were you using == before

shell moon
#

if a enum has private String message, i can edit it without issues?
something like
ENUM1("this is a value")
and using
setValue(String message){
this.message = message;
}

#

would that change the value to the new one

#

right?

torpid raft
#

oh yeah that would do it you definitely can't just do ==

shell moon
#

or its bad? xd

grim oasis
#

if(!gen.getOwner().equals(uuid))

shell moon
#

some1? xd

worn jasper
pulsar ferry
leaden sinew
shell moon
#

what would be the best way to do something similar

#

as it needs to be attached to an enum

#

(switch or else if is what i try to avoid)

leaden sinew
#

What are you trying to do?

shell moon
#

few words

dusty frost
#

yeah this sounds like an x y problem

shell moon
#

enum for Enchant

#

like LUCK, LUCK2 LUCK3 or wahtever

#

and a value attached to it

leaden sinew
#

That shouldn’t be an enum

dusty frost
#

sounds like a map

shell moon
#

but editable

#

with enum as key

#

?

leaden sinew
#

Editable and enum do not go together

dusty frost
#

no reason to have enum as key

shell moon
#

to be able to create an API

lyric gyro
#

can i still buy delux chat

leaden sinew
#

I would just make an enchantment class

shell moon
#

hasEnchant(Enchant enchant)

dusty frost
shell moon
#

it needs to be enum

lyric gyro
shell moon
dusty frost
# lyric gyro damn why

the creator has left the plugin scene, we're working on a free replacement called ChatChat right now

lyric gyro
leaden sinew
shell moon
#

so people can use using the API

leaden sinew
#

That doesn’t answer the question

shell moon
#

hasEnchant(block, enum)

dusky harness
#

API's don't have to be enums
unless it's for backwards compatibility
but still
🤷

dusty frost
#

you think APIs are solely composed of enums?

shell moon
dusky harness
#

🥲

shell moon
lyric gyro
shell moon
#

so, class with static

leaden sinew
#

If you use enums you limit the amount of enchants you can add

shell moon
leaden sinew
#

So other people can’t add enchants

dusky harness
dusty frost
dusky harness
#

what is the string

dusty frost
#

Look into VentureChat or Carbon if you need something complicated

shell moon
lyric gyro
dusky harness
#

wouldn't it just be ```java
public enum Enchant {
LUCK_1,
LUCK_2
}

shell moon
shell moon
#

lets say if i want LUCK_1 to be added in lore

dusty frost
shell moon
#

with a replacement like Luck 1

dusty frost
#

you can map an enum to an object

shell moon
#

(but can be editable)

#

wihtout else if statements

dusty frost
#

huh?

dusky harness
#

as the enum variable

shell moon
dusky harness
#

assuming it's config

#

since u said editable

dusty frost
#

i don't really know what you mean by "without else if statements"

leaden sinew
#

They want to get an enchantment with having to use if else to check if it is the enchant they are talking about

#

So basically like you said

#

Using a map

dusky harness
#

or you can just have a variable for "Luck 1" and have code outside of the enum automatically convert it to like "Some Lore " + enum.getString() + " yes"

dusty frost
#

yes, an EnumMap would serve them well then

leaden sinew
#

I think they should go with enchant classes though

dusty frost
#

well you could have both

shell moon
#

but that thing editable

dusty frost
#

enum for the list of types, class for the actual representation

#

it is Java, after all

#

everything is a class

leaden sinew
#

But keep in mind with enums people can’t register custom enchants if they use the API

shell moon
#

yes yes, i know

#

its not an enchanment plugin for items at all

dusty frost
#

so an enchantment plugin for...?

leaden sinew
#

What is it?

shell moon
#

a block

dusky harness
#

either ```java
public enum Enchant {
LUCK_1("Luck I"),
LUCK_2("Luck II");

private final String enchantString;
// constructor blah blah

}

String lore = ChatColor.RED + Enchant.LUCK_1.getEnchantString();
or java
public enum Enchant {
LUCK_1("luck.1"),
LUCK_2("luck.2");

private final String configPath;
// constructor blah blah

}

String lore = config.getString(Enchant.LUCK_1.getConfigPath());


imo these are what you should do

or

use bukkit `Enchantment` and create a `Map<Enchantment, String>`
dusty frost
dusky harness
#

oh this is a plugin api

shell moon
#

i think i'm going for the map thing

dusky harness
#

ye i think thats best

#

then you can do like setLore api method

#

plus you won't have to re-type all the enchants fingerguns

shell moon
proud pebble
#

personally i had a Map<EnchantEnum,EnchantObject> and then used nbt and put them in a CompoundTag of <String,Integer> on the itemstack, checked for the enchant depending on where it was needed or just forwarded the event to the EnchantObject, i had stuff like onBlockBreak, entity damage events, etc and just did things based on that.

lyric gyro
#

is there a substitue for deluxe chat since its gone down

lyric gyro
dusty frost
#

VentureChat with one channel is not very complicated

#

EssentialsChat if you don't need placeholders and want something beyond simple

lyric gyro
#

want something that is really beyond simple? VCF

lyric gyro
lyric gyro
#

Well I have news for you, VentureChat does not care about what language you speak

dusty frost
knotty raptor
lyric gyro
#

it's under development

dusty frost
#

We're not sure yet, still working on it. We might have a public beta in a few weeks

knotty raptor
#

nice

lyric gyro
#

it dousnt appear

#

and it seems others have had the same error

#

might want to ask in #general-plugins chief, this channel is for programming support

west socket
#

What would be the best way to have an armor stand removed with PacketPlayOutDestroyEntity repear when needed for the client? Using spawn packets doesn't seem to do the trick

wintry grove
#

uh

#

well

#

the packet name says what it does

#

you would need to store the armorstand data and then send back a spawn packet with that info

west socket
#

Yeah I tried that, doesn’t seem to work

#

With PacketPlayOutSpawnEntity

wintry grove
#

weird

#

any exceptions?

#

try doing some debugging

west socket
#

Alright

west socket
#
PacketPlayOutSpawnEntity move = new PacketPlayOutSpawnEntity(((CraftEntity) removeStand).getHandle(), 30, 0);
                        ((CraftPlayer) player).getHandle().playerConnection.sendPacket(move);```
Yeah this doesn't seem to do it
west socket
#

I'm honestly not sure what the third parameter does, but it looks like everything should work out

public PacketPlayOutSpawnEntity(Entity var1, int var2, int var3) {
        this.a = var1.getId();
        this.b = MathHelper.floor(var1.locX * 32.0D);
        this.c = MathHelper.floor(var1.locY * 32.0D);
        this.d = MathHelper.floor(var1.locZ * 32.0D);
        this.h = MathHelper.d(var1.pitch * 256.0F / 360.0F);
        this.i = MathHelper.d(var1.yaw * 256.0F / 360.0F);
        this.j = var2;
        this.k = var3;
        if (var3 > 0) {
          //random stuff
        }
      }```
#

No errors or anything, strange

dusty frost
#

pretty sure this is why protocollib was invented lmao

prisma briar
#

I might be wrong but isn't armorstand is using PacketPlayOutSpawnEntityLiving? assuming you're trying to spawn an armor stand

west socket
#

I saw a thread earlier that said that it that packet wasn’t for armor stands

#

I’ll give it another go though

hoary scarab
tight junco
#

would you like to explain how it doesn't work and what you're trying to do

mortal timber
#

It is to be a nicksystem. I don't know how to remove the player from the table list with Protocollib. This code above does not work, but there is no error message either

atomic trail
#

How should delayed commands be handled? Like a player uses /spawn and has to stand still for 5 seconds before they are teleported, if they move the command cancels. I suppose a map of UUID and time stamp, or what?

tight junco
#

Map<UUID, Long>

broken elbow
#

use guava's CacheBuilder. ez

tight junco
#

check CachedTime + 5000 < CurrentTime iirc

broken elbow
#

wouldn't using a cache builder be better? it would expire on its own as well. so ez

sterile hinge
#

a Queue could be used too

sand ermine
#
 // Check if player is vanished
            // In the database. TableName: player_data, ColumnName: isVanished
                Connection connection = sql.getConnection();
                if(sql.isVanished(connection, player.getUniqueId().toString())){
                    // Player is vanished
                    // Set isVanished to false
                    sql.setVanished(connection, player.getUniqueId().toString(), false);
                    player.sendMessage(plugin.prefix() + "§aYou are now visible to other players.");

                } else {
                    // Player is not vanished
                    // Set isVanished to true
                    sql.setVanished(connection, player.getUniqueId().toString(), true);
                    player.sendMessage(plugin.prefix() + "§aYou are now invisible to other players.");

                }
#

Then these

#
   public boolean isVanished(Connection connection, String toString) {
        try {
            if (this.getConnection() != null && !this.getConnection().isClosed()) {
                String query = "SELECT * FROM player_data WHERE uuid = '" + toString + "'";
                java.sql.Statement statement = this.getConnection().createStatement();
                java.sql.ResultSet resultSet = statement.executeQuery(query);
                if (resultSet.next()) {
                    return resultSet.getBoolean("isVanished");
                }
            }
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
        return false;
    }

    public void setVanished(Connection connection, String toString, boolean b) {
        try {
            if (this.getConnection() != null && !this.getConnection().isClosed()) {
                String query = "UPDATE player_data SET isVanished = '" + b + "' WHERE uuid = '" + toString + "'";
                java.sql.Statement statement = this.getConnection().createStatement();
                statement.executeUpdate(query);
            }
        } catch (SQLException ex) {
            ex.printStackTrace();
        }
    }
#

But when issue the command it doesn’t update anything in the database… no errors -__-

prisma briar
#

also i don't think this is very efficient

sterile hinge
#

first of all, use PreparedStatements

icy shadow
#

omw to setVanished "; DROP TABLE player_data"

sand ermine
night ice
prisma briar
#

ideally you don't want to directly set the value into the database

#

you only need to save it into the database on plugin disable

sterile hinge
#

or if the server crashes

icy shadow
#

ServerCrashEvent

broken elbow
#
if (StopReason == Crash) {
    NO();
}```
brittle thunder
#
while(isCrashing()) {
  Dont()
}
topaz elm
restive isle
#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

restive isle
#
new Timer().scheduleAtFixedRate(new TimerTask() {
                @Override
                public void run() {
                    customizeshopGUI();//refresh inv
                    if (main.inventory.getItem(12) == null)return; //looks if item != null
                    if(main.inventory.getItem(12).getType() == Material.AIR) { // checks if item is air (normal empty slot is set to air)
                        System.out.println("air");

                        return;
                    }else { //if not air it runs this
                        System.out.println("called!!");
                        customizeshopGUI();
                        player.openInventory(main.inventory);
                    }
                }
            },0, 50000);

i got this code in the event on inventory click but it doesnt print annything? i added commands to make it more clear and it should just work if you wanna see the whole file check this link: https://paste.helpch.at/coxuwaferu.cs

echo jetty
#

Hello , i have a question about something iam programming

#

so iam trying to make a killstreaks , for my plugin and i endded up with this idea ..

#

killstreaks:
3:
msg: '&eYou got 3 killstreaks'
prize:
coins: 3 //if coins == nul [nothing in it] then use item
item: diamond
6:
msg: '&eYou got 6 killstreaks'
prize:
coins: 6 //if coins == nul [nothing in it] then use item
item: diamond

#

but it give me an error here :

#

any ideas will be great and thanks

proud pebble
formal crane
#

How do i make a while loop that doesnt crash my server?

#
            as.setVelocity(vec);
        }``` tried this
leaden sinew
dusty frost
formal crane
#

Is it possible to also stop a repeating task?

dusty frost
#

yes

formal crane
#

oh alright

#

ty

formal crane
lyric gyro
#

it does work if used correctly

formal crane
lyric gyro
#

can't find what

formal crane
#

how to use it correctly

lyric gyro
#

you might want to share some of your code given that I forgot my crystal ball this week

formal crane
#
                @Override
                public void run() {
                    if(!as.isOnGround()) {
                        scheduler.cancelTask();
                    }
                }}, 0L, 20L
        );```
lyric gyro
#

casting this to Plugin is kinda strange.. why are you doing that? what is "this" in that context? any errors on the console?

formal crane
#

i still needed to adjust that

#

wasnt ready

lyric gyro
#

what is scheduler

formal crane
#

BukkitScheduler scheduler = Bukkit.getServer().getScheduler();

#

forgot to add that to the code snippit

lyric gyro
#

did you get that to compile..?

sharp hemlock
#

And getting keys and then getting it as a string to get a section?

#

Yeah that’s not going to work

night ice
inner jolt
#

com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Client does not support authentication protocol requested by server; consider upgrading MySQL client
I've tried mysql servers 8.0 and 5.7 and neither seem to work. There isn't much help online either.

queen mural
#

Is there a way to make items "unique"?
So that I can read out with a plugin whether a certain chest has been clicked on?

sterile wren
#
    public void onEnable() {
        if(Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new SomeExpansion(this).register();
        }``` main class
placeholderapi class:
https://paste.md-5.net/remejateva.java
placeholders dont work
rigid mountain
#

Clipboard clipboard = ClipboardFormat.SCHEMATIC.getReader(new FileInputStream(file)).read(worldData);

Im in 1.8 trying to paste a schematic but im getting this error here:

https://paste.helpch.at/tarokopohi.bash it points to the line above

lyric gyro
#

idk about 1.8 but it sounds like the schem file is corrupted or invalid in some other way

rigid mountain
#

Alright thanks

lyric gyro
#

What do you mean by "placeholders don't work"? how does it not work? any errors in console? what does it show when you try to use them? what happens? how are you trying to use them?

sterile wren
#

i put it in scoreboard-revision scoreboard and it spams [18:37:36 WARN]: org.apache.commons.lang.UnhandledException: Plugin Scoreboard-revision vR4 1.1 RELEASE generated an exception while executing task 25 at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

#

and the scoreboard just doesnt have anythng

lyric gyro
#

is that the entire stack trace?

sterile wren
#

bruh wait

#

i only copied that and logs deleted for some reason

#
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NullPointerException
        at me.frandma.disabler.SomeExpansion.onRequest(SomeExpansion.java:39)
        at me.clip.placeholderapi.replacer.CharsReplacer.apply(CharsReplacer.java:161)
        at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:70)
        at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:98)
        at rien.bijl.Scoreboard.r.Plugin.Utility.ScoreboardStrings.placeholders(ScoreboardStrings.java:56)
        at rien.bijl.Scoreboard.r.Board.ConfigBoard.run(ConfigBoard.java:86)
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
        at org.bu```
#

e

#

Playerdata is yamlconfiguration

honest spoke
#

Hola, I'm trying to use a precompiled gradle script as a convention plugin as is done in the docs at https://docs.gradle.org/current/samples/sample_convention_plugins.html but I cannot get it to work. I have default-module-config.gradle.kts in the right place at buildSrc/src/main/kotlin/ but when I go to use it in a submodule with ```kts
plugins {
id("default-module-config")
}

worn jasper
#

Uh could someone help me out here? Quite confused on why this is happening.
For context, this is looping through a list of generators and either dropping an item on top of them OR adding the items to a list if they have a so called "Locker" placed.
This gets executed every 25 seconds by a BR. The first time, it drops everything perfectly, but after it drops, unsure why, all the generators vanish (the objects that are stored in cache), probably from the cache, making it throw an error in the console.

Error: https://paste.helpch.at/ayokuwavob.bash
Method: https://paste.helpch.at/tacegonavi.cs

worn jasper
#

Explaining the above a bit better, I am unsure where or how it's happening since I don't modify the cache anywhere.

worn jasper
#

Rip

pulsar ferry
tacit belfry
#

I'm having a problem on my laptop, whenever I boot up intellij with a maven project i get an error:

#

All of the libraries work fine on my PC but when I git pulled it broke.

pulsar ferry
#

Time to move to gradle? Jokes aside, have you tried invalidating cache?

tacit belfry
#

Oh uh

#

I didnt think of that, ill try it

dense drift
#

are you able to update? 🥲

tacit belfry
#

oh boy

#

uhh

tacit belfry
#

Also invalidating cache did not work

pulsar ferry
# honest spoke https://github.com/katsumag/MultiProject-Test

They need to go on their own module with that set in the settings, here are some examples that work https://github.com/TriumphTeam/triumph-cmds/
On settings.gradle do:

dependencyResolutionManagement {
    includeBuild("build-logic") // where the convention plugins will go
    repositories.gradlePluginPortal()
}

Then they go into /build-logic/src/main/kotlin/, the build-logic gradle probably needs something like this

plugins {
    `kotlin-dsl`
}

repositories {
    gradlePluginPortal()
}

dependencies {
    implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.20-RC")
}

At least the applying of the kotlin-dsl is needed iirc

tacit belfry
#

could it be that my wifi is just too slow?

dense drift
#

nah

molten wagon
#

suspicious stew is not listed as normal recipe when use recipe iterator?

shell moon
#

Event or a way to know when an item starts cooking in furnace (not in 1.18, i know there is an event for that in newer versions) i need it for 1.14+

lyric gyro
#

well they don't have a recipe, you milk brown mooshrooms to get it, that's why they aren't in the recipe iterator

molten wagon
dense drift
lyric gyro
#

okay it loaded now

dense drift
mortal timber
#

Does anyone know how to use Protocollib to change a player's skin and the name displayed above them?

lyric gyro
hoary scarab
#

With maven is there something extra I need to do for placeholders to work?
Ex; plugin.yml

name: '<Name>'
main: '<Main>'

author: '<Author>'
description: '<Description>'
version: ${project.version}
```version isn't being updated to whats in my pom.
spiral prairie
#

lol

#

pex user

hoary scarab
spiral prairie
#

yes

hoary scarab
#

What relevance does that have to my question?

spiral prairie
#

dont want to offend

spiral prairie
hoary scarab
#

lol

dusty frost
#

not sure about Maven, but for Gradle you have to tell it to replace the patterns, and it's just ${version}

#

dunno though, Maven kinda stinky

wheat carbon
#
<resources>
  <resource>
    <directory>src/main/resources</directory>
    <filtering>true</filtering>
    <includes>
      <include>plugin.yml</include>
    </includes>
  </resource>
  <resource>
    <directory>src/main/resources</directory>
    <filtering>false</filtering>
    <excludes>
      <exclude>plugin.yml</exclude>
    </excludes>
  </resource>
</resources>
#

but that in build block

#

e.g.

shell moon
#

center of the block?

#

location.add(x > 0 ? 0.5 : -0.5, 0.0, z > 0 ? 0.5 : -0.5);

#

should work? xD

#

or it's always add(0.5,0,0.5)

prisma briar
ocean raptor
#

block locations are always 0, y, 0 iirc

#

so just 0.5, 0, 0.5

shell moon
#

doesnt affect if its negative coords right?

prisma briar
#

good question, but try it and see xd

shell moon
prisma briar
#

i don't know actually

sterile hinge
#

block coordinates are always rounded down

shell moon
pearl topaz
#

confused how to use reified to get the type of a generic class from within. i have a method randomValue() for my generic class MyClass<T>. i'm trying to do it like

class MyClass<T>(value: ArrayList<T>?): ArrayList<T>() {
    // ...
    private inline fun <reified T> getType(): KClass<T> {
        println(T::class)
        return T::class
    }

    fun randomValue(): ArrayList<*> {
        when (getType<ArrayList<T>()) {
            getType<ArrayList<T>().equals(String::class) -> return arrayListOf("a")
            getType<ArrayList<T>().equals(Int::class) -> return arrayListOf(1)
            // ...
        }
    }
    // ...
}

randomValue() is being called from Java

#

it just prints class java.util.ArrayList

#

I actually can't even get it to compile now, but the thought is there lol

dusky harness
#

or do u mean the type inside of a type

#

oh like the T inside of the ArrayList?

worn jasper
#

uh, is it possible to override this and make it serializable?

#

otherwise, what are my options?

dusky harness
worn jasper
dusky harness
#

serialize to where
theres BukkitObjectOutputStream

dense drift
#

Location is not serializable by default with GSON due to having a World field

dusky harness
#

and BukkitObjectInputStream

#

which should work

worn jasper
worn jasper
pulsar ferry
dusky harness
#

wdym

dusky harness
#

if you're talking about gson, then you need to make a serializer/deserializer thingy

worn jasper
#

the default Serialization method

dense drift
dusky harness
#
BukkitObjectOutputStream out = new BukkitObjectOutputStream(new GZIPOutputStream(new FileOutputStream(filePath)));
out.writeObject(this);
out.close();
```then there's also this
sterile hinge
dusky harness
#

you just need to use BukkitObjectOutputStream

shell moon
dusky harness
#

then you can do the usual java.io.Serializable stuff

worn jasper
worn jasper
dusky harness
pulsar ferry
# dusky harness wdym

Type erasure is always present, what reified does is replace it with the actual class

test<String>()

inline fun <reified T> test() {
    println(T::class.java)
}

Just turns into

System.out.println(String.class)
#

The generic itself is still erased

dusky harness
#

ex ```kt
fun main() {
test<String>()
}

inline fun <reified T> test() {
println(T::class.java)
}
turns into java
public static final void main(String[] args) {
System.out.println(String.class);
}

// $FF: synthetic method
public static final void test() {
Intrinsics.reifiedOperationMarker(4, "T");
System.out.println(Object.class);
}

pulsar ferry
#

Iirc synthetic method is always present because it still needs to be accessible through reflection, since the code is normally inlined there has to be a way to still get it

#

Same way as constants, they are inlined but the original variable is still present for reflection

molten wagon
# dense drift https://minecraft.fandom.com/wiki/Suspicious_Stew#Crafting lol emily

other fun thing, is recipeIterator() only return one type (chest can you make of any plank, but it only return OAK_PLANKS 8 times in an array).

So I need add code to deal with this and on top of this is the custom recipe´s from other plugins (I understand now way you should use namespacedKey all the time when make own recipes in bukkit).

pearl topaz
icy shadow
#

you cant bypass type erasure no matter how much syntax sugar you use

#

the T still gets erased

#

and reified only knows if the compiler knows the concrete type

dusky harness
# pearl topaz yes
inline fun <reified R, reified T : ArrayList<R>> test() {
```this is the best i could do 🤷
#

test<String, ArrayList<String>>()

rigid mountain
#

Im trying to paste a schematic with worldedit in 1.8 like so:

WorldEditPlugin worldEditPlugin = (WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit");
        EditSession session = worldEditPlugin.getWorldEdit().getEditSessionFactory().getEditSession(new BukkitWorld(spawn.getWorld()), 100000);
        try {
            CuboidClipboard clipboard = MCEditSchematicFormat.getFormat(file).load(file);
            clipboard.setOrigin(new Vector(spawn.getBlockX(),spawn.getBlockY(), spawn.getBlockZ()));
            clipboard.paste(session, clipboard.getOrigin(), false);
        } catch(MaxChangedBlocksException e) {
            e.printStackTrace();
        } catch (DataException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }```

But im getting this error, anyone know why? https://paste.helpch.at/qokojujigo.bash It points to the CuboidClipboard line
dusky harness
#

show code for it

#

assuming thats not in the worldedit api

#

oh wait is it

#

oh wait it is

rigid mountain
#

yeah thats in worldedit

dusky harness
#

hmm

#

what if you print out file.isFile()

#

since as long as it's a valid schematic it should work

rigid mountain
#

file.isfile() prints true.

#

This is the same way i did it in a previous plugin in 1.8 but it doesnt work now for some reason

worn jasper
#

I don't understand it

#

is it because it's null?

dusky harness
dusky harness
worn jasper
#

need to do a copy

#

ty

#

uh any ideas what might be causing this? It's supposed to stack them.

var copyItems = items;
if (copyItems.size() > 0) {
  for (var lockerItem : copyItems) {
    if (lockerItem.getMaterial().equals(item.getMaterial())) {
      lockerItem.addAmount(amount);
    } else {
      copyItems.add(item);
      locker.getData().setLockerItems(copyItems);
    }
  }
} else {
  copyItems.add(item);
  locker.getData().setLockerItems(copyItems);
}
#

I am probably doing the the checks wrong lmao

#

wait no it's of the same type? cringe

#

god I am stupid

#

ooh ok

dusky harness
#

btw var copyItems = items; won't copy the list

worn jasper
#

wait actually?

dusky harness
#

yes

#

you're just referencing the items list when u do stuff with the copyItems list

worn jasper
#

so basically, I am stupid

#

understood

#

var copyItems = new ArrayList<>(items);

#

this would right?

dusky harness
#

yes

worn jasper
#

ye I think it's an issue on how I am doing the system

neon wren
#

shallow copy is var copyItems = items;.

#

deep copy is a new list copy from arraylist, or loop through each old list index and copy.

lyric gyro
#

uh no it's not

lyric gyro
lyric gyro
rigid mountain
#

How can i store a larger object in redis?

hoary scarab
hoary scarab
dusty frost
hoary scarab
#

👍

lyric gyro
#

@ashen sigil the list created by Arrays.asList is not resizable

#

you could do something like this instead new ArrayList<>(Arrays.asList(...))

lyric gyro
#

I mean if you're going for efficiency then you should first create the array list, and then use Collections.addAll

#

but bleh

restive isle
#

https://paste.md-5.net/alolazomij.java Im making an invertory for a bank acount and im getting a strange thing where the title and the lore is the same. eventho on every item i set the meta again and i delete the lore (lorelist.clear()) so i dont understand why its doing this? could somebody help?

tight junco
#

You're likely just repeatedly setting the same values

restive isle
#

so how would i fix that?

stuck hearth
#

I'm not sure what you think you're doing?

restive isle
#

?

stuck hearth
#
        meta.setLore(loreList);
        item.setItemMeta(meta);
        meta.setLore(null);```
like this for instance
restive isle
#

i make the lorelist null so the next item wont have lore

stuck hearth
#

Oh I see, ok sec.

#

Doesn't look like you're resetting properly in areas.

#

Let me pop this in my IDE, minute

stuck hearth
worn jasper
#

Uh so.. this is caused because bukkit can't find a material that corresponds to the given String but the thing is, it's dropping the items, which means, it did get?, so I am confused on why I am getting this issue https://paste.helpch.at/gegederami.bash

#

line 53: var drop = Material.valueOf(gensConfig.getString("gens." + tier + ".drop"));

#

Just tested it and all of them are working? so makes no sense lol

twilit chasm
#
public class Typewriter {
    static void pause(int millis) {
        try {
            Thread.sleep(millis);
        } catch (Exception e) {
        }
    }

    static void writer(String text) {
        for (String s : text.split("")) {
            System.err.print(s);
            pause(60);
        }
        Typewriter.writer("test");
    }
}
``` why can't I run this?
#

it doesn't show anything to run it

high edge
#

what the

shell moon
#

Best way to make a material "cookable" without adding FurnaceRecipe?
Context: I want some furnaces be able to cook diamonds (without affecting other furnaces)

tight junco
#

couldn't you just cancel that item from being cooked in any furnance that isnt the specific furnaces

shell moon
#

yes, even is only available in 1.18+ (before it starts to cook)

#

in lower versions only smelt event is available (which would make it run the cook animation and then stop when you cancel the event)

twilit chasm
#

how to make my main method call my other method presumably

shell moon
#

a(){
b();
}

worn jasper
#

is this correct? compileOnly files("libs/PlotSquared-Bukkit.jar")

#

(path is right)

lyric gyro
#

you can do fileTree("libs") but yes that will work

leaden sinew
shell moon
#

too complicated

forest jay
#

Does anyone know of a way to regenerate a chunk since World#regenerateChunk() is broken?

worn jasper
#

pretty sure the path is right

lyric gyro
#

code?

worn jasper
#

I don't have specific code, I can't even import anything

#

events, etc don't even show up in the ide

dense drift
#

compileOnly fileTree(dir: './libs', includes: ['*.jar']) this is what I use

dense drift
#

go to gradle tab and then dependencies

#

is plotsquared there?

peak onyx
worn jasper
worn jasper
worn jasper
dense drift
worn jasper
#

ye it is here

#

but that doesn't explain why I can't access anything from it

#

wth

#

I might not even need plotsquared because when a plot gets deleted/cleared, it uses worldedit to do so right?

#

Cause currently, what I want to do is remove the generators from the database, if they get deleted by the plot being cleared/deleted. Any ideas on how I could do this?

leaden sinew
worn jasper
leaden sinew
#

Make a custom Spigot jar

worn jasper
#

pain

#

Doesn't worldedit have a way of getting deleted blocks?

#

or an event that gets called when blocks are deleted using it

leaden sinew
#

You can probably use the edit session

#

There might be an event

worn jasper
#

ye gotta check

worn jasper
#

wut

#

I added WorldEdit to my dependencies

#

it's showing in the dependencies in gradle

#

but it's not letting me import it

#

TF

#

wtf

worn jasper
#

still haven't found a fix for this ^^

dusky harness
#

show build script

worn jasper
#

okay now I was trying to use the fawe api instead

#

Could not resolve com.fastasyncworldedit:FastAsyncWorldEdit-Core:2.1.1.

#

lol

worn jasper
#

literally followed the docs

dusky harness
#

looks like it should work

worn jasper
dusky harness
#

like where it tried searching

#

urls

worn jasper
#
Required by:
    project :

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

oh

#

😕

worn jasper
#

it's on mavenCentral

dusky harness
#

mhm

worn jasper
#

I have no idea what's happening with my gradle tbh

lyric gyro
#

git gud

pulsar ferry
worn jasper
#

the other version used it

#

at least I got told by you to add that exclude group

worn jasper
pulsar ferry
worn jasper
#

can anyone tell me if you are able to add it as a dependency without any issues?

pulsar ferry
#

Only GUI does

worn jasper
#

ye can someone test if adding FAWE as a dependency is working fine?

#

like, I can't see what's wrong lmao

#

GOD really gradle.

#

Found out the issue

#

def targetJavaVersion = 16

#

needs to be 17

#

can't gradle specify this next time? lmao

#

okay that that's done

#

how the hell can I detect the blocks I delete in an EditSession

#

I have no idea how to work with WE api

#

lmao

edgy hearth
#

how to remove permission from a player in luckperms api?

dusky harness
#

or you might have to remove the node
depending on what you need

lyric gyro
#

removing a permission isn't the same as denying btw

dusky harness
edgy hearth
spark skiff
#

hey guys, im currently making a lobby plugin, and ran into a problem

#

whenever i right click an item, the tps drops considerably

#

if i hold it for a long time, the tps drops to single digits and eventually crashes the server

dusky harness
spark skiff
dusky harness
#

are you interacting with a database sync?

spark skiff
#

nope

dusky harness
#

show code

spark skiff
#

oh yea

#

thats for database

#
    @EventHandler
    public void onInteract(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        if (manager.isInBuildMode(player.getUniqueId())) return;
        event.setCancelled(true);

        ItemStack item = event.getItem();
        if (item == null) return;
        if (item.getType() == Material.AIR) return;

        for (LobbyItem lobbyItem : JoinItems.getLobbyItems()) {
            ItemStack itemStack = lobbyItem.getItemStack();
            if (itemStack.getType() == item.getType()) {
                lobbyItem.onClick(event);
                return;
            }
        }
    }
dusky harness
#

is this PassiveListener or StaffModeListener

rigid mountain
#

Alright, so im using Gson to serialize an object jsona nd store it in a redis db. How can i store that in a mongo db persistantly? as the redis db is just for caching

spark skiff
dusky harness
#

it seems like the lag is coming from either PassiveListener or StaffModeListener

#

or both

#

¯_(ツ)_/¯

spark skiff
#

ill check staffmodelistener

dusky harness
#

alr

spark skiff
#
    @EventHandler
    public void onInteract(PlayerInteractEvent event) {

        Player player = event.getPlayer();
        User user = User.get(player.getUniqueId());
        if (!user.getSettings().isInStaffMode()) return;

        if (!event.getAction().isLeftClick()) return;

        switch (player.getInventory().getItemInMainHand().getType()) {

            case CLOCK -> {
                Player target = PlayerUtils.getRandomPlayer(player);
                if (target == null) {
                    Lang.PLAYER_TELEPORT_NO_PLAYERS.send(player);
                    break;
                }
                player.teleport(target.getLocation());
                Lang.STAFF_RANDOM_TELEPORT.send(player, "%TARGET%;" + target.getName());
            }

            case LIME_DYE -> {
                vanishHandler.unvanish(player);
                player.getInventory().setItem(8, StaffModeHandler.getVanishItem(false));
            }

            case GRAY_DYE -> {
                vanishHandler.vanish(player);
                player.getInventory().setItem(8, StaffModeHandler.getVanishItem(true));
            }

        }

        event.setCancelled(true);

    }
dusky harness
#

which one is this?

#

staffmode?

spark skiff
#

StaffModeListener

dusky harness
#

can you show the code for User?

spark skiff
#

thats a huge file

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

spark skiff
dusky harness
# spark skiff https://paste.helpch.at/ficefuxomi.java

at line 344 can you add a java Bukkit.broadcastMessage("Added user " + getUniqueId() + " to cache"); debug in save? to make sure that it's being added to the cache
and also one at line 503 in getFromDatabase ```java
Bukkit.broadcastMessage("Using database for " + uuid);

#

both should only be called once even when right clicking multiple times

spark skiff
#

mk

#

ok so i didnt click anything, and it broadcasts multiple times

#

i dont think thats a good thing

spark skiff
#

clicking something will broadcast even faster

spark skiff
dusky harness
#

💀 you sure the cache is working correctly? 🥲

spark skiff
#

well something is definitely wrong lmao

dusky harness
#

check getDataStore().save(profile)

#

since that's the only place where the save cache can be

spark skiff
#

Datastore is a morphia thing

dusky harness
#

oh

#

then run java instance.getDatabase().getUserCache().put(uuid, profile); below the save

#

then that should work

spark skiff
#
            instance.getDatabase().getDatastore().save(profile);
            instance.getDatabase().getUserCache().put(uuid, profile);
#

like this?

dusky harness
#

yep

spark skiff
#

alr

#

same thing

dusky harness
#

its keep showing Using database?

spark skiff
#

yep

dusky harness
#

huh

#

ohh

dusky harness
#

not below the save

#

so outside of the if statement

#

now that should work

spark skiff
#
        instance.getDatabase().getUserCache().put(uuid, profile);
        return profile;
dusky harness
#

yep

spark skiff
#

mk

#

same thing

#

Using database for uuid

#

could it be UserCache?

dusky harness
spark skiff
#

not exactly

dusky harness
#

O

#

uhhhhhhhh well i have 0 experience in redis

#

so

#

uhhh

#

get or put is prob not working

spark skiff
#

damn

#

actually now i see right click run multiple times a second if i click once and let go quickly

dusky harness
spark skiff
#

even if i hold right click?

dusky harness
#

yes - then it calls 10 times per second due to mc having a 5 cps rmb "autoclicker"

#

i think

lyric gyro
#

🥲

flat anchor
#

And just publish serialized data to channel

worn jasper
#

Anyone here knows how to use EditSessions from WE?

sterile hinge
#

Whats the question

carmine crow
#

do u guy know how can i sort players by luckperms ranks weights on tablist??

#

i want do that in my plugin

carmine crow
#

ok i can get weight, but now i want to sort players on tablist, i mean i know how to sort arraylist but i dont know how to even modify players order on tablist

dense drift
#

I think you need teams, and teams are ordered by name in tab

carmine crow
#

good idea

#

but i saw someone doing that with packets

#

but teams seems easier

#

so u mean i can make team "a" and in this team will be owner and it will be on top of other teams?

#

but name of team is not displayed on tablist?

#

idk how teams works i never used it

carmine crow
#

so i did

#

onJoin event

        int count = 97;
        ArrayList<Group> sortedGroups
                = new ArrayList<>(LuckPermsProvider.get().getGroupManager().getLoadedGroups());
        sortedGroups.sort(Comparator.comparingInt(o -> o.getWeight().getAsInt()));
        Collections.reverse(sortedGroups);
        for(Group group : sortedGroups){
            Utils.createTeam(scoreboard, (char)count, group);
            count++;
        }```
#
        Team team = scoreboard.getTeam(String.valueOf(name));
        if (team == null) {
            team = scoreboard.registerNewTeam(String.valueOf(name));
        }
        for(Player player : getAllPlayersFromGroup(group)) {
            team.addEntity(player);
        }
    }

    public static ArrayList<Player> getAllPlayersFromGroup(Group group){
        ArrayList<Player> result = new ArrayList<>();
        for(Player player : Wrapper.getPlugin().getServer().getOnlinePlayers()){
            if(LuckPermsProvider.get().getGroupManager().getGroup(LuckPermsProvider.get().getPlayerAdapter(Player.class).getUser(player).getPrimaryGroup()).equals(group)){
                result.add(player);
            }
        }
        return result;
    }
#

and rest of methods

shell moon
#

max distance a player can click a block? (survival)

bitter lark
#

Hello!
I'm trying to give a npc a custom skin but I'm having some trouble doing so.

gameProfile.getProperties().put("textures", new Property(config.getString("npcs.jeff.texture"), config.getString("npcs.jeff.signature")));

I saw this code in a tutorial so I tried it but it doesn't seem to change the skin. Am I forgetting something? Please let me know.
Thank you!

I'm getting the skin texture and signature from this site:
https://mineskin.org/

shell moon
#

you need to put the gameprofile maybe?

#

(never worked with that)

slow folio
#

Okay so basically I have a mining system and I'm trying to get the material's pretty name so like "Coal Ore" instead of "COAL_ORE"

#

But the material name is returning null or "E"

dense drift
#

If you can, use components and translate the material name

slow folio
#

I've tried using XMaterial

slow folio
#

I can log the material name by literally just outputting the material object and returns what I want

#

But It's not a string so I can't format it

#

I've tried material.toString()

#

I've tried material.name()

#

It outputs Unsupported material with no data value: E

#

When using XMaterial

#

I'm not sure why

robust flower
#

how do I convert this buildscript to the new plugin block in a build.gradle.kts file? KTS buildscript { ext.objectboxVersion = '2.9.1' repositories { mavenCentral() google() } dependencies { classpath "io.objectbox:objectbox-gradle-plugin:$objectboxVersion" } }

#

I tried this kt plugin { id("io.objectbox") version "2.9.1" }
but gradle says

Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin [id: 'io.objectbox', version: '2.9.1'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'io.objectbox:io.objectbox.gradle.plugin:2.9.1')
  Searched in the following repositories:
    Gradle Central Plugin Repository
    Google
    MavenRepo```
bitter lark
robust flower
# pulsar ferry Conversion plugin?

no, I have this exact block on my android project's build.gradle file, and I was converting it to kts, but if I remember correctly, buildscript block is deprecated and was replaced solely by the plugins block

#

should I post the full files?

pulsar ferry
#

Oh i read it wrong, give me a sec

robust flower
pulsar ferry
#

I guess best choice would be to try finding the plugin on gradle portal and see the id

#

Doesn't seem to be in portal hmm

robust flower
#

What is the correct way of importing/applying this plugin?

dense drift
pulsar ferry
#

He's trying to do it without buildscript though

#

Tried putting central in the plugin repositories but doesn't seem like you can, you might have to use the buildscript thing

robust flower
#

I guess I'll use it only for this plugin then, thanks for the help 👍

dense drift
#

weird plugin though

dense drift
robust flower
#

yeah, ngl this objectbox kinda sucks, I used it when I was learning android for this specific project because I had no idea what I was doing, and now I kinda wanted to converted this app to Kotlin applying proper OOP principles, so I guess I'm stuck with it for some time

worn jasper
#

any ideas how I can display the elder guardian "curse" effect on a player?

#

Couldn't find this anywhere

inner jolt
worn jasper
#

this is a development support channel

#

unsure why I would ask for the vanilla method

#

lol

inner jolt
#

You can run the comamnd using spigot but yeah i get that

worn jasper
#

that's not how coding works lmao

#

I want to do it directly with the api

lyric gyro
#

isn't it a particle effect?

inner jolt
inner jolt
#

it's paper exclusive

#

not in the spigot docs

lyric gyro
#

sucks to suck

inner jolt
#

oh shit i was looking at the wrong place 💀

#

thanks for correcting me

lyric gyro
#

when was this added...

#

also that name wtf mojang

#

ah it was added since the particle exists, cool ig

worn jasper
#

lol ty

bitter lark
#

I'm trying to get started with creating npc's but when I try to create a simple command that spawns a npc I get this error:

Caused by: java.lang.ClassNotFoundException: net.minecraft.world.entity.player.Player

This is my code: https://paste.md-5.net/ovifopayul.java
Could someone please help me?

#

yes

#

alright

#

i'll try

#

I'm getting an error at:

ServerPlayer serverPlayer = craftPlayer.getHandle();

Is this not the proper way to get a ServerPlayer?

#
Player player = (Player) commandSender;
CraftPlayer craftPlayer = (CraftPlayer) player;
ServerPlayer serverPlayer = craftPlayer.getHandle();
tight junco
#

that looks about right

#

the issue is likely with your plugin's NMS classes not being the same as your servers

bitter lark
#

And how do I fix that?

tight junco
#

well first of all what version is this & are you using maven/gradle

bitter lark
#

im using maven and this is 1.18.1

tight junco
#

uh send your pom.xml

bitter lark
#

spigot

#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
HelpChat Paste - How To Use

bitter lark
#

yes

#

well its the local host

worn jasper
#

what could cause org.bukkit.Location.getWorld() to return null?

fiery pollen
#

did you do the buildtools thing

worn jasper
#

oh mb, didn't notice something was happening

#

I will wait

fiery pollen
#

nahah its okay

#

is Location null?

dusky harness
#

it's nullable

#

where are you getting the Location?

worn jasper
dusky harness
#

u might have to add softdepend on it

#

(so that the worlds load)

#

since by default the plugin loads after (vanilla) worlds

#

(also assuming you're using gson I'd recommend making your own - not Bukkit's bc Bukkit's would attempt to serialize the world - Location class instead and storing that instead of a string)

worn jasper
dusky harness
#

hmmm

#

try printing out if Bukkit.getWorld returns null

#

on the load

worn jasper
#

I have a task running every 15s and it's returning this

#

but only in some, which is weird.

#

can it be an issue that I am running that task async?

ocean raptor
#

when do you cache the locations?

worn jasper
ocean raptor
#

and how, send the code

worn jasper
#

on a hashmap

#
for (var key : json.singleLayerKeySet("gens")) {
  var temp = key.split("::");
  var location = new Location(plugin.getServer().getWorld(temp[0]), Double.parseDouble(temp[1]), Double.parseDouble(temp[2]), Double.parseDouble(temp[3]));
  var gen = (Generator) SerialManager.fromString(json.getString("gens." + key));
  cache.getGenerators().cache(location, gen);
}```
#

cache part is just putting the data into a hashmap

#

nothing else

ocean raptor
#

worlds are not loaded on enable yet

lyric gyro
#

it depends

#

"by default" they are

worn jasper
#

where did you see that?

pulsar ferry
#

If it's exactly world::X::Y::Z, if you miss a single thing, you'll have an error

worn jasper
worn jasper
dusky harness
#

also what lib is that 🤔 i can't find it online

pulsar ferry
#

I'm not talking about that, I am saying you need to validate it or you'll get errors

#

Remember, users are stupid and they'll break your stuff

worn jasper
#

it's a private plugin

ocean raptor
#

try caching the locations 1 tick later, it should work

worn jasper
ocean raptor
#

lol

worn jasper
#

okay this is funny.

#

I completely deleted the json file

#

at first, it works perfectly fine

#

but the issues only come when I first restart

#

lol

#

null is indeed null

#

which means getServer().getWorld() isn't working properly

#

but what's weird is that the world does exist.

#

and even weirder, if I reload, now it works

dusky harness
worn jasper
#

probably because plots world is already loaded? idk

dusky harness
#

temp[0]

#

are you using a world other than world, world_nether, or world_the_end?

#

if so, you need to softdepend on the plugin that manages that world

dusky harness
#

do u have a world plugin?

worn jasper
#

nop, plotsquared created the world

dusky harness
#

ah

#

try depending on plotsquared

worn jasper
#

like legit just adding it to depend?

dusky harness
#

yes

worn jasper
#

k

worn jasper
#

btw

dusky harness
#

ah

worn jasper
#

lets see, added the depend thing

#

okay nop

#

depending on it, didn't work

#

this is funny af

#

because if I reload afterwards

#

it works

#

ye I gotta find a way to check if the world is loaded.

#

and if it isn't, load it

#

found this: new WorldCreator("arena").createWorld(); doesn't this create a totally new world?

lyric gyro
#

uh you probably shouldn't do that

#

you should really just depend on the plugin that is in charge of loading the worlds and loading the config stuff after that's done instead

#

alternatively load the config in ServerLoadEvent ig

dusky harness
lyric gyro
#

then the loading stuff will be called each time a world is loaded, but that doesn't guarantee that the world in the config will be

dusky harness
#

#equals

#

:)

#

oh ic

#

what u mean

#

ye ig he should try serverloadevent

#

and if that doesnt work

#

then worldloadevent

#

although that'll complicate things a bit

worn jasper
#

still didn't load

worn jasper
dusky harness
#

although u prob dont even need to run it async if its in onEnable 🤷

worn jasper
#

will try the serverload event

lyric gyro
#

lol for non-default worlds they load them one tick later

#

gg

worn jasper
#

so, wait like 10 ticks before loading it?

#

on serverloadevent

#

?

lyric gyro
#

that should do it lmao

worn jasper
#

we will see

#

omg poggers actually worked lul

#

you guys are pro's

#

thx for the help

#

🙂

shell moon
#

Best way to get the enchantment name?
(getName is deprecated in new versions and getKey is not available in old versions)

lyric gyro
#

just use getName

shell moon
#

how to get the Enchantment.SILK_TOUCH (the one in bold)

#

wont it be deprecated?

lyric gyro
#

in newer versions yes, but you are basically coding for an old version

shell moon
#

1.8+

lyric gyro
#

woozy_face

shell moon
#

would be enchant.getKey().getKey()

#

but it would return something like minecraft:silk_touch or similar

#

right?

lyric gyro
#

depends uh

shell moon
#

What about enchant.toString()?

lyric gyro
#

what does the first getKey return

shell moon
#

returns namespacekey

#

getKey returns string

#

but doesnt have not null annotation

lyric gyro
#

yeah NamespacedKey#getKey would return silk_touch

lyric gyro
shell moon
#

no way to know how the variable is named right?

#

i mean, without reflections

lyric gyro
#

there are getById/getByWhatever methods

#

static

#

in Enchantment, those are the ones you should use

shell moon
#

i hate those breaking changes

lyric gyro
#

I mean

#

nothing is breaking in any of that

shell moon
#

for me

#

xD

lyric gyro
#

how is any of that breaking?

shell moon
#

once its removed

#

xd

lyric gyro
#

it won't be lmao

shell moon
lyric gyro
#

it hasn't been removed for years when it should have, why would it be removed anytime soon? and the entire ecosystem is designed to not break old plugins

shell moon
#

i dont trust that xd

#

idk why