#help-development

1 messages Β· Page 165 of 1

tender shard
#

yeah

agile anvil
#

static imports remind me of the unsafeness of python

tender shard
#

static imports make me think about kotlin, and I dont like kotlin

#

"conciseness" uaagh

torn shuttle
#

static imports make me think of the finiteness of life

tender shard
#
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(...)

torn shuttle
#

that one annoyed me so much one of my first utility classes was a shortened version of it

agile anvil
#

if only it could be as toxic as renaming methods' name in import

tender shard
#

my color() method is a bit longer lol

remote swallow
#

Wheres the minimessages support smh

remote swallow
#

are you using oyster message on your color method

tender shard
#

no

remote swallow
#

smh

tender shard
#

oyster is a standalone thing

remote swallow
#
    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)));
    }
tender shard
#

I hate how they call it "useUnusualXRepeatedCharacterXFormat"

#

I consider this as the default hex format

young knoll
#

It has uhh

#

Less kind names internally

tender shard
#

like what?

young knoll
#

Don’t remember

#

Something something stupid

tender shard
#

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

chrome beacon
#

Deprecating those methods does make sense

tender shard
#

probably just an oversight on paper's side lol

tender shard
chrome beacon
#

They aren't going to be removed any time soon

tender shard
#

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

chrome beacon
#

CatServer 🀒

#

Oh no Yatopia

tender shard
#

yeah no idea what that even is lol

young knoll
#

Forge spigot hybrid

tender shard
#

I for myself use "Unknown"

#

best server software ever

young knoll
#

Where’s Loliserver

tender shard
#

creating an obscure fork that'll die in 2 weeks > contributing upstream

#

change my mind

remote swallow
#

wonder how quick fabrigot will die

tender shard
#

never heard of that

eternal night
#

sounds like mhoist

#

just even funnier

tender shard
#

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?

chrome beacon
#

Mohist can replace your plugins with their own modified versions

quartz basalt
#

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?

remote swallow
tender shard
#

Yikes

hazy parrot
#

I might be completely misunderstanding pdc, but are they located in some file which can I manually delete for testing ?

young knoll
#

Depends on what pdc

#

Player pdc is in the player data files

#

The rest is in region files or entity files

hazy parrot
#

thanks πŸ‘

tender shard
#

for most stuff, the PDC is just an NBT tag called BukkitValues

#

(or PublicBukkitValues for ItemMeta)

tender shard
#

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

remote swallow
#

would love to know how inteliij manages to break code that works without me changing folder names

tender shard
#

Wdym

remote swallow
#

i refracted some folder names through intellij, it managed to break an enum

#

nothing that should even care about folder names

tender shard
#

The folder names have ofc have match the package names

remote swallow
#

they do

tender shard
#

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:

remote swallow
#

didnt change case either lol

tender shard
#

Then idk

remote swallow
#

stackoverflow doesnt even tell me why the errors appearing or how to fix it lol

tender shard
#

what errors?

remote swallow
#

error: unclosed character literal if (c == 'Β§')

tender shard
#

?paste the whole class pls

undone axleBOT
remote swallow
tender shard
#

are you using maven?

#

set your project encoding to UTF8

remote swallow
#

gradle

tender shard
#

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

remote swallow
#

set it utf8 and it fixed it

#

thanks

tender shard
#

np

tender shard
#

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");
}
hasty prawn
#

That is hilarious

tender shard
#

I also love this

hasty prawn
#

The IDE does not approve of that

tender shard
#

huh?

#

it MUST work

hasty prawn
#

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

tender shard
#

it's just a label (called "https") followed by a comment

hasty prawn
#

It doesn't like this

tender shard
#

it has to be inside a code block

#

e.g. inside { }

hasty prawn
#

Yeah but this is fine

#

I didn't move the link

#

I mean either way it definitely belongs in a WeirdJava repo

tender shard
#

it only works in front of statements

#

e.g. int i = 0;

