#help-development

1 messages ยท Page 347 of 1

quiet ice
#

What is your issue then?

orchid gazelle
#

the direction multiplied by 5 as a base-value and then adding a part of the "size" of my multiblock

charred blaze
#

yes i have it

#

what

quiet ice
#

I thought you were to create a new instance of your javaplugin

wet breach
#

sorry if I don't understand

charred blaze
#

what do i do?

quiet ice
#

Nothing.

wet breach
#

?di

undone axleBOT
quiet ice
#

The person complaining about your api design is likely stupid.

orchid gazelle
charred blaze
mortal hare
#

and what's stopping your from accessing the method names

#

just pass instance and use it

quiet ice
#

I've seen so many people doing absolutely horrendous API that I can trust none but myself when it comes to that matter

charred blaze
#

so can i get back static keyword for methods?

wet breach
quiet ice
wet breach
#

there is a link above for you

quiet ice
#

Still.

#

If you were indeed using static for everything chances are your new system is indeed better

wet breach
# quiet ice Still.

I am not against statics, just against using statics for non-appropriate reasons lol

orchid gazelle
quiet ice
#

If it is not appropriate you shouldn't be using it

#

It's best to learn to not use static overly often.

#

that being said you shouldn't develop around the concept of never using static (or any other keyword), which is the point I made initially

wet breach
# charred blaze but i needed it

you only needed it because you didn't learn how to properly access classes from other classes. So to you, yes you believe you need it, but reality is no you didn't need it and shouldn't have been using it.

#

And as geol said I am not advocating in never using statics

#

just advocating you should be using statics properly. The way you were using them is not proper usage for them

#

and causes more problems then they solve

quiet ice
#

In the long run you cannot use static for everything, even if you wanted to.

austere cove
#

doesn't stop people from trying

wet breach
orchid gazelle
#

yes

icy beacon
#

i wanted to code this small project in kotlin but instinctively started in java and have pretty much finished the project already... goddammit

kind hatch
icy beacon
#

i want to be versed in multiple languages

#

i love java

orchid gazelle
icy beacon
#

but kotlin is cool too

#

i love the syntax sugar

quiet ice
orchid gazelle
quiet ice
#

Sure, it's good to know the basics but not much beyond

wet breach
# charred blaze but i needed it

don't feel discouraged about getting help here, and while although you didn't receive the kind of help you were expecting. Learning appropriate OOP usage is important, in other words we sometimes have to correct people on learning the basics. Otherwise all our help we give would only be futile, and this way when you do come back after learning that, we can help you a lot better and on the actual problems you have ๐Ÿ™‚

quiet ice
#

?jd-s you probably are using the wrong method for the direction

undone axleBOT
icy beacon
kind hatch
icy beacon
#

i love coding for spigot but i will have to go further someday

#

especially with my wide knowledge of java

orchid gazelle
#

why need kotlin then?

rotund ravine
#

Kotlin is nice.

icy beacon
#

if i have a portfolio of multiple languages i will probably look a bit better

#

and kotlin is nice yeah

orchid gazelle
icy beacon
#

i'll keep coding in java but i wanna get very good at kotlin too

rotund ravine
#

Cause you are ignorant.

icy beacon
#

you do you then

orchid gazelle
wet breach
# icy beacon i mean i wanna build a career someday ๐Ÿ˜„ if i have a portfolio of multiple langu...

its not important on the number of languages you know, rather how proficient you are at using the languages you do know. If all you know is 3 languages but are super proficient at those, you will be a much better candidate for something that you might not really know then someone who does know it but sucks at it. Because you being very proficient means you understand concepts and basics as well as if they were to teach you, you will probably get the hang of it pretty quickly. Thus much better.

orchid gazelle
wet breach
#

if that isn't the case, it really doesn't make a difference of which

orchid gazelle
#

(other than having less support :d)

rotund ravine
#

I mean sure for spigot, but kotlin has a cool native and js thing too.

icy beacon
#

i know java really well so why not learn kotlin now

rotund ravine
#

Ah i see the context now.

orchid gazelle
#

I mean, why not learn an actually different language then?

icy beacon
#

bro i got it you are a kotlin hater

tardy delta
#

just learn C++

icy beacon
#

please stop

#

i want to learn kotlin because it's fun for me

rotund ravine
#

Kotlin is great, offers an easy way to do functional programming too.

orchid gazelle
#

kotlin won't bring you much in your job when you already know java

icy beacon
#

yeah i especially love the extensions to classes

eternal night
orchid gazelle
icy beacon
#

please don't argue about language preferences

eternal night
#

Yes I read the context

icy beacon
#

come on yall know it's personal to each other

#

no need to have this convo that only makes the mood worse when you know your opinion won't change much

orchid gazelle
#

compared to learning another language (For example C++, yes), Kotlin will bring a lot less advantages in future job (applications for example)

tardy delta
#

learn assembly

orchid gazelle
tardy delta
#

and write it in binary when you're bored

austere cove
#

programming in assembly makes me feel like a gigachad tho

tardy delta
#

scriptmanager?

orchid gazelle
wooden osprey
#

how can I check if a block is a block entity?

austere cove
#

I have written a few compilers in assembly for esoteric languages

tardy delta
#

learn bytecode if assembly is too difficult ๐Ÿ™„

eternal night
#

Grab the block state

#

And check if it's a tile state

wooden osprey
#

alr thanks

icy beacon
#

just hit the processor timely for it to have some transistors at 1 and some at 0

wet breach
# orchid gazelle wait u code in assembly? XD

many people do and this is very broad. There is different types of assembly. For example, Java assembly is just working with the bytecodes where as Assembly for CPU instructions is significantly different

quiet ice
#

JVM bytecode is incredibly easy

icy beacon
orchid gazelle
austere cove
#

it just feels so rewarding

orchid gazelle
#

thats just like how I feel when I do something really hacky with nms lmao

icy beacon
#

agree

wet breach
#

I need to find a new bug in MC to make popular

quiet ice
#

