#help-development
1 messages · Page 1086 of 1
hmm
probably, that sounds like the hard part
I would atleast write proof of concept so you know its gonna work
I'm pretty sure I've already got a gridding algo somewhere so the spacing wont be a bitch, still just need to figure how to use island size in a way that makes sense
I was thinking maybe like 1,2,3 relating to small, medium, big or something
Now that I think about it, I don't even have to worry about generation, I can just use WE for extra configurability / custom islands
Also thinking this is gonna be skyblock / rpg core
you should do it on the connection as well as the statement
you are not doing it on the connection right there
Yeah I believe that's fine
Yeah perfectly fine
hi spigot gang, i am trying to find the entity that is holding the leash of a boat in the EntityUnleashEvent but i'm having trouble because boats arent LivingEntities and regular entities dont have a getLeashHolder method. can anyone help me?
hello, what is the event or listener that detects when a fish bites? I'm trying to make a plugin that activates a bell, if held in the offhand, when a fish bites.
PlayerFishEvent.
you can always have it in a method from another class but its best practice to keep them all aggregated in one spot
If your list is long enough, a separate class isn't frowned upon
also a var args methods makes it look a lil cleaner
Yeah that works
It's more so, do you genuienly have enough listeners to warrent registering them in their own class
/**
* Register new item handler.
* @param handlers
*/
public void registerHandler(AbstractItem... handlers){
for(AbstractItem handler : handlers){
this.registerHandler(handler);
}
}
then you can just do
registerHandler(
new Listener1(this),
new Listener2(this),
new Listener3(this),
new Listener4(this),
new Listener5(this),
);
just a little less boilerplate-y
they should have a common manager in that case
listeners shouldn't really be depending on eachother, doesn't follow SRP
just a class that both depend on, which the shared variables are stored in
rather then them accessing eachother
Manager holds whatever you need it to, then listeners just depend on the manager
that also adds modularity, such that you can swap the listeners out whenever you want without having to rewrite all the dependency code
it's more OOP
I mean something like this works fine
The design of the manager just depends on what sort of data you're managing
Basically, it's more so a manager of the data not a data class in itself I'd say
Data class for example:
Manager:
The data class is an entire object by itself, the manager is just going to delegate what you're allowed to do with this data
Yes
The manager class should only ever have on instance
(imo) I feel there could be some niche cases otherwise but for the most part
Sure!
@blissful crow would you consider yourself a creative thinker?
I need some ideas of how to make a cross between skyblock and rpg play well
Think like final fantasy, elden ring, etc
In sql I have primary key at first indexation
I dont have to give value when I insert something into the table?
because I am getting an error java.sql.SQLException: No value specified for parameter 1 (its primary key at 1)
I was thinking mainly the eco as most is afk economy, I wanted to strive for something different, perhaps with a bit of it sprinkled on top but different in some way, things like island values and levels were going to be determined by placed custom blocks, player / member levels, island level, etc
String t = "INSERT INTO Accounts (UUID, Name)
maybe I should put key at first
euh
yes
My idea with the value of the island goes a bit into like places explored for example, loot brought back (being the custom blocks you'd place on your island), level advancements of yourself and island members
mysql
Perhaps in the sense of afk eco, some of the acquirable loot could be spawners or something
(sorry delor for clogging the chat haha)
No worries lol
Basically just spawner driven economy
As you can afk them, make the afk farms, sell for money later
A lot are automatic nowadays but yeah
so you literally just need an account to render the spawners
That's why I'm trying to strive for something different
Could be like a wow vibe and just make people grind for money and that be the only way to get money kek
It kinda depends imo
At work I tend to bundle mine by features
General listeners go into main but each manager / tracker registers its own cleanup listener
can I get some help with this?
Main objective being I can delete a whole folder and I only need to remove like 1 line from main
Places explored wasn't exactly supposed to be in there sorry, that would count towards like player levels
eh this can be better segretated but you're starting to get there
I wouldn't hold a hard ref to the world because memo leaks though
Pretty much, that's a viable option
It really depends on how your project scales
Level and score is prone to be moved to a separate data class, as for the world still playing with it and seeing where I can fit in some gridding logic for island placements
player tracking could do with its own class
Which tracks player metadata (their island home / role / wtv) and invites
I tend to make invites its own dedicated service because uh
they can expire and you don't want to load all the island data to reject an invite type deal
Yeah that makes sense
I think I could keep the island home with the island class though, this is more a global location for all members
haha no worries
is RayTraceResult#getHitPosition() in world coordinates or relative coordinates to the hit target
thanks, I could just make it relative by subtracting the target's location then
if your targeting entity dont forget to remove player else you allways get player entity
thanks you just saved me a while 😭
huge brain
I too spent a day to understand what I allways got myslef 🥲
I advise you to use raytrace from world object (not player object)
and dont forget to set player eyes location (not player location)
yep yep
Guys I have a question
There is a purple particle effect in Minecraft, what is its name?
Shaped like this purple snowflake
either enderman or just colored dust
I can't upload videos
I recorded it on video
either verify or share a gyazo / streamable link
Oh ok 1m
@echo basalt heree sirr
Yep
Now, I know there is a ender portal particle effect
But it's like something else
I don't think so, firework is like red black flame
how would i be able to get the leash holder entity from a leashed boat? (using entityunleashevent)
i dont think i can cast it as a living entity
Just Particle#WITCH
hey i am trying to make it work like i want to use my itemmeta and itemStack in my event handler how i do that?
ok i got it
i had to do getCustomModelData == 125
anyone know a good lib/database of banneds words ?
Csv without comma lol
what a window licker!
how to make sure that player is doing right click or if player is doing shift right click in playerinterect entity event?
check if player is sneaking
I thought there was a getAction method
what about right clicking
you can get action for that, from the event
ohh yes
get the action + player#isSneaking or something
Incorrect^
getAction is in event iirc
ohk
mine is playerinterectentity event
Sould be the same code
and e.getAction is not available ig
declaration: package: org.bukkit.event.player, class: PlayerInteractEvent
It is
cltr plus space shows no suggestions
what api version
getAction**()**
1.20
you forgot the brackets
i want to make it work for both 1.20 and 1.21
still same
Oh theres no getAction in interactEntityEvent, there is however a getRightClicked method
declaration: package: org.bukkit.event.player, class: PlayerInteractEntityEvent
ok
dev who write this file have a big imagination
guys
I made an effect, imagine a block and there is an effect around the block
It saves these in config
And when I use the delete blog command, it deletes all the settings for that block from the config.
But the effect does not go away, when I hit /reload the effect is deleted.
I tried reloading the config but it didn't work. Is there another way?
Any good free software for coding plugins, i used intelij but my trial ended.?
how do you remove name of an item, i tried setting it to null it did not do anything
IntelliJ community should work
i used intelij but my trial ended.?
IntelliJ Community is free
pretty sure u used IntelliJ Ultimate
Hm, ill try now. should i deinstall ultimate verisoN?
yes
Alright, thanks.
is it possible to fetch TrialSpawner mob type?
i tried fetching, i was able to get mob spawner's type but not trial spawner's
anyone?
probably get asked this alot but where can i download the spigot 1.21 api?
i mean to put the spigot api into my plugin so i can impliment things instead of wrighting it all out
the project is already using maven
What?
is there a place i can get the spigot api?
The maven repo
What do you even mean by this
sorry im confusing myself
I’m watching a little tutorial to ease my way into making plugin
And they hover over some of the text and it pops up with a option to “implement method”
How would I do this?
What piece of text?
Can u add me so I can dm it to you?
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
I did that. Look in the channel. But it hasn’t given me the verified role.
Read the second bit of that message
Well, they're declaring a class that implements CommandExecutor of which you need to implement a method as it's abstract
Yea but how do I get what’s in the photo to pop up? Because I’m the tutorial i amwatching when he presses “implement method” in the blue text it does it for him
anyone know a good database library?
for example :
https://github.com/pigaut/SQLib
but i get an error cannot access io.github.pigaut.lib.sql.DataTable :L
You create a class which implements CommandExecutor
. And is there a place I could install the spigot api???
Alr 👍🏼
do you get error during runtime? maybe you need to include that dependency into the uber jar
Anyone knows how math expansion functions?. I want to use for formatting the playtime in 2 decimals eg. 2.20 hours
Maven
it says i should use %math_<math expression>% and I made it like this
%math_{time_played}%
and didn't work
i fixed it but now i get another bug
We dont have any other plugin for custom item I'm just making it for video then i will delete or maybe modify code and publish to the site
Hey guys, is it possible to develop custom weapons RPG style with stats and boss creatures without modding the client?
yes look at hypixel skyblock
Ok any sources for how to get started with this?
I want to add misc. mini bosses in the world.
Its not easy to do it but its possible
Sorry i dont have sources which can help you
Have you done or tried it?
There are just too many gears which have to perfectly allign with the rest of the gears
So your best bett would be to try to code it yourself
Yes my system is kinda working 70%-80%
I thought you wanted to copy paste code together
I don't know why you thought that 😮
I've "reverse engineered" world of warcrafts item generator for another project of mine and I want to integrate it into my minecraft server.
Then ig i would start with making an item loader which applys lore and other data to the item
I have put my stats in the nbt
I plan to add some RPG elements incl. custom mini bosses. But I only want to do this if I can modify items and create custom NPCs without forcing client modding.
So what I am asking is: is it possible to do this without editing the client?
I would say yes but this ofc depends on what exacly you want to implement
@paper viper where should I start looking into how to do this? How does it work adding new NPCs and sending model data etc. without client modifications?
how to apply attributes directly to the player?
Player#getAttribute(x)
is there a way to get all loot tables of a world
LootTables has only the vanilla ones but I would also like to access any potential custom ones made by things like terralith
There is existing NPC libraries / APIs that you can use.
You will however not be able to alter their "model" really, but rather their skin or what type of entity they are I guess.
You could do hacky workarounds with Item / Block Displays, but yeah.
Modifying items is another topic - again, you won't be able to just "add" a new item, but you can change textures of existing items through resource packs while also giving them new "functions" depending on what data you hide in them, however a player can choose to download the resource pack on server connect or not.
Have you imported the WorldGuard dependency / API into your plugin?
how
Literally the first link
It also explains how to work with regions on that website
where do i find my gradlew.build? or like do i even have one>
Are you even using Gradle or Maven?
how do i see again? 😭
Are you building your plugins dependencies by yourself (adding each external .jar into your plugin yourself) or are you using a configured build tool that resolves your dependencies?
You would know if you do ...
im adding each external jar like worldguard or fawe or luckperms into my server
i use maven
i was dumb
Then don't use the explanation for Gradle on that website, but the one for Maven - the pom.xml code is right there on the site.
k
i got this
region.setFlag(Flags.USE, StateFlag.State.ALLOW);
but whats the statefklag
or like how do iset the build flag
region.setFlag(Flags.BUILD, true); like this
?
and where do i set the region where i set the flag?
got it
and why dpes this not work
should everything database-related be async?
what about stuff that aren't done that often? such as banning / unbanning to avoid concurrency issues (i'm not sure if databases support concurrency)
alr
Not only database-related stuff for that matter - everything that requires an "answer" or basically "leaves" your server, should be async.
public ModerationManager(DatabaseManager databaseManager, TurboModeration instance) {
this.databaseManager = databaseManager;
this.instance = instance;
this.hasLoaded = false;
this.punishments = new HashSet<>();
instance.runAsync(() -> {
punishments = databaseManager.getPunishments();
this.refreshPunishments();
this.hasLoaded = true;
System.out.println("test");
});
}
public void save(boolean close, boolean async) {
if (!hasLoaded) {
instance.getLogger().log(Level.SEVERE, "Tried to save punishments before loading.");
return;
}
hasLoaded is always false for some reason (it's printing test)
nvm
My server is always crashing with tps on 20.0 and then when it crashes the command simply stops (thread stopped) and then never comes back and the server simply crashes. How can I see the cause if the latest.log only shows the pending stuff from the thread that stopped?
my bad
Hello, is there a way to get the model data of a Block ? (I use the BlockPlaceEvent for any exteriors ways.) 1.21
Blocks have no model data
And there's no way of getting the ItemStack with the model data ?
You can get the ItemStack custom model data in the place event, but a Block has none
How ?
there is a getItem iirc
Not stupid ! But doesn't the block get removed in the player hand when he placed it ?
No
yes the Item is consumed when the player places it
And this method gives you the item before it get consumed?
yes
Okay thanks !
Any plugins that work like valheims monster attacks on base? how to code this?
how can I check which block the player is standing on?
Cuz this stuff is killing me
like why is this so hard
Get the Players (feet) location, subtract 1 from Y, get the block at that location.
Then check what type of block that is.
that isn't necessarily accurate
you can get air and still be supported by a solid block, e.g. if you're standing on the edge
That was the "simple" answer.
ah yes, because shifting over the edge doesn't exist
and this gives inaccurate results for whatever bullshit reason
something about supporting block or standing block
Because someone asking for how to check what block someone is standing one, clearly can understand NMS code?
(the barrier is here cuz it's for a special case for me)
I fail to see how one thing relates to the other
Whatever ... yes there is an NMS method
I also can't recall the name right now
yeah I can
like what the fuq are you on about?
yeah
Sorry, I usually first assume people have no clue when they ask questions like these on the forums / Discord
Especially when given no further information
is there any way I could make armorstands' nametags only visible at a short distance? Could I catch the nametag packets being sent and cancel them if the player is too far?
Actually, it would be even better if I could just make the nametags only visible if there is a direct line of sight, meaning they cant be seen through walls
I'm asking because for some bullshit reason
that is a fair assumption
this gives me that blocks on the same x/z
are not when I land after jump
which is restarded
I've been trying to solve this for like 3 days now
As Emily already said - there is no "simple" answer for that specific problem.
I gave the simple answer, because in 90% of the cases, that is enough for simple use-cases.
The only 100% accurate way of telling which block is supporting the player, you need the NMS method for it.
I can't find it
I'll go with the nuclear response: If one can't find it it does not exist
it does exist because some downstream fork has api for it :^)
(or, a pr to add such API)
does paper have api for it?
"Some downstream fork" would be yatopia
is this the one?
why when I try to move an object with shift-click the objects become invisible https://paste.md-5.net/zadefelacu.java
\
Not sure - is there another one?
I thought of reading the mainSupportingBlockPos var
ah yeah that's the one
okay, thanks
Besides the fact, that you never verify the clicked inventory to be of the type you want it to be and also cancelling ALL drag events for every inventory ever ...
If I remember correctly, cancelling InventoryEvents can cause weird and glitchy behaviour, like items going invisible.
@Override
public void onDrag(InventoryDragEvent event) {
event.setCancelled(true);
}
You are cancelling all drag events
what
how many inventories events exist to cancel them.
check the docs
as I recall, there's two drag, click.
bruh 💀
I thought two or three events at the most.
There are many inventories
any idea how to open the anvil without pushing it. i want have backend logic for virtual gui
Capture user input in Minecraft through an anvil GUI in under 20 lines of code - WesJD/AnvilGUI
how do i shorten the message shown the console?
@EventHandler(priority = EventPriority.HIGHEST)
public void onLogin(PlayerLoginEvent e) {
Player player = e.getPlayer();
ModerationManager manager = MyMainClass.getModerationManager();
Punishment.PunishmentType banType = Punishment.PunishmentType.BAN;
Punishment.PunishmentType ipBanType = Punishment.PunishmentType.BAN_IP;
if (manager.hasPunishment(player, banType)) {
Punishment punishment = manager.getPunishment(player, banType);
String text = manager.getPunishmentText(punishment);
e.setKickMessage(text);
e.setResult(PlayerLoginEvent.Result.KICK_OTHER);
} else if (manager.hasPunishment(player, ipBanType)) {
Punishment punishment = manager.getPunishment(player, ipBanType);
String text = manager.getPunishmentText(punishment);
e.setKickMessage(text);
e.setResult(PlayerLoginEvent.Result.KICK_OTHER);
}
}```
it's like 4 lines duplication only
i'm planning on cleaning it up
aw man
doesn't intellij do that already?
ah, it's an Ultimate feature
idk of any plugin, maybe
have you searched in the plugins marketplace?
wtf is up with BlockSpreadEvent? neither getSource() nor getBlock() return what they are supposed to. I am trying to handle mushroom spreading, but both these methods just return air blocks, never a mushroom block, even when mushrooms are spreading.
instance.runAsync(() -> {
punishments = databaseManager.getPunishments();
this.refreshPunishments();
});
public void refreshPunishments() {
punishments.stream()
.filter(Punishment::hasEnded)
.forEach(this::removePunishment);
}```
in a very specific case, this causes a ConcurrentModificationException
would making refreshPunishments ``public synchronized void``, as well as getPunishments fix it?
or would it do nothing since it's async
whats punishments
a set
the issue is that you are modifying the collection (punishments) while iterating through it (via the stream)
consider Collection#removeIf(Predicate)
what exactly does removePunishment do anyway
it removes the punishment from the set and the db
public void removePunishment(Punishment punishment) {
instance.runAsync(() -> databaseManager.deletePunishment(punishment.getId()));
punishments.remove(punishment);
}```
is there something like a concurrent hashset? like the concurrent hashmap
concurrency isn't exactly your issue, your issue is that you are modifying the set while iterating it
just do removeIf, pass a lambda, and call the db thing inside it as well
also, maybe consider doing a bulk removal on the db too
punishments.removeIf(punishment -> {
if (punishment.hasEnded()) {
databaseManager.deletePunishment(punishment.getId());
return true;
}
return false;
});
```?
yeah, or if you go with the bulk db removal option as well, it'd look something like
var stalePunishments = punishments.stream().filter(...).toList();
punishments.removeAll(stalePunishments);
databaseManager.deletePunishments(stalePunishments);
alr
wait is there a sql statement to bulk delete or will i have to use PreparedStatement#executeBatch
should i do it
lmao where are you getting that from
no
oh god HashSet doesn't implement removeAll
do that, yeah
ok
@Language("SQL")
How to create nps with nms?
oh yeah the language annotation is a thing
I have a ladder, how do I check the block that supports said ladder?
Hello
loop getRelative(BLOCKFACE_DOWN) until its no longer a ladder
Can someone help me with the BattleLevels plugin?
i didnt mean like that
the solid block it is holding it
the block that if i break it the ladder explodes too
wtf how is removeAll hard to do, just make a new empty set xD
Ladder data is Directional so Block#getRelative(Ladder#getFacing())
may have to invert the facing. tas
don't ping staff asking for plugin help
tried doing that for about half an hour for no luck, maybe the list i have a hand doesn't have ladders...
https://paste.md-5.net/ehatuqobam.java
I got a suggestion from illusion, he makes invites an individual service and I just wanted to get some notes on this
ideally use #1100941063058894868 i guess
well sure but I'm not really looking for what you'd call a review I just want to know if it makes sense to follow illusion's idea
why is it a map of invites? for faster lookup?
mainly, I hate lookups on anything but maps kek
It's also what I feel to be more OOP oriented
the invitee is the one getting the invite?
Yes
UUID of island owner can be derived from any member of said island btw so this is not an issue
It just may be confusing as the "owner" may not always be the one inviting
I'll be sure to doc it
wdym
the one sending the invite needs to be able to invite people to some island right?
like the other way around would be a request
Right, but in the naming convention this always makes it sound like the owner of the island is the inviter
Which is not always true
right because thats what you named it xD
then it should be called inviter
and invitee 😛
I dont think its that useful to store the invitee in the invite though
It's easier (imo) to just hold a ref to the island owner since I can already derive this from any member of the island
as its already in the map
Sender/Receiver
why not hold a ref to the island
Hmm
the invite is made by someone who wants to join an island
wrong
anyone co-owning the island I think should be able to accept it
the otehr way round I mean
but if you were co owning an island, I might wanna see if your invite someone
same thing
like justhaving the invite take the island itself might be easier
then you can easily get anyone you want
Yk what's really confusing in this impl kek
The fact that I map a uuid to a uuid right?
But the keyed uuid and value uuid are always the same
alguien me ayuda
wdym
And this is because easier lookups through a map than like a set or list kek
con el plugin BattleLevels?
yeah thats what I was saying before
thats why I asked if you were using a map for lookup
because a list is good enough
or just not store the invitee in the invite
I think the invitee has to be stored in the invite?
to get an invite's invitee, you would have to get the invite first
which would require you to get the invitee's uuid anyways
like how do you get a specific invite without a invitee uuid
short of looping through all invites
which isnt what you want for a map anyways
and also shouldnt it be a Map<UUID, List<Invite>>?
like what if 2 islands invite you near the same time
or a queue I guess
depending on your implementation
so probably just a collection
So the only issue with this is I'm holding members/banned members in a set which is not the best for lookups kek, rather I only get to verify that someone is actually an island member
I mean whats the point
how many people are gonna be a member
100?
i dont think so
yeah but its not gonna be
I don't really know a better way to hold this data though
yeah that was gonna be my next question
how else would you store it haha
in a list?
surely thats a faster lookup
🙂
I mean still the lookups are painful, I have to search by index position with a list
I feel a set achieves it's purpose, just had an idea though, perhaps mapping members to roles within the island
Like you said, this isn't really going to happen, whos gonna allow more than like 10 members per island?
what kinda roles
that would just make the lookup more annoying depending on how you wanna use it
like counting all members of an island at any time will be a pain
since now you are looping through like 4 lists instead of 1
or well count maybe not
I'm just gonna stick with a set then
but you get the point
I don't really need to get a member from an island tbf, I can workaround this with their roles
just keep in mind that adding more ways to get your members might make it harder to maintain
Well that's kind of my point
I don't think I'll ever need to get a specific member as it were, just verify what roles they have to permit wtv
how do people test ip bans and stuff like that? localhost won't work for that
Just make a unit test
And supply fake addresses
But IP banning is beyond idiotic
There are scenarios where its useful but for minecraft unless you're being botted off 1 IP it's kinda pointless
cries in hypixel ip ban
in a world of NATs, CGNATs and IPv6, IP bans is pretty pointless
Hypixel gonna start handing out hwid bans
and banning a range will result in banning an isp or something
how would hypixel have access to hardware id?
Also you have to think about how dynamic ips work what if a person gets a banned ip who isn't cheating
You're now punishing an innocent person for something they have no control over
worst case scenario banning an IPv4 will result in a whole load of people being banned given CGNAT for IPv4 are very common since IPv4 is scarce
i remember one day i couldn't join spigot from my phone data
although that depends on the ISP
i think it was stopped by cloudflare? not sure
Yeah its annoying to have to restart your device
Yeah it's cloudflare
ip bans aren't worth it
if minecraft handled hardware ids to the server that would be great
but someone could patch in fake ids and get away with it
Account bans are best even though those aren't full proof either
How does persistence of player uuids work? I thought this was the "common" way to be banning people
well, premium + ban would be costly in long time
Yeah idk how the cracking scene is post Microsoft
me neither
Used to be easy to get 500 or 600 accounts
I've seen people with like 50kb txt files filled with accounts kek
jeez, how do they get so many?
You could buy used accounts for pretty cheap
4 or 5 cents per account prey sure
not sure if that's still the case post migration
i wonder when the accounts that didn't migrate will get the purge
would be so nice to get my username
They already did I think
Maybe the usernames haven't been freed tho
Non full access is up to over 2 dollars per from my sources
haha, happens the same to me lmao. I used to had a premium account which i could not migrate it and i still cant buy one, one of reason is caused because they dont accept Paypal (dont ask why the fuck they dont do) and second, because of exactly that username is still registered
old minecraft api used to have bugs to fake paying and most used to take that approach, there were the get thosens of accounts
lots of places don;t accept Paypal due to a dodgy history
dodgy? what means that sorry, im not native
underhanded
sketchy
possibly criminal
oh okay, so you mean they dont accept it. because of they owner? or because of bad security. I cant catch it
What is your native language
ambiguous, cryptic, deceptive, deviant, dishonest, unreliable, unsafe, untrustworthy
oh okay, now all take sense - Thanks
spanish haha, totally different. We write things really really different
Indigno de confianza Is the main point
oh right, thanks man . I appretiate trying to explain
Google said that translated to untrustworthy so crossing my fingers lol
yeah i conclude the same that some things from paypal dont really close to me. Starting from the closing of accounts with money and having to do many legals things to get the moeny back. It has is reasons but its weird...
I have a Paypal and have had it for many years. Funds going in and out. One day when I had a decent amount in the account they locked it
typical paypal
I keep 0.19$ in my paypal account... it's not even accepted
I had to jump through so many hoops of faxing photographs of my drivers license and other bits to get teh account unlocked
They would also ONLY accept a Fax, no email or anything else
yep, what i have seen in many times. All tells me the same when you get ahigh number they close the acccount and you have to get your money via legal way, because just dont cooperate
I only ever use paypal as the middle man, don't ever keep any funds in there
i have $11 in paypal and that's more than i'd like to have there 💀
yeah, i do the same. Just have a low balance to not be all time charging from the card, because the comission is too high
also what is too weird from paypal, is that. If you log into your account right? Let say you wanna change your account email due to a steal, you have to best. Because if you do change it fist account is losted, because they dont verify the actual email before the allow to change it
Same
It's nice to beable to dispute charges easily and still use my bank account if something were to happen
Even thoguth here should be more services like these, but they should work both digitally and physically. Because for the backend issue to implement payment methods through pos terminals (where you pay physically with a card), you have to see which provider they use and figure out how to implement it, not that there is an api.
I think cashapp does this, but not everywhere has cashapp
yeah, i wish if could be something like a standar api, which all pos terminals or banks use it, so we all can implement the methods to our software. Because if not you have to do really dirty, typing each pos terminal paying manully to the software
And then one software update takes down the whole world again
Does anyone know why this listener doesnt seem to work? ```kotlin
@EventHandler
fun onPrepareItemEnchantEvent(event: PrepareItemEnchantEvent) {
if (event.item.type != Material.FIREWORK_ROCKET)
return
println("\nitem is firework")
event.offers[0] = EnchantmentOffer(Enchantment.ARROW_INFINITE, 1, 5)
println("post set offer")
}
I expected this to offer the player the infinity enchantment in the list of enchantments, but nothing appears despite both messages being logged to console:
I also tried just iterating over every offer in the event.offers array and setting them all to the same infinity enchantmentOffer, but to no avail
maybe event.offers return copy offers
I dont think this is the case, the javadocs for PrepareItemEnchantmentEvent#getOffers() says: ```
Get a list of available EnchantmentOffer for the player. You can modify the values to change the available offers for the player. An offer may be null, if there isn't a enchantment offer at a specific slot. There are 3 slots in the enchantment table available to modify
Returns: list of available enchantment offers
maybe you need update inventory?
change offers and log all offers to check is it changed
How do you mean
try to get view and set changed offer array
declaration: package: org.bukkit.inventory.view, interface: EnchantmentView
Is it worked?
Give me a moment. Im making a plugin for a survival server for a few friends of mine but the server is still on 1.20.4
Im seeing if the server can be updated to 1.21 before I check if that works, since that doesnt seem to exist in 1.20.4
this event not available on 1.20.3
there is docs only for 1.20.3 and 1.21, not 1.20.4 or 1.20.5
I think enchantment view is exist in 1.20.4
that is why you have to make your own
using stuff that isn't within the users control
The logs get printed on my 1.20.4 server
The org.bukkit.inventory.view package doesn't exist
?paste
Error:
https://paste.md-5.net/eqosibitiz.sql
Where the error is:
public <E extends Event> void registerEventHandler(Class<E> eventClass, EventHandlerFunction<E> handler) {
EventListener<E> listener = new EventListener<>(eventClass, handler); // line 30
plugin.getServer().getPluginManager().registerEvents(listener, plugin);
eventHandlers.put(eventClass, handler);
}
EventHandlerFunction:
@FunctionalInterface
public interface EventHandlerFunction<E extends Event> {
void handle(E event);
}
Can someone help, I dont understand this error at all
You cannot listen directly to the Event class
Why do you want to do that
This is what I am trying to do
eventAPI.registerEventHandler(PlayerSwapHandItemsEvent.class, event -> {
if (event.getMainHandItem() == null)
return;
if (event.getMainHandItem().equals(craftingAPI.getReinforcedShield())) {
event.setCancelled(true);
event.getPlayer().sendMessage(ChatColor.translateAlternateColorCodes('&', "&a&lALERT » &7You cannot hold this item in your other hand!"));
}
});
I don't think I'm listening directly to the Event class
I have an idea what the issue could be
@FunctionalInterface
public interface EventHandlerFunction<E extends Event> {
static HandlerList getHandlerList() {
return null;
}
void handle(E event);
}
If I did this would it be fine
no
Ok
use registerEvent instead of registerEvents
olivo how to calm down kek
Yeah let me try that
I want to reach through my monitor and choke the life out of the chargeback guy D:
Btw I also have this
public <E extends Event> EventHandlerFunction<E> getEventHandler(Class<E> eventClass) {
return (EventHandlerFunction<E>) eventHandlers.get(eventClass);
}
Its unused atm
Wowow
hi, HumanEntity#getOpenInventory is returning a craft inventory view, even when a furnace or cartography table is open
is this correct
How would I do that if my EventHandlerFunction is an interface
i thought it would only give a craft inventory view if the player was in a crafting table or had no inventory open
wait
im stupid
my bad
this is what I get for just printing objects
craft as in craftbukkit 🤦
I'm upset!
Ok I've tried something I'll let u know if its works Olivo
hello upset, im shurikennen
yep
How are we doing today?
No errors in console, who know if it will work though, let me check
you'd need to make an impl for EventExecutor that will call the listener and pass that to the registerEvent method
yeah thats what ive tried doing, im testing it rq
Yeah I need to redo my implementation it didnt work
Is there a way to differentiate between inventories besides name or checking the items like and id or sum?
Awesome it worked
My impl is kinda scuffed
public <E extends Event> void registerEventHandler(Class<E> eventClass, EventHandlerFunction<E> handler) {
EventExecutor executor = new EventFunctionExecutor<>(eventClass, handler);
Listener dummyListener = new Listener() {};
plugin.getServer().getPluginManager().registerEvent(
eventClass,
dummyListener,
EventPriority.NORMAL,
executor,
plugin
);
}
I think using equals() on them?
But - it works 🙂
I meant like not furnace/chest/hopper inventories like chest inventories but instead of checking their name is there like a way to set a id or sum? not really important just curious as it could be a little useful though not really needed
Depending on what u do, u may wanna compare them w equals(), or just ==, or maybe InventoryHolders
:^)
alr
ty
equals
InventoryHolders wouldn't be bad if we didn't snapshot them
If I wanted to have some sort of custom durability that I can reduce whenever on items for example without durability, would this be fine to store the durability, if so, how would I go about changing it?
itemMeta.getPersistentDataContainer().set(new NamespacedKey(plugin, "durability"), PersistentDataType.INTEGER, 50);
Not sure how they’re used internally, but myea I mean if u use them for ur own sake u can always cache em
Ig its kind of api breaking to do that but eeeeeeeh
Or is there a different better way to hold custom durability data?
i would use a persistent data container
not really. I mean you can just add getHolder(bool) no?
and then calculate the percentage of your custom durability out of the max and apply that to the actual item's max
whenever it changes
doesn't cause issues unless you're implementing human entity Inventory or sum
Well that’s if you decide to implement Inventory as well
We were talking about InventoryHolders no?
yeah I just kinda mean you could probably implement a way for them to not be so bad
mye
Thanks for the idea
I'll probably look into it later into my Inventory PR stuff.
👍
Just wondering if PDC was the way and ig it is
I mean there is a lot of stuff surrounding inventories in general that need improvements I can just add it to the chopping block
yep that's how I did it in my plugin
and I believe its the common method
unfortunately there's no built in api for it
You do everything in one single pr or is it split up into smaller ones?
I had one big PR to kinda demo the changes it seemed like there was generally good reception so it was split up. I've already had a couple merges
This is currently being works on
MenuType
Ah okay, nice, ill look at that tomorrow, keep the good work up:)
next will probably be Menu Builders its an idea lynx was talking about in DMs, and I thought I'd mock something up
is there any bbcode or html code you can use in spigot posts to make a table?
Hello good, could someone tell me how I could configure to hide my servers to a port scan because with ip table I can only block all connections even between servers.
It might end up looking nice in the end
you can't
if you're worried about port scanning take yourself off of 25565
What would menu builders do?
well with the current proposal menu's are virtual only. So basically you can't tie them to the world
Builders would allow you to tie them to the world itself and add different data before you actually build it
so with a merchant menu you could do
MenuType.MERCHANT.builder()
.ofVillager(someEmptity)
MenuType.MERCHANT.builder()
.addRecipe(...)
MenuType.FURNACE.builder()
.atLocation(location)
this kinda stuff
then after that I have to completely rewrite the internals for creating inventories
which is a hugeee pain
lol thats not the first time
I'm thinking of doing it differently then last time though. I want to change the way inventories are thought of. In the end I think an API like.
final InventoryView view = MenuType.CHEST.builder()
.fromInventory(myInventory)
.build(player);
``` or
```java
final InventoryView view = MenuType.CHEST.from(inventory);
Would be the coolest.
If that's actually practical is a different question
How are custom huds typically displayed? Bossbar?
Action bar
Depends
If it's at the top of the screen, bossbar, if it's at the bottom, action bar, if it's in the center, a title
You use these since font ascents/shifts aren't relative to screen size
To make stuff relative like that, you need shaders
so I need to use shaders if I dont want it to look werid
Depends on what you’re trying to do
Minecraft ui scales at a constant so if you dont need screen relative stuff, you should need it
is == for material still acceptable or is .equals preferable
== is still acceptable
cool
hey what's the best way to pass the scheduler around
I don't really like passing the scheduler and the plugin around it just feels icky to me
and verbose
maybe ill make a wrapper that includes the plugin real quick
what is the issue with this import order?
Pretty sure it is meant to be alphabetical
Any imports added by a patch should be at the bottom tho, with a CraftBukkit comment
yeah i have those in there
This is one of the most OCD things I've ever seen kek
what the fuck
Haha imagine organizing imports
Project at work legit won't compile if imports aren't in a particular order
what the fuq
yes it's called style guides
For what purpose though
Keeping spacing consistent
And this is literally just for your imports?
if it's for everything it makes sense, I thought it was specifically to organize your imports or something
i keep posting in the wrong thread -.-
aw sick
my favorite
an 18 hour work day
huge pog
but don't worry I took a break to go to the gym for two hours, it was leg day
I think this is related to/the cause of my earlier issue
Is there some way to force enchantment table offers to appear on items that dont normally get enchantments?
I used this code in a PrepareItemEnchantEvent: ```kotlin
//if (event.item.type != Material.FIREWORK_ROCKET)
// return
//println("\nitem is firework")
Arrays.setAll(event.offers) { EnchantmentOffer(Enchantment.ARROW_INFINITE, 1, 1) }
If I put a bow in the enchantment table, all of the enchantment offers populate correctly and show the infinity enchantment
But if I put a firework in there, none of the enchantment offers appear. Is there something else that I need to do here?
is it safe to read data from pdcs asynchronously and if so is there any point or would the performance gains be negligible?
Spotless?
🔥
dont read it async
generally when we store last connexion date of a player, we define the date when the player join or when it leave?
Leave I would say
ctrl + alt + L go brr
I create a new file, 4 warnings
And the fact that that top bar thing from it just sometimes bugs out and duplicates and doesn't go away
annoying asf
Well you can modify both ktlint and checkstyle to your liking
why economy and placeholder showing in red even if it compiles plugin?
Try invalidating caches
top left -> files -> invalidate caches -> invalidate and restart
Why is there an getAttachedFace on the deprecated org.bukkit.material.Attachable MaterialData however there is no equivalent for the newer BlockData approach org.bukkit.block.data.Attachable?
Hey, I'm new to plugin development and I can't seem to figure out how to get the owner of a horse. I found out that a getOwner method exists on the Tameable interface, but I can't figure out how to access that interface. My current code just looks like this:
Entity mount = event.getMount();
if(mount.getType() == EntityType.HORSE)
{
Player owner = mount.
}
Is there an equivalen to that method? So i can use the blockdata instead
Youll need to cast the entity to Tameable to use the method
(Or a child class of it)
Would this work? org.bukkit.entity.Horse horse = (org.bukkit.entity.Horse)mount;
Yeah just check instanceof beforehand
All right thanks
when i tye /broadcast and then a message i get this in chat and not the message
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] args) {
Player p = (Player) commandSender;
String msg = "";
msg = msg + args;
Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', msg));
return true;
}
}
This is why Lists are better than arrays
better?
that will just take first arg
so i need to get all the values out of the array
That will only take args
String msg = ""; its empty, he just used it for concatenation
with caffeine at cache builder you can give a lambda to avoid the cache getting a value into sql for example when it dosnt have
With caffeine at cache build time, you can set a lambda to prevent the cache from obtaining a value in sql if the value is not present, example
cache.get(playerinfo) if the cache dont have it, if it dont have playerinfo it get it from db, anynone know if it use a completable future or something like this (callback) for that? or all are executed sync?
Who knows how to span an item frame. i tried many ways but ended up with errors
in 1.8
1.8 💀
public class InventoryListener implements Listener {
private final Main NeoWorldPlugin;
public InventoryListener(Main main) {
NeoWorldPlugin = main;
}
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
Inventory clickedInv = event.getInventory();
Player player = (Player) event.getWhoClicked();
if (clickedInv.getTitle().startsWith("§lInventaire de §b§l")) { // Command openinv
Player target = Bukkit.getPlayer(clickedInv.getTitle().replace("§lInventaire de §b§l", "").trim());
if (target != null) {
Inventory targetInv = target.getInventory();
for (int i = 0; i < targetInv.getSize(); i++) {
ItemStack item = clickedInv.getItem(i);
targetInv.setItem(i, item);
}
}
}
}
@EventHandler
public void onInventoryClose(InventoryCloseEvent event) {
Inventory closedInventory = event.getInventory();
Player player = (Player) event.getPlayer();
if (closedInventory.getTitle().startsWith("§lInventaire de §b§l")) {
Player target = Bukkit.getPlayer(closedInventory.getTitle().replace("§lInventaire de §b§l", "").trim());
if (target != null) {
Inventory targetInventory = target.getInventory();
for (int i = 0; i < closedInventory.getSize(); i++) {
ItemStack item = closedInventory.getItem(i);
targetInventory.setItem(i, item);
}
}
}
}
}
public class Openinv implements CommandExecutor {
private final Main NeoWorldPlugin;
public Openinv(Main main) {
NeoWorldPlugin = main;
}
@Override
public boolean onCommand(CommandSender commandSender, Command command, String s, String[] strings) {
if (commandSender instanceof Player) {
Player plr = (Player) commandSender;
if (strings.length == 0) {
plr.sendMessage("[" + ChatColor.RED + "NeoWorld" + ChatColor.WHITE + "] "
+ "Vous devez indiquer le nom du joueur !");
return false;
}
if (Bukkit.getPlayer(strings[0]) == null) {
plr.sendMessage("[" + ChatColor.RED + "NeoWorld" + ChatColor.WHITE + "] "
+ "Vous devez indiquer le nom d'un joueur actuellement connecté !");
return false;
}
Player target = Bukkit.getPlayer(strings[0]);
showInventory(plr, target);
}
return false;
}
private void showInventory(Player sender, Player target) {
Inventory inv = Bukkit.createInventory(null, 36, "§lInventaire de §b§l" + target.getDisplayName());
Inventory invTarget = target.getInventory();
for (int i = 0; i < invTarget.getSize(); i++) {
ItemStack item = invTarget.getItem(i);
inv.setItem(i, item);
}
sender.openInventory(inv);
}
}
I am trying to create a command to open the inventory of a player and update it, but I would like to every time you change something in the UI, it updates the player's inventory. In this case it works but only with the close event.
Doesnt caffeine provide built in async caching also
private final ItemFrame frame;
frame = (ItemFrame) location.getWorld().spawnEntity(location, EntityType.ITEM_FRAME);
frame.setFacingDirection(facing);
like so. do note the frame must have a block it can attach to. otherwise it will throw an error.
now that you mention it yes you have reason so it answer to my question
Uuuh, i didnt entirely get what u mean, but yea theres an async cache that wraps the values I think w CompletableFuture
probably
No I mean I’m saying its definitely a thing
But whether it suits u is another question
I love the AsyncLoadingCache. It absolutely forces you to write proper async code and the read-through cache loading is quite clean.
just in LoadingCache so there are not completable future I dedecute?
using completable future in event will generate errors?
hi, is it possible to somehow give the player a freezing effect? which appears when entering loose snow
Player#setFreezeTime or sth like that
thx
i added the dependencie in the pom.xml and plugin.yml (iu use maven) and it says there is nothing like this, in the code., i want to set the pvp flag in a region with myplugin
You have both in one dependency tag
You need to seperate them into their own
And you also need to replace VERSION with your target WorldGuard version
Did you reload the pom
how
The reload icon in the top right
this
yes
Yes
pressed it, does nothing
oh
wait
i think its working
works
thx
still wierd
You need worldguard core too
where how
what bukkit depend
in the pom file
Yea
Yea
now?
Reload maven again and see if it worked
Could always try invalidating caches
yea if i click reload it doesnt work and it still same in my code
Have you actually imported the classes?
And you're unable to import the other ones?
Hey guys, how can I fully disable durability on my server, I want nothing to take damage, is there a way to do this?
maybe there is like a tool change durablity event
and then cancel
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerItemDamageEvent.html look at this
declaration: package: org.bukkit.event.player, class: PlayerItemDamageEvent
Thanks!
np
this is on my onEnable function and i got another file and in there i wanna look at the state of the config, how do i do that and why does it doesnt reognice the config thing and if i want to import it it just doesnt show stuff from worldguard
and wahts wrong here
@chrome beacon
You don't have a variable called world
and no getConfig method in your commands class
I suggest taking a look at some Java tutorials before starting with Spigot
if the text is red in intellij idea, it always means that thing doesn't exist
either it's a variable or a method or a class (sometimes you just need to import the class)
how do i set a variable to a world
World world = ...
thx
what should i do with the getRegiob
Probably proxies I'd hazard a guess?
RegionManager doesn't have getRegion, look for another method similar to what you need
which one should i use for ip punishments?
getAddress would probably ip-ban the proxy
ok
But lemme look
setFlag was expecting the generics T and V
but i put the flag and true
Ah okay getAddress() is probably the one provided by the proxy - but could be spoofed by a malicious client (however that is performed).
Where as getRealAddress() is the ip address of the proxy
which isn't what it's expecting
is there a class called State?
where
just type "Sta" and look if intellij autocompletes for u
if there is a State class try State.ALLOW or State.ALLOWED
If someone know.
scroll down
Thnaks
oh lmfao
i guessed that
how possiblei s it to change the address in PlayerLoginEvent
why doesnt it find it? in the main on enable file it works?
you need an instance of the main class
also this is a crime
this is how to name varibales
but its for the toggle thing
name it toggle
wait so its not a problem if i got like a toggle variable in two files?
yeah
and also use some "private" in your variables
private String str = "This is private"
this means no other class can access it (or inheritors)
protected means only the classes in the same package can access it (or inheritors)
public means any class can access in
after these keywords you can add final or static or both
final means it can't be changed after getting declared
static means it belongs to the class, not the object
so public static String myStr = "Hello" can be accessed like this MyClass.myStr
if it wasn't static, i'd have to do new MyClass().myStr
🥺
public class InventoryListener implements Listener {
private final Main NeoWorldPlugin;
public InventoryListener(Main main) {
NeoWorldPlugin = main;
}
@EventHandler
public void onInventoryClose(InventoryCloseEvent event) {
Inventory closedInventory = event.getInventory();
Player player = (Player) event.getPlayer();
if (closedInventory.getTitle().startsWith("§lInventaire de §b§l")) {
Player target = Bukkit.getPlayer(closedInventory.getTitle().replace("§lInventaire de §b§l", "").trim());
if (target != null) {
Inventory targetInventory = target.getInventory();
for (int i = 0; i < closedInventory.getSize(); i++) {
ItemStack item = closedInventory.getItem(i);
targetInventory.setItem(i, item);
}
}
}
}
}
``` Hello, I would like to know how may I do this when I place an item in the inventory created with my command, to summarize I try to make a command that allows to open the inventory of a player and I would like to make sure that when I place an item in this inventory created which represents the inventory of the player, this updates the inventory of the targeted player.
player.openInventory(target.getInventory())
Oh bro... thank you did not know it was already in the API.
Don't detect inventories by their name
How else?
Keep track of the inventory instance
package fr.program.neoworld.Utils;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import java.util.Arrays;
public class SimpleCommand extends Command {
private final CommandExecutor executor;
public SimpleCommand(String name, String description, CommandExecutor executor, String permision, String... aliases) {
super(name, description, "", Arrays.asList(aliases));
this.setPermission(permision);
this.executor = executor;
}
@Override
public boolean execute(CommandSender commandSender, String s, String[] strings) {
if (commandSender.hasPermission(this.getPermission())) {
return executor.onCommand(commandSender, this, s, strings);
}
return executor.onCommand(commandSender, this, s, strings);
}
}
``` Btw, just what can I return if the player has not the permission given to create the command ? 🤔
pls set the permission in plugin.yml
Why?
More useful to have all in one thing: Java.
so it doesn't show in tab completions if you don't have the permissions
just send the sender a message or smth
Hi, anyone wanna be developer on an Minecraft server?
TeamFun is searching for developers if anyone is interested please DM me you will get developer role on my server if you are accepted
wrong channel
wrong server actually
What’s the good 1?
returning false means printing the help message, true doesnt
?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/
Alright!
how do i create a config.yml and write useWorldguard: true in it and then read it in another file
The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...
so you basically create a config.yml file in your resources folder (the same one where plugin.yml is) then you type saveDefaultConfig(); in onEnable
to retrieve useWorldguard you do getConfig().getBoolean("useWorldguard");
Hey, im using kotlin reflect to recursively go through all the packages under a certain package, it works when i use a test, but once i load it into a plugin it fails to find any of them, any ideas?
what 😭
JavaPlugin::getConfig()
^^
Code?
@Override
public boolean equals(Object object) {
if (this == object) return true;
if (object == null || getClass() != object.getClass()) return false;
Punishment punishment = (Punishment) object;
boolean punishmentNoPlayer = punishment.getPlayer() == null;
boolean thisNoPlayer = this.player == null;
boolean punishmentNoIp = punishment.getIp() == null;
boolean thisNoIp = this.ip == null;
if (punishmentNoPlayer != thisNoPlayer) return false;
if (punishmentNoIp != thisNoIp) return false;
return punishment.getPlayer().getUniqueId().equals(this.player) &&
punishment.getType() == this.type && punishment.getIp().equals(this.ip);
}```
is tehre a better way to do this
object ReflectionUtils {
fun getAllClasses(packageName: String): List<KClass<*>> {
val loader = javaClass.classLoader
val classes = mutableListOf<KClass<*>>()
explorePackage(packageName, loader, classes)
return classes
}
private fun explorePackage(packageName: String, loader: ClassLoader, classes: MutableList<KClass<*>>) {
val resourcePath = packageName.replace(".", "/")
val resourceStream = loader.getResourceAsStream(resourcePath)
resourceStream?.let { stream ->
stream.bufferedReader().use { reader ->
reader.readLines().forEach { line ->
if (line.endsWith(".class")) {
try {
val className = "$packageName.${line.removeSuffix(".class")}"
classes.add(Class.forName(className).kotlin)
} catch (e: ClassNotFoundException) {
println("Failed to load class: $line")
}
} else if (!line.contains(".")) {
explorePackage("$packageName.$line", loader, classes)
}
}
}
}
}
fun loadClasses(packageName: String): List<KClass<out Any>> {
return getAllClasses(packageName)
}
}
dont create extra variables
now im thinking, what in the first place do you need reflective access to all subclasses for?
it works perfectly fine when i run it using the kotlin test but doesnt in the plugin
quite a few things, for example if i have alot of commands or stuff organised by packages
i can use the method on the base command package to get them all
val spigot = "1.20.4-R0.1-SNAPSHOT:remapped-mojang"
What repository has "org.spigotmc:spigot:$spigot" library?
in the current case im using it for items
you need to run buildtools
i find it a flaw..
none, you need to run buildtools
how>
I need without build tools to run github actions
it took too long time
why doing all this effort when you can just register all things yourself
also makes code more clear
but whatever
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
thanks i will try it
i dont get that on the page
pass plugin instance through the constructor
so you can use it to access the config
how
That guide shows you how
ik but i dont understand
what part are you having troubles with
everything
try to be more specific
like i dont understand anything on the page
Did you read it
ip = InetAddress.getByName(args[0]); how do i make this match the ip exactly? so if args[0] is for example 1 it doesn't parse it as 0.0.0.1