#

that's not a statement but an expression

hasty prawn
#

ah

tender shard
#

although tbh I have no idea what exactly the difference is lol

hasty prawn
#

Are you making fun of my true == false Sadge

tender shard
#

C coders be like

#include <stdio.h>
#define TRUE 1
#define FALSE TRUE

int main()
{
    if(TRUE == FALSE) {
        printf("Hello World");
    }

    return 0;
}

hasty prawn
#

This is why no one uses C

tender shard
#

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
worldly ingot
#

Good ole preprocessor directives. Those define directives can be such a hinderance to code readability lol

#

Very useful for backwards compat though!

tender shard
#

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

hasty prawn
#

Yeah my friend and I were talking about those literally last night

#

And he sent this

#

Which it totally allows you to do

remote swallow
#

what about brainfuck

tender shard
#

brainfuck is still easier to use in real life than haskell

worldly ingot
hasty prawn
#

I think he was just making the point that it's literally just replacing it so it allows for non-sensible syntax

worldly ingot
#

Β―_(ツ)_/Β―

tender shard
#

I wonder what happens if you do this in java

    public static native void doSomething();

    public static void main(String[] args) {
        doSomething();
    }
ancient plank
tender shard
#

already did

#

java is unsatisifed

ancient plank
#

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 😩

tender shard
#

yeah that sounds annoying

ancient plank
#

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

floral drum
#

hi adele

#

how are you

fluid river
#

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

hasty prawn
#

From 1 to N not N to 1

fluid river
#

yeah

#

from 1 to N

#

1 2 3 4 ...

floral drum
#

do you know what recursion is

fluid river
#

yeah but

#

basically i can do the backward thing, but i'm kinda sleepy rn

latent bone
#

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

fluid river
#

i don't understand from 1 to N

hasty prawn
# fluid river yeah but
public static void print(int i, int n) {
  System.out.println(i);
  if(i == n) return;

  print(i + 1, n);
}
floral drum
#

spoonfeeding 😭

fluid river
#

i don't think i'm allowed to use i

#

that's the problem

#

only N itself

tender shard
#
    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);
    }
fluid river
#

that's stated in task

hasty prawn
#

You have to have i though I think?

#

Otherwise you don't know what number you're on lol

fluid river
#

oh shit

#

sorry i'm really sleepy

#

this was for last task

#

about not allowed i

#

for my one it works

floral drum
#

lolll

hasty prawn
fluid river
#

there are multiple limits on each task

floral drum
fluid river
#

except this one

hasty prawn
#

I guess if they enter a current thats greater than the target? Lol

tender shard
# fluid river that's stated in task

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

fluid river
#

i am not allowed to use global variables/fields at all

tender shard
#

then send us the full assignment "message"

hasty prawn
#

He can use i

fluid river
#

it's on russian

tender shard
#

oh ok easy

fluid river
#

how did i make a branch lol

hasty prawn
#

Man you really need sleep

fluid river
#

alrclosed it

floral drum
fluid river
#

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

hasty prawn
#

No you dont

fluid river
#

go up or go down

#

oh shit

#

just math max and math min istead

#

ezzz

tender shard
#

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

hasty prawn
#

Yeah

fluid river
#

umm ez

#

i guess

tender shard
#

oh the "current" var ofc should be a passed into printUpToN

#

I just copy pasted it from earlier

fluid river
#

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

tender shard
#

the stupid thing about these kinds of assignments is how useless they are, and also how stupid their wording is most of the time

fluid river
#

yeah i know

#

i wouldn't be allowed to java exams if i don't do all of this

tender shard
#

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);
        }
    }
fluid river
#

exactly

#

not cheating 100%

hazy parrot
#

How can I get pdc of player that is offline πŸ€”

fluid river
#

get NBT's

tender shard
#

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

fluid river
#

That's not really hard as far as i remember

#

but would require wiki

#

cuz .dat structure

tender shard
#

