#help-development

1 messages Β· Page 237 of 1

echo basalt
#

I'm from portugal, there are only like 3 developers out here

#

me, magma

wet breach
#

his GF is in Germany

echo basalt
#

and like that one guy that asks for help once in a while

echo basalt
#

germany and netherlands

vagrant stratus
#

Youtuber actually

wet breach
#

ah even better

#

through youtube

echo basalt
#

I do work for youtubers sometimes but still

#

idk it's weird

#

I already have my life planned out to be like

#

single and lonely

tardy delta
#

thats the spirit

wet breach
#

just get a bunch of cats

vagrant stratus
echo basalt
#

game plan

tardy delta
#

become an old cat lady

echo basalt
#

pretty much

tardy delta
#

expect its a cat man

#

sounds like batman

echo basalt
#

A friend of mine brought me dinner the other day and I thought about it all night

tardy delta
#

:o

echo basalt
#

homemade chicken that her mom made

wet breach
#

well you can't expect life to come to you

#

sometimes you have to go to it

tardy delta
#

oh it was a her

echo basalt
#

yes

#

it was a her

echo basalt
#

the other 3 are for sleep

wet breach
#

then what is the issue lol

echo basalt
#

regardless gtg

wet breach
#

well cya later then

echo basalt
wet breach
#

can always ask your friend out πŸ˜‰

echo basalt
#

tiny problem I'm a minor and she's like 6 years older

wet breach
echo basalt
#

few more months hehehe

wet breach
#

there you go

echo basalt
#

kissed her mom once, was fun

#

anyways I'm out

tardy delta
#

wait ur a minor

#

did not expect that

wet breach
#

kissing isn't illegal ironically

tardy delta
#

people younger than me writing better code than me πŸ’€

river oracle
#

Ur just bad

dry forum
#
            section.set("facing", String.valueOf(bmeta.getFacing()));``` ```Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftRotatable cannot be cast to class org.bukkit.block.data.Directional``` how can i get the direction a block is facing
echo basalt
#

Been making plugins for 6 years

#

Coding for 11

wet breach
echo basalt
#

I wouldn't judge you

tardy delta
#

dedication

river oracle
#

Wtf bro I been coding for only 2 years

#

Idk how yall started so young

tardy delta
#

ive been coding like uhh 3years lol

wet breach
#

21 years I been coding πŸ˜‚

tardy delta
#

and doing some informatics stuff the year before

remote swallow
#

ive been coding like 6 months lmfao

echo basalt
#

Boomer

river oracle
#

I thought I was starting young at 15 lol

wet breach
#

lol

quaint mantle
#

how do people have the patience for coding in elementary school πŸ’€

river oracle
#

Coding isn't frustrating in any sense

#

So y9u don't really need patience

wet breach
quaint mantle
#

was for me when I first started

quaint mantle
#

Idk

quiet ice
torn shuttle
#

man I'd forgotten how much javascript sucks

echo basalt
tardy delta
#

cuties

torn shuttle
river oracle
echo basalt
torn shuttle
#

every time I try to look something up the answer is in an 11 year old jquery format

echo basalt
#

I'm living life with what I got

torn shuttle
#

that must really suck

#

can't relate

tardy delta
river oracle
#

Sadge

#

Out of index errors :*

quiet ice
torn shuttle
#

I'm learning javascript because I hate myself

quiet ice
#

These days I cannot play minecraft anymore, which is just sad

torn shuttle
#

well tbf at this point it's not really learning but still

river oracle
tardy delta
#

aight my debugging broke it, idk if this is correct lol

#

ah i expected it to be 6.6

quiet ice
tardy delta
#

jit be like: i got a 30Β΅s for you the 2nd run

opal juniper
river oracle
#

I just can't believe I used python properly to start instead of being a dumbass and tryna make a game or something

quiet ice
opal juniper
#

fair enough

river oracle
#

I need to make money doing this shit tho. My code sucks so I never wanna post a plugin on spigot lmao

#

I'm surprised a server had hired me during the summer

quaint mantle
river oracle
#

My exception is I can play heavily modded minecraft

#

But it has to be with friends

quiet ice
#

I always end up depending on paper or doing some cursed shit like working with ASM and sun.misc.Unsafe which is why I rarely upload to spigot

river oracle
#

What Is ASM

quiet ice
#

Bytecode editing lib

river oracle
#

Is that just another memory management thing like unsafe

quaint mantle
#

Nothing you would want to use unless you hate yourself

river oracle
#

Ahhh

river oracle
#

Is unsafe a huge security vulnerability

torn shuttle
#

unsafe is a way of life

wet breach
#

depends

echo basalt
#

I wouldn't say so

wet breach
#

for the most part no

#

but you can do a lot with unsafe however

#

that isn't normally allowed lol

river oracle
#

I tbh want to change a private static final field for something in nms xD was curious

quiet ice
#

Allocing objects without running the constructor is nice

quiet ice
torn shuttle
#

some people say it's unsafe to do 100mph in a school crossing, I say life is full of small speedbumps and that's never stopped me before

tardy delta
#

Unsafe::allocateInstance uwu

river oracle
glossy venture
#

cant use it now

quiet ice
#

You still can

glossy venture
#

at least didnt work for me

#

how

quiet ice
#

Like always?

wet breach
#

there are other ways to do things other then just using unsafe

glossy venture
#

unsafe best and fastest and coolest

wet breach
#

you could for example do quite a bit that is unsafe by using JNI

river oracle
#

What's JNI

glossy venture
#

jni calls are slow though and unsafe is built in so no weird dll loading

tardy delta
#

got so much jvm crashes whilst using unsafe

quiet ice
river oracle
#

Ahh interesting

glossy venture
#

can you set final fields with unsafe

#

bet you can

river oracle
#

I'm about to get up and do some stupid shit with unsafe

glossy venture
#

field offset

river oracle
#

Yes

tardy delta
#

ye

glossy venture
#

sick

tardy delta
#

never used it tho

river oracle
#

Time to return to my nms adventures and get to do some stuff I previously couldn't

wet breach
river oracle
wet breach
#

Java native interface

river oracle
#

I'll have to do more research haven't heard of that

#

Must live under a rock

wet breach
#

its for accessing native code stuff

#

like dll's for example

echo basalt
#

JNI lets you run C++ code directly

#

Useful for extreme performance

torn shuttle
#

and extreme bricking!

wet breach
#

there is also JNA as well

echo basalt
wet breach
#

then you have JNR

tardy flame
#

Life is hard and we will die

wet breach
#

JNA and JNR happen on the java layer

#

JNI happens outside of the Java layer

torn shuttle
wet breach
#

JNA uses reflection to call native methods, JNR creates bytecode in runtime only once, so JNR is faster then JNA but they both have their uses

#

starting with Java 18

#

we finally got FFI

#

FFI = Foreign Function Interface

#

@river oracle yeah you got plenty to research on πŸ˜›

dry forum
#
            section.set("facing", String.valueOf(bmeta.getFacing()));```
 
```Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftRotatable cannot be cast to class org.bukkit.block.data.Directional``` how can i get the direction a block is facing
torn shuttle
wet breach
# torn shuttle what's that for, calling functions that don't exist?
    Interacting with legacy apps
    Accessing features not available in the language
    Using native libraries
    Accessing functions or programs on the host OS
    Multi-precision arithmetic, Matrix multiplications
    GPU and CPU offloading (Cuda, OpenCL, OpenGL, Vulcan, DirectX, and so on)
    Deep learning (Tensorflow, cuDNN, Blas, and so on)
    OpenSSL, V8, and many more
river oracle
#

Interesting read

dry forum
#

?

#

huh?

runic minnow
#

Hello, does anyone know how the player.sendMap() function is used, what its purpose is?

remote swallow
runic minnow
#

it's dont working i tried

#

does anyone knowwwwwww

warm token
undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

sterile token
#

Its posible to do a instanceof while working with generics params?

bronze fox
#

how do i create a wait in beetwen here ```java
creeper.setPowered(true);

        creeper.explode();```
tardy delta
#

no

sterile token
tardy delta
#

yes

undone axleBOT
tardy delta
#

thats why people usually pass in a class as constructor param

remote swallow
#

#runTaskLater

bronze fox
#

but i want it to wait in a event

sterile token
# tardy delta thats why people usually pass in a class as constructor param

Okay, so i will have to see how i can do that tho, because of how my command api will works you will have:

  1. An abstract class Command<C extends Node> - Where i need to have a method to get the node provider
  2. Node contains common getters for each command node getName(), getAliases(), etc
  3. Finally 2 implementations for the node class BukkitCommand and BukkitArgument
tardy delta
#

and whats a node provider

remote swallow
bronze fox
#

can you give an example on my code

sterile token
#

But i realize it was a stupid question

tardy delta
#

i guess a command holds a node field

remote swallow
#
creeper.setPowered(true);
Bukkit.getScheulder().runTaskTimer(pluginInstance, () -> { creeper.explode(); }, delayInTicks);
tardy delta
#

just check instanceof on that

sterile token
tardy delta
#

creeper::explode

sterile token
#

Are u free?

#

I can share code if you wish

remote swallow
#

delayInTicks

#

20 ticks = 1 second

bronze fox
#

ahh nice thanks

tardy delta
#

yes

sterile token
#

Fourten this is node class

bronze fox
#

isi t still bukkit if i use paper

#

Bukkit.getScheulder().runTaskTimer(pluginInstance, () -> { creeper.explode(); }, delayInTicks);

#

this

remote swallow
#

yes

bronze fox
#

but

wet breach
bronze fox
#

after

#

this

#

Bukkit.getScheulder().runTaskTimer(pluginInstance, () -> { creeper.explode(); }, delayInTicks);

#

all code after this

remote swallow
#

paper is a fork of spigot, spigot is a fork of bukkit

bronze fox
#

Bukkit.getScheulder().runTaskTimer(pluginInstance, () -> { creeper.explode(); }, delayInTicks);

wet breach
#

but paper is far removed though from being bukkit in my opinion since they change quite a bit

bronze fox
#

will it run after the explode

remote swallow
#

the delayInTick is the delay before it runs

bronze fox
#

yeah but

eternal oxide
#

runTaskTimer takes both a delay and repeat ticks as it's a repeating task

bronze fox
#

all code after Bukkit.getScheulder().runTaskTimer(pluginInstance, () -> { creeper.explode(); }, delayInTicks);

#

will the code run after this has ran Bukkit.getScheulder().runTaskTimer(pluginInstance, () -> { creeper.explode(); }, delayInTicks);

remote swallow
#

proves how much my brain is working

bronze fox
#

do you ubderstand

eternal oxide
#

runTaskLater is what you want

remote swallow
#

^^

bronze fox
#

ok

#

and how do i use that

#

but does this still work

#

Bukkit.getScheulder().runTaskTimer(pluginInstance, () -> { creeper.explode(); }, delayInTicks);

remote swallow
#
Bukkit.getScheulder().runTaskLater(pluginInstance, () -> { 
creeper.explode();
// THIS CODE WILL RUN AFTER THE DelayInTicks
}, delayInTicks);
bronze fox
#

ohh

#

i under stand

#

understand*

#
  symbol:   variable pluginInstance
  location: class me.zittexx.coolessentails.events.eventthing```
#

i get this

#

and this

#
  symbol:   variable Bukkit
  location: class me.zittexx.coolessentails.events.eventthing```
undone axleBOT
bronze fox
#

when i build

undone axleBOT
eternal oxide
#

Build using Maven?

bronze fox
#

yes

eternal oxide
#

Then move your imported jars to your pom, don;t import jars to your project

#

add dependencies to pom

bronze fox
#

yeah but why does it give me that

eternal oxide
#

because maven knows nothign about manually imported jars

bronze fox
#

it doesn't undrestand "bukkit"

#

this