Eh, doing something hacky with the sun Unsafe is even more rewarding

icy beacon
#

that's a whole different feeling

orchid gazelle
quiet ice
#

Like transforming bytecode of other plugins by using the sun Unsafe to set the bukkit Unsafe

icy beacon
#

lmao

wet breach
#

that is how holograms started ๐Ÿ™‚

orchid gazelle
austere cove
#

there's a typo in one of the docs, can't remember where but u can pr that :d

wet breach
#

Holograms originally came from the horse age bug. The bug with the horses age was if you set it to a negative value, the horse became invisible but not its name tag

icy beacon
#

bruh

orchid gazelle
tender shard
#

hm?

wet breach
#

And thus HoloAPI and HolographicDisplays was born

wet breach
icy beacon
quiet ice
icy beacon
tender shard
#

but I havent seen the exact question

wet breach
tender shard
#

also it was about proguard, I use the paid version of allatori ๐Ÿฅฒ

icy beacon
#

i basically said that you used obfuscation and maybe you could help

quiet ice
icy beacon
#

but yeah then i remembered you used allatori

tender shard
snow whale
#

Hello, is there any way to check when a entity collides with a block or another entity? (I'm trying to make a custom weapon like hypixel skyblock, where it summons something where the player is looking at, and when it hits a block or a entity something happens, like the entity summoned explodes, but I can't quite figure out the collide part)

wet breach
#

yes

icy beacon
quiet ice
#

fairly sure @tender shard

icy beacon
#

i just brought alex up because he could be relevant

icy beacon
tender shard
#

they only mention skidfuscator and proguard

orchid gazelle
#

yo alex

orchid gazelle
tender shard
#

no, I havent seen your code. looks like you don't take into account that a block position is basically off by 0.5, 0, 0.5 from the "center" position

orchid gazelle
#

Location distBlock = player.getEyeLocation().add(player.getEyeLocation().getDirection().multiply(5 + (selection.depth + selection.width)/4D));

kind hatch
eternal night
#

There is getByChar

#

If you need the enum representation

kind hatch
#

ChatColor#translateAlternateColorCodes()

orchid gazelle
#

and this is insanely annoying in my build-mode

eternal night
#

Center your starting position?

orchid gazelle
#

wdym?

kind hatch
#

Yea, was going to say. You'd have to compensate for the positioning then.

orchid gazelle
orchid gazelle
#

I do not get the idea of compensating that atm

wet breach
#

blocks are only 1x1

#

if you wanted to detect the edge, you only need to have values from 0-1

kind hatch
#

You could probably also do what lynx mentioned. You'd just need to get a centered location first, then work off of that.

wet breach
#

so, if the blocks x is 1, that means on the x axis, the edges are 1.0-1.9

#

but you are only working with 0-1 values, so centering isn't all that hard to do nor is detecting if they are at the edge

#

if they reach .9 or .1 they are at the edge ๐Ÿ™‚

orchid gazelle
#

well if I add 0.5 0.5 0.5 to center it it will be wrong

wet breach
#

you need to normalize

kind hatch
#

Add .5 to your result as well.

halcyon hemlock
#

open the noor

orchid gazelle
#

wait what

#

the result is the final Location

#

I add .5 to x/y/z there, right?

kind hatch
#

If you are working with a centered location, then you'll have to add .5 to your result to compensate. Otherwise, you wouldn't have to and just work with normalized vectors.

orchid gazelle
#

so just normalize the vector

halcyon hemlock
#

adding .5 to the x and z location would make it so you standing right in the middle

orchid gazelle
wooden osprey
#