it's only a few lines with NMS

fluid river
#

yea

tender shard
#

but it's annoying nonetheless

fluid river
#

i have an example

tender shard
#

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

tender shard
#

or use a normal database like mysql or whatever

fluid river
#

Used .dat files in my old plugin

tender shard
#

only thing I ever used NBT for, is to serialize/deserialize entities

#

for everything else, there's api ❀️

hazy parrot
tender shard
#

yeah unfortunately, the API requires players to be online to access their PDC

fluid river
hazy parrot
fluid river
#

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?

tender shard
#

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

hazy parrot
#

I personally think better solution will be to make some wrapper class and put everything in some chunk

#

wyt

tender shard
#

I dont think so, sometimes servers reset the world etc but want to keep player data

fluid river
#

hey

#

how to get int from char right way

#

0 1 2 3 4 5 6 7 8 9

tender shard
#

wdym

fluid river
#

do i use (int) c or Integer.valueOf(c)

hazy parrot
#
  • '0'
tender shard
#

just cast it to int

fluid river
#

alr

tender shard
#

you dont even need to cast

fluid river
#

i worked with such cringe stuff in c++ only

tender shard
#

you can easily do this

char myChar = 0;
int myInt = myChar;
#

no need to cast

fluid river
tender shard
#

after all, int is a "super set" of char

fluid river
#

i guess should work

tender shard
#

if you want the sum, sure

#

but

#

I wonder why anyone would ever need the sum of a char array

fluid river
#

well i can do with %

#

i need sum of chars in "1234" string

#

1 + 2 + 3 + 4

tender shard
#

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

fluid river
#

that's what i meant when asked

tender shard
#

aah ok

fluid river
#

how do i parse it to int

#

right way

#

Integer.valueOf(c);

#

works probably

tender shard
#

actually for(char ...) should work fine

fluid river
#

Integer.parseInt(c + "");

tender shard
#

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

fluid river
#

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)

tender shard
#

no idea what you mean

fluid river
#

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

tender shard
#

i dont get the question

fluid river
#

it would be easy if i just printed numbers

tender shard
#

sum of "whose" chars?

fluid river
#

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

tender anvil
#

is there a way to detect when a player stops breaking a block?
or a player animation stop

fluid river
#

or some other value

tender anvil
fluid river
tender shard
fluid river
#

or carry the amount as a parameter in recursion

tender anvil
#

or that's what i'm trying to do

tender shard
#

what version are you using?

tender anvil
tender shard
#

on 1.17+ (remapped mojang) the packet you wanna listen to is called ServerboundPlayerActionPacket

tender anvil
#

ok

quartz basalt
#

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)

tender anvil
#

is it on protocolib?\

fluid river
#

the worst code ever

tender shard
tender shard
#

I always forget that this was added

#

@tender anvil forget everything I said

tender anvil
#

ok

tender shard
#

and just listen to the event @young knoll mentioned

fluid river
#

2 more tasks left

#

tomorrow

#

good night guys

tender shard
#

good night

#

why you go to sleep, it's only 4 am

#

at my place

fluid river
#

5 am soon for me

tender anvil
tender shard
tender shard
#

no protocollib or anything needed

tender anvil
tender shard
#

it was added in 1.18.1

tender shard
#

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

karmic stirrup
#

Settings -> Appearance & Behaviour -> System Settings -> Reopen last project on startup

tender shard
#

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

vital sandal
#

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

tender shard
#

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"?

vital sandal
#

Any things

#

I will customize it

tender shard
#

not possible

vital sandal
#

Why ?

tender shard
#

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

vital sandal
#

can i cancel that ?

tender shard
#

no

vital sandal
#

how about particle like: falling effect/totem/etc

#

also splashing bottle

tender shard
#

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

vital sandal
#

:l i seen protocol lib did that

#

but have no idea

tender shard
#

