#dev-general

1 messages · Page 275 of 1

prisma wave
#

explain yourself

#

immediately

#

this is not acceptable

surreal quarry
#

happening to me too

prisma wave
#

same

static zealot
prisma wave
#

but more importantly

#

all of it

static zealot
#

ah

#

hmm

prisma wave
#

double mutability in a static context 😬

surreal quarry
#

why HashMap

prisma wave
#

that too

ocean quartz
prisma wave
#

companion object is basically static so usually all of the same rules would apply

surreal quarry
#

MutableMap or better yet, Map if you dont need mutability

static zealot
#

I think when I made this that's what someone recommended.

prisma wave
#

static mutability bad

#

evil even

ocean quartz
#

Very fancy yeah, love the way it works in ktor

static zealot
surreal quarry
#

holograms suck

prisma wave
#

Thank you

#

var is the root of all evil

static zealot
#

there are some cases where I use var. like counting

#

I think

prisma wave
#

smh

ocean quartz
#

@static zealot Add private set to the late init database

prisma wave
#

real ones never use var

#

There's always a better way :)

static zealot
#

yeah I'm not a real one tho. I'm an impostor

#

oh let me note all this down. I will probably forget if I don't

prisma wave
#

No excuses

#

Even a child knows that val > var

static zealot
#

well I do to

#

but I couldn't think of anything else

#

well I know Kotlin has some methods

#

for all that

ocean quartz
#

127 vals 20 vars in my plugin, nice

static zealot
#

like sum and streams

#

and stuff

surreal quarry
#

wait BM what is the better approach for a counter

prisma wave
#

ehh dépends

static zealot
#

but I need to learn them all because I forget them

surreal quarry
#

an indexed loop or something?

prisma wave
#

o

#

tbh var might be ok in that scenario

#

But

#

there is usually a better way depending on the context

static zealot
surreal quarry
surreal quarry
#

IJ is lying to me smh

ocean quartz
#
lateinit var database: Database
  private set
static zealot
#

k well will change the bounties map to a MutableMap and remove it from the companion object. let me know if there's anything that's very bad.

#

I know that there's a lot to improve

icy nest
#

Is there anyone online that can help me with 3 groups( 3x operator, for 3 times other colors)

surreal quarry
#

what

icy nest
surreal quarry
#

?spigot

compact perchBOT
#
FAQ Answer:

Spigot Account Linking
To get support for a premium plugin owned by Clip or Glare you will need to verify your spigot account using =spigot in the #bot-commands channel. After you have successfully linked your spigot account you should ask your question in the coresponding channel for that plugin. If you have already linked your account and want to update your roles, run this command =spigot check.

surreal quarry
icy nest
#

I did

#

@surreal quarry

surreal quarry
#

you did not

#

you need to link your account

obtuse gale
#

Hey, does anyone have a tutorial on how to get Action Bar messages?
(Coding a Plugin)

static zealot
#

well you either use NMS or an API

obtuse gale
#

Thanks

static zealot
obtuse gale
#

I want to make it so when a player does /vanish it will display a message on their screen, saying "you are in vanish"

#

Like the Super Vanish plugin

#

Can I do that without any dependencies?

prisma wave
#

on 1.13+ yes

#

on 1.8-1.12, yes, but with some messy NMS

obtuse gale
prisma wave
#

d;Player#sendMessage

ruby craterBOT
#
public void setName(String name)```
Description:

Sets the name of the component to the specified string.

Parameters:

name - the string that is to be this component's name

surreal quarry
#

lol

half harness
#

d;spigot Player#sendMessage

ruby craterBOT
#
void sendMessage(@Nullable UUID sender, @NotNull String message)```
Description:

Sends this sender a message

Parameters:

sender - The sender of this message
message - Message to be displayed

half harness
#

wat

obtuse gale
#
        Player player = Bukkit.getPlayer("ExamplePlayer");
        player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(message));```
#

Will that work?

half harness
#

don't use § btw

ruby craterBOT
#
@NotNull
public static String translateAlternateColorCodes(char altColorChar, @NotNull String textToTranslate)```
Description:

Translates a string using an alternate color code character into a string that uses the internal ChatColor.COLOR_CODE color code character. The alternate color code character will only be replaced if it is immediately followed by 0-9, A-F, a-f, K-O, k-o, R or r.

Parameters:

textToTranslate - Text containing the alternate color code character.
altColorChar - The alternate color code character to replace. Ex: &

Returns:

Text containing the ChatColor.COLOR_CODE color code character.

half harness
#

oh wait

obtuse gale
#

also for Bukkit.getPlayer("ExamplePlayer"); what do I put

half harness
obtuse gale
#

Exampleplayer doesn't work

half harness
#

wydm "what do I put"

#

d;spigot Bukkit.getPlayer

ruby craterBOT
#
public interface Player
extends HumanEntity, PluginMessageRecipient, Conversable, OfflinePlayer```
Player has 89 methods, 4 extensions, and  18 super interfaces.
Description:

Represents a player, connected or not

half harness
#

d;spigot Bukkit#getPlayer

ruby craterBOT
#
@Nullable
public static Player getPlayer(@NotNull String name)```
Description:

Gets a player object by the given username.

This method may not return objects for offline players.

Parameters:

name - the name to look up

Returns:

a player if one was found, null otherwise

obtuse gale
#

Bukkit.getPlayer("ExamplePlayer"); how do I get the player who did the command

half harness
#

um

#

?

#

onCommand?

#

d;spigot CommandExecutor#onCommand

ruby craterBOT
#
boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args)```
Description:

Executes the given command, returning its success.
If false is returned, then the "usage" plugin.yml entry for this command (if defined) will be sent to the player.

Parameters:

args - Passed command arguments
sender - Source of the command
label - Alias of the command which was used
command - Command which was executed

Returns:

true if a valid command, otherwise false

surreal quarry
#

instanceof and cast

half harness
#

^^

winged mica
surreal quarry
#

^^^

half harness
obtuse gale
#

Yeah, so I want to so when the player does the command "/vanish" it will display

        Player player = Bukkit.getPlayer("ExamplePlayer");
        player.spigot().sendMessage(ChatMessageType.ACTION_BAR, 
        TextComponent.fromLegacyText(message));``` on their action bar
