#help-development

1 messages · Page 1201 of 1

pseudo hazel
#

but using objects like this just adds extra code to check what kind of object it is, that should not be needed if you didnt use Object

#

the issue is you cant do anything with an Object unless you cast it

#

and its also used by the configuration api

mortal hare
#

I hate how java doesnt have ImmutableList<>, ImmutableSet<>, ImmutableMap<> interfaces

pseudo hazel
#

since you can store any object in a file (for some reason)

mortal hare
#

Kotlin does have such interfaces which doesnt provide add() put() methods

#

😦

pseudo hazel
#

mutability is very different in kotlin

#

probably

mortal hare
#

instead you have hacks like: Collections.unmodifiableList()

#

with runtime exceptions for add()

river oracle
#

if for some reason you needed add to an Immutable List

mortal hare
#

apart from backwards compatibility

river oracle
#
val list = mutableListOf<Item>()
list.add(itemOne)
list.add(itemTwo)
list.add(itemThree)
list.add(itemFour)
val immutableList = list.toList()
mortal hare
#

and the best part there's no runtime checks

#

for immutability in kotlin

#

thus you can't accidentally call add() on immutable list like in java with Collections.unmodifiableList()

#

Kotlin feels like Java++ sometimes

worthy yarrow
#

imagine making mistakes or accidents

#

Couldn't be me man

river oracle
#

I don't really take full advantage of the magic, but I do prefer using kotlin now adays

mortal hare
viscid carbon
mortal hare
#

its Java, but with modern syntax and bunch of compile-time optimizations

#

like inline data classes

eternal night
worthy yarrow
mortal hare
#

which act like fake classes, but they unwrap to be inline calls instead

river oracle
#

Kotlin also just has better functional API too

viscid carbon
#

I see

river oracle
#

Kotlin doesn't compile faster than java

#

that's a lie

mortal hare
#
@JvmInline
value class Person(private val fullName: String) {
    init {
        require(fullName.isNotEmpty()) {
            "Full name shouldn't be empty"
        }
    }

    constructor(firstName: String, lastName: String) : this("$firstName $lastName") {
        require(lastName.isNotBlank()) {
            "Last name shouldn't be empty"
        }
    }

    val length: Int
        get() = fullName.length

    fun greet() {
        println("Hello, $fullName")
    }
}

fun main() {
    val name1 = Person("Kotlin", "Mascot")
    val name2 = Person("Kodee")
    name1.greet() // the `greet()` function is called as a static method
    println(name2.length) // property getter is called as a static method
}

will compile to to just require checks instead of creating new object on the heap

eternal night
#

valhalla when (soon, the jep is open)

viscid carbon
#
fun greet() {
}```
that "fun" is what gets me xD
mortal hare
#

it will exist as an object instance on compilation, but on runtime object will be erased, and will never be created, instead only raw data elements like in this case String object will be created

worthy yarrow
#

Nearly in 2025 and the computer doesn't just do what I think smh

#

Failed species

viscid carbon
#

I guessing fun means function. its just weird to look at, i feel its better to learn java before kotlin

mortal hare
#

it will compile to smth like this:

String firstName = Person.firstName("Kotlin");
String lasName = Person.lastName("Mascot"):

Person.greet(firstName, lastName);

instead of:

Person person = new Person("Kotlin", "Mascot");
person.greet();
#

no additional objects will be created on the heap, except for the needed ones

river oracle
mortal hare
#

fun weirds me out too

#

why not just function

chrome beacon
#

how about no keyword

mortal hare
#

it probably needs it because you declare the return type at the end of the function

#
fun foo(): Int {

}
#

typescript is literally:

function foo(): number {

}
#

kinda similar to ts

chrome beacon
#

more to write

#

Should do it like rust and use fn

worthy yarrow
chrome beacon
#

Kotlin 🔫

mortal hare
#

man programmers are lazy

worthy yarrow
#

Welcome to funky town

river oracle
#

when do we introduce just f

eternal oxide
#

We already do (Math)

worthy yarrow
#
}
``` kek
worthy yarrow
proud badge
#

when

worthy yarrow
river oracle
#
f method {

}

If it returns something we do fr

fr method {
  1 // also got rid of the return word here cuz its such a pain to type
}

If it has parameters just use spaces parenthesis are a pain

fr method int int {
  int0 + int1
}

Instead of naming parameters because thats such a pain if they have long names you can just go by the type and increment it by 1 starting at 0

worthy yarrow
#

param names are what keep my sanity intact tho

river oracle
#

yeah that's a lot of typing though

#

honestly we should remove those pesky curly braces too and replace them with something easier to type

chrome beacon
#

save more characters

river oracle
#
f method j

j

fr method j
 1
j

fr method int int j
  int0 + int1
j

J is on your home row

worthy yarrow
#

ffs

river oracle
#

you don't need shift

river oracle
#

honestly the spacebar is just another thing you gotta type too I'm going to gut that out where I can

#

lets make this eve nmore concise