I don't know every single particle, all I can tell you is this:

  1. Listen to outgoing "particle packets"
  2. If that "packet event" doesnt get triggered on the server, but you still see the particles:
  3. Can't cancel that :/
vital sandal
#

how protocol lib did that ?

river oracle
#

they didn't

tender shard
#

protocollib also cannot "cancel" client sided particles

vital sandal
#

hmm so how they work ?

tender shard
#

how does what work?

river oracle
#

πŸ€·β€β™‚οΈ texture pack or client mod

river oracle
#

idk look yourself lmao lets take a look

#

looks like there is a damage particle event

#

there you go thats how

river oracle
vital sandal
river oracle
#

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

vital sandal
#

i mean it is not even a packet :l

#

i will try read protocollib source instead :L

river oracle
#

I'm concerned you don't even know what your doing

tender shard
static ingot
river oracle
#

He doesn't want to use protocol lib though

#

So you need to find mojang mapping equivalents

static ingot
#

I was only telling him what packet it is, so ye.

vital sandal
#

just found it tksm

tender shard
#

tbh protocollib is one of the worst APIs ever

#

I'd avoid it all costs

#

e.g. PacketEvents by retrooper is so much better

static ingot
#

What makes it so bad? lol

tender shard
#

what makes it bad? I will give you an example

vital sandal
#

so i rewrite it :d

river oracle
#

πŸ”₯ πŸ”₯

tender shard
#

ProtocolLib:

SomePacket packet = new SomePacket();
packet.getIntegers().write(1, entityId);
packet.getStrings().write(2, entityName);
packet.getVectors().write(3, new Vector(0,0,0);
static ingot
#

yeah i just realized i can see why it's shitty without the packet wrappers

tender shard
#

NMS:

SomePacket packet = new SomePacket(entityId, entityName, position);
static ingot
#

lmao

tender shard
#

protocollib does the opposite of what it promises

static ingot
#

but at least it's ✨ version-independent ✨

#

Lol

tender shard
#

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,...)

river oracle
#

Nms packets with mojang mappings don't change much as far as I'm aware

vital sandal
tender shard
#

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

static ingot
#

will definitely check out packetevents for my own future packet endeavors then, lol

tender shard
#

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

worldly ingot
#

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

alpine urchin
#

Thats a thing many people don’t know

alpine urchin
#

Not many people know about Clientbound and Serverbound terminology cause they’re used to NMS naming

stoic vigil
#

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?

drowsy helm
#

It’s in the nbt

stoic vigil
#

okee, and how to change this?

drowsy helm
#

Or just add an enchant and use hide enchants flag

stoic vigil
torn shuttle
#

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

echo basalt
#

stay alert or die alert

torn oyster
#

how would i generate a smooth transition between ints

hybrid spoke
torn oyster
#

well i'm trying to make a runnable that smoothly transitions from the current time to 6000

#

ticks

torn oyster
#

within 2 seconds

hybrid spoke
hybrid spoke
torn oyster
#

ohmygod

solid cargo
hybrid spoke
#

imagine an hater getting the math equation

#

rip

solid cargo
#

Skill issue tbh

hybrid spoke
#

"hehehe, time to let 2+2 be 3"

torn shuttle
#

shouldn't have allowed a bad actor on to your network then

#

seems like a moderation issue to me

molten hearth
#

Should've just not used maths

torn shuttle
#

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

molten hearth
#

Personally, I'd just copy and paste the formula, das just me doe

hybrid spoke
#

they have to compliment you until some AI is satisfied

#

have to reach a certain amount of compliment-points

#

and you cant double entry

inner drift
#

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?

echo basalt
#

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

halcyon hemlock
#

hello, i would like to scale absorption amount how do i do it?

#

otherwise it is like this

torn oyster
#

or set it to that

grand pebble
#

Hi everyone ! I have a question : can we put a persistent custom attribute on player ?

drowsy helm
#

but shouldn't need to use it much tbh

grand pebble
#

For example : I want to put a int attribute on my player like :
« villageId = 8 »

