#help-development
1 messages ยท Page 527 of 1
Depends if you are hourly or salary
LMAO
There is some interesting thing, think about it. No matter when the hell, maybe in 50 years, somewhere there is just a standalone letter i. We all will remember the good old times when we used i as an iterator every day
(mostly) not always
The reason comments is useful everywhere is that, it can actually help you debug by seeing what each aspect of your code without like, being stuck in programming mode
I sometimes use comments to mention possible issues, todos, what things can be done better in the future when I have time or to describe the limits of a functionality
yeah but this is actually the convention for when to use a comment in principle
its really hard to represent what you mean perfectly in code. Like, i could follow all naming conventions and people, (in js not java, im bad at java) could still wonder why i choose this method, and why i dont do it like this
i think there is a rly good yt vid on it
โโ ENGLISH DESCRIPTION โโ
"Coding Better World Together" is a set of master lessons from the famous Uncle Bob (Robert Cecil Martin), where he gives us a broad vision of the importance and future of Software in today's society.
In this second lesson, Uncle Bob teaches us the purpose of comments in the code, breaking the paradigm that commenting ...
Lmao uncle bob
that series will make u a better programmer instantly
But will it make me laugh
Java is annoying because there is just so much properties/methods in it, like, its not like js. For almost all my programming languages i used to learn by playing around with a library, any new term i hear about i look it up, like throwing a snowball down a hill, i expand my knowlage. And this sorta worked fine. but for java i have to watch and look at hours worth of content
idk if that made sense
ye
well java is harder than js at the end so it does make sense to some extent
Tfw types
js is like, java had a child, but the child was adopted, and it hate the child, and tried to drown it in a river.
Im actually trying to teach my friends java based on my experince..
Hi. I want to use the NMS ItemStack from version 1.19.4 but the IDE does not find the NMS ItemStack. How do I import it? Other NMS classes are shown.
Hello! Looking to contribute to spigot adding LivingEntity#playHurtAnimation(). It requires me to add a method into Bukkit and implement that in CraftBukkit. Does this mean I open 2 separate pull requests? (Fork and clone both repos, then open 2 separate pull requests?)
(Please @shy finch me)
Other NMS classes from other versions? You might need to elaborate a bit. If you are using gradle I suggest looking at paperweight-userdev to handle NMS.
@shy finch yes
Although you should already be able to do this with LivingEntity#playEffect
Doesn't work in 1.19.4... Another pull request was already merged for players (https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Player.html#sendHurtAnimation(float)) but of course this cannot be used for entities
I'll be sure to provide those details in the PR
Thanks for the quick response! Just trying to make sure I don't blatantly misuse the PR system ๐
Ye thatโs nice
I feel like there arenโt that many guides that take a completely green field beginner friendly path
Like I never understood why youโd use some symbols and not others in the very beginning when I was learning
Yeah, currently im focusing more on keeping them instrested than fully correct, I rather have someone start off doing things a bit wrong and faulty than loosing interest altogether.
Thatโs a good principle
Minecraft is actually a good motivation to learn java
True
Make it work before you make it look nice
As a bonus you can always skip the make it look nice part and ship it early
The only lanuuage most people care about is python, which sucks, because i hate python
Man talking to spider about all this when raz could of got a cheeky code review xD
:L
yeah they have weird names for their varibles, but currently they dont know the basics so im teaching them that to build intrest.
I love how most programming lanuages have {}
for like functions
I know pythin forces you to indent
but...
If youโre really bold you can even skip the making it work part and just ship it
lmao
But then youโve made sonic 06
Yeah its actually good
Because it motivates you to create smaller functions
As to not get too nested
My next exam is to make a website with CSS and html, advertising some role in IT.
So im sorta glad I can do CSS and html now
I learnt C# from unity, CSS cant be that diffrent
Although i did say that about java
C# is very different than CSS lol
CSS is just ehm well, I mean the language semantically isnt hard
But u gotta remember like a lot of stuff from the dom model etc
Making anything look good with css is hard
But that may be more an artist issue than a programming issue
Making anything look good with anything is hard
I just wanna go back to js ๐ญ
Sadly this is so true
Tbh I prefer Java Syntax
I use js for node.js
Js syntax is too minimalistic
Static + strongly typed >>>
Yeah
I've used npm before and I agree there
thanks for coming to my ted talk
But yeah
Found 56 vulnerabilities in 3 packages
package manager is not everything of a language lol
Yeah npm pretty nice
Also, you should probably look at the code from the package ur downloading
because a bunch of packages
Lmao
literally, redirects another package to you
Didnโt like
like alot of these packages aint anything unique
The thing with npm is
Yea
You get to 2 Terrabytes of dependencies very quick
I always use as few libraries as I can at all tbg
I dont need 50 dependencies just to make a fucking api call
I prefer writing everything how I want it to be, not relying on others
Oh yes you do 
Which you should
Sometimes I download packages that does like, things like recursive functions or things like that, because i cant be damned to fix it, and convenince
Library commitment is sth to be careful about
Aight but now, good night. I gotta go to school in 5 hours
So get up in like 4.5h
Sleep well bro
I should probs go, bye
Cya bud :)
Cya^^
e.getClickedBlock()
How do I get the name of the block
from clicked block
i just checked the forums
i cant see anything
oh thats whats its called
Block#getType
So what is the standard way to send a packet to "all players that can see this".
I see this method in internals, but obvious it is unsafe:
@Override
public void playHurtAnimation(float yaw) {
/*
* Vanilla degrees state that 0 = left, 90 = front, 180 = right, and 270 = behind.
* This makes no sense. We'll add 90 to it so that 0 = front, clockwise from there.
*/
float actualYaw = yaw + 90;
ClientboundHurtAnimationPacket packet = new ClientboundHurtAnimationPacket(getEntityId(), actualYaw);
// TODO send packet to players in radius
// this is unsafe
((ChunkProviderServer) getHandle().getLevel().getChunkSource()).chunkMap.broadcast(getHandle(), packet);
}
Or is the standard broadcast all?
@Override
public void playHurtAnimation(float yaw) {
/*
* Vanilla degrees state that 0 = left, 90 = front, 180 = right, and 270 = behind.
* This makes no sense. We'll add 90 to it so that 0 = front, clockwise from there.
*/
float actualYaw = yaw + 90;
ClientboundHurtAnimationPacket packet = new ClientboundHurtAnimationPacket(getEntityId(), actualYaw);
// TODO send packet to players in radius
getHandle().getServer().getPlayerList().broadcastAll(packet, getHandle().getLevel().dimension());
}
does gradle have built in resource filtering? (so I can add ${project.version} in my plugin.yml?)
or do I need to install a gradle plugin for it
I use a gradle plugin... One sec let me get you a link
cool thanks
oh that one generates the the plugin.yml?
Yes
nice
oop thanks so much for that because next im gonna be adding modules for different versions lol
I have done that once before lol
Yeah that repo is funny because it:
- Compiles to 2 jar files
- Has a module for each NMS version (1.12+) (it actually has 2 modules.... one for each jar)
There should be a source player somewhere else invisibility isn't handled
Well this is in the living entity class, replacing LivingEntity#playEffect(EntityEffect.HURT)
There isn't a player involved (except for the people receiving the packets)
Looking at the source for playEffect, they use broadcastEntityEffect, which doesn't apply anymore since in 1.19.4 we have to use the ClientboundHurtAnimationPacket
Build file 'C:\Users\selen\Dropbox\GlitchMC\Hordes2.0-1.8\build.gradle' line: 87
A problem occurred evaluating root project 'GlitchMCHordes'.
> No signature of method: build_cs1dxgpbzjvnqu203tc6dv6un.bukkit() is applicable for argument types: (build_cs1dxgpbzjvnqu203tc6dv6un$_run_closure6) values: [build_cs1dxgpbzjvnqu203tc6dv6un$_run_closure6@49a9e221]
Possible solutions: wait(), wait(long), mkdir(java.lang.Object), uri(java.lang.Object), split(groovy.lang.Closure)
plugins {
...
id 'net.minecrell.plugin-yml.bukkit' version '0.5.3'
}
...
/* line 87 */ bukkit {
main = "dev.selena.glitchmc.GlitchHordesMain"
authors = listOf("Selena", "GlitchMC")
depend = listOf("WorldGuard")
softDepend = listOf("PlaceholderAPI")
}
``` hmm
(Following what it shows on the github for groovy)
using intellij?
yep
Don't click refresh gradle when installing a new plugin, click the one that looks more like a file
After that, click the refresh gradle
(at least I think that is the issue)
Do you know of a good example method I can investigate? I mean, you'll be reviewing the PR at the end of the day, so I gotta make sure you like it.
nope didn't work Ill just restart intelliJ
invalidate caches and restart is not a bad bet
never actually used it lol is there much of a learning curve
hm guess not :/
then minecraft has minus degrees too ๐
Minus 180 & plus 180 = 360
in between 0
huh the bukkit task has not been added to my task hierarchy
I just made that design choice since a similar (approved) PR made that design choice
trying to keep things consistent
I remember I had this issue with shadowJar but I don't recall how I fixed it
for some reason the issue is regarding these
depend = asList('WorldGuard')
softDepend = asList('PlaceholderAPI')
if I remove them it works fine
i changed the config for my pom.xml to output the plugin in the plugins folder in my localhost, the problem is that, i literally get folders with my stuff in .class.
pom: https://paste.md-5.net/jisudugevi.xml
Folder:
Having an issue with this still
build.gradle https://sourceb.in/uYc9otHdWt
error when trying to reload project https://sourceb.in/j8VoPsAwVM
(I have identified that the error is related to this depend = asList('WorldGuard', 'PlaceholderAPI')
nope just tried changing
nice
sowy idk gradle ๐ซค
i just know the basic of java
ye dw Im still learning gradle XD
if I have an old instance of player
and said player leaves
and then they rejoin
and i try to run functions on the old instance
like teleport
what will happen
i know i should just try it
but im too lazy
Play sound or effect might
Yeah play sound used a slightly different method, but they used volume * 16 for distance... I don't know what arbitrary number I should choose.
I opened the PR here https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/pull-requests/858/overview
Right now it just sends the packet to everyone.
md 5 if I get an offline player object while a player is offline
and then later they come online
two questions
first will isOnline become true
on the old offlinePlayer
and second is it safe to cast this offlinePlayer to Player
- probably; 2) no
I can change it to use the same method as playSound with an arbitrary distance if you'd like... 96 should be more then enough.
better question might be: why are you storing an offline player instance (could be a workaround)
There's absolutely a method - have you checked the entity tracker?
im not im going to store a uuid
I was just curious what would happen
yes, md_5 ^
but this has an unsafe cast that I'm not sure how to avoid
that is the backend code that entityeffect used... I am not too familiar with NMS, so if I just do an instanceof check and return otherwise... I don't know the sideeffects. Like, would this make the method unusable in certain situations?
Check the swing code above your method maybe
public void swing(EnumHand var0, boolean var1) {
if (!this.swinging || this.swingTime >= this.getCurrentSwingDuration() / 2 || this.swingTime < 0) {
this.swingTime = -1;
this.swinging = true;
this.swingingArm = var0;
if (this.level instanceof WorldServer) {
PacketPlayOutAnimation var2 = new PacketPlayOutAnimation(this, var0 == EnumHand.MAIN_HAND ? 0 : 3);
ChunkProviderServer var3 = ((WorldServer)this.level).getChunkSource();
if (var1) {
var3.broadcastAndSend(this, var2);
} else {
var3.broadcast(this, var2);
}
}
}
}
They do the instanceof
I'll update the PR
Level will always be server
md_5, what are plans regarding Material enum due to recent changes in 1.20 snapshots?
I was writing a small library that really made use of the enum. I have no idea how I could prepare from it.
What does 1.20 change that would require the enum to change?
Mojang yeeted most of their material stuff this snapshot```
There are plans underway to change the way many enums in the API are handled so that custom content can be better supported. These changes are not expected to break most plugin jars (backwards compatibility will be provided), however they may unavoidably break plugin source code (though the Maven version will be bumped if this occurs). To reduce the risk of breakage, please consider avoiding the use of switch statements and EnumSet over enums which implement 'Keyed'.```
I make use of Material.valueOf throughout all my plugins
Guess I will have to refractor to Material#getMaterial
Oh that was announced I believe in the 1.18 spigot update? To watch out for enums.
valueOf should still work since they will implement the valueOf function (to try to keep backwards support)
thanks, just don't look at the code ๐
Randomly crashed client[23:34:00] [Server thread/INFO]: CommandBlock at 211,64,-140 issued server command: /killall monsters world [23:34:00] [Server thread/INFO]: MrnateGeek lost connection: Disconnected [23:34:00] [Server thread/INFO]: MrnateGeek left the gameReason: Update video drivers
You had that issue before where MineCraft just crashes for no reason as shown above?
Theres literally a billion reasons why the game may suddenly crash
mf
lol
got ripped off by an AI nothing new
Seriously weak AI if thats all it can remember before going off the rails.
does it do the same if you ask it to recite the digits of pi separated by spaces?
better than this
lol
keeps asking for "continue generating" even though i told it not to
i need 3 glasses to read this
good
I am attempting to make a command for my spigot plugin (I am also using the wiki for help) and I am wondering how to add sub commands (i.e. "/example a" "/example b" and so on)
do I just wrap a command in a command inside plugin.yml?
check arg length and switch args[num]
Only the /parthere notarguments like this
parthere should be declared in plugin.yml
here's an example
so i make a switch and put all of the subcommands in unique cases?
you should also check the length so you dont get errors
so, for example, if I only allow length 1 will /example a b just not do anything? if so, would I have to increase the maximum length in order to make commands like /example a b c?
with a, b and c all being different arguments
like player, position et cetera
you would probably want to if (args.length < 3) return false so that would work with out the rest, but if it needs them use ==
how would I make one command require two arguments and one require like 5 arguments for example?
if (args.legnth != 2) return false
if it relies on sub commands check if it has atleast one arg, then check for more
couldn't i just wrap the if statement into each case and tweak it to how many arguments must be provided?
you can handle it in ifs, but early returns are better in this case
for now i'll just wrap the if in every single case as i believe that's easier, but of course, i can tweak that in the future.
also, what is args[]? I'm assuming it's a list, right?
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
it's an array of strings
thanks
also, does args.length include the subcommand itself (i.e. does /example a have 1 argument)
thank you
also, how do i send a message to a player locally (i.e. to send an error message in chat). do I need to use tellraw?
Player#sendMessage
thanks
how do i include two .yml files in the plugin folder? just by making a new file/folder in resources?
no need, he's talkign about a plugin.yml and a bungee.yml
no i'm not
i'm talking about language files
ah, not same as yesterday then
nope
so properties files
en-us.yml and stuff like that
so en-us.properties
you would make a .properties file for that?
would it matter if i made it a yml file?
No
i'll just stick to yml then considering i've never used properties files before
Or .lang?
no
I'd personally really use .lang, although I never bother with translations anyways
en_US.toml
:o
how is .properties ugly
its the main way in java
nerd
which you really want to use
since its integrated
"DaFeist"
en_US.lang looks 10x more clean
.toml is amazing!
how about we just use json :)
๐๐๐๐๐
lmao
back to the roots. lets use txt
yea
lets use hex
Lets use NO file extension at all
for each text a new file
lets use binary (.bin)
just dont use any text
lets use tyd
problem solved
Or use en_US.US
symbols are universal
oh so real godcipher
i'm intentionally calling my en-us language file en-uk to annoy the hell out of people
death
lol
Omg if imma make a new file ext the next time imma make .sus
it's already working
en_UK.amogus
en_UK.toml
Or en_UK.sus
beautiful
Lmao
en_UK.languagefile
nah id rather in real life
oh fairs

wanna do it together?
bet
i'm going to intentionally make a custom parse file for parsing a .amogus file and i'm going to add a amogus_IMPOSTER language file
im not gonna say any more before I get in trouble ๐
There is an event when a player place a block?
Any one Have Any idea why this not working java if (chest.getPersistentDataContainer().has(new NamespacedKey(plugin, filenamelol + "-Chesttrue"), PersistentDataType.STRING)) { System.out.println("2"); player.sendMessage(TreasureHunt.Prefix + ChatColor.RED + "Sorry But This Chest Is Aready In Chest List, Try Again!"); player.playSound(player.getLocation(), Sound.ENTITY_VILLAGER_NO, 10, 29); return; } it should check if this chest have NamespacedKey that called filenamelol + "-Chesttrue" but when i run it, it not working there are no errors or soemthing like that and How to Then All NameSpacedkeys of the chest to check it really set to the chest or not
Is there anyone available to provide a brief answer to my question?
a block doesn't have a PDC
second, since you are not supposed to throw NPEs yourself
Yeah but from my experience its gone when the state gets updated
Maybe it was a bug, or maybe its normal, idk
I can only always tell people to use CBD for blocks
That works reliantly at least
this Enchantment i use block data
It should work just fine with the state being updated
And unlike your block data you donโt have to worry about removing it manually
It also does this automatically
wait when it reload server or something like that it should keep not gone or anything
huh
Does it handle every way the block could be destroyed
Thereโs at least no open issues on github
Spigot? Github?
All fun and games until someone worldedits the block away
Yeah thatโll be leftover then
Thank you for your answer. I have modified the code as you suggested. How does it look?
import java.util.Objects;
public class PreCondition {
private PreCondition() {
throw new IllegalStateException("Utility class");
}
public static void nonNull(Object object, String message) {
if (Objects.isNull(object)) {
throw new IllegalArgumentException(message);
}
}
public static void nonNullOrEmpty(String str, String message) {
if (str == null || str.isEmpty()) {
throw new IllegalArgumentException(message);
}
}
}
But at least it works, people constantly have issues with PDC on tile entities
PersistentDataContainer customBlockData = new CustomBlockData(block, plugin);??
Yes
Customblockdata
Gotta get that BlockBecomeAirEventโข๏ธ
this what i want thank you! https://hub.spigotmc.org/javadocs/spigot/org/bukkit/persistence/PersistentDataContainer.html
declaration: package: org.bukkit.persistence, interface: PersistentDataContainer
pr it
I know, and thats what CustomBlockData does
BlockTypeChangeEvent
Big brain
How performant are they?
same as every other persistent data container
Like do I have to worry if I read a stupid amount of them in a second
no but if you really store a huge amount, it slows down chunk loading
it's NOT meant for huge amounts of data, same like every other PDC
in the end, it's just regular NBT data
wasnt also there an exploit where you could overload chunks with nbt data
You still can
So its no issue if I read like 200 blocks/tick?
should work just fine but you gotta try it out
Ok
I mean im kind of interested in coding a house system in the future, thats why I just wondered what I could use
The thing is that this obviously needs precise regions
That can be checked very quickly
I think the main issue with an event that catches any block change is that it might be really heavy
Granted probably still not as heavy as the physics event
if you change 2k blocks it probably will lag
Itโs a shame because it would also be very convenient to know when a block changes to air for any reason
Can pdc be read async?
could call it async
or dump it together, which would be harder to make and understand and use
adding onto this btw, what arguments would I need to provide to load a yml file from {pluginFolder}/lang/
What like all changes in the same tick?
Thats a really good idea
possible, but it would be very confusing on multiple changes
It would also lead to people making big loops
Which isnโt ideal for performance either
thats their problem
User error
Hmm
i mean you could test it and benchmark it
If md does not accept the PR then, imma write a mixin-injector and make it myself ;)
means displayName returns null
probably not
To avoid repetition I created a command /cc cps [player name -> target] and I don't know how to call this cmd from a player?
paper moment
thats great
ะัะพ ะฝะฐ ะ ัััะบะพะผ ัะฐะทะณะพะฒะฐัะธะฒะฐะตั
Player#chat("/cmd") or Bukkit.dispatchCommand iirc
I prefer monke
english
Alright thanks.
Omg I gotta call my next API "monke"
Who speak Russia
spigot api is better, if you use paper api cant publish on spigot and you loose support here
nobody, speak english
And who know write mods?
Im sorry, this server is English only
?whereami
wrong place to write mods
i use... purpur
purpur api?
nah
rrrrrreeee
just for my server
i use nms
I use pure asm to write plugins
inject into server
tbh i find spigot quite slow when used on servers
buy a better server then
the thing is
there is a point where a better server won't make your performance better
what i mean by "quite slow" is it uses like 15% more cpu utilisation
what you want is the most insane singlecore speed you can get
thats nothing
for a private server...
thats because of singlethreading
the server i got rn has a 5950x so
mhm
but not the best
oh no it's a 5800x actually
VPS?
yes
yeah you can get about 45% more raw singlecore performance
then overclock it to hell
but then, you reached the limit
i've been forced to pay for a stupid premium plan because the lower tier literally gives you a XEON E5-1630v3!?
lmao
I have the feeling that is /2, I mean like if it was counting not the click of the player but the click of the player once there is not a cd. https://sourceb.in/X46rbNqRlU I do not know if it's clear.
Funcs who are adding +1 to counter or right_counter : https://sourceb.in/gRIMBieVn6
yeah thats a stupid cpu for minecraft
you don't want server cpus for minecraft servers
you want the maxed out high-end consumer cpu
(i9-13900KS is the best you can get rn)
my pc has a 3600x and 64gb of ram (i use adobe software, that's why) so i'd be better off self-hosting
host-unlimited has good servers
according to pebblehost amd is 10000000% better
they brag about it
???
if you don't care about money, no
bloom ๐ช ๐ช
from pure performance, intel outperforms amd
i mean i've switch hosting provider so many times
same
bloom is the current best
Why it counts the clicks of the player only when he has no countdown? https://sourceb.in/X46rbNqRlU
Funcs who are adding +1 to counter or right_counter : https://sourceb.in/gRIMBieVn6
for now, some friendly guy just gave me a free server on his homeserver on an i9-9800K
the issue with it tho is that I kinda need other server applications, not only mc
from shockbyte (ew) to apex to enderchest to cooekie to now pebblehost
fuck shockbyte
ikr
shockbyte was too good to be true (terrible performance), apex too expensive, enderchest closed down (it's back now), cooekie literally gave no documentation for anything and pebblehost is still expensive but also really good in terms of performance
bloom has decent plans and a good price
!dmca
?dmca
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
Someone plz :(?
i don't like the cpu
why not
3900x and 8gb for the same price as my hosting (which gives the 5800x instead)
for cheaper
someone who did a lot of work on cb
what does it mean "create multiple servers"
you can buy 1 plan, and run bungee off it
or multiple severs
you get to split it
Can someone help me plz?
whixch versions got removed
pre 1.8.8
pebblehost provides both a ded. ip and multiple servers
read the pins
spigot relies on craftbukkit
ok
the only reason spigot exists is because of buildtools
ok
Read the code.
we love forking a fork of a fork of the fork
stop being impatient
the spigot versions before that still exists just not through bt
or we'll just ignore you
5 on the same subject is very useful :>.
?
a few of my questions were not answered but I didn't spam people begging for them to answer, did I?
This code is goign to cause so much lag
lol
?
you are saving the config on every damage/click
Yeah and because it's a test?
massive lag spikes
It's not for a "server".
Just tests.
Idc if it's lag, I am alone.
I have no lags with my alt as well.
server lag
We are stating facts, not arguing
I will use a database or json/yaml file for example if it was a real thing for a server.
not client lag
even a database is going to lag unless you do it all async
๐คทโโ๏ธ nvm.
btw how do I load a yml file from {pluginfolder}/lang/
File file = new File(new File(plugin.getDataFolder(), "lang"), "lang.yml");```
tysm
in your code you never actually increase the counter in yoru config. You only count to 10 then reset
ah you do
Look at events method I gave and what I do before the counter.
config.set("cps." + target.getUniqueId() + ".enabled", true);
config.set("cps." + target.getUniqueId() + ".counter", 0);
plugin.saveConfig();
if (config.getBoolean("cps." + player.getUniqueId() + ".enabled")) {
....
}
So what was your actual issue again?
When I get the final result in 10s, -> CPS/10.
But when I see the result, it's strange, for example with my mouse + a macro I do in normal cases 16 CPS and no "8-7" like it shows in game.
I very much doubt every click will be sent from teh client
I also doubt it. Otherwise it'd be a great way to DDoS a server just with an auto clicker ;p
How can i send a PluginMessage from the Bungee to a Server like Spigot? I searched through the forum on SpigotMC but i just found the same question but no answers. I want to send data to the spigot server without the player receiving that data.
And how do you know the CPS of a player then ?
when click:
add 1 to some counter for the player
wait 1 sec
remove again from the counter
somewhere:
get the counter of the player
...
:D
from here do I have to use .getConfig() to actually load the config to use stuff like .getString()?
you have to use yaml config provider i think
FileConfiguration.load or something
You don't
that doesn't exist
atleast in bungee and spigot has built in but its for config.yml. you could search up for an "config api / lib" and then permantently borrow their code
And how a modo check CPS then :>?
Not unless the client actually track it and sends to the server
?
modo?
Moderator.
make a command?
a Moderator?
bro is making anticheat
github is your best friend
There isn't really a way to do this. Bungee's plugin messages sort of hijack the plugin messaging channel which is between the client and the server. It uses a connected client's channel to receive messages from another server. If there's no player, there's no channel to hijack.
The solution is often to use an in-memory database like Redis which has a pub/sub feature
Well explain me then : https://gyazo.com/2d9733bdf57bcfd6d7fbbd1ef60a5202
If you're heard of RedisBungee, the entire premise of that plugin is exactly that
I'd guess a Mod not a plugin
go on github and try find some source code?
It's a plugin ๐คทโโ๏ธ.
Yeah i should prob use db messaging but im too lazy for that. Also it should be possible since the client sends their brand to the server so the proxy could do that too sending a payload / pm to the server
called what?
It's getting CPS of the player.
. of which you can inherit
If anyone intends on making a large proxied network, they should have a Redis instance
Great for synchronizing data
https://github.com/Geo25rey/CPS-Limiter/tree/master immediately found this @dense falcon
yeah that doesn't exist.
YamlConfiguration.loadConfiguration
ye that one
thanks
You can set it to null
?
^
Yeah, so you can set it to null
config.set("key", null);
Yes
Just be sure to save the file as well in order for the changes to be written to disk
config.set(โChocoโ, null)
I just looked at the CheckCheat plugin source. It's as badly written as yours ๐
yuea
It does nothing special
i also found this. is this any better?
Ok and why "badly" ?
...
It also loads a config during the PlayerInteractEvent
which will conveniently lag the server to hell
final YamlConfiguration config = YamlConfiguration.loadConfiguration(file);
And what do you purpose to save a data ?
this is your code btw
Config is file which is VERY slow. You do not save/load in an event
Yeah and I use what then?
json?
JSON would also be a file
database
Keep things in memory until you need to save them persistently. You can do it periodically asynchronously
as you are not retaining the data, you reset to zero after 10 seconds you have no need at all to save it
...
THIS IS #help-development
That's a message link
Yeah why not.
I know it's uselesss to save it.
in CheckCheat he at least does not save the data, he stores in a map
And how they got a map from another class which is inaccessible?
all he is using teh config for is to see if teh user is verified
Imagine a command + events.
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
The alex link will likely be simpler to read
Well alr.
It's not about CPS but velocity, I used my hand + sticks and do you think these values "are good" ?
// Not moving : 0.0, 0.0, 0.0
// Running : 0.02, -0.2, -0.2
// KB 1 (do not move) : 0.0, 0.1, 0.0
// KB 2 (do not move) : 0.0, 0.3, 0.0
You are going to have to use more words
?
Heโs trying to code an anticheat or some shit for velocity cheats
Tests.
used more than punctuations
I am trying to check if someone has an anti kb with a cmd.
You are not even telling us what you are testing
Thatโs literally what I just said
which means you're testing an anticheat module
Jesus Christ
It's not for an anticheat ๐คทโโ๏ธ.
Anti cheat should ban instantly.
no?
It's not that.
๐
You have to enter a cmd to ban etc you with an anti cheat?
no?
ok, I'm sorry I'm not here to help you test random things. If you actually need help with something ask a cogent question with a goal.
Moderator commands are like this, an anti cheats detect cheats auto and ban instantly if they are good.
They do :>.
and the owner of the server will decide what to do
Nope lol.
No one cares
Anticheat do not just detects cheats lol.
hmmm. i wonder where the name "ANTI CHEAT" comes from
https://youtu.be/SvbqRJX54ns look at this for example.
we don't speak spanish
It's FRENCH OMG.
Anti cheats just detect cheats. You can turn on options that will make them autoban but that is optional. They can just warn a mod when it thinks someone is cheating
you're both contridicting yourself and proving my point
^^^^
you're both contridicting yourself and proving my point
once again
Well I can not change you, I did not know you can not understand what means "auto ban".
autoban isn't an anticheat at all
"Turn options"...
autoban isn't a thing
if it was, you would have 0 players
... because it would ban everyone
I have never heard so much boulshit. "If there is auto ban you would have 0 players", bro use your brain?
bro really tried to cuss and completely messed it up ๐ญ
I didn't know that an anti cheat with "auto ban" bans everyone :>.
Definition from the Urban Dictionary for 'Anti Cheat': "A program made to detect cheaters and people using unfair advantages in video-games."
no mention of banning there?
Anti cheats have a lot of false positives
So most servers donโt just ban everyone they detect
they flag them in chat
which then lets admins review
yeah
smaller servers would typically make it automatic due to the lack of staffing
And if youโve got a real complex system you can have something like hypixel where admins can replay the instance after the fact
And then you could avoid having to have staff 24/7
yeah.
This wouldnโt even be that difficult hooking up an anticheat to that one plug-in thatโs like replaymod
I have a plug-in idea
is it an anticheat like hypixel's?
don't make it paid if you actually make it
But not even
for the love of god
Iโm just going to hook into an existing anticheat
spigot forums
Much easier solution
github (best)
Just hook into one that already exists
fair
And hook into that replay plugin
And it would always be recording and save the previous 30 seconds after a detection
hook it into nocheat+
Yea thatโs probably what Iโd do
it's openly sourced under gpl-3.0
How can I customize the name tag of each players? instead of a plain name
in a plugin or no?
like are you asking in terms of programming or plugin management
programming
ah ok
Oh but Iโm going to make it 1.19 because fuck 1.8
Even though thatโs most of the potential users
My@idea is falling apart
Oh well
How can I spawn heads with a custom id/tag or something else ?
indeed, fuck 1.8
?jd-bc
when i try run my command, it ALWAYS prints out the command name to minecraft chat
doesn't run anything it's supposed to
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
code
no it hasn't appeared
then you didn;t create it nor save any language files
then how am I meant to do that?
saveresource
in app.java?
uh?
files
will the folder also sync over
unless you want to leave them in the jar
if you leave them in the jar you can read them from there
easier to update too
then how would i do that
plugin.getResource("lang/en_UK.yml")
instead of using File
loadConfiguration(new InputStreamRerader(plugin.getResource("lang/en_UK.yml")))
so i replace file with this?
i'm getting really confused now
๐
also
on the spigotmc wiki
it says i need to register the command
... but where do I register it
in your plugin
no like
usually in onEnable
can you have more than one onEnable
no
hi
then how do i put it in app.java!?
You need to follow a tutorial if this is your first time making a plugin
getCommand("yourCommandNameAsYouWroteInThePluginyml").setExecutor(new Commands());
oh
in the wiki it's new CommandKit not new Commands
and new Commands doesn't error
so
uhhh
misleading wiki!!!
anyways
back to the language file stuff
do i just do this?
or do i put this instead
second one, plugin being yoru plugin instance
where do I put it? app.java I'm assuming right?
depends
if you set it when you start the plguin yes
FileConfiguration languageConfig = YamlConfiguration.loadConfiguration(new InputStreamReader(this.getResource("lang/en_UK.yml")));
can i give this animation to item oninteract
or this client side ?
for example here will be paper
im trying swingmainhand
"Cannot invoke "org.bukkit.plugin.java.JavaPlugin.getResource(String)" because the return value of "co.uk.robuxtrex.Commands.getPlugin()" is null"
FileConfiguration languageConfig = YamlConfiguration.loadConfiguration(new InputStreamReader(getPlugin().getResource("lang/en_UK.yml")));
getPlugin() is your own invention. it doesn't exist
how do i get the plugin then lol
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
or you use yoru static instance
App.getInstance()
thanks
i've already done all that static instance stuff
private static App instance; {
instance = this;
}
public static App getInstance() {
return instance;
}
The method getPlugin(Class<T>) in the type JavaPlugin is not applicable for the arguments ()Java(67108979)
oh yeah
delete getPlugin()
how do I add to this list in my config file in my java code?
players:
- "example"
List<String> players = config.getStringList("players");
players.add("newPlayer");
config.set("players", players);
config.save()```
The method save(File) in the type FileConfiguration is not applicable for the arguments ()Java(67108979)
and
do i need to reload the config after?
Hello who encountered with problem with colors in console? In console see this message:
[21:12:15 INFO]: ยง6-> ยงfGreenLibrary ยง6(Version - 1.0.0.b50) <- ยงfSuccessfuly load file ยงbDatabaseSettings.json
this code
Bukkit.getLogger().log(Level.INFO, ChatColor.translateAlternateColorCodes('&', "&6-> &f" + info.getName() + " &6(Version - " + info.getVersion() + ") <- " + msg));
Maybe have a solve for this problem?
Remove colors?
Simple solution ^
no colors doesn't work
Cap asf how else are you supposed to stimulate your brain while looking at logs
yeah i was lying, you have to love looking at rainbow while actually looking at logs
subway surfers gameplay
Personally my panel supports Colo codes stay mad
Colors make the serotonin go brrrrrr
I'm ask how this fix..
plugin.saveConfig()
if it's your plugins config
ty
someone give me idea for setblock to location with state
set block after setblock data with scheduler is good idea ?
is there a better way?
wanna see my code ?
bcs i need get block up
public class Crops implements Listener {
@EventHandler
public void onPlaceSeed(PlayerInteractEvent e) {
Player player = e.getPlayer();
Block block = e.getClickedBlock();
ItemStack item = player.getInventory().getItemInMainHand();
ItemMeta meta = item.getItemMeta();
if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (item.getType() == Material.PAPER && meta != null && meta.getDisplayName().contains("test") && block !=null && block.getType() == Material.FARMLAND) {
player.swingMainHand();
World world = block.getWorld();
world.playSound(player.getLocation(), Sound.ITEM_CROP_PLANT, 1,1);
Block up = block.getRelative(BlockFace.UP, 1);
}
}
}```
alright
So you can just do up.setBlockData
id love block?.getType() in java
Kotlin moment
c# moment
How can I spawn heads with a custom id/tag or something else ?
kek
C++: Get fucked
Python?
That will work but you can simplify it
this will not work
how ?
why
Block wheat = block.getRelative(BlockFace.UP, 1);
Ageable age = (Ageable) Material.WHEAT.createBlockData();
age.setAge(1);
wheat.setBlockData(age);
i don't understand dude if u don't show me this how i was learn this ?
๐
Or that
If you're feeling sneaky
I am genuinely looking forward to being able to create generic BlockData though
Ageable ageable = BlockType.WHEAT.createBlockData(); 
Yes
That's why I used BlockType
freakin' dumdum head
you think i would even remember that?
in a command, is args[1] the subcommand itself or the first argument?
2nd arg
no
tnx
so args[0] is the first argument?
Yep
can i ignore nullpointerexception at this code ? ?
public void onPlayerInteract(PlayerInteractEvent e) {
Block block = e.getClickedBlock();
if (e.getAction().equals(Action.PHYSICAL)){
if (block.getType().equals(Material.FARMLAND)) {
e.setCancelled(true);
}
}
}```
no
I mean you can if you want lol
dont you dare use #equals for that
Or you could just do a null check
if you do that im taking chocos dogs
Theoretically, yes, you could ignore it. There are no instances of physical interactions that don't have a block. Though that's not to say there won't be one later down the line. You're always best to do a null check just to be certain
i do but always will be true