worthy yarrow
#
CatchYouForgotAClosingJExceptioneje.printStackTracej```
chrome beacon
#

f method i i
l0 + l1

river oracle
#
fmethodjj
frmethodj1j
frmethodintintint0+int1j
chrome beacon
#

Indentation time

worthy yarrow
shadow night
blazing ocean
#

you don't

shadow night
#

Also, int is too long to type

blazing ocean
#

schrödinger's code snippet

shadow night
#

Rename it to i pls

river oracle
#

you can't start your methods with a letter r if we're going to be fast about this, but I think that's a worthy sacrifice

worthy yarrow
#

Man I can't wait for chatGPT 6.0 to interpret my thoughts before I can

shadow night
rough drift
#

use the g key for spaces

#

it saves time

shadow night
#

Unless capitalization is a syntax error

worthy yarrow
rough drift
#

frmethodgintgintjint0+int1j

#

anyways I'm making an actual language

river oracle
#

ChatGPT made us a parser

#
import re

# Tokenizer function to split the input into components
def tokenize(source_code):
    # Regular expressions to capture function, parameters, and expressions
    token_specification = [
        ('FUNC', r'(fmethod|frmethod)'),  # function definition (either `fmethod` or `frmethod`)
        ('TYPE', r'int'),                 # `int` type
        ('NAME', r'[a-zA-Z_][a-zA-Z0-9_]*'), # identifiers (function names, variable names)
        ('EXPR', r'[a-zA-Z_0-9\+]*'),     # expressions or variables (like `int0`, `int0+int1`)
        ('WHITESPACE', r'\s+'),           # whitespace (to be ignored)
        ('MISMATCH', r'.'),               # anything else (invalid tokens)
    ]

    # Join all patterns into one regex
    tok_regex = '|'.join(f'(?P<{pair[0]}>{pair[1]})' for pair in token_specification)
    line_num = 1
    line_start = 0
    line_pos = 0

    # Iterate through the source code and match the patterns
    for mo in re.finditer(tok_regex, source_code):
        kind = mo.lastgroup
        value = mo.group()
        if kind == 'WHITESPACE':
            continue
        elif kind == 'MISMATCH':
            raise RuntimeError(f'Unexpected character {value!r} at position {mo.start()}')
        yield kind, value

# Parser for the custom language
class Parser:
    def __init__(self, tokens):
        self.tokens = tokens
        self.current_token = None
        self.advance()

    def advance(self):
        try:
            self.current_token = next(self.tokens)
        except StopIteration:
            self.current_token = None

    def parse(self):
        """Parse the entire input."""
        functions = []
        while self.current_token:
            functions.append(self.parse_function())
        return functions

    def parse_function(self):
        """Parse a function definition."""
        func_type = self.current_token[1]  # 'fmethod' or 'frmethod'
        self.advance()

        func_name = self.parse_function_name()
        args = self.parse_parameters()

        return_value = None
        if func_type == 'frmethod':
            return_value = self.parse_return_value()

        return {
            'function_type': func_type,
            'function_name': func_name,
            'parameters': args,
            'return_value': return_value
        }

    def parse_function_name(self):
        """Parse the function name."""
        if self.current_token[0] == 'NAME':
            func_name = self.current_token[1]
            self.advance()
            return func_name
        else:
            raise ValueError("Expected function name")

    def parse_parameters(self):
        """Parse parameters (space-separated)."""
        params = []
        while self.current_token and self.current_token[0] in ['TYPE', 'NAME', 'EXPR']:
            param = self.current_token[1]
            params.append(param)
            self.advance()
        return params

    def parse_return_value(self):
        """Parse the return value for 'frmethod'."""
        if self.current_token and self.current_token[0] in ['NAME', 'EXPR']:
            return self.current_token[1]
        return None

# Example usage
source_code = """
fmethod jj
frmethod j1j
frmethod int int j int0+int1j
"""

# Tokenizing the source code
tokens = tokenize(source_code)

# Create a parser instance with the tokenized input
parser = Parser(tokens)

# Parse the input and print the structured result
parsed_functions = parser.parse()
for func in parsed_functions:
    print(func)
worthy yarrow
#

put it in review thread

river oracle
#

no I'm not making anyone review ChatGPT code

worthy yarrow
#

kek

rough drift
#

yo chat what the fuck

#

they updated gpt, it now shows code on the side

shadow night
#

Yeah been there for a few days already

worthy yarrow
#

Time to get gpt to write me a gpt model

river oracle
#

okay now I'm going to make chatgpt write code in my imaginary language

shadow night
#

I made chatgpt write code in cum once

shadow night
#

@blazing ocean let's make a DNA programming lang

worthy yarrow
#

?paste

undone axleBOT
worthy yarrow
#

I can read all your minds

river oracle
#

@worthy yarrow

#

I'm cooking

#

only mistake it made was created a parameter name

#

I can fix that though

worthy yarrow
#

I feel like it needs less bloat still

#

I look at this and still think code

river oracle
# worthy yarrow I feel like it needs less bloat still

here is ChatGPT's concise lang parser in conciselang

f parse string j
 vi tokens std.split string " "   // Split the code into tokens
 lp token<tokens++j
  f parseToken token j  // Parse each token
 j
j

f parseToken string0 j
 // Parse a function declaration
 lp token<["f","fr"]++j
  f parseFunction string0 j
 j
 // Parse a loop declaration
 lp token<["lp","lpi"]++j
  f parseLoop string0 j
 j
 // Parse variable declaration
 lp token<["vi","v"]++j
  f parseVariable string0 j
 j
j

f parseFunction string0 j
 lp token<["f","fr"]++j
  vi functionType token0 // 'f' or 'fr'
  vi functionName std.split string0 " " // Extract the function name
  vi params std.split string0 " " // Extract the parameters
  lp param<params++j
   vi paramName param // Create the indexed parameter name (e.g., int0, string1)
  j
  // Parse function body
  lp body<tokens++j
   lp token<["j"]++j
    std.println "Function Body Parsed"
   j
  j
 j
j

f parseLoop string0 j
 vi loopType std.split string0 " " // Extract loop type (lp, lpi)
 lp loopBody<tokens++j
  lp token<["j"]++j
   std.println "Loop Body Parsed"
  j
 j
j

f parseVariable string0 j
 vi varType std.split string0 " " // Extract the variable type (vi or v)
 vi varName std.split string0 " " // Extract variable name
 std.println "Variable Parsed"
j```
worthy yarrow
#

The fact that I can read this and somewhat understand it is quite impressive

river oracle
#

okay I had it create pong in conciselang

#

here are the rules if you want to make more code in conciselang

#

absolutely splendid

mortal hare
#

what is the name of the aspect ratio that's inverse of normal aspect ratio formula: width / height

worthy yarrow
#

I'm going home @river oracle

#

Have had enough of conciselang

mortal hare
#

currently i name my helper functions as widthAspectRatio and heightAspectRatio, but this makes no sense as the aspect ratio's formula is width / height so how can i name an inverse of this function?

ivory sleet
#

reciprocal maybe?

#

not sure if that’s the term u looking for tho

#

or just like, inverse ratio

river oracle
#

If you take the reciprocal of too ratios it's just multiplication

#

So multiply!

worthy yarrow
#

damnit I keep clicking back to discord and it adds a reaction

blazing ocean
#

why me

worthy yarrow
#

rad I can read your mind

blazing ocean
tardy flame
#

skibidi toliet

worthy yarrow
blazing ocean
worthy yarrow
#

why does my paste link trigger discord RAT protection kek

remote swallow
#

bc of the .py extension

worthy yarrow
#

breh

eternal oxide
#

just change .py to anythign else. Paste will still show it

blazing ocean
#

does it have diff syntax highlighting then

eternal oxide
blazing ocean
#

doesn't look like it

bold gorge
#

How would I make a per player chat censor with spigot?

Like some players want swear words to be censored and some don't

echo basalt
#

packets ✨

#

or just listening to chat events

bold gorge
echo basalt
#

For example

#

With chat events you can just cancel the event and send the censored message to everyone

bold gorge
#

oh

#

ok thanks :D

arctic briar
#

im having trouble hiding particles from the players screen, whenever i use packet.getParticles.read(0) it always returns as null

blazing ocean
#

use a resource pack and set the texture to an empty one

arctic briar
#

not a bad idea since i was already considering using a custom texture pack for the server 👍

#

i just hope it doesnt come back to bite me laer

#

its weird since the packet does give me a particle in the error log particle=net.minecraft.core.particles.SimpleParticleType@3cb8e8f its just some error with enum wrapping

upper hazel
#

I've never noticed, but does the api often use cloning when retrieving data?

harsh surge
#

Ive just started learning dev for plugins and im trying to make a command but sender, label and arg is all underlined but all the imports are there can anyone help?

chrome beacon
#

Did you add the spigot dependency to your project