half harness
#

well remove that second line

#

scopes

obtuse gale
#
        player.spigot().sendMessage(ChatMessageType.ACTION_BAR, 
        TextComponent.fromLegacyText(message));```?
onyx loom
half harness
#

yes

winged mica
#

Same thing, it is very difficult but I did it 😂

half harness
#
if (sender instanceof Player) {
  Player player = (Player) sender;
}
player.sendMessage("");
#

ik

#

yes 🙄

#

it was an example

#

ok

steel heart
#
class _ {
  {
    {
      {
        {
          {
            {
              {
                System.err.println("lol");
              }
            }
          }
        }
      }
    }
  }
}``` pro coder
lunar cypress
#

Code that breaks in java 9 part 11

steel heart
#

wait fr

lunar cypress
#

yes

#

_ is no longer allowed as an identifier

steel heart
#

aww

surreal quarry
#

damn

#

first time ive seen barry down

steel heart
#

I hope Larry comes back

#

ok nvm

onyx loom
#

#bot-commands kekw

jovial warren
#

someone tell me why sun.misc.Unsafe exists lol

#

isn't the whole point that the JVM is meant to do the memory allocation and garbage collection for you?

old wyvern
#

Yes altho I assume it might be useful for some weird off heap optimizations and stuff maybe

#

You could do the same with JNiIanyway tho?

jovial warren
#

you heard it right here, null is the superclass of Object, primitives, interfaces and void

lunar cypress
#

Yes

#

well

jovial warren
lunar cypress
#

kinda

jovial warren
#

no

lunar cypress
#

null actually inherits from every type

jovial warren
#

null is both every type and no type

lunar cypress
#

at least that is how it's specified I'm fairly sure

jovial warren
#

it both has a value and doesn't have a value

#

it's null, that's the way it's designed

lunar cypress
#

ok but that's not the point

jovial warren
#

it's a value that's meant to represent no value

lunar cypress
#

the name and the fact that you can only get an instance via reflection might hint at that

jovial warren
#

and also, if you do new Object().getClass().getSuperClass(), apparently somebody said that because this returns null that apparently, that means that null is the superclass of all classes, which is bull shit, because the documentation specifically says that it's meant to return null in those cases (primitives, interfaces, Object, void)

jovial warren
#

unless that's just an OpenJDK thing

lunar cypress
#

Try it

jovial warren
#

I just did

lunar cypress
#

which version

jovial warren
#

8 I believe, can't remember, lemme look

old wyvern
#

Did you try running it?

jovial warren
#

yeah 8

#

nah I didn't

lunar cypress
#

...

old wyvern
#

Try

#

Return the singleton Unsafe instance. This method may only be called internally.

#

may only be called internally.

jovial warren
#

not what it says for me

lunar cypress
#

that's why I said "try it"

#

Writing Unsafe.getUnsafe() doesn't do shit on its own

jovial warren
old wyvern
#

Try running it bard.

jovial warren
#

I'm using OpenJDK, and it even provides an example where it uses getUnsafe() without reflection

#

gimme a min

lunar cypress
#

it may be possible in Java 8 but why don't you just run it

lunar cypress
#

It's definitely not possible in newer versions

#

not without further effort at least

old wyvern
#
 public static Unsafe getUnsafe() {
        Class<?> caller = Reflection.getCallerClass();
        if (!VM.isSystemDomainLoader(caller.getClassLoader()))
            throw new SecurityException("Unsafe");
        return theUnsafe;
}```
jovial warren
#

ah, you're right

lunar cypress
#

see

prisma wave
#

spooky java internals

lunar cypress
#

also I just checked the java specs, null is indeed a special type and while they don't put it exactly that way, it still inherits every type in a sense

prisma wave
#

null is like kotlin Nothing

lunar cypress
#

There is also a special null type, the type of the expression null (§3.10.8, §15.8.1), which has no name.

Because the null type has no name, it is impossible to declare a variable of the null type or to cast to the null type.

The null reference is the only possible value of an expression of null type.

The null reference can always be assigned or cast to any reference type (§5.2, §5.3, §5.5).

jovial warren
#

I actually kinda wanna try this now

lunar cypress
prisma wave
#

nah not really

#

But

#

Same sorta thing

jovial warren
#

how do you find out what memory addresses are what?

#

like is there a way to list everything in the JVM's memory using this class?

prisma wave
#

Probably not

#

The JVM makes no guarantees about memory addresses afaik

lunar cypress
#

you get an address when you allocate something

old wyvern
#

Unsafe just allows you to work outside the restrictions of the jvm heap and gc I think

jovial warren
#

is that what the long that allocateMemory returns is? a memory address?

lunar cypress
#

yes, should be

jovial warren
#

alright, let's try this

prisma wave
#

aren't there actual APIs for foreign memory access?

lunar cypress
#

nowadays there are yes

#

You should definitely try those

#

If you want to do this sort of stuff

#

And, while you may not feel special anymore if you do it, you may also just use the JNI and have complete control

prisma wave
#

lmao

jovial warren
#

apparently I just can't use it at all lol

#

actually nvm, those are just warnings

old wyvern
#

wdym?

#

oh

jovial warren
#

I get like 5 warnings telling me it's internal proprietary API and may be removed in a future release lol

lunar cypress
prisma wave
#

because it is

lunar cypress
#

better

#

and more modern

#

although it is not unsafe anymore 😦

prisma wave
#

anything in the sun package is proprietary and isn't guaranteed to be present everywhere

prisma wave
old wyvern
#

Wait how is it less unsafe tho?

lunar cypress
#

Just not the same feeling if your program doesn't segfault because you missed a string terminator

jovial warren
old wyvern
#

oh wait nvm

lunar cypress
old wyvern
#

yea just did

prisma wave
static zealot
#

hmm. on github. how do you put those cool stats in your profile ReadMe?

jovial warren
#

I can't fuck up my system or anything by using this btw, can I?

old wyvern
#

Which one blit?

jovial warren
#

I swear Windows encapsulates every program and doesn't allow it to read other programs' memory

#

right, good

lunar cypress
#

every modern os does that

lunar cypress
#

for good reasons lol

static zealot
#

I want just the personal stats

#

like when you go to my github

#

like repos, languages etc.

static zealot
#

ah. thank you

old wyvern
#

There are more that might have things you might want

#

just google "dynamic github readme"

static zealot
#

yeah I've just seen what you sent me lmao

#

its actually a wiki for it

lunar cypress
#

I wonder if you can manage to segfault your java program using unsafe

prisma wave
#

probably

#

i managed to crash the JVM which is close enough

old wyvern
#

🥲

lunar cypress
#

Oh I've done that plenty of times but not without jni

prisma wave
#

Does this count as a segfault?

lunar cypress
#

well does it segfault?

prisma wave
#

A fatal error has been detected by the Java Runtime Environment:

SIGSEGV (0xb) at pc=0x00007facb499a32a, pid=32459, tid=32490

#

yes

old wyvern
#

o.o

lunar cypress
#

noice

#

ok I think jshell simply doesn't allow it

prisma wave
#

probably not

#

aah

lunar cypress
#

I do love that it gives you some info though

#

In C it literally just says "Segmentation Fault" in the console lmfao

prisma wave
#

Yeah that's why I was wondering if it's an "actual" segfault

lunar cypress
#

yeah it is

#

The jvm just doesn't leave you alone with it

prisma wave
#

fair enough

lunar cypress
#

procrastinating again, god damnit

#

I only have one exercise left but it's the worst of all

#

So far this class has been ok but I really can't wrap my head around proving that an algorithm does what it's supposed to do

jovial warren
#
Unsafe unsafe = Objects.requireNonNull(ventureIntoTheUnknownToRetrieveTheUnsafe());

String string = "Hello World! I was written and read using Unsafe!";

List<Long> memoryAddresses = new ArrayList<>();

// Put all characters of string into memory with separate memory addresses
for (char character : string.toCharArray()) {
    long memoryAddress = unsafe.allocateMemory(1);
    memoryAddresses.add(memoryAddress);
    System.out.println("Put character " + character + " into memory. Address is " + memoryAddress);

    unsafe.putChar(memoryAddress, character);
}

// Sleep for 3 seconds
Thread.sleep(3000);

// retrieve all characters and build them back into a string
StringBuilder outputBuilder = new StringBuilder();
for (long memoryAddress : memoryAddresses) {
    char character = unsafe.getChar(memoryAddress);
    System.out.println("Retrieved character " + character + " from memory. Address is " + memoryAddress);

    outputBuilder.append(character);
}

System.out.println("Retrieved String: " + outputBuilder.toString());
```👌
#