#
            Creeper creeper = (Creeper) event.getEntity();
            creeper.setPowered(true);
            creeper.setVelocity(new Vector(0, 1, 0));
            Bukkit.getScheulder().runTaskTimer(pluginInstance, () -> { creeper.explode(); }, 10);```
remote swallow
#

does it have the imports too

bronze fox
#

imports?

wet breach
#

obviously someone doesn't like reading

bronze fox
#

plugininstantce

#

is that the class

remote swallow
#

?di

undone axleBOT
remote swallow
bronze fox
#

yes

#

"import class"

remote swallow
#

click it

bronze fox
#

k

#

know it cant understand getchudler and plugin intance

#

getshuelder

#

cant spell it lmao

remote swallow
#

lol

#

change getScheulder to getScheduler

bronze fox
#

now its run task

#

timer

#

that is "red"

remote swallow
#

change runTaskTimer to runTaskLater

bronze fox
#

now

#

final red

#

and its

remote swallow
#

plugininstance?

bronze fox
#

drum roll

#

yes

#

lol

remote swallow
#

one sec

#

public class MyClassName implements Listener {
    private final MainClassName plugin;

    public MyClassName(MainClassNme plugin) { 
      this.plugin = plugin;
    }
}

and on the constructer change it to new MyClassName(this)

bronze fox
#

what

remote swallow
#

?paste ur class

undone axleBOT
bronze fox
tardy delta
#

might aswell learn some basic java

bronze fox
#

thats what im tryna do

round finch
#

?di

undone axleBOT
remote swallow
#
public class eventthing implements Listener {
    private final YourMainClassName plugin;

    public eventthing(YourMainClassName plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void creaturespawn(CreatureSpawnEvent event) {
        if(event.getEntityType() == EntityType.CREEPER) {
            Creeper creeper = (Creeper) event.getEntity();
            creeper.setPowered(true);
            creeper.setVelocity(new Vector(0, 1, 0));
            Bukkit.getScheduler().runTaskLater(plugin, () -> { creeper.explode(); }, 10);

        }

    }
}
#

on ur main class change the constructer to eventthing(this)

#

so in full getServer().getPluginManager().registerEvents(new eventthing(this), this);

remote swallow
#

that too

sterile token
#

Fourten, Im doing all this shity and dirty things cuz how i want to implement the execution system, im wondering to command executor or argument, contain the same method for creation. Something like the followed example

// Basic command creation
public class TestCommand extends Command<BukkitCommand> {

  public TestCommand() {
    super(name, aliases, permission, usage, description):
  }

  public boolean execute(CommandSender sender, String[] args) {
    return true;
  }
}

public class FactionList extends Command<BukkitArgument> {

  public TestCommand() {
    super(name, aliases, permission, usage, description):
  }

  public boolean execute(CommandSender sender, String[] args) {
    getHandler().
    return true;
  }
}


// Command library initialization
CommandLibrary command = new CommandLibrary(plugin);

// Basic command registration
command.register(new TestCommand());

// Command executor registration
CommandNode faction = command.register("faction").permission("faction.command").description("Faction command");
faction.getArguments().register(new FactionList());

bronze fox
sterile token
remote swallow
#

i typed 0 instead of )

round finch
#

you need the main class instance

remote swallow
bronze fox
#

i know a little bit

sterile token
# bronze fox not really

So then you have the consequences, if you leant first java and then startng to work with api, you woundt be having this simple things

bronze fox
#

so at plugininstance is that the class or

#

like

remote swallow
bronze fox
#

got it

sterile token
#

Ofc to clarify im not being rude nor what you thinking just to say, because you mustnt be coding using an api or library withut having the language knowledge

wet breach
sterile token
bronze fox
#

i know need to learn it and you definitely not rude

sterile token
#

If i had to do that i would clarify ignore him

remote swallow
#

lmfao

round finch
#

writting with java not knowing java hehe

sterile token
#

I would just ignore him because i definitly not patient

bronze fox
#

who

sterile token
#

Also its stupid to code something without learning the lang where you are coding 🀑 πŸ’€

bronze fox
#

but the plugininstance

#

is red

round finch
#

you pass your main class cause it extends the JavaPlugin

remote swallow
#

you havent copied what i sent then

bronze fox
#

ohh

remote swallow
#

copy all but the imports chaning YourMainClassName for your main class name

sterile token
remote swallow
#

most deffo a

#

?learnjava!

undone axleBOT
sterile token
#

Lmao my patient went to flor and i dont want to swear

sterile token
bronze fox
#

thanks

#

why

round finch
#

that is a bit hash lol

sterile token
#

I think spigot must ban every user asking for support which they dont even know java

bronze fox
#

true

sterile token
#

Or atleast make a fkg rule with that because there lot of that type guys which are really ass--hole

#

🀣

bronze fox
#

true

round finch
#

i guess i gotta ban myself for not knowing the whole java api

sterile token
#

Idk what u are saying tho

#

πŸ˜‚

round finch
#

joking ofc

sterile token
#

Because i dont seeing he his msgs anymore since 5m ago

round finch
#

failing to know basic java is a big oof

sterile token
round finch
#

Extreme >:) <3

glossy venture
#

which is usually the reason why you would use unsafe

round finch
#

then they tell you to pass a java class

glossy venture
#

or an alternative

round finch
#

and idk how

#

we need ?BackToBasic

#

πŸ”₯ πŸ”₯ πŸ”₯

remote swallow
#

i should have di stuff copied somewhere

#

because people dont read the link on ?di

wet breach
glossy venture
#

whats ffi

#

foreign function i

#

?

wet breach
#

yes

glossy venture
#

ahats the i

wet breach
#

interface

glossy venture
#

ah

round finch
#

common mistake i see people do

  • being lazy
  • not listening to help
  • can't be bothered anyway
  • not knowing what they're trying to do
glossy venture
#

as a primitive

wet breach
#

you can't do everything from unsafe either

glossy venture
#

its in hotspot/shared/prims/

#

nah thats true

#

but things like quickly getting fields

tardy delta
#

went eating

glossy venture
#

might be useful for things like fast serialization

wet breach
glossy venture
#

if you have one time get but a lot of querying

#

like a serialization thing

#

where you cache the fields in a map

#

their offsets at least

#

and then get with unsafe

wet breach
#

what I mean is, like if you have the ability to obtain the fields before it enters the JVM then that is going to be quicker then waiting on it to be loaded first

glossy venture
#

wdym

#

and how and where would that be usdd

#

used

wet breach
#

if the class hasn't been loaded yet, then accessing the jar outside of the JVM is going to be faster

glossy venture
#

no reading the class file will be way slower

#

and this is for setting fields

#

has to be loades

wet breach
#

if you have to wait for it to be semi loaded but not initialized, then using unsafe is faster

wet breach
glossy venture
lavish wing
#

Hey guys can someone help me?
Why player with nick "MCSTORM_IO" can join?

    @EventHandler
    public void onPlayerJoin(PlayerLoginEvent e) {
        String p = e.getPlayer().getName();
        if (p.startsWith("MCSTORM")) {
            log.warning("Attack Detected.Blocking...");
            e.setKickMessage("Connection Refused.Attack Detected.");

        }
    }
wet breach
#

the point is, it depends at what point in time you are needing to do something

#

which dictates what you should use

tardy delta
#

cuz you arent kicking the player

remote swallow
#

oh yeah

#

isnt there a PlayerPreLoginEvent

tardy delta
#

yes

#

theres no player object available there

#

only uuid

#

asyncprelogin tho, sync is deprecated iirc

lavish wing
#

Using PlayerPreLoginEvent the error is the same

wet breach
#

what error?

#

you never specified an error

glossy venture
#

all the fields

#

the object class is loaded anyways

remote swallow
lavish wing
#

But its same

remote swallow
#

you arent kicking them otherwise

#

?paste the error you get

undone axleBOT
remote swallow
#

oh i know the reason

#

event.getPlayer().kickPlayer(kickMessage)

lavish wing
remote swallow
shell trench
#

I try to get the x cordinate the player is standing on.
I'm using this code to achieve it:
Math.floor(player.getLocation().getX()))

But it somehow acts as Math.round().
All numbers between .1 and .5 round down and all numbers betwwen .5 and .0 round up.

Math.floor shoul always round down.
What is the problem here?

lavish wing
remote swallow
#

offline mode?

lavish wing
#

But my code was like this:

PLayer p = e.getPlayer
if(p.getName.startswith("MCSTORM")) {
  p.kickPlayer(msg)
}
wet breach
remote swallow
wet breach
#

for example, if the object doesn't need to be Java serialized, you can make use of anything else that isn't JDK and it most likely be more efficient

remote swallow
#
Player p = event.getPlayer();
if (p.getName().startsWith("STRING") p.kickPlayer(msg);
#

e.getName returns the event name irrc

#

iirc

tardy delta
#

for when was pattern matching with null a thing again?

lavish wing
#

Not e.getName

#

It was p.getName

river oracle
#

Does anyone have an example on how to add modeldata in a resource pack

#

nvm

river oracle
#

meant the json xD

#

but thanks for the help πŸ‘πŸ½

#

I figured it out

round finch
#

bruh

river oracle
#
    "overrides": [
        {"predicate": {"custom_model_data":9801001}, "model": "btscrolls:item/teleport_new"},
        {"predicate": {"custom_model_data":9801002}, "model": "btscrolls:item/teleport_used"},
        {"predicate": {"custom_model_data":9801003}, "model": "btscrolls:item/instant_teleport_new"},
        {"predicate": {"custom_model_data":9801004}, "model": "btscrolls:item/instant_teleport_used"}
    ]```
