#help-development

1 messages · Page 892 of 1

echo basalt
#

fixed it with unsafe :3

eternal oxide
#

that IS nms

frail sluice
tender shard
#

are you on 1.16 or older or sth? o0

eternal oxide
#

stay away from NMS unless there is no alternative

echo basalt
#

mm I love abstracting reflections

frail sluice
eternal oxide
#

only in nms

#

?nms

young knoll
#

Smh where is the SNBT support

tender shard
#

brb

tender shard
#

there it is

young knoll
#

Does it work

tender shard
#

idk - how does one of those snbt strings look like?

young knoll
#

Uhh

#

Something like {CustomModelData:1}

#

Actually the item one might be with the item name

inner mulch
#

?paste

undone axleBOT
young knoll
#

minecraft:diamond{CustomModelData:1}

inner mulch
tender shard
tender shard
young knoll
#

Woo

#

I hate the essentials give command cuz it fucks that up

tender shard
# inner mulch yes

well that's the issue. You told javac that it'll get your shaded version of the class but in reality it's a class from another classloader.

You either must not access the other class, or not shade it into this plugin

inner mulch
rough ibex
#

the inner machinations of java

tender shard
#

You are accessing the class from another plugin I guess. But you also have it in your plugin shaded.

Your plugin now thinks it gets the class that's included in your plugin, but in reality it gets passed the class from the other plugin that just happens to have the same name, same methods, etc

inner mulch
#

oh

topaz cape
#

can i add the dependancies thing in the plugin.yml of bungeecord (if yes is there a link of how those stuff work?)

#

what?

#

no

inner mulch
#

oh

#

you need to add dependencies in the pom.xml

topaz cape
#

you can add dependencies in modern spigot versions in your plugin.yml for the server to download on runtime

tender shard
#

you mean libraries

topaz cape
#

im asking if that’s available on bungee as well

#

yes libs

young knoll
#

Yeah I don’t think bungee has a library loader

#

Afaik

tender shard
#

it does have this in PluginDescription

young knoll
#

Hm

tender shard
#

yep should work

topaz cape
#

generally speaking, is it better if i write my own if i need to add Velocity support at somepoint?

tender shard
#

your own library loader?

topaz cape
#

yes

tender shard
#

no

#

rather use an existing library for it

topaz cape
sand spire
#

Should I load necessary playerdata from config with PlayerJoinEvent or PlayerLoginEvent

topaz cape
#

does it just use old ones?

tender shard
#

however idk, read their readme i guess

topaz cape
#

aight tysm this sounds awesome ngl

tender shard
winter schooner
#

One message removed from a suspended account.

tender shard
#

?services

undone axleBOT
tender shard
#

however if you rekd your world without a backup, you're pretty much fucked

winter schooner
#

One message removed from a suspended account.

tender shard
#

no 🥲

winter schooner
#

One message removed from a suspended account.

tender shard
#

yeah unfortunately, no backup no mercy

frail sluice
tender shard
#

did you setup mojang maps?

frail sluice
#

I installed NMS with buildtools

tender shard
#

are you using maven?

frail sluice
#

gradle

tender shard
#

ok first of all you gotta change your dependency from org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT to org.spigotmc:spigot:1.20.4-R0.1-SNAPSHOT:remapped-mojang

#

did you run buildtools with the --remapped flag?

#

if not do it before changing your dependency

remote swallow
#

do you have mavenLocal() in repositories

tender shard
# frail sluice what does this do exactly

if you're using mojang maps, your compiled code tries to access the proper method names. that plugin will take your compiled .jar and changes the method calls etc back to the obfuscated names

#

otherwise your plugin won't work

frail sluice
#

btw, is it possible to see the actual implementation of methods?

sand spire
remote swallow
#

there is multiple

#

a runnable version and a supplier version

young knoll
#

supplyAsync

remote swallow
#

use supplyAsync to return a value

#

get shit on coll

young knoll
#

My message is first on my screen

#

So

tender shard
#

usually you want to do sth like this

public CompletableFuture<MyConfigClass> getCOnfigAsync() {
  return CompletableFuture.supplyAsync(() -> ...);
}
echo basalt
#

futures my favorite

sand spire
#

do I need to return the class my config code is in or "FileConfiguration"

tender shard
#

wdym with "the class my config code is in"?

sand spire
# tender shard wdym with "the class my config code is in"?
public CompletableFuture<FileConfiguration> getConfigAsync() {
        return CompletableFuture.supplyAsync(() -> getConfig());
    }```
or 
```java
public CompletableFuture<ConfigManager> getConfigAsync() {
        return CompletableFuture.supplyAsync(() -> getConfig());
    }```
echo basalt
#

why are we doing this async on the first place think3d

tender shard
#

well what's the return type of getConfig() ?

#

maybe getConfig() loads a 2mb json file?

echo basalt
#

It's file to load the configs "sync" onEnable and just cache the values

echo basalt
sand spire
#

oh FileConfiguration

echo basalt
#

We'd rename to loadConfig

#

or initConfig

sand spire
#

rn I load data from config like this

public void loadData(Map<UUID, Integer> dataMap, Player player, String dataType) {
        if (!dataMap.containsKey(player.getUniqueId())) {
            if (!configManager.getConfig().contains(player.getUniqueId() + dataType)) {
                dataMap.put(player.getUniqueId(), 0);
                player.sendMessage("Created new " + dataType + " profile");
            } else {
                dataMap.put(player.getUniqueId(), configManager.getConfig().getInt(player.getUniqueId() + dataType));

                player.sendMessage("Used " + dataType + " from config");
            }
        }
    }```
#

but alex has async idk whats better

echo basalt
#

ow that looks ugly

sand spire
#

thanks

frail sluice
#

Ok... any idea what POTENTIAL_JOB_SITE and MEETING_POINT are? ```java
public void releaseAllPois() {
this.releasePoi(MemoryModuleType.HOME);
this.releasePoi(MemoryModuleType.JOB_SITE);
this.releasePoi(MemoryModuleType.POTENTIAL_JOB_SITE);
this.releasePoi(MemoryModuleType.MEETING_POINT);
}

sand spire
#

Also, how do I get the data from the CompletableFuture?

getConfigAsync.getInt doesn't work anymore like it did before it was async

remote swallow
#

you have to run stuff after its completed

#

getConfigAsync.whenCompelete

sand spire
remote swallow
#

no

#

you use the values of when complete

sand spire
#

uh

remote swallow
#

getConfigAsync.whenComplete((config, ex) -> { chec ex isnt null, interact with config})

echo basalt
#

I think luka's not properly aware of how futures work

#

And like.. multithreading

#

People just thing "async good"

#

I wish I were an animator rn to just come up with visual examples

sand spire
#
configManager.getConfigAsync().whenComplete().thenAccept(dataMap.put(player.getUniqueId(),configManager.getConfig()));```
i got 2 errors 💀
sand spire
echo basalt
#

Alright

#

Let's start with the mega basics

#

We have threads

#

A thread is basically a line of processing

#

Think of it like a person doing a job

sand spire
#

yeah i understand how async works

echo basalt
#

That thread can sleep (stop all work until it wakes up again) etc

#

There's also a thread pool

#

Think of a thread pool as just a collection of threads

sand spire
#