I actually managed to make it work lol

jovial warren
#

wow

obtuse gale
#

Of course you can't just try and read a memory address just like that, that is illegal memory access, but you have to use those functions from the winapi

jovial warren
#

also, if anyone asks why I allocate a separate space in memory for each character, I tried allocating one big space for all of them, but putChar would just replace the original char with the new char lol

obtuse gale
#

And of course there are certain areas you can't read/write from/to either lol

jovial warren
#

unless I'm just being dumb

lunar cypress
obtuse gale
#

But it isn't an impossible task

#

It's not that it is strictly forbidden and there is absolutely no way of reading memory that doesn't belong to your program

jovial warren
#

also, am I the only one here that has a project called "testing" on IntelliJ that is specifically used for just throwing random testing things in

prisma wave
#

They should rewrite windows in a more modern language

#

Rust for example

obtuse gale
#

elara v2

jovial warren
#

yeah, because scratch files have indexing

old wyvern
#

I have many projects for that 🙂

#

I have lost count

jovial warren
prisma wave
#

SIZE_T is so outdated and ridiculous, we should all use usize!

jovial warren
#

actually, scratch files do have indexing

old wyvern
#

I also have a new project every 2 competitions, while I try to start sorting things with packages but just forget that exists 🙂

jovial warren
#

but they kinda still do require a project to use them

lunar cypress
#

got any problems with any type of software? a rewrite in rust will fix it

prisma wave
#

Obviously

#

let mut is the answer to everything

#

unlike VERBOSE and UNREADABLE "auto"

old wyvern
#

Got any problem with software? Rewrite to Elara, auto fix 😎

prisma wave
#

true!

old wyvern
#

🇪

prisma wave
#

Operating systems are perfect for Elara/JVM !

old wyvern
#

EVM

prisma wave
#

😳

old wyvern
#

ERM

prisma wave
#

Yes

old wyvern
#

Elara IS the bytecode now 🙂

prisma wave
#

Unlike the LAZY and INCOMPLETE "virtual" machine, Elara's is 100% real!!

old wyvern
#

🌟

lunar cypress
#

elara ships with a physical computer

old wyvern
#

YES!

prisma wave
#

We will reinvent lisp machines

#

Elara machines

lunar cypress
#

I had this stupid idea of writing a regular lisp but with exaggerated parantheses

old wyvern
#

Forget Turing machines, Elara Superior Machine is coming

#

Elara to solve halting problem before Vlang????

lunar cypress
#

and calling it "what non-lisp programmers claim lisp looks like"

old wyvern
#

😬

prisma wave
#

The Mitten-Yugi thesis

old wyvern
#

xD

prisma wave
lunar cypress
#

I thought maybe every list needs 2 parens instead of one and every scalar also needs parens now

prisma wave
#

lmao

lunar cypress
#

and then of course you don't have vectors or anything like that

prisma wave
#

No

#

Only parentheses

lunar cypress
#

So it's essentially scheme but with double parens

prisma wave
#

perhaps any character should be represented by an amount of parentheses according to its ASCII value

lunar cypress
#

oh my god

prisma wave
#

a = 65 pairs of parantheses

#

Etc

lunar cypress
#

that is actually genius

prisma wave
#

or use the binary values with 0 being ( and 1 being )

old wyvern
#

