#help-development
1 messages · Page 63 of 1
The provided scope results in the dependency and all it's transitives to not be shaded in
why is that weird
well, never shade spigot/api
Ah Right
never shade other plugins, like vault nor protocolLib
So i have to exclude spigot-api from utilityPkg?
no
Eclipse's autocomplete says following thing about provided:
This is much like compile, but indicates you expect the JDK or a container to provide the dependency at runtime. For example, when building a web application for the Java Enterprise Edition, you would set the dependency on the Servlet API and related Java EE APIs to scope provided because the web container provides those classes. This scope is only available on the compilation and test classpath, and is not transitive.
just set everything you don't wanna shade to "provided"
Thanks, I understand that, my question is what I shouldn't shade
If "utilityPkg" declares "spigot-api" as "provided" it will not be shaded in
even if you set "utilityPkg" as "compile"
it shouldn't be shaded in right?
generally, "everything" is what you shouldnt shade
Things, that are already provided, Spigot-Api and for ex. Libs declared in plugin.yml
Wait what?
When it's a library you probably have to shade it
When you're depending on a plugin not
However if "utilityPkg" declares "spigot-api" as "compile" it will be shaded in if "utilityPkg" is declared as "compile". You need to manually exclude "spigot-api" in that case
New-ish versions of spigot provide support of "libraries"
do you use any libraries? if so you will notice if they need to be shaded
They are basically downloaded at runtime and needn't be bundled (shaded) with your jar
Only declared in your plugin.yml
a library's readme will tell you if it needs to be shaded or nont
Sorry, declared as compile? Is that something a scope thing?
Yeah, I am talking about scopes there
Oh okay, is providing no scope considered compile?
yes
Yes
I have rarely seen libs that needn't be shaded (outside of lombok or whatnot I guess)
well
Ah okay
stuff that's already in spigot
e.g. apache commons
guava
But it won't be in the lib's readme page
well thats what I said
It needs to be on the classpath somehow
I said "they will tell you if shading is required"
Which is always the case
Java won't magically add classes to the classpath
I know
Okay great, so: I shouldn't shade spigot, and libraries that don't* need to be shaded according to their Docs, and shade everything else
the general idea is to shade nothing
Okay actually Vault and Protocol-api and other plugin-apis that take the form of plugins needn't be shaded now that I remember
then if you get a NoClassDefFoundError, you can set whatever's missing to "compile"
Ahh right, someone said something about it being downloaded when run?
this one
that's the libraries feature from plugin.yml
That is only done if you declare it manually in the plugin.yml
Oh the softdepend, depend and the such?
nah, that is for plugins
Ah okay didn't know you could declare deps in the yml
you should just stop worrying so much about it and set everything to provided
yep i ma just not shade anything and run it
there is no such command
l
jesus, how stupid is this
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Is there an easy replacement for the /fill command in code?
just use worldedit
Nested for loops
thanks very much guys
?plugin.yml
https://www.spigotmc.org/wiki/discord-commands/ I once made this list of available commands but there is no plugin.yml one IIRC
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
loop over the blocks and do setType() ?
?plugin-yml god damn it
See the pins in #spigotcraft
someone should add it to the listt
Hmm, how would I loop over blocks, set a minimum x y z and a max?
with a normal for loop?
oh?
This is why we need /commands
for(int x = -5; x <= 5; x++) {
for(int y = 64; y <= 128; y++) {
for(int z = -5; z <= 5; z++) {
// do something
this wouldd loop over all blocks between -5,64,-5 and 5,128,5
yes
Yes
Ok thanks
where these removed from the json library at some point or am I doing something wrong? json-20220320
ok so do I need an older library?
pfp ran away?
As you see that library is outdated AF. I recommend migrating to other json parsing libraries
but what if I wanted to fill an area from 0 0 0 to -10 5 10
I could just change it to -- instead of ++ but id like this to be in a method
?
dont start from 0
Yeah just adjust the numbers lol
void fill(int fromX, int fromY, int fromZ, int toX, int toY, int toZ) {
for(int x = fromX; x <= toX; x++) {
for(int y = fromY; y <= toY; y++) {
for(int z = fromZ; z <= toZ; z++) {
world.getBlock(x, y, z).setType(smth);
}```will this work?
Thank you so much I thought I needed just org.json
public void fill(int x1, int x2, int y1, int y2, int z1, int z2){
int xMin = Math.min(x1, x2);
int xMax = Math.max(x1, x2);
int yMin = Math.min(x1, x2);
int yMax = Math.max(x1, x2);
int zMin = Math.min(x1, x2);
int zMax = Math.max(x1, x2);
}``` can do this so you dont ahv eto check which is smallest
oh yea
you are 15 minutes ahead of me then
well nearly 2pm
15 minute time zones would be wack
remember 1000 years ago? there were no timezones
every city had its own local time
pepperidge farm remembers
was just kidding
lol
I can't type
since i've never really posted on spigot so I needa create 20 posts now
xd
they will just get deleted and you'll get a temp ban or warning if you're lucky
at least post your spam in offtopic instead of dev forum
.l
How can i send 2 respawn packet
Without making player stuck in terrian loading.
why do you need two
If i send 1 the player will be broken and cant interact with world
Can you do this?
Thing()
public void Thing(){
//Do something
}
(ie. call the method before it has been... set?)
What is wrong ?
Yes ?
its just so weird to me, since the method hasnt really been set yet
that makes no sense
you cannot invoke methods outside of code blocks
:l
only javadoc warnings, and one from md5's plugin
What are you sending a respawn packet for anyway
Skin reload
I already posted code to show you how to change skins safely
found why my code wasnt working lol, i was working with an invalidated player object :/
There are some method as: p.show/hide && EntityDestroy && respawn&& change dim
All tried out
I posted full code to change skins. fully working
May i get the post ?
do plugins load after the world loads?
need a way to check if the plugin is reloading in onEnable
i need to check in in onEnable :(
if empty is a startup, if not its a reload
set a boolean flag in onLoad
read it in onEnable
ive been thinking the whole night about my code lol
Protocol ?
nope, thats mine, posted a few posts later
🙂
i lost all my braincells
Is there a way of changing the players prefix while changing their name?
But it finally works!
all of them?
Is there a way to disable this on the server?
Nevermind, I can just use scoreboards
prefix is not a Profile thing
i assume you want to code something to remove it?
or you want precoded plugin
check out my spigot page then 😄
What is it?
AntiPopup is the plugin name
it does what you want + removes warning on join
yes
Very cool thanks
youre welcome
whotf added that
is that the new 1.19 thing
I cant use Spigot with gradle
It builded successfully but i cant import them in Main Class, what should I do?
show your build.gradle file
?paste
hmm nice comments
smh cant userMap.computeIfAbsent(id, storage::loadPlayerSync)
do File -> Invalidate Caches -> check everything and click o nrestart
So, I have this method to select a hunter from the players in a provided world:
public List<Player> getHunter(String world) {
List<Player> players = new ArrayList<>(Objects.requireNonNull(Bukkit.getWorld(world)).getPlayers());
Player hunter = players.remove(new Random().nextInt(players.size()));
Player hunter1 = players.remove(new Random().nextInt(players.size()));
List<Player> hunters = new ArrayList<>();
hunters.add(hunter);
return hunters;
}
And this method to retrieve all players that are not hunters
public List<Player> getNotHunters(String world, List<Player> hunters) {
List<Player> players = new ArrayList<>(Objects.requireNonNull(Bukkit.getWorld(world)).getPlayers());
for (Player hunter : hunters) {
players.remove(hunter);
}
return players;
}
The problem is: sometimes players are both a hunter and a not hunter, as well as the hunters receiving two messages each somehow. This is how I call the method:
https://pastebin.com/rrRfwD3i
It is also set up in the main class like this:
https://pastebin.com/9YbQKtDm
The hunters and not hunters lists are also cleared after the game, so I'm really confused
have they changed entity.teleport?
https://pastebin.com/jnynJdKq
Seems to increment only by .5 in chunks
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.
hmm the return value of someMap.computeIfAbsent(key, key -> null) when the entry is not present should be null right?
still same
yes
hm then no idea
i dont understand why intellij doesnt suggest to suppress this warning, as it's obviously pointless and there is no other solution than to suppress it
there is no suppress there either
you are worried about the wrong thing 👁🗨 👅 👁🗨
ah then do it yourself lol
mye sometimes it gives some useful things
hehe
type erasure coming at u
or split into declaration and assignment bruh
yea
yeah and everything is instanceof Object
thats even more trash
girl dont be dissing intellij
Are primitives instanceof object
well
no but they cant be used in generics anywway
It is
I got ultimate, that allows me to insult it sometimes
lol
shoulve used netbeans smh
i get ultimate for free
how can I nick a player with name and skin like whats the packages (1.18.2)
I like to keep my collections on full display
getOrDefault with null as default is just get impl
and beef jerky
then it seems like it indeed doesnt get called
although thats hard to believe
@SupressWarnings("unchecked")?
ik
youre a cat arent you
I just wonder why it doesnt suggest it
I’ve never had issues with the event
nah it does
Granted I don’t think I’ve really used it on armor stands
it doesnt, I sent screenshots
?
I have a list of two players, how can I disable these two players from damaging eachother
j hbtnm,
@SuppressWarnings("all") heheheh
listen to the damage event then check if both are in the list?
Put that at the top of every class file
ok il ltry that thanks
genius
i had that on top of my utils class
lmao
is there a way to the the
this dude looks so shitty
how can people find this dude attractive
I have a lot of @supresswarnings(“deprecation”) classes
peoplee think you are shit
Thanks paper api
and nobody cares
is it possible to make a creeper afraid like absolutely petrified, flabbergasted of a dog like it is of a cat?
some people do think that, yes
yes, add the proper goal to the pathfinder thing
but not sure whats it called
it might expect a Cat object and not a generic mobb
It probably takes a generic mob
see if the generic EntityDamageEvent gets called
Since it’s used for other mobs too
many pathfinder goals take a specific mob
if it was only meant for those
no idea why
This one is used for several afaik
bru
what have i done :(
give me my role already
lets remove the weakreference ;)))
!verify @quaint mantle
Could not find your SpigotMC.org account!
What am I looking at
:[] tafuqds
Da heck is a lazy value
Hi, im trying to make a Nick Plugin in 1.18.2 with Skin + Name. But i cant find anything online. Do you guys have any clues/videos/threads that could help me ^^
Would be nice. Thx :)
Wait that’s amazing
something in rust inspired me to do that lol
so has scala
well then I also can't help :/
is that new? never saw it before
thats so SMART!
🤔
let's KISS
my father might be DEAD
how the turntables...
does anyone have a tool that can extract zips and organize them in a very good manner?
I have no idea, just try it
No
his work college said he didnt come to the job and doesnt pick up phone
I'm messing with call of duty files, extracting sounds for my own minigame
hmm hot stuff 🥵
yes, Winrar lol
interesting
yeah @hoary knoll throws
@SneakyThrows
@tender shard just to explain why unchecked cast is a warning level inspection
record Conclure(){}
record B<T extends Conclure>(T t) { }
interface A<T> { T t();}
//then
A<Object> o = (A<Object>) (Object) new B<>(new Conclure());
System.out.println(o.t());
would result in a class cast exception
smells like committing a crime
@hoary knollThrows
nah bro @hoary knoll why you be throwing 🙁
discord is so weird sometimes
compile time check u can use from the language semantically to stop it/make it less error prone
btw everyone
we just summoned a new Conclure() RUUUUNNN
quick reminder that you should check your discord bot intent settings, or they might go offline soon
I can confirm that armorstands should work fine with the EntityDamageByEntityEvent
I know this because I had problems with them bleeding
omg best captcha ever
einen wattes
yeah they added new captchas
was ist das
What
das ist der hCaptcha mein freund.
Is that giraffe in the centre
yes
they got conclures dog
it looks high off meth
nah
It looks like it’s neck got snapped
but was does that sentence mean
meth would be more apparent
oh no I just misspelled his name
caffeine knows their shit
swp saidd "this is hcaptcha, my friend". the captcha said "click on all birds"
I'm thinking about buying winrar so I can stop seeing these fucking prompts
7zip
^^
I mean
7z has better compression 🦾
Can you run PluginManager#callEvent asynchronously?
not for .rar files
wouldnt try
What kind of fancy zipping are you doing
Only for async events
yes
oh
yes, in constructor of events there is a boolean
^
which decides where the event can be called async or not
Most cannot
fun fact: in NMS, there's a "isFastFood" method/boolean on "Food" objects
and dried kelp is the only food considered fastfood
i need food
but i already ate everything
Fun fact: CraftEntity#getEntity(nmsEntity) is the most digusting thing that spigot could make
All hail the magic conch
best indiana jones scene ever
Fun fact: NMS is a package
fun fact: there's a quagmire sound category within the Call of Duty: Black Ops files
wow thank you
i can speak germn
Fun fact: you can use Player#getPing on 1.17+ without needing reflection and nms
ive been learning german for 3 years in school and dont know shit
hallo
ich bin german
too far
ich speak german very gutt
I always wondered why people need the ping anyway
i
to know a user’s ping?
and i got 49% on my german exam heheheeee
lol
For display reasons I guess
making a ping plugin or to visualize it somehow
and then? send them a message "pls get a better wifi"?
Like a scoreboard
simple, calculating which player the country the user is from and DOXXING them.
I
what the hell idid i say
^
I feel geoip is better for that
in the docs md5 even wrote it is for that and that only
not anticheat purposes as the client can spoof it
it’s also like a rolling average over 30s or something
so it should be used in a case where there’s no advantage in lying
yeah 20 on modern minecraft
:l all class doesnt exit in
it uses Mojang mappings
imagine using obfuscated mappings 😩
The before times were dark days indeed
yeah everytime I add new NMS stuff, it's just copy paste for 1.19 - 1.17. and then comes 1.16.X 😐
and everything is called a()
That’s why we shun old versions
I wouldn’t even have to update my plugins if it wasn’t for craftbukkit :(
Continues
quick, gimme ideas for stuff that can only be done with NMS
gud
hm nah
Player respawn :l
make boats panic
That need player to dead first
Make all mobs follow the player
already have that
But they only get 1 block away from you and then just stare at you
you don't need nms to simulate player death either
you likely have just bad design
Imagine if creepers just started at you instead of exploding
Kick them
or you could just teleport them show a short death screen of your choice
I have a wrapper for AI goals so basically everything AI like is already done https://github.com/JEFF-Media-GbR/JeffLib/blob/master/spigot_1_19_R1/src/main/java/com/jeff_media/jefflib/internal/nms/v1_19_R1/ai/CustomGoalExecutor.java
https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/ai/goal/CustomGoal.java
Nice
how can i nick a player + skin in 1.18.2
someone make a wrapper for me to support me
AtomicOneByte
I actually found something I couldn’t figure out how to do properly with NMS
Had to use protocollib
what is it?
ah, yes
hehehe
how about telling me what wrong with this
very good plot btw
you're using obfuscated / spigot mappings
that's what's wrong with it 😛
Hi im trying to make a Nick Plugin in 1
mess with block break speed
You don’t even need NMS for that really
Now that we have BlockDamageAbortEvent and Player.sendBlockDamage
I basically look for ideas to add to my lib. e.g. I today added a PDC -> string and string -> PDC serializer
I mean yeah but what about making blocks break faster
sendBlockDamage just sends a packet
what is the diffirent in temp of method here ?
except the way of maping
Use the arm swing event and just a counter
Have a look at hypixel mining system^
the client also predicts
will this work to see if the plugins jar is in the plugins/update folder?
try to just do this without the health check https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/ai/goal/CustomGoal.java
Hi, im trying to make a Nick Plugin in 1.18.2 with Skin + Name. But i cant find anything online. Do you guys have any clues/videos/threads that could help me ^^
Would be nice. Thx :)
oh wait
wrong link again
this @vital sandal
that's the craftplayer respawn() method
i dont need them to die ...
Just call the one line
?
oh actually this is something I could add to my libb
just a wrapper for respawn() without the need to die
What would that feel like in real life
awesome
if you need a video tutorial to make a plugin you want you are way in above your head learn more before continuing
i dont think they are looking for a "how to make a plugin video"
but more like "what to do to change player's name and skin"
bro I fucking want to know what the packages are
package?
thank you
that will not work
You got stuff for dealing with packet entities?
you need to send packets to update the names to other players
and skins have to be signed
how ?
do they really?
by not doing if(player.getHealth <= 0) ?
yes
I thought you could change skin atleast with PlayerProfile
only for heads, it works with unsigned skins
where is that method ?
100% sure
Afaik using player profile works for everyone but the owner
CraftPlayer class
afaik it works for noone if the skin is not signed
Huh
or if the signature is invalid
i remember how happy I was when PlayerProfile was added, until I found out that it's still useless
I'm seeing some older threads where it works fine withg base64/url
atleast according to the op
for heads, yes, but not for players
again I specifically looked at player skins
so i need to modify the lib itself ?
I am wrong very often
but in this I am actually quuiiiite sure
nno
you copy paste the code I sent
without the health check
actually no you were right signed only but you can still get url's for those skins pretty easily it seems
yes, getting the URL is easy. but if you just change it, nothing will happen if you dont have a signed texture
no idea why those signatures are required in the first place, but... mojang /shrug
lol there are still some pretty inventive ways to do it it seems
some server did it via item data on the armor
yeah anyway, if someone finds an easy way to change skins, please share the solution 😄
but there is no method respawn() for craftplayer ?
Hijack the users computer and make them physically change their skin
ok so I did a tad more research you need signed skins for them to look on the player try to look what this guy did and see what you can do https://www.spigotmc.org/resources/customskins.2983/
getHandle().connection.connection
Don’t question it
yeah since 1.17 the connection object is weird
1.16 is like player.playerConnection, 1.17+ is player.connection.connection
are you using mojang mappings?
nope
because it seems like you don't
spigot
Ewww unmapped
I won't even try to help people who don't use mojang mappings because it's just a pain in the ass, and not in the good way (scnr)
that's what he said
okay I'll get out
hope it gonna not crash all of my previous code
hm
if you used NMS, then it'll break
you will have to "translate" it to mojang names too
you can either go full mojang mappings, or full obfuscated
but you cannot mix it
okay in theory you could mix it but....
not a good idea
No point really
yeah well if someone already has 300 lines of obfuscated code, it COULD make sense to just keep it and add both, spigot remapped and spigot obfuscated
but yeah that seems like a bad idea
You’ll have to update that obfuscated code never version anyway
Might as well replace it now
Once I moved to mojang mappings I never looked back
true
!false
same for eclipse -> intellij for me lol
“IntelliJ is alright but netbeans is the best ide”
Pretty much
IntelliJ is a very resource intensive ide tho
IntelliJ is unbeatable tbh
Its not worth the resource cost for most people, esp college students that are learning
it have a free version
I mean sure if you’re using an i3
Wdym it takes like a 2gb ram
Most modern notebooks have at least 16gb
Not really, more like 8gb
You dont know what “resource cost” means lol
Chrome tab, minecraft, and intellij is borderline impossible on 8gb
just play modded :>
3.4gb
My computer has 8gb of ram
that’s crazy
mine has 16gb else ram
See there we go
my computer has 16gb tho so idc kek
I lowballed it lmfao
I can't have Minecraft open with intellij open 💀
open 8gb swap space
it take like 3W of power ;d
then u can have 16gb of ram
talking about RAM... eat this
3w is literally like the plastic corner of a gpu
no one cares about your 128gb dedi :(
when do I get one alex
it has an additional 128gb of swap
is there any mojang mapping for 1.16.5 ?
no
;<
mojang mappings for spigot started in 1.17
Not on spigot
so how could i fix mine problem
check out the source code and see which method is the respawn one
or wait until I did it
Best resource which I've never figured out how to use is minimappings
minimappings is broken
hey Alex, what’s your swappiness 😏
Is it
screamingsandals is better imho
It worked when I used it
yes
in org.bukkit.craftbukkit.v1_16_R3.entity.CraftPlayer right ?
unless your browser allows cross site scripting
yes, CraftPlayer.Spigot
I will tell you the exact name in a few minutes
how to open it :l
this is so sad
ctrl+b while on the class name
dead cats are sad
i think i know the issue :l
would this work to check if the plugins jar is within the plugins/update folder?
It gets moved before it loads afaik
ah
the urge to send the try it and see video
@vital sandal ```java
@Override
public void respawnPlayer(Player player) {
((CraftPlayer)player).getHandle().server.getPlayerList().moveToWorld(((CraftPlayer)player).getHandle(), true);
}
this is all you need
Player is a bukkit player
that's for 1.16.5
dont dare
I think i broken the corefile by adding —remmaped
corefile?
I need to rerun buildtool
wdym with corefile
the spigot lib
it doesn't break by using --remapped
using --remapped will just create an additional jar in your maven repo
It resulted in my server :l
but as said, remapped wonnt work for 1.16.5 anyway
1.17 is the first spigot version that can use remapped
i still remember when it was announced and I was like "nooo" and then when I understood what it means, I was like "yeeehaaaaw"
yeehaw parner
I would like to use default items from minecraft to create little powerups where you can right click to gain certain effects, I heard before something about giving items tags and detecting them when they're being right clicked on? How do i go about this
PDC
but dare he shall
Wow amazing, and what could I use for items being right clicked on?
It does :d
Now it work thank you
But still need to teleport them back
Where dark mode
I bought a theme for 70€
but it looks like ass
I can show in a minute
@ancient plank check out the site again
it's now in this weird, half assed dark mode
but the code blocks look like shit and so does the search bar
black bade, use grey
PlayerInteractEvent can be used to check for "right clicking with an item"
I don't like pure black in design
yeah I bought it while drunk
it was a bad decision
but I won't refund because it's not their fault that I bought it
I just went and found some random theme that looked nice and put it on my website kekw
i still need someone who does a proper website for my foundation but all offers I got were like 3000k+€ -.-
What is it for?
Wtf, that's so much
abused children. check out the pinned post in #general
not sure why they quoted you that much. Not like you need the website to interface with anything lmao
How do I get the highest collidable/solid block under a player?
its not just for children but for people who were abused when they were children
for that much, I would have them include an app
loop over them, and do isSolid() on each of them
e.g. sth like this:
Okie, I could keep on calling getRelative() I suppose
for int i = world.getMinHeight(); i < player.height; i++
currentblock = world.getBlockAt(coordinates)
if block.getType().isSolid(): currentblock = this block
Start at the player and go down
And then break away once you find something
That's more than annual income of both my parents combined
oh whut
where are you from
in my country, 3000€ is like what minimum wage people earn in about 2 months
Czech Republic
oh shit
Oh
I read 30 000k by mistake
the cheapest offer I got was 2100€
My bad XD
Sweet thanks
Yeah, you can definitely get it done under 200€
btw you might also wanna check for isOccluding()
Ohh why?
that is still a bit high, have any of them explained the reason for the cost?
e.g. isSolid() will e true for fences although they let light pass through
Ahh I see
isSolid() basically means "can you walk on this"
so glass, fences, etc are solid, but none of those are occluding (letting light through)
Yup okay gotcha
perfect
webdesign is extremely expensive in germany
those are normal prices
my father's website costed him like 7000€
and it's not even a nice website
maybe if they lowered their costs they would get more customers. Sounds like they are really not interested in the webdesign market
in the US, for a cheap basic website with 1-3 pages and simple navigation you are looking at anywhere between $100-$300
I mean, if you spend 2 weeks to design the whole website and you get 3000€, then you probably pay like 1200 in taxes so you're left with 1800€ which is "okay" for 2 weeks
if you want something a bit nicer, easily looking at $500 and that gets you quite a lot to even include them setting up domains for you and everything lol
no idea whether 2 weeks is realistic, I just made that number up
the more customized the site needs to be or if it needs to interface with something, the more it will cost.
i only need a very simple site with a system where people can donate online
without paypal
we must not accept paypal for legal reasons
but paypal has donate buttons already
yeah but laws for charities are very strict in germany because some people kept abusing them
yay for the dumb people
the only thing we may legally accept is regular bank transfer
but we dont get much donations anyway, so not a real problem haha
what card processor are you using?
none, we got a regular bank account
well it's some kinda charity account
so we dont have to pay any banking fees
jeff media
that isn't what I meant. I meant processor to accept cards online
thats sth different lol
then you really can't interface your website with anything except maybe your bank if they have any API's to automatically setup EFT
my charity has nothing to do with jeff media gbr
yeah I'm looking for some online payment system but as said, its not worth 3000€ imho
no it isn't
we would need weeks to get that money back
when i throw ender pearl on 1.8.8 spigot then i cant hit anyone and no one can hit me for like 3-5 seconds
and if someone really wants to donate, they could just transfer the money via bank anyway
i have only my custom plugin so i dont know what the issue
is this a development question?
ah ok
yes
who the fuck donating with bank transfer
what does your pluginn
I started out with web design, and I still kind of do it on some rare occasions, but I still keep tabs on the prices and you can easily pay cheap prices for a simple site lol
anyone, otherwise you couldnt tax deduct it
for germans that is
just tell me and then i will look up
yeah as said, our laws are fucked in regard to this
1)```java
Location newLocation = regionObject.getMax();
while (true) {
double x = NumberUtil.randomInt((int) regionObject.getMin().getX()-1, (int) regionObject.getMax().getX());
double y = NumberUtil.randomInt((int) regionObject.getMin().getY()-1, (int) regionObject.getMax().getY());
double z = NumberUtil.randomInt((int) regionObject.getMin().getZ()-1, (int) regionObject.getMax().getZ());
newLocation.setX(x);
newLocation.setY(y);
newLocation.setZ(z);
// Logic with location & return or continue
}```
2)```java
while (true) {
World w = regionObject.getMax().getWorld();
double x = NumberUtil.randomInt((int) regionObject.getMin().getX()-1, (int) regionObject.getMax().getX());
double y = NumberUtil.randomInt((int) regionObject.getMin().getY()-1, (int) regionObject.getMax().getY());
double z = NumberUtil.randomInt((int) regionObject.getMin().getZ()-1, (int) regionObject.getMax().getZ());
Location loc = new Location(w, x, y, z);
// Logic with location & return or continue
}```
What is the best way to do this? I guess the first one that reuses an existing location and does not create a new one by iteration?
for people in the US, as long as who you are donating too is a non-profit organization of legal nature, then all you need is just a receipt of donation
creating a location is very cheap. i wouldnt worry about it unless you run into performance problems
yeah basically same here, BUUUT
it's not 100% a donation if any online payment system takes a commission or anything
modifying an existing one will be even better, won't it?
paypal doesn't take a commission for donations
in theory, that is true
but the impact is so small that I just wouldnt think about it at all
hm maybe I have to get it checked out again by someone
I would use ints for those locations
Just dont worry about what's better if both is working fine
e.g. sometimes people do bitshifts because they think it's "faster than using /2"
no sense in using doubles unless you have borders that are not full block length lol
but in reality, both is so extremely fast that it's just pointless to invest time into "optimizing it" manually
well technically it is, but you won't be able to see the difference without some kind of benchmark for it
exactly
From what I’ve heard C compilers will optimize / 2 to a bit shift
No idea if the java compiler does
java doesnt do that, I checked it
but then I read that most CPUs automatically use bitshifts if possile
and then I stopped worrying aobut it
was about to say this
Why? I've also seen that WG uses int instead of double or at least in the yaml it looks like that
Fair enough
worldguard uses integers, yes
you cannot create regions that aren't "full blocks"
ints are whole numbers already which matches up with a block location. Doubles are handy if you are needing locations smaller then a whole block, and second a double takes up more memory to hold then a simple integer
mmm good
also, math on doubles takes more cpu resources then it does on ints
yeah IIRC a double is 8 bytes while an int is "only" 4 bytes
even if your doubles are whole numbers, and it goes through 2 different cpu routines for double vs ints
and an Integer object is like 192 bytes lol
or sth like that
new Object() is 128 bytes if I am not totally stupid rn
it varies between implementations. Typically that is true
oh yeah, I think 32/64 bit also makes a difference
it does
but tbh who cares about 100 bytes
that's maybe an issue in embedded stuff, but not in a spigot plugin
only time you need to worry about size of objects like that, is if you are dealing with a system that takes up huge globs of ram to just run
like somewhere around 32gb-64gb
then it becomes necessary to optimize on those levels
btw frostalf. you guys in USA always say "i need to go the bathroom" but noone ever says "i need to go the toilet lol"
this just came into my mind because I really have to go to the toilet
Not sure what this is about but there is literally no difference between using a byte, short or int in java. Only clarity wise.
Tf?
because in the majority of houses, we don't have a room that simply only has a toilet. They do exist still, but for the most part they are full bathrooms. Most people say restroom though if they don't say bathroom.
Are you telling me they all take 32 bits
there is. a byte only takes 1 byte IIRC. a short is 2 bytes and an int/float is 4 bytes. and a long/double is 8 bytes
I am pretty sure that in hotspot basedd JVMs, they only take up as much space as I mentioned
but I am wrong very often, so maybe this time too
story of my life
you are talking about fields I guess, since they store a memory address
TIL what a word is
Its in the table of computational types
I guess we have so much memory these days wasting 24 bits doesn’t really matter
yeah exactly
still, we got nothing bbetter to talk about and I find stuff like this interesting
We are nerds...
and I am proud of that
that is only JVMS architecture
ehh
How many slots it occupies on the stack does not mirrior the memory it consumes
The document even acknowledges that this was a mistake
bbealdung claims that a byte is indeed only one byte
reading into this convo makes me feel useless for this
They are backed by an integer would be the correct thing to say
Hi for some reason when i try calling the class it dosent work @Override public void onEnable() { getServer().getPluginManager().registerEvent(new MovementEvent(),this); }
as for the object forms, other then long and double, they are all stored in a 32bit cell
baeldung claims that an integer only takes up 4 bytes (32 bit)
what if u look for freelancers on smth like upwork or fiver who code it for u
yeah that's proably what I'll endd up doing
that is probably right more or less
No
@worldly ingot
???
and for payment system, the stripe thing is quite good and ez to setup
VPS is garbage. If you have 20 bucks a month to spare then you can just get a root server and run everything on it.
show that class
that being said there are overheads for fields, arrays and stuff
yes but stripe takes comissions and that would make it "non-100% charity" hence not tax dedducitble
Oh man they are apparently the ceo of this host
ohhh
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
public class MovementEvent implements Listener {
@EventHandler
public static void OnPlayerJoin(PlayerJoinEvent event){
Player player = event.getPlayer();
player.sendMessage(ChatColor.LIGHT_PURPLE + "Welcome to the server");
}
@EventHandler
public static void OnPlayerWalk(PlayerMoveEvent event){
Player player = event.getPlayer();
int x = player.getLocation().getBlockX();
int y = player.getLocation().getBlockY();
int z = player.getLocation().getBlockZ();
Material block = player.getWorld().getBlockAt(x, y-1, z).getType();
if (block == Material.GRASS_BLOCK){
player.damage(20);
player.sendMessage(ChatColor.RED + "YOU TRY ! ");
}
}
}
Seeing the ceo advertising on discord makes me really eager to use it
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
german laws for charities are extremely strict 🥲
your website has no data privacy policy and not even an address?
very sus
yeah when I trying calling the class
I guess event's methods must not be static
I actually don’t think it matters
But iirc a certain fork can more effectively optimize non static event methods?
Imagine paying almost 120 bucks a month for a ryzen 9 vps with 64 gigs of ram and only 250 gigs of hard drive.
You can get this dedicated for half the price.
to an extent this is true
Don’t we all
guys how can i deserialize this to a location im coding a converter
Cries in 10mbit
why the plugin just done that
i forgot an S in the registerEvents(new MovementEvent(),this);
Location already implements ConfigurationnSerializable, why do you wanna reinvent the wheel?
sorry everyone
you'd have to split the string by @ and then parse the contents manually
Do whatevery you are doing when serializing. Just the other way around...
Split, parse for "@?" and parse primitives
^