harsh surge
#

i used the minecraft dev plugin so it should have all done it

chrome beacon
#

Is Intellij up to date

harsh surge
#

noo ill update

#

still highlighted

#

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

these are all my imports

chrome beacon
#

What version of Intellij are you using?

#

Open Help > About to check

harsh surge
#

IntelliJ IDEA 2024.2.5 (Community Edition)

chrome beacon
#

You're still outdated

#

Update

#

When doing an update through the UI it will only do one update step at a time

harsh surge
#

ohhh

#

so should i download through web?

chrome beacon
#

Not sure how it handles that

#

I use toolbox to manage my IDEs

harsh surge
#

ok

#

what is the lates version

chrome beacon
#

2024.3.1.1

harsh surge
#

ok im on that

#

but all of my things still not working

chrome beacon
#

Did you modify your pom at all?

harsh surge
#

yes

#

i added outputfile

chrome beacon
#

Could you send your pom

#

?paste

undone axleBOT
harsh surge
#

do i send in the pastebin?

chrome beacon
#

yes

harsh surge
#

ok done

chrome beacon
#

Now send the link

harsh surge
chrome beacon
#

That's the wrong way to do it

#

If you’re using maven for your Spigot plugins (which you should do), it’s easy to make maven automatically save your plugin’s .jar in your plugins folder. There’s two ways of doing this: 1. The lazy way (not recommended) If you only work alone on one computer, you can just directly declare the output location in...

harsh surge
#

ok so do i remove the config thing

chrome beacon
#

It's not the cause of your issue

#

but it's something you should fix

harsh surge
#

ok

chrome beacon
#

Make sure you have a Java 21 JDK set

#

If you are expand the external libraries in the project browser and see if Spigot is there

#

If it isn't close Intellij and delete the .idea folder of your project

harsh surge
#

ok

quaint mantle
brittle geyser
#

Is this correct?

@Override
    public Map<String, Object> serialize() {
        final Map<String, Object> map = new HashMap<>();
        map.put("name", this.getName());
        map.put("location", this.getLocation().serialize());
        return map;
    }

    public static AdvancedHologram deserialize(Map<String, Object> map) {
        final String name = (String) map.get("name");
        final Location location = Location.deserialize((Map<String, Object>) map.get("location"));
        return new AdvancedHologram(name, location);
    }
blazing ocean
peak depot
blazing ocean
#