```((print ((+ ((- (12) (1))) ((* (5) (2))))))))````

lunar cypress
#

but I think parsing is not deterministic anymore in that case

prisma wave
#

yeah idk if you could parse it properly 🥲

lunar cypress
#

I was thinking the amount of parens in scheme-like lisps is already p high and if you double that it will be pretty absurd

old wyvern
#

use wrap every character denoting parens with a []

lunar cypress
#

I mean since you add parens to scalars as well you triple it even

prisma wave
#

🥶

old wyvern
#

lispfuck

#

brainlisp

#

how about brainfuck with parens instead of 0s and 1s

#

oh wait no

#

it isnt in binary is it

prisma wave
#

nah

lunar cypress
#
(((let) (((((x) (5))) (((y) (10)))) (((println) (x) (y)))))```absolutely beautiful
old wyvern
#

oh god

lunar cypress
#

Since I'm done with my post now I think I'll do this in the upcoming days

#

Any language suggestions

prisma wave
#

()))()))()())()()())()))()))()()()()()()()())()()())())())())())())))()()))()))())())))()))()())())())()()()()()()
here's my take

#

print("Hello world") in "HellLisp"

lunar cypress
#

I think there's something like this already

#

Oh god this reminds me

old wyvern
prisma wave
#

()))((((()))(()(())()(()())()))(()))()(((()()((((()((()(()(()(((())(()()())())((())())((())())))(()(((((()))()))())())))()))(()(())())((())(()(((()((()((()()(()
fixed it, should be more like this

old wyvern
prisma wave
old wyvern
#

Definitely programming languages like the title suggested!!!!

lunar cypress
#

As uni freshmen we got a set of tasks by older students (stuff to get to know the city and essentially a troll quiz) and one task was to write a program that validates paren expressions

#

We compiled our solution to brainfuck

prisma wave
#

oh god

lunar cypress
#

they said you could validate things like this in O(1) ()))((((()))(()(())()(()())()))(()))()(((()()((((()((()(()(()(((())(()()())())((())())((())())))(()(((((()))()))())())))()))(()(())())((())(()(((()((()((()()(()

#

I think that's absolute bullshit

#

But I actually haven't checked since then

prisma wave
#

that doesnt seem right

#

maybe logn

#

but constant time?

old wyvern
#

wouldnt the minimum be O(n) since you need to go through the input one way or the other?

#

Probably them trolling

prisma wave
#

you could probably divide it up to do in log n

lunar cypress
#

yeah probably

prisma wave
#

But definitely not constant

old wyvern
prisma wave
#

idk lol

#

divide and conquer?

lunar cypress
#

I'd love to send our solution but it's too big to be pasted in hastebins lmao

old wyvern
#

I dont think that should be possible, what ive seen people do is just use a stack

#

push and pop

prisma wave
#

🥲

lunar cypress
#

Yeah we didn't have a stack, but we did it in O(n) regardless

prisma wave
#

(()()(((()))((((()))(()(())()(()())()))(()))()(((()((((((()((()(()(()(((())(()()())())((())())((())())))(()((()((()()(()
this is (println "Hello")

#

so it could transpile to clojure

old wyvern
#

How about representing each character as parens, where each left paren would add 1 to the ascii value and each right paren would end a character

prisma wave
#

hmmmm

#

That's even more verbose than doing it by bits

lunar cypress
#

not satisfying

prisma wave
#

Which isn't necessary a bad thing

lunar cypress
#

I actually do want to make a proper lisp

#

adding useless parens still makes it esoteric of course but I don't wanna go brainfuck-level

old wyvern
#

xD

prisma wave
#

True true

#

Maybe reverse the parens lol

#

)println "Hello(

#

call it a psil

old wyvern
#

😫

lunar cypress
#

oh my god that is absolutely terrible

#

I love it

prisma wave
#

🤣

#

It's beautiful

old wyvern
#

dont pls xD

lunar cypress
#

how about both

#

()println "hello"()

prisma wave
#

lmao

#

Is that possible? there'd be ambiguity with nesting no?

lunar cypress
#

oh yeah

#

yeah you need different opening/closing tokens

old wyvern
#

Unless you have the function not be separted by a space from the starting ()

prisma wave
#

What about a lisp with every paren type? ```
([<{println "Hello World"}>])

lunar cypress
#

I mean technically

#

if I actually implement a lisp I will probably use some parser generator

old wyvern
#

How about every character being use equivalently to a paren (without the opening or closing ofc)

lunar cypress
#

and changing stuff like this is trivial

old wyvern
#

I mean do lisps really need too much of a parser?

lunar cypress
#

no they don't

old wyvern
#

isnt the code the syntax tree itself?

#

ah

lunar cypress
#

yes

#

but I wanna try one

#

Writing an exam about it soon 🥲

old wyvern
#

about lisps or parser generators?

lunar cypress
#

Context free grammars

old wyvern
#

ah

lunar cypress
#

that's one of the many topics at least

old wyvern
#

Mine just finished 3 days ago, whole toc tho

prisma wave
#

Fancy

lunar cypress
#

I'll have Set theory, encodings, compression, simple and first order logic, formal languages, context free grammars, assembly, graph theory and algorithm correctness proofs as exam topics 🥲

#

I honestly don't know how to keep all of it in my head

old wyvern
#

Those are from multiple courses right?

lunar cypress
#

no

old wyvern
#

You have those in a single subject?

prisma wave
#

Wow

lunar cypress
#

yes, it doesn't go too deep in most cases though

old wyvern
#

Ah

#

For me most of those topics were covered over 3 sems in varying subjects

lunar cypress
#

yeah they will come up again

old wyvern
#

ah

lunar cypress
#

the class is called "basics of computer science" essentially

old wyvern
#

Ah

#

we never had anything like that welp

prisma wave
#

"Basics"

lunar cypress
#

Honestly so far it has been fairly basic, it's just a lot to remember

#

well, and as I said I can't wrap my head around correctness proofs

#

(Hoare calculus)

#

did you do that as well @old wyvern ?

old wyvern
#

Nope, not yet

#

My interim sem just ended so waiting to see what courses we get for the next one in a week or so

lunar cypress
#

oh you don't know yet?

old wyvern
#

Nope, we get a list of courses like a few days before the course registration begins

lunar cypress
#

oh ok

#

We have a list of all classes we need to take to get a degree and you can choose whichever you want

#

although there is a recommended order of course

old wyvern
#

yea we have something similar but not as flexible, we need a certain no. of credits for the degree and each course provides an amount based on what that includes (Courses are split into combinations of Lectures, Theory, Tutorials, Practicals, Projects and something else I forgot xD was explained at start in the orientation class). Then each sem the Credit System coordinator selects a list of courses for each batch at multiple time slots and then we can choose whichever we want from those.

#

Also apparently a few extra credits (18 or so) could fetch a minor in some other specialization if we wanted to as well, but im unsure as to if thats valid

lunar cypress
#

ok yeah we also have a credit system and the courses are also split

old wyvern
#

Didnt really pay attention to what they said on the first day

frigid badge
#

I really wish I went to an uni for cs

ocean quartz
#

Same

#

I guess i'm still young and still can go, but idk

lilac saddle
#

So im trying to make a placeholder that will display the name of a world the player is standing in, but change the name of the world if it is "world_nether" but this isnt working, can anyone help? :
var world = player.getWorld().getName();
function changeWorldName() {
if (world == "world_nether") {
world == "Nether"
}

prisma wave
#

world == "Nether" this is like

#

Very wrong

lilac saddle
#

haha

#

Well im very new! How could i fix this?

prisma wave
#

if you just wanna reassign it use =

#

== is for comparison

lilac saddle
#

OHHHH RIGHT i totally forgot

#

Thank you, let me try that

#

Of course that worked! Thank you for your help. Im a noob

prisma wave
#

Lol no problem

steel heart
#

Object[] array = new Object[10];
array[0] = 1;

#

would this box the int when put into array

forest pecan
#

probably, cause Integer is a subclass of Object

steel heart
#

I hope not

#

I mean

forest pecan
#

and you can't convert primitive arrays to object arrays

#

directly

steel heart
#

How would I test it

forest pecan
#

.class?

#

print the .class of the object?

#

idk

steel heart
#

would work if java didnt autobox

forest pecan
#

oh wait

#

hm

steel heart
#

@prisma wave if u r awake

#

help me

prisma wave
#

what's up

prisma wave
steel heart
#

that autoboxes it?

#

you serious

#

fuck

prisma wave
#

Almost definitely

steel heart
#

FUCK

#

okay if I have an array whose elements are null

#

that won't take much on memory right?

#

but like a big array

#

🙏

old wyvern
#

how big?

#

And what type?

#

primitive or reference type?

steel heart
#

Object, and then maybe around 1000, one for Object and one for each primitive

#

not a problem?

old wyvern
#

Yea probably not

steel heart
#

ok good

#

they're gonna be cached btw

old wyvern
#

1000 references should only be around 31.25 kb

steel heart
#

holy fuck

#

and if an element in an array is null

old wyvern
#

Im not talking about the objects size

steel heart
#

does that optimize it?

#

yeah yeah

old wyvern
#

Im talking about the references size

static zealot
#

damn ProtocolLib javadocs are down or is it just for me?

steel heart
#

oh well

half harness
static zealot
#

xD

#

its my first time working with it

#

and it lets me down like this

half harness
#

protocllib?

#

oh

#

lol

#

😂

regal gale
half harness
#

normal 🙂

hallow crane
#

wiki VEEGEE

regal gale
#

Works fine for me

half harness
#

😮

#

blitz

static zealot
#

I'm on that rn

half harness
#

somethings wrong on ur end

static zealot
#

but their spigot linsk

half harness
#

oh wat

static zealot
#

to another one

half harness
#

I still haven't figured out how PlayerInteractEvent left click works 😭

#

even tho i gave up on that project a while ago

regal gale
#

d;spigot PlayerInteractEvent

ruby craterBOT
#
public class PlayerInteractEvent
extends PlayerEvent
implements Cancellable```
PlayerInteractEvent has 4 fields, 1 all implementations, 18 methods, 1 implementations, and  1 extensions.
Description:

Represents an event that is called when a player interacts with an object or air, potentially fired once for each hand. The hand can be determined using getHand().

This event will fire as cancelled if the vanilla behavior is to do nothing (e.g interacting with air). For the purpose of avoiding doubt, this means that the event will only be in the cancelled state if it is fired as a result of some prediction made by the server where no subsequent code will run, rather than when the subsequent interaction activity (e.g. placing a block in an illegal position (BlockCanBuildEvent) will fail.

regal gale
#

👍

half harness
#

😐

#

i meant, what fires it

#

what causes it to fire*

old wyvern
#

any interaction

#

one time for each hand

half harness
#

I meant, what code causes it to fire

regal gale
#

"Interacto" 🥲

half harness
#

🥲

regal gale
#

Good word btw

old wyvern
#

You'll have to look into the internals for that

old wyvern
half harness
#

because it doesn't fire all if I click fast

regal gale
#

Yeah, inside NMS will show you

half harness
#

hmmm

#

wHaT iF i CoPy ThE cOdE

old wyvern
half harness
#

HM

#

i dont think so :)))

#

hopefully not

regal gale
#

Click fast and holding click are a different things

half harness
#

ik

#

bc other servers like || mcplayhd || can detect like 30 cps rmb, prob lmb too

old wyvern
#

You can hook into the netty pipeline and see the incoming packets I guess

half harness
#

uh

#

I don't know what that it 😢

old wyvern
#

Google

regal gale
#

Fact that I learned from nms: usually right click only triggers 20 blocks at max per sec

half harness
#

too busy right now

#

don't ask why im on discord 😛

old wyvern
#

🤷

half harness
#

😮

regal gale
#

Ahem.. right click

#

Not left

old wyvern
#

right click is for place right?

regal gale
#

Yeah

old wyvern
#

or wa it left?

#

oh ok

half harness
#

._.

#

thats like

#

basic mc controls

old wyvern
#

I usually reverse that binding so it always confuses me

half harness
#

oh

regal gale
#

Me too lol

half harness
old wyvern
#

ayy

distant sun
#

you guys are weird

regal gale
#

🥲

distant sun
#

quick coc anyone?

half harness
#

🥲

old wyvern
#

xD

half harness
#

hUh?

#

witch speak?

#

whats that

regal gale
old wyvern
#

idek I forgot the language name again

old wyvern
distant sun
#

C

half harness
#

C 👀

old wyvern
#

Uh slovenian?

distant sun
#

romanian smh

old wyvern
#

wait no thats frostys place

#

uh

#

oh yea

half harness
#

lol

distant sun
#

stoopid

old wyvern
#

🥲

half harness
#

🥲

old wyvern
#

smiling_face_with_tear

#

Thank me later

half harness
#

lol

old wyvern
#

🙂

half harness
#

ok

#

=remindme

compact perchBOT
#
Reminders | Invalid Tier

You need to be at least Tier V in order to set reminders!

half harness
#

:C

old wyvern
#

HA

half harness
#

._ .

#

|| not like you can either 🙂 ||

old wyvern
#

🥲

half harness
#

🥲 🥲 🥲

static zealot
#

oh @distant sun that's pretty cool

distant sun
#

😁

forest pecan
#

hey

#

dont bully my tier 3

half harness
#

ur only tier 3?

#

ur sorta active tho

livid jay
#

can u guys integrate guilds into mmocore and add guild boss raids

onyx loom
#

no u

half harness
forest pecan
#

wait a minute

#

Frosty uses this formatting in his code?

public void t() 
{
}
half harness
#

😱

#

thats horrible

ocean quartz
#

It's not bad

forest pecan
#

What should my nms module name be called

#

my main project is called MinecraftMediaLibrary

#

I'm thinking of MML-NMS-v1_16_R1

#

is that fine?

quiet depot
#

no

forest pecan
#

What should be the convention

quiet depot
#

just call it 1_16_R1 lol

forest pecan
#

oh

#

KEKW

regal gale
forest pecan
#

Yeah same

regal gale
#

First of all, it's much harder to track down for me

quiet depot
#

"this formatting" has a name

#

it's called allman

forest pecan
#

For me, I feel that it uses so much space and it doesn't follow the java ap format

quiet depot
#

ap?

forest pecan
#

advanced prep

quiet depot
#

what the fuck is that

forest pecan
#

basically college level classes in high school

quiet depot
#

lol

forest pecan
#

or liek that

#

and they require you to write the code on paper

#

no cap

quiet depot
#

that's in no way official or even slightly indicative of a convention

forest pecan
#

for open response

#

and its messy and takes too much space to do that

#

kekw

obtuse gale
#

it doesn't follow Google's java style guide

forest pecan
#

lol

quiet depot
#

java doesn't define an official brace placement convention

forest pecan
#

Yeah

quiet depot
#

the closest thing we have to it is the docs using k&r

forest pecan
#

Although other languages

#

like javascript i think?

#

fixate it

#

but at least we can all apreciate java has brackets

#

python tho

quiet depot
#

don't think javascript has official conventions on this either

ocean quartz
#

JavaScript has no conventions man, it's like the wild west there

forest pecan
#

its not js

#

its Go

forest pecan
#

in Go, you need two brackets

#
if x < 0 {
{
    return sqrt(-x) + "i"
}}
#

but thats still uh

#

nasty

obtuse gale
#

what the fuck

#

why

quiet depot
#

erm

#

you don't need two?

forest pecan
#

you do

quiet depot
ocean quartz
#

Never seen 2 brackets in Go lol

quiet depot
#

yeah neither

forest pecan
quiet depot
#

why would you use allman in go?

ocean quartz
#

Even the person that is used to allman wouldn't use that

forest pecan
#

yea idk

#

lol

ocean quartz
#

As one of the comments stated

Succinctly, no.

#

Interesting that go doesn't support that though

quiet depot
#

nah it makes sense for go

#

I thought go's whole philosophy was "there's one right way to do things"

#

"and if a way doesn't exist then don't do it"

ocean quartz
#

Yeah it makes sense

restive field
#

e

hot hull
#

What are some cool IJ plugin to install

static zealot
#

Gradle

#

Minecraft

hot hull
#

I mean cool, not mechanics

#

Just visual shit

#

I got rainbow brackets and nyan progress bar

static zealot
#

ah

#

hmmm Frosty how would the commands work? /toggle <arg>?

hot hull
#

It'd be a gui with modules

#

The idea is to have not just messages, but try and disable any desired text, itemstacks, maps, holograms, etc

static zealot
#

oh

#

ok nvm then I ain't working on this xD

hot hull
#

Basically just make an amazing toggle plugin

static zealot
#

Gonna use Matt's GUI FW?

hot hull
#

FW?

static zealot
#

lib*

hot hull
static zealot
#

xD

#

yeah I think you'll have to work on this plugin yourself because this is to much for me xD

hot hull
#

Why Blitz :C

#

I need to work on mob coins

static zealot
#

I mean just block text packets was easy enough I guess

hot hull
#

I will probably need to rewrite boosters from scratch cause I have 27 hours of unsaved progress on my old drive which idk if it works

static zealot
#

but like this is going to be a whole thing

hot hull
#

I have so much stuff to do :C

static zealot
#

I was like already working on the commands lmao xD

#

well because its Java first of all.

hot hull
#

Yea because this would be a mess in kotlin

static zealot
#

I mean if I finish these courses I started maybe I'd be more qualified to work on this

#

but that's like 5 hours of videos I think

#

and its kotlin xD

hot hull
#

Fix your wildcard imports

import java.util.*

obtuse gale
#

🔲

static zealot
#

🔳

obtuse gale
#

frostys monitor be like 🔲

static zealot
#

xD

hot hull
#

Shut up

stuck harbor
#

frosty, is that plugin free?

hot hull
#

Which one?

stuck harbor
#

is it... free real estate?

hot hull
#

fuck off

stuck harbor
#

:)

static zealot
hot hull
#

This new gradle shit is confusing aaaaaa

distant sun
#

[26/01 10:21:12 WARN] [JDA RateLimit-Worker 4] Encountered 429 on route PATCH/channels/{channel_id} with bucket 9852e1a53c06ffc5a89d65fef85ca4ce:guild_id:742322157035585536:webhook_id Retry-After: 56 ms 😤

lunar cypress
#

Bruh wtf are you doing

distant sun
#

just trying to send a webhook for fuck sake

#

it worked perfect previous 20 times

lunar cypress
#

That's not it

#

I think

distant sun
#

wdym?

lunar cypress
#

Do you do anything else at all

distant sun
#

with webhooks?

lunar cypress
#

No in your code

#

Generally

#

Do you send any other requests

distant sun
#

well I get the event from a ktor webhook endpoint

lunar cypress
#

Don't create the client each time

#

That probably edits the channel

distant sun
#

hmm, maybe

#

do I need to close it when the bot shut down?

lunar cypress
#

I don't think that's necessary

distant sun
#

oky

#

I misread it and thought I have to create a new client every time >.<

jovial warren
#

trying to make a platform agnostic configuration system (when I say platform agnostic, I mean it basically works anywhere lol), and I've spent the past day or so trying to figure out whether I should use annotations and reflection, a config key system (a bit like what LuckPerms, PAPI 3, and I think ConfigMe does), or basically a map++ (like what Bukkit and Bungee do)

#

I've rewritten the code in this project at least 10 times by now lol

prisma wave
#

whatever you consider most practical I guess

jovial warren
#

that's the thing: I can't decide lol

prisma wave
#

Imo annotation based ones are gross but many people like them

#

Is this yaml only?

jovial warren
#

I would prefer it to be abstract enough to work with any format that stores key/value pairs

#

and also has a heirachy

quiet depot
#

I recommend the key system

jovial warren
#

if I was gonna write a key system, how would you recommend I do it? same way things like ConfigMe and your key system work (PAPI 3)?

#

where you just have a class of constants filled with key objects that store values

#

I guess that's the general idea

steel heart
#

Doesn't lp work with pseudo enums or smtng

quiet depot
#

papi 3's key system is very complicated

#

but yeah

jovial warren
#

LuckPerms has some factory system that can create keys in a sort of declarative way

quiet depot
#

papi does too

#

I didn't even know lp used keys

#

I took inspiration of keys from sponge, but the key impl I made was completely unique to papi

steel heart
#

It's quite frankly smooth, implemented something along those lines as well 🙂

jovial warren
quiet depot
#

no

jovial warren
#

or does it use it's own built-in system

steel heart
#

sponge api solely probs

quiet depot
#

I didn't realise you were talking about configs

#

sponge uses keys in it's actual api

#

although not to the extent papi does

jovial warren
#

ah okay

quiet depot
#

sponge has a mix of keys & getters

#

whereas papi is basically just keys

jovial warren
#

what's the difference there? like what's the purpose of a key over a getter?

quiet depot
#

more concise

prisma wave
#

when you say configs do you just mean simple stuff? Because object mapping is always nice

quiet depot
#

it's smaller

#

that's the benefit

steel heart
#

Piggy is your impl open source?

jovial warren
#

I mean like full YAML, JSON, etc. kinda configs

quiet depot
#

no but i'm happy to add you

jovial warren
quiet depot
#

what's your github

steel heart
#

Conclure

#

😄

prisma wave
#

Well gson has object mapping

stuck harbor
#

nice

prisma wave
#

Where you just pass a class

#

Rather than bukkit's horrible serialization method

steel heart
#

wow

prisma wave
#

Which is usually much more convenient

jovial warren
#

how exactly does Bukkit's method work btw?

steel heart
#

did u just insult md5s glorifying api

regal gale
#

Lmao

quiet depot
#

wym bukkit's method?

jovial warren
#

also, if you think the Bukkit config API is bad, try looking at Bungee's lol

#

Bungee's config API is kinda what sparked the idea of making this system in the first place

quiet depot
#

btw for configs specifically

#

I use objects

steel heart
#

Piggy I'm allowed to pr and all that or do you just want me to spectate rather?

quiet depot
#

which I think bm already mentioned

#

you can pr if you'd like conclure

jovial warren
#

what = object mappings?

stuck harbor
#

it's funny, me reading this, when I just give the data to gson and tell it to deal with it

steel heart
#

okay nice (:

jovial warren
#

you talking about how in Gson, you can convert objects to JSON?

quiet depot
#

conclure the reason it's private is so people don't suggest things that are already planned

#

and so people don't start writing code for a pr when someone else is already working on it

steel heart
#

oh yeah touché

quiet depot
#

so just keep that in mind

#

if you pr something, don't expect it to be used

steel heart
#

ofc

jovial warren
#

my idea for this library is to have as little verbosity as possible

steel heart
#

sounds like a kotlin karen

prisma wave
#

Without hardcoding any strings

jovial warren
#

I swear that's just called serialisation

prisma wave
#

Pretty much

quiet depot
#

gson doesn't just convert to json btw

prisma wave
#

Well it depends

jovial warren
#

turning objects into strings is serialisation

old wyvern
#

It can also convert it to just a map I think

quiet depot
#

indeed yugi

#

d;gson gson#tojsontree

ruby craterBOT
#
public JsonElement toJsonTree(java.lang.Object src, java.lang.reflect.Type typeOfSrc)```
Description:

This method serializes the specified object, including those of generic types, into its equivalent representation as a tree of JsonElements. This method must be used if the specified object is a generic type. For non-generic objects, use toJsonTree(Object) instead.

Parameters:

src - the object for which JSON representation is to be created
typeOfSrc - The specific genericized type of src. You can obtain this type by using the TypeToken class. For example, to get the type for Collection<Foo>, you should use: Type typeOfSrc = new TypeToken<Collection<Foo>>(){}.getType();

Returns:

Json representation of src

old wyvern
#

ah

jovial warren
#

I kinda want this system to work with any format that can be represented as a Map<K, V> object

prisma wave
#

Yeah object mapping is turning an object to a map, serialization is turning that map into writable bytes (I guess)

stuck harbor
#

I remember when I used to store data in a yaml

#

all of the data

#

every bit of it

prisma wave
#

"how to save player data in config.yml"

stuck harbor
#

well I would make a data.yml ofc

old wyvern
#

I remember when I had a 1 column mysql table

#

🙂

stuck harbor
#

I'm not insane

old wyvern
#

Actually I might still have it

#

one sec

jovial warren
#

Iridium Skyblock for example just stores the old JSON data in a single column in an SQL table

#

talk about laziness lol

stuck harbor
#

wowzers

old wyvern
#

Some old tor nodes

stuck harbor
#

jesus

jovial warren
#

Tor nodes?

stuck harbor
#

tor

jovial warren
#

nice

old wyvern
#

exit nodes

stuck harbor
#

mmm

jovial warren
#

ooo exit nodes

old wyvern
#

just scraped data for a hackathon

#

xD

jovial warren
#

I run a few of those

stuck harbor
#

the one who controls the exit nodes controls the world

jovial warren
#

all 3 still running smooth somehow lol

old wyvern
#

I also have a table with a lot of info on doctors registered in india in 2001 for some reason

jovial warren
#

lol

stuck harbor
#

wot

prisma wave
old wyvern
jovial warren
#

not gonna ask questions

old wyvern
#

Another hackathon xD

stuck harbor
#

am I the only one who finds hacking really boring?

jovial warren
#

anyway, about my key system, I want this to be as fast and as lightweight as possible as well

old wyvern
#

its not hacking iwan

stuck harbor
#

well ya know what I mean

jovial warren
#

though fast and lightweight don't always go together lol

old wyvern
#

hackathon are about building a application in a small time period

stuck harbor
#

infiltrating computer systems

old wyvern
#

not about literal hacking

stuck harbor
#

ah

#

should be called bodgeathons tbh

jovial warren
#

if you wanna learn how to be a pro haxor, check out Hack The Box

stuck harbor
#

1337 h@xx0r

#

or whatever it is in leetcode

old wyvern
#

For that data I just had to go through a registration website that provided some info about doctor registrations, run through its source to get the api endpoint and just request and cache data from there

stuck harbor
#

very nice

old wyvern
#

The mobile app could then request for info of any doctor by sending a request to the server applet which handles the internal querying

#

Altho I didnt save everything because after just loading up 1 year, its seems theres a LOT of data to be stored xD

stuck harbor
#

did ya tell them?

old wyvern
#

Tell whom?

stuck harbor
#

uh

#

what do you mean tell whom

old wyvern
#

did ya tell them?

stuck harbor
#

who do ya think I mean

old wyvern
#

No idea?

stuck harbor
#

well you take data from somewhere

old wyvern
#

Yea one of the endpoints from the indian medical council register

#

It lists by year and banned doctors and stuff

#

But nothing more

stuck harbor
#

so did you tell the Indian median council?

old wyvern
#

For what?

stuck harbor
#

cause you gained access to their systems

old wyvern
#

I did not?

stuck harbor
#

and someone malicious may do so

#

wot

old wyvern
#

It was public

stuck harbor
#

ahhhh

#

so you just got it ALL from the public system

#

I get ya now

old wyvern
#

Kinda

#

Im not fully sure if that endpoint is supposed to be public

#

🤷

stuck harbor
#

hm well that's fun

old wyvern
#

I guess it could be, but who knows

stuck harbor
#

man I hate frontend development

#

backend is where its at

old wyvern
#

Our task or problem statement was about verifying medical info or something like that

stuck harbor
#

mmm

old wyvern
#

So our project was to like verify doctors, as in you can check if someone is actually a doctor, what they actually studied, whether they have been banned from medical practice...ect..

stuck harbor
#

mhm makes sense

obtuse gale
#

is there a way so i dont have to put my navbar in all my html pages?

steel heart
#

just have one in every paragraph

#

ez navigation

jovial warren
#

anyone here ever suffer from lack of idea syndrome? like you really want to make something but you can't ever think of something

#

I wanna know if this is common amongst developers

steel heart
#

it is

#

thats why I hired a brainstormer

distant sun
#

yes @jovial warren

#

it is also called laziness

jovial warren
#

I also tend to overthink things, and try and build elaborate systems and stuff that I don't need, and then wonder why I can't make it because I have no idea what to do with it

obtuse gale
#

So ive got a background that goes behind white text, however on phone the background doesnt go low enough and the text is just invisible because its white, whats my best option to do here?

steel heart
#

BoomerBardy why not make minecraft in kotlin

jovial warren
#

there's no need for it

distant sun
#

I feel ya bombardy lol

steel heart
#

u usre?

jovial warren
#

and if there's no need for it, I don't have any motivation to do it

steel heart
#

okay fair enough

#

I just remake every plugin on spigot rn

#

quite depressing but ye

jovial warren
#

I always seem to waste my time making things that don't even get used, have been made before, or just aren't that good, and it just makes me think "what's the point?"

steel heart
#

There doesn't have to be a point

jovial warren
#

yeah I know, but without a purpose, I struggle to find motivation

#

you know what I mean?

steel heart
#

ye

#

I mean I make stuff either for cash or cuz it's fun

jovial warren
#

I don't even have the motivation to make things when I'm getting paid for them

steel heart
#

Sounds tragic

jovial warren
#

that's why I've never stuck around when I've been hired for commission-based development teams

steel heart
#

I have been in the same scenario

jovial warren
#

the last one I was in, the project I was doing got me so demotivated that I just lost all motivation for programming and quit

steel heart
#

I think a motivation factor is challenges

#

oof

old wyvern
#

The issue is common to humans in general bard

#

We are impatient

#

we seek immediate happiness

#

If the project takes too long you lose interest

#

best thing to do is build a prototype as fast as you can

#

Then improve parts

#

And then rewrite

jovial warren
#

you're right

#

and I know you're right because every single one of my projects that is on my GitHub right now that's actually been somewhat completed (no such thing as completion, but I count working as at least somewhat there) has followed that principle

old wyvern
#

😂

steel heart
#

I don't get how the guy that made Spring kept his motivation

old wyvern
jovial warren
old wyvern
#

the other pages would only contain the other "content" part of your page tho in this case

distant sun
#

to do that you have to go past "made something that worked", bb

jovial warren
#

true