#help-development
1 messages · Page 892 of 1
that IS nms
Can I read it
are you on 1.16 or older or sth? o0
stay away from NMS unless there is no alternative
mm I love abstracting reflections
because of this: ```java
@Override
public EntityVillager getHandle() {
return (EntityVillager) entity;
}
@Override
public void remove() {
getHandle().releaseAllPois(); // <-
super.remove();
}
Smh where is the SNBT support
brb
Does it work
idk - how does one of those snbt strings look like?
Uhh
Something like {CustomModelData:1}
Actually the item one might be with the item name
?paste
minecraft:diamond{CustomModelData:1}
https://paste.md-5.net/ixabuluqoq.java
Im not even casting anything??
are you shading that class from another plugin / dependency or sth?
yep works
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
wait, i dont really understand, do i have it twice?
the inner machinations of java
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
oh
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
you can add dependencies in modern spigot versions in your plugin.yml for the server to download on runtime
you mean libraries
Hm
yep should work
generally speaking, is it better if i write my own if i need to add Velocity support at somepoint?
your own library loader?
yes
no
rather use an existing library for it
how does this handle the server if offline
Should I load necessary playerdata from config with PlayerJoinEvent or PlayerLoginEvent
does it just use old ones?
i'm pretty sure that it caches it and will never attempt to redownload it
however idk, read their readme i guess
aight tysm this sounds awesome ngl
I load data in PlayerLoginEvent async, then I cache it for up to a minute, if the player hasn't joined until then I unload it again
Thank you
One message removed from a suspended account.
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
however if you rekd your world without a backup, you're pretty much fucked
One message removed from a suspended account.
no 🥲
One message removed from a suspended account.
yeah unfortunately, no backup no mercy
How can I view deobfuscated function names? I am reading it in intellij and it's all like 1 or 2 characters
did you setup mojang maps?
are you using maven?
gradle
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
and then use this gradle plugin https://github.com/patrick-choe/mojang-spigot-remapper
what does this do exactly
yes
do you have mavenLocal() in repositories
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
I see, thank you
btw, is it possible to see the actual implementation of methods?
uhh, I made my getConfig method async with the code below, but CompletableFuture has to return void i think. This worked with making my save method async but now I need something to return
public CompletableFuture<Void> getConfigAsync() {
return CompletableFuture.runAsync(this::getConfig);
}```
supplyAsync
usually you want to do sth like this
public CompletableFuture<MyConfigClass> getCOnfigAsync() {
return CompletableFuture.supplyAsync(() -> ...);
}
futures my favorite
do I need to return the class my config code is in or "FileConfiguration"
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());
}```
why are we doing this async on the first place 
well what's the return type of getConfig() ?
maybe getConfig() loads a 2mb json file?
It's file to load the configs "sync" onEnable and just cache the values
Yeah in that case
oh FileConfiguration
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
ow that looks ugly
thanks
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);
}
Also, how do I get the data from the CompletableFuture?
getConfigAsync.getInt doesn't work anymore like it did before it was async
so I use getConfig after getConfigAsync is complete?
uh
getConfigAsync.whenComplete((config, ex) -> { chec ex isnt null, interact with config})
thenAccept
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
configManager.getConfigAsync().whenComplete().thenAccept(dataMap.put(player.getUniqueId(),configManager.getConfig()));```
i got 2 errors 💀
I think you're right
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
yeah i understand how async works
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
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
use 1 or the other
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
Alright
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
thread safe?
That just means it won't face any weird concurrency issues
alright
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 ...;
}
if you dont use future everything is automatically in the main thread or thread A right?
Not in every case
oh
Some events are fired async
thanks spigot
But they got Async in their name
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
So this should get every block from an explosion, correct?
you don't need to stream to forEach
my bad
I edited it because I was using other stuff before
forgot to remove it
I think I understand why and how to make something async but I have no idea how to get the data from the completablefuture
You can handle completion using the following methods:
thenRun(Runnable)- Just runs code once the future has been completethenAccept(Consumer<T>)- Provides a variable, you do whateverthenApply(Function<T, U>)- Provides a variable, you can return whatever you'd likethenCompose(Function<T, CompletionStage<U>>)- Used for chaining futures, where the main future now runs the sub-future's task
this is what i tried
configManager.getConfigAsync().thenAccept((config, ex) -> { dataMap.put(player.getUniqueId(), configManager.getConfig().getInt(player.getUniqueId() + dataType))});
No clue why you're calling getConfig again
what is remapped-obf?
you have the config object
to get the data
but how do i get it
fetchValueAsync().thenAccept((value) -> {
// do something with the returned value;
});
????
Your lambda provides it
I think i'll use thenRun cause I just need to add the data into a map
thenRun does the same except it doesn't pass your value??
oh
Take a minute to do some research
How do I get a CraftVillager? typecasting?
by casting a Villager
(and check instanceof before)
Apparently the change to EntityDamageEvent breaks EssentialsX.
https://github.com/EssentialsX/Essentials/blob/8a57856c9644bda3e8c19a622e29eba281d14fc2/Essentials/src/main/java/com/earth2me/essentials/commands/Commandsuicide.java#L17
me when kotlin smartcasting: if (entity !is CraftVillager) return
I think I got it thank you
configManager.getConfigAsync().thenAccept((value) -> {
dataMap.put(player.getUniqueId(), value.getInt(player.getUniqueId() + dataType));
});```
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
well deserved 😈
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
this doesn't work... I am calling that method but other villagers don't get the profession
Is there something else that's getting called when an entity is removed?
?paste
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?
I think more importantly, why is your arm so stretched? lol
lmfao
But it's most likely the fact that "bukkit:?" isn't in quotation marks
oHH
YAML probably having a stroke
im confused why I didnt get any errors
Just silently fails to parse
tysm
How would I make a database that doesn't break the open closed principle
so like this?
blocked-commands:
"bukkit:?":
permission: "*"
permission-message: "&cYou cannot use this command!"
Like let's say I got a stats object, and I add a new stat to it
then I got to register or impl a new line to serialize and deserialize that
I meant to say that isnt working
its just doing the command as normal
I mean the open closed principle just says a module should be open for extension, closed for modification
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
Anyone got any idea on why this is happening?
Does it print that for each block
https://paste.md-5.net/ikoziwenuw.java
why is the config.yml not getting loaded?
Add a config.yml in your jar and then just use saveDefaultConfig
this is my jar layout, what does savedefaultconfig do?
writes resources/config.yml to plugins/.../config.yml
Yeah but how lmao
If I had 5 different databases
I would need to register 5 different serializers
everytime I add a new stat
Depends how you code it ofc
https://paste.md-5.net/ezeganayaf.java
here is the code, but the /bukkit:? is still working
Anyhow, the open closed principle doesn’t help you much
here is my config.yml
I've noticed a lot of plugins just couple themselves with one database
# 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!"```
Why not just use permissions to block commands
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)
wdym
If you don’t want someone to use /plugins you can explicitly remove the permission
they also probably have permissions
At least they should :p
Ah so like abstracting everything is kinda what you're saying
like version independent plugins
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
@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
I think I'll just couple my plugin with Gson
its prob easier to use startsWith
or just split it by space and use the first arg
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?
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
id probably just use ```java
String[] split = event.getMessage().toLowerCase().split(" ")
String command = split[0];
if (command.equals(whatever) { stuff }
it also wont ever contain just ":" because thats not how it gets split
the bottom one looks easier but thanks max and thanks epic
Yea. It does but they still get broken
=yes
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.
WTF
lmfaoo
yea, its based of a true story tho
Yk what I could do
For each stat I make it have the ability to serialize and deserialize itself
Coll the web developer!?
I mean that’s one way
My college made us do a ton of it
Guess they forgot anything other than web dev still exists
Are you defining some sort of database polymorphic structure that supports both sql, graphs, nosql max?
and json
computer science?
“Software development”
Lmao
So computer science from Walmart
rn I'm just thinking of making my own object that's basically a wrapper of a hashmap
but only supports primitives and strings
Yeah, well have you ever looked at something like luckperms?
I think they deal w database types in a reasonable way
yeah I checked it out
Obv it isn’t perfect, but its a good step in the right direction
The interface and the async part makes sense
but then it gets so abstracted idk what's happening
A little bit yea
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
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)
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
Are you even allowed to invoke remove() inside that forEach?
It does for some
just not all
Like there is a 50% chance for the block to not be broken
Oo right
That’s a bit under engineered
Yea i didnt change anything
You might wna define some sort of interface that contracts a serialize and deserialize method max
yeah
What's a word that combines serialize and deserialize
you think something like factory
Serializer is fine
serialize technically :p
Alr
Try something other than forEach and remove
removeIf mayhaps
Will do
Wait doesnt remove if work for properties and not actual methods?
or am i stupid
whaa
Since the check is running the blocks location through structure checks
removeIf takes a predicate right?
Ye
anyone know a good yaml manager (like a updater class for yaml files)?
Yea the problem is im not checking a predicate
Im using a method to run through anything that makes it unbreakable
Structure locations, nearby blocks, stuff like that
Like between config versions?
yes
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
this is an example of why you should break up your java application into smaller bits
something that can be leveraged here is the classloader
Yeah well you’d distribute each module in a separate jar more or less
exactly this, then you would just load the modules you need and this way you can just change out a module and not the whole thing
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
I just found this from some random plugin
config.addDefault("enableShulkerbox", true);
config.addDefault("enableEnderChest", true);
config.addDefault("enableCraftingTable", true);
what does it mean?
and how can I impliment it
I mean, it defines a default value to a specific key
so that would basically be an updater thing?
Yeah, it can be
alr ty
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?
BlockPhysicsEvent
All a predicate is is some function that takes in X and returns true or false
It does get called a lot of times though, is it something I should worry about or no
Yea but I need the blocks location and several of them so unless I use forEach(subsection) I dont have subsection to get location
Im testing a basic for each
does "getConfig()" get the config in the datafolder? or just the plugin jar
Data folder
ty
whats the difference between saveDefaultConfig and saveConfig
and what should I do when the plugin enables
saveDefaultConfig copies the file from the jar to the data folder
Save config saves any changes made to the config
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:
- ":"```
did you add the permissions to yourself? it doesnt look like OP is considered a person that bypasses it
i didnt. this is a fresh server
the command I ran was /plugins
which is not on the list
so it shouldve worked
Because you are checking if the command they ran contains any of the blocked commands
/plugins does contain pl
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
Did you close and open the server after you changed it?
What are u trying to do?
I feel like that'd cause a ConcurrentModificationException
just event.blockList().clear()
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
event.blockList().removeIf(block -> ...)
I remember making an explosion-proof glass thing
Ive been slowly making things more and more simple
and it worked fine
Is your message being broadcast?
Yea and it gave the proper number of dropped blocks which is 50
or that time was
which doesnt make sense since its supposed to remove all of them
Your code should not work in the first place.
how so?
Just try list.clear() for now
Im not trying to clear it
It should throw an exception
Do that for now pls
Just as a test?
smile saying "pls" instead of "please"
he's either incredibly sleep deprived or just woke up
Plz
pl0x
How...
yeah
code change plox
Congrats you're having some kind of exception
second is the blocks remaining
Alright. Now use removeIf(Predicate<Block>)
There arent any errors in the logs tho
you were having**
There werent any then either
Probably some weird uncaught exception
What would I put its if as?
But yeah let's build up from here
removeIf(block -> true) should have the same effect
yep same effect
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
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);
I could
Thats not a bad idea
Yay method references
Tho it would be isInStructureResistant since the plan is to disable a structure brom being broken into
Not exactly half
Not exactly but close enough
Random so close enough
true
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
You should stay away from reloads. They are not supported by spigot and prone to breaking half of the plugins out there.
Thats not very helpful.
Also i dont want to restart the server every single time im testing a plugin i am making
The logic in those two sets fo code is so close it's pointless seperating them
Was about to say that im seeing a lot of dry code here
First one, if no perms do all this shit and delete anyway.
Second one, if he does have perms still delete
So putting the ifs in a method works fin but doing it inside of the actual explosion event dont 😑
Thanks a ton
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
KingdomManageretc, instead of keeping all your data in the JavaPlugin class
Removed duplicate code. Not changed any logic so likely still won;t work https://paste.md-5.net/davofonewa.cs
It's not duplicate. Its checking for if the user is/n't a admin
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
spigots damage method does armor-piercing damage. is there any way to make it not?
Ye. I see what you mean now
Took me a sec
are you running this code in onDisable?
and is "plugin" referencing your plugin or Kingdoms?
@lost matrix Great success. 22k TNT :P
Top section of the structure is destructable, lower half is not
Noice
Das a lotta boom
Can I replace a spawned entity with a custom NMS subclass?
Yes
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.
I don't mean that, I mean an entity that has already spawned
Um. Remove it and spawn your own then?
Wouldn't that be noticeable?
Explain the overal situation. What do you need this for?
I want to replace the behavior of a villager at some point
Then spawn your custom villager from the beginning and have the logic reflect your change instead of replacing the villager completely
Then your classes are no longer found and the villagers will be replaced by vanilla ones
👍
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?
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
Double space
Combination clicks like R - L - R
What event can I use to check what a dispenser dispense
I want to check if the dispensed item is a elytra
Swap item key
?jd-s
yep got it
@rotund ravine i heard you‘re gonna write some basics modules today? :3
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!
Probably doesn;t exist in 1.8 but https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityPotionEffectEvent.html
yea, ChatGPT already suggested that 😄
but that doesn't exist in 1.8
still thanks!
How can i get the face of any block like bedrock and apply it to an armorstand to rotate (the event is BlockPlaceEvent)
sorry I don't understand
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
in PlayerInteractEvent you can get the clicked blockface
i need it inside block place event
then you just keep it in a map for a tick or sth
although BlockplaceEvent also has a placedAgainst block
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/block/BlockPlaceEvent.html#getBlockAgainst()
then use blockPlaceAgainst.getFace(blockPlaced) to get the blockface
declaration: package: org.bukkit.event.block, class: BlockPlaceEvent
might be the other way around, idk you gotta try
and then how can i convert the blockface into a rotation for the armor stand
wdym with "rotation"? a yaw value?
yes
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
but that would only move the armorstand instead of rotating it, no?
is he tryign to set teh head facing or the whole stand?
tbh i have no idea what they're trying to do lol
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
this Euler guy made my mathematic suffering mathematically worse
Trueee
Math that uses actual numbers (and well letters) on top
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)
Damn that's a cool pastebin
yes and no. code looks fine as what i've seen, but you dont want to use the common thread pool. CompletableFuture.supplyAsync(this::getConfig) rather pass in your own executor. also for loading purposes you have the AsyncPlayerPreLoginEvent
im not a fan of all those XXAsync methods, but you do you
There is some code that should be asynced, e.g. playerloginevent -> asyncplayerpreloginevent. Other than that, if there is something wrong/inconvenient, it'll pop up during testing. Also, this is more of a preference thing, but I'd advise to not use a static instance variable and instead pass the instance of the plugin during dependency injection
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Basically everything godcipher said + di lol
I will read the wiki and apply the changes thank you both!
Oh my. I def said this week 👀
But sure probably
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?
the event is already async, you can just load your data sync and that thread will block untill the data is loaded, hence keeping the player in loading screen until that point as well.
Thanks 👍
Does anyone have some nice utility method for formatting BigDecimals in the format of 5.12k or 128M?
I used to have the opposite somewhere
I guess I'll just use the engineering representation in the meantime but that might use too many chars, I'll see
BigDecimal bd = new BigDecimal(1);
bd = bd.setScale(2, RoundingMode.ROUND_HALF_UP);
System.out.println(bd);
this will give you 2 decimal places and rounds up
or you could round down
But that wouldn't give the suffix or?
No, for storage sizes you will need to create a utility for that
since it depends which standard and which type of size
its not overly difficult to create one
can someone help me lower the xp merging on a minheut server
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)
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
You could try to play with the velocity in the PlayerMoveEvent after checking isGliding(). Try to set it to a certain threshold if it's too high.
Not sure how good that will actually work out but it's worth to give it a try.
just set it super high and watch them fly like a dart 
multiply it by 1.001 every move event so they slowly get faster and can never slow down unless they ram into something 
that is interesting way to do that
Hmm, I gotta return a value from an ExecutorService. By using .get() on the future but wouldn't that be slow or nah?
.get will lock the calling thread
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
Use completeable futures
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()```
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
Why not using coroutines?
cuz their api is terrible imo, i dislike them
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
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)?
I mean yeah using something like redis and just send messages back and forth is fine?
but calling api methods in those packets?
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
why are my classes not recognized anymore?
You could use RMI
RMI?
Remote method invocation
what does that mean?
its a way to invoke a method that exists on one jvm, from another jvm
and how does this work?
Events aren't guaranteed api
They are internal and not meant to be called manually adjust your project accordingly
Idk I’ve never really implemented it, just knows it was annoying to debug
@inner mulch
idk if RMI is a good fit for your needs or not or solves your issue
however, its something to learn 🙂
ok
Yeah conceptually very cool framework for one who needs it
How can i get value X out of config.yml?
Spawn:
X: 18.483
Y: 48.0
Z: 49.574
Pitch: -179
Yaw: 0
like this?
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
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
you're looking for constructor overloads
very simply, you just make more constructors where said params are optional
or you just remove the params
i thought thats a wrong way to create them
i mean its not the cleanest
you could use a builder pattern alternatively
bit overkill if you just got 3 params though
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
hmm, thanks
@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
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
Gotta customize goals iirc you'll have to make your own entities
This requires NMS
To get started with nms see below
?nms
thanks atleast i know what to start from
that would be nice, though would it be too much to ask to return the original constructors as well in addition to the current ones
Yes
darn
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
is there a documention of what each goal does
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?
yo, can someone either tell me how to find an entity in World by UUID
or quickly PR it ? :D
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
well, ServerLevel has getEntity(UUID)
don't see any reason for World to not have it too
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#getLivingEntities()
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#getEntities()
declaration: package: org.bukkit, interface: World
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
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)
not sure why you think it would be slow, but conversely how would the method you propose or were looking for would work implementation wise?
well NMS has lookup by uuid, that's a map of some sort
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
Bukkit#getWorld(UUID)
World#getUUID
I need entity in that world
World#getEntities is a method
that iterates over every world
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
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
why do you need that as opposed to Server getEntity
because it goes through every world
?
If I already have the world, I don't see a reason to iterate over every world the entity is not in
I might be reading it wrong, but I think there is full world entity access
I am not sure how slow you actually think looping over a list would be
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
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
kind of my point lol, but I mean even at a million it really doesn't take long though
ye I guess that's true lol :D
well depends on the invocation frequency but yeah
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?
I guess you don't understand how git works?
prob right
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
git clone and you're set
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
I dont want to upload it to github, its someone else code
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
appparently not but they could make it their own by forking
XD
Dfq
alright, well there is two ways you can go about this then
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
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
I dont want to upload my own version
its fine, but even if you don't its handy in case the repo goes away 🙂
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
I have plenty of repo's forked myself
even though most of them I probably haven't touched
Okay soo.. im at the github and what should i do now? Download zip?
you could, but there should be a button for getting the url to clone
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
?img
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
Is this the right place?
https://prnt.sc/he8U5A7GNZ7-
click the green code button
yep that url that ends with .git is what you need
and now that you know where its at, time to find where in IJ git clone resides 🙂
Does IntelliJ have clone? I just use the CLI lol
yea it does
I couldn't tell you, I would imagine so
Well there you go, if Conclube says it exists it must
So i need to find where in intellij i can paste that link? and it will copy the code
it will clone the repo, not sure if it will ask you if you want to open the project or not but I think it will
Nah that's valid, I mean it can make things easier
and then that is pretty much it
Alright thanks, but do you know where in intellij i do that? i cant find the place where i paste the link
nope as I said I don't use IJ
Oh sry didnt see that
I suppose Conclube could help with that
Yeah
I use netbeans 😛
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
there isn't like just a button or something in the menu that say git clone?
Hmm, maybe lol
o.O
They change the gui too often
its from something from version control iirc
When i paste the link at the existing sources menu nothing happenms
more reasons I don't use IJ
File > new from version control
Yeah, they use, us users, as labrats pretty much lol
Thanks
Why do i get an error at essentials dependency? the error is at "io.papermc:paperlib:1.0.6"
https://prnt.sc/0Q05Wuln36wU
does it compile
Genuinely no clue why that's even exposed in the classpath tbh
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)
add the paper repo
Still confused why it's exposed at all
that's an internal development tool, not meant for API publication
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
thats not a valid bstats version
But why could the developer build the project when i need to change all the dependencies now?
probably from stuff being on his maven local
depends when the developer last built from it?
anyways its simple fix here
2022
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
is this correct? (found it on https://central.sonatype.com/artifact/org.bstats/bstats-bukkit/2.2.1?smo=true)
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>2.2.1</version>
</dependency>
thats a major out of date but sure
well it was using an old version to begin with
I doubt updating the dependencies to latest would be wise
So i should just update all dependencies now? but im just wondering if the code still would work then
only update the dependencies that its giving issues with, in this case bstats
update it to the lowest version closest to what the pom had
The pom didnt have any bstat
if you update the dependencies on a old project to latest, odds are it will break the project 😛
according to your compiler log above, something needed it
here is the default pom
https://pastebin.com/BEmHT4rk
anyways, this is one of the downsides of dealing with old projects that are not maintained anymore 😛
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
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)
seems for whatever reason placeholderapi needs it most likely
This is the "Sync" error:
Cannot resolve org.bstats:bstats-bukkit:1.8
how to change spawner mob type? is code not work, event work
yeah not entirely sure why it wants bstats
You're on the right track, you just forgot to call spawner.update() to apply the changes
I know a hackish way though to make it go away however
I think its becuase this is just a "core", this plugin is needed for the other plugin to work
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
thank you!
How do i install it in my local maven repo?
by using the maven commands
well not sure how to do it with IJ
think it lets you do that
Where can i download bstat?
Oh i found it on mvnrepository
So which maven commands should i use now?
just change the dep version and reload
bstat isn't declared in the pom directly
oh
its being pulled in as a transitive
the hell is providing bstats
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
ig update whatevers trying to provideit
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
essentials exposes bstats
I have that excluded in the single plugin I have that hooks with essentials lmao
@worldly ingot fight someone there
lol
Yeah and it exposes paperweight for some reason too
and vault exposes bukkit which is kinda pepega as well
oh yeah essentials also exposed paperlib too
Sorry, paperlib, that's what I meant
🫠
Classic. Now we know who to yell at!
uhmm... so should i use the maven commands to fix bstat or should i do something else=?
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>
at least that's relocated lol
where is that Message class even coming from? The adventure I depend on doesnt have any message class
hello
i saw your tutorials and i have a question
about multi maven projects which deal with nms
?ask
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!
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)
whut
no
show the output of mvn dependency:tree
you exclude it from essentials
excluding bstats from bstats makes little sense lol
my first question is about specialsource-maven-plugin and SpecialSource artifactId's on maven repo
what is the difference between them
idk, I'd always use the one from md5 on maven central, and then look for the latest version: https://mvnrepository.com/artifact/net.md-5/SpecialSource/1.11.3
md_5 share 2 different dependency on maven repo related to SpecialSource
oh wait
u are using specialsource-maven-plugin
yeah I just saw, the thing on central isnt the maven plugin
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>
no
why would essentials be under org.bstats
add it tot he net.essentialsx:essentialsX dep
exclude bstats from essentials
Discover specialsource-maven-plugin in the net.md-5 namespace. Explore metadata, contributors, the Maven POM file, and more.
<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?
you mean that ? : @tender shard
<dependency>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>2.0.2</version>
</dependency>
yep!
why is that a dependency
maven plugin not needed right
not a plugin
just dependency
you need the plugin to remap
the dependency itself is worthless
hmm
you only have to add the <plugin> section - declaring the dependency again is not needed
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
i would avoid that and have each thing as a module
instead of some stuff being in parent bc iirc maven doesnt support that
i don't really understand the question at all
then you must not use NMS
no i think Core module can solve that for us.
you arent really making much sense
99% of your plugin should be in core
Ahh okay thanks
hmm nms sub modules should be jar projects and implements only handler class then
right ?
what
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
nms is pom project and their submodules are jar project
in maven its easier to have it all in base dir
example: https://github.com/mfnalex/JeffLib/
Avoid writing the same code over and over again - use JeffLib for your Spigot plugins! - GitHub - mfnalex/JeffLib: Avoid writing the same code over and over again - use JeffLib for your Spigot plug...
what's the point of having a separate parent for NMS modules? I don#t see any advantage
parent = pom
all others = jar
its more hierarchical
you are not using jar-with-dependencies also
in your tutorial
yeah I'm using the maven-shade-plugin
it includes the dependencies in your .jar
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
Can you elaborate on the subject a little more?
should I be worried about it and maybe there is a better way to have placeholders than doing .replace()
https://maven.apache.org/plugins/maven-shade-plugin/
it takes all your dependencies and throws them into a single .jar
there is like 3 versions of special source in case you were curious
its looks like jar with dependencies thing
well 4 if we count the maven plugin I guess
it is pretty much
but the offical version with normal naming
im using that
use shade plugin
root project pom right ?
shade plugin is better as it can create a proper dependency-reduced pom.xml, and has additional features such as minize and relocate
no, dist
depends where you need to shade stuff
or each project needed that dependency
only the dist module
well depends, assembly in this context would essentially embed a jar inside of a jar. Handy if you want to provide plugins from a single plugin 😛
yeah but I doubt that that's what they want
How do i fix this error?
https://pastebin.com/24eFksvC
The error is at triumphgui
You need to shade it in or else it wont be there on runtime
where does triump even come from? it wasnt in the pom you sent earlier
Its becuase this isnt my code, its from github. Its a core for another plugin i use so therefore there are more poms
How do i do that?
What do you mean by "more poms". Is this a multi-module project?
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
Use the maven-shade-plugin in your pom. The femboy can explain it, im out for a run
the femboy
People just getting started with maven always ask me the same 3 questions, so here’s a a short FAQ! How to change the output directory? Read this. How to shade dependencies and what it means Sometimes you are using certain libraries (for example, my CustomBlockData class, or similar stuff) that is not already present at...
Sry, *cute femboy
now we talkin
looks like you are expected to run mvn package on the "packaging" module - then use the .jar from that
you probably used the .jar created from "plugin"
So i shouldnt shade it or what?
packaging will probably shade it
you should
which module did you compile, and how, to get your .jar?
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>
it would be much easier if you'd simply answer the questions
I didnt compile anything
so how did you get the jar
Artifact
so you did compile something
no wonder its not shaded then
Your guys are saying two diffent things 🤣
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
^^
never ever use "build artifacts" when you use a maven or gradle project
(and "build artifacts" is still compiling btw)
I didnt that now but the plugin is named "plugin" now
And it still isnt fixed
https://pastebin.com/th8Y0aE4
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
I doule clicked on package?
then where did you get the jar from
100% he clicked on some random "package" from another module
just send a screenshot
?img
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
.
.
.
you should have used mvn package on the packaging module
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?
why mobs not spawned every second? UPD: Fixed
generatorData.getTimeToSpawn() returned 1
not sure if that keeps firing if no inventory is attached
ok, I'll try. Thanks!
Isn't that when the block is above the hopper and not when the hopper is pointing in it? Cuz it says Event that gets called each time a Hopper attempts to find its source/attached containers
Ok, thanks!
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
that looks like build artifact project
that's an eclipse project
so I can't open eclipse project in idea?
If you created a project new from version control then you should have everything.
This is simply not a maven project so it has no pom.
ofc you can. Its just a simply java project.