how can i make an NBT like (for instance) a furnace's slots with PersistentDataContainer ? Furnace's nbt for reference:
Items: [{Slot: 0b, id:"minecraft:raw_iron, Count:12b}, {Slot: 1b, id:"minecraft:coal", Count:1b}, {Slot: 2b, id:"minecraft:iron_ingot", Count:1b}]

im quite stuck really

halcyon hemlock
#

wdym

#

are you asking how to set nbt? or set nbt for a furnace? or what

orchid gazelle
wooden osprey
#

basically i am trying to set a block's nbt data and i am trying to create furnace-like block where i need to store the ingredients and the result; a way i thought was to create an nbt (array) that stores item data that is the count, slot and id (just like a furnaces "Items" nbt data)

wet breach
#

or how you are attempting to do things now

icy monolith
#

How do i add commands that have args in my plugin.yml file?

orchid gazelle
#

still the same but with the normalization

#

Location distBlock = player.getEyeLocation().add(player.getEyeLocation().getDirection().normalize().multiply(5 + (selection.depth + selection.width)/4D));

halcyon hemlock
#
new BukkitRunnable(){
  public void run(){
    // blah blah blah
  }
}.runTaskLater(Core.getInstance(), 20L);
halcyon hemlock
tardy delta
#

use the scheduler instead of instantiating bukkitrunnables pls

halcyon hemlock
wet breach
#

let me just go look

orchid gazelle
#

ok

halcyon hemlock
orchid gazelle
halcyon hemlock
#

FourteenBrush says that you shouldn't instantiate bukkitrunnables apparently

ivory sleet
#

BukkitRunnable is fine

kind hatch
#

It doesn't matter which one you do.

ivory sleet
#

But it looks a bit cleaner with the BukkitScheduler tho

kind hatch
#

Use what you want.

#

Both do the same exact thing.

halcyon hemlock
#

well use that ig, apparently it doesn't matter

orchid gazelle
halcyon hemlock
orchid gazelle
#

ah ok

ivory sleet
#

?scheduling goes over some substantial differences

undone axleBOT
halcyon hemlock
#

p.getEyeLocation().add(p.getEyeLocation().getDirection().multiply(amt_of_blocks))

ivory sleet
#

iirc I wrote about bytecode differences also

orchid gazelle
halcyon hemlock
#

so whats the error then

orchid gazelle
#

that it is insanely inaccurate

halcyon hemlock
#

I use it to get 1.5 block infront of player and it works fine (?)

orchid gazelle
#

by ~half a block

icy beacon
#

i'm so happy

#

i wrote a cool project in 2 days

halcyon hemlock
halcyon hemlock
icy beacon
#

and it works with no known bugs

#

hehe

orchid gazelle
icy beacon
orchid gazelle
#

this does not seem accurate

kind hatch
icy beacon
#

line 45?

ivory sleet
orchid gazelle
halcyon hemlock
wet breach
#

at least not what you are trying to make

orchid gazelle
halcyon hemlock
#

}.runTaskLater(Core.getInstance(), 20L);

#

why is it not working for you?

wet breach
halcyon hemlock
orchid gazelle
#

inaccuracy

icy beacon
#

wait why are you still creating a runnable and not using a scheduler

crimson relic
#

i dont see any

icy beacon
#

but ok

kind hatch
# ivory sleet

As someone who doesn't do bytecode. This went over my head. ๐Ÿ˜›

orchid gazelle
icy beacon
#

hm

halcyon hemlock
#

you shouldn't do that btw, if you are just gonna get location to place block

orchid gazelle
wet breach
orchid gazelle
#

^

wet breach
#

so, in order to do that we need some math and normalizations

tardy delta
#

well it blocks the server 20 ticks every loop

#

youre using the scheduler but still waiting sync on the result

wet breach
icy monolith
# halcyon hemlock u dont need to specify args in plugin.yml
   public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (cmd.getName().equalsIgnoreCase("maps")) {
            if (args.length == 0) {
                sender.sendMessage(ChatColor.RED + "Please specify a subcommand: create, addspawn, or reset");
                return false;
            }

            String subCommand = args[0];
            if (subCommand.equalsIgnoreCase("create")) {
                if (args.length != 2) {
                    sender.sendMessage(ChatColor.RED + "Usage: /maps create <map name>");
                    return false;
                }

                String mapName = args[1];
                mapSpawnLocations.put(mapName, new ArrayList<>());
                sender.sendMessage(ChatColor.GREEN + "Map " + mapName + " created");
                return true;```
Plugin.yml
```commands:
  maps:
    description: Your description
    usage: /maps
    permission: moul.op```
Eh then when when i do /maps or /maps create it sends this:
wet breach
#

I mean probably need to normalize the direction

kind hatch
wet breach
#

too

orchid gazelle
wet breach
#

right, but what we need to know if they passed the edge

#

is the location of where the block is at

orchid gazelle
icy monolith
wet breach
#

so you need the vector of the direction normalized, and then you need the block location normalized, and betwen those two things you should be able to detect if near or passed the edge

orchid gazelle
#

how? Locations are not normalized

wet breach
#

or to vector

orchid gazelle
#

yes

wet breach
#

Vector has normalize

orchid gazelle
#

yes but

halcyon hemlock
#

what does normalize mean?

orchid gazelle
#

only Location I put in is the eyeLocation

wet breach
orchid gazelle
wet breach
halcyon hemlock
#

i havent learnt vectors in school yet and dont know a lot about them xd

wet breach
#

I can give you an example

#

lets say you have x,z for a vector

#

and that vector was for an arrow

#

arrow as in direction

#

Well that doesn't tell you how long the arrow is

#

or its length

#

which is also known as magnitude

#

well in order to get that magnitude we need to normalize

orchid gazelle
#

Alf can you give me an example of how I can do this edge thing?

icy beacon
#

what's the maven-shade-plugin version for java 8? i'm trying to use bstats and it gives me Unsupported class file major version 60

kind hatch
icy beacon
#

i'm using java 16 but for some reason this is happening

#

so i suspected bstats

quiet ice
#

never use outdated stuff

#

Unless you want to use Java 6 that is

icy beacon
#

๐Ÿค”

#

wait what

#

oh

#

oh yeah right

#

for some reason the project was using 3.2.4

austere cove
#

there is a wiki page for that and u link so

icy beacon
#

it was outdated

#

alright it compiles with 3.4.1 lmao

#

thanks

quiet ice
#

much nicer

wet breach
#

I probably shouldn't help any longer XD

quiet ice
#

You should always try to keep the maven-compiler-plugin and the maven-shade-plugin to the latest version

orchid gazelle
#

Gigachad's tired at 3pm

quiet ice
quiet ice
orchid gazelle
#

Ok

wet breach
halcyon hemlock
#

explain in fortnite terms

kind hatch
orchid gazelle
#

yeah

quiet ice
#

................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

wet breach
fierce whale
#

?img

undone axleBOT
icy monolith
#

How do i do it then?

orchid gazelle
#

Crosshair direction should be player.getEyeLocation().getDirection()

wet breach
fierce whale
wet breach
#

how do you know they looked somewhere else

orchid gazelle
#

I need the target location

wet breach
#

that isn't hard...

#

but I mean still not what I was asking

quiet ice
#

shouldn't the eye direction be the crosshair direction?

halcyon hemlock
#

your server crashed

kind hatch
#

Correct me if I'm wrong, but isn't that what you are getting with the vector multiplication?
Your origin is the eye location and the target is the eyelocation * X.

orchid gazelle
wet breach
quiet ice
fierce whale
#

How can I solve that?
It worked well few munites ago ๐Ÿ˜ฆ

orchid gazelle
wet breach
kind hatch
#

Yes

orchid gazelle
#

Yes

halcyon hemlock
wet breach
#

interesting, good to know

halcyon hemlock
kind hatch
#

You can filter out the head movement though. If you want anyways

halcyon hemlock
#

if not you can always use packets

orchid gazelle
quiet ice
wet breach
fierce whale
#

umm what is spark?

wet breach
orchid gazelle
#

Aight

kind hatch
halcyon hemlock
#

creating worlds take a lot of ram thats why ur server crashed, most probably

fierce whale
#

for world creator?

halcyon hemlock
fierce whale
quiet ice
#

how much ram did you allocate anyways / what are you launch args?

fierce whale
#

I allocate 1GB

quiet ice
#

issue with spark is that it is pretty useless ...

#

Okay, 1 GB is not enough these days

halcyon hemlock
#

yeah especially on world creation

quiet ice
#

no profiler is needed there

fierce whale
#

but the problem is that. It worked well just few minutes ago

#

Im

quiet ice
#

Not allocating enough ram is a ticking time bomb

halcyon hemlock
#

i did it for multi verse and it worked but maybe something taking more ram for u

fierce whale
#

Im allocating 4GB now

quiet ice
#

You don't know when it explodes - but it will explode

#

Yeah, 4 GB is far more than enough

fierce whale
#

But Intelij + server + minecraft make my computer like dynamite lol

halcyon hemlock
mortal hare
#

preloading chunks ftw

quiet ice
#

eclipse is sad

halcyon hemlock
#

ive played with over 6 people on my server and it worked lag free

crimson relic
#

sad vibes

haughty granite
#

is it possible to create "private" scoreboards, visible only to the players we have determined?

mortal hare
#

mine with intellij, minecraft, 8 tabs open

#

firefox**

halcyon hemlock
#

thats how scoreboards work, dont they?

icy monolith
#

How do i select a random key out of a hashmap veriable every minute?

halcyon hemlock
#

p#setScoreboard(scoreboard)

mortal hare
kind hatch
#

Always include it in versions 1.13+. If you don't include it, legacy material support will kick in. Otherwise, set it to the lowest version your plugin supports.

icy monolith
#

random hashmap key

kind hatch
#

Are you using any 1.19 specific materials?

icy beacon
#

me crying in the corner with 8gb

#

my pc commits self termination when i have to launch two minecraft instances

kind hatch
#

Are you trying to support 1.18 as well? Cause if not, you can just leave it at that and keep it at 1.19.

mortal hare
#

why firefox and brave at the same time lol

wet breach
#

@orchid gazelle can you show me what you are using ? the math that is

mortal hare
#

why cant you just one instead

icy beacon
wet breach
#

nvm I will just scroll up to find it

mortal hare
#

I use firefox's fork, Librewolf

kind hatch
#

Well, then set it to 1.18 and start fixing the issues so it works on both versions. xD Only thing you really can do.

mortal hare
#

no telemetry, clean browser

icy beacon
#

yeah

icy beacon
icy beacon
#

nice

mortal hare
icy beacon
mortal hare
#

yes

#

its basically firefox without that sync and wallet shit

icy beacon
#

oh

#

hm

mortal hare
#

it doesnt even have auto update by default

icy beacon
#

i might consider getting it then haha

mortal hare
#

you need to install separate extension

icy beacon
#

i'm just tired of switching browsers

#

i used to use chrome before it crashed on me and deleted all the fucking data

#

bookmarks, history, tabs, stuff

mortal hare
icy beacon
#

so i yeeted it and went to firefox

wet breach
kind hatch
#

lol. Do want you want/need to, but general rule of thumb is to set the api-version to the lowest version you support.

halcyon hemlock
orchid gazelle
mortal hare
#

i switched from chromium just because of the upcoming extension api which would break adblockers soon

orchid gazelle
#

I just need that exact block, nothing around it

mortal hare
#

and i already used firefox on mobile since it allows to use extensions on the mobile

crimson relic
mortal hare
#

ublock origin

kind hatch
#

Depends on how you have it setup. If it's a multi-module project, then it handles itself. Otherwise, the version needs to be the lowest version you support.

mortal hare
#

on mobile is such a breeze

wet breach
mortal hare
#

i've been thinking of purchasing a PiHole

orchid gazelle
icy beacon
#

btw

#

what do yall think about ecosia

mortal hare
#

basically it makes a global adblocker

#

for your whole network

kind hatch
#

I'm talking about the spigot-api version.

icy beacon
#

i've been using it for a couple months i think and it's cool

orchid gazelle
#

Just gotta get the right block at the player crosshair

crimson relic
#

nextdns also good option

mortal hare
#

yea, but you see, you can use those blockers for devices which do not support browsers well enough

#

like samsung tvs

#

or consoles

#

its better than nothing

#

My parents ๐Ÿ˜„

#

eh its an old model

#

2014

#

and its youtube app is laggy as hell

#

but it gets the job done

halcyon hemlock
#

same lol

#

anyone tryna make a plugin together?

crimson relic
#

working with people is painful

halcyon hemlock
#

true lmao

#

never worked together

chrome beacon
quiet ice
#

It also depends on the size of the project

crimson relic
halcyon hemlock
#

lmao

quiet ice
#

For larger plugins working together is nice, for smaller it is basically stupid

halcyon hemlock
#

i can make smaller plugins in a day or so

#

oh rip

crimson relic
#

lol

halcyon hemlock
#

in my (discord) server, there is only 2 admins. me and my friend. i gave him admin after like a few months of knowing him. can't trust people these days

#

damn

#

is that a lot?

#

in java its like double im guessing

quiet ice
#

1k lines are relatively okay

quiet ice
#

When someone contributes anything to one of my repos I generally verify that those contributions are not malicious. Does a treat of avoiding issues in the future

halcyon hemlock
# orchid gazelle So, got any idea?

check for player move event, there is a func to get blocks in raycast, also a limit, get the last block and send packet or however you are doing it

untold patio
#

@last temple Hi! I canโ€™t DM you!

quiet ice
#

bundled libraries?

wet breach
quiet ice
#

That being said, contributors are very hard to come by

orchid gazelle
#

I do not have an existing block I can raytrace for

quiet ice
#

600 kb skripts???

#

What the hell are you writing

halcyon hemlock
quiet ice
#

is that a giant switchmap or what?

orchid gazelle
halcyon hemlock
quiet ice
halcyon hemlock
#

they made rocket in worse software than old nokia phones tbh

#

its probably possible

#

yeah

quiet ice
#

Still, 200 - 300 chars per line. Not even my largest classes come anything close to that

orchid gazelle
#

@halcyon hemlockfor getLineOfSight, what do I add for transparent?

halcyon hemlock
#

use intellij minecraft plugin

orchid gazelle
#

I want it to not care about other blocks

mortal hare
#

skript is procedural scripting language

quiet ice
#

my largest class is 343.6 KB large

kind hatch
#

Did you also run buildtools?

quiet ice
kind hatch
#

What's your pom look like?

orchid gazelle
#
                List<Block> all = player.getLineOfSight(null, 5 + (selection.depth + selection.width)/4);
                distBlock = all.get(all.size() - 1).getLocation();
``` like that?
halcyon hemlock
#

i think so

#

try it and lmk

orchid gazelle
#

ah bruh its just the same issue

#

literally 100% the same issue

halcyon hemlock
#

there's also #getTargetBlockExact

orchid gazelle
halcyon hemlock
#
Player player = ...
Location playerLoc = player.getLocation();

double yaw = Math.toRadians(playerLoc.getYaw() + 90);
double pitch = Math.toRadians(-playerLoc.getPitch());

double x = playerLoc.getX() + 5 * Math.cos(yaw) * Math.cos(pitch);
double y = playerLoc.getY() + 5 * Math.sin(pitch);
double z = playerLoc.getZ() + 5 * Math.sin(yaw) * Math.cos(pitch);

Location blockLoc = new Location(playerLoc.getWorld(), x, y, z);
orchid gazelle
#

this is so frustrating+

#

such a simple issue destroying everything

halcyon hemlock
#
Player player = ...
Location playerLoc = player.getLocation();

Vector facing = playerLoc.getDirection().normalize().multiply(5);
Location blockLoc = playerLoc.clone().add(facing);
austere cove
#

yea obv it looks better in skript if you don't even try to write clean java code

quiet ice
#

?jd-s in b4 raytracing does this as well

undone axleBOT
halcyon hemlock
#
Player player = ...
Location playerLoc = player.getLocation();

List<Block> blocks = player.getLineOfSight(null, 5);
Block targetBlock = blocks.get(blocks.size() - 1);
#

complexity isn't always bad

quiet ice
#

yeah, sadly raytrace will return null if it doesn't hit anything

orchid gazelle
#

plz don't use skript if you can code lol

halcyon hemlock
#
Player player = ...
Location playerLoc = player.getLocation();

Vector direction = playerLoc.getDirection();
RayTraceResult result = playerLoc.getWorld().rayTraceBlocks(playerLoc, direction, 5);

Location blockLoc = result.getHitPosition().toLocation(playerLoc.getWorld());
orchid gazelle
#

only disadvantages besides less lazyness requierd

halcyon hemlock
#

how do you test so fast

orchid gazelle
halcyon hemlock
#

could u give your full code

orchid gazelle
#

raytracing raytraces BLOCKS, which is the exact thing I want to avoid

#

good

#

im literally gonna throw some bricks against the window rn

halcyon hemlock
orchid gazelle
#

:( already explained 3 times

halcyon hemlock
#

so just placing blocks 5 blocks infront of player?

frank kettle
orchid gazelle
orchid gazelle
#

but this garbage does not let me do that

chrome beacon
#

Sounds like you want to use the rayTrace method

halcyon hemlock
#

do u want me to open my server and test it for you?

orchid gazelle
#

tr4gfrwegwegerger

chrome beacon
#

I know you've said you don't want to

#

but try it

orchid gazelle
halcyon hemlock
#

no raytracing

orchid gazelle
chrome beacon
#

How so?

halcyon hemlock
#

raytracing will get block in x blocks

#

regardless of blocks it hit

#

i think

orchid gazelle
#

no

frank kettle
#

How about you build the blocks yourself instead of being lazy and wanting code to do it for you?

#

Smh this humans nowadays...

halcyon hemlock
#

automation overrated

#

do the work for your players,

orchid gazelle
#

raytracing finds the next block that the direction hits

halcyon hemlock
orchid gazelle
#

omg

frank kettle
#

I still stand by the solution of you building the blocks yourself

#

The world is getting too much automated, we need some human control back

halcyon hemlock
astral condor
#

i need help

halcyon hemlock
#

try debugging

halcyon hemlock
astral condor
#

it gives error saying org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml

halcyon hemlock
#

give me your location ill call police

frank kettle
#

That's cause invalid plugin.yml

halcyon hemlock
#

smh

#

monkeys these days (jk)

astral condor
#

im sad :<

orchid gazelle
#

in which world would I be able to use triangles if I have one length

echo basalt
#

@orchid gazelle It's about time you go in-game and start making and visualizing test cases

halcyon hemlock
halcyon hemlock
#

double yaw = Math.toRadians(playerLoc.getYaw() + 90);
double pitch = Math.toRadians(-playerLoc.getPitch());

double x = playerLoc.getX() + 5 * Math.cos(yaw) * Math.cos(pitch);
double y = playerLoc.getY() + 5 * Math.sin(pitch);
double z = playerLoc.getZ() + 5 * Math.sin(yaw) * Math.cos(pitch);

Location blockLoc = new Location(playerLoc.getWorld(), x, y, z);```
echo basalt
#

able to show me an in-game visual example?

chrome beacon
# astral condor

Your plugin.yml probably isn't included in the jar. Since you appear to be using artifacts to build it you need to manually specify the file as included

frank kettle
halcyon hemlock
echo basalt
#

or draw something up in paint?

frank kettle
#

True plugun.yml

astral condor
chrome beacon
frank kettle
#

So it's not a problem in the plugin.yml after all

halcyon hemlock
#

use intellij minecraft plugin to create projects

orchid gazelle
#

@halcyon hemlock yeah that code does a very good job going even further away from the target

frank kettle
#

Imagine setting up the files yourself in 2023

astral condor
#

I actually misspelled it too.

halcyon hemlock
frank kettle
#

Ask chatgpt to create the plugin.yml for you

halcyon hemlock
#

its easy

#

i use them all the time, and they work fine for me

orchid gazelle
#

did you even read what the problem is?

echo basalt
#

maybe your way of explaining hte problem is odd

river oracle
orchid gazelle
#

that the vector multiplication is inaccurate as hell on earth

halcyon hemlock
echo basalt
#

I'm trying to get a full understanding of the problem

astral condor
#

Thank you very much everyone

echo basalt
#

Vector multiplication works perfectly fine, maybe your own math that uses vector multiplication is flawed

halcyon hemlock
astral condor
#

I spelled the plugin wrong lol

halcyon hemlock
#

dont your eyes hurt?

halcyon hemlock
#

what is the extra variables you put?

frank kettle
#

Congrats on your first plugin

echo basalt
#

here's a basic example

frank kettle
halcyon hemlock
#

yes, good

echo basalt
#

the player's line of sight is circular

river oracle
astral condor
river oracle
#

He uses light mode

halcyon hemlock
astral condor
echo basalt
#

the player's line of sight is circular

halcyon hemlock
#

thats some haram level shit

halcyon hemlock
river oracle
#

Join the cult of darkness

halcyon hemlock
#

yeah

astral condor
#

how to change

echo basalt
#

but blocks are not circular

halcyon hemlock
#

oh no

orchid gazelle
halcyon hemlock
#

pls use nogui

river oracle
halcyon hemlock
astral condor
#

thx u

echo basalt
halcyon hemlock
#

also please send full code

orchid gazelle
orchid gazelle
echo basalt
#

multiplying those decimals ends up giving you a decimal result

quiet ice
halcyon hemlock
orchid gazelle
#

Location distBlock = player.getEyeLocation().add(player.getEyeLocation().getDirection().normalize().multiply(5 + (selection.depth + selection.width)/4D));

astral condor
halcyon hemlock
tender shard
chrome beacon
tender shard
#

close the eyes

echo basalt
#

Dafeist's thread because chat is spammy

tender shard
#

Ah yes, "Dafeist's thread", what a very useful title

echo basalt
#

do better

river oracle
#

Vector shit

tender shard
echo basalt
#

neither do I

icy monolith
#

Can i put a class inside of a class?

river oracle
#

Ye

#

Can't be public though

#

I'd generally avoid that behavior though unless the class is only used internally in the class your putting it in

quiet ice
hazy parrot
#

It can't in java

#

You can have inner public class

quiet ice
#

Yes, even in java

hazy parrot
#

You literally can't

#

Public class

quiet ice
#

You just can't have two public non-inner classes within the same file

#

But a public class within a public class is very much possible

hazy parrot
#

File have to named same as public class

quiet ice
#

Lemme find an example, shouldn't be too hard to figure out

hazy parrot
quiet ice
#

And before you say "it's an interface", I'll find a better one

river oracle
#

Idk why I thought you couldn't

quiet ice
#

of course you can

#

this would be a stupid limitation

river oracle
#

I wonder where I got that from ๐Ÿค”

quiet ice
#

Wow, I rarely use non-interface inner classes that aren't static and private

quiet ice
icy monolith
#

How do i select a random key out of a hash map and save it in a veriable every 1 minute?

river oracle
#

I barely use inner classes

#

?google

undone axleBOT
quiet ice
#

I use inner classes rather frequently

river oracle
quaint mantle
quiet ice
river oracle
quaint mantle
#

having a public class in a class means it's not a top level class

hazy parrot
#

and what is public class X as not toplevel?

quaint mantle
#

It's an inner class

hazy parrot
#

That is nested class

#

Not inner

quaint mantle
#

or nested

hazy parrot
#

It's not same

quiet ice
#

but

public class X {
   public class Y {
   }
}

is valid

quiet ice
hazy parrot
river oracle
#

Same difference

quiet ice
#

I have learned the JLS, I know this

#

There are no such nested classes

#

There are only local, anonymous and inner classes

#

And top-level classes if you count that, but I don't remember them being mentioned in the JLS spec

hazy parrot
#

Well, oracle docs are wrong then

halcyon hemlock
quiet ice
#

local classes are classes within methods

halcyon hemlock
#

average java coder

quiet ice
#

And anonymous classes are classes without a name

river oracle
#

Oh God look what I started and I was wrong too

quiet ice
#

Inner classes are classes within a class

quiet ice
#

If you are saying that the JLS is wrong then go back to C world

river oracle
#

What's jls stand for

austere cove
#

java language specification

quiet ice
#

Exactly

halcyon hemlock
#

enum constructors

hazy parrot
#

Well, I was wrong, inner == nested class, however I wasn't referring to nested classes

ornate mantle
#

anyone know why im getting IllegalArgumentException: Symbol does not appear in the shape: [] while trying to set an ingredient?

#

?paste

undone axleBOT
hazy parrot
austere cove
ornate mantle
#

im trying to turn a java List into a crafting recipe

#

but it gives me an IllegalArgumentException

hazy parrot
#

So yeah, ig not every nested is inner

ornate mantle
#

does anyone know why?

halcyon hemlock
#

wdym

quiet ice
#

8.1.3 Inner Classes and Enclosing Instances
An inner class is a nested class that is not explicitly or implicitly static.
An inner class is one of the following:
โ€ข a member class that is not explicitly or implicitly static (ยง8.5)
โ€ข a local class that is not implicitly static (ยง14.3)
โ€ข an anonymous class (ยง15.9.5)
The following nested classes are implicitly static, so are not inner classes:
โ€ข a member enum class (ยง8.9)
โ€ข a local enum class (ยง14.3)
โ€ข a member record class (ยง8.10)
โ€ข a local record class (ยง14.3)
โ€ข a member class of an interface (ยง9.5)
Seems like we were both kinda wrong

#

(Excerpt from JLS 19)

hazy parrot
#

Yap

quiet ice
#

That being said I was accidentally correct since I wasn't talking about static

hazy parrot
#

I was for some reason reffering top level class as inner

echo basalt
ornate mantle
#

its a single digit number which im casting to a char

echo basalt
#

yeah but casting it to a char

ornate mantle
#
Recipe: [000, 000, 000]
Ingredients: {ItemStack{STICK x 1}=0}```
echo basalt
#

doesn't do what you think it does

ornate mantle
#

the console gives out this before shitting itself

echo basalt
#

(char) 9

#

does not return '9'

ornate mantle
#

what does it do

#

oh

echo basalt
#

it returns <horizontal tab>

ornate mantle
#

OH

echo basalt
#

because it returns what's on the ascii table

ornate mantle
#

ordinal

echo basalt
#

do Character.forDigit(number, 10)

ornate mantle
#

so i should be using the Char class?

#

yeah

#

the 10 makes sure it doesnt go above 10?

quiet ice
#

Yesn't - it's the base

#

i.e. Character.forDigit(15, 16) would return E

zealous osprey
#

Got a question, when I compile using maven, the compiled jar exists in the folder and another called smth like "originaljar". How could I stop this "original" jar from generating?

quiet ice
#

don't use the shade plugin

zealous osprey
#

What should I use as an alternative?

quiet ice
#

there are no alternatives

zealous osprey
#

So I gotta live with that extra jar being generated?

quiet ice
#

mostly

#

Shouldn't be that much of an issue anyways unless you have very severe OCD

#

At that point you can just add a script to remove any jars ending with -original.jar that is executed after each compilation

hazy parrot
#

It does

zealous osprey
hazy parrot
tardy delta
#

0->15

zealous osprey
hazy parrot
#

No, plugin for maven

quiet ice
#

I doubt there is a plugin for that

hazy parrot
#

I used it here

#

You can use regex there ig

quiet ice
#

and that also runs when you don't explicitly invoke the clean goal?

hazy parrot
#

Not sure tho

#

I always build with clean

zealous osprey
#

What's the filset config in there?

quiet ice
#

plus clean should run before shade, so it wouldn't make much sense if you need to explicitly invoke clean

#

the list of files to remove

hazy parrot
#

I use it to remove old jar from plugins folder

#

So don't know, you can probably try and see @zealous osprey

zealous osprey
#

kk

paper viper
#

why are the sometimes shivering and sometimes not?

@Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        Player p = (Player) sender;
        Entity strider = Bukkit.getWorld("testw").spawnEntity(p.getLocation(), EntityType.STRIDER);
        org.bukkit.entity.Strider strider1 = (org.bukkit.entity.Strider) strider;
        strider1.setSaddle(true);
        strider1.setAI(false);
        strider1.setInvulnerable(true);
        return true;
    }
tardy delta
#

man got a cold

restive mango
#

If I'm adding things to a list using a normal bukkit runnable task, but then running through that list with an asynchronous task and doing things with elements of that list (like using them to do complex math), will there ever be a case where the element grabbed by the asynchronous task is malformed?

eternal night
#

depends on the list

restive mango
#

Like say its a list of string arrays, and it is trying to grab the string array at the fourth index of that list, it would never grab {"a", "b", "c"} when it is actually supposed to be {"a", "b", "c", "d"}

eternal night
#

ArrayList would throw a proper ConcurrentModificationException if you are trying to add an element to the list while your async task is iterating

restive mango
#

hrm

#

how might i add things to that list WITHOUT getting that error thrown? I'd really like to be able to generate a list of stuff in the thread and then use an asynchronous task to grab elements from that list and use them to fo a bunch of vector math and then send a bunch of packets and delete that element

eternal night
#

a rather normal synchronization issue

#

either use javas sync blocks

#

or something like a semaphore

tardy delta
#

cant you use a blocking queue so the async task blocks till an new element is detected?

eternal night
#

or that yea

zealous osprey
restive mango
#

alright ill google all those things

eternal night
#

there are a few data structures out there with inbuilt multi threaded safety

restive mango
#

thanks

wooden osprey
#

how can I rotate a block?

#

isn't it directional?

wooden osprey
wooden osprey
#

yeah well cant cast block state to directional..

#

oh data?

#

sorry data*

#

but i may have mistyped it lemme try rq

raw brook
#

Eclipse error

wooden osprey
orchid gazelle
#

uhm guys, is there a PlayerMoveEvent for minimal camera movements?

tardy delta
#

isnt one fired anyways?

orchid gazelle
#

if you only move your crosshair a tiny bit, the event is not getting called

misty ingot
#

anybody got plugin ideas? im bored asf and have 9 hours to burn

tardy delta
#

:o

misty ingot
#

so

#

how do you usually deal with life

orchid gazelle
#

thats bad, when I do not move my crosshair a decent amount it does not get called

#

so, I gotta waste literal tons of performance to run it always, no matter on the event

quiet ice
#

what do you mean "don't move"?

#

If it includes no movements of the crosshair, it's false

#

If I take my hands out of the mice and keyboard and am not standing in water or simiar, the event will not fire

orchid gazelle
#

the event does not fire when moving the crosshair a bit

#

only when I move it by a big amount

sterile token
#

?google what means Entity#setAI() ??

undone axleBOT
quiet ice
#

I used to do an analysis on this topic and usually PME will fire around every 1.5 - 1.8 ticks

#

(over many players and many servers)

orchid gazelle
#

Now, is there a way to detect small movements?

glossy atlas
#

I want to make a server game and some play room
I can make server game myself
but how to generate play room?
use multi-world plugin?

vagrant stratus
#

I don't think so

orchid gazelle
#

Fusion is that related to my question?

past wedge
#

How can I import nms for custom npcs please ?

orchid gazelle
#

If yes, yeah now thats insane amounts of performance getting drained from me now

vagrant stratus
orchid gazelle
orchid gazelle
past wedge
vagrant stratus
#

It's possible that it just doesn't get sent, the server would detect any movement packet

orchid gazelle
sterile token
orchid gazelle
orchid gazelle
orchid gazelle
dire bluff
#

hello! im a new developer and i need some help

orchid gazelle
#

PlayerCameraMoveEvent xD

vagrant stratus
orchid gazelle
dire bluff
#

so i triewd to create a plugin in IntelliJ

#

but when i try to use it it tells is it up to date

#

should i send u he code?

tardy delta
#

the plugin is up to date?

dire bluff
#

im trying to make it

orchid gazelle
#

Uhm, I am not understanding your issue rn

tardy delta
#

whats up to date

past wedge
#

How to import nms

dire bluff
#

can i send u smth dm so i can give u more details

orchid gazelle
#

Ah, how bad is a async repeating scheduler with one boolean check for performance?

tardy delta
#

theres no need for that

#

its not about performance

orchid gazelle
#

?

dire bluff
#

please guys i need a help i think it will not take mutch

remote swallow
#

take a screenshot of whats not up to date

echo granite
#

Should I use a DI framework(such as Guice) in order to avoid constructors that consist of 5+ services - using Field Injection?

#

It's hell to maintain at this point

dire bluff
#

Server thread/[ERROR] Error occurred while enabling MPATSARIA v1.0-SNAPSHOT (Is it up to date?)

#

this is my plugin

remote swallow
#

?paste the full error

undone axleBOT
vagrant stratus
#

We need the full error

quiet ice
vagrant stratus
#

We're not mind readers

dire bluff
#

no this is it

orchid gazelle
#

Show the full log of the issue

dire bluff
#

@remote swallow im using IntelliJ and i installed plugin minecraft developers

remote swallow
echo granite
# tardy delta is it that bad

I have so many constructors with repetitive dependencies, it's hell to read and especially configure at onEnable()

tardy delta
#

๐ŸŒ

quiet ice
mortal hare
#

am i the only one who doesnt understand why plugin classes are being loaded by custom PluginClassLoader?

quiet ice
#

Can you make stuff static in a way that makes sense? If so, you can do it

mortal hare
#

Isnt urlclassloader sufficient enough

quiet ice
#

Another good way to reduce classes is to just merge classes with simiar - if not identical - use

mortal hare
dire bluff
#

@remote swallow i made it

quiet ice
#

Actually, didn't we have that exact same discussion not so long ago?

mortal hare
#

the question is if your boolean variable is atomic or not

remote swallow
remote swallow
#

your commands arent in plugin.yml

mortal hare
#

if the boolean variable changes during async runtime, it could lead to problems

#

if its the field volatile keyword should prob be enough

dire bluff
mortal hare
#

but i suggest using atomic classes from java

orchid gazelle
#

Oh wait it actually takes more

echo granite
remote swallow
orchid gazelle
#

Its getting all Online Players and compares them to an ArrayList

quiet ice
mortal hare
#

before doing async operations think if those operations are thread safe or not

dire bluff
remote swallow
#
commands::
  yourcommand1:
    permission: cool.permission.1
  yourcommand2:
    permission: cool.permission.2
dire bluff
#

im rll rll new

misty ingot
#

anybody got some plugin ideas? I have nothing to do and 9 hours to burn

echo granite
quiet ice
#

If you are not abstracting bukkit, there is no excuse for this bullshit

dire bluff
quiet ice
#

Service hell is a hell you should be afraid of, not create willy-nilly

remote swallow
mortal hare
#

does anyone have an answer?

#

Why cant you just use URLClassLoader

dire bluff
#

wdym

remote swallow
#

press the maven

dire bluff
#

now?

round finch
#

i forgor how do i get my ConfigFile From my Plugin.jar

tardy delta
#

click arrow

remote swallow
remote swallow
tardy delta
#

lifecycle > package

quiet ice
dire bluff
#

?

round finch
#

i wanna save it to my folder

quiet ice
#

(although perhaps #saveResources doesn't work - eh, I'd reinvent the wheel anyways and use getResourceAsStream within the plugin's classloader)

dire bluff
#

@remote swallow what to do

tardy delta
#

javadocs on its best ๐Ÿฅบ

#

lets just ask chatgpt to write javadocs ig

quiet ice
#

meh

tardy delta
#

that stuff can atleast produce proper english

quiet ice
#

The javadocs will be far too vague

tardy delta
#
/**
 * Retrieves an integer value from the specified index and verifies that it falls within a specified range.
 *
 * @param index the index from which the integer value is retrieved
 * @param min the minimum value that the integer is expected to be
 * @param max the maximum value that the integer is expected to be
 * @return the retrieved integer value
 * @throws IllegalArgumentException if the retrieved integer value is less than the minimum or greater than the maximum
 */```
#

that does the job ig

dire bluff
#

can someomne help me howt o build my plugin

remote swallow
quiet ice
#

what's up with converting an int to an int

dire bluff
#

and then

quiet ice
#

mvn install

remote swallow
#

package

dire bluff
#

then

remote swallow
#

your done

tardy delta
remote swallow
#

you built your plugin

dire bluff
remote swallow
#

its in target

dire bluff
#

ok in target right>

#

ok

#

wich one

#

wich

remote swallow
#

the one without original or shaded on it

quiet ice
tardy delta
#

bad

dire bluff
#

ok and where is the plugin.yml

#

to add the command

remote swallow
#

src/main/resources

quiet ice
#

You'd want to use DFU for itemstack serialisation

#

Data fixer upper

dire bluff
#

can u check dm 1 sec epic

quiet ice
#

Mojang's itemstack serialisation library (also does more, but that is of little relevance)

dire bluff
#

i think im a bit annoying here

tardy delta
#

someone had the genius idea of nesting functionals here

misty ingot
#

whats the best way to encrypt a string, say I am storing passwords of players?

eternal night
#

you wouldn't encrypt it

#

you'd hash it

misty ingot
#

yeah that

tardy delta
#

String#hashCode kekw

eternal night
dire bluff
#

i need help in smth in my code

#

bcs i get gis error Server thread/[ERROR] Could not pass event PlayerInteractEvent to BaronSMPM v1.0-SNAPSHOT

tardy delta
#

?paste the error

undone axleBOT
hazy parrot
tardy delta
#

hmm String#hashcode should never produce the same result for a string with different contents right?

dire bluff
#

check it if possible

quiet ice
#

And the error?

tardy delta
#

block probably null