For gradle you just use a copy task ```kt
tasks.register("copyJars", Copy::class) {
from(tasks.shadowJar)

into("pathToPluginsDirectory")

}

tasks.assemble {
dependsOn("copyJars")
}

eternal night
#

🙏

mortal hare
#

i hate java records

#

specifically of how it doesnt blend with getter and setters of normal classes

#

why couldnt they just named the getters with get prefix

#

my OCD kicks in seeing records not following conventions

shadow night
#

What's an OCD

mortal hare
#

Obsessive–compulsive disorder is a mental and behavioral disorder in which an individual has intrusive thoughts and feels the need to perform certain routines repeatedly to relieve the distress caused by the obsession

#

well i don't have OCD (at least diagnosed) one but im kinda perfectionist and seeing things like these infuriates me

#

for 10's of years everyone followed JavaBeans spec of naming getters with get<Noun>() format

#

and Java devs be like: nope. we're gonna do something else

chrome beacon
#

Fluent getters and setters are getting more common

shadow night
#

I believe the getless thing has a meaning

blazing ocean
#

it means we're never gonna get anything we want

short drift
#

Is it actually possible to create shaped recipes with something like:

W__
W__
W__

And the same ingredients, in another recipe, on the opposite side:

__W
__W
__W

Or is it impossible? I seem to get only one of those recipes.

spiral light
#

what does effect the tablist texture to display the overlay texture too ?
i know its for the fake player in the metadata but i use velocity tablist and i cant send the packet for this.

spiral light
#

yes

blazing ocean
#

the player needs to be in render distance for that to render

mortal hare
short drift
shadow night
short drift
spiral light
mortal hare
blazing ocean
#

out of luck afaik

#

would need to merge the skin layers

shadow night
chrome beacon
shadow night
blazing ocean
#

fields 🙏

shadow night
#

Why do we use getters and setters btw

blazing ocean
#

side effects

#

ig

mortal hare
short drift
# shadow night If you register as I said it will work iirc

I'm not sure if I explained my problem well enough. Let me try again.
So ... I have left curtain item and right curtain item. And both of their recipe is 3 wools. I use shaped recipes for both. Wools on the left-most column for left curtain. And wools on the right-mose column for right curtain. No matter where the column is when crafting -> left, middle, right, I always get the left curtain item.
Instead I would like to get left curtain for one left column positions and right curtain for right column positions.

mortal hare
#

i get it that you can know what it does implicitly

#

but i think it can be quite confusing sometimes

ivory sleet
# mortal hare and Java devs be like: nope. we're gonna do something else

yea I agree, its a bit bizarre and may both add or take away readability. Like functions in general do stuff and thus should be named after verbs, in functional programming this is often violated but that’s cuz u have so many fkn functions and with infixes, and then different ways to reduce and compose and combine stuff, in object oriented programming where functions rather are procedures its goofy, having functions with prefix of get/set is nice cuz u can make ur ide list all getters or setters for a given type.

shadow night
#

I told you already everything

mortal hare
short drift
blazing ocean
ivory sleet
#

also to retain ABI dovidas

shadow night
mortal hare
ivory sleet
#

lets say for some data, the way you access that data changes for all clients, then retaining ABI is important in the long run

#

not really

mortal hare
#

nvm i forgot that you dont need interface to declare a getter lol

#

you're right

ivory sleet
#

:>

short drift
shadow night
#

Not sure if you can do that

short drift
#

Yes, exactly. Sorry that I explained it so poorly. I should have shown a screenshot.

blazing ocean
#
W _ _
W _ _
W _ _

_ W _
_ W _
_ W _

_ _ W
_ _ W
_ _ W

where _ is air?

short drift
#

Yes.

blazing ocean
#

shouldn't that just work

shadow night
#

He needs them to have seperate outputs btw

short drift
#

Yes, outputting different two items.

blazing ocean
#

I mean just use seperate recipes then

short drift
#

Well they are.

shadow night
short drift
#

But one is overriding the other.

shadow night
#

I thought the api forbid you to use air

pseudo hazel
#

thats not possible

blazing ocean
#

ah

short drift
#

I guess my question was exactly that - is it impossible. And I guess I got my answer.

pseudo hazel
#

if its the same shape with same ingredients, it will have the same result

short drift
#

I'll need to think of something different.

mortal hare
shadow night
#

You could prob manipulate it using the crafting event

mortal hare
#

man you guys need to check this section

#

saves so much time in terms of code generation

ivory sleet
#

yea

#

Its good

#

but you can put like things that contradict each other and the ide flips out

mortal hare
#

my favorites

#

i especially like the spam of final on code generation

#

less bugs when writing code and hinting JVM for optimization

eternal night
#

good job

#

I love spamming final

ivory sleet
#

oh yea its great

mortal hare
#

also these

#

verbosity of this, super and static

ivory sleet
#

myea, I mean I think there are occasions when this isn’t needed

#

but its good when the class is getting larger

eternal night
#

verbosity schmerbosity

#

once you glimpsed into the endless void that is FQN in mojang sources, a few finals are nothing

ivory sleet
#

kotlin cant compete

shadow night
mortal hare
#

i just prefer this everywhere since i dont have to confuse myself with color schemes

ivory sleet
#

Good song btw lynx

mortal hare
# shadow night Where do I find them

Unqualified static access
Instance method not qualified with 'this'
Instance field access not qualified with 'this'
Unnecessary qualifier for 'this' or 'super <- this one removes typed out unnecessary class name for this or super (Foo.super, Foo.this etc)

ivory sleet
#

does it pick super over this?

eternal night
ivory sleet
ivory sleet
mortal hare
ivory sleet
#

yea, like if there’s an inherited member and its not accessed with the receiver parameter this it puts super as opposed to this

#

and if super is possible, it yells at you for using this

ivory sleet
#

Cz I could never get it to work

#

ah they still didnt fix that then - sadge

mortal hare
#

i guess if you have such problems, maybe inheritance is not the solution

ivory sleet
#

I don’t think I was the owner of whatever library I was using

mortal hare
#

I wonder does java have a dedicated linter that's separate from IDE

#

something like BiomeJS or ESLint but for java

dry hazel
#

spotless

mortal hare
remote swallow
#

annotations when

blazing ocean
#

val

grave depot
mortal hare
#

dont need it

#

again:

#

with @NullMarked from JSpecify library, it declares all parameters as @NotNull implicitly unless you declare parameters as @Nullable explicitly

mortal hare
grave depot
blazing ocean
#

?codereview btw

undone axleBOT
grave depot
grave depot
#

im new here haha

buoyant viper
mortal hare
#

i would also probably remove magic values for slot numbers and refactor them to be either loaded from configuration file or refactor them to be inside static fields.

buoyant viper
mortal hare
#

You usually use Bukkit Configuration API to read configuration data for that purpose and then replace the placeholders with String.replace or adventure api if you're using paper

grave depot
mortal hare
grave depot
mortal hare
#

this is the way for linting

#

i 've searched for this and Scorpionist did found what i wanted for a long time 😄

mortal hare
#

i feel like Kotlin inline value classes are such a good way to wrap OpenGL objects

#

too bad valhalla is still not released

eternal night
#

sooooon

#

value objects have a JEP now

#

there are EA builds

mortal hare
#

me when Valhalla releases

ivory sleet
#

null restricted types is gonna be yummy

blazing ocean
inner mulch
#

Why are value types so much faster than normal classes?

slender elbow
#

less memory indirection

inner mulch
#

Okay

dawn plover
#

Hey there
I was wondering if anyone knows a fix for the following.
I am working on a plugin where you can cast abilities. these abilities have cooldowns, and i thought i would display these cooldowns as the stack number.
However, setting a number to higher then 100 (i did 360 lol), aperently breaks the game. Not imidialty but whenver you open your inventory

So my question is, does anybody know a way to go over this number, without breaking the game

slender elbow
#

no

#

or, yeah, fork spigot and change the hard-coded limit lol

dawn plover
#

🥲

dawn plover
carmine mica
dawn plover
#

i am just going to create a mod, just so i can have a big number

carmine mica
#

pretty sure that limit is part of the codecs somewhere oto

slender elbow
#

uh is it part of the network codec?

#

it's clearly part of the regular codec

#

it's just an unbounded varint on the network codec

true mural
#

I had a question

#

So recently I published this plugin that makes a website with a normal user and admin panel where in admin panel there can be multiple accounts with certain permissions, I added console but I was wondering if I could literally add a file manager, I should be able to load and save other plugin's configs from the plugin or is that not possible?

#

If I can't then I'll just spend the day tmr refactoring the code cuz its horrible rn

viscid carbon
true mural
viscid carbon
young knoll
#

I would use the new cooldown group component for cooldowns

#

Rather than stack size

inner mulch
#

so its said that udp is faster than tcp, altough, i tested it and it seems like tcp is faster? does anybody know why?

eternal night
#

sounds like a rather flawed test

inner mulch
#

i sent strings and echoed them

#

1.000.000

wet breach
#

Tcp requires acknowledgement that the other side received what you sent and is stateful meaning as long as the connection is open the other side is connected too or should be anyhow lol.

#

Udp doesnt check if the other side is even listening, you just send the packet off to where you want it to go and forget about it lol

inner mulch
#

okay

wet breach
#

That being said, udp is handy for communications where it isnt really crucial if the other side got it or not

inner mulch
#

yes, but i heard its faster if even if you ensure it gets on the other side

wet breach
#

It is but only because there is less overhead. That is you are not having to manage the connection and setting up any listeners as is required by tcp. You also dont have much strictness in regards to some header info(part of the less overhead)

#

So its not faster because it is better but simply there is less required for it to send a packet off with it

inner mulch
#

okay, but are there really any applications in which you wouldn't care if it didnt reach the sender?

wet breach
#

Sure, when you want to provide informative notifications. Lets say in the game the client allows you to setup friends list. And then it notices your friend is online. Instead of using tcp to tell the server to send notification to your friend you are online, you could do so with udp

#

Because really such a notification isn't super important

inner mulch
#

true

wet breach
#

Maybe the server wants some effect to happen on the client. Like fireworks going off because festivities. You could send that via udp since its not important the client do all that

#

So there is plenty of stuff you can just have done over udp, just have to decide and know is it ok if they just dont get it lol

echo basalt
#

In games they use both TCP and UDP

#

UDP generally has lower latency so it's often used when you're sending similar data a million times and you don't care if it's accurate

inner mulch
wet breach
#

Not really

echo basalt
#

Let's say, for example, when your enemy is moving. The UDP packet contains the player's final position and you kinda don't care if you miss a few

echo basalt
#

It gets abstracted away

wet breach
#

Older games when it came to setting up servers since all the services were separated. Usually your chat server was done over udp and tcp only used to just tracking purposes and admin stuff

echo basalt
#

Or when you're in a call, you don't care if the end receiver missed a couple bytes as long as the call is pretty much in real time

wet breach
#

Games especially older ones didnt really prioritize chat and care about the order of the messages just as long as everyone got your message at some point

echo basalt
#

Even when you screenshare on discord it goes over udp

#

connection can drop but as long as you get enough frames it's ok

inner mulch
#

i didnt know there where that many usecases

echo basalt
#

it's used like everywhere

#

minecraft bedrock also uses udp

#

most games do

inner mulch
#

but they have to somewhat ensure something

wet breach
#

As i said before, udp advantage is the fact it has less overhead and management

inner mulch
#

yes

wet breach
#

You just dont have reliability but that is ok because modern tech and networks it isnt common to just not get packets

#

Well it isnt like decades ago where like the percentage of not getting a packet was higher then it is today lol

echo basalt
#

in most cases it comes nowadays unless something seriously fucks up

wet breach
#

For example when connections were dial up, udp was something you wouldnt use commonly because that type of connection is not reliable and prone to suddenly going down

echo basalt
#

I wonder if we're gonna get to a point where it's so reliable we don't need tcp

wet breach
#

Well tcp has ordering

echo basalt
#

yeah..

wet breach
#

Also, secure connections cant use udp either

#

Since you cant be sure who you are sending to

#

Well they can, just not as secure really. Can still encrypt the packet

indigo orchid
#

Can I use spigot plugins on a paper server?

slender elbow
#

yeah

unborn hollow
#

are there any good resources that explain raytracing to detect if a player's looking at an entity's hitbox?

desert aspen
echo basalt
#

update your server's java version or compile to a lower version

echo basalt
#

I can offer a quick explanation if you want

unborn hollow
unborn hollow
#

Assuming it's this one you're talking about

echo basalt
#

I believe so yeah

#

I'd like to begin by stating that spigot has builtin methods for this

#

But it's always good to know what raytracing / raycasting is about

#

The basic concept around this is that we make a like that starts at the player's eye, aiming towards a direction and we see what it intersects

unborn hollow
#

I see

echo basalt
#

The most basic implementation of this goes a bit like the following

#

Define a couple variables:

  • Starting location (eye)
  • Direction
  • Max distance (we don't want to loop forever)
  • Precision (this is essentially how much we travel per iteration)
  • "offset" (basically your direction normalized and scaled down to precision length)

Start at the starting location and see if it intersects any bounding boxes, if it does, hurray!
If it doesn't, add offset to it and try again
If we reach maxDistance with no matches, end the loop

#

The math is pretty similar to rendering a particle line, except instead of displaying a particle we just look for bounding boxes

#

The finer the line, the more accurate and expensive the operation becomes

#

There are a couple ways to optimize it but fundamentally this is it

unborn hollow
#

Alright, thank you so much for your help!

echo basalt
unborn hollow
#

I'll be sure to check it out once I get the hang of things

echo basalt
#

Here's some old old code fore reference

unborn hollow
#

Are they related to the looking_at predicate?

echo basalt
#

raytrace / raytraceBlocks / raytraceEntities

cursive kite
#

Hey - I'm trying to practice my Git when commiting files why does it have two copies of each? Example; src/plugin.yml and target/classes/plugin.yml

mortal vortex
#

nothing to do with Git

wet breach
#

Target is the directory that gets created when you compile

cursive kite
#

Should both be publishing to git?

wet breach
#

All the files and classes destined for the jar get put there. Classes are turned into compiled format and then once compiling is done, all the stuff in target goes into the jar

wet breach
cursive kite
#

Dang it...

#

So delete the target folder from github

wet breach
#

So create a gitignore file add directory to said file. But before you do delete the directory, git commit and then push that change to remove directory from repo. Easiest way. Then create your gitignore file

#

Once directory is in gitignore file git will stop tracking it

cursive kite
#

What is strange is my current .gitignore contains /target/

wet breach
#

You need to remove the slash at the beginning

#

target/

cursive kite
#

About the other files, should .settings be there

#

seems to be my eclipse settings 💀

mortal vortex
mortal vortex
twin venture
#

Hi anyone know how i can get the old intellij idea ui?

umbral flint
#

It's somewhere in the settings

viscid carbon
#

Click that settings icon > old UI

#

thats in the right corner btw

arctic briar
#

im having a problem where protocolLib doesnt detect particles in particle packets on 1.21.1, it only returns as null when i try to read it

rough ibex
#

show code

cursive kite
#

Welp I broke more... I deleted the classpath proejct and settings from my github repo and then did git pull and it is giving issue snow

rough ibex
#

are you using a build system

cursive kite
#

What do you mean

cursive kite
#

I am opening my project in IntelliJ now and it has so many errors despite Eclipse not having any

rough ibex
#

you're talking about .classpath and .project files

#

you should be using a build system like maven or gradle

#

instead of relying on eclipse's hodge podge

blazing ocean
chrome beacon
blazing ocean
#

oh I read that as "get rid of the old UI"

umbral pumice
#

Would anyone mind helping me figure out why i cant compile any projects with intelliJ even though it says successfull?

#

tried like 3 and they all either compile and dont show up the jar in target folder, say error or hang up on post compile task

#

This is the error

chrome beacon
umbral pumice
#

How would i go about updating that in intelliJ

chrome beacon
#

Open your pom.xml and change the version numbers

#

a google search should find the latest versions available

umbral pumice
#

i dont see a pom.xml i do see xml files though

rough ibex
#

such as?

umbral pumice
#

build.xml and then these

blazing ocean
rough ibex
#

those are intellij configuration files

blazing ocean
#

that's not maven

rough ibex
#

those will not help you build anything

#

are you using a build system at all

umbral pumice
#

I know very little

rough ibex
#

also are you storing this on your onedrive...

#

thats gonna end badly

umbral pumice
rough ibex
#

C:\Users\dawse\OneDrive

umbral pumice
#

i have one drive disabled

#

pretty sure at least..

blazing ocean
#

still

#

that can and will break a lot of things

onyx fjord
#

Learnt the hard way

#

During c++ class my programs used to compile for 2 minutes (even a simple hello world) due to onedrive

patent elm
#

Is there an API in the Spigot API that will list the plugins purchased by the user? I want to verify with Discord.

blazing ocean
#

no

twin venture
blazing ocean
#

I believe you need a plugin for that

#

on newer versions at least

umbral pumice
#

so i disabled one drive now intellij cant find my documents folder..

#

it is there though

#

ill move them ig

#

ayy figured it out

chrome beacon
umbral pumice
#

i was before i merged it

#

i used netbeans

#

w ant 🤣

chrome beacon
#

💀

umbral pumice
#

moving everything from user/onedrive/documents to user/documents

#

then i will go from there

#

god one drive is annoying

quaint mantle
#

Or maybe switch to linux

rough ibex
#

the correct choice

blazing ocean
#

👍

umbral pumice
#

Alright back in a regular folder environment

#

Project shows this but wont show a build or target folder

blazing ocean
#

Yea because you're still not using maven

umbral pumice
#

How would i convert from ant to maven

blazing ocean
#

no idea

shadow night
#

Excuse me

#

What

#

Why would you use ant wtf

blazing ocean
#

just do it from scratch lmao

shadow night
#

How ancient are you

umbral pumice
shadow night
#

Bro even the netbeans people use maven

umbral pumice
#

Im glad you have opinions

#

can i get help

blazing ocean
#

@shadow night making a tool for setting up IJ workspaces for decompiled plugins, how should I get the VF jar? I don't really wanna make a config file and don't want the user to input the jar themselves... should I just download it?

#

I could download it to a place and check if it exists ig

shadow night
#

Ye download it

blazing ocean
#

I could download it to the user's data dir and check if that exists

quaint mantle
#

I used ant for hotreloading once

umbral pumice
#

Also you could blame ant, but i cloned a maven project and that wouldnt even build

umbral pumice
#

yeah im boutta just rebuild the project in maven and paste code

#

it works but its super l ong and annoying

#

yeah i got no idea whats even happening anymore. ant can get bent and ill remake the project with maven/gradle and just paste code over then it will build fine without all this mess

blazing ocean
# shadow night Ye download it

do you think this is fine? ```rs
pub async fn download_vf() -> io::Result<PathBuf> {
let jarfile = data_dir().expect("data dir could not be found").join("plugdecomp/vineflower.jar");
if jarfile.exists() {
return Ok(jarfile);
}

if let Some(parent) = jarfile.parent() {
    fs::create_dir(parent)?;
}

if let Err(err) = download_url(VF_DOWNLOAD_URL, &jarfile).await {
    return Err(io::Error::new(ErrorKind::Other, err.to_string()));
}

Ok(jarfile)

}

