#help-development
1 messages · Page 2272 of 1
welllll
because of how many ppl are using it
when its yellow it means speeds are slightly faster
you could get it to compile if you generate classes that have the methods you need
it just wont run 🙂
copilot can do that for me
copilot is fun
it gave me some whack shit typing that code block above
lets connect people all over the world
it was making a basic window frame
no only the minecraft servers
fuck connecting anything else
only thing is, is how would you mint new coins
on block break
yes
lame
and for some reason it just suggest stuff i already wrote myself like 2 lines above
what if someone fakes blocks breaks and crashes the economy 😱
oh god that reminds me of that dreadful film i watched once
i quote
"i just need root access to hack the blockchain and stop the timer!!!!"
fake it till you make it
i wanted to throw myself out of the window after hearing that
or it was like stop the system or smth like that
"ahh, he's too strong i cant hack him, he's fighting back!!" - "wait i will help you!" 2 people on 1 keyboard
their firewall is the strongest in the world, i cant hack this!
ill have to use y secret weapon
Wtf lmfao
Hard coded timer and only new coins can mint ever 5 seconds x difficulty level
i aint kidding that was what the hackerman said
lets make a firewall where you need to beat it in tetris if you want to access
Ban
shut up, the recaptcha team might be listening
Omfg i played a botnin chess.com today
I felt so stupid
Took 10 times to beat it
that would be a good movie
some hacker parody
but a real hacker movie would be interesting too
tetris theme plays
Oh no! their firewall is impenertable!
any idea on how to set it so that you can compile the plugin you have made on github
like a programmer who randomly found a major exploit
Wdym?
and takes over the world
People should be able to clone it
i think they mean like a ci?
Make a script that git pulls and then compiles
like a github action
Ah
I use CircleCI because I’m weird
Circleville isn't too bad
alright thanks
Im old fashioned i just hand do things
Jenkins :(
Jenkins 
I heard its aids to setup
Sort of
Based?
-they discover it
-they tell the devs of the software/lib
-it gets patched
-the patch gets released
-everyone panics cuz of the exxagerating youtube videos
-it only affects 1 specific version of a library no one uses
ew java
nah, it gets rejected - turns villain
how to offend 15 thousand people 🙂
Make a movie script about Log4j exploit now
and hackermans everyone, hackering their firewalls
nah
a documentary with david attenbruh
sadly there is no good action hacker movie
Oh he just like me fr
idk how to spell the guy
attenboroough?
like
the british nature documentary guy
with the calm af voice
the old guy
is there a way to select paper plugin after i selected spigot plugin in intellij
How would you program a British accept
Just change the import to spigot good sir
no i need paper
The maven plugin will detect it
bo'el 'o wo'ah
I tried but it's red for some reason
or leave the server
?paste
Hey now
youre an all star
Get your game on
go play
same but with rock star
POKÉMON
get paid
cant send the pom
Same thing
why tf cant i send imges
?paste
You need to link your account
#verify
?verify
lol?
?verify in #verify
?verify wisijs
i think so
I dont download files sry
what u can expand it
Im on mobile
change this bit
<dependency> <groupId>io.papermc</groupId> <artifactId>paper-api</artifactId> <version>1.19-R0.1-SNAPSHOT</version> <scope>provided</scope> </dependency>
to
<dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot-api</artifactId> <version>1.19-R0.1-SNAPSHOT</version> <scope>provided</scope> </dependency>
im trying to convert a spigot plugin to paper
Ik the issue
Its the repo url
Go ask in paper discord for that
I had same issue a bunch too
oh alright thanks
and what exactly is the issue?
A lot of forums online use a old repo url
hm
Yeh just bad repo url
paper's repo is https://repo.papermc.io/repository/maven-public/
Paper api gross 😝 😑 😐
Unless you didnt try invalidating caches and restarting
ok but i need getTPS
As well as reloading maven
Use reflection on MinecraftServer ez
no
doesn't work
exact one im using lol
try what i said
read down
not the reflection stuff lol
or you can
look into other tps plugins rq
and see how they do it instead of switching for one method
they all use gradle
how would yall recommend multi version support, would it be a good idea to just develop the plugin in the lowest version i want?
and im getting fucking ignored on papermc lol
good
gradle is literally harder and slower
It's easier and faster
One line imports ❤️
2 hour reloads ❤️
20 line maven imports 🤮
2 hours reloads?
instant reloads ❤️🔥
builds*
for first build
nah, 30 seconds max
.
yes
this is how you normally do it
unless you want to go through hell
of multi versions with different code bases....
or just release a different version for each server version?
that what i mean
cause realistically the only thing that might change is the blocks etc
lol
no
what the fuck
and only for remapped jars
yes
L maven.
remapped jars is only time i use maven cause no ones converted the special source to gradle 😠
is paper api better than spigots?
ehh
yes and no and yes
while also no
but also yes?
but a lot of no
yea nice one
depends who you ask honestly
it has a few additions
like async teleporting
^^
thats the annoying part
i fucking hate that...
so stick with spigot?
eww
thats not needed
What if my code can't get a chunk? he hangs stupidly
world.getChunkAt(chunk_coord[0], chunk_coord[1]).getChunkSnapshot()
Maybe I need to make a .load() before receiving it?
i hate paper forces that
i mean u can still use the spigot api version of the method
try it?
yes try to load before and see if you get the same result
cant hurt
it just doesnt like when u do
if not come back
yeah i dont like a crossthrough in intellij tho
its ugly
i like pretty code
xd
pretty code :))
all async too and then calls back synchronously when completed insert a sfw moan emoji bc i dont have one
matches up
LMAO


