#help-development
1 messages ยท Page 1745 of 1
There is a project that just has enough packet handling for a limbo where players are trapped and wait in a queue. Its written in C++
...would I also have to implement AI logic?
yeah
god fucking damnit
inventory logic
chunk loading
data storage
all kinds of shit
well its not needed to be able to join
you could make a server with just chat capabilities
I think I'll just like
do some other stuff in Rust before I even think of doing that
but rust is a native language right
especially AI logic.
compiles to binary
ye
it could be quite fun
well Java compiles to binary too, just not native
just messing with AI
ok yeah but I don't know algorithms lmao
yeah but debugging the JVM is much easier
i think
I am terrible at math and AI requires that
no but imagine making skeletons jump off cliffs when they find them
yeah
Just copy paste A*
Nothing else is used in games anyways.
I can't think of how to do that at all
Maybe Theta*
No. Every voxel based game uses it. Its just memory inefficient but its quite fast
(plus I'd have to figure out how to apply A* to Minecraft's world)
but there's other parts that require math too
I think I'd have to implement worldgen
and I've actually looked into the worldgen code
it's fucking HUGE
there's so many classes and yes it does use math
OpenSimplexNoise for terrain generation
i wanted to make my own terrain generator
there's different classes for doing shit in Minecraft
like generating features, biomes, etc.
Vanilla also uses SimplexNoise ๐
but patches of stuff that crossed chunk borders were a big problem
And A*
since when?
Ever
at least in bukkit
I thought it used Perlin noise
simplex is perlin right
no
simalar
Perlin noise is "Car" Simplex nois is "BMW"
Its just a specific perlin noise implementation
if you compare Simplex world generators (from Fabric or whatever) to Minecraft's default generation
they are quite different looking
well then that's another implementation detail I have to add too
yep
have you factored how much research this would also require?
this would take me a long time
otherwise u would get boring, smooth terrain
and I'd still have to do a bit of math
You can overlay thousands of noise layers to create very very different results with the same noise algo
sad
there is no way to avoid math in this situation
true
but for basic movement u need math too
so theres no way to avoid it
lmao
Its just too much work for a single person
eh if I knew math I could do it
you underestimate me
Imagine the pain when updating to a new version...
starting with an older version could be possible
as it doesnt have that many features
like 1.0
or some beta
alternatively I could just only implement chat stuff
yeah
glorified chat client lol
Write an ultra high performance 1.8 pvp server
discord but minecraft
wdym pvp server
I'd totally add support for (some of) Markdown
wdym wdym pvp server?
it's a self-explanatory term
Nobody uses 1.8 but fortnite starved pvp kiddies
you need all other components to create a pvp server
AKA literally everyone who plays on any server with PVP elements lol
Hypixel uses 1.8 and it's filled with children
like me lmao
you go to SkyWars and you find people trying to be cool for their shitty YT montages
I use 1.8 when i don't want to wait forever for my server to start ๐
you go to Classic Games, TNT Games, or any of the other obscure gamemodes
and you find fucking E-daters
(not a joke btw that is actually true)
wait what
I found E-daters in TNT Tag once bc it's like the only thing I play on that server anymore lmao
oh yeah also
it's easy to find no-lifers on there too
just go to SkyBlock :)
that entire gamemode is a fucking grind
i dont likek skyblock
I literally played that thing for 3 hours and got nowhere
but its impressive how advacned it is
and how much content they were able to code with just server side plugins
better hands
better brain
actually
apparently Hypixel has "SMP" now
you can host your own survival servers or smthn
but it's in beta and only accessible to those with ranks
thing is
gimme a sec
(btw what the fuck is The Pit even supposed to be)
(like, it's not Battle Royale, it's literally just senseless PVP)
(even Duels looks more fun)
(how did this shit win over fucking King of the Hill?!)
(or whatever that gamemode was called, that shit was fun)
king of the hill?
one of their experimental gamemodes
it got cut bc not enough people liked it
sounds fun
nah that's a different one
this one had like powerups and kits and shit
rlly
yep
and it was mainly a PVP game
oh ye you could also build
you could build walls and shit to keep your enemies out
and they could break 'em down
that sounds so fun
and there was a center tower which would grant whoever stood on it longer a win
and there were two side towers that would give passive buffs to those who claimed it
imagine recreating that
BUT THEY FUCKING SCRAPPED IT
with plugins
IN FAVOUR OF THEIR SHITTY CAPTURE THE FLAG CLONE
lmfao
THAT MODE WAS UNFUN AS FUCK
:)
nice
and I didn't even give them a single dollar
I begged my friends to when I was younger
hell yeah
nice
lmaoo
i was thinking abt buying rank
but then i somewhat stopped playing
yeah me too
Hypixel is kinda shit
I'm not a big PVP fan so
I don't play any of their PVP-centric games
and nobody plays their non-PVP-centric games
except for Murder Mystery, but that gets old when you've played like 200 games of it
(which I probably have)
oh but their seasonal games are sometimes fun
havent played them in a while
๐
are they always at the same plac3e
oh ye and I never play Build Battle cuz I'm really bad at building lmao
same
yes
bruh
so I basically just go to the most stocked house
grab literally all presents in it
repeat
and I win 70% of the time
oh ye
but most of their Arcade Games are fun
Party Games is a great game (most of the time)
Zombies is actually fun and it reminds me of this really old Minecraft mod that I liked a long time ago
HOLE IN THE WALL IS FUCKING UNDERRATED BTW
Hypixel Says is basically their WarioWare clone but it was fun when I played it like 3 years ago or smthn
etc etc
now
SkyWars, BedWars, and Duels are filled with sweaty tryhards
and are only fun to play with friends
yeha
or if you actually put up with and are good at the shitty system that is 1.8 PVP
I never wanted to practice that shit
the fact that you have to practice a PVP system to have any chance at actually doing good is mindboggling
ive been playing bedwars for over 3 years or so
I'm like a co-op BedWars lad
although I haven't played it in forever
but I'm mainly like
lmao
I was alright at PVP for a while
but y'know rust like eventually seeps in when you don't play for years
and I found certain stuff just plain unfun to practice or even do
like fishing rods, strafing, double-clicking
but that's all pretty much required if you want any chance at winning
it just feels like a game of luck tbh
I typically outsmart my opponents in BedWars via hitting them off of bridges
but most of the time people can clutch and just fucking bridge at lightspeed and then fuck you over
so honestly not even fun
im bad at plain pvp
HOW DO PEOPLE BRIDGE THAT FAST BTW?
you mean ninja/speedbridging?
yeah
I dislike you now
a lot
maybe they have a different api, not bukkit
allow them to do even more thing?
speedbridging is annoying to look at imo
why
superiority complex mainly bc people can bridge faster than you can sprint
so most of the time PVP just ends up feeling unfair
especially when you're matched up with no-lifers
that isn't hard man
who are combo + bridging gods
doing it fast takes practice
it is like timings 1 second to count seconds without a clock
plus I'm kinda just awful with my hands lmao
then maybe it does take practice, but i dont think it takes that much
and I get disoriented quickly
i cant move them very fast
on my mouse
maybe just the shape
im kinda cracked at builduhc ngl
but i get like 11 cps
(which is why I'm better than my friends at rhythm games but could never be as good as my parents are, they're fucking BEASTS)
man I get like 2 or smthn idk
but not that much if u compare to normal players in uhc duel
gimme a sec I'mma measure my CPS
nice
6.4
also
my muscles tense up easily
like, for some reason, I am more relaxed in the middle of a game than I am with aim trainers?
like AimLab for some reason
can't control it either
my arm just like stiffens and so my aim just gets way slower
you can never hide
I see everything.
btw i think we should change the channel to #general
prooobablllyyy
i gtg
aight, peace
cya
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Hey
Where is define a player UUID in Bukkit/CraftBukkit ?
?help
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous names and nicknames of a member.
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
?commands
this is not the right place to hire developers ๐
is there any place to hire developers? lol
FirstBook_meta.setLore(ChatColor.translateAlternateColorCodes('&', FirstBook_lore));
FirstBook.setItemMeta(FirstBook_meta);```
ah it says it needs String Value for setting lore
but
?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/
that's where you hire devs ^
oh
You are trying to translate colors on a list
also
Which will return a single string
there is so much wrong here
List should not be used like that
add a type parameter to it
can you give me small example?
List<String>
otherwise adding/retrieving from it can only return/require Object
and you have to cast it manually
which is not only bad practice, but I believe invalid if something requires a List<String>
also
FirstBook_meta.setLore(ChatColor.translateAlternateColorCodes('&', FirstBook_lore));
FirstBook.setItemMeta(FirstBook_meta);```
FirstBook, FirstBook_lore, and FirstBook_meta are unconventional variable names.
for one, all variable names should be stylized as camelCase with no underscores
ah ok
ah, ok i will keep that in mind
but how do i fix this
you have to put a space after > for one :p
FirstBook_meta.setLore(ChatColor.translateAlternateColorCodes('&', FirstBook_lore));
FirstBook.setItemMeta(FirstBook_meta);```
FirstBook_meta.setLore(ChatColor.translateAlternateColorCodes('&', FirstBook_lore));
FirstBook.setItemMeta(FirstBook_meta);```
alright
now?
I think that actually doesn't matter
you can't pass a list to translateAlternateColorCodes
so what do i do
maybe the lexer recognizes it fine, but you shouldn't do it anyways since it's trash
Thats right
in that case you should rename the variables
Villain entries be like:
How can I send custom data from Bungeecord to all subservers? Is it only possible with the plugin messaging channel?
and also in all fairness it's not obvious how one would efficiently apply an operation to every element in a list
yep, or some hacky nio stuff
you could either use a ListIterator or stream() I believe
.foreach()!
Alright. And the messaging channel only works if at least 1 player is online on the network or on the subserver receiving the message?
fair
jut put it in another intermediary list
why do that when you could just update the entries instead?
less locals
correct.
Wait, what now? online on the network?
On the subserver
Ok thanks
(granted idk if listIterator returns a new iterator, if so, then it's still the same number of instantiations, but at least you're not instantiating a medium-weight object like a List)
yeah, only read the message halfway, my bad
Hope everyone is now happy with variable names
ItemMeta firstBook_Meta = FirstBook.getItemMeta();
String firstDisplay = plugin.getConfig().getString("Books.First.Title");
firstBook_Meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', firstDisplay));
List<String> firstBook_Lore = plugin.getConfig().getStringList("Books.First.lore");
firstBook_Meta.setLore(ChatColor.translateAlternateColorCodes('&', firstBook_Lore));
FirstBook.setItemMeta(firstBook_Meta);```
pretty sure listIterator extends iterator, but idk
spacing makes my eyes hurt
I know how to code!
System.out.println("Hello world!");
thats it thats all of it
methods can't extend other methods
so what you mean is ListIterator extends Iterator
tf
yeah that
i did that
but the primary benefit of ListIterator is that it allows you to set an element at the current position
your itemstack is still pascal case
you have Uppercase_Snake_Case
ItemStack FirstBook = new ItemStack(Material.BOOK); and that ^
thats item name
you'd probably want book (or book1), meta, and lore
I still generally scold for improper convention
yes now pls help, help me with real issue
it's a sign of amateurishness
ItemMeta firstBook_Meta = FirstBook.getItemMeta();
String firstDisplay = plugin.getConfig().getString("Books.First.Title");
firstBook_Meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', firstDisplay));
List<String> firstBook_Lore = plugin.getConfig().getStringList("Books.First.lore");
firstBook_Meta.setLore(ChatColor.translateAlternateColorCodes('&', firstBook_Lore));
FirstBook.setItemMeta(firstBook_Meta);```
using color codes
and, if you look at other people's code that uses proper convention, you may have a rougher time reading it
from config
pfft imagine using cases
String Correctly_formattedText = "";
the more words the less case I can use
yes ofc
ppl enters color codes as lore in config.yml
i just want to convert them to colors
simple af
List<String> unformattedLore = /* obtain it */;
List<String> formattedLoreList = new ArrayList<>();
for (String s : unformattedLore) {
formattedLoreList.add(ChatColor.translateAlternateColorCodes('&', s));
}
you get the gist
well, it's only halfway done
You still need to actually use that example
tasty
And hey, what other way are you going to teach them how to do it?
"oh hey, use this overcomplicated and very expensive API that is called Stream"
this is third party api dude
only java wont help
doc is trash
why is this help development then
I usually just tell them the process
Stream isn't overcomplicated, it's just a bunch of lambdas
But it is definitely an expensive API.
then they can write the code themselves
The primary benefit of Stream is that it is able to be lazily-evaluated, but for something like a List, that doesn't matter since Lists are created eagerly anyways.
now now
Are we allowed to keep references to OfflinePlayer objects?
I think they will not see my message anyways
It's okay, I'm not the one that has to stay with them
I'd personally write it as
final List<String> lore = /* yabba dabba */;
final ListIterator it = lore.listIterator();
while (it.hasNext()) {
it.set(ChatColor.translateAlternateColorCodes('&', it.next());
}
honestly
but y'know
I try to be a perfectionist lmao
wheres the best place to learn how to create a different thread for stuff or is my code already in a different thread https://mystb.in/FocusBelkinLadder.java
even then I'd probably separate this into a utility function like ListUtils::map or smthn
is my code already in a different thread
probably not
the word for that is spoonfeeding, you dont learn when you get spoonfed
you may want to learn basic concurrency honestly
I ask because OfflinePlayer#getPlayer() returns a non-null player even if the player has gone offline, and if they come online again this function's result doesn't even point to the online player. I have to re-fetch the OfflinePlayer...
but yeah Executors works nicely for that
yes my question was where to learn
wheres the best place to learn how to create a different thread for stuff
List<String> formatted = new ArrayList<>();
for (String s : firstBook_Lore) {
formatted.add(ChatColor.translateAlternateColorCodes('&', s));
}
firstBook_Meta.setLore(formatted);```
this will work?
I just read each article in this lol.
Very good selection of guides on the high-level and low-level forms of concurrency within Java.
I don't learn I just do and it works and I don't know how and I don't wanna know how
u were abt to leave?
I disagree.
you cant disagree with spoonfeeding is bad
I do.
spoonfeeding is situational
its kinda a solid thing
I actually learn from it sometimes bc I take the time to analyze code snippets but
it doesn't apply to everyone
examples gives us idea, how things work
spoonfeeding is only okay if someone makes it filled to the brim with explanations and the person who ctrl+c ctrl+v's them actually reads it
so that we can implement
examples do yes
on future codes
but not spoonfeeding
comment the fuck out of that shit yep
the more comments, the more detail, and the harder it is to copy-paste stuff
I learn from spoonfeeding, I learn that metal spoons make my mouth hurt.
if they dont know the basics of java theres no luck spoonfeeding is there
turn 6 lines of code into 73 lines of code
u forgot to close statement
who said dont know sir? I asked what the way, if u can give example
I mean, someone has to show them what a for loop is
with )
oh shit
i dk
nice catch, orby
I actually checked that line to make sure there were the correct number of parentheses but I neglected the set( at the start :p
peace out
do mc servers have some sort of uuid i can identify them with or not
uhhhh
this sounds hard to answer
for one, how would you interact with a server to begin with?
no, the only unique thing is the ip and port
wow, do u see the Saturn up in the sky??? no right? does this mean, Saturn doesn't exist?
are you referring to BungeeCord stuff or smthn?
ok thank you
ip and port?
yeah
the bstats UUID is one way
but no mojang related UUID
although that's not guaranteed to exist
yes thats all i needed ty
waiting for the day to get fucked ๐
you're not getting paid to answer questions lol
if you already have bstats or if the plugin only works on paper, then it is; otherwise no
What the hell am I seeing here
yes ill just identify with ip
?ban 755325501035249726 lol ok
Done. That felt good.
annoying for stuff like minehut but
(make sure to re-hash it if required though)
? why was he banned
like I get that he was an unverified who just had a burst of rage but that seems more kick/muteworthy
yeah, I'd say so too
Unbanned that user from this server.
there u go
...huh
i just wanted to clear his messages
did not expect you to actually unban him
ah, you should add a purge command or smthn then
but like I was expecting this shit to get all admin-abusey... my faith has been partially restored in humanity???
i think there is but I always forget the name because it isn't ?purge or ?clear
I think its clean 
/*This line of code defines the package that the file should be in so the compiler knows what to do with it and where to put it*/
package com.urmom.minecraftplugin
/*This tells the compiler to do black magic that makes things not throw errors*/
import org.bukkit.Bukkit;
/*This is a class and it's where the stuff goes that gets ran at runtime probably*/
/*extends means that it uses all the magic from the class with that name*/
public class ploogin extends JavaPlugin {
/*the magic stuff goes in here*/
/*@Override means that it overrides a method that exists in the super class*/
@Override
/*this is a void, it returns nothing*/
public void onEnable() {
/*System.out is the class println is the method. The parentheses mean ur invoking the method with the variables inside*/
System.out.println("Hello, World!");
}
}
๐ค
/*This tells the compiler that it needs to use another package from somewhere else*/
import org.bukkit.Bukkit;
false
idk man
it provides a shorthand for the class name for the compiler
it does magic
imports are compile-time only
pls dont whrite that many comments on an sout
no
gimme a sec
its more appropriate to my knowledge now
i thought ur profile picture was someone making bread ToT
i did a refractor on the Main.java and I updated the plugin.yml too. Have I something else to update ?
is it throwing errors?
if not you don't have anything else to update
yes it does
org.bukkit.plugin.InvalidPluginException: Cannot find main class 'me.enderf5027.perplayerborder.Main'
is your main class called main
it was
err Main
i just did a refactor on Main for call it PerPlayerBorder (the name of my plugin)
"it was" you have to change your plugin.yml to match your main class name and location :)
I did
in plugin.yml there should be a line that says main: <your plugin main>
change that to the new plugin main
name: PerPlayerBorder
version: '${project.version}'
main: me.enderf5027.perplayerborder.PerPlayerBorder
api-version: 1.17
prefix: PerPlayerBorder
authors: [ EnderF5027 ]
interesting
did you put in a recompiled plugin jar after making that change
yes
and the package at the top of PerPlayerBorder.java is
package me.enderf5027.perplayerborder;
```right?
yes
I eliminated by myself the message
i want to upload it as .txt
?paste
hastebin
maowcraft is really working on the most overcommented code ever huh
yes he's writing his message for 8 minutes
gonna be a 10/10 spoonfeeding job
his cat on the keyboard maybe
nop definitely typing that code out
so, im going to update my code on GitHub because i need to save it
Boom.
44 lines, bitches.
And only 6 of them aren't comments.
Plus it's literally 5 fucking kilobytes lmao.
and the hello world isn't even using bukkits logger
yep
frickin hilarious
I'd have added 11 extra lines if it actually used Bukkit's logger.
actually no
probably 21
bc I'd assign it to a field to better explain fields/variables
and then also comment the assigning of it
honestly I should probably just get to work on that one Java guide I wanted to write a few months ago lmao
bro u didn't explain the semi-colon
oh
or the brackets
eh
I didn't explain syntax at all actually
just semantics
in all fairness, syntax doesn't need to be explained unless you're working directly with it, e.g. via a lexer.
this does that because compiler does black magic and turns english + punctuation into other black magic
which does more black magic with ur lightning box to make shiny pixels go brrr
so i have a command that takes text as an input but the text could be like 3 - 10 words so how can i make an argument support that? if i just made the command have 1 arg it would only take the 1st word
// ; = End of line.
// { = Start of a 'body', where statements can be declared depending on what the body belongs to, e.g. instructions can be declared only by method bodies.
// } = End of a body.
Java - explained as html
supposed args is ur arguments
args[0] == arg1
args[1] == arg2
args[2] == arg3
/*etc etc*/
you'll want to check the length of args first
yeah but i dont know how many arguments it will contain
so you don't get IndexOutOfBounds error lol
it work
args.length
it's fixed-size
even if you check length, you'll have to do that repeatedly for each possible length
which is not only inefficient, but time-consuming
accomplishing nothing dont mind me```java
String argument = null;
for (int i; i < args.length; i++) {
argument.append(args[i]);
}
Use string builder, combine the args
Or the other method that was mentioned
i promise this does something its just much less efficient than straight up doing args[0]
exactly
close enough
even then a String argument; would be undefined
(not the same as null btw)
so it would throw a compiler error
you actually want
beautify my code I let the compiler do the work
StringBuilder sb = new StringBuilder();
for (arg : args) {
sb.append(arg).append(' ');
}
args[number]
it's the same thing
foreaches are syntactical sugar
they're compiled down to a regular for anyways
yea I didn't see the assignment of arg at first lol
but then I'm gonna have a space at the end!!!!!!
(with lists and other Iterables, it uses the iterator())
ah well then you can keep track of the index and if it reaches i == length - 1, then you just don't append a space.
StringBuilder sb = new StringBuilder();
for (int i = 0; i < args.length; i++) {
sb.append(args[i]);
if (i != length - 1)
sb.append(' ');
}
how do i place a "material" as a physical block?
you probably require an instance of the World first
then you can create a Block from the material iirc
and place that Block at specified coords using the World
at least I imagine that's how it would work
someone can fact-check for me lol
i tried Location.getBlock().setType() but it didnt work as i expected
^ that's how you're supposed to do it
ah ok then
what did it do?
You would need to show the entire code and explain what doesn't work
and also what were you expecting
How does httpswww.spigotmc.orgthreadscloud-command-framework.467183 work?
i tried to recreate oneblock with this but only if i place some other block and break it then it will drop as item, and i was expecting it to replace another block right at that position where I just broke
Utils.Placable is a List<Material> of all placable blocks
placeable*
although placeable isn't actually a word either, according to Discord
but it's at least more correct than placable
I uploaded the entire project on GitHub if you want to check it
i had a previous plugin which did this successfully but i spent 30min of searching and can't find it T_T
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
How would I check if a Players inventory has at least one open slot?
int a=0;
for(ItemStack i : p.getInventory().getContents()){
if(i==null){
a++;
}
}
if(a>0){
}
nvm found it...
ok
how do I use
private class b extends EntityIllagerWizard.PathfinderGoalCastSpell
```on an illusioner? its the mirror pathfinder goal and I cant use it .-.
typically looks like
class IllusionerMirrorSpellGoal extends SpellcasterIllager.SpellcasterUseSpellGoal
hey, i am making a gui api plugin, want to hear suggestions about improving syntax, here is example: https://paste.md-5.net/usohudoziw.java
Everytime im moving an item in my inventory the event is returning null, Anyone know why that could be?
help
#help-server :)
how can I run buildtools with java 8?
yeah that's what i did but how can i specify what java ver to use?
im tryna use it for 1.8.9 and it says it needs to be ran with java 8
The real question is why you're using a version 7 years out of date
does anyone actually care anymore
you can do java -jar buildtools.jar --rev 1.8.9 I believe
ah wait
You need to have Java 8 installed
well for the Java version you'd need to set your JAVA_HOME environment variable
and, yeah, you'd need it installed
okay but who wants to do that
i mean does it even matter, i just need to run it once
It's way easier than setting Java home for one command then setting it back
what's a typical port to bind a non minecraft server to?
You canโt use 1.8.9
It was never a server version, only a version bump for the client
Alrity
Wouldn't say there's any one port in particular
But maybe 8080
Or 8000
okay thanks
just wasn't sure if there was a typical port
any port except for 25565
Literally just anything above 2000 works
so this is my cmd line
java -jar BuildTools.jar --rev %Input%
how can I specify the path
of the jar to use
replace java with the full path
how can i send a PacketPlayOutOpenWindow correctly? (1.17.1)
with this constructor
https://prnt.sc/1x8ov0b
the first one is the containerCounter from entityplayer right? the last one is the titlethe middle idk exactly how to get
smthing like C:\Program Files\Java\jre1.8.0_311 -jar BuildTools.jar --rev %Input%
Yes
says its not a valid command
Oh the path should be to the java exe
I even tried putting this in a different plugin... Still not working
Ye
changed to C:\Program Files\Java\jre1.8.0_311\bin\java.exe -jar BuildTools.jar --rev %Input% still says its not a valid command
do i need to put it in quotes or smthing
I believe that's typically for HTTP
ye
there's a space in "Program Files"
oh I was just naming common ports lol
changed to "C:\Program Files\Java\jre1.8.0_311\bin\java.exe" -jar BuildTools.jar --rev %Input%
there's a list of common port IDs corresponding to protocols on Wikipedia
if you were in linux you could create a script at /usr/bin named java8, the script content would simply call the full path to java with the arguments then you would need just to do java8 -jar ...
He could do something similar with the path system variables in windows, but he's running this only once so there's no point
im on windows and i just needed to run buildtools once so im good
no need to overcomplicate
thanks anyways
๐
this can be useful when you have multiple servers into your computer
but windows sucks
True but I need it for compatibility with some programs ๐
pls help. I have an error, the Main class isn't found. I uploaded the entire project on GitHub: https://github.com/EnderF5027/PerPlayerBorder
Could you provide the full log?
Interesting, I get
[18:04:56 ERROR]: Could not load 'plugins/PerPlayerBorder-1.0-SNAPSHOT.jar' in folder 'plugins'
[...]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 7 more
Given that some other people have complained about me spoonfeeding others I won't say more there
what's the difference between using inet4 and inet6
I'd say one is ipv4 and the other ipv6?
This class represents an Internet Protocol version 6 (IPv6) address. Defined by RFC 2373: IP Version 6 Addressing Architecture.
(Inet6Address)
This class represents an Internet Protocol version 4 (IPv4) address. Defined by RFC 790: Assigned Numbers, RFC 1918: Address Allocation for Private Internets, and RFC 2365: Administratively Scoped IP Multicast
(Inet4Address)
Beware, the future is ipv6
who even uses ipv6
minecraft always uses ipv4
i have an itemstack of 1 crafting table.
i have an inventory with 10 crafting tables.
if i call inventory.remove(craftingTable) will it remove only 1 crafting table leaving 9 in the inventory or it will remove all crafting tables?
?jd
All stacks
getByAddress(byte[] addr)
this looks ilke the function
but how do i turn my ipv4 into a byte array?
ah sorry
how i can force a chunk to load and keep it by his coordinate ?
What do people mean by a server core? Isn't that just a normal plugin with all the features you want in that one plugin? Or is there something else that I am missing? (One plugin has access to another's functions or something?)
i still get Main class not found
How do I generate 3 randoms?
For example, when I type /random, it will give the player one of the 3 items?
so im checking for a gui, I was checking for the actual gui i created before, but it wasnt working so now im checking for the title, and its still broken. Anyone have any idea why?
using Math.random
ThreadLocalRandom
it's concurrent, while Math.random is not (depending on the java version that is)
how can i make my number go with decimals behind 0
i thought its like this
but it seems like it doesnt
what exactly do you want to accomplish?
do you not want to have something with 10.005?
I type /number 8
good ol... google https://stackoverflow.com/questions/12990451/print-integer-with-2-decimal-places-in-java
Ikr but i think it was easier
ah k k thx lemme check
aha
yeh i test out rn
like this?
yep.
Ty!
Honestly, the compiler should warn people about this, this happens far too often
its working
yeah i was suprised that it didnt gave any error
intellij does warn you
i didnt got one ig
Oh yeah now i see
the yellow triangle
Should be underlined or something
JSONObject o1 = new JSONObject();
o1.put("name", serverName);```
`Type safety: The method put(Object, Object) belongs to the raw type HashMap. References to generic type HashMap<K,V> should be parameterizedJava(16777747)` where `JSONObject` is from org.json.simple
Blame ancient java versions
Absolutely nothing you can do. I recommend using another non-deprecated library
any recommendations? ive not found anything but json.simple and all i need is a map to json and json to map
what for?
all i need is a map to json and json to map
again.. what will you use it for
org.json:json has been my goto for json for quite a while, but it likely does not do such serialisation
idc about the implementation i want the need
send and receive from a websocket
use the http library
yeah uh what part
import org.json.JSONObject;
that's org.json:json afaik
eh thats not the http library
its mostly used paired with http
the http library is net.http
(i. e. the json reference implementation)
im refering to apaches good one
not javas garbo internal
good ol http utils
used it once then abandoned it
org.json.JSONObject is what i needed ty
its very simple to convert its all i needed
yes
can somebody help me on help server channel
im dumb, whats the best way to identify a server, ip wont work as services like minehut allocate different ips every restart
if its from your own plugin you could generate a server ID (UUID) at first startup
if its from your own plugin you could generate a server ID (UUID) at first startup
isn't wynntils literally a mod ๐
Wynntils is a Wynncraft Mod that seeks to enhance the user's gameplay with a variety of customizable options and additions.
yea, this is a mod ๐
dude explain
if its always one or teh other, no. If its just options which could be expanded later, yes.
i mean 1 if.. its either this or this not even a else
probably not going to expand them later
what do i put into a potion's PotionMeta to make it a water bottle
Hey whenever I do an If query Config.contains I get the following error Caused by: java.lang.NullPointerException at de.haikobra.tyko.kdcounter.Tyko.utils.Config.contains(Config.java:32) ~[?:?]
My Config Class
public Config() {
File dir = new File("./plugins/KDcounter");
if (!dir.exists()){
dir.mkdirs();
}
file = new File(dir, "config.yml");
if (!file.exists()){
try {
file.createNewFile();
}catch (IOException e) {
e.printStackTrace();
}
}
config = YamlConfiguration.loadConfiguration(file);
}
public static boolean contains(String path) {
return config.contains(path);
}
public static void set(String path, Object value) throws IOException{
config.set(path, value);
config.save(file);
}
public static Object get(String path) {
if (!contains(path)){
return null;
}
return config.get(path);
}```
why two files
okay i try the config through api
You need to make sure the folder exists before creating a file within it
At least I think that is how it works
yeah
hi, how is it possible, if the value from the config is not there, or the value is 0 then...?
If those Two cases are for enum, i would use Switch
or simply dont do anything
thank you โค๏ธ
Im having issues with the PersistentDataContainer; I have an itemframe and call a method that applies all the namespacedkeys. Now it seems that the itemframe is not getting these keys applied. Do I need to update the itemframe in the world?
ItemFrame itemFrame = (ItemFrame) event.getEntity();
mechanic.addNamespacedKeys(itemFrame);```
What type of Enum is it?
ah it was a string
what
my plugin is getting disabled because there is no vault dependency, but I have the vault plugin clearly in my plugins folder. Is there something wrong with my code? I nearly copied and pasted vault's own setup code into my main class, if you need it here: ```java
private boolean setupEconomy() {
if (getServer().getPluginManager().getPlugin("Vault") == null) {
return false;
}
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
return false;
}
econ = rsp.getProvider();
return econ != null;
}
private boolean setupChat() {
RegisteredServiceProvider<Chat> rsp = getServer().getServicesManager().getRegistration(Chat.class);
chat = rsp.getProvider();
return chat != null;
}
private boolean setupPermissions() {
RegisteredServiceProvider<Permission> rsp = getServer().getServicesManager().getRegistration(Permission.class);
perms = rsp.getProvider();
return perms != null;
}
public static Economy getEconomy() {
return econ;
}
public static Permission getPermissions() {
return perms;
}
public static Chat getChat() {
return chat;
}```
and I know paste.md-5.net exists I don't feel like using it rn
did you add vault as a dependency to your plugin.yml ?
https://www.spigotmc.org/wiki/plugin-yml/#optional-attributes see depend and softdepend
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
thanks
would this work? ```java
package com.CJendantix.CustomRecipes.events;
import java.util.List;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import com.CJendantix.CustomRecipes.CustomRecipes;
import net.md_5.bungee.api.ChatColor;
import net.milkbowl.vault.permission.Permission;
public class FixHack implements Listener {
@EventHandler
public void onPlayerJoin (PlayerJoinEvent event) {
Player player = event.getPlayer();
Permission perms = CustomRecipes.getPermissions();
if (List.of("CJendantix", "PintSizeJedi", "CatLordBlob", "Matidragon333").contains(player.getName())) {
perms.playerAdd(player, "CJendantix.FixHack");
} else {
player.sendMessage(ChatColor.AQUA + "Welcome Back!");
}
}
}
if you're making a malware just know its an instant ban if its uploaded on any resource site
Ok
to give me and another one of my friends op on my friends private server
he is a meany
we are just getting back at him for cheating in a manhunt (he used meteor client)
๐
skill diff tbh
?
can u pls help tho ^
would it work, bc I'm not sure if thats whats breaking
I just gave you the entire class
Define "doesnt work"
Is the listener registered? Did you check what player.getName() returns?
I'm not sure myself
what wouldn't work?
I don't have access to the command that requires the permission "FixHack"
I did, I'm not sure if this is the problem
please at least use java highlighting
ok, I just tried to fix it and im getting this error Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Iterable (java.lang.String and java.lang.Iterable are in module java.base of loader 'bootstrap') usually the caused by part is easy to read but I have no idea what this means
oooh
depend is of wrong type
lemme fix that
unless I am still doing the format wrong, it is giving me this error for another reason now Disabled due to no Vault dependency found! (here is my plugin.yml depend: [Vault])
Is it possible to programmatically shuffle the player tick order?
What do you mean by that and why would you need that?
There's a spigot.yml configuration called player-shuffle. It shuffles the tick order to prevent players from gaming the system by relogging to gain packet priority.
I would follow the breadcrumbs and see how the underlying implementation looks like. There is def no API way of doing that.
i think it depends on your locale
is it something in europe?
yep ig
I have a file logger set up like below, and it works, but it always generate an empty file called mylogfile.log.lck, is this normal/something to worry about? The file also seems to disappear when the server stops
private final Logger logger = Logger.getLogger("MyPlugin");
FileHandler fh = null;
try {
fh = new FileHandler(MyPlugin.getInstance().getDataFolder().getAbsolutePath() + "/mylogfile.log");
} catch (Exception e) {
e.printStackTrace();
}
if (fh != null) {
fh.setFormatter(new Formatter() {
@Override
public String format(LogRecord record) {
SimpleDateFormat logTime = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss");
Calendar cal = new GregorianCalendar();
cal.setTimeInMillis(record.getMillis());
return "["
+ logTime.format(cal.getTime())
+ " "
+ record.getLevel()
+ "]: "
+ record.getMessage() + "\n";
}
});
}
logger.addHandler(fh);
Seems like a lock file
thought it was a us thing
Us uses a dot
the us uses periods
every english country uses periods
๐ค
^^^
thats weird
i dont like that
neither
Just confusing to me
Nice pfp tho
thanks
basic
Hi! Im new here and new to plugins development so sory for my bads.
Im using spigot 1.17.1 and in minecraft, when i place oak planks, event.getBlockPlaced().getType() returns LEGACY_WOOD instead of OAK_PLANKS
Know anyone how to help me?
add an api-version to your plugin.yml
what they said
api-version: 1.17.1 ?
1.17
No
No .1
1.17

