#help-development
1 messages ยท Page 1464 of 1
yes, byte is different from Byte
@wraith rapids so does it bother you that google lets you search keywords instead of keeping a big directory of everything on google so you can browse the directory instead?
they are two very different things
dude
why didn't you tell me before
because it's java 101
and you should know it
google is quite different from my project
google can't categorize everything into neatly ordered nodes based on their use and intent
how nice
I mean it could if it really wanted to
if it could, and if it did, I'd use that rather than the search function
because when you compare a string of text vs a network mapped based on actual intention, the string loses every time
this is less the case in a project that you and you alone are working on
because you probably remember most of the names by heart
and can associate intention to those names
christ no
How to set the maximum value of a bossbar
I don't
and so searching them directly can be faster
but that is not the case for someone else browsing the project
it's quite possible yes
Maximum value is 1.0
ah ok
this is just one project
i remember most of the hundreds of names in my projects
it might take a little bit to re-remember them and their purpose after coming back after a while
but i do remember them
and that's all the more reason to categorize them based on a package tree rather than name
you are slowly losing the advantage of "i know this name" and getting into google territory
I couldn't even tell you the name of 10 people I studied with let alone the exact names of my class files
where you have to throw random search queries at it and hope it finds what you want
they are in packages, but also I know that if I want to mess around with a fireball power whose name I forgot I can just type fireball and it will be there
or you could open the packages that involve fireballs and see it'll be there as well
thanks you. I created color class. but how can I use this in spigot plugin's console?
yes, I could go to the list of all packages, find the one I am looking for, look through that list of packages, find the one I am looking for, look through the list of packages, find the one I am looking for and then browse that package directory
or I can just type "fireb"
and the downside of this is that your class names turn into orgBukkitBlockBlock from org.bukkit.block.Block
and what's the downside of that?
that they become absurdly and needlessly large and your code becomes illegible
idk
EnderDragonDiscoFireball is the opposite of illegible to me
it tells me everything I need to know at a glance
the other downside is that on windows, you have a max direcctory depth and character limitation in paths. On linux generally don't have that problem.
you don't need to know most of the things it tells you
I need to know it's dragon specific, that it's a fireball power and which one it is
the only extraneous thing in there is "ender"
and that's just because I am following the api name
perhaps you should also know that it's specific to your plugin
why don't you add your plugin name to the classname
you're being facetious because you just don't have a counter-argument for what I just said
i have other problem now with it..
this is false
i'm saying his class names are excessively verbose
no, we're comparing a search method vs browsing directories
I usually resort to browsing directories if what I am trying to search for doesn't pan out
if you named it something very easy to find perhaps you wouldn't have a hard time finding it in the first place
that's what I do
well that depends
and then again you end up with excessively verbose classnames
which is his way of saying you wouldn't have 20 classes called "fb"
my minecraft crashed with this
DataWatcher watcher = new DataWatcher(((CraftPlayer)player).getHandle());
watcher.register(new DataWatcherObject<>(7, DataWatcherRegistry.a), (byte) 1);
PacketPlayOutEntityMetadata meta = new PacketPlayOutEntityMetadata(((CraftPlayer)player).getHandle().getId(), watcher, true);
world.getPlayers().forEach(all -> ((CraftPlayer)player).getHandle().playerConnection.sendPacket(meta));
}```
depends on how broad you want to be about when it comes to searching. For coding projects, I have zero problems using either method
if you need to include every bit of information on what a class is and what it does and how to find it in the name, you'll end up with really long names
the name isn't the place to store all of the identifying information of a class
but if say I want to find a random obsucre file that I have, then browsing directories is going to be faster then using some search function
you still have not explained how EnderDragonDiscoFireball makes it harder to understand what it is
it probably doesn't necessarily make it harder, but it could turn into an odd name if its used for multiple things
it's just one power
but, I say use whatever works for you ๐
the ender dragon has 20, currently 6 of which are fireballs
it's needlessly long and takes up space and takes up time to read
if the only complaint you have is one that is of an opinion, then its not much of a complaint or argument
maybe I'm just a fast reader, but it takes me no time at all to read 4 words
then again that is my job
me neither but it takes somewhat longer than to read 1 word
I still can't imagine a world where you can somehow browse hundreds of project directories faster by hand than by typing 4 words but perhaps you're just some sort of super human at reading 1 word long directory names and your kryptonite is class names with 4 words
it depends on what exactly you are trying to search for
i wouldn't want to have a project of thousands of files each of which must be uniquely identifiable by their name lest I can't find them with a test based search function
they don't have to be entirely unique, just searchable
I wouldn't want to have to go through dozens of directories to find one class
look all I'm saying is that when I look up the javadocs I use the search feature, not once in my life have I actually even looked at what shows up by default
lol
for all I know there's a picture of a cute dog on there
well I think I pretty much answered when browsing directories is going to be faster
if what you are searching for is going to be contained just in a single project, then its going to be faster
its when you have to make that search broader does it become less efficient
I use the search function on two class projects
missed my point
I don't really care where you are using the search function. I am stating that as long as your search can be contained within a specific set of parameters. In your case just your project, then the search function is going to be most of the time faster. However, the moment you can't contain the search to something specific, IE it becomes a broader search will drastically become less efficient the more broader it becomes.
well yeah but unless you're on a seriously large project odds are there's a hard threshold to how broad your search can get
as long as my IDE is aware of all the projects I told it to be aware
I can search through them all
yeah obviously this won't work if you literally can't index the files
but I do have projects where searching isn't feasible though
IE, Mozilla firefox being an example ๐
you work on internet explorer AND firefox?
however, I can narrow it down by telling it certain directories to only look instead
that sounds like a conflict of interests
I don't work on internet explorer?
IE
how would i put just "\ " without it escaping quotatioon marks
the world doesn't deserve my top notch comedy
IE = Id Est
woosh
for sure
I'm sure microsoft also doesn't use this tactic, but I don't I'm not breaking down in cold sweats over it
but that is probably the best example I have where searching isn't always effective except unless you know the directories to contain the search to
I don't think I'll sneeze and accidentally become google
though it would be one cool party trick
well, googles patent did expire so you could always look at that if you are wanting to become what google used to be ๐
yeah this sounds like the space I should be competing in
what with my vast background of making semi-obscure spigot plugins and translating
you better watch out google
magmoogle is coming to get you
anyway I'm still
two powers short
lol
but it is also the reason why google search kind of sucks now too, since they changed their search function because apparently you can't use something unless its patented
according to the vast corporations lol
I wouldn't say it sucks but it does feel like it's a few features short
that being said I used duckduckgo for a few years but I still ended up going back to google for a few features
I wish I could not use google but at the same time ddg lacks the ability to answer queries on the search page
or at least to do it well
most likely because most websites tailor their stuff to google
it would be nice if google wasn't trying to predict everything I am trying to search for
predictive search is nice for people who are not tech savy. Terrible for people like developers because it tries to find what is relevant to their average user, not so much caring for the niche stuff
pro: a search engine that knows what you want to search
con: a search engine that knows what you want to search
google very rarely gets it right in what I am trying to search for
using google is super annoying because for every search query you make you need to think "how would a plebian search for this"
it's exceedingly rare that I don't get what I want from google on my first try
maybe you're a plebian
lol
maybe I just like typing because it's my day job
not sure what typing has to do with it
it's not hard to get a search right if you give it enough context
I can give it enough context all I want, if its a niche or obscure site I am trying to find or topic, google won't find it
all it's going to find is 2000 results of "how to open task bar windows techgenius guide"
man I'll feed google half remembered lyrics from random songs from the 90s and it will still sort it out by result 5
JUMP_HIGH or something
the names are dumb
should've gotten flattened in 1.13
but ig then we'd have to rewrite that enum at runtime with bytecode hacks too so eh
lyrics happen to be something google is interested in since they do have their own music section, in fact they started listing the lyrics right on their search page directly for most songs
well that's probably it then
ironically the one thing google's music service isn't good at is getting lyrics
declaration: package: org.bukkit.potion, class: PotionEffectType
try not to make it explode by doing whatever it is that you're doing asynchronously
don't be a coward make player movement async
only fools and cowards move in linear time
player movement could be async
main problem isn't doing that, rather the client wouldn't know how to handle it
couldn't make pvp worse
that'd involve making block and entity collisions threaded
which with the current system would be kind of bad news bears
yeah with the way MC is setup currently it just wouldn't work
but that isn't the same as saying player movement couldn't be async though. Which in most games player movement is async
although ig entity collisions are handled by the client
let's be real the way it is currently setup is the way it will remain setup for the rest of mc's duration
and most block collisions are handled by the client as well
almost all of player movement is clientside actually
from mojang yes, to have it different would require not just a custom server project but also client, which unfortunately there isn't very many decent projects as far as custom clients go
it's too much of a hassle to start one for as long as the official client keeps getting updates
DataWatcher watcher = new DataWatcher(((CraftPlayer)player).getHandle());
watcher.register(new DataWatcherObject<>(7, DataWatcherRegistry.a), (byte) (int) 1);``` is crashing my minecraft..
nobody cares about the client anyway
nobody that could actually do something about it cares
the load times are absurdly long as of like 1.15 or something
ever since that new eyebleaching red mojang logo in the loading screen
I don't quite know why minecraft's load times are so long
@wraith rapids but..
surely they could load things during runtime
data driven something something resources
well most of that stems from the fact that most people don't switch the JVM the client uses. by default the client uses 1.8 java that is shipped with the launcher
java.lang.ClassCastException: java.lang.Byte cannot be cast to java.lang.Float
at vp.cd(SourceFile:711) ~[vp.class:?]
at buq.a(EntityRenderer.java:675) ~[buq.class:?]
at buq.a(EntityRenderer.java:934) ~[buq.class:?]
at buq.a(EntityRenderer.java:1646) ~[buq.class:?]
at buq.b(EntityRenderer.java:1614) ~[buq.class:?]
at buq.a(EntityRenderer.java:1385) ~[buq.class:?]
at bib.az(SourceFile:1023) ~[bib.class:?]
at bib.a(SourceFile:419) [bib.class:?]
at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_281]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_281]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_281]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_281]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:159) [launchwrapper-of-2.1.jar:2.1]
at net.minecraft.launchwrapper.Launch.main(Launch.java:30) [launchwrapper-of-2.1.jar:2.1]
literally read
we all Float down here
why do you keep attempting to cast objects?
tf
at least cast it to the right shit
final byte i = Integer.valueOf(1).byteValue(); i tried it to
why do you need the byte value of 1, just curious
so he can have it explode by trying to cast it to float obviously
wait
notify
schedule for later
@dusty herald maybe they want to get some practice in for bitshifting or bitmasking one of the two
i have no idea what either of those do
noob
if they know what bitshifting is I will eat my hat
lmao
lol
You want to create a new Data Watcher, set its watched byte 7 to byte 1, create a metadata packet, set its data watcher field to the created datawatcher, set the entityid field of the metadata packet to the player's entityid and send the packet to the viewers >
my hat will remain uneaten
i need it to make it
you are
trying to cast
a byte to a float
the solution to this problem:
don't do that
and ironically float is not the type needed here either so the cast is unnecessary to begin with XD
I think vinny will make for a great mmorpg developer one day, he can clearly prove that he can create his own issues he just needs to then sell the solution to the playerbase
i have no clue where the cast is even happening because of the classnames
but if i and an int how does it become a i float
but he is passing a byte somewhere that expects a float
and for some reason the compiler isn't catching it
calm down
i'm calm
he pinged me
i can't see replies
not sure why
i cant understand it
it can be such a simple business but it can sometimes get so hard xd
ripcord = legacycord
they'll implement replies eventually maybe
idk, maybe they already have
haven't updated ripcord in like 2 years or something
then update
what's ripcord
LMao
are you modifying something with the client @minor garnet ? or is this a plugin you are working on?
kind of like discord
plugin
im trying remake this:
this shit right here? awesome
the last time I saw someone call things gay this often it was 2011 and I was in a COD lobby
well that explains where the casting comes in, the client is expecting a float but you have it set to a byte on whatever the packet is you are trying to send
which means that whatever you tried setting, was the wrong thing
holy fuck NNYa
you know suddenly it makes sense that you like directories so much
lol
I've never before seen an OS that looked deranged
there is a real reason for why everything is the way it is
and I saw the thing accursedfarms came up with
try looking at everything with just green colors ๐
are all of these reasons derived from a deep self-hatred?
mostly from eye damage
right
green colors I use sometimes especially for console because its just a military thing
i just want to create a package where all players see a certain player pulling the bow
basically there's some defect in the lens of my eyes that causes me to see shit in two
when looking at any screen in the military, its pretty much just green and white XD
high contrast and monochrome displays help with seeing things properly
it's a from-scratch rewrite of the discord client in like C or something
ok correct me if I'm wrong but aren't old crt vector graphics exclusively green?
very IRC vibes
I thought it came from that
same monitors still found in... oscilloscopes?
it's been a while
0x01 this is a byte...
@torn shuttle not sure of the top of my head, but the reason green is used is because your eye can see more shades of green far easier then any other color
hence why NVG's are also green
back in the day green was the brightest phosphor they could come across iirc
ah yeah
NNYA why doesn't it ever show when you're typing
that sounds vaguely familiar
is it bc ur name is so long
basically his client just doesn't send that packet
thats cool
my godlike ripcord powers also let me see all hidden channels and all user permissions and shit
yes I can see #verification too
well don't think anyone said discords API stuff was very good ๐
i don't even look at the channel list ever
i just have a select few channels open in my tabs
and a few other select channels in the custom list on the left
and then I just navigate those
i'm in like a billion servers, can't be arsed to scroll through them all
i mean magma u can mute channels and right click the server and click hide muted channels
I can't tell if NNYa always sees red or is blind to the color red
technically that is a hexadecimal visualization of a byte
or maybe both, somehow
i use red because it doesn't fuck up my circadian rythm
what version of windows do you even use nnya
10
is that why your walls are covered in blood?
does not look like it 
well they stated they have eye damage, quite possible he doesn't see red the same way you or I do
except it's red
how do I add a byte value 1 in a fdatawatcher
@dusty herald if you do, need to use a cpu limiter for it
many games from that time era used the CPU as the clock
yeah
so, modern cpus are way too fast for the games
let's play at 300x the speed
^
you are correct
oh shit, there's a #discord-staff 
discord-staff is mandatory
i wonder what goes on in there
probably nothing
idkk
discord forces servers of a certain category to have that channel
you see the staff like once or twice a week
so the cpu limiter basically artificially slows the CPU clock for the game so that the game doesn't run at million times faster then you are wanting it to @dusty herald
are you saying i can speed shit up just by changing the CPU limits
for older games yes
I mean that's not even the worst of it
because as I said, they used the CPU speed as the game clock or tick rate
there's games that have in-game speed tied to framerate
oh yeah there is that too
oh my god
a few years back some major racing title came out locked to 30fps
people unlocked it
many old games do that yeah
turns out it was tied to fps
also turns out the physics were sort of weirdly async
so cars would fly off the map
pretty much instantly
ah yes
best space sim game ever made 10/10 I believe it got recalled
async
async multithread physics fork
every developers wet dream
package me.notprankster.kitduels.events;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
public class EntityDamageListener implements Listener {
@EventHandler
public void onEntityDamage(EntityDamageByEntityEvent event) {
if (event.getDamager() instanceof Player) {
if (((Player) event.getDamager()).getNoDamageTicks() > 0) {
event.setCancelled(true);
}
}
}
}
I'm making a kitselector plugin, and I've got the GUI working, the tp'ing working, and the invincibility by using .setNoDamageTicks(), but my one question is how I would prevent the player who is invincible for a set duration after spawning from damaging people. This is my method but I haven't tried it yet. I want to know if this is the best way.
๐คท test it
listen to entity damage by entity event and check if the damager is invincible for a set duration, then cancel
don't do that
because I already know you're going to mess it up
and read the no damage ticks
ye, i just wanna know if this is a good method
basically this will run into the issue that anybody will have nodamageticks > 0 after they're punched
or just keep track of the players who are invincible and track their actions for that period of time
magma send that twitch thing again im on desktop
and just don't let them hit players ๐
yeah you should probably not use the nodamageticks for tracking this
as that's being used by the game for stuff
https://www.twitch.tv/videos/1035433388 will probably not work the twitch player is busted
i set them invincible by .setNoDamageTicks(invincibilitySeconds * 20)
oh my god
yes and punching them will also set the invincible with nodamageticks
yep
so whenever anyone punches anyone they become invincible for a brief moment and can't punch anything
what do i do?
you listen to damage events and cancel them if the damager or damaged player are invincible
and track invincibility separately
ergh
how do i make them invincible in the first place though
by marking them as invincible
idk, add them to a Set<Player> named myinvincibleplayers
or whatever
add them to an arraylist?
or keep a list of players you are making invincible and compare it to that if you don't want to run into compatibility issues
yeah, what you said but with a set
okay, thanks, now i know a better method
make sure you make it static buddy
I suppose you could
I mean this is the perfect use case
do i make the set in another class or can i keep it in the same listener class that sets them invincible
go nuts
ahhhhh
well you are not wrong about that @torn shuttle
tbf source is 1440p, no one is forcing you to run that at 10 pixels
nvm, i'll make a function
the site is
twitch is poo poo
worst shit ever
@torn shuttle works if I set it to 360p
2021 and we haven't invented video streaming yet
it automatically starts at 2 seconds and instantly stops and starts the countdown for the next video
this isn't even streaming, it's a clip
it is streaming
the stream was buttery smooth
works if I set it to source, but auto wants to default to 360p @torn shuttle
i probably can't even run source
fun
it's probably like 2gbps bitrate
I can run it as source and my display only does 1080
I can stream but I can't watch lol
tell that to my integrated gpu and 600mhz cpu
I have an integrated as well, but my cpu is faster then that XD
@torn shuttle then maybe set a lower resolution for recording then?
probably why your videos have issues
the videos are entirely fine when I record them locally
and the stream playback at 1440p is perfect
somehow clipping it is what broke it
i use action for recording and it eats through my memory like fraps but on cocaine
public static Set<Player> invinciblePlayers;
public void makePlayerInvincible(Player p) {
int invincibilityTime = KitSelector.getInstance().getConfig().getInt("invincibilityTime");
invinciblePlayers.add(p);
BukkitScheduler scheduler = KitSelector.getInstance().getServer().getScheduler();
scheduler.runTaskLater(KitSelector.getInstance(), new BukkitRunnable() {
@Override
public void run() {
invinciblePlayers.remove(p);
}
},invincibilityTime * 20L);
}
would this work?
should lower the video quality
he actually made it public and static
was i supposed to do that
maybe
it's valid
i mean ๐คท
ideally yes
eh
getters are nice
exposing state directly is bad bad
i use lombok for that though
where is tommy tom tom I wonder
it's magick
oh
ok just to prove a point here, this vod works just fine right https://www.twitch.tv/videos/1035159785?t=03h44m29s
just the clip I got from it is completely broken?
what?
substituted tom's name for tommy tom tom
public class EntityDamageListener implements Listener {
@EventHandler
public void onEntityDamage(EntityDamageByEntityEvent event) {
Set<Player> invinciblePlayers = InventoryClickListener.invinciblePlayers;
if (event.getDamager() instanceof Player) {
Player damager = (Player) event.getDamager();
if (invinciblePlayers.contains(damager)) {
event.setCancelled(true);
}
}
}
}
?
check the damaged player as well
you don't want people to damage an invincible player
so you should cancel those as well
ye
i just remembered it right now
public void onEntityDamage(EntityDamageByEntityEvent event) {
Set<Player> invinciblePlayers = InventoryClickListener.invinciblePlayers;
if (event.getDamager() instanceof Player) {
Player damager = (Player) event.getDamager();
if (invinciblePlayers.contains(damager)) {
event.setCancelled(true);
}
}
if (event.getEntity() instanceof Player) {
Player plr = (Player) event.getEntity();
if (invinciblePlayers.contains(plr)) {
event.setCancelled(true);
}
}
}
is this fine?
you may want to split the latter check into its own listener listening for EntityDamageEvent
as this event handler will only be fired for entities damaging the player
fall damage and cacti and lava and shit won't fire this
fyi that's not a getter if that's what it was meant to be
i assumed he was doing something with lombok
never really looked into that shit so idk how that's supposed to look like
i was jsut talking about lombok, and how it has saved my projects from being crouded
i've considered this, but i only want the player to be invincible from player attacks
3 seconds after spawn
@torn shuttle
Audio for portions of this video has been muted as it appears to contain copyrighted content owned or controlled by a third party.
also the video works properly too, can set lower resolution without issue
yeah
then this is fine, but you should also check whether the damager and damaged are players before cancelling it
then it's right
cannot access net.md_5.bungee.api.chat.TextComponent ? I imported the spigot dependency
since this will also fire when a zombie punches a player
I don't really care about playing copyrighted music lol
oh right
are you using a dependency manager
or directly importing shit via ide
@maiden briar
@torn shuttle well sometimes twitch will mute whole sections of a video where you can't hear people talk
I am using Maven
that should be included then
even if you use music that is public domain
I've never seen them do that for my streams in real time
check your dependency tree
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>${spigot.version}</version>
<scope>provided</scope>
</dependency>
bungee-chat should be there somewhere
Ok
and honestly aside for clipping purposes I don't really care about the vods, I don't know that anyone watches them anyhow
did I go too mainstream?
i dont ever watch streams
i don't watch streams at all because all streaming platforms are so laggy
It is there
youtube's streaming is a little bit more lightweight but the chat box bricks my browser
i usually stream in phases when I feel like it
But still get the error
clear caches and restart
How?
it's under File > iirc
honestly my stream content is really boring, most good it does is force me to go the extra mile to make something look good or work
i can only watch videos at a quality of 360p
Ok restarting....
caching is hard
having only 1 mbps of download speed sucks
and not spend hours making fun of nnya's distaste of my naming conventions for classes
your conventions are the only thing being made fun of
the feeling is mutual
lol
Still getting the error
what error
I just get it since I am working with module-info.java
cannot access net.md_5.bungee.api.chat.TextComponent in Maven
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
But I can import the class
And IntelliJ doesn't give any problem
Yes I done it exactly as that
oh well then clearing caches won't help
caches cause the ide to scream about issues that don't exist
Yes
alright so I've been putting off going to bed for 4 hours now, I think it's a losing battle
sleep is for the weak
gn, dream of my class names
says the man so worried about his circadian rhythm that he turned his entire OS into a horror movie
meanwhile I started working at 8 pm
like i said it's not exclusively about circadian rythm
no,. but it makes for a good zinger
that's just why I chose red over the other colors
never let facts get in the way of a good joke
[21:11:56 ERROR]: Could not pass event EntityDamageByEntityEvent to KitSelector v0.0.1
java.lang.NullPointerException: null
at me.notprankster.kitselector.events.EntityDamageListener.onEntityDamage(EntityDamageListener.java:18) ~[?:?]
help
public void onEntityDamage(EntityDamageByEntityEvent event) {
Set<Player> invinciblePlayers = InventoryClickListener.invinciblePlayers;
if (event.getDamager() instanceof Player) {
Player damager = (Player) event.getDamager();
if (invinciblePlayers.contains(damager)) {
event.setCancelled(true);
}
}
if (event.getEntity() instanceof Player) {
Player plr = (Player) event.getEntity();
if (invinciblePlayers.contains(plr)) {
event.setCancelled(true);
}
}
}
}
the exception has all of the information you need
if it says it's null then it's null
Sometimes I think the same, Java always gets it right
public static Set<Player> invinciblePlayers;
is this a correct way of declaring sets
or did i do itw rong
No
not initialized
you are declaring a field
new HashSet
the field is empty
it has no object
it points at no object
it is a null-pointer
it is null
i see
This is the same as public static Set<Player> invinciblePlayers = null;
i am completely stupid
public static Set<Player> invinciblePlayers = new HashSet<Player>();
like this then?
myes
Yes
thanks
tell that to intellij so it can stop warning me about it
Haha
why cant my server launch
it says can't keep up with server something running 67109 ticks behind
try not running it on a raspberry pi
Your PC is a bit overloaded
i play on a new hp laptop with intel pentium 4 1.2 hz and intel hd graphics and 2gb ram
is that enough for server
new BukkitRunnable() {
@Override
public void run() {
invinciblePlayers.remove(p);
}
}.runTaskLater(KitSelector.getInstance(), invincibilityTime*20L);
is this fine
cause i don't have much experience with things like these
i could be missing something like a way beter method
it works fine i guess
Bukkit.getScheduler().runTaskLater(() -> invinciblePlayers.remove(p), invincibilityTime*20L);
watcher.register(new DataWatcherObject<>(7, DataWatcherRegistry.a), new Byte((byte) 1));``` i really cant understand how to solve this problem
java.lang.ClassCastException: java.lang.Byte cannot be cast to java.lang.Float at vp.cd(SourceFile:711) ~[vp.class:?] at bib.t(SourceFile:1610) ~[bib.class:?]
this is problem intern of minecraft client
What is the type of DataWatcherRegistry.a ?
can we call paper event inside a spigot server (with maven import) (i think have the answer but i wanna be sure)
Red Tulip?
ah ok
อออ อออ| อออ| อออ| อออ| อออ| อออ| อออ | อออ อออ|อออ อออ| อออ| อออ| อออ| อออ| อออ| อออ | อออ อออ|อออ อออ| อออ| อออ| อออ| อออ| อออ| อออ | อออ อออ|อออ อออ| อออ| อออ| อออ| อออ| อออ| อออ | อออ อออ|อออ อออ| อออ| อออ| อออ| อออ| อออ| อออ | อออ ออ| ladder
How I can code a program, that moves a player to another server in bungee network?
What should be the exception I would throw if I only want one library instance per plugin but someone decides to create a library twice for one plugin (which should be illegal)
IllegalStateException?
if(player.isOnline() && player instanceof ProxiedPlayer) // line 44
{
ServerInfo serverInfo = ProxyServer.getInstance().getServerInfo(server);
((ProxiedPlayer) player).connect(serverInfo);
sender.sendMessage("ยงaDer Spieler wurde erfolreich auf den anderen Server verschoben.");
}
else {
sender.sendMessage("ยงcThe player isn't online!");
}```
[16:36:58 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing 'ccn redirect freebuild Verox007' in de.cimeyclust.commands.CCNetworkCommand(ccnetwork)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:169) ~[patched_1.16.5.jar:git-Paper-611]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:810) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.PlayerConnection.handleCommand(PlayerConnection.java:2170) ~[patched_1.16.5.jar:git-Paper-611]
Caused by: java.lang.NullPointerException
at de.cimeyclust.commands.CCNetworkCommand.execute(CCNetworkCommand.java:44) ~[?:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.5.jar:git-Paper-611]
... 18 more```
I have this error with this code. Can someone help me?
I use this on a child server of the bungee server.
Could this be the error?
why are you using bungee cord api on a spigot server
you cannot use the bungee cord classes on a "child" server
the bungee api is only valid for bungee cord plugins
That's what spigot uses if you try to make a second plugin instance iirc, so seems good to me
Do you know how to use ansi in spigot getLogger#log();?
i couldn't find any way in google
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Does anyone know a consistent way to connect player to a server on a PostLoginEvent? Or do i need to use another event? (BungeeCord)
thanks u. but sadly, i already took look at this and it didn't work ๐ญ
But I'll try it in great detail.
As mentioned it depends on the console
I don't think most shared hosts implement colors
As expected, it's the same. But thank you! ee(NoColor) < logged msg new ColoredLogger("e", '0').log(java.util.logging.Level.INFO, "e"); < code
String server = args[1];
Player player = Bukkit.getPlayerExact(args[1]);
if(player.isOnline()) // line 44
{
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("ConnectOther");
out.writeUTF(player.getName());
out.writeUTF(server);
player.sendPluginMessage(this.plugin, "BungeeCord", out.toByteArray());
sender.sendMessage("ยงaDer Spieler wurde erfolreich auf den anderen Server verschoben.");
}
else {
sender.sendMessage("ยงcThe player isn't online!");
}```
org.bukkit.command.CommandException: Unhandled exception executing 'ccn redirect test Verox001' in de.cimeyclust.commands.CCNetworkCommand(ccnetwork)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:169) ~[patched_1.16.5.jar:git-Paper-611]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.dispatchCommand(CraftServer.java:810) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.PlayerConnection.handleCommand(PlayerConnection.java:2170) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.PlayerConnection.c(PlayerConnection.java:1985) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1938) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:50) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.PacketPlayInChat.a(PacketPlayInChat.java:8) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:35) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[patched_1.16.5.jar:git-Paper-611]```
at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1262) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1255) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:1216) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1130) ~[patched_1.16.5.jar:git-Paper-611]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:289) ~[patched_1.16.5.jar:git-Paper-611]
at java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.NullPointerException
at de.cimeyclust.commands.CCNetworkCommand.execute(CCNetworkCommand.java:44) ~[?:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.5.jar:git-Paper-611]
... 18 more```
Help please.
It didn't work. I'm using this now, but I still get the same error in the same line.
read the error
are you using the same string (args[1]) to identify the server and the player ? xD
yes it is
read the error as i said, if you have a NPE just look the object you trying to work with
i'm actually trying to doing this but i don't know how to call regulary the WorkloadThread every ticks on spigot
https://www.spigotmc.org/threads/guide-on-workload-distribution-or-how-to-handle-heavy-splittable-tasks.409003/
Does anyone know why this only work sometimes?
@EventHandler public void onJoin(PostLoginEvent postLoginEvent) { ProxiedPlayer player = postLoginEvent.getPlayer(); ServerInfo serverInfoMain = ProxyServer.getInstance().getServerInfo("Main"); player.connect(serverInfoMain); }
wanna ping 7smile7 haaaaaa
Wdym
what ?
The work load thread is just the thread that actually does the computation?
i think (i begin in this so i continue to learn how it work)
just when i start it, it compute only once
or did i setup wrong my workeloadThread ?
workloadThread = new WorkloadThread();
System.out.println("Start filling queue");
for (int x = 0; x <= maze.length; x++) {
for (int y = (int) origin.getY(); y <= origin.getY() + 20; y++) {
for (int z = 0; z <= maze.length; z++) {
workloadThread.addLoad(new WallBreaker(origin.getWorld(), (int) (origin.getX() + x), y, (int) (origin.getZ() + z)));
}
}
}
System.out.println("Start task");
workloadThread.run();```
@AllArgsConstructor
public class WallBreaker implements Workload {
private final World world;
private final int x;
private final int y;
private final int z;
@Override
public void compute() {
Block block = world.getBlockAt(x, y, z);
if (block.getType() == Material.SMOOTH_SANDSTONE)
block.setType(Material.AIR);
}
}```
(i know set type is a very slow method but it's just to test the workload system)
@EventHandler
public void onJoin(AsyncPlayerPreLoginEvent e){
Bukkit.broadcastMessage("Humanoid is joining, fuck off");
e.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_BANNED);
e.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "bye");
}``` Message is broadcasted, player still joins.
Fixed by changing to PlayerPreLoginEvent
#Just1.8Things
hi, im making power orbs but this piece of code buff NPCs (Citizens with "player" type), how i can prevent that?
protected void buff(Player player)
{
player.setHealth(Math.min(player.getMaxHealth(), player.getHealth() + (player.getMaxHealth() * 0.02)));
PlayerStatistics statistics = PlayerUtils.STATISTICS_CACHE.get(player.getUniqueId());
PlayerUtils.boostPlayer(statistics, new PlayerBoostStatistics()
{
@Override
public String getDisplayName()
{
return null;
}
@Override
public Rarity getRarity()
{
return null;
}
@Override
public GenericItemType getType()
{
return null;
}
@Override
public double getBaseStrength()
{
return 10;
}
}, 20);
statistics.boostManaRegeneration(0.5, 20);
}
you're trying to prevent NPCs from getting this effect?
can u help?
i don't remember what the way to tell citizens npcs apart from real players was
you could always depend on their api I suppose
@tribal holly
can we call paper event inside a spigot server (with maven import) (i think have the answer but i wanna be sure)
yes but no
you can have the logic for it in place
but you mustn't refer to the event directly
(world.getOnlinePlayers().contains(player))
because the event class is not present in the spigot environment
Pretty sure the NPC's aren't part of the online player list
meaning any class that strongly deferences that class will explode
for (Entity entity : stand.getNearbyEntities(18, 18, 18))
{
if (!(entity instanceof Player)) continue;
Player p = (Player) entity;
if (c >= 5) break;
c++;
if (USING_POWER_ORB_MAP.containsKey(p.getUniqueId()))
{
if (!USING_POWER_ORB_MAP.get(p.getUniqueId()).equals(stand)) continue;
}
USING_POWER_ORB_MAP.put(p.getUniqueId(), stand);
new BukkitRunnable()
{
public void run()
{
USING_POWER_ORB_MAP.remove(p.getUniqueId());
}
}.runTaskLater(Spectaculation.getPlugin(), 20);
buff(p);
for (int i = 0; i < 8; i++)
playEffect(p.getLocation().add(SUtil.random(-0.5, 0.5), 0.1, SUtil.random(-0.5, 0.5)));
}
stand.setCustomName(sItem.getRarity().getColor() + (getCustomOrbName() == null ? getBuffName() : getCustomOrbName()) +
" " + ChatColor.YELLOW + Math.max(0, seconds.decrementAndGet()) + "s");
}
i have this
instance of player
update it run only few tasks and then stop
don't return, continue
ik
correct
whatever the use case might be
You can also just use Citizens' api assuming that's where these ncps are coming from
xcannot find symbol
[ERROR] symbol: variable world
I'm making a server where it's just 1 server & I need to handle bans, I'm used to handling bans in the bungee server but now I can't, what's the best way to check for bans upon joining/connecting? this requires database requests.
I'm unable to cancel the result there.
you can prevent the player from connecting
Someone know about workloader ?
set the result to deny
I can't, setting their login result to KICK or some bs just lets them login regardless
this is false
Sure
AsyncPlayerPreLoginEvent::disallow
prevents the player from joining
the player won't be allowed to join before all event handlers have processed the event, and since the execution happens off the main thread, you can block with your db request for up to 30 seconds
after your db request completes, you can either choose to allow or disallow it
the latter of which will prevent the player from connecting
๐ข
yeah i don't know what i'm looking at but denying the prelogin event prevents the connection
help
then make the world resolved
Well then perhaps check the clip which literally says otherwise
@EventHandler
public void onJoin(AsyncPlayerPreLoginEvent e){
Bukkit.broadcastMessage("Get the fuck outta here;");
e.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_BANNED);
e.disallow(AsyncPlayerPreLoginEvent.Result.KICK_BANNED, "nibba");
Bukkit.broadcastMessage("Bet you're still here...");
}```
if that absolutely doesn't work for whatever reason, then preload the data required for kicking or otherwise preventing the connection during async prelogin
This still lets them log in just fine
change to craftbukkit world?
my point is do the db query in async prelogin, as it is async
then do whatever you want with the data you get, whenever you want
No, I knew this wasn't an option because the same thing happens with AsyncChatEvent, I'm pretty sure the async events are just placebos in 1.8's spigot
what
chat is definitely async
async prelogin events are asynchronous from the main thread
async chat may or may not be
I can't change the format or even cancel it for that matter when using AsyncChat, only when using ChatEvent I can actually change things
I'm on 1.8 like I said
shouldn't have any effect on it
I don't know what it is
Yeah i'll look into that
just do the query asynchronously
chat is async until some plugin decides to do something with it, then it becomes sync
World is null?
You're defining the world before it actually loaded.
prime reason to not use outdated versions
im asking how to define it
I'm assuming you're working with locations?
if (!(entity instanceof Player)) continue;
Player p = (Player) entity;
if (c >= 5) break;
c++;
if(world.getOnlinePlayers().contains(player)) continue;
if (USING_POWER_ORB_MAP.containsKey(p.getUniqueId()))
{
if (!USING_POWER_ORB_MAP.get(p.getUniqueId()).equals(stand)) continue;
}
USING_POWER_ORB_MAP.put(p.getUniqueId(), stand);
what;s wrong
learn java basically
clearly not
yes now im actually a clown
Looking back at it knowing you just don't understand java and referring to the error as a bulb makes me laugh a little
lmao
a bulb
probably referring to the icon in the IDE
myes
This magic bulb told me that world isn't defined? HEEEEELP
Let me guess, you did World world; & called it a day?
The magic world of wonders
depends on ones definition of the world. For some, it could just be the continent they are on
my world is the barrel i live in
i can use bukkit.getonlineplayers()
yes but somehow it works
yeah this is a no fun zone
so I hear
you need to be a cuck and pay server boosts to get to use emojis and shit
there are like 3 channels and the staff are basically dead
full of boost
36
in a word this discord as a whole is pretty shit
this help channel doesn't even have any pins
the lord already knows i'm not about to waste 3 dollars a month to use my nitro emotes in a specific Discord server
it's like they don't care at all
yes i want to test if the orb still buff player but forgot to install citizens
that is what the forums are for
my entire life is a circus
why even have a discord guild if you're just going to let it rot
because it is free
he does it for free
Meh why not, you've got people like you and me still using it.
they should put some effort into it
why?
not like the forums are any better anyway
forums are far better for information storing then discord is
Maybe some magic bulb tooltip will magically make them care
yeah but compared to bukkit forums they're extremely lackluster
bukkit didn't make its own forums
if the forums are the thing they're focusing on they could at least make them good
Bukkits website was/is managed by curse
and spigot's is some 3 dollar stock xenforo design
Spigot doesn't have such a sponsor
i use bukkit.getOnlinePlayers and its work
good job
why i became a clown when i can become not a clown
not exactly sure what your complaint is with this
cause my entire life... is a circus
my complaint is that everything about it is bleh and either rotting to shit or mediocre
so, you are upset because spigot chose to not toss a ton of money to its website
replace money with effort and ton with decent amount and you're mostly right
time is money mostly, that includes effort
yes but effort has more soul
Hi, someone know why my workLoad run stop after few compute done ? and how to make it compute until the workload is empty ?```java
@Override
public void run() {
long stopTime = System.currentTimeMillis() + MAX_MS_PER_TICK;
while (!workloadDeque.isEmpty() && System.currentTimeMillis() <= stopTime) {
workloadDeque.poll().compute();
System.out.println(workloadDeque.size());
}
}```
because you're telling it to stop when the queue is empty
yep but when it stop he is not empty
Well, the website serves its purpose for what it is for, can't ask for more when it doesn't charge you to use it.
then it has reached stopTime
3.5Millions remain
Heya!
I'm looking for a way to get the durability of a pickaxe. Tought about using getItemInMainHand().getDurability(); but I see it's **Deprecated **. Tried to find another function to get this data, but could not find it. Any tips?
read the note about deprecation
yep to avoid overHead the tick as the 7smile7 tutoriel explain
on the javadocs, it says why it's deprecated and it probably mentions a replacement
but i don't understand how he is doing to make it repeat every tick begin until is not empty
i don't know what you're talking about
PlayerInventory
(i can send back the 7smile7 tutorial link)
@lost matrix help this man
i was afraid to ping him
real men don't know fear
hahaha
the gayest
looking at this guide it probably expects you to schedule a repeating task rather than a single task
yep i was thinking about this but as he said in spigot we can't call every tick Start because we don't know
and he talk about some kind of tps check
but don't specify how
ideally you would use paper's getMspt to see how much free time you have
yep but can't use paper event inside spigot server
and then allocate like 30% of that
yeah well that's why more than 60% of people don't run their shit inside spigot servers
i begin to know about this but i wanna make it on spigot
and maybe after shade it to paper
do you want github link ?
does your github describe your project concisely
in french yes but google translate
then no i do not want the github link
to late
in few world a maze mini-game with god and abilities
are you're that guy with the dungeon plugin
huuuu
that not was YOUR plugin ?
i remember talking to you about async task make on other thread
i remember talking to someone who was working on a dungeon plugin about my dungeon plugin
so that was probably you
it definitely looks like a dungeon plugin
if you want
looks interesting i suppose
lmk when you've written it in english and built it against paper
might give it a try
no problem i've got a friend on the translate part so maybe a day
whats the best way I can handle this: i have an ArrayList with objects stored and I want to return the object with the highest value (the method xFactor() returns it)
how often is this arraylist modified
how often do you need to get the highest value
just when i execute the method
that answers exactly zero of my questions
just need a quantic computer to do this fast
its only modified when i add an object
no shit
and thats only in the beggining
so you're reading more than you're writing
yes
do you also need to get the highest values of other kinds, like yFactor() or whatever
well the objects have only one method and thats xFactor() which returns a double and i need to get the object with that highest double
sort the list
Collections.sort(list, Comparator.comparing(element -> element.xFactor()))
if you can't sort it, iterate over the list and find the highest value
algorithme exercise i see
yes i have a for loop
you should exceed expectations
wut im figuring out how to do it
write a heapsort algorithm and use it to sort the list
Offload the operation onto a server in India
lmao
In computer science, a sorting algorithm is an algorithm that puts elements of a list in a certain order. The most frequently used orders are numerical order and lexicographical order. Efficient sorting is important for optimizing the efficiency of other algorithms (such as search and merge algorithms) that require input data to be in sorted lis...
do you think I've already learned that?
could try recursion for a faster loop, but beware it is easy to cause lots of problems doing this lol
the point is that you haven't learned it yet
so you should exceed expectations by learning it
its a exercice so i would be able to solve it
you should think of it as something more then an exercise problem as this problem is something you will run into constantly in various forms regardless of the project/code language you use
now that we're on the subject matter of sorted shit
does anybody know any actually navigable map implementations
i know java has "navigable" maps like treemaps
but in order to "navigate" from one entry to the next or the previous one, you need to search through the entire tree all the way from the root every time
which is just a colossal waste of time
create one
i'm not seeing a way of navigating about the former without passing the current entry's key to higher/lowerEntry
which has to go through the entire tree to find the next entry
wouldn't you be able to sort the tree map in such a way that the root has the entry you want?
i want to maintain a pointer within the sorted map and be able to move that pointer forward and backward at will
the use case is a list of trade offers that is modified relatively frequently by adding/removing entries
the pointer itself is mostly used for paginated views of the list
i'm using a tree map for it but navigating to the next/previous entry in a treemap involves going through the entire map to find the next key that is greater/lower than the key I'm currently at
in logarithmic time, sure, but still needs to go through the tree all the way from the root
f.e via a next()/back() method on the returned entry itself
uhm
it doesn't have pointers?
to navigate between the nodes?
maybe you're not checking the TreeMap's methods
since i bet navigable map is pretty weakly defined
could look at using treemultimap or make your own custom multimap
i guess i'll just have to write it myself
should be relatively simple
just need to maintain a linked list of the entries and then have methods on the entries returning the next/previous elements
treemap.entryset?
doesn't have a 2-way iterator from what I can see
why would you wanna return?
because the user might want to go back to the previous page
you could hold a stack history yourself then
the list could get modified at any time
but i guess you can't have a tree map view of the prev node then
i don't think a tree map is your solution here
you need a custom build system
what I need is a treemap that lets me move to the next and previous nodes on demand
sadly one doesn't seem to exist
What's the difference between gradle, maven and the artifact thing
it should be a tree as that makes insertions and finding the nearest values to specific queries fast
Im always confused by this
and it should be linked as that makes modifications fast
and since it's linked it can't be random access
which disqualifies binary searches as a replacement for the tree structure
gradle and maven are build tools
it allows you primarily to attach dependencies
or run tasks
the difference between them, i dunno
i guess the syntax
and some nice to haves
Like including the dependencies in the final jar file?
that's a part of it
not always tho
it's mostly so users don't have to scour for the files
they can download them
How to get current server version with the spigot API?
the most notable part about it is that it automatically downloads and links the dependencies you're using with your ide
Bukkit.getVersion
for example, if you use your IDE alone to import spigot api
Thanks thanks
you won't have access to the bungee chat components
because those aren't actually in the spigot api jar
Unless I use the full spigot
but if you use maven/gradle, it will see that spigot api includes bungeecord-chat
and automatically downloads the bungeecord chat dependency as well
So does gradle/maven have anything to do with the finish product?
I see
you can make it shade stuff in, relocate stuff around
Can it help in reducing the file size then
automatically fill plugin.yml placeholders with project variables
filesize is one of the most irrelevant things in development
Cause idk what I did but the plugin went from 1.3m to 40m