drowsy helm
#

just use pdc

grand pebble
#

What is pdc ?

hazy parrot
#

?pdc

grand pebble
#

Oh ok, but last question

#

If player disconnect, the attribute persist or i need to re-set at spawn ?

tender shard
#

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

tender shard
grand pebble
#

Sorry πŸ˜…

tender shard
#

np πŸ˜„

#

it's persistent across restarts, across deaths, etc etc

grand pebble
#

Ok ok thanks a lot for your help !

torn shuttle
#

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

echo basalt
#

nah put it all in 1 file

tender shard
#

put it all in one line

torn shuttle
#

I'll put you in 1 file

echo basalt
#

gotta make the documentation match your code style

tender shard
torn shuttle
#

you're both equally monstrous

tender shard
#

nah I'm skinny and fragile

torn shuttle
#

I hope the internet police raids your houses and find you guilty of harassing sexy people on the internet

echo basalt
#

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

torn shuttle
#

it's not a threat, it's a promise

echo basalt
#

Try me

torn shuttle
#

cmere

tender shard
echo basalt
#

quirky goofy ahh joke

echo basalt
torn shuttle
#

oh no we have a badass on our hands

tender shard
#

yesterday, on german "who wants to be a millionaire", there was a dude from my city, and he was so ridiculously stupid

echo basalt
#

magma fyi a bus to your city costs 28 bucks

torn shuttle
#

my background says "live, laugh, love, tase imillusion's balls"

echo basalt
#

60 bucks and you're dead

tender shard
#

so you charge him 32 bucks to kill him?

echo basalt
#

no

#

round trip and 4 bucks for food at lidl

tender shard
#

fair

echo basalt
#

I'd kill magma for pleasure, not for money

torn shuttle
echo basalt
#

this can be very easily taken out of context

tender shard
#

I applied like 50 times already

torn shuttle
echo basalt
#

bruh moment

molten hearth
#

51st is the charm

#

take this shitty illustration i find everywhere

torn shuttle
#

alex is so dumb he can't even get past the application, imagine that

molten hearth
#

well

#

I applied for a student loan and didnt actually fill in any documents

torn shuttle
echo basalt
torn shuttle
#

synthol is one hell of a drug

echo basalt
#

we should have a jury that compiles our best roasts into a google doc

#

even though you wouldn't be on it

torn shuttle
#

there used to be an irc thread on there

#

I was featured a few times

#

(by there I mean spigot forums)

tender shard
torn shuttle
tender shard
echo basalt
#

it's magma

#

wdym

torn shuttle
#

original soundtrack by ImIllusion

echo basalt
#

got no sound because I'm based

#

listening to 50 cent's Get Rich or Die Tryin' album

torn shuttle
#

illusion's out here thinking he's hard but knows he will just flop over if he comes within 100km of my region

echo basalt
#

wish I had the availability to beat yo ass

torn shuttle
#

too busy hyping yourself up in the mirror?

echo basalt
#

😭

#

smartass

vocal cloud
#

Is this a civil war in here

echo basalt
#

magma

#

there's a freestyle battle in lisbon on the 15th

#

let's be the special show

torn shuttle
#

I was banned after my last battle caused the tsunami/earthquake

crimson terrace
#

I didnt think youd get rocked that hard

torn shuttle
#

I told them self-burn Wednesdays were a bad idea

crimson terrace
#

πŸ˜‚πŸ˜‚

stoic vigil
#

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");
    }
fluid river
#

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

fallow violet
fluid river
#

compared maps with == too

#

xD

#

omg guys

fallow violet
#

and why u do (!(==)) instead of (!=)?

fluid river
#

because he needs to

#

?learnjava

undone axleBOT
fallow violet
#

you can

fluid river
#

you can

fallow violet
#

the output is true in this case

fluid river
#

lel

#

!(itemStack.getType() == Material.ITEM_FRAME)

#

ya know