round finch
#

just setTexturepack

river oracle
#

dude I don't think you even know what I'm talking about

topaz kettle
#

I'm trying to figure out the same thing

round finch
#

Custom model json is part of the texturepack lmao

twilit roost
#

Dumb me thought its equivalent of Math.pow but it seems it just adds up

Is there some equivalent of Math.pow?
Which is short?

river oracle
#

puts the json out nice

lavish wing
# remote swallow e.getName returns the event name irrc
    public void onPlayerJoin(PlayerJoinEvent e) {
        Player p = e.getPlayer();
        if (p.getName().contains("MCSTORM")) {
            log.warning("Attack Detected.Blocking...");
            e.getPlayer().setHealth(1);
            e.getPlayer().kickPlayer(ChatColor.RED + "Π’Ρ‹ Π±Ρ‹Π»ΠΈ Π·Π°Π±Π»ΠΎΠΊΠΈΡ€ΠΎΠ²Π°Π½Ρ‹ Π·Π° ΠΏΠΎΠΏΡ‹Ρ‚ΠΊΡƒ Π°Ρ‚Π°ΠΊΠΈ сСрвСра." + ChatColor.BLUE + "Если Π²Ρ‹ считаСтС Ρ‡Ρ‚ΠΎ это ошибка, Ρ‚ΠΎ ΠΎΠ±Ρ€Π°Ρ‚ΠΈΡ‚Π΅ΡΡŒ Π² наш дискорд сСрвСр: " + ChatColor.DARK_AQUA + "
");
        }
    }
#

So?Why player can enter?

#

I tried to replace "startswith" with "contains"

tall dragon
#

im pretty sure you need to delay the kick by 1 tick if you're doing it from a join event

remote swallow
#

?scheduling

undone axleBOT
remote swallow
#

#runTaskLater

lavish wing
# remote swallow #runTaskLater
    public void onPlayerJoin(PlayerJoinEvent e) {
        Player p = e.getPlayer();
        if (p.getName().contains("MCSTORM")) {
            log.warning("Attack Detected.Blocking...");
            BukkitScheduler scheduler = Bukkit.getScheduler();
            scheduler.runTask(mainfixer.getInstance(), () -> {
                e.getPlayer().setHealth(1);
                e.getPlayer().kickPlayer(msg);
            });
        }
    }```
Now its right?
remote swallow
#

yeah

#

wait nah

#

runTaskLater

#
            BukkitScheduler scheduler = Bukkit.getScheduler();
            scheduler.runTaskLater(mainfixer.getInstance(), () -> {
                e.getPlayer().setHealth(1);
                e.getPlayer().kickPlayer(msg);
            }, 1);  

lavish wing
#

?

remote swallow
#

that

lavish wing
#

Oh, thx

tardy delta
#

hmm i think i'll do smth like this to handle parentheses

tall dragon
lavish wing
# remote swallow that

It dont work(

[21:39:03 INFO]: UUID of player MCSTORM_IO is a631968e-f991-3021-abc0-029527e906bd
[21:39:04 INFO]: MCSTORM_IO[/127.0.0.1:49611] logged in with entity id 261 at ([world]-175.2017668330055, 69.0, -134.6030753048176)
tall dragon
#

using

    
    private void playerJoin(PlayerLoginEvent e) {
        e.disallow(PlayerLoginEvent.Result.KICK_OTHER, "Kick Message");
    }
tardy delta
#

hmm didnt know IntPredicate s = i -> i != ')' was possible

tardy delta
#

looks a lot cleaner

tall dragon
#

did you even register your event then

lavish wing
#

Wait

tall dragon
#

huh xd

humble tulip
#

If u don't want a player to join, block it from the asyncplayerpreloginevent

tardy delta
tall dragon
tardy delta
#

nah

#

found the issue

humble tulip
#

@tardy delta whay are you doing?

tardy delta
#

expression parser

#

still

#

changed backend

humble tulip
#

Are you making your own?

tardy delta
#

yes

humble tulip
#

WhyπŸ˜‚

#

That's such a pain

tardy delta
#

cuz fun

#

i shouldnt be doing it if it wasnt a pain

tall dragon
#

not fun

#

its pain

tardy delta
#

AHAHA it works

#

had to directly modify the newly created expressions reader

#

optimisation of 20 lines

tall dragon
#

is it fast tho

glossy venture
tardy delta
#

better

#

mans want to see speed

#

sout calls take relatively long lmao

#

if you benchmark it

#

its very jit dependant too

quiet ice
#

To be expected though

tardy delta
#

thats why i turn of debug usually

tall dragon
#

@tardy delta now try 6.5*7.8^2.3 + (3.5^3+7/2)^3 -(5*4/(2-3))*4 + 6.5*7.8^2.3 + (3.5^3+7/2)^3 -(5*4/(2-3))*4 + 6.5*7.8^2.3 + (3.5^3+7/2)^3 -(5*4/(2-3))*4 + 6.5*7.8^2.3 + (3.5^3+7/2)^3 -(5*4/(2-3))*4

quiet ice
#

Well they usually aren't that slow

tardy delta
tardy delta
#

and lemme see if my new impl fixed the parentheses issue

#

looks like its back on track

#

wasnt workin before

glossy venture
#

nice

lavish wing
#

?paste

undone axleBOT
glossy venture
#

ima rewrite my expression parser and interpreter

quiet ice
#

Does anyone know whether the JVM (I'm talking about the generic Java 17 hotspot JVM) allows to extend final classes?

glossy venture
#

its so slow 15 ns per execution

lavish wing
tardy delta
#

there are 1000Β΅s in a nanosecond right?

remote swallow
#

?paste the class

undone axleBOT
lavish wing
#
    public void onPlayerJoin(PlayerLoginEvent e) {
        Player p = e.getPlayer();
        String msg = "";
        if (p.getName().startsWith("MCSTORM")) {
            log.warning("Attack Detected.Blocking...");
            getServer().setWhitelist(true);
            log.warning("Whitelist was enabled!");

            BukkitScheduler scheduler = Bukkit.getScheduler();
            scheduler.runTaskLater(mainfixer.getInstance(), () -> {
                getServer().setWhitelist(false);
                log.warning("Whitelist was disabled!");
            }, 60);

            e.disallow(PlayerLoginEvent.Result.KICK_OTHER, msg);

        }

    }```
tardy delta
#

tf are you even trying

glossy venture
quiet ice
#

Make it easy on yourself and use JavaPlugin.getPlugin(MyPlugin.class) instead of passing the plugin instance around

tall dragon
tardy delta
quiet ice
glossy venture
remote swallow
#

use the AsyncPlayerPreLoginEvent and put the e.disallow in the scheduler

glossy venture
#

when its already a tree

glossy venture
#

so yeah its expected to be fast

pure coral
#
    @Override
    public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command command, @NotNull String s, @NotNull String[] args) {
        Player p = (Player) commandSender;
        p.setDisplayName("Β§c" + p.getName());
        return false;
    }
}```
But when I execute the command nothing happens, and the name over my head is still white?
glossy venture
#

but not fast enough and i completely fucked function call performance

tardy delta
#

my first 1+1 expression takes 11685Β΅s and after jit optimizes it's 68Β΅s

#

my solving algorithmn is slow asf tho

glossy venture
#

jit is epic

remote swallow
tardy delta
#

need to rewrite it

#

jit is weird

pure coral
glossy venture
pure coral
tardy delta
#

i basically loop thro the string, transform it into tokens and later on solve that token chain

quiet ice
#

Alternatively I'll just inject into Material's switchmap which should allow me to register new materials on the fly

glossy venture
#

like 5 = x + 7

tardy delta
#

thats why its slow

glossy venture
#

do you mean evaluate or solve for x

tardy delta
#

this big boy i meanhttps://paste.md-5.net/dekuqobojo.cs

#

TokenList class

glossy venture
#

oh yeah so evaluate

tardy delta
#

its very static now, whenever i want to add method calls it will go brr

glossy venture
#

solving algorithm would be epic

tardy delta
#

im not smart enough to write that

glossy venture
#

that you enter 5 = x + 7 and it returns x = -2

#

shouldnt be too hard if you have an ast

#

but still a pain

tardy delta
#

uhhh

#

yes

#

i really have to get rid of this tho

quiet ice
#

You still gotta redo what's basically over 10 years of maths you learned at school

tardy delta
#

people might just directly instantiate one ig

#

you're right

#

or Expression.parse(String)

glossy venture
#

or whatever theyre called

pure coral
tardy delta
#

im learning about Math.log in college lmao

quiet ice
#

log is nice and all, but ln is the real deal

tardy delta
#

were using some program on our pc to do all the stuff

glossy venture
#

logBASE is epic

tall dragon
#

pretty sure that will be ur name in chat not sure

tardy delta
#

imagine being able to make this

pure coral
#

How can I change the name above my head then?

glossy venture
#

did u know logBASE(x) = logE(x) / logE(BASE) or something like that

tardy delta
#

yes

pure coral
glossy venture
#

saw that on like stackexchange or smth

#

for math

tardy delta
#

i didnt come to lesson lol

#

forgot a bunch already

tall dragon
glossy venture
#

is that ln

quiet ice
#

then ln

tardy delta
#

normal log is 10log but Math.log is e log right

tall dragon
tardy delta
#

its confusing

quiet ice
pure coral
tardy delta
#

well i mean log as you would write it somewhere

quiet ice
#

log is always suffixed by a base, base 10 log is lg

tardy delta
#

assuming base 10

#

hmm

quiet ice
#

It's something a lot of people neglect

tardy delta
#

still wondering where ill need logs for anyways

quiet ice
#

Yeah you can do ln for everything

tall dragon
pure coral
glossy venture
#

its written like log[subscript BASE](x) right

tardy delta
#

2log4 = ln(2)/ln(4) or smth

#

base log x for me

glossy venture
#

the base is in subscript suffixed

quiet ice
#

log a (b) is what it should be iirc

tardy delta
#

we're writing it differently smh

#

makes it more clear when writing it down tho

glossy venture
#

b is base

quiet ice
#

2log(4) would explicitly mean 2 * lg (4) generally

quiet ice
wispy flicker
#

Hey all! gettin into development via code and im following guides and when adding protocol lib as a dependency its showing as not found. is there a reason for this?

tardy delta
#

maven/ gradle?

quiet ice
#

Or Eclipse JDT or IntelliJ artifacts?

tardy delta
#

man already outta here

#

they think we'll tag them

#

uh my math is bad dont question me

quiet ice
#

For b^a = c you can do ln(b) * ln(a) = c

glossy venture
#

ah

wispy flicker
tall dragon
# pure coral 1.19

uhhh pretty sure you will need to send
PacketPlayOutPlayerInfo to remove the player
another PacketPlayOutPlayerInfo to add the player with a different name
then a PacketPlayOutDestroyEntity to all players except the player that's changing his name
then lastly a PacketPlayOutNamedEntitySpawn to all players exept the player changing his name.

though im not sure if it still works like this in 1.19

tardy delta
#

did reload?

quiet ice
tardy delta
wispy flicker
quiet ice
#

Artifact ids should be lowercased generally

quiet ice
wispy flicker
#

as you can see here tho

#

in this guide

#

no issues

remote swallow
#

reload maven

wispy flicker
#

how

remote swallow
quiet ice
wispy flicker
#

ohh

#

i got somewhere

wispy flicker
#

seems to have done it!

wet breach
#

for example, if you need to serialize to XML

wispy flicker
#

thank you so much!

glossy venture
wispy flicker
#

Im quite new to using code for making plugins to be honest.
Is this a good place to get general help with getting stuck?

quiet ice
#

it's the best place to get help yeah

twilit roost
#

Is Async World Generation possible somehow?

wispy flicker
#

had another server and average response was "fix ur sh**** code or learn java

quiet ice
#

Only paper, the forums and the irc (okay that one not really) can rival it

#

Well you'll get these answers too

#

No matter where you are

wispy flicker
#

ye well that was the only answer you got xD

fluid cypress
#

do i need to check if a key exists before doing config.getString or something?

wispy flicker
#

after aboutttt 8 hours of wait

wet breach
wispy flicker
#

should i develop on spigot as opposed to paper? if i make a plugin on paper does it limit users to use paper/forks only?

quiet ice
#

Okay actually, you will very unlikely get the answer in the spigot irc channel

glossy venture
tardy delta
#

?jd-s

undone axleBOT
quiet ice
#

Given that only phoenix and I are active on there and neither of us are particularly keen on shutting down people

glossy venture
#

does it just boom write the raw data from memory with pointers?

quiet ice
wispy flicker
#

oh ok thanks lol

wet breach
glossy venture
#

how do you know the data type

snow wave
#

In cratesplus I don't know what to do or what permission to give so that users can open chests with the keys, it doesn't let them

wet breach
glossy venture
#

also Unsafe has access to jvm internals while JNI probably has also been 'made safe'

wet breach
#

JNI can never be safe

#

anytime you use JNI, you are stepping outside of the JVM

#

therefore the JVM has not a clue what is going on

glossy venture
#

yeah but it probably has some more security code behind the JNI methods

wet breach
#

security code?

#

such as?

glossy venture
#

which then eventually calls jvm internals

remote swallow
glossy venture
#

without the and whatever

wet breach
snow wave
#

Thanks

wet breach
#

that is on you and your native calls to ensure

#

if you want to step outside of the JVM, the JVM stops caring about what you are doing outside of it

wispy flicker
#

What's yalls Go-to guides? i have this really long playlist on YT by Kody Simpson seems to be good idk if theres anything else that wont put a hole in my wallet

tardy delta
#

looking at github

wet breach
wispy flicker
#

i have basic understanding of like how to structure plugins etc and logic behind it its more understanding how to format code and write it out

tardy delta
wet breach
#

some of us don't require guides per-say and are more then happy with working with Documentation as well as just looking at the implementation code

river oracle
#

?paste

undone axleBOT
wet breach
tardy delta
#

its to read a int from a java.nio.CharBuffer

#

i see too much revert() and break

river oracle
#

I have a texture pack for my plugin, but the texture is not displaying it is just displaying the custom texture
i ensured it has the material data

        this.item = ItemBuilder.builder()
                .material(Material.DIAMOND)
                .modelData(1)
                .name(ChatUtil.style("<gradient:ff0000:ff7f00>Crystal of Lava</gradient>"))
                .build().make();

I also ensured it was being applied correctly changes I make that break textures do indeed go through and display so that is also out of the question.
I doubled checked and my ItemBuilder does apply it
https://paste.md-5.net/boyonubopu.coffeescript
the png file is in assets/meliorate/textures/items/lava_crystal.png

Not quite sure why it wouldn't be applying correctly. Not quite sure if its with my code or Json I tried changing the json which I think is right, and nothing happened so I'm a tad confused

wet breach
remote swallow
river oracle
midnight shore
#

Hi, how can i make a point on a line (in my case a raycast) go down until it finds an edge of a block? so that then i can use it as kind of a path? (i tried to show in the photo what i wanted to do)

#

in this case a point is a location

tardy delta
#

and you essentially only had the x >= '0' and x <= '0' check

#

im constructing the read integer tho

tardy delta
#

new TokenReader("123ahdha").readInt() would give 123

opal juniper
midnight shore
#

the one on the ground

#

sorry for my terrible drawing skills

opal juniper
#

errr just raytace, get the block x and z and then use the like getHighestAt thingy

#

ig

wet breach
midnight shore
tardy delta
#

its basically a simple Integer.parseInt

midnight shore
dry forum
#
            section.set("facing", String.valueOf(bmeta.getFacing()));``` ```Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftRotatable cannot be cast to class org.bukkit.block.data.Directional``` im trying to get the rotation of a block