imagine using 1.8 anything
yeaahhhh
Ngl this is fucking pinnacle of developer humor
real
i did mention that
give it like a year the rest of the internet will catch up to having the emoji
dott
not if were still on jre 1.8
i give it google either already has it or will have it in about 3-6 months for android
itll take windows about 3 years
and 16 security updates later
android doesn't have it
i have 4 pending rn
sadly as soon as i see the update button i update
My computer randomly crashes and thats when I get my updates
^^
Along with a free Maven reset.
exactly mike
Since it corrupts Intellij's caches
Idling with just discord and chrome open
I have 3 open actually, I just pretend it doesn't exist
godhelpme
im sorry do u have htop on windows
11 👀
sadly
Did windows decide to do that by itself?
7 was the best. all down hill from there
I changed BIOS settings to prevent windows from ever letting me
Caused by: java.lang.IllegalStateException: Asynchronous chunk load!
turned off TPM? 😎
Caused by: java.lang.IllegalStateException: Asynchronous chunk load!
at org.spigotmc.AsyncCatcher.catchOp(AsyncCatcher.java:15) ~[patched_1.16.5.jar]
at org.bukkit.craftbukkit.v1_16_R3.CraftWorld.loadChunk(CraftWorld.java:599) ~[patched_1.16.5.jar]
at org.bukkit.craftbukkit.v1_16_R3.CraftChunk.load(CraftChunk.java:191) ~[patched_1.16.5.jar]```
You're ahead of your time. One day chunk loading will be async
ok i fix it
Just run it sync 
so, this do not helped me
Why is this necessary?
no need for the task there
plus
its gonna do that one tick later
so its gonna do the same exact thing but honestly your probably loading a lot of chunks at once
which is likely the root cause
Can you show code outside of that code block there?
is this efficient or is it better to read and save the file every time i access?
would it be better to just use the String List?
i only save files 2 times
once on server shutdown
and once every x amount of minutes in a CompletableFuture
any other time is unecesary mostly
so i should just add a runnable or something which saves the String List, every x minutes and itll be fine
yes but make sure its async
as onEnable i place all the data in a Local String List
what does this actually mean?
IE, anytime to write data to a file it should be async
there is times
you do not want it to
like on shutdown, run it sync (It will block the main thread and write to file)
while async, will let other code run while it is also saving
which is not ideal for server shutdowns
but 100% ideal during runtime
on server startup, sync (blocking, main thread) operations are good too
so how would i convert my current code to async do i need to?
You can simply run a BukkitRunnable and runTaskAsync
or
the chad
the gigachad way
CompletableFuture
20
ok thats fine i can do that just want to know if my onEnable and onDisable atm need to be changed
have you tried removing the schedular and just calling load()?
nah not rly
i would reccomend making a different class to handle those though
ok thanks youve really helped today haha
instead of it being in just your main class
ok is there a benefit for this or just cleaner code?
yes cleaner code is the main thing
ok ty
yes
server freezes
Have you tried adding debug logs in your for loop
and seeing how many times that for loop fires before it crashes
i feel like its something else and not just chunks unable to load
ive loaded 9x9 chunks before and it was near instantaneous, and it was just in a simple for loop like that nothing complicated either
The generator worked, but stopped abruptly :_) It freezes on the very first chunk
the amount of times i typed schedular instead of scheduler when working w my smp core recently
someone should PR a proxy method called getSchedular() for dumbasses who cant type (me)
Make a method in your main called getSchedular and call it instead
https://paste.md-5.net/aqewuzoxej.xml
Maven doesn't shade ItemsAdder into the jar... who can help me pls?
dev.lone.itemsadder.api.NotActuallyItemsAdderException: Error: ItemsAdder does not seem to be installed. This is just the API reference, not the actual implementation.
<groupId>com.github.LoneDev6</groupId>
<artifactId>api-itemsadder</artifactId>
<version>3.2.2-beta5_2</version>
<scope>compile</scope>
</dependency>```
Don't shade that
Hence why you shouldn’t shade it as olivo pointed out
The dependency only gives you a set of interfaces that explode
java moment
does anyone know how to make for example /plugins give a custom message?
capture of ? could be anything within the bounds of the wildcard
Which disqualifies type Object
What if the capture is a type of a function
func(capture<?>)
the function might actually be consuming a subtype of Object
ugh
And Java doesn’t fully know if that captured type is Object, tho you might be more clever
Or well you are more clever
maybe include this
@FunctionalInterface
private interface PlaceholderPlacement {
void apply(PreparedStatement ps, int i, Object t) throws SQLException;
}```
tried to make a method that removes the boilerplate code
but uh that map looks really ugh
i was bored and did some stuff
doesnt help
fair
I love the consistency
map looks hotter but map slow
What Java version are you using?
I’m perplexed
reflection?
java 17
IdentityHashMap<Class<?>,CoolFunction>
^
Use a switch
or that
switch (class) doesnt work if you mean that
literally anything lol
ah wait java 16
A switch statement transfers control to one of several statements or expressions, depending on the value of its selector expression. In earlier releases, the selector expression must evaluate to a number, string or enum constant, and case labels must be constants. However, in this release, the selector expression can be of any type, and case lab...
Oh 16 ;/
i can switch to 17
is there a way to disable the built in ai or pathfinding of an entity but still make it so i can setVelocity?
doesnt really matter
Then use what I sent :)
Reflection is bad and all but i wonder will something like this work?
ps.getClass().gtMethod("get" + o.getClass().getSimpleName().invoke(ps, i, o);
u are missing a bracket
and an e
does anyone have a recommended Economy Data holder plugin that doesn't have commands for in server, and depends solely on a 3rd party plugin to program and execute commands like /balance?
I Want to use essentials but it has everything, and I want to make my own economy plugin with variations of my liking without allowing players to do /bal or /balancetop and getting essentials response
Or is there a way to disable this in server with essentials
wait duh
this could be fixed with permissions
I think I answered my own question lmfao
You did
TIL where to use Map#computeIfAbsent vs Map#putIfAbsent
bc apparently putIfAbsent returns null if there wasnt already a key
I mean you can parse it yourself but what result do you expect when the color switches in the name?
Like §2Rain§9bow
Also there is https://hub.spigotmc.org/javadocs/spigot/org/bukkit/ChatColor.html#getLastColors(java.lang.String)
declaration: package: org.bukkit, enum: ChatColor
Hey, how could I code a custom shop that would take 2 diamonds from inventory (any) and give back 32 custom emeralds (itemstack with itemmeta) ? I'm trying to get it to work but it doesnt work if inventory is full, even if there's a uncompleted slot of emerald
here's my code right now, it doesnt work
for(int i=0; i < player.getInventory().getSize() ; i++) {
ItemStack actit = player.getInventory().getItem(i);
if(actit != null && actit.getType() == Material.PRISMARINE_SHARD && actit.hasItemMeta() && actit.getItemMeta().getDisplayName().equalsIgnoreCase("§a90$")); {
if(actit.getAmount() == 64) {
}else {
Main.econ.withdrawPlayer(player, 90);
player.getInventory().addItem(getItem(Material.PRISMARINE_SHARD, "§a90$"));
ItemStack ban = new ItemStack(Material.EMERALD, 1);
ItemMeta banM = ban.getItemMeta();
banM.setDisplayName("§aBanque");
String bal = "§7Vous avez §a§l" + String.valueOf(Main.econ.getBalance(player.getName())) + " §a$";
banM.setLore(Arrays.asList(bal));
ban.setItemMeta(banM);
banquee.setItem(31, ban);
break;
}
}
}
}
YamlConfiguration modifyFile = YamlConfiguration.loadConfiguration(file); modifyFile.getConfigurationSection()how can i get ALL configuration sections?
// whatever
}```
??
what exactly isn't working? Does your else block get called?
not what i asked
You iterate over all the sections below one section
Obviously it returns a collection. So instead of iterating you can also use it for something else
However if you want a more formal answer: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/configuration/ConfigurationSection.html#getKeys(boolean)
declaration: package: org.bukkit.configuration, interface: ConfigurationSection
isnt a FileConfiguration a MemorySection
how do nms dependencies work? i know the maven and all that but if the nms changes from 1.12 -> 1.19 for example and i want it to support 1.12 -> 1.19 what maven version of spigot would i use? does each version need to be added as a dependency?
They both implement the #getKeys method
And yes I left it blank since I wouldn't know what his Section is named
public void onInventoryClick(InventoryClickEvent e) {
brewingFix(e);
}
private void brewingFix(InventoryClickEvent e) {
if(!(e.getClickedInventory() instanceof BrewerInventory))
return;
if(e.getCursor().getType() == Material.POTION)
e.setCancelled(true);
}``` did someone know why my code sometimes cancels event and somtimes not? is it becouse of 20 ticks?
when i have a full inventory of prismarine shard in this case, and one slot of another item which amount is <64, then when i try to withdraw prismarine, it doesnt give anything (obviously), but still takes money from vault
yeah i thought you were using a blank string to get the root as a memory section
idk if thats even possible
Afaik it is possible. I usually have a root section anyway since it looks cleaner
what exactly is "banquee"? You seem to set it there on slot 31. This variable is not defined in the code you sent
yea but how do i get all of the configurationsections?
I don't think you can get them directly without looping the strings and calling #getConfigurationSection().
There's only #getParent() and #getRoot() but no direct way down
Hey, I've got a bug or something. For a custom crafting gui and verification, I'm using RecipeChoice#test() to check if a the RecipeChoice contains a ItemStack. But when I do recipeChoice.test(item) where item is equal to air and where the recipeChoice is [OAK_PLANKS, SPRUCE_PLANKS, BIRCH_PLANKS, JUNGLE_PLANKS, ACACIA_PLANKS, DARK_OAK_PLANKS, CRIMSON_PLANKS, WARPED_PLANKS], the function return true while item is not contained in that recipeChoice. Is there an alternative to that?
hmm
I mean you can probably use another yaml library that has this functionality. But unless you have to reload the sections multiple times per second i doubt you will run into problems by just looping them
If they don't get new childs you only have to loop once anyway.
its an inventory, its the GUI
Other question: There is no ArmorEquipEvent in Spigot?
If you only have full stacks (64) of prismarine your code should not do anything. No matter what other item you have in your inventory. I'm confused why you mentioned that you have another item that is <64 in your inventory
yes if I have full stacks of 64 (36 stacks), it doesnt do anything indeed and its perfect
So what's the problem then? :D
but if i have 35 stacks of prismarine and 45 planks, and i want to withdraw prismarine, it does withdraw my vault account, but doesnt give me anything
45 planks, 32 powered rails, 1 sapling, anything
What's the result and what's your input?
35 full stacks? In that case your code should still not run. Unless that's another function that you did not post
it does run,and i dont have any other funcs
Because you basically go
loop {
if(isMyPrismarine() && amount<64) {
// do something
else {
// do nothing
}
}
So in that case I wouldn't expect anything to happen. And you just said nothing would happen. Now you say it removes items but doesn't give you anything.
well basically that would mean that it does something, but my inventory is full so i cant receive the item
Yeah do what it says. getLastColors only gives you a String. In order to use that as a color you will have to use the function that is mentioned
Or actually it depends. What does getLastColors return? Is it BLUE or §0 ?
You said you only have full stacks of your item. So it shouldn't do anything o.o
yeah but what string
"BLUE", "§0", something else?
Because depending on that you will have to decide what you do with it
I can read the documentation xD But it doesn't make clear in what form they are represented in the string. That's why I'm asking if you could test it and tell me
I would expect them to be §0 but it's better to be sure
System.out.println(org.bukkit.ChatColor.getLastColors(name))
Can someone help me?
Huh? Custom color? So another color besides the one that minecraft/spigot has by default?
In that case I don't even know if spigot will return it correctly when it's none of the defaults (§0 to §f). But checking the output of #.getLastColors(name) will answer that for you
well then there's your answer about the custom colors xD
I mean there sure is but when you use custom colors over those that minecraft provides than you will need a custom parser aswell
Don't you need some kind of mod anyway to let players see those custom colors?
if my inventory has 36 stacks of 64 of IT (we'll call the prismarine IT), then it doesnt do anything, right. And If I have 35 stacks of IT and 1 stack of planks, still does nothing. But when I have 35 stacks of IT and any item that isn't IT and <64, then it does the code
public void onInventoryClick(InventoryClickEvent e) {
brewingFix(e);
}
private void brewingFix(InventoryClickEvent e) {
if(!(e.getClickedInventory() instanceof BrewerInventory))
return;
if(e.getCursor().getType() == Material.POTION)
e.setCancelled(true);
}``` did someone know why my code sometimes cancels event and sometimes not? is it becouse of 20 ticks?
if(actit != null && actit.getType() == Material.PRISMARINE_SHARD && actit.hasItemMeta() && actit.getItemMeta().getDisplayName().equalsIgnoreCase("§a90$")); {
I would expect this line to prevent it from doing anything in that case.
Are you sure you are running the right code?
May I see how you set those colors to a string then?
I'm trying to make a bank system, so basically I have 10$, 90$ and 10 000$, and its with different items, so my GUI has 3 different withdraw-able items, so the code I gave you is copy pasted for those 3 items
and yes, its the right code
Sounds like you want to use getCurrentItem(), no?
How do you create the colored string? Like the one you want to receive the colors from
i want to get item that i placed in the incentory, to do that i use getCursor()
i'm just want players to not be able to place potions in brewing stand
In that case it could be that it's a clientside issue. Does the potion actually finish brewing?
yes
Can you add a debug message that outputs e.getCursor().getType()?
and where does the items name receive its colors?
[20:41:08 INFO]: [RPG] POTION
[20:41:09 INFO]: [RPG] POTION
[20:41:09 INFO]: [RPG] POTION
[20:41:10 INFO]: [RPG] POTION
[20:41:10 INFO]: [RPG] POTION
[20:41:11 INFO]: [RPG] POTION
[20:41:11 INFO]: [RPG] POTION
[20:41:12 INFO]: [RPG] POTION
[20:41:13 INFO]: [RPG] POTION
[20:41:13 INFO]: [RPG] POTION
[20:41:14 INFO]: [RPG] POTION
[20:41:15 INFO]: [RPG] POTION
[20:41:15 INFO]: [RPG] POTION
[20:41:15 INFO]: [RPG] POTION
[20:41:16 INFO]: [RPG] POTION
[20:41:17 INFO]: [RPG] POTION```
it's always potion
I'm trying to understand what you mean by "custom colors" to decide on how to parse them
Can someone help me?
And the message was also sent on the click that did not cancel? Or did you have to spamclick to make it work?
If you are sure it was printed on that one, please also print the inventory type
when potion get's into brewing stand event is just not registered
I would expect it to work as it should unless some packets are messing up
It is registered for me. I get "AIR"
And that's what I expected
So basically if you click fast enough you pretend that you want to place AIR but you actually have your potion placed. You can prevent this with another check I suppose. Let me try
You need to check the length of the array
You probably confusing index array
First element is get with list[0]
Second list[1] ect...
Yeah that's the solution
Regex
any idea why its always on one side and not in front of the player?
Location spawnAt = p.getEyeLocation().add(p.getLocation().getDirection()).subtract(0,.6,0);
how to fix it?
https://paste.md-5.net/ozadunisog.cs is there a more efficient way to do this?
example if arg 1 is null ( player name is null) target is player
arg.length == 2?
args.length == 2 && args[1] == null
um
kk
hmm
Well where is line 23
@daring lark looks like it actually does completely ignore the event at times. Guess there isn't much you can do in that case. Maybe block players from interacting brewing stands at all
print args?
bump
https://paste.md-5.net/ozadunisog.cs is there a more efficient way to do this?
Can you print the location? If would guess it gets the block location and so it will always spawn on .0 .0 .0 edge of a block
why doesnt this work? WorldServer s = ((CraftWorld)p.getWorld()).getHandle(); EntityArmorStand stand = new EntityArmorStand(s); stand.setLocation(loc); PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(stand); ((CraftPlayer)p).getHandle().playerConnection.sendPacket(packet); Cannot resolve constructor 'EntityArmorStand(WorldServer)' line 2 Cannot resolve method 'setLocation' in 'EntityArmorStand' line 3 Cannot resolve symbol 'playerConnection' last line (1.18)
[12:14:18 INFO]: [SoulSystem] [STDOUT] get
i think its cause he didnt provide a 2nd arg
nop its subcommand
Location{world=CraftWorld{name=world},x=34.33872173725389,y=69.98752361077463,z=-25.542753185005125,pitch=1.8610876,yaw=-119.766624}
/soulsystem get
example: /soulsystem get playername if playername is null use command sender for player
Why are you getting the sections and then casting them instead of using modifyFile.getString() or modifyFile.getInteger()?
i get it target = SoulSystem.plugin.getServer().getPlayer(args[1]);
If not arg[1] is null
What particle is that? Maybe it just got a weird offset
as the sections are the ID of the "robot"
yes, anything is ok i dont know why i get error
its Redstone
w.spawnParticle(Particle.REDSTONE, loc, 5, new Particle.DustOptions(Color.fromRGB(r, g, b), 2));
But can't u still do
workers.put(s, modifyFile.getConfigurationSection(s).getInt(s + ".workers"));?
ye i can lmfao dont know what i was thinking
@last temple
you have any idea?
Also if you use .getKeys(true) you can probably shorten it to
workers.put(s, modifyFile.getInt(s + ".workers")); however your "putting" s will also change then
Hey guys, so I wanted to know if there's a way I can make a percentage scheme by dividing it into X parts, dividing the 100% into
value 1 = 30%
value 2 = 30%
value 3 = 40%
I've tried but I can't
I was doing like in the print, just like, it has a chance of falling into none and I don't want that, I want it to fall into 1
if theres only 1 arg supplied thats bound to error
error is not for this
holy
i remove it fixed, i remove it before and not work
ty for help 💛
For me that code works perfectly fine and spawns it in front of me
public static List<Location> createCloud(Location at,int amount){
List<Location> ret = new ArrayList<>();
Location loc = at.clone();
int i =0;
while(i<amount){
if(at.distance(loc)>=2)
loc = at.clone();
Vector random = Vector.getRandom();
loc.add(random);
ret.add(loc);
i++;
}
return ret;
}
``` im looping thru these locations to create that cloud
I guess your issue is that you are cloning your loc and then only clone from that loc again and again instead of falling back to your default every time you loop
well I want it to be randomly
if distance from location is > 2 I reset it at default location
I see
but I don't see how this would have created cloud at same position every single time
on a different topic: Is there a reason you do not use a for loop here?^^
didn't work for me for some reason
no clue why tho
soo I sticked with while
but what you did there is exactly what for loops are made for.
for(int i=0; i < amount; i++) {
// code
}
ye ikr
anyway. Lemme try it
oh ik y i sticked with while
I was spawning those particles in the for loop but I had some errors in that
soo I thought while would fix it
didn't but I was too lazy to fix it
Is there an event which allow you to know when you right click on a player?
PlayerInteractAtEntityEvent
does anyone know if theres a way to code mods and like how to do it
Spigot == plugin && mods != plugins
@twilit roost alright found it. It's the Vector.getRandom()
return new Vector(random.nextDouble(), random.nextDouble(), random.nextDouble());
}
since it only returns positive numbers it can only go to one side
You need to use a specific Api for mods
you open ur favorite IDE
select java
import api for mods
start coding
Agree
oooh so I gotta create my own random vector gen
Basically you just wanna generate 3 numbers between -1 and 1 or -0.5 and 0.5 depending on your needs
Itstom do you know if there is another event which allow me to the right clicked entity, the click type and the item?
Oh and also I would recommend to create a function "spawnCloud" or something that does not store the values in a list prior to spawning the particles but spawns them directly in a loop. Just for performance reasons :)
Random random = new Random();
double x = random.nextDouble(-1,1);
double y = random.nextDouble(-1,1);
double z = random.nextDouble(-1,1);
return new Vector(x,y,z);
should do
kk
as long as you don't call new Random() everytime you create numbers xD
works fine
It does. It's just that creating a new Random object everytime is very bad performancewise
oh you meant it like this
imma change it to one final in main class
Technically you could also use the same vector everytime and just change it's values accordingly aswell^^
Aight perfect
Math.random() - 1
anyone?
Patient bro
You are not paying anyone
If you want to persist your message open thread on the chanel
.... it went up about 20 messages no one is gonna see that
...
a thread isnt gonna fix much
replying to my message isnt gonna kill you or anyone else so chill out, who said i needed instant support?
No switch :c
literally everyone bumps their messages
Are you against swithcs?
lemme switch to java17
Yeah i prefer switch
But the problem is that you cannot check many conditioons
As you will do it with if
In the other hand switch are faster than if
is openjdk from oracle?
I think
oh didnt know
Or not
its a lot
I i dont know really
not just oracle
bruh
Oracle mantains openjdk
wish i was on linux
Amazons OpenJDK
I use JSDK to compile my java code (java script development kit!!!)
Its really a nightmare from that part
downloaded it and now i got a fking zip file lol
if you are on linux, unzip -r file.zip
🤭
im not smh
how do i give a user a potion
sudo apt install openjdk-17-headless not working smh
Player#applyEffect()
what about like the icon for a inventory
He?
thats automatic based on the effect
when you open your inventory, where it shows the effect, duration, and the little icon representing it
and what happened here
You have all the JDK, the 8, 14 and 17
this is mine https://cdn.rackdevelopment.tech/img/OGAj6cmKOL.png
i probably have some others floating around
JDK is the development kit right?
ye
It also install the JVM
Yes
im always picking the openjdk
?
Also openjdk is better than jdk
Lol
but windows bruh it needs to move 500 files and it reached 20 now 🙄
use linux!
no
will reset my pc
Windows == shity || mack == shity
its just mac
and dualboot new distro
we aren’t that sweaty
we arent that rich for a mac
We are gamers too
actually idk price
Lol
For example which java version and which spigot api would need to use for making a full comatible plugin?
Just don’t support legacy
Why?
Heeheehaw
No i dont weant that answer
too bad
I have used java for more than 1y and its the same as 17 but less optimized and less shits
😂
rack's mack computer !
either way, for full compatability would probably end up being J8 API1.8, but even then that will probably break at API1.13
What?
Java 17 is more optimized lol
You need to use OpenJDK
Idk what you have been using
Probably some version from 4chan lol /s
lmao
I was told that api 1.13 its the one that have more compatibilities between all the spigots
there's 1 spigot
we all share the same bucket 🪣
1.13 and newer are the newer api style
1.12 -> 1.13 had some big api changes
Could you still make plugins compatible with older versions? Yeah, should you? No.
Do the same as Spigot and only support the latest version
Supporting legacy will literally break your spine. It’s so much workload
Also changing topic, Map#computeIfAbsent return the map value if the key is already set?
Thats why we should be telling anyone not running 1.19 fuck off
But if you get paid enough no one orries!!!!!
😂
I just compile against lowest and call it a day, if there's a bug on an older version that my dev server isn't running on, skill issue
you arent getting paid enough for doing minecraft development
@chrome beacon i thought 1.17 could use a switch on classes?
I would not take 1.8 commission
unless you are working for like one of the server giants or Mojang
Java 17 can
I wouldn't take a pre 1.13 plugin commission, pre 1.13 is such a pain in the ass to work with
i see
I'll always be able to do pre 1.13, as I started development with that; but id still rather use latest / post 1.13
Also changing topic, Map#computeIfAbsent return the map value if the key is already set?
I've done 1.12
it wasn't that bad but I only did it because my favorite server used 1.12
anwerting to?
you could also check the Javadocs
What
check javadocs when you hover over method
Dont bully me but i cannot find the javadocs
Does anyone know if there's a simple way to get an java.awt.Color from a string or would I have to make my own method and return certain colors based on string?
Yes
dont tell me youre using eclipse
module index
NO that is to shoot yourself lmao
Eclipse is really bad
a quick google search
wasnt this possible in 16 too?
He doesn’t use eclipse, he uses netbeans
sometimes you can get a much easier solution much more quickly just by typing your question in google
for real
oh well actually i dunno about the case Type t
I stand in opposition
hm sadly they don't have it, gotta do it myself
My opinion is that these are evil and unnecessary
It just means you are being lazy over using inheritance
mmh
Is it cool? Yeah def
But I don’t rlly find a good use case for them
Only for very specific stuff I guess
I used eclipse for years and recently swapped to intelliJ since I'm using it during my job aswell.
While I like a lot of things about IntelliJ there's still some things from eclipse that I miss in there
I started on Eclipse, good for like 4 years until a friend finally forced me to IntelliJ
never looked back
One of the things that was hard for me was the multiple projects but I like single project setup better now
(I tried IntelliJ in those 4 years but could never figure out how to build the freaking jar and gave up)
I too started with Eclipse and switched to IntelliJ and never looked back
still waiting for java to implement generics for primitives smh
same
probably some silly tutorial
What bothers me the most is that packages that have uncommitted changes are not highlighted. Only the files inside, once you open it up
Also having multiple projects files open without different windows can be somewhat helpful at times
We need var arg generics
I liked eclipse, I just swapped because I was struggling to get maven to work in eclipse 
implements Something<String...> hmmmmm 🤔
Gradle and eclipse is 🤮
😠 how dare you
ok looks like olivo has scammed me and you cant use a switch with a class object in java 17
Gradle is better than Maven, but i prefer Maven
?
This is what I was talking about
You can use that
why when i use getConfig.set() plugin.saveConfig() every line starts with # disappears?
like its the config.yml
# hmm
hmm2: 3
# well
# is the config.yml
i do getConfig.set("hmm2", 69);
and config.yml converts to this:
# hmm
hmm2: 69

