#help-development
1 messages · Page 218 of 1
tha'ts what I meant
For some reason the english documentation has different numbers for when the moon disappears (167) and no time at all for when the moon appears
The german one says this though
and it seems more reasonable
now how do I adjust my moon angle function to this shortened time range?
Something doesn't add up here though. If the full cycle is 24000 ticks, one would assume that when you divide it in half, you get your two cycles, both at 12000 ticks. Sure you can subdivide those into sunrise and sunset, but just based off the numbers, the range of 12000-24000 should be enough.
According to that page, the moon is not "visible" for around 175 ticks which isn't much.
The thing is that night is 9 minutes and day 11 minutes
I know but the german page says something different and that matches my observations
Hmmm, the odd part I find is that there shouldn't be an offset. The sun and moon are always opposite one another. Just because of how time is categorized doesn't change that fact, so your results being off by 10% or so is concerning.
This is 24000. you can see how the sun is already very high
This is 12000, the sun is still very high
the moon cant be seen at both of these times anymore
Hi guys, little question. How can i check the blockstate of a block at a location ?
get the block then get the state
Hmmm, I see what you mean. I can tell you that the numbers are also based off the center of the celestial bodies. If you set the time to 23000, you'll see what I mean.
Not really sure what you mean. Theyre at opposite positions at 23000
I'm saying that the center of the sun is directly on the horizon at 23000
Half of it is showing at that time.
Meaning it's based on the center.
its more like 23200 but yeah
But, if the starting value of 0 isn't good enough, then find a value that is and start from there.
Your overall range should still be 12000 ticks, but if you need to start at 11000, then by all means.
How does one resolve this error when dispatching a command? https://paste.md-5.net/iyobacowif.bash
Don't run that method asynchronously.
Why is my math not working then
The only explanation is that the sun moves slower than the moon
which explains the 9 minutes night
What if I need to? [edited]
What if I need to, or how does one run it sync when it is triggered by an async environment?
which means i have to adjust my math
See but that wouldn't add up. The sun and moon are always opposite. You can observe that if you are far enough in the sky.
hi what is sweet berries name in spigot material api?
SWEET_BERRIES
Im not saying theyre not opposite. Im saying the sun moves slower and the moon moves faster
When its night, the sky is sped up basically or the other way around
thats what im assuming
How would they be opposite in that case? They wouldn't. If one moves faster than the other, that makes them out of sync. The wiki says that they are always opposite one another.
Im saying the ENTIRE sky is sped up on night time and slowed down on day times
sun and moon
Is there a way/method/something to italicize or strikethrough a player name in a Spigot Scoreboard Team? Seeing as it's very possible to use any color you want on the Team i would assume it's possible somehow to use the other formatting codes.
Oh, I see. I can't confirm, but I would assume this would have been documented by someone at this point if that was the case.
I think the problem lies within the math.
i'm wondering if my plugin can connect to a mongodb server hosted on my pc, the two hosts are on the same local network
tried to set mongo host to "mongodb://<external ip of pc>:27017"
Fourteen
Take a look about mongo cluster
I think that you have to use it, when you want to connect to mongo having 2 different servers
im going to host mongodb server on my pi anyways ig
Ig?
i guess
i guess
did you ask for my instagram, ig?
ig is "i guess" in text, but sometimes ig is "instagram"
Yeah
why would i need that
just trying to connect my mongo instance to a server running on my pc
where client runs on pi
Make sure there isn't a firewall blocking connections
Not sure if a pi has one enabled by default
service is running when i check with netstat
I do not think its the math.
It is correct at midnight
Its just about 10% off when the moon sets and when it rises
But you can try and search the issue, heres the code:
It is documented just not that detailed. But how else would the day be longer than the night by 2 minutes
It could just be poor documentation.
or in other words, why can the sun be seen 2 minutes longer than the moon
Guys, I need your opinion. I have an item called "pig shooter", which, has the name suggests, is supposed to shoot pigs. My initial idea was making a projectile, like an arrow that if It hits the player, it spawns a bunch of pigs around the player (also gives slowness as a debuff)
Because the sun is bigger and you can see more of it while the center is still below the horizon.
second idea is actually spawning a pig on top of the players head and make them actually launch the pig in the direction they are looking
second idea sounds cooler, but I'm not sure
Don't they have the same texture size though?
I dunno. I was talking about real life.
Alright so I've got the NBT part down for processing stuff from NBT schematics, but what the hell do you do to process the blocks?
It's just a giant thing of hex
LMFAO
ah mongodb is not accepting remote requests by default
Oh yes
You have to enabled it
might wanna make a free cluster thing
I forget that, really sorry
What? Because cluster is called a set of different mongo instances connected together, so the request are divided using a load balan ce
<Respect bruh
IM being repesctfull with u
?
I mean, you are just self hosting a database server
Its mainly what i do with my 32 cores and 128gb ram machines
yes on my pc, so that shit shuts down whenever i close my pc
i could run it on my pc too
got 8 gigs ram
Ik what you mean
I understand you
That why i use one my local severs
because whenever i stop the pc, all the severs that run my test plugins stop the db connection cuz of obviously reason as pc goes down, mongo sever goes down
Is this in a loop? I want to try and recreate this, but I don't know if this in in a listener class or not.
uhh
?paste
Not really
I wouldn't say it's hard
You dont know how to use it
sql is shit💀
Hi guys, I'm making a plugin where you can have skills. I made a class called "PlayerPlus", which contains the player associated and the skills the player has. I was also thinking about implementing each skill on this class.
however, I suppose this would make the class very big
mongodb itself is such a pain
What?
Split things up. Don't have every skill in one class
hmmm, I think that makes sense
I could store the cooldowns and the skills the player has in the class "PlayerPlus", but implement the actual skill in a different class 🤔
what do you think?
Yeah
You can do that
Interesting
I think you are right
makign every skill in the same class would make the code look ugly
and It would be more difficult to debug
I think
I would make an abstract or interface skill class, for common things and then each class per impl
ooooh, interesting
should i work with an username and password or certificate?
I use username and pass because I'm lazy
Works just fine don't really need anything else
dont even know how to setup cetificate
Same
WAIT you are right. Each skills has an associated event with the actual action it generate. I could create an interface called "skill" and make both the event and the actuall skill an abstract class
:o
And then
A profile user with a List<SKill>
And loop over each skill, calling the event or smth like that
how can i teleport an entity while a player is on it?
teleport them both
I would say use the PlayerMoveEvent
lol running curl ifconfig.me on my pi thro ssh gives me the public ip of my pc
make so that every time the player you want moves, the player associated gets teleported to the other player location
no, i meant when a player is a passenger
ooh
Idk, sorry :(
maybe teleport the entity and them set the player as a passanger to the entity, again?
Yeah of course, ssh expose your public ip address. If not it wouldnt be possible to connect tho
😂
doesnt make sense that public ip of pi and public ip of pc are the same?
Ssh only exposes your public address if you first expose your pi to the public
You only have 1 public ip. When you open a port you specify a local IP that will have that request forwarded to it. So if you open SSH on 192.168.0.123 -> port 23. With a pub address of 1.2.3.4.5 if someone connects to 1.2.3.4.5:23 they'll be routed to the local ip of 192.186.0.123
so how can i get the pub ip of my pi 🤔
curl 'https://api.ipify.org?format=json'
Your IP isnt resereved to your pc...
your IP is for your network
so if your raspberry pi is on that network then its the same ip
And that what its?
ip6
SHIT
probably your public ipv6
did that 20 minutes ago too
I was going to do that
Tip: if it looks weird, dont send it
Yeah sorry and thanks for deleting it
@tardy delta
uh i clearly skipped networking classes
this pretty basic common knowledge
how is my public ip not reserved for my pc 🤔
yes?
That why my local severs works over a proxy network, so then they never leak private ips
tracert
What is that?
i was playing a game in network classes so cant really say
Oh intenet protocol
google it
win command
The TRACERT diagnostic utility determines the route to a destination by sending Internet Control Message Protocol (ICMP) echo packets to the destination.
Its for tracking intener packets
I wonder if tracert would work on your proxy
yeah but i bet a poorly made one would be vulnerable
I have try it and tracert give me the proxy isp
good job proxy
Yeah that is true
Mines are setup correctly, because my father works with base confidence information and a technich from his work have setup everything
It was an engeenier
I mean, in most time it's "plug and play" kind of setup
There are already tools for that
Imagine that i have lost one my router ip address and i cannot access his configuration dashboard
But as far its configured or protected so good, there is no way to tracert it to find the ip adress we assigned for it
I have tried everything, default gatway, tracking packets inbound and outbounds
dont you only need the subnet of your network to know the routers ip address?
ipv4 very limited
I reaslly need to find the router ip
tjats why i t doesnt really matter when it gets leaked
unless someone wants to ddos you
isnt router ip first available ip in the subnet too?
As i have said i try that but the proxy is setup between ISP moden and main router
++++
Doesn't have to be, it's just convention
So every local router at home is protected via the proxy
Webserver can be ran in any ip in subnet
👀
only thing i remember from networking classes is how to calculate id and broadcast address of a subnet 💀
My main problem is that the router i need to find the ip is in mode router
So its not so simple to find the ip
Broadcast is basically just last ip in subnet
ye
.255 for ipv4
You already asked me if it's same thing xd
ohh yea
we talked thp
I have mem problems so just ignore me
Drugs talks too much about me
💀
hmm
Do you want me to help?
Are u using mongo server on raspberry or from mongo cloud?
they give me a code example damn
Yeah
mongo cloud tihing
ok it seems to work, only console being spammed with mongodb stuff
where would i need server api version for
What?
in the code
weird
just works with doing this
I guess that's future proofing
proofing?
https://hastebin.com/oyedazurod.properties
how can i fix this error?
also should i send the github link here so can see the code?
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
From what i read your shechedule havent been already executed or havent finished
Yeah there is only one version atm just looked it up
Looks like you tried to stop a task that isn't running
dont even have that method in my ide lol
but it was running
Also why every shity udemy course, has mono audio instead of stereo? 😡 😡
It wasn't
afaik this is what makes it run
Bukkit.getScheduler().runTaskTimer(this, ParticlesGuiListener.SPIRAL_TRAIL_MANAGER, 0, 5);
?conventions
and how did you cancel it
ah im on 3.12.11 and there its just
can i send the entire code link?
Sure
SpiralTrails Task, manager, gui listener
i found the location where ?whereami comes from
good good
tsym
Where are you starting the task
I can't find it
Verano you drunk again
He is always
True
lol
Yeah you're not starting the task anywhere
how not bro
Your start task method does infact not start the task
Also smth i realize, plase never on life get menus/gui via NAME!!!
?scheduling
Sorry for pinging you olivo
No worries
hmm would this work to delete a home from an user object in the db which has a list of associated homes?
or do i need to users.updateOne or smth?
Mongo#findOneAndUpdate() ill first get a list of each home and then get the first home - Applied to your case
do i just need to set their homes back, but with the obj i want removed?
Is homes an array?
their Document s are driving me crazy
I've only used MongoDB with JavaScript
No, they are okay, its because you used to use SQl, which is rpetty diff
worked great
Yes its okay
Explain what you want
And i explain you
i want to remove a home from that user on the db
Let ope na thread because
🤔
stop task thing
Fourten, you have a user collection right?
In user document, you have a list of home document right?
lemme just show whole thing https://paste.md-5.net/sipokavike.java
yeah
better
ok
I understand now
And what you want to do?
Find a home via name and update it?
and remove it ye
So you need how to update it and delete it
i guess
dont tell me youre typing that on your phone
This is currently in a sync scheduled task every second. It loops over all players.
I might move it into an event as people have told me thats more efficient
@kind hatch
public static void startChecking(Plugin plugin) {
plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, () -> {
for(Player player : plugin.getServer().getOnlinePlayers()) {
long time = player.getWorld().getTime();
//Check if nighttime
if(time < 12575 || time > 23400) break;
//Check if players yaw is on moons "orbit"
if(Math.abs(player.getLocation().getYaw()) < 85 || Math.abs(player.getLocation().getYaw()) > 95) break;
double moonAngle = getMoonAngle(time);
player.sendMessage("Moon angle: " + moonAngle);
if(moonAngle > 90) {
if(player.getLocation().getYaw() < 0) break;
moonAngle = 180 - moonAngle; // Moon Angle should always be between 0 and 90
}
else if(player.getLocation().getYaw() > 0) break;
if(Math.abs(Math.abs(player.getLocation().getPitch()) - moonAngle) < 5) {
player.sendMessage("You are looking at the moon!");
}
}
}, 0, 20);
}
public static double getMoonAngle(long time) {
time %= 24000; // 24000 ticks in a day
return time / 24000.0 * 360.0 - 180;
}
@tardy delta sorry its imposible thru cellphone, i will send you a link with basic CRUD operations with mongo
Extra info: Filters#gte() is used to make operations over nested documents
when I do this on PlayerDropItemEvent, I see that hotbar "animation" item is getting dropped
but it isn't and nor is it being removed from my hand
why>
nah
So, I made a discord channel that whatever command someone types, it is ran in game, but my only issue is that I have no clue how I would check for permissions especially since sometimes commands don’t have the permissions stuff inside the plugin.yml but instead just use haspermissions.
Correct me if I am wrong, but I believe the permissions stuff in plugin.yml is mainly for convenience for server admins
BukkitRunnable spiralRunnable = new BukkitRunnable(){
@Override
public void run() {
makeSpiralTrail(2, 2);
Bukkit.getLogger().info("spiral task is running");
}
public void makeSpiralTrail(double radius,double height){
degree%=360;
for (Player player : Bukkit.getOnlinePlayers()) {
double radians = Math.toRadians(degree);
double x = Math.cos(radians) * radius;
double y = height;
double z = Math.sin(radians) * radius;
Location particleLoc = player.getEyeLocation().add(x, y, z);
player.getWorld().spawnParticle(Particle.FIREWORKS_SPARK, particleLoc, 0, 0, 0, 0, 0.1);
}
degree+=5;
}
}.runTaskTimer(Kingdoms.getInstance(), 0, 5);
what is wrong here? it says that incompatible types: org.bukkit.scheduler.BukkitTask cannot be converted to org.bukkit.scheduler.BukkitRunnable
true nvm lol
Does plugin.yml handle that or do you have to enforce it yourself? Haven't dealt with permissions in a long time
Aye, thanks for the refresher
permissions in the plugin.yml are registered and visible to permission plugins
so what method should i use to run it
no real point
?scheduling
BukkitScheduler?
k
dawg
so something like this?
BukkitScheduler scheduler = Bukkit.getScheduler();
...
scheduler.runTaskTimer(Kingdoms.getInstance(), () -> {
makeSpiralTrail(2, 2);
Bukkit.getLogger().info("spiral task running");
}, 0L, 5L,);
true lol
Also, why not using DI?
💀
wat is DI
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
ah
would look something like the following
public class ClassName {
private final MainClassName plugin;
public ClassName(MainClassName plugin) {
this.plugin = plugin;
}
}
ok
forgot about that part
so
public class ParticlesGuiListener implements Listener {
private final Kingdoms kings;
BukkitScheduler scheduler = Bukkit.getScheduler();
private int degree = 0;
public ParticlesGuiListener(Kingdoms kings){
this.kings = kings;
}
...
scheduler.runTaskTimer(kings, () -> {
makeSpiralTrail(2, 2);
Bukkit.getLogger().info("spiral task running");
}, 0L, 5L);
then in main
@Override
public void onEnable(){
particlesGuiListener = new ParticlesGuiListener(this);
}
yeah
just ignore that degree thing
if its a listener
getServer().getPluginManager().registerEvents(new ClassName(this), this);
So I wanted to launch entity in air in the direction I look BUUUT it doesn't work and I don't know why
attacked.setVelocity(attacker.getLocation().getDirection().multiply(3).setY(10));
it pushes the entity to where i'm looking to but not in the air. how can i fix that? i was trying to find the answer for an hour or so :(
if its the var getServer().getPluginManager().registerEvents(particlesGuiListener, this);
oh i already did that
before yall say me to do DI lol
yeah thats correct
this.getServer().getPluginManager().registerEvents(new ParticlesGuiListener(), this);
so i can remove the first this?
Ye but it runs through console since idk how else to do it with 0 player’s online and so it basically bypasses the permissions anyways.
i did that once, let me see if i find it
he did it?
let me try move it around
Actualy its not the same thing
this is used to refer to none static fields, methods
i guess you have to get eyeDirection OuO
still doesn't work
attacked.setVelocity(attacker.getEyeLocation().getDirection().multiply(3));
?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.
something like this
it's the same as i referred earlier - #help-development message
but this part works, that's fine. it pushes where i look at. it doesn't push in air
ye wait
Y-velocity doesn't work in any way in this. Even if I look upwards and hit mob
no? should work
ye it would
so yeah
well it does in particles lol
can the problem be in paper server?
nah
try applying a Vector of 0 10 0 to the mob just to see if it throws the entity
paper is a fork of spigot
i understand but it changes many things
Oh wait, are you setting the velocity in an event like damage entity event ?
it still has all of spigots code
uh huh yeah
if yes, try applying this velocity but one tick after the event
Taking damage will reduce the velocity
bruh, how to make delays?
?scheduling
im so stupid sry
runnable prob
Make it run next tick
scheduler better imo
scheduler.runTaskLater(plugin, ...
what do i need to put in plugin?
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
you can use runTask rather than runTaskLater.
yea
oh i see yeah
runTask will schedule it for the next tick at the earliest
use runTaskLater if you need more than a 1 tick delay
what is your problem?
well, try removing all cached files. that's all you can do I guess
Nope
I turned off brave shields as well
It works on Google Chrome but not on brave...
spigotmc doesnt support brave
Hi guys, What would be an efficient way of implementing cooldowns on given skills? My idea is to create variables that tell if some skill is on cooldown I set the isOnCooldown to True, and set an scheduler to set It to false after some time
this is easy to do, but I'm not sure if Its the most elegant approach/useful
I guess time to switch to opera gx again ffs
it should
iirc brave is built on chromium, just like operagx
Yeah but you cannot compare a potato with a ferrari
brave is not comparable with Opera gx
I would compare brave as firefox
what
It all depends. if you want an animation etc to represent the cooldown (for instance send a message when not in cooldown anymore) you'll have to use a bukkit task. Otherwise if you only want to prevent an item in cooldown to be used, save the time it was lastly used, and compute a difference with actual time
ah, I see
horray, i made it, ty all guys
nice
well i got some errors while doing di
https://hastebin.com/iniqafaked.typescript
the main class:
private static Kingdoms i;
@Override
public void onEnable(){
//init
i=this;
ParticlesGuiListener pgListener = new ParticlesGuiListener(this);
...
the listener
BukkitScheduler scheduler = Bukkit.getScheduler();
private int degree = 0;
private final Kingdoms kings;
public static void ParticlesGuiListener(Kingdoms kings){
this.kings = kings;
}
...
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
why does it says it require no arguments if i put Kingdoms as argument
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.
lol
naw
But bro you musnt code without learning the basics from java
i know coding, but coding without an IDE is kinda sad lol
-me literally trying every shit until I give up and ask for help xd-
i had intellij like 1 and half year ago but my pc is too potato to handle it
I mean even more simply, not even without knowing the modifiers
Modifiers are essentially the most basic thing you have in java
it worked thx
Try to code on paper, then everything will feel easy
does Paper have an API?
hahaha paper will make him leave minecraft coding
xDDDDD
paper api is even worst
Tought tho xd
oh i forgot that haha
holy fuck thats something I would not try i guess
Yeah coding paper will make you left plugin coding
lmao im coding in github.dev
i do game dev stuff but i use C# and not Java to code an entire API
WHY?
i am lazy to do APIs
bc my pc is too potato to have intellij again
oh ok
Oh please left the sever inmedialy
wow. You should open a leetchi
Eclipse 💀 💀 💀
you are not who will define where I am.
pc suffering to run maven in cmd prompt
and yes I use Eclipse because InteliJ is too weird for me, and my PC barely would run it :)
I need to agree. :D
eh .-.
Hahah in my case i used to had really bad xp with eclipse, but when i first started to work with Intellij having 4gb of ram on pc was a fucking mess. And then finally moved from 4gb into 64gb
i dont
WFT¿?
and how will a random hungarian kid get 64gm or ram from 4gb? 🤣
i have 8gb atm, but afaik thats still not enough
Wait he is a kid?
16 is still "kid" by the law here -.-
basicaly: a guy hired me to make him a plugin (bc he saw that i code for almost 2 years), so i code, build, give for someone to test, if it works, good, if not, fix and repeat
I have downloaded more ram tho i can send the file
Pls
law is an enforement 💀
I serously hate it
i dont think you get what downloading ram is
btw i really dont care about age lol
Weird, here you are adult having 18or +18
in most cases
😦
didnt even see the staircase i made before lol
I think that download more ram is a meme
oh nvm u did
XDDD
anyways: this was in month 3 (i forgot name in english)
https://paste.md-5.net/ixaqajuxar.java
dawg
"This isn't a scam, there isn't a virus, it's just a joke website. Made in jest, keep smiling" - bottom of the site :3
anyways i think its in github
March
ye
Yeah, self doxing my self about what i have done
best code ever https://hastebin.com/dasohumixi.java
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
I defintly be drunk on that momment
ngl I use that as well
and I approve it
TO BE GOOD :D
nah
I hate loops
What is a loop
bruh
i didnt know to make in that situation
repeating a certain task for lots of times
or maybe forever
You need mathematical knowledge on how circle works lol
like repeating a YouTube or Spotify music
y^2 + x^2
Why loop? Definetly use a while!
Do you want to crash your server?
Because this is how you do it. :)
while (true) Thread.sleep(); 💀
Thread.sleep(); basically stops the main thread, and so, pauses the whole server, and crashes it because of no response lol
I tested it
it was hilarious
No I'm sire zacken is a smart boi and use Thread#sleep in a newly created thread
russian roulete
if(threadlocalrandom(0,6) == 3){
while(true){
Thread.sleep
}
}
I just never realise dhow
but Thread.sleep crashes szerver
and is bad
veri veri bed
B. R. U. H.
x2
Math.random
Please fix me this dude is when working over spigot its better using smth like a service executor or spigot scheduling?
hes not
if shopLocation is represented as getting the shop location
Blegh records suck
No need to name declarations with shop keyboard, its already understandtable that is for shop cuz of the object name
LMAo you defintly want to swear
Just do it bruh
You are a master at life.
I haven't used them even though I probably should I still make immutable classes
I wont wanna follow you
Don't you guys prefer a() ?
bruh he has his rights to do so
This is surprisingly a good attitude
i dont even know what is a record
bruh same
o
What is your java version ?
like getA()?
nonono, a() and to set it why not name it r_z()
i decompiled minecraft and it's written like that so I assume real pro badass devs names their methods with letters
so like using aaaa() instead of getBLABLA()?
no way, no one would do that for sure 🥸
I know... well It's a running joke...
and it's called obfuscation for info
This is menu api implentation its pretty cool
MenuPlugin plugin = (MenuPlugin) getSever().getPluginManager().getPlugin("MenuPlugin");
if (plugin == null) return;
A a = plugin.getA();
B b = a.newC().a("&6Users").b(3).c(27, new C(itemstack, ClickType.RIGHT, (d) -> d.getPlayer().sendMessage("Stop")).e();
a.getA().a("users", b);
b.f(event.getPlayer());
Sorry i sent wrong code
Here I see a pro badass developer
this is so f*cking weird I don't even understand the code lol
I sent the obf one
Its a builder
Skidding ImIlussion coding ideas
I have literally skidded his menu impl
🤣
Also zacken, coding like that its not really diff
Just need to have clarify what means each letter
😂
Ayo, I need suggestions 🤔 🤔 . I'm making a plugin where you can MILK any entity and get powers when you drink It. For now, we have chicken milk, that gives you slow falling and pig milk, which gives you the ability to shoot pigs that give slowness
I'm looking for ideas for abilities that certain mobs are gonna give
Br?
yeah
Oh nice
Im from UY and i fallao portuñol
Hahaha
Verano: the drunk all seeing eye
true
português 😔
What do you guys think Sheep milk can give you?
I need something creative and epic
Haha
make it so other players can shear you to get wool
oooh, this can be cool
so the players get naked?
I need some type of buff for the player tho
Shhh please, I'm not on alchool anymore, before I went to sleep I had 0.64 alchool and now I have 0.25.
Dont ask me why i have the thing for knowing alchool
👉 👈
hm they can eat grass
portable bed, you drink it and you sleep
oooh
or you explode in the end
💀
aah, yea, maybe, but I think I liked the grass eating idea
are you talking of......
btw, you can milk ANY entity in my plugin
including villagers and players
okayy okay
Ahahaha
i see
haha my ideas was just to see ur reaction
Hahaha
🤨
milking player gives u a children lol
mining fatigue too
What do you think about programming a simple plugin that only contains lowercase and uppercase letters, for declarations, methods, constructors, class names, class inners and then upload it to spigot? Just to see ppl reaction when they try to fork it
greek question mark better
i prefer trying to do the longest method call chain
Do you talk normal greek or that greek weird which doesnt have translation
i talk math greek
I used to work for a Greek sever and imposible to work with them because all spoken that greek which doesnt have translation
😨
was just about to do that
lmfao
what i wont send it obviously
what the heck guys 😂
haha
because your a serious person
true
I also im not stupid to send that type of content
I can go to jail bruh
wow guys I won't joke with you anymore
i was drunk that day
youre always
how you know?
Enough jokings for today, it's time to stop fucking around. Before I end up banned
lol
this is from translator
Anyone?
No need to do that
If your message get losts open a thread
Its better
Oh right
I mean opening thread is better because the message wont get lost
Reading the Data in NBT Schematics
Might be finished executing in a few hundred years
weak
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Now new Thread() in most nested loop
setAi(false) lmfao
And will be alright ig
lmao
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
Is there a way if checking an number input is "null" ?
Because from what i know int is never null
if(input !.equals(null))
And what are you doing if you have to check that
ye lol
Inventory
?
nvm lol
rows == lines
9 slots for each
mb
oh ok
6 lines
57 slots in total
9 columns
54 i meant lol
yeah I agree, but for < 4 it's quicker to type the zeros
it's a double
write 1000 it will work
yall weak in coding
public class Main {
public static void main(String[] args) {
try {
Thread.sleep(Integer.MAX_VALUE);
//entire code in the project
} catch (Exception e) {
System.exit(0);
}
}
}
people i need help with my project
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
you can't
You have yo use jdk 8 then@
Why are you compiling to java 8 anyway
And is this with maven?
because it's a lib that should support 1.8 - 1.19 and it refuses to use 1.17+ without jdk17
and yes it's with maven
If you’re using intellij make sure it’s on your project setting aswell
You should still be able to run a plugin targetting java 8 no?
the server just has to run on jdk 17
java is backward compatible, so if you compile in java 8, java 19 could still use it
well you can't do that with 1.17
maven marks it as "inaccessable"
go to 1_17_R1
i have version in it set to 1.8
what are you doing
i was testing some bat scripting
bruh
what?
Mc versions are such a pain
i know 😦
Indeed
my advice: drop older versions
i WOULD support from 1.16 up
(since the name is MODERNdisguise you are allowed to lead everyone into newer versions 🥹)
So you will force ppl moe to newers versions when they realize you are not supporting then anymire
no it's modern because usage of it is modern and unique
not because omg support the version i use only because i love it
bahahahah
you're refering to the people stuck in 1.8 I see you
it's like disabling android or ios auto update just because android 4 is better
fuck security vulnerabilities
new features
and improvements
but this debate is here since a long time and will remain, no need to argue anymore
agreed
+1
How can i get an object of children in config.yml file
grandparent.parent.child*
but i want to loop through each
getKeys(false)
true will loop through every child recursively, false will only loop through the first level
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/configuration/ConfigurationSection.html#getKeys(boolean) (for reference)
declaration: package: org.bukkit.configuration, interface: ConfigurationSection
thanks
im hoping to just list out all of the things in console like
parent:
child1: "hi"
child2: "hi"
child3: "hi"
"Loaded "child1" from config."
get the config section of the parent, and loop through each of the keys
for (String keys : getConfig.getConfigurationSection("parent").getKeys(false)) {
println(keys);
}
okay, i got this int amount = entry.getValue().size() - 1 == 0 ? 1 : entry.getValue().size() - 1; because if the size is 1 it'll be 0 and wont spawn anything so how would i fix this?
since that shows a warning
How do i disable that when coding webs?
I mean its appear that bar like if you can type
Because its not a scrollbar
Its smth that didnt use to appear, its started this year
Use math.max
Any good articles about making a Scoreboard and using Teams as well ?
Good point
if i have a shulker placed with some PDC info and it's broken is the info transferred to the shulker item?
it gets transfered to Item
which has #getItemStack method
and well here it is
i guess
yeah gonna try
sup spigot need help with an error from one of my plugins that a user is currently experiencing
I figured out the line that this is occuring
so it happens here java if (cachedRedstoneActivity.size() > 0) { for (Iterator<Location> iterator = cachedRedstoneActivity.iterator(); iterator.hasNext(); ) { try { Location location = iterator.next(); Block block = location.getBlock(); BlockData data = block.getBlockData(); if (data instanceof Powerable) { Powerable powerable = (Powerable) data; powerable.setPowered(powerable.isPowered()); block.setBlockData(powerable); } else if (data instanceof AnaloguePowerable) { AnaloguePowerable analoguePowerable = (AnaloguePowerable) data; analoguePowerable.setPower(analoguePowerable.getPower()); block.setBlockData(analoguePowerable); } BlockData blockData = block.getBlockData().clone(); block.setType(block.getType());//HERE block.setBlockData(blockData); block.getState().update(true, true); } catch (Exception e) { throw new RuntimeException(e); } } }
my guess is that the chunk isn't loaded
would that be an alright assumption?
Certified purpur moment
do you list purpur as supported?
I say 'server is server'
but is it because the chunk isn't loaded?
because wouldn't this fix it?
if (cachedRedstoneActivity.size() > 0) {
for (Iterator<Location> iterator = cachedRedstoneActivity.iterator(); iterator.hasNext(); ) {
try {
Location location = iterator.next();
Block block = location.getBlock();
if (!block.getChunk().isLoaded()) { //here
continue;
}
BlockData data = block.getBlockData();
if (data instanceof Powerable) {
Powerable powerable = (Powerable) data;
powerable.setPowered(powerable.isPowered());
block.setBlockData(powerable);
} else if (data instanceof AnaloguePowerable) {
AnaloguePowerable analoguePowerable = (AnaloguePowerable) data;
analoguePowerable.setPower(analoguePowerable.getPower());
block.setBlockData(analoguePowerable);
}
BlockData blockData = block.getBlockData().clone();
block.setType(block.getType());
block.setBlockData(blockData);
block.getState().update(true, true);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}```
we've encountered the same problem and #isLoaded wasnt an option iirc
just checked, depends on the version since in 1.8 f.e. #getChunk loads the chunk
Hey!
Not really a spigot question, but why no results are returned from this query
val result = prepareStatement(
"""
INSERT INTO dodge_user (kills) VALUES (0);
INSERT INTO default_user (user_uuid, name, ip, dodge_user_id) VALUES (?, ?, ?, currval('dodge_user_id_seq')) RETURNING *;
""".trimIndent()
).apply {
setString(1, user.uuid)
setString(2, user.name)
setString(3, user.ip)
}.executeQuery()
RETURNING * should return the just created object. It actually works on Intellij console
but when executing...
org.postgresql.util.PSQLException: No results were returned by the query.
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:135) ~[?:?]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[?:?]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[?:?]
at com.shiftmc.game.users.database.postgres.DatabaseAPI.createUser(DatabaseAPI.kt:61) ~[?:?]
at com.shiftmc.game.users.database.postgres.UserController.createUser(UserController.kt:45) ~[?:?]
at com.shiftmc.game.users.event.UserLoadingEvents.preLogin$lambda$2$lambda$1(UserLoadingEvents.kt:44) ~[?:?]
at com.velocitypowered.proxy.scheduler.VelocityScheduler$VelocityTask.lambda$run$1(VelocityScheduler.java:228) ~[velocity.jar:3.1.2-SNAPSHOT (git-2d072151-b185)]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
hi! was wondering what kind of tutorials you guys would suggest?
im already pretty familiar with java, have been using it for the past 3 yrs in compsci
but tbh id rather learn from a video series than scouring docs trying to figure out what to do
i see kodysimpson and codedred, but dont know if theres any actual recommended tutorials you guys have
Besides the written ones the videos ones tend to be 25m to cover a 3m topic
I've watched some kody simpson videos then just tryed making stuff.
Learned the basics with a youtube video, then just googled
are the written ones pretty in depth?
A lot of video "tutorials" contain either lots of bad practice or spoonfeed people to death
Yeah, most of then is just... Copy what i'm doing
Yeah, but they're built as if the person watching doesn't know java which increases their viewership
where would the written ones be at
tutorials especially video ones should be showing or teaching the concept of something and show you an example of how to use it, not to necessarily copy from. Generally it is best to teach yourself in how to read documentation as well as to research and look to see how something is implemented. I routinely have discussions with people in regards to implementation and when they set out to actually look are quite surprised when something isn't implemented as they thought it would be 😉
this even includes Java API and the JVM
yea
i j hate being so clueless with programs
especially an api that i have no idea how to use yk
docs r always great but i feel a lot of times they dont provide enough practical information to know how to do something properly
Hey guys quick quesiton, is there any way to shorten this? : https://paste.md-5.net/erarocuyas.coffeescript
Jeez Louise
ikr
but people should never directly look at the implementation to see how something works but at the javadocs. your program or whatever you do shouldnt be implementation-specific
Hey, for BungeeCord, what is the best event that exposes the server that the user had logged into on join?
can I use an AtomicInteger for keeping track of indexing in my bukkit scheduler
does return in a bukkit runnable end it or skip that iteration?
If it's repeating return just stops that specific runnable but does not prevent another
You'd need to store the actual queued repeated task and cancel that
Or throw an exception but that's an ugly way to do it
yes
tho it might be smarter to use a singleton array or just a class that encapsulates a mutable int variable
I decided to use a stack instead, having issues with empty stack exceptions tho
well first off the error is java [15:30:57 WARN]: [NeoPerformance] Task #111296 for NeoPerformance v1.14.2 generated an exception java.util.EmptyStackException: null at java.util.Stack.peek(Stack.java:101) ~[?:?] at java.util.Stack.pop(Stack.java:83) ~[?:?] at com.neomechanical.neoperformance.version.restore.HeartBeatWrapperNONLEGACY$1.run(HeartBeatWrapperNONLEGACY.java:36) ~[NeoPerformance-1.14.2.jar:?] at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.19.2.jar:git-Purpur-1839] at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[purpur-1.19.2.jar:git-Purpur-1839] at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1500) ~[purpur-1.19.2.jar:git-Purpur-1839] at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:486) ~[purpur-1.19.2.jar:git-Purpur-1839] at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1424) ~[purpur-1.19.2.jar:git-Purpur-1839] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1194) ~[purpur-1.19.2.jar:git-Purpur-1839] at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:310) ~[purpur-1.19.2.jar:git-Purpur-1839] at java.lang.Thread.run(Thread.java:833) ~[?:?]
restoring redstone activity
chunking operations
💀 im actually special ed
why is the second line throwing a concurrent modification thing?
for (Iterator<Location> iterator = batch.iterator(); iterator.hasNext(); ) {//Line 41
try {
Location location = iterator.next();
Block block = location.getBlock();
if (!block.getChunk().isLoaded()) {
continue;
}
BlockData data = block.getBlockData();
if (data instanceof Powerable) {
Powerable powerable = (Powerable) data;
powerable.setPowered(powerable.isPowered());
block.setBlockData(powerable);
} else if (data instanceof AnaloguePowerable) {
AnaloguePowerable analoguePowerable = (AnaloguePowerable) data;
analoguePowerable.setPower(analoguePowerable.getPower());
block.setBlockData(analoguePowerable);
}
BlockData blockData = block.getBlockData().clone();
block.setType(block.getType());
block.setBlockData(blockData);
block.getState().update(true, true);
} catch (Exception e) {
throw new RuntimeException(e);
}
}```
show full error
[15:55:51 WARN]: [NeoPerformance] Task #111459 for NeoPerformance v1.14.2 generated an exception
java.util.ConcurrentModificationException: null
at java.util.ArrayList$SubList.checkForComodification(ArrayList.java:1415) ~[?:?]
at java.util.ArrayList$SubList.listIterator(ArrayList.java:1284) ~[?:?]
at java.util.AbstractList.listIterator(AbstractList.java:311) ~[?:?]
at java.util.ArrayList$SubList.iterator(ArrayList.java:1280) ~[?:?]
at com.neomechanical.neoperformance.version.restore.HeartBeatWrapperNONLEGACY$1.run(HeartBeatWrapperNONLEGACY.java:41) ~[NeoPerformance-1.14.2.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.19.2.jar:git-Purpur-1839]
at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[purpur-1.19.2.jar:git-Purpur-1839]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1500) ~[purpur-1.19.2.jar:git-Purpur-1839]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:486) ~[purpur-1.19.2.jar:git-Purpur-1839]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1424) ~[purpur-1.19.2.jar:git-Purpur-1839]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1194) ~[purpur-1.19.2.jar:git-Purpur-1839]
at net.minecraft.server.MinecraftServer.lambda$spin$1(MinecraftServer.java:310) ~[purpur-1.19.2.jar:git-Purpur-1839]
at java.lang.Thread.run(Thread.java:833) ~[?:?]```
updated code, see above, and error is now on line of the for loop, error is up to date
Are you calling remove somewhere
Well there is this java dataManager.setRestoringRedstone(true); iHeartBeat.restoreServer(cachedData.cachedTeleport, cachedData.cachedRedstoneActivity); //The code of the hour cachedData.cachedRedstoneActivity.clear(); cachedData.cachedTeleport.clear(); dataManager.setRestoringRedstone(false);
Do any of those contain batch
restoreServer, the code we are looking at with concurrent exceptions https://paste.md-5.net/afoqajujix.java
batch is in that
I dont see why you need to pop elements
Maybe that is your issue
Why not just iterate through them normally
Because I want to do one batch at a time
for (Player player : cachedTeleport.keySet()) {
if (player.isOnline()) {
player.teleport(cachedTeleport.get(player));
}
}
performance
iterate over the Map.Entry
entrySet
I dont know why your code is throwing an exception
I think its something to do with that stack pop() though
thanks lol
?paste
how would i fix this?
code:
net.minecraft.world.level.chunk.Chunk c = ((CraftChunk)chunk).getHandle();
for (Player player : Bukkit.getOnlinePlayers()) {
if((player.getLocation().distance(chunk.getBlock(0, 0, 0).getLocation()) < (Bukkit.getServer().getViewDistance() * 16))) {
((CraftPlayer) player).getHandle().b.sendPacket(new PacketPlayOutMapChunk(c));
}
}```
how would i get rid of the enchantment.level.14?
would i have to change the way the enchantment is listed itself
lets not talk about the lore pls
Bruh wtf people making these days 😭
design decision fr
declaration: package: org.bukkit.inventory, enum: ItemFlag
You can use that to hide the enchant, then just readd the word “Impaling” with lore
can i somehow loop thru each PDC element or set items PDC to some other PDC which is a variable?
is it possible to get all the arguments after arg[0]?
you can use ArrayList#sublist(1, ArrayList#size)
it will return all items after first one
ima try it out
it doesn't work
show code
ok
I tried this
ArrayList.sublist(1, ArrayList.size);
is it from java.util.ArrayList?
# usually represents instance method
So you can't just ArrayList.size
you gotta use your arraylist lol
idk what u mean
nvm
okay then is there a way to make the other arguments only arg 1?
instead of their own seperate argument
Just get subarray using Arrays.copyOfRange or smth and string join them
can you show me an example?
b
imagine handling nulls
for the "arr.length" do you mean args.length or its the same thing?
so do I keep it that way?
Or just string.join ig
You can loop through each key https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/persistence/PersistentDataContainer.html#getKeys()
declaration: package: org.bukkit.persistence, interface: PersistentDataContainer
and how do i get value from the key?
i also need persistent data type
you need the persistent data type and the namespacedkey
you manually keep track of those
damn