eternal oxide
#

Rotatable and Directional are two different interfaces

wet breach
#

that don't interact with each other

dry forum
#

so im casting to the wrong thing?

wet breach
#

the exception should have made that obvious

eternal oxide
#

instanceof is your friend

wet breach
#

you can't cast to something that doesn't have a relation to one another

midnight shore
wet breach
#

well blocks are only 1meter by 1meter

#

so you could just create your own

#

0-1

#

0.5 being in the middle lol

tardy delta
#

brr im always confused between arr[i++] and arr[++i]

tall dragon
dry forum
#

Caused by: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_19_R1.block.impl.CraftRotatable cannot be cast to class org.bukkit.block.data.Rotatable Rotatable bmeta = (Rotatable) block.getState().getBlockData(); section.set("facing", String.valueOf(bmeta.getRotation()));

midnight shore
tall dragon
#

well u have x, z right

midnight shore
#

yes

#

how can i get the decimals

#

wait

#

if i make it a string

#

and then split from ,

#

will it work?

wet breach
#

you do know you could just use double

midnight shore
#

what do you mean

wet breach
#

an integer is a double without the decimal

midnight shore
#

yes i know

wet breach
#

so....add your new integer to the double that has your offset? and return a double

#

integers and doubles can be added together without anything fancy being needed