but i've to set tome stuff
Snakeyaml dumper moment
addHeaders
i will laugh when i see that message showing up and then regretting
Idk if spigot works this way but
Its a linkedhashmap
All the paths and objects
When you load a yaml
well uhh thnk you olivo for telling me
In spigot they might just modify the map
And dump
So there is no way of comments being there
Maybe add a header explaining stuff @sage patio
nms issue
or maybe moving that to last lines of config
ok i got it
https://paste.md-5.net/evehehupis.java
does not matter, keeps clearing # lines
better now
Do you have multiple fillPlaceholders methods
why is the s "greyed out"
Hey guys, so I wanted to know if there's a way I can make a percentage scheme by dividing it into X parts, dividing the 100% into
value 1 = 30%
value 2 = 30%
value 3 = 40%
I've tried but I can't
I was doing like in the print, just like, it has a chance of falling into none and I don't want that, I want it to fall into 1
Hey guys, so I wanted to know if there's a way I can make a percentage scheme by dividing it into X parts, dividing the 100% into
value 1 = 30%
value 2 = 30%
value 3 = 40%
I've tried but I can't
I was doing like in the print, just like, it has a chance of falling into none and I don't want that, I want it to fall into 1
Hover over it and click the suggestion
remove redundant but i need to do that
What does it remove
how do I use hex codes in item names?
List<String> firstLore = plugin.getConfig().getStringList("factories.first.lore"); for (String s : firstLore) { s = s.replace("%efficiency%", plugin.efficiency.get(id).toString()); s = s.replace("%equipment%", plugin.equipment.get(id).toString()); s = s.replace("%workers%", plugin.workers.get(id).toString()); s = s.replace("%id%", id); }it will remove the
s = s.replace("%id%", id);line, then give the same error on the line above it
anyone
reassigning s doesn't do anything
if you're trying to change what that item in the list is
you have to replace it with List#set
This is where one needs to learn how to write unit tests
would List#replaceAll work?
yeah it should
ok ty
why doesnt this work?
WorldServer s = ((CraftWorld)p.getWorld()).getHandle(); EntityArmorStand stand = new EntityArmorStand(s); stand.setLocation(loc); PacketPlayOutSpawnEntityLiving packet = new PacketPlayOutSpawnEntityLiving(stand); ((CraftPlayer)p).getHandle().playerConnection.sendPacket(packet);
Cannot resolve constructor 'EntityArmorStand(WorldServer)'
line 2
Cannot resolve method 'setLocation' in 'EntityArmorStand'
line 3
Cannot resolve symbol 'playerConnection'
last line (1.18)
when was PersistentDataContainer added?
u need to remap ur code with SpecialSource iirc
specialsource?
shit lmfao gotta learn nbt now
uhh yes?
thats just saying how to import nms and stuff not how to fix those cannot resolves
._.
Just copy everything and you're good to go
Hey is there someone who can tell me how to create a .yml file that can save args after a command
is it normal for it to install portable git in my project
java -jar <external location of buildtools.jar> --rev 1.18 --remapped now its just installing 1.18 buildtools...
I hope you didn't run it in your project
It installs things to your local maven repo
wdym
When it's done you can delete everything it created
The required stuff is stored somewhere else
seems like intellij didnt like me running that command andddd it crashed
and the project got deleted
lmao
all i did was run that command
in intellkij in my project
i made a save of the project though :p
so uh am i supose to run that command in my intellij project?
No
where am i supose to run it then i dont get it how would it know to remap my code if it doesnt have acess to my project
Create a new folder. Put BuildTools jar in it. Open cmd in that folder and run the command. When it's done delete the folder and everything in it
but thats just creating a 1.18.2 build tools
i dont need that
i just need to fix my code
i have 1.18 buildtools installed
it installs to your local maven
i have buildtools.jar installed
i have git installed
yes i dont need that
i need to fix my code...
i already have 1.18 installed
You need it in your local maven repo for it to remap
oh?
Please just stop arguing when we're trying to help you
Just run BuildTools like I said and we'll get things setup properly
its done
Jerelfa no one wants to help you if you aren’t being cooperative
i thought they were missunderstanding my problem assuming i didnt have buildtools installed
yeah thats what i meant
Alright now copy paste all the maven stuff from here @dry forum
You can skip the spigot-api dependency since it's included in the spigot one
When you're done send your pom in a paste so I can take a look
?paste
Cannot resolve symbol 'project.mcversion' is giving me an error
<project.cbversion>${project.mcversion}-R0.1-SNAPSHOT</project.cbversion>
alright then is the rest correct?
also wouldnt i need that for using the right spigot version?
like if the server is on version 1.12 etc
Your plugin won't work on 1.12 if you're using 1.18 nms
1.18 nms will only work on 1.18
would i need this then in that case?
No
The pom is compile time only
That propery doesn't do anything
Also your pom isn't a module if you want to support multiple versions
Right now it's 1.18 and 1.18 only
Reload the project, make sure the code is okay then just package your jar with maven
That's it
i still have errors in intellij though? itd just auto fix it or smthn?
No the code above is outdated
also i noticed specialsource hasnt been updated since 1.16
It does not work on 1.18
yeah and i need to fix that
Specialsource isn't version dependent
ah
Also pretty sure it has
So now we need to find the Mojmap names for everything. For example EntityArmorStand will only be ArmorStand iirc
WorldServer is Level
As for the packet I don't know
It's one of the Clientbound<smth> I'd assume
sorry still not 100% understanding the point of the maven? what is it supose to do
also still dont understand how im supose to use the right version dependency based on the server version
That would be handled by code and multiple maven modules
It's a bit complex
ive asked earlier and someone said i need to do each dependency so idk if thats required
Basically you need one module for each NMS version and all the code there
yeah i have that setup
Then in the parent pom you simply shade everything together in to one jar
Then on enable you check what version your server is running and loads the correct classes for later use
yeah i have that
So what's the problem?
these errors
Yeah I told you how to fix them
you did?
