#help-development
1 messages · Page 224 of 1
all of us pretty much
build sys?
none of us sorry
thats litterly the development channel from offical spigot
yeah i noticed that
I use Maven, you can also start with it because the XML syntax is straightforward
New build envirolent Graven!
The lastest invento around the years for java development
i just did intellij build system
Oh please dont use that
heard it should be 10 times better then maven or gradle
Learn a build system
yep
how many things do i have to learn
for the very beginning you could use the very default compiler
but for coding anything good you'll need to learn maven or gradle
for now just start with java
The language itself, your IDE, and the compiler tools.
well using a default compiler, intellij build system.
so... where do i put files that i want to execute?
i only have 1 folder
alright yall, now for a real question... why is my compiler bitching at a COMMENTED LINE???
nah bad english
like fr i've been having this error since yesterday
i think if i deleted this class it'd still throw an error
delete comented line and create it again?
Default builders from ide will make you suffer a lot because you have to download and manage dependencies manually. In the other hand build envirolent like gradle or maven make that work easier. Because you tell them what dependencies to use (name, version, etc) and they care about download it, etc
Also using graven is the best option because is 10x fadter than the actual inventions
😂😂
remake plugin
Try creating a new project with java 19 and see if it'll let you.
not exactly in the mood to recreate ~80 files
nah he just has delete class dont think he will need it
src
to code
src
what files
create a class or a file?
You may be able to copy and paste them over, but you should see if you can even create a Java 19 project in the first place.
package
a class is a java file
i managed to fix the fact that it doesn't allow me to use java 19 at all by updating the ide, so that should be checked out of the list i think
What's your pom looking like?
now that i emptied every method, it errors at a comment, guess it really doesn't like Register:63
bro got more libaries then I have hair
lmao
LETS GOOO i writed my first code in java!
package test;
public class myfirstprogram {
public static void main (String[] args)
{
System.out.println("This is my first string of code in java!");
System.out.println("I hate Roblox");
System.out.println("Minecraft better lmao");
System.out.println("Lore FNAF");
}
}
i am following programmingbydoing
|| time to drop the naming conventions link ||
Hmm, your pom looks fine. Maybe you should purge your com.roughlyunderscore.enchs packages from your local m2 repo. (You would want to quit IJ first)
hm, perhaps
now i have to write a letter to myself
only need clean and install, and the way you wrote it would make maven error since package comes before install
no error happened actually
and yeah it failed at register 63 later too
most likely because it errored at compile
and didn't quite make it to the packaging install parts 😛
what does it say for it?
take a look
either delete and retype the line or just shift the line down
the content of the line does not matter
i shifted the line multiple times
in the message that i linked above, it was a completely different line
it just errors at 63
and if there were to be a hidden char, it'd probably say that in the error or in the ide itself
try removing .
not always
where?
at the end of the comment
alright, so
a funny thing
i just cleared the shit out of Register.java for it to have 55 lines
Would you be Interested on trying Graven the new 10x faster invention for java building
Hmn
well that is an improvement, does it give anything else?
Eh, maven errors are weird sometimes. What does it say now?
I would recommend learning about reading ide and stracktraces
Hmn maven doesnt thru empty errors
Does it say anything in the lines above it?
try removing the comment completely
it's an entirely different class now wtf
it just throws errors at whatever-class-it-finds-funny:63
you have an encoding problem it would seem like then
or corrupted class files
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
that changes the encoding during compile time
doesn't change the encoding the file started as
If you click on "Some problems were encountered" or "COMPILATION WARNING", does it say anything there?
for Register:
Some input files use or override a deprecated API.
Recompile with -Xlint:deprecation for details.
for EntityConditionParser:
uses preview features of Java SE 19.
Recompile with -Xlint:preview for details.
this is the first warning:
'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 24, column 21
It is highly recommended to fix these problems because they threaten the stability of your build.
For this reason, future Maven versions might no longer support building such malformed projects.
it does, in fact, throw that error even when the version tag is present
version should be in there
and its quite possible there isn't a maven version for 19?
let me remove the compile plugin and try again
nope
same thing
Did you refresh your pom after you removed it?
yeah
Idk, I was able to compile against Java 19 just fine with maven.
but you have preview features being enabled
not entirely sure how much that changes in how the compiler works
but is it giving the same errors?
I'm not getting errors though. 😛
package test;
public class math {
public static void main(String[] args)
{
System.out.println("Doing Math, I will count my votes");
System.out.println(" (6 + 5 + 3) / 3 ");
System.out.println("yooo what a good/bad grade man...");
}
}
why doesnt do the math
its like
" are for strings
you encapsulated your math expression in a string
You put the math in string representation.
you shouldn't
I just removed the compiler plugin altogether and it still compiled just fine.
it works
frostalf, do you see anything peculiar?
i'll take some time off, will be back in half an hour maybe
possibly
is there any possible way to play the totem popping animation to a player without them holding a totem in their hand?
probably
any idea how?
so I was correct on the hidden characters
hm
and put the old health back
alright, around all your comment blocks, there is a hidden character before and after the * and its the . character but hidden
what I suggest is to set in the IDE to turn all tabs to spaces
and then have the IDE reformat your class file
also enable viewing hidden characters too
You can reformat your files by selecting the one you want to modify and then using the spaces button in the bottom left.
having the IDE reformat the class file should remove those hidden characters
hopefully lol
not sure why your IDE is adding those in there or how they got there
what is a double var?
you mean this?
double variable = 1.3d;
a number with a decimal
What’s the difference between a double and float
they are the 32bit version of double
@icy beacon @kind hatch can see the hidden characters on the left
the arrows are tabs
I swear, tabs were a mistake.
but you can see there is a . before and after the asterisk
Are you sure that's not the notation for a space? Some editors use . indicating a space. I also copied the code from the repo and it looks like a space to me.
oh wow
Actually, I'm positive that it is a space. Just look at the comment itself.
but why the 63 line every time?
It has them between the words.
yeah I see it now, only other thing I can think of is tabs
but it isn't python to cry about indents
not usually
I think you were right about the encoding. Because it looks like an old form of it.
Did you changes the tabs to spaces?
not yet, looking for a way
The button down here.
yeah, found it in Edit -> Convert Indents
My personal settings. Use 4 if you want.
Hey, I need a bit of advice, I got a problem with allays. I'm spawning one with noai and i'm open a inventory in interact and cancel the event. If the player doesn't have a item in hand, the inventory is "glitched" otherwise it's normal. I mean with normal that my listeners cancel the inventory click events etc.
Show your code.
yeah might need to re-create the files if its encoding problems
it is the only way I have ever been able to resolve such issues
Have you tried making a new project to see if it's an issue with that one project?
since I don't have their project files I can't really look
ah, this is going to be a pain in the ass
i've committed the new Register file, take a look
spawning:
entity.setSilent(true);
entity.setAI(false);
entity.setCanDuplicate(false);
entity.setCollidable(false);
entity.setCanPickupItems(false);
entity.setInvulnerable(true);
@EventHandler
public void handle(PlayerInteractEntityEvent event) {
if (this.isNonTask(event.getRightClicked())) {
return;
}
event.setCancelled(true);
// open here a inventory with player.openInventory.
}
maybe something is there again
I'm also canceling the PlayerInteractAtEntityEvent.
?paste the full code.
There could be more issues than what you are showing.
yea i'm creating a minimal example mom
if I should, i can update the github project fully
like all the files that have changed since the last edit
Well, you know, if you only show part of the problem instead of explaining the whole thing, then don't be surprised when the advice people give you doesn't work because they didn't have the full picture.
It looks like you already did cause now I see that the file is using spaces instead of tabs.
well, there are still 36 uncommitted files
There could be a number of things wrong. Maybe something is out of order, you're missing a null check, you have a weird if statement, etc. What you've shown isn't good enough to help you effectively.
I wonder if its the switch blocks causing issues
like mixing up switch expressions with switch statements
Maybe, but I think there are checks in place for newer styles used with older sdks. I got an IDE warning and a compile warning for that before.
do you still think it's a code problem? 😄
at this point really hard to tell because no error output
i'm certain it's not, otherwise it would at least be a different line when i removed that line
well nothing really useful being outputted anyways
It could literally be anything. lol
if you have any ideas, i can check them myself
it could be the annotation processor
I was going to mention that, but I figured it was fine.
have you tried removing the annotations?
Hey, can you push your changes? I'd like to see if I can compile it on my system.
I think the latest one is missing a couple classes.
yeah, sure, let me just finish the no-annotation attempt
wait, that seemed to be a good call
i removed the annotations from Register and now it throws an error at main
it'd be really unfortunate if annotations are the case, because I do not want to create a thousand getters-setters-constructors
Yea, I don't know what's up with the code that's currently on the repo, but it's missing classes and has messed up imports.
yeah, it's because I only updated the Register class
it has 36 uncommitted changes
i'll try to remove all the annotations in my main class, if it fails, i'll commit the changes
Lmfao, what a variable name.
🙂
It was Lombok!
now just gotta figure this, shouldn't be harder than a google query, unless?..
Check your IDE project level.
It shouldn't be.
alright, it was an outdated shade plugin
and it FINALLY compiled
ok, wow, so lombok was causing errors in 2 classes, no more no less
oh, I got an idea, i'll readd the annotations one-by-one
You may also want to check if lombok has an update.
However, it may not be lombok itself, but how you implemented it. I have a feeling the compile on my end would have been fine if I had the original Register class.
Hard to say though. My setup is a little different.
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
<scope>provided</scope>
</dependency>
people who like lombok >
😛
so it seems that @SneakyThrows is at fault
I've readded the other annotations and it compiled just fine
at least as for the main class
haven't done the register class yet
Hi! So, I'm trying to compile a plugin on 1.19 which was abandoned in 1.18. It's giving me an error though when it tries to compile PlayOutSpawnEntity, why is that? https://pastebin.com/dKxELuku
Because that is a 1.18 specific packet. You'll have to update the packets to use the 1.19 equivalent.
ah so it was removed in 1.19?
Possibly. It may just be the wrong import, but it's likely that it could have been renamed to something different.
@kind hatch sorry for the late response. I found out that both events PlayerInteractEntityEvent and PlayerInteractAtEntityEvent are getting called twice for allays. I that a spigot related issue?
I tested it out with a minimal setup also and confirm it like so
pretty sure it's known yeah
yea okay
I'm sorry if this is obvious, but is there a list of available packets?
then sorry for pinging you shadow master.
but also not sure if it's an "issue", looks like "intended behavior" because it's been out for a while
Well, you are listening for what is essentially the same event. PlayerInteractAtEntityEvent extends PlayerInteractEntityEvent. You can probably just use the latter event and be fine.
idk is that right?
when yes its kinda dumb
yea I just fixed it with a kinda rate limit
What are you trying to do? Just listen for when a player clicks an entity?
Ok, I have just checked, @SneakyThrows is 100% at fault. It's also present in those two classes only so it kinda makes sense. Not sure what is going on though.
yes and i'm opening a inventory. But its a bit complex inventory and it got bugged because it was opened twice directly
so it lead to a race condition
Do you need both events though? I'm betting no.
@wary wren are they called twice for each hand? or once for each hand?
no the events just was for testing. I was only using one event. The other one was just get canceld too
called for each hand once
that's correct then
Oh right, the hands.
if (event.getHand() != EquipmentSlot.HAND) {
return;
}
Are you still getting a bugged inventory then?
nop that fixed it
Cause it seems like you shouldn't if you are listening for one event and have that check.
Ah, good deal then.
ugh
?switchmappings
🙏
haha I just realize
you are welcome
the blog post I sent and wrote is EXACTLY about the packet you mentioned lmao
I've also opened an issue on github. thanks ShadowMaster and frostalf for helping me solve this unreasonably non-trivial problem 😛
i was trying to make a joke about how you know my real name
lol
but then i realized
you forgot the third g.
not sure if a sin of such scale may be forgiven
you will have to forgive me, otherwise I'll bribe michael to ban you from this discord
😶