midnight shore
#

won't this get me double the coordinates?

wet breach
#

but you do need to return a double to retain the decimal stuff and what not πŸ˜›

vagrant stratus
#

Any real reason/use cases for me to use something like postgres over MySQL or SQLite? πŸ€”

opal juniper
#

SQLite for quick and easy

#

postgres has some cool features

wet breach
#

Postgres is ORDBMS

midnight shore
midnight shore
tall dragon
#

u have x, z so just the Y of the highest block and add them together

#

and u got the location

vagrant stratus
vagrant stratus
#

(not that they use postgres, they use cassandra from the one thing I could find on their backend lmao)

midnight shore
tall dragon
#

no it doesnt?

wet breach
#

there is no transforming or translating the object to something else

tall dragon
#

as long as your original x, z is not in the corner

midnight shore
vagrant stratus
tardy delta
#

i never know when to use what database either

wet breach
#

lol

midnight shore
vagrant stratus
#

I just use SQLite for everything lmao

echo basalt
vagrant stratus
#

One of the jobs I'm looking at has PostgreSQL as one of the Experiences/Skills, but I can't think of any actual use case so I can learn it πŸ˜‚

wet breach
#

SQLite is nice, only problem with it is its only good for small to maybe medium sized stuff

eternal oxide
#

only point between SQLite and others is if you need to access the same data from multiple apps/locations