its like instead of running code on 1 timeline you run it on an adjacent timeline or something so the stuff on the second timeline doesn't slow down the main timeline

echo basalt
#

Where when you have a task, you grab an available thread, if possible

#

Let the thread process that task

#

And when the thread is done, it goes back to the pool

#

When the pool is empty, it is considered "exhausted", and all tasks will just wait until there's a thread available

#

Now that's out of the way

#

a Future is basically an object that represents a "pending" task

#

A completablefuture is an extension of Future that allows you to chain logic when that "pending" task is complete

#

Or other kinds of states, like when it faces an exception

sand spire
#

Alright

echo basalt
#

You can manually create and complete these futures

#

But you can also use the runAsync / supplyAsync static methods

#

Where you pass a Runnable / Supplier

#

And it passes that task onto a thread pool

#

That runs your task on another thread

#

Once that task is done, the future completes with the task's returned value (Void in case of a Runnable)

#

Now, when you do your runAsync / supplyAsync methods, they return a CompletableFuture and don't block the thread

#

It's your responsibility to hook up logic that happens when the task is complete, and making sure all its underlying logic is thread-safe

#

Here's an example

sand spire
#

thread safe?

echo basalt
#

That just means it won't face any weird concurrency issues

sand spire
#

alright

echo basalt
#

Or struggle when two threads are doing things at the same time

#
public void sendRequest(Player player) {
  // This runs in thread A

  this.getPlayerDataAsync(player).thenAccept(data -> {
    // This runs in thread B
    data.doSomething();
  }); 

  // Code still runs in thread A
}

private CompletableFuture<PlayerData> getPlayerDataAsync(Player player) {
  return CompletableFuture.supplyAsync(() -> this.getPlayerDataSync(player));
}

private PlayerData getPlayerDataSync(Player player) {
  // Read from file or some other blocking method
  return ...;
}
sand spire
#

if you dont use future everything is automatically in the main thread or thread A right?

echo basalt
#

Not in every case

sand spire
#

oh

echo basalt
#

Some events are fired async

sand spire
#

thanks spigot

tender shard
#

But they got Async in their name

echo basalt
#

There's no need for certain stuff to run on the main thread

#

Like chat

#

Or player logins

#

You can still run futures on them, it's whatever

wintry lynx
#

So this should get every block from an explosion, correct?

echo basalt
#

you don't need to stream to forEach

wintry lynx
#

I edited it because I was using other stuff before

#

forgot to remove it

sand spire
#

I think I understand why and how to make something async but I have no idea how to get the data from the completablefuture

echo basalt
#

You can handle completion using the following methods:

  • thenRun(Runnable) - Just runs code once the future has been complete
  • thenAccept(Consumer<T>) - Provides a variable, you do whatever
  • thenApply(Function<T, U>) - Provides a variable, you can return whatever you'd like
  • thenCompose(Function<T, CompletionStage<U>>) - Used for chaining futures, where the main future now runs the sub-future's task
sand spire
#

this is what i tried

configManager.getConfigAsync().thenAccept((config, ex) -> { dataMap.put(player.getUniqueId(), configManager.getConfig().getInt(player.getUniqueId() + dataType))});

echo basalt
#

No clue why you're calling getConfig again

frail sluice
#

what is remapped-obf?

echo basalt
#

you have the config object

sand spire
#

to get the data

echo basalt
#

..

#

but the future gave you the data

sand spire
#

but how do i get it

echo basalt
#
fetchValueAsync().thenAccept((value) -> {
  // do something with the returned value;
});
#

????

#

Your lambda provides it

sand spire
echo basalt
#

thenRun does the same except it doesn't pass your value??

sand spire
#

oh

echo basalt
#

Take a minute to do some research

frail sluice
#

How do I get a CraftVillager? typecasting?

tender shard
#

(and check instanceof before)

frail sluice
sand spire
#

took a while even tho you gave it on a plate...

#

its probably cause I don't understand lambs, I will search a tutorial tomorrow but for now imma sleep have a great rest of your day

wintry lynx
#

For some reason this doesnt get every block or something is stopping them from being removed.

#

It prints In structure without error but some of the blocks get broken anyway

#

This wall should be unbroken because its part of the structure

#

but only part of it is unbroken

young knoll
#

That’s an F for essentials

#

But now they can do it properly

frail sluice
#

Is there something else that's getting called when an entity is removed?

olive vault
#

?paste

undone axleBOT
olive vault
#

https://paste.md-5.net/nimohoqeji.java

and also my config.yml

config-version: 1 # DO NOT EDIT, NO SUPPORT GIVEN IF EDITED

# The plugin does not allow "/" in front of the command as it automatically uses it



maincommand:
  permission: "*"
  permission-message: "&cYou cannot access this command"

blocked-commands:
  bukkit:?:
    permission: "*"
    permission-message: "&cYou cannot use this command!"```
#

why is the blocked command not working?

worldly ingot
#

I think more importantly, why is your arm so stretched? lol

olive vault
#

lmfao

worldly ingot
#

But it's most likely the fact that "bukkit:?" isn't in quotation marks

olive vault
#

oHH

worldly ingot
#

YAML probably having a stroke

olive vault
#

im confused why I didnt get any errors

worldly ingot
#

Just silently fails to parse

olive vault
#

tysm

quaint mantle
#

How would I make a database that doesn't break the open closed principle

olive vault
#

so like this?

blocked-commands:
"bukkit:?":
permission: "*"
permission-message: "&cYou cannot use this command!"

quaint mantle
#

then I got to register or impl a new line to serialize and deserialize that

olive vault
#

its just doing the command as normal

ivory sleet
#

which means like, you should be able to modify a class, without the need to recompile it (explicitly editing a classfile)

#

and the way u allow that is by composition and inheritance mostly

wintry lynx
young knoll
#

Does it print that for each block

olive vault
young knoll
#

Add a config.yml in your jar and then just use saveDefaultConfig

olive vault
#

this is my jar layout, what does savedefaultconfig do?

compact haven
#

writes resources/config.yml to plugins/.../config.yml

quaint mantle
#

If I had 5 different databases

#

I would need to register 5 different serializers

#

everytime I add a new stat

ivory sleet
olive vault
ivory sleet
#

Anyhow, the open closed principle doesn’t help you much

olive vault
#

here is my config.yml

quaint mantle
#

I've noticed a lot of plugins just couple themselves with one database

olive vault
#

# The plugin does not allow "/" in front of the command as it automatically uses it
# ANY commands with ":" in it MUST have quotations


maincommand:
  permission: "*"
  permission-message: "&cYou cannot access this command"

blocked-commands:
  "bukkit:?":
    permission: "*"
    permission-message: "&cYou cannot use this command!"```
young knoll
#

Why not just use permissions to block commands

ivory sleet
#

Max, open closed principle is more advantageous as a concept when one has multiple jars and want to have some degree of independent redeployment in a system runtime

#

That is, avoiding to recompile every line of code in a system

(Or for third party dependencies where the target audience of consumption is the entire world)

young knoll
#

If you don’t want someone to use /plugins you can explicitly remove the permission

olive vault
#

nono i want to do it for custom commands too

#

its gonna be a public plugin

remote swallow
#

they also probably have permissions

young knoll
#

At least they should :p

quaint mantle
#

like version independent plugins