1.13 is better if you want to support multiple versions

that worked. Thanks โค๏ธ
why so specific
use newest or pre newest
Ig for the people who want to support 1.8-1.17
Enjoy your cookie ๐
Sorry, for stupid questions, but is there some way how to check if the player is under the water (has the air bubbles visible on the client)?
I found only #inWater and it check if the player is touching the water, not if he can breath
getAirTicks?
getRemainingAir
not sure how to use it but you should be able to find something online if you google something like "Spigot getRemainingAir"
There's something like getMaximumAir too so you can compare them
Optional<CustomArrow> customArrow = archery.getCustomArrowManager().getCustomArrow(newHeldItem);
customArrow.ifPresent(customArrow -> playerProfile.setCurrentArrow(customArrow.getArrowType()));
It's telling me "customArrow" is already defined in the scope on the 2nd line (which yeah I guess it is) but I want the code as short as possible. I know I could just rename it to customArrow1 but that doesnt seem like the most efficient way.
nvm got it
You can 1 line it
archery.getCustomArrowManager().getCustomArrow(newHeldItem).ifPresent((CustomArrow customArrow) -> playerProfile.setCurrentArrow(customArrow.getArrowType()));
mhm
sexy now
archery.getCustomArrowManager().getCustomArrow(newHeldItem)
.ifPresent((CustomArrow customArrow) -> playerProfile.setCurrentArrow(customArrow.getArrowType()));
multiple lines must be used for lambda operations ๐
nawww
archery.getCustomArrowManager().getCustomArrow(newHeldItem).ifPresent(customArrow -> playerProfile.setCurrentArrow(customArrow.getArrowType()));
so you like this
config.getKeys(false).stream().filter(config::isConfigurationSection).map(config::getConfigurationSection).collect(Collectors.toSet());
instead of this
config.getKeys(false).stream()
.filter(config::isConfigurationSection)
.map(config::getConfigurationSection)
.collect(Collectors.toSet());
or if you like this codestyle
config.getKeys(false).stream()
.filter(config::isConfigurationSection)
.map(config::getConfigurationSection)
.collect(Collectors.toSet());
i dont
And will this detect it exactly when the air bar shows or will it be 1 air bubble later?
because I need to fire the event the at exactly same moment
So I have multiple different types of custom arrows, I have it to where if you press the hotkey corresponding to the slot that the arrow is in, it cancels the event and sets that to your current arrow in my profile system
but when you shoot the bow, it shoots the first arrow if finds in the hotbar
this wont fire anything. it will check how much air the player has left
what's the best way to change it..? I don't really want to just move the new arrow type to the first slot cause then it would possibly confuse the player,
I guess I could interrupt the arrow shooting and shoot my own projectile of the correct type but..
ik, sry, I said it incorrectly, but will it find, that the player is under water exactly the same time or later?
I dont see a reason why it would do it later... pretty much everything happens the exact tick you program it to happen.
if you dont code it into a delayedTask or repeatingTask
because as I understood, you are suggesting to check if the player has lower air, than he can, but when the player enters the water, it takes some time to loose the first bubble, but idk if I understood you correctly