wet breach
#

since I tend to need MySQL anyways, it is my preferred DB format

vagrant stratus
#
Apache Cassandra is an open source distributed database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure. Cassandra offers robust support for clusters spanning multiple datacenters, with asynchronous masterless replication allowing low latency operations for all clients.
tall dragon
midnight shore
wet breach
#

once the sqlite db hits a certain point you are better off with something like MySQL

round finch
#

me with sql AFkermitpain

tardy delta
#

would i do smth like this?

echo basalt
#

me, making my own format because I don't like well-established solutions

tardy delta
#

including a static method in its own class

echo basalt
#

or just using S3 because my customers are crypto millionaires borpaPointLaff

vagrant stratus
echo basalt
#

discord switched from mongo to cassandra

round finch
#

guess you could make your own storage data base system

tardy delta
#

mongo??

round finch
#

πŸ€”

vagrant stratus
#

Yea, but I don't remember why @echo basalt lol

echo basalt
#

because it wasn't scaling nicely

#

like request times were increasing

vagrant stratus
#
Vishnevskiy, Stanislav (March 29, 2018). "How Discord Stores Billions of Messages". Medium. Archived from the original on June 30, 2020. Retrieved March 28, 2021. Quotes:
"We decided early on to store all chat history forever so users can come back at any time and have their data available on any device.""We setup our code to double read/write to MongoDB and Cassandra." "Since Cassandra is eventually consistent it cannot just delete data immediately." 

https://web.archive.org/web/20200630192338/https://blog.discord.com/how-discord-stores-billions-of-messages-7fa6ec7ee4c7

Medium

Discord continues to grow faster than we expected and so does our user-generated content. With more users comes more chat messages. In…

#

Ig if I were to re-do the old ChatRoom project, I might as well convert it to that & microservices lmao

wet breach
#

wouldn't make sense

opal juniper
#

whats the point

vagrant stratus
#

Well, even if I didn't do anything with it, still gives me experience for something I don't already use like MySQL or SQLite lmao

wet breach
#

you change/scale the project as required. You don't start with things that are only optimal under extreme loads first

#

just because something can handle stuff at the extreme

#

doesn't mean they are optimal at the other end of the spectrum

vagrant stratus
#

Pretty sure it uses SQLite currently lmao

#

Yea it does kek

wet breach
#

well I am just pointing out is all

vagrant stratus
opal juniper
#

whats the point in persisting the messages then

vagrant stratus
#

tbf it was a half-assed project just to learn sockets

wet breach
#

lol

opal juniper
#

sockets are piss easy

#

just sendin data

#

i mean, i wouldnt wanna impl one

vagrant stratus
#

At least point doing it any real serious manner's dumb, so any updates would be for a specific thing, e.g. microservices

opal juniper
#

although i did impl my own QR code generation algorithm

vagrant stratus
#

For retrieving old messages I can just grab all of them for the specific server lmao

wet breach
#

did you at least learn how to use UDP?

#

because for such purposes UDP would excel

vagrant stratus
#

uh, probably not no lol

wet breach
#

one of the major differences between UDP and TCP is that UDP doesn't wait for a response to come back

#

also UDP packets can arrive out of order, but for retrieving old messages this isn't really an issue

eternal oxide
#

it's downside is it has no guaranteed order or delivery with no error checking

vagrant stratus
#

It's a packet based approach using sockets, no idea if it's UDP or TCP lol

wet breach
#

odds are then it was tcp

white root
#

Udp can also suffer from packet loss

wet breach
#

so can TCP

eternal oxide
#

if tcp loses a packet it resends

white root
#

Exactly

wet breach
#

which can be bad if you don't implement a check to stop it

white root
#

So you don't need to worry abt packet loss with TCP

wet breach
#

you do actually

wet breach
#

you don't want something to constantly keep sending something it isn't getting a reply for

white root
# wet breach you do actually