olive vault
#

hmm alr

#

ima make anew plugin

ivory sleet
#

Well yes and no

#

I mean, the SOLID principles are derived more concretely from the industry and applied in the industry as that’s where they become more important

#

in the scope of a minecraft plugin, it is rarely the case you’d need to religiously respect them

#

I can give you an example of when applying the open closed principle is significantly advantageous if u want

quaint mantle
#

Sure

#

I'm just wondering how I should save persistent data rn lol

olive vault
#

@EventHandler
public void commandExecutedEvent(PlayerCommandPreprocessEvent event) {
String command = event.getMessage().toLowerCase().replace("/", "").trim();
if (command.contains(":")) {
if (!event.getPlayer().hasPermission(config.getString("permission"))) {
event.setCancelled(true);
}
}

}

How can I make the "command" string only the command

quaint mantle
#

I think I'll just couple my plugin with Gson

remote swallow
#

or just split it by space and use the first arg

olive vault
#

ohh i forgot about .split

#
ArrayList<String> command = new ArrayList<>(Arrays.asList(event.getMessage().toLowerCase().replace("/", "").trim().split(" ")));
if (command.contains(":")) {
    if (!event.getPlayer().hasPermission(config.getString("permission"))) {
        event.setCancelled(true);
    }
}```

is this good?
quaint mantle
#

You can probably do some thing like

#

Arrays.stream(splitting madness).filter(str -> str.contains(":")).isPresent()

#

I forgot the names

#

But it's something like that

remote swallow
#

it also wont ever contain just ":" because thats not how it gets split

olive vault
#

the bottom one looks easier but thanks max and thanks epic

wintry lynx
quaint mantle
#

Wait

#

are you blocking cmds that have the colon

olive vault
#

=yes

ivory sleet
#

Let’s say you’re writing a system, the system entails 100 million lines of code, we can both agree on that compiling this code base every-time we made a change to the source is going to be time consuming, even with modern build tools such as gradle or maven. Think, what modules of your system would you want to be able to compile without having to recompile the entire system?

|| One answer is that the GUI module would be neat to have this property, GUI code can be susceptible to change for no apparent reason, maybe the client, or the stakeholders just don’t want the blue background color anymore. ||

Another application of the open closed principle is reusability. Which on its own does imply abstraction. Reusability is something that, as an api designer becomes quite integral, for one if you have designed a software for others to use, you would want it to be appealing to them. The consumer should be able to use your software they way they want to within scope of expectations. By having this flexibility, they need not to fork the source and recompile your software every-time they would want to change something. It is also quite nice for yourself as you may not have to edit and recompile thus avoiding binary incompatibilities assuming you’ve been faithful to the principle.

quaint mantle
#

WTF

olive vault
#

lmfaoo

ivory sleet
#

Its to max

#

Regarding the open closed principle

quaint mantle
#

yeah that examples makes sense

#

pretty extreme one lol

rough ibex
#

Eh

#

It's pretty straightforward.

ivory sleet
young knoll
#

Laughs in CSS

#

Well, for web apps anyway

quaint mantle
#

Yk what I could do

#

For each stat I make it have the ability to serialize and deserialize itself

ivory sleet
#

Coll the web developer!?

young knoll
#

My college made us do a ton of it

#

Guess they forgot anything other than web dev still exists

olive vault
#

php or html?

#

lol

ivory sleet
#

Are you defining some sort of database polymorphic structure that supports both sql, graphs, nosql max?

quaint mantle
#

and json

ivory sleet
young knoll
#

“Software development”

ivory sleet
#

Lmao

young knoll
#

So computer science from Walmart

quaint mantle
#

rn I'm just thinking of making my own object that's basically a wrapper of a hashmap

#

but only supports primitives and strings

ivory sleet
#

I think they deal w database types in a reasonable way

quaint mantle
#

yeah I checked it out

remote swallow
#

oh fuck its 3:20

#

how is it 3am

ivory sleet
#

Obv it isn’t perfect, but its a good step in the right direction

quaint mantle
#

The interface and the async part makes sense

#

but then it gets so abstracted idk what's happening

ivory sleet
#

A little bit yea

quaint mantle
#

Nah it's a lil better now

#

Last time I checked was a month ago when I was rly rly clueless

#
    @Override 
     public void saveUser(User user) throws IOException { 
         user.normalData().discardChanges(); 
         try { 
             if (!this.plugin.getUserManager().isNonDefaultUser(user)) { 
                 saveFile(StorageLocation.USERS, user.getUniqueId().toString(), null); 
             } else { 
                 ConfigurationNode file = ConfigurationNode.root(); 
                 if (this instanceof SeparatedConfigurateStorage) { 
                     file.getNode("uuid").setValue(user.getUniqueId().toString()); 
                 } 
  
                 String name = user.getUsername().orElse("null"); 
                 String primaryGroup = user.getPrimaryGroup().getStoredValue().orElse(GroupManager.DEFAULT_GROUP_NAME); 
  
                 file.getNode("name").setValue(name); 
                 file.getNode(this.loader instanceof JsonLoader ? "primaryGroup" : "primary-group").setValue(primaryGroup); 
  
                 writeNodes(file, user.normalData().asList()); 
                 saveFile(StorageLocation.USERS, user.getUniqueId().toString(), file); 
             } 
         } catch (Exception e) { 
             throw new FileIOException(user.getUniqueId().toString(), e); 
         } 
     }

I don't think they have the self serialize thing

ivory sleet
# quaint mantle but then it gets so abstracted idk what's happening

iirc I think they use the built in datatypes for sql, and obv they take advantage of tables and relational data,

for files iirc they just map an explicit lock to every file and then they populate a given data object and fill in default data if needed, delegating the file format parsing to configurate (a config lib)

wintry lynx
#

So I removed all if checks so it should just universally not break anything and it did this

#

also yes I know there is an easy way to comment out code

#

I just didnt use it cuz brain damage

ivory sleet
#

Are you even allowed to invoke remove() inside that forEach?

wintry lynx
#

just not all

ivory sleet
#

well, for concurrent collections yea

#

but you’re doing this single threaded no?

wintry lynx
#

Like there is a 50% chance for the block to not be broken

ivory sleet
#

That’s a bit under engineered

wintry lynx
#

Yea i didnt change anything

ivory sleet
#

You might wna define some sort of interface that contracts a serialize and deserialize method max

quaint mantle
#

yeah

#

What's a word that combines serialize and deserialize

#

you think something like factory

ivory sleet
#

Serializer is fine

young knoll
#

serialize technically :p

quaint mantle
#

Alr

young knoll
#

removeIf mayhaps

wintry lynx
#

Wait doesnt remove if work for properties and not actual methods?

#

or am i stupid

ivory sleet
#

whaa

wintry lynx
#

Since the check is running the blocks location through structure checks

ivory sleet
#

removeIf takes a predicate right?

young knoll
#

Ye

olive vault
#

anyone know a good yaml manager (like a updater class for yaml files)?

wintry lynx
#

Im using a method to run through anything that makes it unbreakable

#

Structure locations, nearby blocks, stuff like that

ivory sleet
olive vault
#

yes

ivory sleet
#

Well, I know mojang uses DFU to deal with their format updates, but something simpler… hmm, not sure exactly. I think most devs just define some sort of case by case update functions

#

Or fallback values etc

wet breach
#

something that can be leveraged here is the classloader

ivory sleet
#

Yeah well you’d distribute each module in a separate jar more or less

wet breach
ivory sleet
#

Yep, but to be able to do such things, you’d need to write code that supports it, which is sorta what the example points at

olive vault
#

I just found this from some random plugin

config.addDefault("enableShulkerbox", true);
config.addDefault("enableEnderChest", true);
config.addDefault("enableCraftingTable", true);

https://github.com/percyqaz/UltimateInventory/blob/main/src/main/java/me/Percyqaz/UltimateInventory/UltimateInventory.java

GitHub

Minecraft server plugin to streamline inventory management - Supports PaperMC and SpigotMC - percyqaz/UltimateInventory

#

what does it mean?

#

and how can I impliment it

ivory sleet
#

I mean, it defines a default value to a specific key

olive vault
#

so that would basically be an updater thing?

ivory sleet
#

Yeah, it can be

olive vault
#

alr ty

short plover
#

if I place a block that's not supposed to be on top of another block, for e.g a small dripleaf on top of a stone block, and then I break a block next to the dripleaf, it will make the small dripleaf break because of that, how do I cancel it?

young knoll
#

BlockPhysicsEvent

young knoll
short plover
wintry lynx
#

Im testing a basic for each

young knoll
#

you have a block

#

Than you can get the location of

olive vault
#

does "getConfig()" get the config in the datafolder? or just the plugin jar

young knoll
#

Data folder

olive vault
#

ty

#

whats the difference between saveDefaultConfig and saveConfig

#

and what should I do when the plugin enables

young knoll
#

saveDefaultConfig copies the file from the jar to the data folder

#

Save config saves any changes made to the config

olive vault
#

tysm

#

https://paste.md-5.net/pujipofose.java

why is it saying the command is blocked? here is my config.yml:

config-version: 1

permission: blockcommands.bypass

blockedpermissionmessage:
  - ""
  - "This command is blocked!"
  - ""

blockedcommands:
  - "pl"
blockedcharacters:
  - ":"```
