#help-development
1 messages Β· Page 165 of 1
static imports remind me of the unsafeness of python
static imports make me think about kotlin, and I dont like kotlin
"conciseness" uaagh
static imports make me think of the finiteness of life
public static String color(String string) { return ChatColor.translateAlternateColorCodes('&', string); }
this is one of the few exmaples where I'd use a static import
although even there, I'd rather just do TextUtils.color(...)
that one annoyed me so much one of my first utility classes was a shortened version of it
if only it could be as toxic as renaming methods' name in import
my color() method is a bit longer lol
Wheres the minimessages support smh
in another library https://github.com/JEFF-Media-GbR/Oyster-Message
are you using oyster message on your color method
no
smh
oyster is a standalone thing
public static final LegacyComponentSerializer SERIALIZER = LegacyComponentSerializer.builder().character('&')
.hexCharacter('#').hexColors().useUnusualXRepeatedCharacterHexFormat().build();
public static String colorString(String string) {
return ChatColor.translateAlternateColorCodes('&',
SERIALIZER.serialize(MiniMessage.miniMessage().deserialize(string)));
}
I hate how they call it "useUnusualXRepeatedCharacterXFormat"
I consider this as the default hex format
like what?
lol
yeah idk they are sometimes very toxic towards spigot stuff
e.g. deprecating basically everything that takes a string
I am already surprised that sendMessage(String) isn't deprecated yet
Deprecating those methods does make sense
probably just an oversight on paper's side lol
not if they want to stay compatible with spigot imho
They aren't going to be removed any time soon
if it's not deprecated in bukkit, it shouldnt be deprecated in any fork that claims to be compatible
they could have just added a @see comment instead of deprecating everything
but i dont care, i dont use paper api
I'll only switch to it when almost noone uses spigot anymore
i dont think this will change anytime soon
^ that's the global stats
my users have both, a higher spigot and a higher paper percentage lol
yeah no idea what that even is lol
Forge spigot hybrid
Whereβs Loliserver
creating an obscure fork that'll die in 2 weeks > contributing upstream
change my mind
wonder how quick fabrigot will die
never heard of that
tl;dr all hybrid forks/things suck
and not in the good way
wasn't mohist this thing that didnt have persistent Player objects?
the one that created a new Player object everytime a player died, and they weren't even equal() to the old objects?
Mohist can replace your plugins with their own modified versions
im making a plugin where you can create different particle effects like spirals etc, whats the best way to do this with no/minimal lag?
Yikes
I might be completely misunderstanding pdc, but are they located in some file which can I manually delete for testing ?
Depends on what pdc
Player pdc is in the player data files
The rest is in region files or entity files
thanks π
for most stuff, the PDC is just an NBT tag called BukkitValues
(or PublicBukkitValues for ItemMeta)
Inventory#getContents() returns an ItemStack[]
then just check the items in slots 0 - 8
tiny example that takes two player inventories
public static boolean areHotbarsEqual(PlayerInventory inv1, PlayerInventory inv2) {
for (int i = 0; i < 9; i++) {
ItemStack item1 = inv1.getItem(i);
ItemStack item2 = inv2.getItem(i);
if(!Objects.equals(item1, item2)) return false;
}
return true;
}
this however wouldn't work if your hotbar contains "damagable" items
because ofc a damaged pickaxe will not equal an undamaged one, etc
also renaming items in an anvil will also break this system
I'd probably give the player a certain PDC tag once you gave them the hotbar inv, then just check if they have this tag
unless you don't need to worry about this
oki sure, then you can just compare the inv contents from slot 0 to 8 with equals() π
depends on what it does
if it creates a new world, then yes, that is very bad π
if it only does some tiny math, then its no problem at all
just remember what the vanilla server does EVERY TICK
it loops over every loaded entity, it checks their physics, health status, potion effects, AI controller, etc etc etc
as said, it depends on what you rurnnable actually does π
as long as you don't trigger thousands of block physics or load chunks (or similar I/O) then it's probably fine in 99.9% cases
that of course also depends on the contents of your if statement
if you do
if(stuffThatsHardToCalculate())
then it's not so good
if you do
if(entity.getX() <= otherEntity.getX())
then that's basically nothing
that's probably one of the fastest things you can ever do in java
a == will ONLY compare the memory location
you can do that 50k times per tick without noticing any downsides
== really only checks
"is this.memoryLocation the same as that.memoryLocation"
equals() on the other hand is a different story
for example, comparing ItemStacks is "kinda" expensive IIRC
would love to know how inteliij manages to break code that works without me changing folder names
Wdym
i refracted some folder names through intellij, it managed to break an enum
nothing that should even care about folder names
The folder names have ofc have match the package names
they do
If you only change the case of a folder, it indeed sometimes breaks
Thats why i never rename My.Package to my.package directly D:
didnt change case either lol
Then idk
stackoverflow doesnt even tell me why the errors appearing or how to fix it lol
what errors?
error: unclosed character literal if (c == 'Β§')
?paste the whole class pls
gradle
okay same for gradle
Β§ are two chars when you're not using UTF8
alternatively, do it like this:
if (c == '\u00A7') {
this should work even when you don'T set it to use UTF8
np
the problem you experienced was basically this
https://github.com/JEFF-Media-GbR/WeirdJava#unicode
java is weird
huh
yeah, it looks like a comment
but the \u000a stuff is a newline, and the other two things are } {
so javac sees it like this:
if(true == false) { //
}{
System.out.println("Java can be weird. This line DOES get printed");
}
That is hilarious
I also love this
The IDE does not approve of that
Oh wait now it works what
It was saying Not a statement earlier
I just added a random if statement under it and it decided that was ok
it's just a label (called "https") followed by a comment
It doesn't like this
Yeah but this is fine
I didn't move the link
I mean either way it definitely belongs in a WeirdJava repo
it only works in front of statements
e.g. int i = 0;
that's not a statement but an expression
ah
Are you making fun of my true == false 
C coders be like
#include <stdio.h>
#define TRUE 1
#define FALSE TRUE
int main()
{
if(TRUE == FALSE) {
printf("Hello World");
}
return 0;
}
This is why no one uses C
yeah
noone
for real, #define is so weird
#include <stdio.h>
#define weirdShit (printf("Lol"))
int main()
{
weirdShit;
return 0;
}
this prints "Lol"
#define is like search/replace before compiling lol
actually kinda neat
even this works
#include <stdio.h>
#define lol int main() {printf("Hello world"); return 0;}
lol
Good ole preprocessor directives. Those define directives can be such a hinderance to code readability lol
Very useful for backwards compat though!
yeah it's a curse and a blessing
and then there's bash, where 0 is true and 1 is false
this is "Hello World" in Piet
Yeah my friend and I were talking about those literally last night
And he sent this
Which it totally allows you to do
what about brainfuck
brainfuck is still easier to use in real life than haskell
I mean at that point you might as well just #define LMAO if instead
I think he was just making the point that it's literally just replacing it so it allows for non-sensible syntax
Β―_(γ)_/Β―
I wonder what happens if you do this in java
public static native void doSomething();
public static void main(String[] args) {
doSomething();
}
U know what sucks about working on a server with plugins that have existed since 2012 and haven't been touched in years? Cloning a repo and having to fix dependencies for the 15th time π©
yeah that sounds annoying
Very unfun
I have to go find new repos, versions etc, then clone and install other repos from the server and do the same process for them sometimes
guys help me
i feel dumb
Task:
You are given a number N. Print all numbers from 1 to N. (recursion only, not a simple IntStream.range().forEach() or for solution)
i can understand all numbers fron N to 1
basically just decrease until N == 0
but backwards is the question
From 1 to N not N to 1
do you know what recursion is
how do i make this better.. i don't know how to begin
like I'm not entirely sure how to shorten this down easy (ignore static, i'm working on fixing that)
https://paste.md-5.net/gejokukeme.cs
i don't understand from 1 to N
public static void print(int i, int n) {
System.out.println(i);
if(i == n) return;
print(i + 1, n);
}
spoonfeeding π
public static void printUpToN(int target, int current) {
if(current == target) return;
if(current < target) {
System.out.println(current);
printUpToN(target, current + 1);
}
}
public static void main(String[] args) {
printUpToN(10, 0);
}
that's stated in task
You have to have i though I think?
Otherwise you don't know what number you're on lol
oh shit
sorry i'm really sleepy
this was for last task
about not allowed i
for my one it works
lolll