remote swallow
#

why would you ever want that

#

decompiled code in a workspace woud hurt my brain

blazing ocean
#

i got a nice malware sample and would prefer to look at it in IJ

remote swallow
#

just decompile with vine to a folder

#

its like 1 command now

blazing ocean
#

yea but you need the spigot API and shit

#

so I'm mainly doing that

remote swallow
#

nerd

blazing ocean
#

for gradle integration

still vortex
#

is there a way to know when a server on the proxy is stopped through bungee api?

#

i cant seem to find any events called related to it

blazing ocean
#

you'd have to do SLP lookups

still vortex
#

slp?

#

server list ping?

blazing ocean
#

yea

still vortex
#

any example of how to do so?

#

nevermind ServerInfo has a ping method thanks

lost matrix
lost matrix
still vortex
blazing ocean
#

you could use something like websockets ig

lost matrix
# still vortex interesting, how do i use a signal?

Events are signals for example. But anything you listen for is a signal. You have two options:

  • Write a plugin which is put on the server and send a message via a socket in your onDisable
  • Use a message broker like Redis or RabbitMQ (former is my fav)
#

Plugin messages wont work in onDisable iirc

eternal oxide
#

Slightly delayed but you could check the last ping

#

It just depends on why you need it. Do you need to know precisely WHEN a server stops, or do you just need to know IF its still available?