bitter rune
#

did you add the permissions to yourself? it doesnt look like OP is considered a person that bypasses it

olive vault
#

i didnt. this is a fresh server

#

the command I ran was /plugins

#

which is not on the list

#

so it shouldve worked

young knoll
#

Because you are checking if the command they ran contains any of the blocked commands

#

/plugins does contain pl

olive vault
#

nono i removed /plugins from the configuration list for testing

#

to see if its only looking at the jar file

#

or the actual config.yml

young knoll
#

Like I said

#

The command “/plugins” does contain the string “pl”

candid inlet
wintry lynx
#

I might be losing my mind

short plover
echo basalt
#

I feel like that'd cause a ConcurrentModificationException

#

just event.blockList().clear()

wintry lynx
#

Well in that code im just trying to remove all blocks from the list of blocks the explosion will damage but in the long run im trying to disable a certian number of blocks based on location and type

echo basalt
#

event.blockList().removeIf(block -> ...)

wintry lynx
#

Yea that didnt work

#

Already tried

echo basalt
#

I remember making an explosion-proof glass thing

wintry lynx
echo basalt
#

and it worked fine

lost matrix
wintry lynx
#

or that time was

#

which doesnt make sense since its supposed to remove all of them

lost matrix
#

Your code should not work in the first place.

wintry lynx
lost matrix
#

Just try list.clear() for now

wintry lynx
lost matrix
lost matrix
wintry lynx
#

Just as a test?

echo basalt
#

smile saying "pls" instead of "please"

#

he's either incredibly sleep deprived or just woke up

young knoll
#

Plz

echo basalt
#

pl0x

lost matrix
#

yeah

#

code change plox

wintry lynx
#

So yea that works.

#

106 is the blocks originally hit

echo basalt
#

Congrats you're having some kind of exception

wintry lynx
#

second is the blocks remaining

lost matrix
#

Alright. Now use removeIf(Predicate<Block>)

wintry lynx
echo basalt
#

you were having**

wintry lynx
echo basalt
#

Probably some weird uncaught exception

wintry lynx
echo basalt
#

But yeah let's build up from here

#

removeIf(block -> true) should have the same effect

wintry lynx
#

yep same effect

echo basalt
#

Alright, let's add a check now

#

How about getting rid of half the blocks

#

removeIf(block -> ThreadLocalRandom.current().nextBoolean())

#

Or just filtering by block type

#

Keep in mind returning true will remove the item from the list, therefor "saving it" from being removed

lost matrix
# wintry lynx What would I put its if as?

I would recommend creating a method called

public boolean isExplosionResistant(Block block) {
  // Write your impl. Return true if explosion resistant
}

Then you can use it like this:

list.removeIf(this::isExplosionResistant);
young knoll
#

Yay method references

wintry lynx
#

Tho it would be isInStructureResistant since the plan is to disable a structure brom being broken into

wintry lynx
echo basalt
#

Not exactly but close enough

eternal oxide
#

Random so close enough

wintry lynx
#

true

rigid loom
#

https://paste.md-5.net/guxahunuxi.cs
for some reason this doesn't actually disband the kingdom upon server reload, even if there's more than just the kingdom being disbanded in existence

lost matrix
rigid loom
eternal oxide
#

The logic in those two sets fo code is so close it's pointless seperating them

lost matrix
#

Was about to say that im seeing a lot of dry code here

eternal oxide
#

First one, if no perms do all this shit and delete anyway.
Second one, if he does have perms still delete

wintry lynx
#

So putting the ifs in a method works fin but doing it inside of the actual explosion event dont 😑

lost matrix
# rigid loom Thats not very helpful. Also i dont want to restart the server every single ti...

Add a bunch of debug messages to see whats being called.
I can see quite a few points of failure here but fixing them might need major changes to the whole structure of your plugin.
For the next time:

  • Never write a getter or setter for your collections (lists, sets, maps, etc)
  • Create more manager classes like KingdomManager etc, instead of keeping all your data in the JavaPlugin class
eternal oxide
rigid loom
eternal oxide
#

it is identical, The only difference is you do three checks and return if they don;t have the permission

#

rest of the code is duplicate

dreamy ridge
#

spigots damage method does armor-piercing damage. is there any way to make it not?

rigid loom
#

Took me a sec

eternal oxide
#

are you running this code in onDisable?

#

and is "plugin" referencing your plugin or Kingdoms?

wintry lynx
#

@lost matrix Great success. 22k TNT :P

#

Top section of the structure is destructable, lower half is not

lost matrix
#

Noice

young knoll
#

Das a lotta boom

frail sluice
#

Can I replace a spawned entity with a custom NMS subclass?

lost matrix
#

Yes

frail sluice
#

How?

lost matrix
# frail sluice How?

There are several approaches depending on how clean you want the replacement to be.
Some can be quite complicated. The easiest way would be to listen to spawn events, cancel them and spawn your
own entity instead.

frail sluice
lost matrix
#

Um. Remove it and spawn your own then?

frail sluice
#

Wouldn't that be noticeable?

lost matrix
#

Explain the overal situation. What do you need this for?

frail sluice
#

I want to replace the behavior of a villager at some point

lost matrix
#

Then spawn your custom villager from the beginning and have the logic reflect your change instead of replacing the villager completely