exactly
Who's Michael?
md_5
blackmailing is bad
this is michael lol
LMAO
yeah anyway
wtf is this, and why does it show up when you google "md_5 spigot" lmao
sctr
sctr?
why is choco in the corner out there
because he's finely handsome
cap
i'm saying this as a straight male
that should be enough proof
lmao
true, that's actually choco
this ain't canada, why is it green outside and not white
OH NOOOOOOOOOOO\
@young knoll stay back
lol
try {
Connection connection = DriverManager.getConnection(getDB().getPath());
} catch (SQLException e) {
throw new RuntimeException(e);
}
public File getDB(){
return new File(getDataFolder().getPath()+"/locks.db");
}
i get this error
java.sql.SQLException: No suitable driver found for plugins\SignLock\locks.db
Class.forName("org.sqlite.JDBC");
connection = DriverManager.getConnection("jdbc:sqlite:" + dataFolder);```
I have this for example, dunno if it is the best way
i'll try it thanks.
Just look at this repo, it's one of my old plugins where I got that code from https://github.com/KevinDaGame/ShopGuiDataLogger
you can always refer to the official sqlite web page
which gives a couple of examples in loading it
if (condition.length == 1) {
String temp = condition[0];
condition = new String[2];
condition[0] = temp;
}
i've written this code snippet a very long time ago, let's try to figure out what the fuck it does
condition example: ["damage", ">", "5"]
um... any idea why it's giving me a Cannot resolve symbol 'ClientboundRemoveEntitiesPacket' error when I try to import net.minecraft.network.protocol.game.ClientboundRemoveEntitiesPacket;? :c
are you sure you have the correct NMS version?
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
Hello guys, a question, anybody knows why the variable message ain't changing it's value? I mean, it's always "Your saved homes are: " but it's not reaching the "You don't have any homes"
so I should do something like dependencies { compileOnly 'org.spigotmc:spigot:1.19.2-R0.1-SNAPSHOT-shaded' implementation project(':NMS') } in the build.gradle then?
wouldnt you just set the absent message if the mainCommands.homes is empty? else just iterate the other logic you got there
No, because I save information of all players in the array
Well, you’re not mutating the contents of the array anyway?
Not there at least
if (homes.length ==0){
sendAbsentMessage();
return;
}
StringBuilder message = new StringBuilder(…);
for (var home : homes){
message.append(…);
}
sendMessage(message.toString());
Or sth? You know, case by case working the logic out.
The code is just a pseudo
But you get the point
I mean I can't use the (homes.lenght = 0)
well is it an array or a collection?
IsEmpty()
^
Is that in an event?
You wanna know what, my teacher programming doesnt want to let me use break and continue
Even when the code looks better
what do they advocate instead?
Array
And that array has different players homes

So wouldn't make sense if I say if homes.lenght == 0 send the message, because welp, it's not gonna be empty
Im starting to hate that teacher
Well if its not, then the absent message is redundant?
The point is to send the message if once the arraylist gets iterated, no home with the player sender uuid is found
...
What event r u using?
Cuz of the runnable ig
So the bukkit runnable runs unexpectedly much?
stat.executeQuery("select * from "+tableName);
guys i want to get all values of that but it only gives me one of the values
show code
Select from table with definetly show all entries from table
Genius

my teacher programming forces me to do this;
boolean found = false
while (it.hasNext() && !found) {
if (/**/) {
it.remove();
found = true
}
}```
💀
we cant use break lol
cuz shes a bitch probably
Is she to dumb to understand break keyword
shes also taking points if we dont use the required loop for her
What a shitty professor
She's probably cranky she ended up as a professor cuz she wasn't good enough to get a job anywhere else
didn't nobody ask to teacher "why"?
Your prof would hate me lol I love using final and breaks etc etc
I use finals everywhere where something doesn't need to be changed
if you use final for variables i hate you too
then altleast use C++ with const
where it has its usecase
what did final do to you
Took his dignity
Hello guys i am making boxpvp server. There is problem with plugin MRL. I write /mrl create (name) and theres ,,An internal error occurred while attempting to perform this command,,
What is wrong?
never use final
?paste the whole error
you might contact the plugins owner if thats not your plugin
How is called the fern and the large fern in legacy?
ew dutch code
English > Dutch when it comes to coding
Legacy? you mean as an numerical id?
alright, about to make changes to pathetic then
tell that my teacher
I would just write it english anyways lmfao. Don't make stuff harder then it has to be
what's the best way to extract a folder from your Plugin Resource folder to the Plugin Data/Config folder?
plugin.saveResource("file.yml", false)
does this work for folders?
oh uh not sure about that, probably not
either way check the impl and do the same thing for folders
Getting folder content from resources is fucked up
You probably just want to save all file names and iterate over them
me coming to the idea of writing a bytecode interpreter in java itself 💀
interpreterr is probably not the word
anyways, how would i go about including a connection string to a mongodb cluster server in a plugin?
dont want to expose password and dont even know if its safe to expose the string itself
Thanks I was thinking about this, but can you explain why?
Because afaik there is no other way then opening file as zip(jar) entry and walking over files
so best way is to iterate over them
just save names in set or something and saveresource
imo yes
alright thanks brother!
if it is a public plugin and a central database, then don't give direct database access. You'd probably be best off having a seperate server that runs some code handling the database. (kinda like bstats does it)
im storing BlockData in a hashmap with a vector. is their a replacement of BlockData that also stores the metadata of the block?
hmmm
is their a Bukkit.createBlock(data); sorta thing?
yes under Material
thats create block data
oh no such thing as createBlock
each location refers to an Instance of a Block. there is never more than one Instance of each Block
When starting a spigot project, I can't decide which classes, which model classes I need. What is your suggestion for me?
what are you making lol
yo am i tweaking or does Server#recipeIterator() not have all the recipes
i’m tryna cache shaped recipes in a custom way for a custom craft menu
you can use Material#createBlockData() like Material.STONE.createBlockData()
do we have any people here who understand the concept of dynamic programming?
I have a few questions regarding the algorithm it specifies that i couldnt find on google
And no. dynamic programming is not particularly finding something at runtime (That what I initially thought before uni lecture today)
wtf is dynamic programming i feel stupid
its an optimising algorithm for problems that you cant easily solve, for example in problems which involve combinations
mostly for the problems that can be solved recursively
lets say you have a 2XN block board
and you have two tiles, an "L" one (blue), and 1x1 (purple) one,
you need to construct a function which give you result how many combinations can 2XN board have
for 1X2 board you only can use two 2 1x1 tiles, so you have only one way to tile it
for 2x2 you have 5 ways, since you can use "L" tile and rotate it by 90 degrees like in tetris, and you can use 4 1x1 purple times, so 4+1=5 ways
Some recipes have multiple-choice ingredients
Also some are complex
Both are returned by the iterator however
and by analysing more and more combinations you can spot on a pattern of how the sum of combinations can be expressed algebraically
Hey, I'm trying to limit the amount of certain item a user can have in their inventory. I have already handled it for when the player picks up an item from the ground, but I'm having a hard time finding the correct event to handle for when the player moves an item from one inventory to his inventory. Does anyone know which event I should use
Isn’t it called InventoryMoveEvent?
I tried that one, but it didn't work
drag
I'll try that one
nope
ok, its sort of working, its behaving really weird though
I'll just play around with it
How can I change the priority of an event by changing something in console?
Example:
Chat Event Priority: HIGHEST
Movement Event Priority: LOWEST
does isDead() work for checking if a firework has exploded?
Can probs use reflection then re register the event
ah, okay... I dont think ima do that then
Yeah, the alternative is to just have 5 listeners of varying priority and swap between them lol
Which is a bit ugly, but definitely the better approach
yeah I might do that one, but not sure if its a necessity for my chat plugin. Just thought it would add more compatibility.
Im not 100% sure how I would switch between the different priorities however.
EDIT:
I guess I could just have checks that will enable or disable based on what it is
Is it possible to create a fake user to be sent a message?
It seems like EssentialsXDiscord requires there to be someone in the AsyncPlayerChatEvent#getRecipients() section of the event to determine that there is a message being sent. The messages that I send cannot be used in conjunction with normal chat messages, (I'm sending hover able messages), so I have to clear the recipients before sending the message to ensure only 1 message is sent
is there any way to get the spot immediately to the left of a player?
I know .getDirection() can give you right in front of the player (where they're looking) but what about other directions?
a spigot plugin can set a playerlist name, but i can only see a display name on bungee (for proxiedPlayer). Is there a way to change the playerlist name from a bungee plugin?
I guess i'll have to set it from the bungee part of the plugin since there i have access to Player which has setPlayerListName()
You can rotate the direction vector 270 degrees clockwise
Or 90 degrees anticlockwise
Say I'm writing an addon for an existing plugin.
If I want to make changes to what the plugin does in one of its methods, what options have I got?
Can I inherit from this plugins class, overwrite that method and somehow tell it to use my "edited" child class instead?
If you can extend the class and then figure how to orovide the plugin with instances of your custom class, that can work
May be difficult tho
It might be easier to get the src
figure how to orovide the plugin with instances of your custom class
Any idea how this would work?
It depends on the type of changes you're trying to make
Let's say you're trying to change a manager class that the plugin has an instance of in its main class, you cld use reflection
so you literally want to inject your own instance to somewhere it probably doesnt belong
Still the best option
The class in question doesn't need instances, it basically contains a number of static methods to some of which I want to make small changes to.
I know building my own version of the plugin would be easier, but I want my plugin to act as an optional addon that depends on the main plugin, not as its own standalone thing.
Can't really overwrite static methods, what do you think would be the best approach for this scenario?
.
Hi everyone, I'm trying to modify the explosion resistance of some blocks. What's the best way to do that? I've tried using NMS but unfortunately the explosion resistance fields are final.
I think you can modify final fields with reflection
that's if there isnt a securitymanager stopping you from doig so
Thanks for answering! I did try, unfortunately final modifier has to be removed from the field which is not possible as far as I know on java 12+
you can bypass it
unsafe ;)
I'm currently trying to do that actually. Do you mind pointing me in the right direction? I see references online for modifying static members of a class but not object instances.
Would it look like this (kotlin):
val unsafe = Unsafe.getUnsafe()
val blockBaseER: Field = BlockBase::class.java.getDeclaredField("aH")
unsafe.putFloat(Blocks.eG, unsafe.objectFieldOffset(blockBaseER), 100f)
Yep that one's static 🙂
Anyone know why this doesn't work?
What's the proper way to run some code only once when the server starts?
I can't use onEnable() because that is called when I run the /reload command.
you can't afaik onEnable is the entry point
if server owners use reload its their fault your plugin will break
tell them to cope
I guess I could save some data to a file. Read that in onEnable to see if the server is already running.
Basically, I want to make server start/stop messages for my discord webhook.
I don't want it to say "Shutting down", "Starting server" every time I /reload
Looks like the code I sent worked with just a few minor changes, thanks!
whats the best way to add support for spigot & bungee for my plugin?
oh lol i was about to send some weird behaviour i found whilst testing
Oh really? Sounds interesting
public static void main(String[] args) throws Exception {
//this is standard
final Field unsafeField = Unsafe.class.getDeclaredField("theUnsafe");
unsafeField.setAccessible(true);
final Unsafe unsafe = (Unsafe) unsafeField.get(null);
//field that you want to modify
final Field ourField = Example.class.getDeclaredField("amount");
ourField.setAccessible(true);
//instance of the object you wanna modify
Example example = new Example();
//let us get the value of that field via unsafe and print it (1222)
System.out.println(unsafe.getInt(example, unsafe.objectFieldOffset(ourField)));
//let us set the value of the field to 100
unsafe.putInt(example, unsafe.objectFieldOffset(ourField), 100);
//let us print the value of the field via a method (1222)
System.out.println(example.getAmount());
//let us print the value via reading directly from the variable(100)
System.out.println(unsafe.getInt(example, unsafe.objectFieldOffset(ourField)));
}
you shouldn't be reloading your server
if you need to do anything hard restart
when you modify the variable via unsafe, the getter is not garanteed to return the updated value
reloading can tend to cause memory leaks and other problems
Yeah I can explain that
It's final, right?
Reason is the compiler sees the variable has a constant value defined at compile time and inlines it in the getter
yep
when declared like this though
it works
If you read the int from stdin or smth and set it at runtime that wouldn't happen
How can I make clickable only part of message? I tried this but is not working. I want 2 clickable messages in one line. TextComponent confirm = new TextComponent("Potvrdiť"); confirm.setColor(ChatColor.GREEN); confirm.setUnderlined(true); confirm.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/char done")); confirm.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("Vytvor si postavu.").color(ChatColor.GRAY).italic(true).create())); player.spigot().sendMessage(confirm + "text");
sendMEssage can take an array of TextComponents
so just split each bit into a separate TextComponent
you cant append a string to text component
how do i convert setDisplayName() and setLore() to paper?
they are deprecated
and requires compoents
💀 ask paper
they have their own server
:c
Guys can please any one help me :c, everytime a player executes this command (even if they don't have any homes) it's not reaching the variable reasignment message "YOu don't own any homes"
why not just store a home name to a list of locations in a map
is there any way i can add to the already existing "loot table" for librarian villager trades, so that even ones created by the player have a chance to get the trade?
Maybe but, in this case, why isn't it reading the variable reasignment?
.
use strings anway
should i be getting recipes like iron chestplate?
?paste
like rn im only getting these https://paste.md-5.net/isafumamey.css
hmm
Code
does it matter when im trying to access them because rn im printing these onEnable()
Plugin startup normal?
i believe so
it does say it loaded 7 recipes
which is weird cause im getting more than 7 but
im getting a Found new data pack file/bukkit, loading it automatically in the console, not sure if thats normal
after creating a new spigot server, im getting different recipes being printed
but not anywhere near 500
yo where can i hire a dev i need somone with experience to make a server for me and add plugins if u looking for a mini job HMU
Is it possible to open a GUI to a proxyplayer in a bungee plugin? and like- How?
With packets, yes
But usually you‘d want to do it from the actual server
The proxy doesnt keep track of any inventories
?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/
btw you should enable either DMs, or at least accept friend requests, otherwise noone is able to message you lol
i do have dms open HEEH
let me open em
just friend request me
Is there a way for server plugins to communicate with bungee plugins?
sure, it's called "plugin message channels"
?messaging
hm
?channels
what's the command again
?messages
?pluginmessages
fuck this
1 sec
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
this however only works if the backend server has at least one player online. if you also want it to work without any players, you should rather look into pub/sub systems, e.g. redis
@idle loom
redis is the "de facto standard" for stuff like this
yeah fuck the plugin messaging shits wack
it would be better if it didnt require someone on the server
yo alex, some reason im not getting all the recipes when i use recipeIterator(), you got any experience with this?
ughm it should include everything
you do use spigot as your .jar ?
or do you use a weird forge/fabric hybrid thing?
because in those cases, I can confirm that it doesnt include everything
however, there's of course also a chance that your plugin gets enabled before all recipes are registered - what happens if you check the iterator after waiting one tick?
public void onEnable() {
Bukkit.getScheduler().runTaskLater(myPlugin /*this */, () -> {
for(...) // Now print out all recipes, whatever
, 1L, 1L);
}
oh yeah
yeah rn im printing based off command for that reason, only spigot and only a few recipes
smh
but its weird cause the recipes rotate, its different recipes after every restart
weird. can you show your code, and the output that it does?
looks okay, what does it print?
hold lol
damn now you removed the msg lol
case "recipes" -> {
getPlugin().getServer().recipeIterator().forEachRemaining((recipe -> {
System.out.println(recipe.getResult().getType());
}));
}
same thing
lemme get a paste
?paste
is that everything?!
not ALL the recipes change, a lot stay the same between restarts, just a few
and yes
What /version
who runs craftbukkit anymore
pls send screenshots directly instead of using gyazo or whatever 😛
it doesnt popup as embed?
it's spigot
why they put craftbukkit on there then
well even if it would be craftbukkit, it should work
do you run spigot.jar or craftbukkit.jar @winged anvil ?
I'll test it, gimme a minute
But I doubt there's a non deterministic bug lol
but it says craftbukkit version something-spigot-something shouldnt it say spigot version something
well that's just how it is lol
Don't think it be like that but it do
jank
hmm
i hope it also breaks for you so i dont look crazy
bruh
ok
I'm using 3607-Spigot-6198b5a-e7aab54 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT)
(latest)
yeah same as well
do you have any datapacks in your world's folder or similar?
does your server say "loaded 7 recipes" in console when it first starts up
I'll check
i mean i have the bukkit/pack.mcmeta but i think that just comes with no?
yes
have you tried to move your spigot.jar to a whole new directory, then see what it does with only your plugin installed?
e.g. new world, no other plugins, etc?
mmm i recreated the server by deleting everything in the folder, but not a new folder name
i can try a new folder
well that should be a problem, but please try it anyway lol
should NOT* be a problem
sorry I'm quite drunk
can you send your whole latest.log?
?paste
oki
heres the log from the old server, not the new one im making rn
here i do use /reload so im gonna try wout that
the log you sent has all the recipes
brb, going for a smoke
well, problem solved
some hosting companies have very weird "online" console viewing things
maybe that's the problem
it is localhost
yes, issue has been resolved
Do you know what the problem was?
well i feel dumb, is it bad to trust a print to the console ?
ig the console just didn’t print all the things
The console, if you run plain spigot, will always show every System.println
On paper, iirc they supress repeated messages or limit them somehow
But im not 100% sure and im banned on papers discord lol
lmaoo for what
A soundcloud link lol
But lets not go into that here
I sent a song that violated their rules
Hängst du schon am Haken? Knusprig Paniert und JEFF & Jefferson ergeben zusammen: Le Crochet!
interesting they banned you for that
people on paper's discord are quite easily triggered
I talk about sex and stuff here all the time and nobody cares lol
that's why I love this discord
Within reason of course lol
Lets not forget your temp removal lmao
?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/
trigger warning: hello11!!1! /srs ||hi|| (i apologize if i offended anyone)
bro remember the your mom joke streak we went on in the paper dc
how do i make my localhost server not count my accounts as 127.0.0.1 for ip? cant test my ip thing with it being 127.0.0.1 all the time
that's a joke right..?
lmao
prolly his thoughts when working on spigot
"yeah yeah that addition might work"
im tryna get the actual IP of my vpn yknow
ip leaked confirmed
Have fun, I live next to the taco bell 😉
takes too much effort to find where they are
:lol:
also i cannot be bothered to type an ipv6 ip
Mood tbh
Did you get it?
yeah i made a shockbyte server (25% off using code LIVECHAT) ;) ;)
(not sponsored)
Shockbyte is actually just terrible
Nah, use oracle cloud free tier
Buy a $5 a month digital ocean node. You control everything from the OS to the java version.
how do you expect any of us to have money
Or bloom.host or pufferfish.host if you need a host
Those are the least shit of the mc hosts
Puffer is better I think, mostly cause of pufferfish+
whats pufferfish+
correct but you get 25% off using LIVECHAT coupon code ;)
SCAM
Not really tbh
$1.87/gb
just got a free build from the 30th october
have fun with the 500mb of memory ig
$5 a month nets you a gig.
https://pastebin.com/pvSWaunj why does my code not work ( i use crazy crates)
yeah i tried to app nobody answered 😦
hey,
how would i apply an tab complete list to my custom command?
for example when i have an command time with 4 options morning, noon, evening and midnight.
is there spigot method to do this or do i have to code this from scratch somehow?
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
switch (args.length) {
case 1 -> {
return StringUtil.copyPartialMatches(args[0], Arrays.asList("option1", "option2", "option3", "option4", new ArrayList<>());
}
}
}
That's not code. Use #help-server
okay thanks
Return switch
i want to make an item that you can upgrade in a shop and cannot remove from your inventory and i dont know how to make the item upgradeable
i was thinking of making a hashmap with key int, value itemstack
any better way of doing it?
You want an upgradeable item you have two common options.
- If the item follows an algorithmic upgrade system where each state is based on a % increase of a base version then you only need to store the base version and the formula.
- Use a HashMap and store each upgraded state as an individual item.
its gonna have many different enchants
and material types
wai tactually
ill put it in a sorted list
because the player will select each tier of the item
or maybe not
i just keep going in loops
i dont know what to do
You can also try storing a class or something that defines the operation on upgrade rather than the exact item. That way you won't need to override the old items (vanilla enchants, dyed leather armour for one)
SPAM
Sorry its the cellphone thing
providing a direct solution to someone's problem is not spam, it's help
I thought he was lo king to his own private servers
Idk just for spam reason 😂🤣
again a little question, when i set a player custom weather with player#setPlayerWeather()
will this reset after an rejoin or is this permanently until i reset it?
its reset on a re-log
okay, good :) thanks
Is there an equivalent to player.chat() that lets me select the recipients? Or would I have to use player.chat() and then intercept its AsyncPlayerChatEvent?
is there anyway to play custom sound in resource pack?
This
If I have Material.STONE.createBlockData(); can I just store the result and re-use it? Or will that cause issues?
Alternatively you can just send the msg to the ppl that need it
I dont think it should
via player.sendMessage(), you mean?
Yes
I'll stick to AsyncPlayerChatEvent then, thanks :)
You can.
Hello, is there some API for yaml you guys recommend? Thanks!
spigots yaml is good enough
else eo yaml or snakeyaml
? 🤔
Thanks. ✅
I also have my own FileHandler which is an impl of spigot one but is well used compared with spigot default one which is really abstract in terms of usage
👀
Cool. I am finding a solution to create files much faster.
why is legacy book and quill deprecated in 1.16.5?
wdym by creating files much faster.
new File("path");
Haha.
are you stupid
Adoman I also looking for a solution for working over diff flat file formats by using the same way
File file;
FileConfiguration config;
public void setup() {
file = new File("path/file.filetype");
if (!file.exists()) {
try {
file.createNewFile();
// config = YamlConfiguration.LoadConfiguration(file);
catch (IOException e) {
e.printStackTrace();
}
}
config = YamlConfiguration.LoadConfiguration(file);
}
here
idk if it is the correct one
yaml ew
Yeah is not bad
makes me remember to work on my expression parser
Yeah... it gets little complicated when creating serializations and separate files.
public enum FileType {
YML,
JSON,
PROPRIETARY;
}
type deal
and make a handler for each
then link em together
So the end result would look a bit like worldedit's clipboardformat class
3)? =3=(?
uhh
wtf are you on
Ahh shit fucked discord
Cellphone discord is trash
shit fucked Discord
yeah that
but add more types
MYSQL being the only remote database type is shameful
add MongoDB, Cassandra and S3 <3
then i only had to do this
smh it was more like a personal plugin which just was on gh
my database abstraction system is a bit more aggressive
yeah yeah once I learn adding them
aslo
is there any difference between the four?
Url? Is it public
👀
anyway gonna make the game
Might need more databases
see ya
impl 🤮
Mesaging? Lol amazing
but I can use RabbitMQ for messaging if I want
cry about it
It ties into my packet system and allows me to send packets containing info to specific instances
useful when sharding
How does your message work
you make a packet
Query to De database every x time?
Oh bruh
all the messaging databases have a pubsub system
I thought you were using db mthru Messaging
binary pubsub
ffs
caching
fetching
type adapter is for funky types but it should handle it automatically
graphing is for making graphs
Wipe?
very useful when you fuck up the entire schema
I dont understand meaning hahaha
it deletes everything
on mysql it's like dropping all tables
on mongo it just deletes and recreates the collection
for proprietary formats, it just deletes the file
or empties the bucket for bucket-based databases
oh btw im converting all my old plugins to one new core plugin
kinda like essentials 2.0
Does your database interface contains the credentials, open and close methods right?
yeah
I like how you code imlussio.
PlayerUUID: e69dee42-3a33-359c-802c-eb5dd278a5d7
DiscordUUID: '925303002867310592'
cd62:
PlayerUUID: e69dee42-3a33-359c-802c-eb5dd278a5d7
DiscordUUID: '925303002867310592'
Help please how can i delete cd61 out the config file?
it comes with experience, verano
I take your impl coding ideas and apply to my own resources
not set cd61 to null just remove it out
setting it to null should remove it
Mainly skidding your way of implenting the things
watch me add licensing to all my code samples
so you have to give me 5$ every time you steal my ideas
Rude
desperate times need desperate measures
i want to remove cd61 out bro if set it to null it still have cd61 value like
cd62:
PlayerUUID: e69dee42-3a33-359c-802c-eb5dd278a5d7
DiscordUUID: '925303002867310592'```
haven't been paid in 2 weeks, only got like 30$ to my name rn
Why?
I thought you have a stvle work were they paid you montly x amount of dollars
Held?
Lmao shity englibs
I hate fkng english
Oh now úes I understand
now, I have like 1k$ unpaid
Lol
and bills to pay in 2 weeks
Are u sure the goig to pa?
yes
Because they can still your work tho
not only am I getting paid, I'm also getting a raise once alpha is done
But for you doesnt care cuz you can make usage of Dm A
I can just sell their code and make 5 grand lmao
Im cae you are not member of Dmca you are fucked up because they can sirelly now pay u
Na there you are doing things worst