#dev-general
1 messages · Page 626 of 1
with that use case there is no reason you would ever need an instance of your main class anywhere
apart from perhaps some weird jvm thing
nothing is coming to mind for that though, but something might exist
Don’t want to be mean, but that code is far from idealistic
🤷 read the name
Yes, but like this only proves piggy’s point?
Just proving my point of use cases for using <main>
the only preference that comes into play here is whether you prefer to write good, or bad code
if you prefer to write good, then there isn't a preference in whether the main should be a singleton or not, there is only one choice, it will not be a singleton
All things considered, not all use cases are inherently good use cases
Thats where its left to preference
im failing to see how thats a good use of a main class anyway
I remember I actually had a system like this, identical to this, a long time ago
I made it because I thought it'd be useful, it sounded useful, but then I realised, it's literally not useful, it's just "cool"
Like yapperyaps, we usually wanna separate and isolate concerns between different classes and modules, not merge 10 responsibilities into a single class
It was for my multi bot discord bots.
Again... preference... Sometimes I have a shit ton a methods per class, sometimes I have 1 method per class. Depends on what I have the usage for.
Sure, but some preferences are just not good and beneficial preferences
To some... I feel like I'm explaining the definition of "preference" at this point.
if your preference is to write bad code, then sure, it is a preference to use a singleton
but if your preference is to write good code, then you do not get to choose here, because choosing to use a singleton for that and also choosing to write good code, are two fundamentally incompatible choices
Hello, may I know how the Phrase Check in your Discord Bot works?😂
"good code" is opinion based... If something runs how intended it could be considered "good code". You get the idea.
no, good code is objective
Hell look at activision's recent games xD
Get users purchased plugins
purchased?
Yes
Okay
SpigetAPI, SpigotAPI and checking the linked discord on the spigot account.
I don't believe you can access buyers via any of those methods
SpigotAPI you can
@pallid gale is this true
Isn't there any other way to know if the user bought my plugin?
Go to buyers list and click "find buyer"
hm?
can u acecss buyer list through spigot api
https://github.com/Funny-cube/SpigotBuyerCheck
Is this still available?
I think we stopped using that because we got banned or something
sad :(
I thought it did, I thought we just got banned because of high traffic
nah its dead
Ah probs cause of the clouflare update MD_5 did a few months back
more than a few months
we went through many solutions before the one we're on now that has been mostly rock solid
it's not perfect though, far from it
I just use paypal's API and have it check the transaction memo lol
I haven't checked in quite a while but I think you can make different tokens on paypal that have different perms so could request perms for just transaction memos
But depends on the user.
idk, current way works atm
If you want spigot to have an API you gotta make your own and tell MD_5 to add it. He won't do anything himself anymore lol. Look how long the remove buyer button took.
(For buyers added manually)
I am so confused, got a variable which I assign, in 15 classes the variable is assigned, yet in one it's null, it all works at the same time, yet that one is still somehow null, I have a timer running which prints if the variable is null, yet it never is, so how can it be null if in all the rest of the classes it's not
Show code
Here it's not null:
public final class PlayerPostRespawnListener implements Listener {
private final GameSession session;
public PlayerPostRespawnListener(final GameLoop loop) {
this.session = loop.session();
}
@EventHandler
public void onPostRespawn(final PlayerPostRespawnEvent event) {
if (this.session == null) {
return;
}
this.session.equipmentComponent().apply(event.getPlayer());
}
}
Can you DM me the txt lol
Here it is:
public final class PlayerRespawnListener implements Listener {
private final GameSession session;
public PlayerRespawnListener(final GameLoop loop) {
this.session = loop.session();
}
@EventHandler
public void onRespawn(final PlayerRespawnEvent event) {
if (this.session == null) {
Logging.log("Session null");
return;
}
final StageObject currentStage = this.session.currentStage();
if (currentStage == null) {
Logging.log("Stage null");
return;
}
event.setRespawnLocation(currentStage.teamComponent().teamBukkitSpawnLocation(this.session.playerTeam(event.getPlayer()), currentStage.mapComponent().world()));
Logging.log("Respawning ", event.getPlayer().getName(), " at ", event.getRespawnLocation());
}
}
(Talking about GameSession so we're clear)
Where are you initializing PlayerRespawnListener?
Same place as the other one
... show please lol
show gameloop
upload source to github next
transfer copyright to me
Send the entire code as zip
If you want to finish the project sure, you can even collect the payment for it
Is this for that "among us" game?
Note that it literally is not null in other classes at the same exact time, as it's null in this one
Ok yeah show gameloop like piggy said. Everything else matches so far.
Also if all do do is loop.session() just pass session instead
so it's null on the spigot event and not the paper one?
Yes
I could, but cleaner in the register method :3
do it for debug frosty
I was thinking maybe you nulled the game session after post respawn or something.
nvm I'm not
.
Yeye doing that rn
Figured out the issue, I'm a slight nonce
ur a what now? 🤨
A random or semi-random number that is generated for a specific use
Does WE have an attribute to paste something without applying gravity to it, or how should I prevent sand from falling
nonce 😭😭🤣🤓
I don't think so. Fawe does or you can make your own.
It does, check the SideEffects things
pretty sure you set them somewhere in the edit session
will check
Anybody know how to block looking at /?
isn't there a config option for that
Negate the perm node.
I have no clue how to do that
In your perms plugin add a - before the permnode Ex; -<perm>
Okay
also
I saw on this one server, DonutSMP
They made it so you can only see the commands you can use
So when doing like /dc menu it won't show up as a actual command.
They probably had a plugin like CommandWhitelist
set up
but good plugins should do that by default
hey
can i ask you smth?
?help
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait
and probably not in #dev-general
ok sorry
but feel free to ask in #off-topic
why placeholder plugin isn't working on aternos
Startup Log Location
Your latest startup log can be found in the logs folder of your
server directory, labeled as latest.log.
Please copy the contents and paste them to a paste service.
Type ?paste for more information.
they can't get it installed
because it doesn't show up in the plugin manager thing
bro, Aternos says they had to remove it cause it can abuse their system bruhhhhhhhh
I'm experimenting with java sockets and I wanted to see what it can do so I made a program that using sockets to communicate between computers.
but for some reason idk why I'm getting a stackoverflow error.
can I get some help, idk why is this issue occurring.
?paste
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
https://paste.helpch.at/opekebinix.cs - mainclass
https://paste.helpch.at/ijazuqovub.java - threads.client
https://paste.helpch.at/ilopekuveh.java - threads.server
https://paste.helpch.at/cexupaciju.xml - exception details
Please ping me if you think you can help
Does anyone know any simple key-value "databases" for Java, such as quick.db (javascript), TinyDB (python)?
https://github.com/dain/leveldb Something like this?
Chronicle-Map
yeah, I found it
Does anyone roughly know the standard of developers that get admitted into Hypixel without a CS degree?
I don't know how good or bad I am
Based on what I've seen... I think they hire anyone that applies xD
Since when do they support 1.7?
the server is on 1.7 (for some reason)
but only 1.8+ is allowed
It's not on 1.7
Are you sure? If that's the case then why the complicated admission process
Only joking a little.
I meant 1.8+
can you tell me what happened to PlaceholderAPI?
hypixel runs 1.7 internally
It died in a car crash
A tragic loss
Oh
at least they do in skyblock, idk bout the entire network
Proof?
one of their devs has openly said they use 1.7
I've seen the same said for 1.8 lol... Any proof?
i think minikloon said it on someone elses stream once
thats where i heard it
no idea where that vod is tho lol
@PrinceBunBun981 @ConnorLinfoot @ChiLynnLynn 1.7.10 yes, but we dont support that anymore as a lot of our cosmetics require armorstands
We didn't drop 1.7 support as soon as 1.8 was released. There was a period of time where you could connect with 1.7 or 1.8 on Hypixel. We didn't remove 1.7 support until 97% of players were already using 1.8. We did this so that we could use new features (such as the world border and new blocks). It also resolved a few bugs that we couldn't fix while still supporting 1.7.
At this point, you may be wondering why we didn't update our servers to 1.8 itself. Well, that would require a huge amount of rewriting and testing of every single plugin and game mode that we used. We also use a heavily customised version of Spigot. Those changes would need to be ported over too. A lot of work. It was far easier to simply add support for later versions using protocol adaption and manually add the 1.8 features we needed to our custom Spigot.
In future, I recommend you avoid the calling people idiots like that. After all, it kind of backfired on you considering they were correct.
Huh. Wonder how they got armorstands to work then.
Weren't they horses with certain data in 1.7.10?
It was like a hidden thing until "full release" 1.8
wait for 1.7 or 1.8 clients
1.7.10 clients
o
i assume they just patched the shit out of the server jar to send the right packets
Which sounds evil but I guess it works
they use a very very customized and optimized server jar regardless so that sounds about right
i wouldn't be surprised if their server jar has a later bukkit api version
Thats what its looking like...
or that they added a lot of api to the jar
oh yea prob this
they probably added their own
Since everything is custom there's no point enforcing yourself to the bukkit api
but not 1.8+ api
Yeah at this point I'm surprised they still claim they use spigot. With alot of the customization I wouldn't assume it would match spigot at all lol
but they prob still copied it
considering they probably started with a spigot jar and just added stuff to it, they still have that jar in there somewhere and they have to say it because of licenses
is what im assuming
well even if they modified it, spigot is the base API
and now, it's still probably at least half of the api (or a quarter)
For all extents and purposes it's a completely custom server
its a very very much customized fork
Discord needs to add searching from roles instead of just users
add every user to the search 🥴
I want to be able to search in:#<channel> role:<rolename> <text> to show all from the text by users with the role.
Anyone know a way to optimize having many different gun configs?
I know it would lag out the server this would be on if many players had many different guns, so I'm trying to figure out how to make it more efficient
Gonna need some more details on that question lol
Imagine crackshot but instead of 15 gun configs its 200, and for this hypothetical they're all being used at once
Well... if its your own plugin cache the gun settings rather then the whole config.
And if you really need the config have them cached on a delay. (Remove them after non use for a certain time)
Ah I see
second one makes sense shouldve thought of that lol
Whats the difference when you refer to gun settings instead of config?
Well assuming you have more then just recoil, velocity, damage, spread and settings like that in the config... the whole config really doesn't need caching
For example a GunSettings class that's stored instead of getting the config every time
(a GunSettings class for each gun)
so maybe like Map<String, GunSettings>, the string being the name of the gun
then the map gets updated on config reload and server start
^^^
Does anyone have experience with JPA or Hibernate?
I have the jakarta.persistence.schema-generation.database.action set to create in persistence.xml, so the JPA will create tables automatically for me if not exist. But now every time I run my program, it tries to create tables without checking and I keep receiving a warning (so the program runs without problem) saying my tables already exist. How do I set JPA to check for the existence of tables before actually creating them? Alternatively, how do I disable the warning?
Anyone know any good alternatives to Google Analytics?
https://charlie.sh/ref/analytics fathom is my go-to, otherwise https://plausible.io/ but never used them
ofc ofc 😂
I've used fathom for years now, really love it, can't fault it, and haha ive been good pal, hows you?
Ye not too bad. Had to move out of the gaff due to Cost of Living
But we're looking for somewhere cheaper
Yeah stuff has gone up so much now :( these UK increases are going wild
very
Imagine living
brit*sh boy doesn't know idioms
i love it
Did you just "censor" british
its not offensive to call someone british lol
Lmao americans will never understand br*ts
random question, holograms are basically invisible armorstands, which are entities, so, having a lot of holograms or just armorstands in the server, could it cause lag because of the amount of entities?
make clientside entities
No, Armorstand dont have an AI, which means that they wont take up server space, the only thing it may cause is FPS lag, there are of course exceptions to this rule, (aka. Making them float in bubbled water) but traditionally speaking, they shouldnt cause lag, especially after the optimizations added in 1.8.
okay, thanks a lot-
it's offensive to my mouth saying that word 

Armorstands cause more then fps lag. They are still entities. They are still ran through entity ticks. (I think paper has an option to remove them from the ticker)
Only packet based armorstands are not loaded in the world and only sending the packets would affect the server.
if you disable collision and gravity on it I think it causes a lot less server lag though
and maybe some client lag too
if spread across the server and with the right config (such as what Dkim said) it wont cause lag.
And if anything- minimal
Even with those options, spawn 2k armorstands spread across a few chunks. ;)
His question was about holograms.
Yes, but I wasn't responding to his question. I was responding to the comments about armorstand lag.
so im assuminngggg he doesnt have 2k in a couple chunks.
even 2k prob won't lag the server since it's not checking gravity, AI, or collisions
sending packets isn't free, but honestly 2k probably wouldn't be awful on a decent server
oh wait I remember I sent a LOT of armorstand packets (all moving) and it made my ping quite high
Besides me has anyone actually tried this? Been working with armorstands for quite awhile xD the more armorstands you have the laggier your server will become.
Ive tested the affects on armorstands on servers.
I've tried it but iirc it affected more ping than tps but it's been months so I don't remember
yeah the clientside lag and the amount of packets is a thing
but overal it wont affect tps by anything.
but the actual CPU impact of the server sending those packets is not very high
or barely anything
Yes but that's client side. I'm talking server side currently.
yeah server side it's not that bad
most of the server's work is sending packets lol
Server side the server Should be fine if the configuration is properly done. Except when you dont have the proper config and you have 7K armorstands
Not sure if the ping is from the server trying to send a billion packets or the client trying to handle them though
then the server goes kinda- dead.
7K armor stands in 1 chunk btw.
In bubble water.
lol
Tested on a server with 5Gb of ram.
I'm not on PC so I can't bring up my tests. Someone spawn 1 armorstand per block over 12 chunks. (Nogravity and set it as a marker in higher versions) then do a timings or spark profiler.
btw offtopic but what would happen if a program ran out of memory and the GC can't free up any more? And it's also capped using -Xmx
would it just kill itself?
It errors with OutOfMemory
^^^
oh
It would shut down
smh dkim never tried making a million new objects before
speaking of, if you're running a server on 1.17 or up, ZGC is really fucking good
or a max length array
Why the frick does stupid NameTagEdit keep enabling debug mode on its own..
essentially no stop-the-world pauses and very efficient garbage collection
Aikars flags?
nope, new ZGC flags
havent seen those yet
Aikar hasn't updated his flags in years lol, but now Minecraft newer versions can take advantage of Java upgrades
-Xms4G -Xmx4G -XX:+IgnoreUnrecognizedVMOptions -XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:-OmitStackTraceInFastThrow -XX:+ShowCodeDetailsInExceptionMessages -XX:+DisableExplicitGC -XX:-UseParallelGC -XX:-UseParallelOldGC -XX:+PerfDisableSharedMem -XX:+UseZGC -XX:-ZUncommit -XX:ZUncommitDelay=300 -XX:ZCollectionInterval=5 -XX:ZAllocationSpikeTolerance=2.0 -XX:+AlwaysPreTouch -XX:+UseTransparentHugePages -XX:LargePageSizeInBytes=2M -XX:+UseLargePages -XX:+ParallelRefProcEnabled
These?
No
java -Xms10G -Xmx10G -XX:+UseZGC -XX:ZCollectionInterval=30 -XX:MetaspaceSize=256M -XX:+DisableExplicitGC -XX:+AlwaysPreTouch --add-modules=jdk.incubator.vector -Duser.timezone="America/Denver" -Dlog4j2.formatMsgNoLookups=true -Dterminal.ansi=true -Dterminal.jline=false -jar server.jar --nogui
These are mine
and it is very nice let me tell you
Lemme get em up and running and do some tests
one of our servers runs on 1.18.2 so this might help
yeah I run all 1.18.2 servers and we had a big problem with long GC pauses with G1, so we swapped to ZGC and they are a thing of the past
kinda crazy how far technology has actually come
lmao
i dont actually have the ZCollectionInterval flag
I gotta contact my host for this xD
lol, that's when you get a dedi and become your own host >:)
sweet, sweet Pterodactyl panel
Atm its cheaper if i just buy the servers like that-
Im still developing most of the network so
how many servers ya got? I've found if you have a big server, you need the performance of a good dedi, and if you have more than like 3 servers it is very worth getting a dedi and just using all your resources
We got 6 atm.
sheesh, how much per?
oh
since i was about to switch to pebble xD
so how much do you spend in total for the 6 servers?
and they were like- we can pricematch lol
plus proxy
Per month? Emmm like 30$? not that much
oh damn okay
that's pretty cheap lol
i suppose you're doing something light like minigames or something
Ill be upgrading 2 of the servers when we release
But we are doing Skyblock/ Vanilla Anarchy atm
oh huh
Pretty heavy gamemodes.
how many people per server?
like right now
We arent open yet
ah
But i think theoretically we could hold like a solid 50 without lag?
i was gonna say, i do big SMPs with stuff like MMOItems and MythicMobs and ModelEngine, we do 50 people per server right now on a dedi and we have 4 servers
I got 500 slots on the network open for now so.
and we need the performance of a nice dedicated CPU lol
plus accessory hosting, like databases and website
Got any cheap dedi's i could look at?
OVH is where I get mine, unless you're located in Europe, in which case Hetzner is your company
The reason i went with my current host is cuz they have amazing ping towards the US etc while being in europe.
and cuz i like their systems
but i might look into a dedi eventually
huh, yeah OVH servers in the US will be better just because of location, and you won't really have any "systems" when you're doing your own hosting
you'll just use a panel like Pterodactyl or something that you setup your self
yeah okay
I think im using multicraft atm-
I dont think its terrible
but ive heard people hate it
oh yeah multicraft is not great lol
Pterodactyl is a lot nicer and has a ton more flexibility
i dont really get why
In all honesty most of the stuff i do is via the FTP
But i wouldnt say its terrible.
mostly closed source and proprietary and expensive, and just outdated UI and management ability
Ahh okay
kinda absurd to have to pay money just to use your own stuff lol
wdym?
you have to buy a license to use multicraft
whereas Pterodactyl is free and open source
oh like that
yeah okay fair
If i go for somethin itll probably be Hetzner
Since their dedi's there are 40$ a month for 64GB and over at my host its 110$ a month lol
yeah Hetzner is great, though don't know how great it would be for a server for Americans
Maybe when i switch ill have the funds to make a split network with a US location and an EU location
;/
idk
lmao probably not worth
OVH is not that much more expensive
especially if you get a deal for no setup fee
xD
Understandable
btw- why does Pebble ask for money to use Aikar's flags.
thats like- kinda bs
oh yes it's because hosts are a scam
Oof
if you have the technical knowledge, a dedi will always be a good investment for any server planning for more than 15 players
No true
Personally never used a dedicated server before tho
So I would have NADA clue where to start lol
ever used linux?
then you should be pretty good lol, a dedi is generally just a linux box that you can do whatever on
Plot twist: you install Windows on the Linux system
And then get an entire army of people get mad at you for doing so
But yeah thanks man!
yup yup
anyone here good with packets? trying to cancel the q event with items and empty hand
So far i just have it set up with the item drop event, but that wouldnt work with nothing in hand, so thats why im resorting to packets.
SHIFT + Q would activate the ability
1.9 players predict the drop, don’t do this with packets
So client sided the player will replace that item with air
wym? sorry new to packets
If you cancel the item drop event when the player is holding an item, it will desync the client
oh, okay.
Why cancel it with empty hand?
the players have an external ability tied to the q button.
like when they press shift + Q wither skull projectiles will launch from them etc.
however PlayerDropItemEvent can only fire with item in hand, so I was looking for work around to get it when there is no item in hand
So you just want to listen to the event
I’d cancel it with bukkit and listen to it with packets
yeah thats what I was looking to do, but you said its not good?
but what if they have an item in hand? I dont want them to throw their item out if they use their ability
Cancel with bukkit
on packet listening to block dig, how can you differentiate from a regular Q drop or a block dig?
public void onPacketReceiving(PacketEvent event) {
StructureModifier<WrappedEnumEntityUseAction> actions = event.getPacket().getEnumEntityUseActions();
actions.
}
Idk I use PacketEvents
api?
yeah PacketEvents much easier
Which config? Cause I was speaking about holograms as an example, I do plan on using armor stands. More like an cosmetic thing (imagine a barrier with a head inside)
noob question but how do you cancel a bukkit event from another class?
you have to get some sort of handler?
You'd pass the event in to that class
Paper.yml spigot.yml stuff. Disable armorstand collisions etc.
Hmm okay, would it be a good idea to just delete armorstands when the user isn’t online? (Assuming armorstands are a cosmetic for a block a user placed)
Wdym by that?
how would OVH solve that problem
The problem was that they wanted to use Hetzner, and I said it's not worth it because OVH isn't that much more expensive and has much better ping to the US
So, lets say I use armorstands with a head just purely cosmetic for a generator (which is a block). That generator belongs to X user. So my idea was to despawn the armorstand when the user isnt online, since its useless to display it. And spawn it again on join.
us location 🔜
Where can I find this? Just double checked and they have no dedicated server listings in North America
Okay so... For the moment... Your best option in North America is OVH...
yes
Great conversation lmao
Tbh I just use Oracle Cloud...
They give a 24gb ram 4ocpu VM for free
😎
Perfectly enough for testing and whatsoever
Heh... Enjoy it while it lasts.
🤣🤣
works fine for me :p
btw not sure if you saw it because of discord dark mode but it had a soon emoji
Oh that actually makes a lot more sense lol
Though still not sure why they brought it up in the first place, that at least explains that lol
Awful clock speeds not suitable for any medium sized or above server
and they randomly terminate your account for no reason
not for me
for now
Bm just doesn't pay his bills
yeah
oracle is evil
Clearly
always has been
Owns java, must be
the oracle rabbit hole, full of shit btw, goes back a long time
probably worth a google
for >1 year
good point
has lasted for over a year now sooo
ye ik, I said I use if for development and testing.
not to host an actual server, who is stupid enough to do such thing?
lol
I am
anyway to detect when player opens up their own inventory? I've read its impossible, without a custom client. Wanted to double check
IIRC there's an advancement for opening inventory, you can check PlayerAdvancementDoneEvent or whatever, if it's the Open Inventory one, remove it, rinse and repeat.
Tacky, but might work
Sheesh that’s kind of a big brain idea
only on 1.8
clients
minecrafts way of handling recipes is a complex mistress
im looking it over to see if theres any optimizations i can make to my recipes and its like terrifying
found the root of the recipe lookup, they use like stream()...findFirst() and something called a flatmap
which was weird
and some other weird stuff im not familier with such as Recipe<?> and
public <C extends Container, T extends Recipe<C>> Optional<T> getRecipeFor(RecipeType<T> type, C inventory, Level world) {
the thing thats confusing me is the <C extends Container, T extends Recipe<C>>, i have no idea what this type of syntax is called
or what to search online for the answer, guess ill start typing some keywords and hope for the best
Generics
thanks
eww
😌😌😌😌😌😌😌
no idea what it is
well i have an idea but not sure how to use it or if i should as the current method seems optimal enough
It accepts a RecipeType<Recipe<Container>> as first argument, and the second argument (C inventory) has to be the same type as the container from Recipe<Container>. So if you use RecipeType<Recipe<WorkBench>> (assuming WorldBench is a valid container type), the second argument has to be a WorkBench instance.
i was mainly talking about using generics
i probably shouldve given a bit more context
progress update to my crafting gui in a chest gui, it kinda works now. tho its deleting items which i assume is cus i dont check for inventoryaction, which i will do now.
Turns out there is a client server desync with the player's offhand when attempting to put an item in it and its been cancelled.
Does someone know if Vault works for 1.18.2? It just says that it isn't tested, on the spigot site
yes
unless something regarding offline players has a dramatically catastrophic breaking change, odds are it will work in every future version
Alright, nice
Hey I tried rebasing the last 7 commit so I can reword them (change the commit message) but I messed something up now when I run git rebase -i HEAD~7 it instantly says "Successfully rebased and updated refs/heads" anyone know how to fix that?
Hippity Hoppity your meme is now my property
oo
Nice
Anyone here got any idea on IOS development? More specifically with RealityComposer & RealityKit
Uh random question, whats that thing some people have in github that shows like A+, B-, etc. Regarding the quality of the code?
Readme stats
Its for your profile
Well I saw people using stuff for independent projects and it actually graded the quality of your code?
At least thats what I got told?
codacy is an example
I got shapeless recipes to work for my chest-based crafting GUI, they also now remove from the highest quantity slot instead of just the first to the last.
i just checked and i could be wrong but i dont think hypixel has true shapeless recipes
also shaped recipes now take priority over shapeless
Who wants a completely useless command?
I do
kk
this command does all you need : summon many mobs at a time
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (sender instanceof Player) {
if (sender.hasPermission("server.multisummon")) {
Player player = (Player) sender;
if (args.length >= 2) {
try {
EntityType entity = EntityType.valueOf(args[0]);
int amount = Integer.parseInt(args[1]);
for (int i = 0; i < amount; i++) {
player.getWorld().spawnEntity(player.getLocation(), entity);
}
player.sendMessage(colorize("&b&lTL &b&o: &4You summoned &e&o" + args[1] + " " + args[0]));
} catch (IllegalArgumentException e) {
player.sendMessage(colorize("&b&lTL &b&o: &4This is not an entity."));
}
} else {
player.sendMessage(colorize("&b&lTL &b&o: &e/multisummon [mob] [amount]."));
}
} else {
sender.sendMessage(colorize("&b&lTL &b&o: &4You don't have permission to do this."));
}
} else {
sender.sendMessage(colorize("&b&lTL &b&o: &4You cannot do this. "));
}
return true;
}
public String colorize(String msg) {
return ChatColor.translateAlternateColorCodes('&', msg);
}```
What the fuck
wut
its kinda ugly
ok and
let me get the arrow code gif
i haven't used arrow code
fck i cant find the gif
lol
bruh
Turn
if (sender instanceof Player) {
// more conditionals here
}
to
if (!(sender instanceof Player)) {
return true;
}
// conditionals here
understood?
What the fuck is that arrow
no
just flip the condition and put the rest after
thats what they all say
it's literally from months ago ; -;
I can show the spigot thing
wut
yk
that's not the plugin I was working on
same thing I just copied and pasted it
oh
it doesn't even work
for 1.5
Let me bring up spigot rq
bruh no screenshots
@forest pecan it's really sad
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage(colorize("&b&lTL &b&o: &4Only a player can execute this command."));
} else {
Player p = (Player) sender;
if (p.hasPermission("server.multisummon")) {
Player player = (Player) sender;
if (args.length >= 2) {
try {
EntityType entity = EntityType.valueOf(args[0]);
int amount = Integer.parseInt(args[1]);
for (int i = 0; i < amount; i++) {
player.getWorld().spawnEntity(player.getLocation(), entity);
}
player.sendMessage(colorize("&b&lTL &b&o: &4You summoned &e&o" + args[1] + " " + args[0]));
} catch (IllegalArgumentException e) {
player.sendMessage(colorize("&b&lTL &b&o: &4This is not an entity."));
}
} else {
player.sendMessage(colorize("&b&lTL &b&o: &e/multisummon [mob] [amount]."));
}
} else {
}
}
return true;
}```
it still is an arrow
you know you dont have to do that ONLY for that conditional
you can do that for other conditionals too
lmao
and you dont need else
if you return
yk I have no idea what you're talking about
sigh
if (!(sender instanceof Player)) {
// logic
return true;
}
if (!p.hasPermission("")) {
// logic
return true;
}
get the idea?
if (p.hasPermission("")
thats the whole point
you dotn want an arrow
so you reverse it
so it looks easier to read
yes
for code
I do
I've done it forever
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage(colorize("&b&lTL &b&o: &4Only a player can execute this command."));
} else {
Player p = (Player) sender;
if (!(p.hasPermission("server.multisummon"))) {
} else {
Player player = (Player) sender;
if (args.length >= 2) {
try {
EntityType entity = EntityType.valueOf(args[0]);
int amount = Integer.parseInt(args[1]);
for (int i = 0; i < amount; i++) {
player.getWorld().spawnEntity(player.getLocation(), entity);
}
player.sendMessage(colorize("&b&lTL &b&o: &4You summoned &e&o" + args[1] + " " + args[0]));
} catch (IllegalArgumentException e) {
player.sendMessage(colorize("&b&lTL &b&o: &4This is not an entity."));
}
} else {
player.sendMessage(colorize("&b&lTL &b&o: &e/multisummon [mob] [amount]."));
}
}
}
return true;
}```
still an arrow
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage(colorize("&b&lTL &b&o: &4Only a player can execute this command."));
return true;
}
final Player p = (Player) sender;
if (!p.hasPermission("server.multisummon")) {
return true;
}
if (args.length < 2) {
player.sendMessage(colorize("&b&lTL &b&o: &e/multisummon [mob] [amount]."));
return true;
}
}
im not spoonfeeding all of it
but do you see the difference?
that is so much easier to read
I see redundence
if (!(sender instanceof Player)) {
sender.sendMessage(colorize("&b&lTL &b&o: &4Only a player can execute this command."));
return true;
}
if (!(sender instanceof Player)) {
return true;
}```
You cannot edit your mistakes
I already have your mistake
but why "final player"
final good
^
it injects a virus into ur server
Never used final ever
dont use final
except in one line of code
private final ServerPlugin plugin;
public Heal(ServerPlugin plugin) {
this.plugin = plugin;
}```
believe it or not, but final actually makes some optimizations lol
I'm not that stupid
for free!
I mean it's safe already
it does the literal same thing
😂
I didn't wrong reply
I just replied
to your last message
cope
lol
sure
i aint crying
however if i had to guess i would say that pulse was probably correct
he's not
in what way?
he just wants looks
ok im guessing ur new to coding
but ask literally any professional programmer and they will tell you that readability is the most important thing in 99% of scenarios
same difference
I've just learned spigot
looks are inherently important
For what
who's gonna decompile my plugin and complain to me about how my code3 looks
decompiled code never looks good
but you my friend are the one that's gonna be complaining
because when you come back in 2 months to change 1 thing and you have an unreadable mess, you're going to suffer
come back 3 months
"I was there when it was writen"
sure, maybe you can with 30 lines, but what about an entire codebase where you've completely ignored "looks?"
hahahahah that's just not how it works
cough bukkit
never gonna do that though
why not?
nobody's brain is that 5head
I don't wanna make a "codebase"
I just like making completly useless plugins
thats a codebase
well okay suit yourself i guess
ok but it isn't gonna be huge
whatever
bump
no thank you but thanks for the offer
I wasn't asking you specifically
Lmk when you offer 2 pizzas
I'll take 3
wut
i know but i can still reply no?
that's because he isn't using optifine 64 chunks 🙂
yeah. clearly there's joe 64 chunks away. he's just waiting to be found
wheres joe?
joe mama
64 chunks away from your location and rapidly aproaching
so you better start running
wut
You're to stupid to have a daughter
why are you pinging me dear sir?
you said bump
You're too stupid to not spell too correctly
lol
I meant to spell it that way
Sus
my ears died and had a closed casket funeral.
lol
Does anyone not notice what's on this bird
pterobutt
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
if (!(sender instanceof final Player p)) {
sender.sendMessage(colorize("&b&lTL &b&o: &4Only a player can execute this command."));
} else {
if (!(p.hasPermission("server.multisummon"))) {
sender.sendMessage(colorize("&b&lTL &b&o: &4You don't have permission to do this."));
} else {
switch (args.length) {
case 0:
sender.sendMessage(colorize("&b&lTL &b&o: &4You need to pick an entity"));
case 1:
sender.sendMessage(colorize("&b&lTL &b&o: &4You need to specify a number"));
case 2:
try {
EntityType entity = EntityType.valueOf(args[0]);
int amount = Integer.parseInt(args[1]);
for (int i = 0; i < amount; i++) {
p.getWorld().spawnEntity(p.getLocation(), entity);
}
p.sendMessage(colorize("&b&lTL &b&o: &4You summoned &e&o" + args[1] + " " + args[0]));
} catch (IllegalArgumentException e) {
p.sendMessage(colorize("&b&lTL &b&o: &4This is not an entity."));
}
}
}
}
return true;
}```
wow
@subtle smelt have u ever heard of haskell
no
ok
I still have no idea who you are
why would you need to know who I am?
Because you're supposed to be trusted
Then how did you even become trusted
hmm
I cannot execute that command here
I don't have a life
but
I haven't spent time on this server
"Unfortunately we've been noticing quite the trend of you being actively helpful to members in the community"
yes.
that's why I executed the command
I can't believe you actually spotted that
You're not really that helpful
yeah everyone hates blitz
I don't hate him
that's a lie
I just said he's not really helpful
also if you're on staff blitz
why are you posting a sticker of a
pterobutt?
a sticker of a what?
Wtf lol
pteropenis
From the Pterodactyl server. Lol
Yeah, that's why I said that
I was typing something out and it automatically showed up bcz discord dumb. so I just sent it bcz I realised discord wants me to do it
Don't tell me you can't see it
Penisdactyl
see what
joe
the penisdactyl
i really dont get what u mean
this thing
yeah what about it?
😊
yeah idk DarkLife. Seems like you're going insane
you are making me blush
yw
I have even more code for you to see
You might need some bleach
bleach for what?
List<String> arguments = new ArrayList<>();
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) {
if (command.getName().equalsIgnoreCase("multisummon")) {
if (args.length != 1) return Collections.emptyList();
if (!sender.hasPermission("server.multisummon")) return Collections.emptyList();
return StringUtil.copyPartialMatches(args[0].toLowerCase(), Stream.of(EntityType.values()).map(Enum::name).map(String::toLowerCase).collect(Collectors.toList()), new ArrayList<>());
} else if (command.getName().equalsIgnoreCase("server")) {
if (arguments.isEmpty()) {
arguments.add("reload");
}
} else if (command.getName().equalsIgnoreCase("gamemode")) {
if (arguments.isEmpty()) {
arguments.add("creative");
arguments.add("survival");
arguments.add("adventure");
arguments.add("spectator");
}
}
List<String> results = new ArrayList<>();
if (args.length == 1) {
for (String a : arguments) {
if (a.toLowerCase().startsWith(args[0].toLowerCase()))
results.add(a);
}
return results;
}
return null;
}```
TabComplete
blitz u got instagram?
yes. kinda.
no. that's the evil monkey
is that your side kick?
only cultured people will get that
yeah
you my friend are very cultured
ty
Why wouldn't you
bored apes jpegs?!?!
Already screenshotted, get fucked nerd
hmm?
package me.darklife12345.serverplugin.events;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerFishEvent;
import org.jetbrains.annotations.NotNull;
public class NoFish implements Listener {
@EventHandler
public void onFishEvent (PlayerFishEvent e) {
final Player p = e.getPlayer();
if (!(e.getPlayer().hasPermission("server.fish"))) {
e.setCancelled(true);
p.sendMessage(colorize("&b&lTL &b&o: &4You're not allowed to fish."));
p.damage(5);
}
} public @NotNull String colorize(String msg) {
return ChatColor.translateAlternateColorCodes('&', msg);
}
}
no fishing allowed
Updated code
package me.darklife12345.serverplugin.events;
import me.darklife12345.serverplugin.ServerPlugin;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerFishEvent;
import org.jetbrains.annotations.NotNull;
public class NoFish implements Listener {
private final ServerPlugin plugin;
public NoFish(ServerPlugin plugin) {
this.plugin = plugin;
}
@EventHandler
public void onFishEvent(PlayerFishEvent e) {
boolean fishThing = plugin.getConfig().getBoolean("Fishing");
final Player p = e.getPlayer();
if (!(fishThing)) {
if (!(e.getPlayer().hasPermission("server.fish"))) {
e.setCancelled(true);
p.sendMessage(colorize("&b&lTL &b&o: &4You're not allowed to fish."));
p.damage(5);
}
}
}
public @NotNull String colorize(String msg) {
return ChatColor.translateAlternateColorCodes('&', msg);
}
}```
Smh @static zealot get with the program
@static zealot if you're so helpful then what should I add to this
async
everything
I don't understand
I cannot comprehend what you want me to do
private final ServerPlugin plugin;
public ChatEvent(ServerPlugin plugin) {
this.plugin = plugin;
}
@EventHandler
public void onChatEvent(AsyncPlayerChatEvent e) {
String chatFormat = plugin.getConfig().getString("ChatFormat");
String playerPrefix = plugin.getConfig().getString("Prefix");
Player player = e.getPlayer();
String chatFormatted = Objects.requireNonNull(chatFormat).replace("{prefix}", Objects.requireNonNull(playerPrefix)).replace("{player}", player.getName()).replace("{message}", e.getMessage());
e.setCancelled(true);
Bukkit.broadcastMessage(colorize(chatFormatted));
}
public @NotNull String colorize(String msg) {
return ChatColor.translateAlternateColorCodes('&', msg);
}``` 😮 chat plugin
I will kindly ask you to stop sending random snippets of code, thanks
uh why ;- ;
Why would it not be, I mean look at that beauty

Me rn:
what about @Disabled?
100% of zero tests passing is still 100%
True
https://help.minecraft.net/hc/en-us/articles/7149823936781-Player-Chat-Reporting-in-Minecraft-Java-Edition
Besides realms, wouldn't there be no way to verify reports? 🤔 🤔 🤔 🤔 🤔
Since someone could just decompile the client and see how the report button works
or is there something that mojang does that stores chat messages on their own server
thats the only thing i can think of
you need to select the messages yourself, and that's where message signing comes into play, the whole thing around message signature is to verify the actual message (with its "actual contents") are legitimate and actually sent from the player it claims to be from
how do messages get signed tho? (what do they get signed with and how the verifies it)
or would the sender sign it and then the sender would tell the server which would tell the receiver the signature?
when you launch the game, auth servers provide you with a public and a private key; the private key your client uses to sign messages (and other things like certain command arguments), public key is sent to the server when you login (and "broadcasted" to other online players) which is used to verify the integrity of your messages
something something cryptography stuff
oh ic
wait so this means that the server can disable chat reporting? by just not sending the keys
if the signature is invalid (or absent) then there is no way to verify a certain message (which btw, messages are sent alongside a corresponding signature) is legit or not, it could've been tampered with in some way.. somehow, how? idk, but that does not matter in any case
"yes"
"yes"? 👀
not in such direct way, but you can strip out signatures from messages on the packet stream
I would advise against disallowing basic player safety features however
and this can be changed by ProtocolLib, right?
As I'm assuming this would just be another field in the packet
true
🥲
"sure man, come on in this construction site but you must not use a hardhat"
yeah but when you change a message's content, the signature is no longer valid, it doesn't correspond to the contents anymore
wait so each signature is generated by the message contents?
Oh wait yea
I was thinking each player has its own signature
for some reason
wait
wait which one
😖
when you send a chat message or some command arguments (like /say or /me etc), the client will do some magic cryptographic woes and produces a hash, then with the public key you can do some more crypto fuckery to verify the validity of the hash against the message
I don't know the mathematical details or process but if it matches, the message is untouched and basically means "yes, this player sent this"
if it doesn't, something went wrong or was modified somewhere after the player signed and sent the message
Interesting 🤔
anyways ty for the explanation 👍
def test_method_4(self):
b = """
class A:
def __init__(self, foo):
self.foo = foo
def next(self):
pass
def __iter__(self):
return self
"""
a = """
class A:
def __init__(self, foo):
self.foo = foo
def __next__(self):
pass
def __iter__(self):
return self
"""
self.check(b, a)
😮 foo bar
you get that now?
Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
• HelpChat Paste - How To Use
I got banned in spigotmc community discord for saying I got banned in roblox for saying I hate Koreans so imma make squid game real in korea
So I wonder if this server will kindly ban me too with no specific server like every server ever
@distant sun
You come from chad city you know what to do right
haha. 😦 its not Chad's flag. is Romania's flag
The fuck
just do it im tired of getting banned in every server for no reasons so this time i will give a reason so pls do it
im wanderingpalace by the way so ban my main acc too
haha. dont you think you can add this to the ban reason too?
Ban reason: Chad
you can also, like
Leave server exists
no i want to get banned for actually a reason for the first time ever
im tried of getting randomly banned for no reasons
people are just racist towards my name
Just because im deleted user doesnt automatically mean im a troll
Deleted User is a race now?
Well I mean right now you're acting like a troll lmao
cuz i have been identified as a troll for so long so why not?
tired of discord anyway ban me pls
end it quicker
Man's twelve
nah you dont understand
being banned FOR A REASON breaks the loop
hello. I've been trying to reach you about your car's extended warranty!
right now im stuck in a loop i need yall to help me break it
But i don't even own a car
thats famous last word
so whaT? you don't want to pay insurance?
Your better watch your kneecaps
You have been banned from SpigotMC.
Reason
No reason was given.
ok
you should get some green tea
discord now shows a reason when you're banned?
its from their bot
ah. cool
alr mate you know what give my your paypal i will pay for my ban
20 usd each i have 2 accs deal?
I can give you my paypal
I don't have any moderation powers tho
maybe you can let me join your own discord server and ban me
without reason?
no way
haha
Uh no
remember the days when we all have green names
that was kinda the pinnacle of my life
right now i do not know what am i doing
im lost and im down
hey trusted why are we in the same discord server but our lives are so different
relatable
nobody lives life worse than me
how so? we're both wasiting our lifes by trolling and ranting on discord. 😦
i have wasted enough time to not know how to advance any further