graceful meadow
#

Signal based handling is all fine until your server crashes badly and fails to send a signal, if you want to react to crashes as well as normal shutdowns, then I think the ping method is better in this case

exotic moss
#

Free crates plugin suggestion that works in 1.21.4? And not "excellent crates" cuz its buggy. And Item remover after item dropped time passed like shown in the photo

lost matrix
dry hazel
#

jvm crashes? there's no guarantee shutdown hooks run if the jvm crashes if you mean that

lost matrix
#

But if the process is killed or the OS dies, then there is nothing you can do. In which case polling would be the better option.

dry hazel
#

or when the jvm crashes, e.g. a segmentation fault due to bad memory, which is also pretty common

lost matrix
#

Interesting. I have seen zero seg faults in my 5 years of working with java so far. 🥲
But thats anecdotal. I would assume that its not very common. Would be interesting to find actual stats about what most often causes an ungraceful jvm shutdown.

chrome beacon
#

I've seen it once

#

The guy had just gotten a new PC with faulty memory

#

causing corruption in the program

untold trellis
#

Hello, I want to print all my packages when the plugins are loading, but it doesn't work.

for (int i = 0; i < eu.stepanb.commands.size()) {
blazing ocean
#

you'd need to use reflection

#

something like that will not just work

untold trellis
#

can i use lombook instead?

blazing ocean
#

that will not help you

untold trellis
remote swallow
#

because thats not what lombok doeds

blazing ocean
#

yea

untold trellis
#

so what lombok does

blazing ocean
untold trellis
#

i can add @Setter and @Getter to all my classes so it probably will work

#

Thanks

#

@blazing ocean

blazing ocean
#

wha

#

no

#

that is not how that works 😭

untold trellis
#

so how can i do it

remote swallow
#

1st is leanring java

#

2nd is reflection

untold trellis
#

i know java

#

i know java very well

remote swallow
#

i highly doubt that

blazing ocean
#

yea

untold trellis
blazing ocean
#

it really does not look like you know java very well

untold trellis
#

i know java well bro

remote swallow
#

so use reflection then

untold trellis
#

how

remote swallow
#

google

untold trellis
remote swallow
#

we arent gonna spoonfeed you

#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

blazing ocean
#

guava classpath my beloved

blazing ocean
#

okay?

remote swallow
#

so google how to use reflection

inner mulch
#

if you would know java you should know reflection

#

thats common knowledge amongst java users

untold trellis
#

i know java but i dont know reflection

remote swallow
#

but you know java very well

untold trellis
#

yes

inner mulch
#

reflection is part of java

untold trellis
#

reflection isnt java

inner mulch
#

it is

blazing ocean
#

it is lmfao

untold trellis
#

no

remote swallow
glad prawn
#

it is

remote swallow
#

it is

blazing ocean
#

it is

untold trellis
#

no

remote swallow
untold trellis
#

just reflection

#

addon to java

inner mulch
#

stepan you have to be trolling

blazing ocean
#

^

untold trellis
#

which u can add to gradle

remote swallow
#

reflections is a dependency

#

reflection is included in java

#

note the s

untold trellis
#

no

remote swallow
blazing ocean
#

"no"

inner mulch
#

java.lang whats that packet supposed to mean?

remote swallow
untold trellis
#

reflection isnt part of java

remote swallow
#

read

#

reflection is, REFLECTIONS is not

blazing ocean
inner mulch
#

*package

blazing ocean
#

blind

untold trellis
#

okay i know bukkit but i dont know java

#

better?

remote swallow
#

but java does include reflection that is not that api

untold trellis
#

so how can i do that

remote swallow
#

you can use reflection without that api

remote swallow
untold trellis
#

no

#

how can i do this

remote swallow
#

we arent spoonfeeding you it

inner mulch
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

remote swallow
#

if you refuse to read, you arent gonna get very far

untold trellis
#

im just going to ask chatgpt

#

bye

inner mulch
#

bye

remote swallow
#

he totally know java very well

inner mulch
#

yes

untold trellis
#

i know bukkit

blazing ocean
#

that's not java

#

bukkit is not java

#

bukkit is a library

#

an API

#

a dead one, at that

remote swallow
#

its only been dead for 10 years at this point

untold trellis
#

im still using bukkit on my server

remote swallow
#

ur on 1.7.9?

fickle spindle
#

how can i use hex colors in my plugin?

chrome beacon
#

or are you using components

fickle spindle
chrome beacon
#

Then the format is &x&f&f&f&f&f&f for #ffffff

fickle spindle
#

#fffff

chrome beacon
#

Assuming you're using & as the § character

fickle spindle
#

wait

#

i use the one that use discord

chrome beacon
#

??

fickle spindle
#

&x&r&r&g&g&b&b

chrome beacon
#

Spigot accepts hex

#

Not RGB

#

as far as I'm aware at least. If you want to use rgb you'll need to handle that on your own

fickle spindle
chrome beacon
#

add a &x and then add a & before every letter/number in the hex code

abstract totem
#

is there anything special you have to do to get mojang mappings working for NMS? I have added the md_5 plugin and the remapped-mojang dependency to my pom.xml but the classes are still obfuscated

fickle spindle
chrome beacon
#

yes

undone axleBOT
chrome beacon
#

Actually did you run BuildTools with the remapped flag

abstract totem
fickle spindle
chrome beacon
#

The string you want

abstract totem
chrome beacon
#

Remove the craftbukkit dependency

#

You can also remove the -api one

fickle spindle
#

thx

blazing ocean
#

brainrot

abstract totem
mortal hare
#

I dont understand. Most of the GLFW functions you need to call from main thread

#

but how i suppose to then have multiple rendering threads

#

for an application

#

if i can't offload GLFW.glfwSwapBuffers() which is basically needed for rendering thread to function properly

river oracle
mortal hare
#

wdym

#

inverse of control? i should offload application logic to another thread, meanwhile render everything under main thread?

slender elbow
#

what you can do is perform certain work tasks in other threads that you then push the result to the render thread

river oracle
#

this is through LibGDX but same point holds

package sh.miles.algidle;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.utils.viewport.ScreenViewport;
import org.jspecify.annotations.NonNull;
import sh.miles.algidle.screen.LoadingScreen;

public class MainGraphics extends Game {

    private SpriteBatch batch;
    private ScreenViewport viewport;
    private Camera camera;

    public MainGraphics() {
    }

    @Override
    public void create() {
        HeadlessGame.INSTANCE.start();
        this.batch = new SpriteBatch();
        this.camera = new OrthographicCamera();
        this.viewport = new ScreenViewport(camera);
        viewport.apply();
        setScreen(new LoadingScreen(this));
    }

    @NonNull
    public SpriteBatch getBatch() {
        if (this.batch == null) throw new IllegalStateException("Attempted to fetch SpriteBatch before #create call");
        return this.batch;
    }

    @NonNull
    public ScreenViewport getViewport() {
        if (this.viewport == null) throw new IllegalStateException("Attempted to fetch Viewport before #create call");
        return viewport;
    }

    public Camera getCamera() {
        if (this.camera == null) throw new IllegalStateException("Attempted to fetch Camera before #create call");
        return camera;
    }
}
    private HeadlessGame() {
        this.gameThread = new Thread(this);
        this.tickLoop = new TickLoop();
    }

    public void start() {
        this.gameThread.start();
        Registries.freeze();
    }
mortal hare
river oracle
mortal hare
#

does this mean that there's no way to have two independent GLFW instances, apart from creating a new process?

#

not saying that its practical but im just curious

river oracle
#

I'd assume so

chrome beacon
#

You can have multiple ones

#

but you usually wouldn't

#

Contexts I mean*

#

If you want to handle multiple windows and such you can do so

mortal hare
#

Opengl contexts yes,

#

but i mean glfw itself

#

GLFW.glfwInit(); can only be called from main thread

#

you cant have glfw context per thread

#

thus you cant have logic be running on main thread

#

and multiple renderers on separate threads

#

not that its practical anyways to have multiple renderers running at the same time lol

harsh surge
#

Can someone help me set up a project as im clueless or is there an article or video that helps?

lost matrix
harsh surge
#

thanks

#

What JDK do i use as people say use 21 but the 1 i use causes a ide error

chrome beacon
#

What's the error?

harsh surge
#

wait i reinstalled and it worked i think it was bugged

mortal hare
#

I give up

#

i give up making renderer for a game engine in java

#

im too braindead for this

pseudo hazel
#

oof

#

you're probably overcomplicating it then

lost matrix
mortal hare
#

im currently using that

chrome beacon
#

How about just using LibGDX for you game

blazing ocean
#

have you considered not making a game

#

it saves you a lot of brainpower

mortal hare
mortal hare
chrome beacon
#

Yeah same

#

I have to make engine + game in cpp though

#

with SDL as only lib

pseudo hazel
#

im making an art app in rust on top of wgpu which is basically a wrapper for all kinds of graphics libraries but essentially the same thing

#

just followed a giant tutorial so I can draw a thing on the screen

#

now it takes ages to make something normal and nicely abstracted

mortal hare
#

🙂

pseudo hazel
#

yeah

mortal hare
#

well he coded in cpp, but i did it in java

#

same shit

harsh surge
#

Not annotated parameter overrides @NotNull parameter Does any 1 know what this means when im making a command the sender, label and args all have the erroe

pseudo hazel
#

yeah just the bindings

#

which do the same thing

river oracle
mortal hare
#

i cant use something more high level

#

like LibGDX

#

or game engine

chrome beacon
pseudo hazel
#

but I guess you just have to build for windows desktop right?

chrome beacon
#

also that's a warning and not an error

river oracle
#

ahhh LibGDX barely feels like a game engine it really doesn 't hold your hand, but yeah that sucks

harsh surge
mortal hare
#

LWJGL is just bindings for opengl and glfw

#

barebones of what you need for game engine

chrome beacon
#

Which is what I like about it

river oracle
#

also what I like about it thus far

chrome beacon
#

?

harsh surge
#

so i change sender and stuff 2 notnull?

chrome beacon
#

yes

harsh surge
#

ahhh

#

thanks

blazing ocean
#

sorry it took me too long to find

pseudo hazel
#

it do be fast

#

but my stupid ass is gonna make the app run slow anyways

chrome beacon
blazing ocean
#

rust doesn't have the concept of actual libraries, hence the compile times

chrome beacon
#

yeah

#

It needs to compile everything

pseudo hazel
#

its not too bad

#

there is not a lot of code yet

#

I am not a person to just hoard dependencies because I need an is_odd function

blazing ocean
#

I was working on a tiny project earlier today and already had to compile 300 crates

remote swallow
#

clap

blazing ocean
#

clap my beloved

quaint mantle
#
   private boolean depc(Player player) {
        String depositCoinsAmount = plugin.getConfig().getString("deposit.player-deposit-coins-3");
        String depositGoldAmount = plugin.getConfig().getString("deposit.player-deposit-gold-3");
economy.depositPlayer(player, Double.parseDouble(depositCoinsAmount));
        if (playerInventory.containsAtLeast(new ItemStack(Material.GOLD_INGOT), Integer.parseInt(depositGoldAmount))) {
}```

Is this the right manner to get the value for a double data-type and an integer data-type from a config file?
quaint mantle
#
        Double depositAmount = plugin.getConfig().getDouble();
#

Is that correct?

remote swallow
#

use it the same way you use getString

mortal hare
#

i wonder if creating proxy classes for window size like this is good practise:

    private class OpenGLWindowSize extends Size {
        private OpenGLWindowSize(final float width, final float height) {
            super(width, height);

            GLFW.glfwSetWindowSizeCallback(OpenGLWindow.this.id, (window, newWidth, newHeight) -> {
                super.setWidth(newWidth);
                super.setHeight(newHeight);

                OpenGLWindow.this.callback.invoke(window, newWidth, newHeight);
            });
        }

        @Override
        public void setWidth(final float width) {
            GLFW.glfwSetWindowSize(OpenGLWindow.this.id, (int) width, (int) this.getHeight());
            super.setWidth(width);
        }

        @Override
        public void setHeight(final float height) {
            GLFW.glfwSetWindowSize(OpenGLWindow.this.id, (int) this.getWidth(), (int) height);
            super.setHeight(height);
        }
    }
}

outer class constructs OpenGLWindowSize which will represent width and height and it will allow for outer access of setting width and height

remote swallow
#

getString("path") or getDouble("path") or getInt("path")

mortal hare
#

then i can do

OpenGLWindow window = ...
Size size = window.getSize(); // Returns OpenGLWindowSize but hides it under Size class, because user doenst need to know that this is a proxy implementation of Size class
window.getSize().getHeight() // This will be synced with GLFW and cached to a field, handled by Size class, thanks to the provided listener of Window Resize, provided by OpenGLWindowSize
window.getSize().setWidth(550) // This will set the Size's this.width field and also will invoke GLFW to resize the window, essentially syncing the statea
quaint mantle
#

Figured it out

mortal hare
onyx heart
#

I was wondering if it's possible to disable this message from your plugin when you launch your server
Enabling Test v0.0.1

#

Pardon me for my horrendous English

chrome beacon
#

Just let it be there

#

No reason to disable it

onyx heart
chrome beacon
#

?

onyx heart
#

Uhhh.. Bukkit.getConsoleSender

#

Idk how to explain it...

onyx heart
blazing ocean
#

please don't

onyx heart
#

It is a bad idea?

blazing ocean
#

ansi colours are not supported on every terminal and there isn't really a reason to

onyx heart
#

Uhhhh.... ok

onyx heart
quaint mantle
#

It is

chrome beacon
#

Possible yes probably

#

good idea no

quaint mantle
#
    public static String sendMessage(String content) {
        return ChatColor.translateAlternateColorCodes((char) '&', (String) content);
    }```
Boom, simple
glad prawn
#

Wow

quaint mantle
#

I know

#

That's Hypixel level code right there

onyx heart
glad prawn
#

No pls

lapis widget
#

why cast to (char) and (String) legit isn't needed 🤔

onyx heart
rough ibex
blazing ocean
rough ibex
#

and a String to String

blazing ocean
#

is that decompiled code

onyx heart
blazing ocean
#

then why in the fuck are you doing that

rough ibex
#

It looks ugly as hell

#

and is useless and annoying

#

dont do it

#

Logs are not for aesthetics

#

theyre for logging

quaint mantle
lapis widget
#

no

quaint mantle
#

Honestly, I should get the code reviewed

onyx heart
rough ibex
#

no!

onyx heart
rough ibex
#

no!

quaint mantle
#

It is probably extremely horrendous

rough ibex
#

use logging levels

onyx heart
rough ibex
#

Yes

quaint mantle
#

Yes

onyx heart
#

...uhhh.. no

rough ibex
#

Your text editor can highlight them

quaint mantle
wet breach
#

The logger isnt what colors it

onyx heart
#

My terminal does support colours

quaint mantle
wet breach
#

Log4j is what is responsible for handling the coloring, or what does or doesn't get colored in regards to messages specifically sent to the logger. As for reading them better, the coloring only is visible/applies while looking at the console at the time the message appears. Once the message is logged, there is no more coloring lol.

quaint mantle
#

I'm noting this down

#

Thanks

mortal hare
wet breach
#

and?

mortal hare
#

nothing

#

i just want to show my ego

#

against you

#

unsucessfully

wet breach
#

o.O

mortal hare
#

😎

wet breach
#

duly noted I supposed lol

nimble crescent
#

how do I get item info of custom items like ecoitems:something

rough ibex
#

Custom items?

#

like, modded?

nimble crescent
#

no

#

like eco items

rough ibex
#

those are just items

nimble crescent
rough ibex
#

is it modded or not

#

you cant register new items vanilla

#

its just an item with custom data

nimble crescent
nimble crescent
rough ibex
#

Exactly that

#

Its just giving it some NBT

nimble crescent
#

aha so there is no way to get the default lore

rough ibex
#

And providing logic

rough ibex
blazing ocean
#

just pray that plugin has an API

rough ibex
#

maybe ecoitems has an api

#

If not, youre SOL

nimble crescent
sick ermine
chrome beacon
#

CMarco 💀

sick ermine
remote swallow
#

a troll that used to be in here

mortal hare
#

i'm probably starting this over

#

by implementing everything in more game engine higher level

#

im not even sure why im wrapping it

#

i love joe biden gifs

rough ibex
#

oh god hes made his way back in

sick ermine
#

i love rte gifs

mortal hare
#

the more i think about it,the more i realize generics are usually a code smell

#

I mean is it really worth to lose runtime type information and autobox every primitive value just because of convenience

#

for example

#

what if i have a Vector2d

#

sure i can have Vector2d<Float>

#

But then i can also have FloatVector2D which returns float insteas of Float with a generic type

eternal night
#

valhalla

#

when

#

but no, generics are not a code smell

#

jvm generics might be a bit funky to work with, but that is language detail

mortal hare
#

Type erasure is the root of the problem, and the only way to solve it is to use wonky runtime class type passings over parameters

#

Idk guys but what Fastutil offers without generics is way better imho

chrome beacon
mortal hare
#

we need Templates from C++

#

and SFINAE

#

please!

nova notch
mortal hare
#

its for dimensions

#

2 dimensional

nova notch
#

uh

#

i dont think thats true

mortal hare
#

what does 3D stand for in cinemas?

#

3 doubles in cinemas?

eternal night
#

yes

blazing ocean
#

I mean vec2f exists but he's right

#

but that might just be mojank

mortal hare
#

i prefer full data type names instead of one letter ones

#

Vector2i sounds kinda weird

#

IntVector2D looks more right to me

#

but that's just me

chrome beacon
#

TwoDimensionalIntegerVector

nova notch
#

int vector 2 double

blazing ocean
#

doubled int vector

mortal hare
#

well vectors can be multidimensional