frail sluice
#

I see.

#

What would happen if the plugin is uninstalled?

lost matrix
#

Then your classes are no longer found and the villagers will be replaced by vanilla ones

frail sluice
#

👍

short raptor
#

This is less development and more design, but if your plugin had two different abilities the player could use, how would you enable them to activate these abilities? A hotbar item is not an option

#

You could put one ability on crouch, but then what for the second?

rotund ravine
#

Double crouch?

#

Crouch double right click?

short raptor
#

Yeah, I feel like double crouch will make the most sense, I'm just testing to see if anyone else had an idea I haven't come across

rotund ravine
#

Double space

lost matrix
tribal zephyr
#

What event can I use to check what a dispenser dispense

#

I want to check if the dispensed item is a elytra

undone axleBOT
tribal zephyr
tender shard
#

@rotund ravine i heard you‘re gonna write some basics modules today? :3

torpid blaze
#

Hey,
I know, 1.8 is not supported anymore but I still would like to ask, if anyone knows how I could "fix" the minecraft bug, where the players nametag is still visible, even though he drank an invisibility potion.
I thought of manually making the nametag invisible when a player has the effect and remove it again when the effect disappeares, but I can't find any event that triggeres on these moments.

Does anyone maybe know a better way to do this?
It would mean a lot to me!

eternal oxide
torpid blaze
#

but that doesn't exist in 1.8

#

still thanks!

cobalt thorn
#

How can i get the face of any block like bedrock and apply it to an armorstand to rotate (the event is BlockPlaceEvent)

sullen marlin
#

sorry I don't understand

cobalt thorn
#

i need to get the face of a block like the direction was north and then apply it to an armor stand

#

to look in the same direction as the block

tender shard
#

in PlayerInteractEvent you can get the clicked blockface

cobalt thorn
tender shard
#

then you just keep it in a map for a tick or sth

#

although BlockplaceEvent also has a placedAgainst block

#

might be the other way around, idk you gotta try

cobalt thorn
tender shard
#

wdym with "rotation"? a yaw value?

cobalt thorn
tender shard
#

just map the 4 faces to their yaw values or sth, idk, e.g.
WEST = 90
NORTH = 180
EAST = -90
SOUTH = 0
or sth like that

eternal oxide
#

apply that vector to teh stand

tender shard
#

but that would only move the armorstand instead of rotating it, no?

eternal oxide
#

is he tryign to set teh head facing or the whole stand?

tender shard
#

tbh i have no idea what they're trying to do lol

eternal oxide
#

lol

#

if it's the head he can setHeadPose(new EulerAngle(x,y,z)) of the vector

shadow night
#

tf is a EulerAngle

#

idk maths btw

sullen marlin
#

The Euler angles are three angles introduced by Leonhard Euler to describe the orientation of a rigid body with respect to a fixed coordinate system.They can also represent the orientation of a mobile frame of reference in physics or the orientation of a general basis in 3-dimensional linear algebra.
Classic Euler angles usually take the inclina...

#

geometry sucks

shadow night
#

this Euler guy made my mathematic suffering mathematically worse

icy beacon
#

Math that uses actual numbers (and well letters) on top

sand spire
#

Can someone check my code and tell me if this is a safe way to load & save userdata from config? Everything works but I'm new to coding and I might have overlooked something important that will cause lots of pain in the future (I added comments for quick navigation)

https://pastes.dev/1Ym6DyOLDb

icy beacon
#

Damn that's a cool pastebin

hybrid spoke
#

im not a fan of all those XXAsync methods, but you do you

icy beacon
#

?di

undone axleBOT
icy beacon
#

Basically everything godcipher said + di lol

sand spire
#

I will read the wiki and apply the changes thank you both!

rotund ravine
#

But sure probably

sand spire
#

Should I make something so the player only exits the loadingscreen and joins the server when the data is finished loading async, or is this already automatic with the AsyncPlayerPreLoginEvent?

tall dragon
sand spire
#

Thanks 👍

quiet ice
#

Does anyone have some nice utility method for formatting BigDecimals in the format of 5.12k or 128M?

shadow night
#

I used to have the opposite somewhere

quiet ice
#

I guess I'll just use the engineering representation in the meantime but that might use too many chars, I'll see

wet breach
#

this will give you 2 decimal places and rounds up

#

or you could round down

quiet ice
#

But that wouldn't give the suffix or?

wet breach
#

since it depends which standard and which type of size

#

its not overly difficult to create one

rocky fox
#

can someone help me lower the xp merging on a minheut server

ember estuary
#

I want to make elytras slower, how can I do so?
setFlightspeed seems to only change creative flight speed. Are there some variables where i can set elytra gliding speed / max velocity ?
(on a per player level, so that one can unlock full speed by upgrading his elytra)

smoky anchor
#

I do not believe this is possible, might be with 1.20.5 gravity attribute tho
I've seen someone use high gravity to make fast elytra, might work other way too

flint coyote
wet breach
#

just set it super high and watch them fly like a dart uwu

flint coyote
#

multiply it by 1.001 every move event so they slowly get faster and can never slow down unless they ram into something uwu

wet breach
#

that is interesting way to do that

rare rover
#

Hmm, I gotta return a value from an ExecutorService. By using .get() on the future but wouldn't that be slow or nah?

eternal oxide
#

.get will lock the calling thread

rare rover
#

Hmmm, well I needs retrieve the value from the thread somehow. Or return something else:

    inline fun <reified T> runAsyncIf(condition: Boolean, crossinline block: () -> T): T? {
        return if (condition) {
            var result: T? = null

            val thread = Thread { result = block() }
            thread.start()

            thread.join()

            result
        } else {
            block()
        }
    }``` which is bad
#

Trying to use a thread pool but idk what to return

young knoll
#

Use completeable futures

rare rover
#

Rightttt, forgot those existed

#

💀

#

something like this?:

inline fun <reified T> runAsyncIf(condition: Boolean, crossinline block: () -> T): CompletableFuture<T?> {
        return if (condition) CompletableFuture.supplyAsync({ block() }, EXECUTOR_SERVICE)
        else CompletableFuture.completedFuture(block())
    }``` iirc