there are multiple limits on each task
go to sleep mate
except this one
Why the current < target check
I guess if they enter a current thats greater than the target? Lol
then do it like this
public class Thing {
private final int target;
private int current = 0;
public Thing(int target) {
this.target = target;
}
public static void main(String[] args) {
Thing thing = new Thing(10);
thing.printUpToN();
}
public void printUpToN() {
if (current <= target) {
System.out.println(current);
current++;
printUpToN();
}
}
}
then it doesnt take any argument lol
i am not allowed to use global variables/fields at all
then send us the full assignment "message"
He can use i
it's on russian
oh ok easy
how did i make a branch lol
Man you really need sleep
alrclosed it
bro discord isn't github
wait wtf
i hate this tasks
You are given numbers A and B
print all numbers from A to B
But
if A is bigger then B from the beginning
print all numbers from B to A
Bro i need boolean
No you dont
if you don't send the exact wording of the task, I consider this as valid solution
public class Thing {
private int current = 0;
public Thing(int target) {
System.setProperty("target", String.valueOf(target));
}
public static void main(String[] args) {
Thing thing = new Thing(10);
thing.printUpToN();
}
public void printUpToN() {
if (current <= Integer.parseInt(System.getProperty("target"))) {
System.out.println(current);
current++;
printUpToN();
}
}
}
obviously it's cheating, but there is no other way to do this recursively if you may always only pass "int n" into the recursive thing
Yeah
oh the "current" var ofc should be a passed into printUpToN
I just copy pasted it from earlier
just scroll from min to max
it's going up anyways
just have to get the bigger number before running recursion
i'm just too dumb to instantly understand
sleep goes brrt
lmao task 4 is on russian but i can't get what it wants from me
the stupid thing about these kinds of assignments is how useless they are, and also how stupid their wording is most of the time
given that you may not use global variables (called "fields" lol), and may always only pass 1 int to the recursive function, this would 100% solve the assignment
public Thing(int target) {
System.setProperty("target", String.valueOf(target));
}
public static void main(String[] args) {
Thing thing = new Thing(10);
thing.printUpToN(0);
}
public void printUpToN(int n) {
if (n <= Integer.parseInt(System.getProperty("target"))) {
System.out.println(n);
printUpToN(n+1);
}
}
How can I get pdc of player that is offline π€
get NBT's
short answer: you cannot
long answer you don'T wanna hear: you'd have to read their .dat file manually and parse the NBT contents yourself
That's not really hard as far as i remember
but would require wiki
cuz .dat structure
it's only a few lines with NMS
gonna try that, thanks
yea
but it's annoying nonetheless
i have an example
just do not use PDC if you need offline player's data
or don'T use their player object, but use the default world's pdc, or similar
or use a normal database like mysql or whatever
Used .dat files in my old plugin
only thing I ever used NBT for, is to serialize/deserialize entities
for everything else, there's api β€οΈ
already using that, just wanted to add pdc impl because i never worked with it before and want to try
yeah unfortunately, the API requires players to be online to access their PDC
aboud
Thanks π
decompile it cuz i don't have sources
shit what the fuck is going on
You are given numbers K and S
How much K-digits numbers with sum of whose chars == S exist
where do we get d from
should it be s, not d?
yeah you can easily read .dat files with the NbtIo class
NbtIo#readCompressed(File) returns a CompoundTag that has all the data
then you can use CraftPersistentDataContainer#fromNBT or however its called
public static void main(String[] args) throws Exception {
CraftPersistentDataTypeRegistry registry = new CraftPersistentDataTypeRegistry();
CraftPersistentDataContainer container = new CraftPersistentDataContainer(new HashMap<>(), registry);
File file = new File("uuid.dat");
CompoundTag tag = NbtIo.readCompressed(file);
container.putAll(tag);
}
this'll give you a PDC with the file's contents
I personally think better solution will be to make some wrapper class and put everything in some chunk
wyt
I dont think so, sometimes servers reset the world etc but want to keep player data
wdym
do i use (int) c or Integer.valueOf(c)
- '0'
just cast it to int
alr
you dont even need to cast
i worked with such cringe stuff in c++ only
after all, int is a "super set" of char
i guess should work
if you want the sum, sure
but
I wonder why anyone would ever need the sum of a char array
ooh
well
then it will not work like this
the int value of '1' is not 1
but 34 or sth like that
it's the ASCII value
that's what i meant when asked
aah ok
actually for(char ...) should work fine
Integer.parseInt(c + "");
I was wrong earlier
public static void main(String[] args) throws Exception {
char[] num = { 1, 2, 3 };
int sum = 0;
for(char myChar : num) {
sum += myChar;
}
System.out.println(sum);
}
this prints 6
so yeah, works fine
ok
the cringies thing
not stated if i can't use amount field
i need to get amount of k-digits numbers
with sum of digits == S(which i get from keyboard)
no idea what you mean
basically if S = 3
and K = 3
then 111, 102, 120, 300, 201, 210(3 digits in numbers)
sum of digits gives 3
and if S = 4 then
112, 121, 211, 220, 202, 301, 310, 400
i dont get the question
sum of "whose" chars?
oh true
my brain translator died
basically calculating how much numbers if i sum their digits up gives me 3 or 4 as a result
is there a way to detect when a player stops breaking a block?
or a player animation stop
or some other value
don't think so
ah
but i need an external AMOUNT variable instead
not without listening to incoming packets IIRC
or carry the amount as a parameter in recursion
i'll do that
or that's what i'm trying to do
what version are you using?
1.19.2
on 1.17+ (remapped mojang) the packet you wanna listen to is called ServerboundPlayerActionPacket
ok
how can i set the speed of a particle using spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force)
is it on protocolib?\
BlockDamageAbortEvent
the worst code ever
then check if the Action is Action.STOP_DESTROY_BLOCK
oh right
I always forget that this was added
@tender anvil forget everything I said
ok
and just listen to the event @young knoll mentioned
5 am soon for me
is it in protocolib because i haven't really done packet listeners on nms yet
fair enough
it's a regular spigot event
no protocollib or anything needed
ok cool
declaration: package: org.bukkit.event.block, class: BlockDamageAbortEvent
it was added in 1.18.1
is there any option to disable "opening the last opened files" in intellij?
I fucking hate it to have to wait 3 minutes when I accidentally closed a project while having a huge file open like this
Settings -> Appearance & Behaviour -> System Settings -> Reopen last project on startup
thank sbut that's not what I mean
it's not about opening the last project, but about opening the files I had open in a project
imagine I have class X open in Project Y. Now I open project Y again, and now it automatically opens file X again.
this is what I want to prevent
How can i prevent server from sending particle packet ?
I create a listener for all packet players send and receive but no particle packet was sent
hook into netty, or use some packet library like PacketEvents
oh you already have a packet listener?
well some particles are 100% client sided
what particles do you want to "cancel"?
not possible
Why ?
because, as said, many particles are 100% client sided
e.g. those drip animations from lava/water that's above you
there are no packets for that
the client shows those automatically
can i cancel that ?
no
I am pretty sure that those are also client sided
just listen to the packet, and if it doesn't trigger but still shows the particle, then it's client sided
I don't know every single particle, all I can tell you is this:
- Listen to outgoing "particle packets"
- If that "packet event" doesnt get triggered on the server, but you still see the particles:
- Can't cancel that :/
how protocol lib did that ?
they didn't
protocollib also cannot "cancel" client sided particles
hmm so how they work ?
how does what work?
π€·ββοΈ texture pack or client mod
idk look yourself lmao lets take a look
looks like there is a damage particle event
there you go thats how
why tf did you bother even asking here instead of just decompiling
i dont want to use protocol lib :l just need pure nms
very unlikely your going to find someone to spoonfeed you nms its kinda a lot of experimentation
also you could just look at the source for protocol lib
I'm concerned you don't even know what your doing
Well its a valid question imho
it listens for the PacketType.Play.Server.WORLD_PARTICLES with Particle.DAMAGE_INDICATOR in protocollib,
He doesn't want to use protocol lib though
So you need to find mojang mapping equivalents
I was only telling him what packet it is, so ye.
just found it tksm
tbh protocollib is one of the worst APIs ever
I'd avoid it all costs
e.g. PacketEvents by retrooper is so much better
What makes it so bad? lol
what makes it bad? I will give you an example
so i rewrite it :d
ProtocolLib:
SomePacket packet = new SomePacket();
packet.getIntegers().write(1, entityId);
packet.getStrings().write(2, entityName);
packet.getVectors().write(3, new Vector(0,0,0);
yeah i just realized i can see why it's shitty without the packet wrappers
NMS:
SomePacket packet = new SomePacket(entityId, entityName, position);
lmao
protocollib does the opposite of what it promises
getInts(), getStrings(), ... wtf? the NMS packets have a cleary defined constructor, ProtocolLib is so abstract that you always need to open wiki.vg which btw doesnt even tell you the proper packet names
oh and protocollib doesnt use the wiki.vg packet names. it also doesnt use the spigot packet names. it also doesnt use the mojang packet names
NMS packet names are straightfoward. ClientboundEntitySpawnPacket
Protocollib is like Server.Play.Out.EntityAdd or sth like that
where does this "Play" or "out" come from?
and why is it called "Server" when it's a clientbound packet
and why do I have to do setInt(1,...)
Nms packets with mojang mappings don't change much as far as I'm aware
I rewritten my one
they basically never change, unless there's something new. and in that case, PLib's setInt(1, ...) will also break
but in NMS you at least know it on compile time
with PLib you only realize this at runtime
PacketEvents > ProtocolLib
will definitely check out packetevents for my own future packet endeavors then, lol
it's written by @alpine urchin and the only thing I can complain about is that it needs like 4 method calls before you can use it lol
but other then that, it's just way better than protocollib
CraftBukkit mappings. Play is the protocol (because there are other protocols such as the status and login protocols), out is the direction (outwards from the server, clientbound)
Also, wiki.vg isn't relevant to ProtocolLib because it operates on the fields in the packet class, whereas the wiki outlines the data that's sent across the network and when you can expect it
Yup
Thats a thing many people donβt know
Cause they see it as a Server sided packet I guess
Not many people know about Clientbound and Serverbound terminology cause theyβre used to NMS naming
is there a way to make an itemstack glow enchanted, but without giving it a real enchantment?
so you can give for example /give @p stone{Enchantments:[{}]} 1 which is a stone that looks enchanted, but isn't. how to do this with an ItemStack?
Itβs in the nbt
okee, and how to change this?
Or just add an enchant and use hide enchants flag
jeah i do this rn, i think that's fine too, thy π if i have to much time i'll try with editing nbt
gotta stay on your toes
it keeps you alert
sometimes my plugins throw math problems at online users and if they don't solve them in under 1 minute it deletes their entire network
stay alert or die alert
how would i generate a smooth transition between ints
what exactly do you mean?
well i'm trying to make a runnable that smoothly transitions from the current time to 6000
ticks
Ok thats actually cool
probably by counting up then
within 2 seconds
so the fate of the entire network is in the hands of one random player
count up faster then
ohmygod
Ima become admin of hypixel just to put that plugin πΉ
Skill issue tbh
"hehehe, time to let 2+2 be 3"
shouldn't have allowed a bad actor on to your network then
seems like a moderation issue to me
Should've just not used maths
it used to require users to write a poem about how awesome I am in iambic pentameter or haiku but I got complaints that neither work for some languages
Personally, I'd just copy and paste the formula, das just me doe
they have to compliment you until some AI is satisfied
have to reach a certain amount of compliment-points
and you cant double entry
Hi there, I'm trying to sync a config to my client mod using plugin messages (first time developing spigot plugin)
https://github.com/samolego/ClientStorage/blob/feature/modules/spigot/src/main/java/org/samo_lego/clientstorage/spigot/ClientStorageSpigot.java
I'm trying to make it send the custom payload (plugin message) on player join. STDOUT fires, though I can't seem to intercept packet on my client - injecting to handleCustomPayload in ClientPacketListener and making it print every identifier field (type ResourceLocation) (afaik this is the channel I provide) the only thing printed upon joining is minecraft:brand ... Any ideas where I'm doing the mistake - in the spigot or client part?
yeah I've managed to create a mix of INTERCAL https://en.wikipedia.org/wiki/INTERCAL#Details and Shakespeare https://en.wikipedia.org/wiki/Shakespeare_Programming_Language#Example_code
It's called "linear interpolation"
often denominated lerp
You can also do the rule of threes
int start = 2000;
int end = 3000;
int iterations = 20;
int delta = end - start;
int transitionOffset = delta / iterations;
so you add transitionOffset for each iteration
hello, i would like to scale absorption amount how do i do it?
otherwise it is like this
so add transitionOffset to the time?
or set it to that
Hi everyone ! I have a question : can we put a persistent custom attribute on player ?
yes
but shouldn't need to use it much tbh
For example : I want to put a int attribute on my player like :
« villageId = 8 »
just use pdc
What is pdc ?
?pdc
Oh ok, but last question
If player disconnect, the attribute persist or i need to re-set at spawn ?
well but the "Server" handles all packets, both incoming and outgoing
so the name "Clientbound" makes way more sense since it also tells about the direction
and not just about the useless fact that the server is involved, which is always true
it's called PersistentDataContainer because whatever you store there is persistent
Sorry π
Ok ok thanks a lot for your help !
ok I really need to split up my documentation into more pages, I'm at 1000 lines and I have barely started
writing documentation is the worst
nah put it all in 1 file
put it all in one line
I'll put you in 1 file
gotta make the documentation match your code style
i'll put the remainings of your dog I shot into a line and snort it like crack cocaine
you're both equally monstrous
nah I'm skinny and fragile
I hope the internet police raids your houses and find you guilty of harassing sexy people on the internet
magmaguy hates me because I figured enums were the best solution to his problem
mans threatening to beat me up in the streets
start a charity
it's not a threat, it's a promise
Try me
cmere
are you auto-closeable?
quirky goofy ahh joke
don't fuck with me, I got the 50 cent wallpaper
oh no we have a badass on our hands
yesterday, on german "who wants to be a millionaire", there was a dude from my city, and he was so ridiculously stupid
magma fyi a bus to your city costs 28 bucks
my background says "live, laugh, love, tase imillusion's balls"
60 bucks and you're dead
so you charge him 32 bucks to kill him?
fair
I'd kill magma for pleasure, not for money
what a roundabout way of saying you were on who wants to be a millionaire yesterday
this can be very easily taken out of context
I can only wish
I applied like 50 times already
yeah people might think you are coming over to smooch me instead, god forbid
bruh moment
alex is so dumb he can't even get past the application, imagine that
Dum is the artist? Was this you @worldly ingot ?
because I assumed the government already has my info
but no
they dont
rare video of @torn shuttle
synthol is one hell of a drug
we should have a jury that compiles our best roasts into a google doc
even though you wouldn't be on it
there used to be an irc thread on there
I was featured a few times
(by there I mean spigot forums)
IT'S RANDOM YOU IMBECILE D:
nothing in the world is truly random numbnuts
wow wtf this dude looks like an easter island statue
original soundtrack by ImIllusion
illusion's out here thinking he's hard but knows he will just flop over if he comes within 100km of my region
wish I had the availability to beat yo ass
too busy hyping yourself up in the mirror?
Is this a civil war in here
I was banned after my last battle caused the tsunami/earthquake
I didnt think youd get rocked that hard
I told them self-burn Wednesdays were a bad idea
ππ
why doesn't it remarks the correct lore etc? it's exactly the same...
create ItemStack:
ItemStack posterFrame = new ItemStack(Material.ITEM_FRAME);
ItemMeta posterFrameMeta = posterFrame.getItemMeta();
posterFrameMeta.addEnchant(Enchantment.DURABILITY, 1, false);
posterFrameMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
posterFrameMeta.setLore(List.of("Β§7use Β§6/poster help Β§7for more information"));
posterFrameMeta.setDisplayName("Β§fPoster Frame");
posterFrame.setItemMeta(posterFrameMeta);
check ItemStack:
@EventHandler
public void onPosterPlace(HangingPlaceEvent e) {
ItemStack itemStack = e.getItemStack();
if (!(itemStack.getType() == Material.ITEM_FRAME)) { return; }
ItemMeta itemMeta = itemStack.getItemMeta();
System.out.println(itemMeta.getEnchants());
System.out.println(Map.of(Enchantment.DURABILITY, 1));
if (!(itemMeta.getEnchants() == Map.of(Enchantment.DURABILITY, 1))) { return; }
System.out.println("1");
if (!(itemMeta.getLore() == List.of("Β§7use Β§6/poster help Β§7for more information"))) { return; }
System.out.println("2");
e.getPlayer().sendMessage("jo, korrekt");
}
guys just updated skyrim to new version, now my mods are too old
even libraries for another mods
can't play the game i love without downgrading back now
bro compared lists by ==
bruh
and why u do (!(==)) instead of (!=)?
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.
you can
you can
the output is true in this case
xd
itemStack.getType() != Material.ITEM_FRAME
^^^^^^^^
morice_0 u missed the point ig
yeah
he could just place != between values
instead of (!(ITEM#GETTYPE() == TYPE))
not doing !(firstValue == secondValue)
nukerfall i love you bro
yeah we said that you kinda missed the point
xd
no offense
everybody does mistakes :p
except comparing fucking lists with ==
i'm forced to do small gui by guide from 2015
damn
university sucks
ahaha
academic texts?
look at this task ΠΠ°ΠΏΠΈΡΠ°ΡΡ ΡΠ΅ΡΡΠΎΠ²ΡΠΉ ΠΊΠ»Π°ΡΡ, ΠΊΠΎΡΠΎΡΡΠΉ ΡΠΎΠ·Π΄Π°Π΅Ρ ΠΌΠ°ΡΡΠΈΠ² ΠΊΠ»Π°ΡΡΠ° Student ΠΈ ΡΠΎΡΡΠΈΡΡΠ΅Ρ ΠΌΠ°ΡΡΠΈΠ² iDNumber ΠΈ ΡΠΎΡΡΠΈΡΡΠ΅Ρ Π΅Π³ΠΎ Π²ΡΡΠ°Π²ΠΊΠ°ΠΌΠΈ.
i'm gonna trasnlate it
and you would never get it
Write a test class that creates an array of the Student class and sorts the iDNumber array and sorts it by inserts.
explain
gui sucks
sorting sucks
last assignment is using Collections Framework
gonna be the easisest from all
meant to be the hardest tho
Hi. I keep getting the next error in Eclipse (1.19)
```The import org.bukkit cannot be resolved````
Anyone knows how I can fix this? Have been stuck for 1,5 hour already. Tried reinstalling the file, grabbing the Spigot-API, the buildtools file and also the server file but nothing works
How are you adding spigot to your project and how are you compiling it
bro switch to maven
anyways, thx for good support also for beginners π¦
and: it doesn't work with != eighter, i've tryed this too
.jar dependency is not supported
In eclipse click "New -> Other -> Maven -> Maven project"
Check "Skip archetype selection"
Click "Next"
Fill "Group ID", "Artifact ID", "Version", "Name" and "Description" fields
Click "Finish"
There is a convention about package structure:
your main class should be inside 3 packages:
me.yourCodeNickname.projectName
for organizaiton or company you need:
org.organizationName.projectName
or
com.companyName.projectName
how can i convert a chunk's x and z to block x y z
Right click build path add external and select the jar file
(chunk.getX() * 16), I think?
God I cannot type
You should probably use Maven/Gradle, it just makes managing it easier.
is there any useful references to the attack speed of mobs in Minecraft?
do they all have custom attack speeds or attack every tick or what lol
They deal contact damage and the player has invulnerability frames
So if you want them to "attack" faster, just remove the invulnerability frames faster
uh I want them to attack at normal speed actually im not sure what speed that should be atm its 500ms
well I set it to 500ms
this is more a general question not specifically spigot
Minecraft's default is 60 ticks I think
ah I see I'll give that a try ty
So 3 seconds
hmm that sounds about right
Honestly I'm not sure what you're asking since you said custom attack speed and then normal attack speed π
ah I meant like
do they have mob-specific attack speed
eg a zombie takes 3 seconds, a slime takes 5
before their next hit/attack
Afaik the ones that deal contact damage don't
Skeletons, Ghasts, Blazes, they might, but I'm not sure.
π makes sense I'll keep that in mind tyvm
This doesnt sound right
I just googled it so that could definitely be wrong 
https://minecraft.fandom.com/wiki/Damage#Immunity According to this it's actually half a second, guess I got lied to 
Don't do that. Use Maven or Gradle
cool kids just x << 4
it's not supported now
create maven project instead of deault java project
and add dependencies through pom.xml
example is in my Etalon branch here
issue is thats its already a pretty old project that i started working on again
code for older java version
in eclipse there is a button
convert to maven project
or maven nature
don't remember
basically just create a new Maven project with same name
copy paste my pom.xml
Aight
And copy paste your classes
Yeah, Configure -> Convert to Maven Project
My only distaste with this option is that it keeps all your files under the src folder and makes it a source directory. I wish it would shuffle it over into src/main/java
well then download IntelliJ and do this
Choco you use Eclipse?
yeah
I do, yeah
@jaunty crest i have a project structure example in the end of branch as a screenshot
I'm usually the resident Eclipse issue solver lol
Well I suppose someone has to be lol
I mean more so people that are new to the IDE asking questions
He means when people have issues using Eclipse
except convert to maven project
@fluid river thanks bro, fixed the issue β€οΈ
btw you need to build it another way
not by exporting
basically you need to run mvn package
posted on the branch too
Hi π How can I make command that will be executed but it won't be sent to console/log?
you can probably make some Log filter
Sounds fishy
cringe question but are you sure you need a command
you need to work with logger
but in 99% of cases you don't really need a command as a developer
If you want really nothing to be visible then you can just use a packet listener and intercept the chat packet before it reaches the server.
Yes, I was thinking about this but still wanted to ask if there is something easier π I need same thing like AuthMe does and I was looking into source code but I didn't found what I was looking for π
I think its about right
let's not forget mobs are stupid and walk up to you and hit you and afk
Nah a zombie can hit twice a second easily
It doesnt just stay there for 3s
Yes but I want to make commands with passwords so because of security I need to do it without them sending that they were executed to console π
Too old! (Click the link to get the exact time)
yeah now that I think about it I get comboed by zombies sometimes
other times they hit me and stare me into my soul
and question their life choices
and have children
and die
then go back to assaulting me
actually true
you can get comboded by mutiple mobs
what about Attribute.GENERIC_ATTACK_SPEED
of enetities
doesn't work on skeletons tho
i tried once
Only players afaik
goddamn bukkit overcomplicating where tf the value of that is
wiki.vg came in clutch
so uh the Default attack speed is 4.0? 4.0 what lmao
4.0 attack speed
Value is the number of full-strength attacks per second.
I see
so I should probably add a cooldown of 0.15s
But this is for players with nothing in their hand
so you're telling me it changes if a player holds a stick
what a random mechanic
holy shit I get raped if I set it to 0.15s
It changes when the player has something in his hand that changes his attack speed attr
Zombies attack about twice a second. So 500ms
Hey, Im trying to generate a second (or even third) end. Unfortunately, although the boss bar appears, no Ender Dragon spawns. Do I need to spawn the Dragon myself or am I doing something wrong?
Spawn it yaself
its actually meant to damage me
the damage just isnt working
I will have to figure out why lmao
yeah
i was right
perhaps
I also realised I can set that attribute but the code im using doesnt use the attribute
Plz help, I need to make it so that when you click on a resident without a profession, he does not shake his head, is it possible to do this?
you could use PlayerInteractEvent and cancel it if the player is targetting one of those
How to cancel?
event.setCancelled(true)
Thanks, I'll try
What have i messed up on here? Not worked with player skulls before
pass your plugin
It says it right there, you cannot cast CraftMetaSkull to Itemstack
Yeah I can see that, how do i go about making skull of player
Doesn't work without casting it to itemstack
Doesn't WITH casting as its not an ItemStack
then apply the meta to a skull and use the skull
Ahh I was using wrong, i used metaskull not the itemstack, thanks
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
any pointer which points on object of MainClass(one which extends JavaPlugin)
dude u could just do
private MainClass plugin;
public Classname(MainClass plugin) {
this.plugin = plugin;
}
and use plugin where u want it
and make it final
How can I check if the players already been added to the gui so it doesn't just spam player heads? Also, I only want the slots on the inside so the 2 lower on the edge and 2 upper on the edge shouldn't be there. How can i do this?
Anyone?
Done the check for players in inv and it worked just want to know how to manage where the heads are placed (I want the border of the gui to stay glass panes)
When you add the skull for a player why don't you just break the for loop?
So much wrong with that code as well. Assert doesn't work during normal runtime just an FYI
I know it doesn't work
I don't need help with checking if player is in gui, i've already done that
.
I read into your code why don't you just iterate using a regular for i in range loop and use i to get the player and it seconds as the location for the head as well
You can also easily paginate it by using division
HI guys i added to my pom.xml local jar as dependency and on compiling with maven i get this error in git bash
I'm not that advanced idk what this is lol
this is how it looks as dependency in maven
Something you're using is using a higher version of java then you are
So you need to increase your version or not use it
i tried java 18 and then java 17 and then 1.8 but still nothing
You changed it in every location?
in pom i set java.verison and in project structure too
im not sure where to change it else ?
And your pom uses java.version everywhere?
wdym by that
Just send pom
?paste
Well you won't be able to use 1.8 if you're using a library that requires 61 unless the server also runs it.
so what should i do then
Not use whatever you added?
Your compile is set to java 8
In your maven compile plugin
i kinda have to
it is because of that plugin i have to use it so that my tabapi is working
Then change your compile to 17
which line is it
How can i prevent a player from dismounting from a entity?
have you tried to look for even for something like that
declaration: package: org.spigotmc.event.entity, class: EntityDismountEvent
And you set it to a java 17 jdk in the project settings?
yup yup
I did, but nothing worked for now
did you try to set it to cancelled just for you to see if i that is what you are looking for
change it in pom too
Try mvn clean package
in my git bash ?
same error
Send the full log
?paste
will player.hasPermission("") return true always? Checkinf if the player has blank permission? Or false?
Try updating the compiler plugin to 3.10.1
which line is it
142
</execution> is on line 142
Then resend the pom. Can't you see the version for the plugin? I shouldn't need to point it out lol
there is too many stuff for me to guess on what are you thinking
same thing
Same error?
yup
Send full error again
What does mvn -version output
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: C:\Program Files\apache-maven-3.8.6
Java version: 1.8.0_321, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_321\jre
Default locale: en_US, platform encoding: Cp1250
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Maven is seeing java 8
lol how do i change that π€·ββοΈ
I'll look more into it when I'm home in an hour if I remember
Don't pass null as your plugin?
sure
Yup, looks pretty null to me.
Its null?
Your plugin is null
Like the error says it is
π₯²
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
By learning java
I already
told you @viral hazel
private final MainClass plugin;
public Classname(MainClass plugin) {
this.plugin = plugin;
}
XD
Change Classname to your class name
oh my god what the fuck
EventInfo
Learn java please π I beg of you
private final Eventsystem plugin;
public EventInfo(Eventsystem plugin) {
this.plugin = plugin;
}
there u go buddy
yes you are yes you are
@vocal cloud managed to update version that maven sees and i did got build success but we will see haha
?paste
this has to be a troll at this point
you can not use new EventSystem()
I was gonna say that
You have been shown how to use dependency injection so use it.
new EventInfo(), this); @viral hazel
"this" is passing in the main class instance which I think is where you are registering the event
oh its command
just use this inside EventInfo(this)
Its so sad the answer is literally being screamed at him
And you continue to spoonfeed
Obviously he will not take the time to learn java so if I can answer the question without having to put much effort or into it its ok with me
But when it happens again will they understand? Id rather get them to go through the error
if he wont learn, then he should not be offered help
The error literally tells you to a T what's wrong
I understand what you guys are saying, I'm not telling you any different.
How do methods get run automatically like when I include protocollib? So to register Listeners etc
I get this error "ClassNotFound" but i have that class and there is no problems in that class
Maybe some code would help?
genius coding skills
@mellow pebble
would you like to see whole class ?
?paste
Noo need for code, class isn't shaded
if someone insists π€·ββοΈ
have fun AHAHAH
i mean i really dont know why does this happen because everything should really work fine
The package structure does not match up
Could you give us a compiled jar (if available) - those usually are a better indicator when analysing CNFEs
yeah i can
in your dm
Hello, I'm looking for support in coding a minigames plugin for a bungee cord server. It would navigate players from a lobby server to join a queue, then when there are sufficient players, they would be placed in 1 of 4 match servers. Is this the right place to get help with this?
If by support you mean you have questions and we have answers sure
yeah exactly
Yep :)
So I am new to using bungee cord and it's API, I am wondering if there are any resources that will help me with this?
String disguisePackage = "io.github.nosequel.tab.v" + nmsVersion.toLowerCase() + ".v" + nmsVersion; @mellow pebble
You can run a bungee plugin on the proxy, and you can check their documentation.
where can i find that lol