If a packet isn't received, it just gets retransmitted until it does
And if all else fails, and no response is recieves it just disconnects

eternal oxide
#

If you are not getting a response with TCP it's yoru code at fault not TCP

white root
#

(trust me, I manage an anticheat which is entirely packet based)

eternal oxide
#

TCP is fully error corrected. Worst case is it drops the connection

white root
#

+1

wet breach
eternal oxide
#

There is no real way to fail with TCP

wet breach
#

yes there is

eternal oxide
#

I've coded both TCP and UDP client/server

vagrant stratus
#

But yea, I'm sure there's a lot I could do in general to improve it @wet breach but there's just a general lack of caring and no real reason lmao

white root
round finch
#

are hypervisers only for servers?

wet breach
round finch
#

i'm thinking of having one as to switch beteewn os on my Main home pc

eternal oxide
wet breach
#

packet is lost with no response and yes after a bit of time the packet is re-transmitted

eternal oxide
#

It is literally impossible to lose a packet if the connection is still up

wet breach
#

it isn't impossible

eternal oxide
#

ok

round finch
#

it is a virutal os?

#

that what i'm wondering

#

kinda don't wanna do server stuff
just directly running on my pc

white root
wet breach
eternal oxide
#

No there is not

white root
#

No, not really

eternal oxide
#

thats teh whole point of a TCP connection

#

it's FULLY error corrected

wet breach
eternal oxide
#

a black hole will take yoru connection down

round finch
#

lost packets is a real thing

wet breach
eternal oxide
#

as said, If the connection is still up no packet will ever be lost

glossy venture
#

packets can get lost but the confirmation signal will ensure that they are re-sent i think

eternal oxide
#

no it's not]

wet breach
#

you never heard of failing lines? Or faulty lines?

echo basalt
#

It's weird

white root
#

You use TCP when you want to guarantee that data will arrive and will arrive correctly, with the drawback of potentially higher latency
And UDP for when latency is most important and every packet doesn't need to be received
I.e. video calls etc

wet breach
#

error correction wouldn't be a thing if you couldn't lose packets at all

echo basalt
#

I've been studying TCP packets for my upcoming NMS tutorial

white root
eternal oxide
#

TCP error correction requires a confirmation is sent. if no confirmation is received the packet is resent. it will timeout eventually and drop the connection

wet breach
#

no it wouldn't

white root
#

You wouldn't just loose some data then keep continuing on

echo basalt
#

Each packet contains a numerical index on its header

#

And an index of the last received packet

white root
#

Ok you're obv just trolling

round finch
#

Oh so you run a hyperviser then you connect directly to itself

eternal oxide
white root
#

Have fun ig

vagrant stratus
#

I guess if I were to re-do the ChatRoom project, move it to MySQL, microservices, and some half-assed React based UI, yea?

echo basalt
#

TCP resends missing packets, UDP doesn't care and skips all that overhead

wet breach
#

like have you ever messed with switches and border gateways at all?

#

or setup the actual connections

eternal oxide
white root
#

You clearly haven't @wet breach

#

Smh

near citrus
#

hello is there any way possible to get what face of the block the player is looking at?

sterile token
#

That why its recommend to learn Netty instead of swearing with shity raw sockets

wet breach
white root
#

No wonder you had to use the keyword "was" lol
Clearly aren't too knowledgeable about this lol

echo basalt
#

I have a very dumbed down explanation of how TCP works

vagrant stratus
#

I'm not even sure it would be worth learning netty or google protobuf for something like the ChatRoom project lol

eternal oxide
wet breach
sterile token
wet breach
#

according to you error correction means you can correct the data without actually getting the data

eternal oxide
#

Modems, protocols and security authenticators was part of my job at Dowty

vagrant stratus
gray merlin
#

Does anyone have a good resource that explains pdc?

wet breach
#

?pdc

echo basalt
gray merlin
#

lightning fast, awesome response

#

thank you

echo basalt
wet breach
#

or how about when someones cable line runs next to powerlines

midnight shore
#

Hi, i'm trying to use an external source using maven but whenever something calls that class it says this weird error ClassNotFoundException... How can i fix this?

near citrus
#

ok ...

round finch
#

bing it joys

vagrant stratus
#

?bing

undone axleBOT
round finch
#

lol it is real omg XD

eternal oxide
gray merlin
#

Oh this is beautiful.

chrome beacon
midnight shore
gray merlin
#

Does PDC edit the entity's data?

#

is that it?

#

i love it

undone axleBOT
midnight shore
echo basalt
#

PDC like

tardy delta
#

nbt wrapper or smth

wet breach
echo basalt
#

stores all its data inside an nbt tag

#

present in the entity's data

chrome beacon
wet breach
#

the other side isn't going to re-request anything unless it has at minimum received 1 packet

midnight shore
gray merlin
eternal oxide
wet breach
#

but the point I was stating is that, you can lose packets without a response

#

you said it is impossible

round finch
#

imagine storing a whole server in a nbt tag

wet breach
eternal oxide
echo basalt
#

I mean

midnight shore
#

?google

undone axleBOT
wet breach
#

it is possible to lose data

echo basalt
#

technically the connection can drop / timeout

tardy delta
#

hmm anyone who knows what the dif is between ByteBuffer.allocate(int) and ByteBuffer.allocateDirect(int)?

echo basalt
#

while the data is being sent

wet breach
#

if the connection goes down in the middle of transmission the other side will never get the data

eternal oxide
echo basalt
#

but you can't just... not receive a couple packets and go by unnoticed

#

The only way to lose data is by dropping the connection

round finch
echo basalt
#

obviously

wet breach
echo basalt
#

Y'all 2 are just talking on different wavelengths

wet breach
#

you never know what might change

echo basalt
#

Also open a thread for this :)

eternal oxide
#

Sorry frost you are plainly and 100% wrong in this. I've been writing code for TCP/UDP for 40+ years.

wet breach
#

please let me know you can transmit data through a firewall that suddenly decides to filter your packet out

#

you control all the transmission points correct?

eternal oxide
#

Yeah, discussion is over, you will not listen

twin venture
#

i tried , .equals , same code not work

white root
#

If the packet got filtered out
The sending computer would not recoece an ack for that packet
Then the sending computer would retransmit
If it still doesn't get a response, it'll disconnect