#
    @PublishedApi
    internal val EXECUTOR_SERVICE = Executors.newSingleThreadExecutor()```
hushed spindle
#

did anything recently change with the EntityDamageByEntityEvent? it now has a DamageSource parameter which breaks existing projects calling it manually

#

its more like a why is this a thing now

rare rover
#

cuz their api is terrible imo, i dislike them

ivory sleet
#

Co routines is nice, but yeah, if u’re j21, virtual threads is just as fine, since u do use kotlin using em can be nice josh

#

But if you wanna appeal to the java community, maybe its best to have some api that don’t expose coroutines at least

inner mulch
#

does anyone know a good approach of communication in between the proxy server and the mc server, via packets (redis)? (also calling api methods in those packets to do something on either server)?

ivory sleet
#

I mean yeah using something like redis and just send messages back and forth is fine?

inner mulch
#

but calling api methods in those packets?

ivory sleet
#

I mean you’d define some sort of protocol over redis, and then u interpret the protocol and invoke relevant methods on the proxy jvm, respectively the mc server jvm

inner mulch
#

why are my classes not recognized anymore?

inner mulch
#

RMI?

ivory sleet
#

Remote method invocation

inner mulch
#

what does that mean?

ivory sleet
#

its a way to invoke a method that exists on one jvm, from another jvm

inner mulch
#

and how does this work?

river oracle
ivory sleet
#

Idk I’ve never really implemented it, just knows it was annoying to debug

#

@inner mulch

wet breach
#

idk if RMI is a good fit for your needs or not or solves your issue

#

however, its something to learn 🙂

inner mulch
#

ok

ivory sleet
#

Yeah conceptually very cool framework for one who needs it

lament maple
#

How can i get value X out of config.yml?

Spawn:
  X: 18.483
  Y: 48.0
  Z: 49.574
  Pitch: -179
  Yaw: 0
hushed spindle
#

YamlConfiguration#getDouble("Spawn.X")

#

first gotta get the config ofc

lament maple
hushed spindle
#

well i didnt say getstringlist did i

#

thats gonna attempt to fetch a string list from the value mapped to Spawn

#

but its not a list

#

so it will be an empty list

sage patio
#

how can i create a method like this(String username, String title, String message) and put some stuff to be allowed be empty
for example i want the username always but title and message are optional

hushed spindle
#

you're looking for constructor overloads

#

very simply, you just make more constructors where said params are optional

wet breach
#

or you just remove the params

sage patio
#

i thought thats a wrong way to create them

hushed spindle
#

i mean its not the cleanest

#

you could use a builder pattern alternatively

#

bit overkill if you just got 3 params though

wet breach
#

the cleanest way, is to create an object and have said object be what is required for the param

#

then you can just set the options in the object the way you want

sage patio
#

hmm, thanks

river oracle
#

@hushed spindle now that I'm thinking about it might make a PR later to make that more clear 🤔 probably gonna add api status internal to constructors

#

That way it's atleast obvious

quaint mantle
#

yk when zombie is attacking it stops for a bit in between then attacks again is there a way to make its ai brutual like really hard to pvp

river oracle
#

This requires NMS

#

To get started with nms see below

#

?nms

quaint mantle
#

thanks atleast i know what to start from

hushed spindle
hushed spindle
#

darn

river oracle
#

The API has changed in a positive way and I don't want to perpetuate a standard there

#

Especially when we have trouble getting rid of shit api already

quaint mantle
#

is there a documention of what each goal does

torn shuttle
#

very random question but does anyone know if there is a way to make a post request to discord to get a list of threads that exist in a forum in a specific discord server?

wet breach
smoky anchor
#

yo, can someone either tell me how to find an entity in World by UUID
or quickly PR it ? :D

torn shuttle
#

you get the world get the entities and compare it by uuid afaik there is no map access to it

#

then again it's been a hot minute since I've done anything like that, it's slow as hell

smoky anchor
#

well, ServerLevel has getEntity(UUID)
don't see any reason for World to not have it too

wet breach
#

those two methods gets the entities in the world of currently loaded chunks

#

choose which ever you need, loop through the list and compare the uuid

smoky anchor
#

Seems slow, I'll just create a method using NMS
(totally not me hoping MD will come here and add the method himself out of pure rage)

wet breach
smoky anchor
#

well NMS has lookup by uuid, that's a map of some sort

wet breach
#

just because said method you were looking for wouldn't require you to loop doesn't mean some kind of loop isn't being done

river oracle
#

World#getUUID

smoky anchor
#

I need entity in that world

river oracle
smoky anchor
#

that iterates over every world

river oracle
#

no it doesn't

#

World#getEntiites get entities in that world

smoky anchor
#

oh ye, I misread the method
again, returns a list and from what I understand, lookup by uuid in map is "faster" than iterating over a list

river oracle
#

I believe only chunks allow entity lookup as you want

#

I dono't think any such world storage for every entity exists

#

this is because of how internals work, as far as PRing such a method it'd still be iterative so its a 0 sum game

slender elbow
#

why do you need that as opposed to Server getEntity

river oracle
#

because it goes through every world Shrug ?

smoky anchor
#

If I already have the world, I don't see a reason to iterate over every world the entity is not in

smoky anchor
wet breach
#

maybe you unders estimate how fast CPU's really are

#

also, I doubt you are going to have over a million entities in the world at any given time loaded

#

yes, a map could potentionally be faster, however it limits how it can be used as well

#

since Entities in a world can only exist when chunks are loaded a list is sufficient if you need to go through all current loaded entities in a given World

#

if instead you were looking for a way to search the entire storage of the server for a particular entity, then you are going to have to manually parse region files yourself since they are not typically all loaded at once unless you just have a small world

ivory sleet
#

if there is a million/billion entities, iterating would be... well, not very nice, but doubt thats the type of functional requirements we're dealing with here

wet breach
smoky anchor
ivory sleet
timid hedge
#

If i have the plugins source code on github and what to change something in one class how do i so add the plugin to my intellij and so i can build to project myself?

wet breach
timid hedge
wet breach
#

anyways, ideally you would already have the project locally already, so its just a matter of opening it. Make the changes you want, then use git to commit your changes to your local repo

#

then you use git to push those changes to github

minor junco
wet breach
#

if by chance your github repo changes, you can pull those changes to your local version and your IDE will automatically update the project if its currently loaded

timid hedge
#

I dont want to upload it to github, its someone else code

wet breach
# minor junco git clone and you're set

normally you shouldn't need to clone your own repo's from github, but yes if you don't have the repo for whatever reason you are going to want to clone it

minor junco
#

Ah it's his own repo

#

well

wet breach
#

XD

minor junco
#

Dfq

wet breach
timid hedge
#

So...
I have a premium plugin
That plugin requires another core plugin
The core plugin requires some different plugins and essentials
I want to download the core and code essentials out from the core so i dont need to have essentials on my server

wet breach
#

you can either use the fork button on github, and essentially make a clone of the current repo as it is in your own github repo

#

it won't auto update, but this allows you to upload your own changes. Handy if you plan on maintaining your own version

#

the other way is to just use the clone button to pull the repo to be local, I am pretty sure IJ has some git clone thing

#

and then you can open the project

timid hedge
#

I dont want to upload my own version

wet breach
minor junco
#

1.7 if you're not wanting to check against server version. Use the latest if you do and also if you want to use the latest features if supported

wet breach
#

I have plenty of repo's forked myself

#

even though most of them I probably haven't touched

timid hedge
wet breach
#

you are going to need that url and then in IJ you need to find the git clone

#

I don't use IJ so I can't tell you specifically where it is at

timid hedge
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

wet breach
wet breach
#

and now that you know where its at, time to find where in IJ git clone resides 🙂

minor junco
#

Does IntelliJ have clone? I just use the CLI lol

ivory sleet
#

yea it does

wet breach
ivory sleet
#

Im a gui user

#

(Dont hate me lol)

wet breach
#

Well there you go, if Conclube says it exists it must

timid hedge
wet breach
minor junco
wet breach
#

and then that is pretty much it

timid hedge
#

Alright thanks, but do you know where in intellij i do that? i cant find the place where i paste the link

wet breach
#

nope as I said I don't use IJ

timid hedge
#

Oh sry didnt see that

wet breach
#

I suppose Conclube could help with that

ivory sleet
#

Yeah

wet breach
#

I use netbeans 😛

ivory sleet
#

Well there’s pretty much File -> New Project -> New Project From Existing Sources

#

iirc

#

or maybe its called like

#

New Project From Version Control

#

idr

wet breach
#

there isn't like just a button or something in the menu that say git clone?

ivory sleet
#

Hmm, maybe lol

wet breach
#

o.O

ivory sleet
#

They change the gui too often

remote swallow
#

its from something from version control iirc

timid hedge
wet breach
#

more reasons I don't use IJ

remote swallow
ivory sleet
timid hedge
remote swallow
#

does it compile

worldly ingot
#

Genuinely no clue why that's even exposed in the classpath tbh

timid hedge
#

No, im getting this error:

io.papermc:paperlib:jar:1.0.6 was not found in https://repo.extendedclip.com/content/repositories/placeholderapi/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of placeholderapi has elapsed or updates are forced

Try to run Maven import with -U flag (force update snapshots)

remote swallow
#

add the paper repo

worldly ingot
#

Still confused why it's exposed at all PES_Giggle that's an internal development tool, not meant for API publication

timid hedge
#

Why do i get this error now? placeholderapi???

rg.bstats:bstats-bukkit:pom:1.8 was not found in https://repo.extendedclip.com/content/repositories/placeholderapi/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of placeholderapi has elapsed or updates are forced
org.bstats:bstats-bukkit:pom:1.8 was not found in https://repo.extendedclip.com/content/repositories/placeholderapi/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of placeholderapi has elapsed or updates are forced

remote swallow
#

thats not a valid bstats version

timid hedge
#

But why could the developer build the project when i need to change all the dependencies now?

remote swallow
#

probably from stuff being on his maven local

wet breach
#

anyways its simple fix here

timid hedge
#

2022

wet breach
#

the versions you have issue with there do not exist in the repo it mentions

#

1.9.0.1 is the lowest version in that repo for placeholderapi

#

oh its trying to find bstats

remote swallow
#

bstats is central and uses full versions

#

eg 3.0.1

timid hedge
wet breach
#

looks alright

#

save it and try compiling again 🙂

remote swallow
#

thats a major out of date but sure

wet breach
#

well it was using an old version to begin with

#

I doubt updating the dependencies to latest would be wise

timid hedge
#

So i should just update all dependencies now? but im just wondering if the code still would work then

wet breach
#

update it to the lowest version closest to what the pom had

timid hedge
#

The pom didnt have any bstat

wet breach
#

if you update the dependencies on a old project to latest, odds are it will break the project 😛

wet breach
timid hedge
wet breach
#

anyways, this is one of the downsides of dealing with old projects that are not maintained anymore 😛

torn shuttle
#

anyone know off the top of their heads if when doing animated textures for mc items through blockbench anything special needs to be done to get it to work?

#

I've not had much time to look into it yet but I managed to get the model in but the texture is busted when using it just as it exported from blockbench

timid hedge
# wet breach according to your compiler log above, something needed it

I have added paper and bstat and im still getting this error

org.bstats:bstats-bukkit:jar:1.8 was not found in https://repo.extendedclip.com/content/repositories/placeholderapi/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of placeholderapi has elapsed or updates are forced

Try to run Maven import with -U flag (force update snapshots)
wet breach
#

seems for whatever reason placeholderapi needs it most likely

timid hedge
#

This is the "Sync" error:
Cannot resolve org.bstats:bstats-bukkit:1.8

pure stag
#

how to change spawner mob type? is code not work, event work

wet breach
#

yeah not entirely sure why it wants bstats

worldly ingot
#

You're on the right track, you just forgot to call spawner.update() to apply the changes

wet breach
#

I know a hackish way though to make it go away however

timid hedge
#

I think its becuase this is just a "core", this plugin is needed for the other plugin to work

wet breach
#

just not sure if you should do it is all

#

anyways, you could just manually download the lowest version available of bstats and then manually install it in your local maven repo as 1.8

#

can't guarantee it won't cause problems but if it does you could just remove it from your local repo but I doubt it will though

timid hedge
wet breach
#

by using the maven commands

#

well not sure how to do it with IJ

#

think it lets you do that

timid hedge
#

Where can i download bstat?

#

Oh i found it on mvnrepository

#

So which maven commands should i use now?

remote swallow
#

just change the dep version and reload

wet breach
remote swallow
#

oh

wet breach
#

its being pulled in as a transitive

remote swallow
#

the hell is providing bstats

wet breach
#

but the problem is, the version being tried to be pulled in doesn't exist anymore

#

well not on the official repo I don't think

remote swallow
#

ig update whatevers trying to provideit

wet breach
#

yeah, just not sure what it is. So I told them a hackish way to solve it 😛

#

problem is I don't know how to do it using IJ

slender elbow
#

essentials exposes bstats

#

I have that excluded in the single plugin I have that hooks with essentials lmao

remote swallow
#

@worldly ingot fight someone there

wet breach
#

lol

worldly ingot
#

Yeah and it exposes paperweight for some reason too

slender elbow
#

and vault exposes bukkit which is kinda pepega as well

#

oh yeah essentials also exposed paperlib too

worldly ingot
#

Sorry, paperlib, that's what I meant

tender shard
#

and papi exposes shaded adventure

#

and minimessage

worldly ingot
#

🫠

remote swallow
#

it was mdcfe

#

choco go

worldly ingot
#

Classic. Now we know who to yell at!

timid hedge
#

uhmm... so should i use the maven commands to fix bstat or should i do something else=?

tender shard
#

where is bstats coming from? just exclude it from that

#
<dependency>
    <groupId>com.something</groupId>
    <artifactId>whatever-is-too-stupid-to-create-a-dependency-reduced-pom</artifactId>
    <version>1.0.0</version>
    <exclusions>
        <exclusion>
            <groupId>org.bstats</groupId>
            <artifactId>bstats-bukkit</artifactId>
        </exclusion>
    </exclusions>
</dependency>
slender elbow
tender shard
#

where is that Message class even coming from? The adventure I depend on doesnt have any message class

trim quest
#

i saw your tutorials and i have a question

#

about multi maven projects which deal with nms

remote swallow
#

?ask

undone axleBOT
#

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

timid hedge
#

Is there any fix for this?

        <dependency>
            <groupId>org.bstats</groupId>
            <artifactId>bstats-bukkit</artifactId>
            <version>2.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.bstats</groupId>
                    <artifactId>bstats-bukkit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

Try to run Maven import with -U flag (force update snapshots)
tender shard
#

show the output of mvn dependency:tree

remote swallow
#

you exclude it from essentials

tender shard
#

excluding bstats from bstats makes little sense lol

trim quest
#

my first question is about specialsource-maven-plugin and SpecialSource artifactId's on maven repo

#

what is the difference between them

tender shard
trim quest
#

md_5 share 2 different dependency on maven repo related to SpecialSource

tender shard
#

oh wait

trim quest
#

u are using specialsource-maven-plugin

tender shard
#

yeah I just saw, the thing on central isnt the maven plugin

timid hedge
# remote swallow no

So like this?

    <dependencies>
        <dependency>
            <groupId>org.bstats</groupId>
            <artifactId>EssentialsX</artifactId>
            <version>2.19.2</version>
            <exclusions>
                <exclusion>
                    <groupId>org.bstats</groupId>
                    <artifactId>bstats-bukkit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.github.MilkBowl</groupId>
            <artifactId>VaultAPI</artifactId>
            <version>1.7</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>me.clip</groupId>
            <artifactId>placeholderapi</artifactId>
            <version>2.11.1</version>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>net.essentialsx</groupId>
            <artifactId>EssentialsX</artifactId>
            <version>2.19.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.essentialsx</groupId>
            <artifactId>EssentialsXSpawn</artifactId>
            <version>2.19.2</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>net.wesjd</groupId>
            <artifactId>anvilgui</artifactId>
            <version>1.5.0-SNAPSHOT</version>
        </dependency>
    </dependencies>

</project>
remote swallow
#

why would essentials be under org.bstats

#

add it tot he net.essentialsx:essentialsX dep

slender elbow
#

exclude bstats from essentials

tender shard
tender shard
# timid hedge So like this? ``` <dependencies> <dependency> <groupId>o...
        <dependency>
            <groupId>net.essentialsx</groupId>
            <artifactId>EssentialsX</artifactId>
            <version>2.19.2</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.bstats</groupId>
                    <artifactId>bstats-bukkit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>net.essentialsx</groupId>
            <artifactId>EssentialsXSpawn</artifactId>
            <version>2.19.2</version>
            <scope>provided</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.bstats</groupId>
                    <artifactId>bstats-bukkit</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