fallow violet
#

xd

fluid river
#

itemStack.getType() != Material.ITEM_FRAME

fallow violet
fluid river
#

what

#

he is comparing values

#

not bools

#

he said one != two

fallow violet
#

morice_0 u missed the point ig

fluid river
#

yeah

fallow violet
#

morice

#

he can just do ITEM#GETTYPE() != TYPE

fluid river
#

he could just place != between values

fallow violet
#

instead of (!(ITEM#GETTYPE() == TYPE))

fluid river
#

not doing !(firstValue == secondValue)

fallow violet
#

nukerfall i love you bro

fluid river
#

yeah we said that you kinda missed the point

fallow violet
#

xd

fluid river
#

no offense

fallow violet
#

everybody does mistakes :p

fluid river
#

well

#

my java homework

fallow violet
fluid river
#

i'm forced to do small gui by guide from 2015

fallow violet
#

damn

fluid river
#

university sucks

#

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

molten hearth
#

Lucky

#

I have to implement gay ass algorithms

#

In python

vocal cloud
#

I have to write backend and frontend garbage in ASP.NET

young knoll
#

Pretty sure you can’t

#

They’re client side

jaunty crest
#

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

chrome beacon
fluid river
#

bro switch to maven

stoic vigil
# fluid river ?learnjava

anyways, thx for good support also for beginners 😦
and: it doesn't work with != eighter, i've tryed this too

fluid river
#

.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

small current
#

how can i convert a chunk's x and z to block x y z

jaunty crest
hasty prawn
#

God I cannot type

hasty prawn
molten hearth
#

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

hasty prawn
#

They deal contact damage and the player has invulnerability frames

#

So if you want them to "attack" faster, just remove the invulnerability frames faster

molten hearth
#

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

hasty prawn
#

Minecraft's default is 60 ticks I think

molten hearth
#

ah I see I'll give that a try ty

hasty prawn
#

So 3 seconds

molten hearth
#

hmm that sounds about right

hasty prawn
#

Honestly I'm not sure what you're asking since you said custom attack speed and then normal attack speed πŸ˜›

molten hearth
#

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

hasty prawn
#

Afaik the ones that deal contact damage don't

#

Skeletons, Ghasts, Blazes, they might, but I'm not sure.

molten hearth
#

πŸ‘ makes sense I'll keep that in mind tyvm

lost matrix
hasty prawn
#

I just googled it so that could definitely be wrong KEKW

eternal night
#

it does

chrome beacon
eternal night
#

cool kids just x << 4

fluid river
#

create maven project instead of deault java project

#

and add dependencies through pom.xml

#

example is in my Etalon branch here

jaunty crest
fluid river
#

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

jaunty crest
#

Aight

fluid river
#

And copy paste your classes

worldly ingot
hybrid spoke
#

or just rightclick the project and click "Add Framework Support"

#

oh its eclipse

worldly ingot
#

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

hybrid spoke
hasty prawn
#

Choco you use Eclipse?

worldly ingot
#

I do, yeah

fluid river
#

@jaunty crest i have a project structure example in the end of branch as a screenshot

worldly ingot
#

I'm usually the resident Eclipse issue solver lol

hasty prawn
#

Well I suppose someone has to be lol

fluid river
#

?

#

eclipse has issues?

worldly ingot
#

I mean more so people that are new to the IDE asking questions

hasty prawn
#

He means when people have issues using Eclipse

fluid river
#

except convert to maven project

fluid river
#

πŸ’©

jaunty crest
#

@fluid river thanks bro, fixed the issue ❀️

fluid river
#

btw you need to build it another way

#

not by exporting

#

basically you need to run mvn package

#

posted on the branch too

coral helm
#

Hi πŸ‘‹ How can I make command that will be executed but it won't be sent to console/log?

hazy parrot
#

you can probably make some Log filter

lost matrix
#

Sounds fishy

fluid river
#

you need to work with logger

#

but in 99% of cases you don't really need a command as a developer

lost matrix
#

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.

coral helm
molten hearth
#

let's not forget mobs are stupid and walk up to you and hit you and afk

lost matrix
#

It doesnt just stay there for 3s

coral helm
molten hearth
#

idk in my experience it does

#

maybe it was changed after 1.8

lost matrix
#

?a.8

#

?1.8

undone axleBOT
molten hearth
#

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

fluid river
#

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

young knoll
#

Only players afaik

molten hearth
#

goddamn bukkit overcomplicating where tf the value of that is

#

so uh the Default attack speed is 4.0? 4.0 what lmao

lost matrix
molten hearth
#

Value is the number of full-strength attacks per second.

#

I see

#

so I should probably add a cooldown of 0.15s

lost matrix
#

But this is for players with nothing in their hand

molten hearth
#

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

lost matrix
#

It changes when the player has something in his hand that changes his attack speed attr

#

Zombies attack about twice a second. So 500ms

molten hearth
#

lmao

#

oh alright ty

opal wedge
#

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?

tardy delta
#

Spawn it yaself

grim ice
#

alive just to suffer

molten hearth
#

its actually meant to damage me

#

the damage just isnt working

#

I will have to figure out why lmao

fluid river
#

so generic attack speed

#

works on entities

#

?

molten hearth
#

yeah

fluid river
#

i was right

molten hearth
#

perhaps

#

I also realised I can set that attribute but the code im using doesnt use the attribute

orchid portal
#

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?

crimson terrace
#

you could use PlayerInteractEvent and cancel it if the player is targetting one of those

crimson terrace
#

event.setCancelled(true)

orchid portal
#

Thanks, I'll try

civic wind
#

What have i messed up on here? Not worked with player skulls before

delicate lynx
#

pass your plugin

untold jewel
civic wind
#

Yeah I can see that, how do i go about making skull of player

#

Doesn't work without casting it to itemstack

eternal oxide
#

Doesn't WITH casting as its not an ItemStack

civic wind
#

I'm fully aware of this

#

I can see the error

eternal oxide
#

then apply the meta to a skull and use the skull

civic wind
fluid river
#

pass your plugin

#

instance

#

?di

undone axleBOT
fluid river
#

any pointer which points on object of MainClass(one which extends JavaPlugin)

untold jewel
#

dude u could just do

private MainClass plugin;

public Classname(MainClass plugin) {
this.plugin = plugin;
}

and use plugin where u want it

tardy delta
#

and make it final

civic wind
#

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?

fluid river
#

leave it like this

#

nothing's gonna change

tardy delta
#

make everything that musnt change final

#

and ide will yell anyways

civic wind
#

Anyone?

civic wind
vocal cloud
#

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

civic wind
vocal cloud
#

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

mellow pebble
#

HI guys i added to my pom.xml local jar as dependency and on compiling with maven i get this error in git bash

civic wind
mellow pebble
#

this is how it looks as dependency in maven

vocal cloud
#

So you need to increase your version or not use it

mellow pebble
vocal cloud
#

You changed it in every location?

mellow pebble
#

im not sure where to change it else ?

vocal cloud
#

And your pom uses java.version everywhere?

mellow pebble
vocal cloud
#

Just send pom

mellow pebble
#

?paste

undone axleBOT
mellow pebble
#

it is kinda too many stuff

vocal cloud
#

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.

vocal cloud
#

Not use whatever you added?

#

Your compile is set to java 8

#

In your maven compile plugin

mellow pebble
#

it is because of that plugin i have to use it so that my tabapi is working

vocal cloud
#

Then change your compile to 17

mellow pebble
vocal cloud
#

164

#

And 165

mellow pebble
vivid skiff
#

How can i prevent a player from dismounting from a entity?

mellow pebble
vocal cloud
#

And you set it to a java 17 jdk in the project settings?

vivid skiff
mellow pebble
tardy delta
#

change it in pom too

vocal cloud
#

Try mvn clean package

mellow pebble
#

in my git bash ?

mellow pebble
vocal cloud
#

Send the full log

mellow pebble
#

?paste

undone axleBOT
spare marsh
#

will player.hasPermission("") return true always? Checkinf if the player has blank permission? Or false?

vocal cloud
#

Try updating the compiler plugin to 3.10.1

mellow pebble
vocal cloud
#

142

mellow pebble
vocal cloud
#

Then resend the pom. Can't you see the version for the plugin? I shouldn't need to point it out lol

mellow pebble
#

there is too many stuff for me to guess on what are you thinking

vocal cloud
#

What you don't need to guess. You only have one compile plugin

#

142

vocal cloud
#

Same error?

mellow pebble
vocal cloud
#

Send full error again

vocal cloud
#

What does mvn -version output

mellow pebble
#

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"

vocal cloud
#

Maven is seeing java 8

mellow pebble
#

lol how do i change that πŸ€·β€β™‚οΈ

vocal cloud
#

I'll look more into it when I'm home in an hour if I remember

#

Don't pass null as your plugin?

vocal cloud
#

Yup, looks pretty null to me.

#

Its null?

#

Your plugin is null

#

Like the error says it is

tardy delta
#

πŸ₯²

untold jewel
#

?learnjava

undone axleBOT
vocal cloud
#

By learning java

untold jewel
#

I already

#

told you @viral hazel

#
private final MainClass plugin;

public Classname(MainClass plugin) {
this.plugin = plugin;
}
#

XD

vocal cloud
#

Stop just learn java please

#

It really hurts

untold jewel
#

Change Classname to your class name

river oracle
#

oh my god what the fuck

untold jewel
#

EventInfo

river oracle
#

Learn java please πŸ™ I beg of you

untold jewel
#
private final Eventsystem plugin;

public EventInfo(Eventsystem plugin) {
this.plugin = plugin;
}
#

there u go buddy

river oracle
#

yes you are yes you are

mellow pebble
#

@vocal cloud managed to update version that maven sees and i did got build success but we will see haha

#

?paste

undone axleBOT
mellow pebble
#

any help with this now πŸ˜…

dire marsh
#

this has to be a troll at this point

eternal oxide
#

you can not use new EventSystem()

vocal cloud
#

I was gonna say that

eternal oxide
#

You have been shown how to use dependency injection so use it.

vocal cloud
#

By learning java

untold jewel
#

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)

vocal cloud
#

Its so sad the answer is literally being screamed at him

#

And you continue to spoonfeed

untold jewel
#

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

vocal cloud
#

But when it happens again will they understand? Id rather get them to go through the error

subtle folio
vocal cloud
#

The error literally tells you to a T what's wrong

untold jewel
#

I understand what you guys are saying, I'm not telling you any different.

manic furnace
#

How do methods get run automatically like when I include protocollib? So to register Listeners etc

mellow pebble
#

I get this error "ClassNotFound" but i have that class and there is no problems in that class

untold jewel
#

Maybe some code would help?

grim ice
#

genius coding skills

untold jewel
#

@mellow pebble

mellow pebble
#

?paste

undone axleBOT
hazy parrot
#

Noo need for code, class isn't shaded

mellow pebble
#

if someone insists πŸ€·β€β™‚οΈ

#

have fun AHAHAH

#

i mean i really dont know why does this happen because everything should really work fine

quiet ice
#

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

vague kite
#

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?

vocal cloud
#

If by support you mean you have questions and we have answers sure

vague kite
#

yeah exactly

fossil lily
#

Yep :)

vague kite
#

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?

quiet ice
#

String disguisePackage = "io.github.nosequel.tab.v" + nmsVersion.toLowerCase() + ".v" + nmsVersion; @mellow pebble

fossil lily
quiet ice
#

In TabHandler#createAdapter

#

Alternatively, follow the stacktrace