#

no, definitely not like this

#

are you just randomly typing things into your pom?

trim quest
#

you mean that ? : @tender shard

<dependency>
    <groupId>net.md-5</groupId>
    <artifactId>specialsource-maven-plugin</artifactId>
    <version>2.0.2</version>
</dependency>
remote swallow
#

why is that a dependency

trim quest
#

maven plugin not needed right

remote swallow
#

not a plugin

trim quest
#

just dependency

remote swallow
#

you need the plugin to remap

tender shard
#

hm? ofc you need the maven plugin

#

?nms

tender shard
#

the dependency itself is worthless

trim quest
#

hmm

tender shard
trim quest
#

and i want to ask why you programming to versions.

#

Can't we use maven modules as an interface from which we can pull classes and interfaces?

#

i have project like that

#

it was 1.8-latest

remote swallow
#

i would avoid that and have each thing as a module

#

instead of some stuff being in parent bc iirc maven doesnt support that

trim quest
#

is there any way ?

#

to do that

#

because i really dont wanna program for each version

tender shard
#

i don't really understand the question at all

tender shard
trim quest
#

no i think Core module can solve that for us.

tender shard
#

erm yes ofc

#

the NMS projects should always only implement your NMS handler class

remote swallow
#

you arent really making much sense

tender shard
#

99% of your plugin should be in core

timid hedge
trim quest
#

right ?

remote swallow
#

what

trim quest
#

look at my project tree

#

i divided nms and core

remote swallow
#

you have a core module which is the plugin, you have an nms-api which is based of an interface that you extend with the needed version and use reflection to get an instance, then you just call the methods

trim quest
#

nms is pom project and their submodules are jar project

remote swallow
#

in maven its easier to have it all in base dir

tender shard
#

what's the point of having a separate parent for NMS modules? I don#t see any advantage

#

parent = pom
all others = jar

trim quest
#

its more hierarchical

#

you are not using jar-with-dependencies also

#

in your tutorial

tender shard
#

yeah I'm using the maven-shade-plugin

trim quest
#

what is that

#

i just saw. i was using jar-with-dependencies for unite them

tender shard
sullen canyon
#

for example if I update my scoreboard every second and I need to do .replace() (because I have "placeholders") it seems to lag a bit

#

can't really feel it but profiler shows that it has impact

trim quest
sullen canyon
#

should I be worried about it and maybe there is a better way to have placeholders than doing .replace()

tender shard
wet breach
trim quest
wet breach
#

well 4 if we count the maven plugin I guess

remote swallow
#

but the offical version with normal naming

trim quest
#

im using that

remote swallow
#

use shade plugin

trim quest
#

root project pom right ?

tender shard
#

shade plugin is better as it can create a proper dependency-reduced pom.xml, and has additional features such as minize and relocate

tender shard
remote swallow
#

depends where you need to shade stuff

trim quest
#

or each project needed that dependency

tender shard
#

only the dist module

wet breach
tender shard
#

yeah but I doubt that that's what they want

timid hedge
lost matrix
tender shard
#

where does triump even come from? it wasnt in the pom you sent earlier

timid hedge
#

Its becuase this isnt my code, its from github. Its a core for another plugin i use so therefore there are more poms

timid hedge
lost matrix
#

What do you mean by "more poms". Is this a multi-module project?

timid hedge
#

yea

#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

lost matrix
remote swallow
#

the femboy KEKW

tender shard
lost matrix
#

Sry, *cute femboy

tender shard
#

now we talkin

tender shard
#

you probably used the .jar created from "plugin"

timid hedge
remote swallow
#

packaging will probably shade it

tender shard
#

which module did you compile, and how, to get your .jar?

timid hedge
#

It is already shaded

        <sourceDirectory>src/main/java</sourceDirectory>
        <defaultGoal>clean install</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <configuration>
                    <relocations>
                        <relocation>
                            <pattern>dev.triumphteam.gui</pattern>
                            <shadedPattern>dk.plexhost.core.gui</shadedPattern>
                        </relocation>
                    </relocations>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

tender shard
#

it would be much easier if you'd simply answer the questions

timid hedge
#

I didnt compile anything

remote swallow
#

so how did you get the jar

timid hedge
#

Artifact

tender shard
#

so you did compile something

remote swallow
#

no wonder its not shaded then

timid hedge
#

Your guys are saying two diffent things 🤣

tender shard
#

no

#

both epic and me know that you randomly compiled any part of that project using IJ's build artifacts while you should have used mvn package on the packaging module

remote swallow
#

^^

tender shard
#

never ever use "build artifacts" when you use a maven or gradle project

#

(and "build artifacts" is still compiling btw)

timid hedge
#

I didnt that now but the plugin is named "plugin" now

tender shard
#

show a screenshot of your maven output after you compiled

#

or better of your whole IJ after you ran maven, with the maven console open

timid hedge
#

I doule clicked on package?

remote swallow
#

then where did you get the jar from

tender shard
#

100% he clicked on some random "package" from another module

#

just send a screenshot

timid hedge
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

timid hedge
tender shard
tender shard
#

you should have used mvn package on the packaging module

ivory ivy
#

Hello, does anyone know how to catch an event of a hopper trying to transfer items into a non-container block with custom NBT? So basically I am making an autoseller plugin and I need to handle when a hopper is trying to transfer items into my autoseller block (a player head with a custom nbt tag isAutoSeller: true). How to properly do this?

pure stag
#

why mobs not spawned every second? UPD: Fixed

#

generatorData.getTimeToSpawn() returned 1

ivory ivy
ivory ivy
eternal oxide
#

both

#

if getSearchBlock() returns your block

ivory ivy
ocean hollow
#

how to get a project from git hub? I added a project via a link, what next? I don't see pom.xml here, instead of .class - .java

remote swallow
#

that looks like build artifact project

ocean hollow
#

so I can't open eclipse project in idea?

lost matrix
lost matrix