#help-development

1 messages · Page 499 of 1

tardy delta
#

now fixing the undefined behaviour ™️

slim wigeon
#

Got all the logs removed, how can I remove the leaves?``` public void timber(Block block) {
List<Block> logBlocks = new ArrayList<Block>();
do {
block = block.getRelative(0,1,0); logBlocks.add(block);
} while ( logs.contains(block.getRelative(0,1,0).getType()) );

    for(int i = 0; i < 8; ++i) {
        for(Block log : new ArrayList<Block>(logBlocks)) {
            for(int x = -1; x <= 1; ++x) { for(int y = -1; y <= 1; ++y) { for(int z = -1; z <= 1; ++z) {
                if( logs.contains(log.getRelative(x,y,z).getType()) && !logBlocks.contains(log.getRelative(x,y,z)) ) {
                    logBlocks.add(log.getRelative(x,y,z));
                }
            }}}
        }
    }

    for(Block log : logBlocks) { log.breakNaturally(); }
}```
#

Lots of entities kills the fps

small current
#

I have a region plugin and i dont want players from outside the region to activate a redstone block at the edge of the region by connecting redstones, how can i check for redstone going from block to block?

slim wigeon
#

Charged creeper incoming[10:00:06] [Server thread/INFO]: [MrnateGeek: Summoned new Lightning Bolt]

quaint goblet
#

Hello all! Im having trouble working out the placeholder for the ammount of people online, can someone help/tell me?

slim wigeon
#

PlaceHolder?

#

Such as what?

quaint goblet
#

Like the way you would use placeholders like %vault_eco_balance% to show your balance, i need one for all online players using PlaceholderAPI

slim wigeon
#

I don't know, is this like a plugin feature? Maybe #help-server

quaint goblet
#

Already asked there

slim wigeon
#

Well, I don't know. Not quite there on dev

sinful elm
#

so I'll explain my problem for the third time because I tried to fix it but it keeps not working...

small timber
sinful elm
wet breach
#

no

#

you asked for a short answer

#

it is the shortest one I know

#

use the paste site

#

not sure what is with people thinking posting such long ass code stuff in discord is ideal to read

#

?paste

undone axleBOT
lament swallow
#

well it's not the full code

#

just a demo

wet breach
#

not sure how that is a counter argument

lament swallow
#

the message is just long because I tried to explain it well

#

but ok next time i'll use the paste site

wet breach
#

the advantage to using a paste site when you start posting code or configs

#

is that I can zoom out and see it all

#

also highlighting is better

green prism
wet breach
#

and if I want to toss it into an IDE its easier to copy

lament swallow
#

okok

#

do you have any idea how to fix my problem?

#

or not at all

green prism
lament swallow
#

Hi guys I coded a custom API and I want to use it in one of my other plugins but I get this error :

java.lang.ClassCastException: class dev.littlebigowl.api.EssentialsAPI cannot be cast to class dev.littlebigowl.api.EssentialsAPI (dev.littlebigowl.api.EssentialsAPI is in unnamed module of loader 'EssentialsAPI.jar' @612f6df7; dev.littlebigowl.api.EssentialsAPI is in unnamed module of loader 'test-plugin.jar' @21f16c88)

I added the API jar as a dependency in my pom.xml like so :

<dependency>
      <groupId>dev.littlebigowl.api</groupId>
      <artifactId>EssentialsAPI</artifactId>
      <version>1.0.0</version>
      <scope>system</scope>
      <systemPath>path-to-jar</systemPath>
</dependency>

FYI I'm using vscode. Does anybody have a fix to this? I think the correct solution would be to add the jar in a different manner with the <provided> scope but that can't work if the jar is added with the <systemPath> tag.

#

that should be better

green prism
#

There's a Per-World Bossbar

#

And, since bossbars are stored inside a map, that's why I believe it doesn't get updated

wet breach
#

ironically its complaining about casting to the same thing it started as

green prism
#

Is it the best way to achieve that result?

wet breach
#

so I am going to assume you were wanting to actually cast to something else?

green prism
#

Yeah...

lament swallow
green prism
#

Frostalf, what do you think about that problem?

#

Well, it's a clock bossbar

lament swallow
#

that I want to re-use in another

green prism
lament swallow
#

So i'm using getPluginManager() to get my plugin and cast that to the EssentialsAPI Object

wet breach
#

however

#

it seems you are shading it?

ivory sleet
#

Even with 50 it ought to be fine

wet breach
#

this isn't going to work, API's need to be implemented

ivory sleet
#

Unless you run a serial gc jvm with like minimal resources available

wet breach
#

you can't just toss them in with your plugin and expect them to work

lament swallow
lament swallow
fluid river
#

i found a solution to my previous task

#

now i rephrase it

#

How to find N closest(by value) elements of an array to the given number

#

for example:

Array = [1, 2, 3, 4, 5, 6]
Element 1 = 1
Task: Find 2 closest(by value) elements to 1 in the array(excluding element1 itself)
Result = 2 and 3

tardy delta
#

no bitches

eternal night
fluid river
#

i wanted to find all possible combinations of size N of elements in the array

eternal night
#

are you just posting leetcode questions here xD

fluid river
#

😭

eternal night
fluid river
#

i mean i already passed several tasks

#

and probably gonna apply

#

but still

#

so

eternal night
#

I mean, those kind of tasks have solutions online dogekek why ask here lol

eternal night
#

is the array sorted ?

fluid river
#

no

weak meteor
#

i got

#

tons on error on my code

#

someone wanna help?

hazy parrot
#

there is literally StringBuilder#reverse

weak meteor
#

lol

rotund ravine
#

Have a look at kotlin

weak meteor
#

ye

#

uses jvm

tardy delta
#

java extension

weak meteor
#

but its different from java

tardy delta
#

and the syntax is a piece of shit

#

if you really want to waste your time, learn assembly

weak meteor
#

java:[66,45] [line,char]?

#

or char,line?

ivory sleet
weak meteor
#

what?

ivory sleet
#

Kotlin can compile to jvm compatible bytecode

weak meteor
#

o

slim wigeon
#

What did you do? Is that apart of Java?

weak meteor
#

no it isnt

#

just my friend wanna compile it

#

and well, yeah

#

im trynna help

tardy delta
#

i believe orbyfied was making his own jvm compatible bytecode java extension

ivory sleet
#

Java extension 💀

#

You make it sound like vsc extensions

ornate mantle
#

does a ClientBound packet mean the packet is headed from server to player?

tardy delta
#

or smth like that

rotund ravine
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

rotund ravine
#

Dont mind me

ornate mantle
#

what

#

its not even a question that needs my code

ornate mantle
#

nice

rotund ravine
#

It wasn’t for you

#

Iiterally wrote “don’t mind me”

ornate mantle
#

mb

wet breach
#

well regardless their question was answered

small timber
pseudo hazel
#

did you register the listener?

slim wigeon
river oracle
#

You know how to not be annoying??

tribal quarry
#

a packet that bounds to server: Serverbound

tardy delta
#

bound as in sent to

ornate mantle
#

ong

small timber
#

if i replace t1book with stone it works

small timber
#

anyideas?

eternal oxide
#

?jd-s

undone axleBOT
hollow birch
#

is there a way to remove the players current block damage progress

#

setting the stage to 0 with the packet is technically the first stage

#

((CraftPlayer) player).getHandle().b.a(new PacketPlayOutBlockBreakAnimation(-player.getEntityId(), position, stage));

#

stage is any integer between 0-9

lethal rune
#

could anyone troubleshoot my java plugin?

eternal oxide
fluid river
#

can i call method by it's name in string?

#

using reflex

ivory sleet
#

Yes

#

name + signature

#

reflection?

#

you mean right?

fluid river
#

yes

ivory sleet
#

Yea

fluid river
#

i need some line of code or smth

#

method is static

ivory sleet
#

getMethod, getDeclaredMethod

#

mhm

#

Method::invoke
where you pass (null, args…)

#

null dictates the method should be invoked statically

#

(:

fluid river
#
Class.class.getDeclaredMethod("myMethod", String.class).invoke(null, myString);```
ivory sleet
#

well

#

You need to provide the signature also

fluid river
#

it has string param

#

like diz?

ivory sleet
#

Ah then getDeclaredMethod("myMethod",String.class).invoke(null,argument);
// myMethod(argument)

fluid river
#

cool time to try

hollow birch
ivory sleet
#

Looks cleaner?

#

you sure about that?

hollow birch
#

yeah

#

its also just easier

ivory sleet
#

Huh

#

Makes no sense

hollow birch
#

because the packet uses 0-9

#

i can just add 1

eternal oxide
#

Nothing you have said makes any sense

hollow birch
#

im confused what youre confused about

ivory sleet
#

We’re not confused

hollow birch
#

like what about what i said doesnt make sense

ivory sleet
#

But rather, your preference and justification regarding nms is quite incomprehensible

eternal oxide
#

you would prefer to go though the extra steps of accessing NMS/packets just to copy something which is already in the API

hollow birch
#

its slightly different in the API

#

and that difference makes it annoying to use

#

and results in the same problem anyways

eternal oxide
#

it does exactly the same job, and is a single method call

ivory sleet
#

How is it annoying

eternal oxide
#

identical across versions

hollow birch
#

because the API uses a float between 0-1 to get block damage

#

but the packet uses an int between 0-9

ivory sleet
#

But how is that annoying?

eternal oxide
#

so what?

hollow birch
#

adding 1 is easier than adding 0.1

ivory sleet
#

It doesnt affect cleanliness whatsoever

eternal oxide
#

lol

hollow birch
#

plus either way that doesnt really have anything to do

#

with my problem

#

because in either one setting the value to 0 doesnt remove block damage

#

it just sets it to the first stage

eternal oxide
#

to clear it just send a fake BlockChange

#

also part of the API

slim wigeon
#

Seeing my eco at 4T+ on this casino game I play, I surprised. Now I in the mood to create plugins, Because EssentialsX has errors on 1.19.3, I going to try to create that

regal scaffold
#

https://wiki.vg/Protocol#Update_Teams

I need some help understanding this

Using ProtocolLib:

ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(this, PacketType.Play.Server.SCOREBOARD_TEAM) {}

To listen to the packet

                    final PacketContainer packet = event.getPacket();

This contains the packet data. What layer does it actually contain from the wiki link

Like, the wiki link has field names and types. How does this actually work

chrome beacon
#

The Spigot API can do everything you want

regal scaffold
#

I do need it for what I need to do with it

#

Player specific glow effects

chrome beacon
#

Yep you can do that with the api

regal scaffold
#

No...

chrome beacon
#

You can

regal scaffold
#

Player specific as in

chrome beacon
#

I know

regal scaffold
#

I can only see the glow effects for other players

chrome beacon
#

You can do that

regal scaffold
#

But

#

Plugins like LPC

#

Interfere with the colors

#

If I use teams

#

I need to change the color only for the player to see the glow

#

I already did all the testing

#

Client-side custom color glow effects only on specific people

#

I'm just wondering if I should use a packet wrapper or not

ivory sleet
#

What versions do you want to support?

regal scaffold
#

1.17.1

#

Only

ivory sleet
#

If its not legacy, then in principle just stick with nms + mojmaps

regal scaffold
#

Alright

#

Thanks

ivory sleet
#

Yea, much easier imo

abstract sorrel
#

i'm saving a class in a config file using FileConfiguration.set, but when i do FileConfiguration.get with the same path it returns a MemorySection, can someone show me how to fix

ivory sleet
#

Then you just inject the packet channel

eternal oxide
ivory sleet
#

And ^ register it before using it

abstract sorrel
#

how would i do that, my class has variables that are other classes aswell?

eternal oxide
#

read teh ConfigurationSerializable javadocs

ivory sleet
#

You have to make those implement config serializable or just have methods such that you can turn instances of those classes into/from Map<String,Object>

wise mesa
#

Are Bukkit interfaces that use the Bukkit vector going to switch to using the JOML Vector3f

ivory sleet
#

Doubt

#

Highly doubt

wise mesa
#

Do I have to copy the old transformation into a new object to change something about it

#

For a display for example

#

That seems wasteful of objects

ivory sleet
#

isnt the bukkit vector like mutable

wise mesa
#

Not Bukkit vector

#

Transformation

#

For a display

ivory sleet
#

Hmm

wise mesa
#

Like itemdisplay

#

It seems like they’re immutable

#

Oh wait no

#

Because the underlying objects are mutable

hollow birch
#

im probably thinking about that wrong

wise mesa
#

As long as get translation doesn’t clone the underlying vector3f

#

But I’ll have to check that later when I’m home

ivory sleet
#

Yea

eternal oxide
#

First I'd try just sending the BlockData from the actual block. It will not have any damage as thats all been faked

river oracle
#

I'm making a front end API that supports multiple Databases namely both NoSQL and SQL databases. I setup my arrangement which is more geared to Mongo database however, I also want to support something like SQlite for local database option. I looked around for NoSQL options like SQLite but couldn't find any. I'm currently trying to brainstorm a way to even set this up.
https://paste.md-5.net/kitowizani.json - sample data

Currently I was thinking of creating an empty table and appending rows as I needed my main issue is what to do with nested values like
for example object.object which conatins a string and int value my first idea was to append a column to the table named something like object.object.string or object.object.int, but I feel like eventually the table would get so unnecessarily large. Unfortunately I'm not sure what else I could do. I really don't want to have to resort to putting json into SQL that would be messy as hell.

urban kernel
#

anyone having problems creating a new IJ project with plugin development?
im getting

tardy delta
#

update ij

urban kernel
#

i am is update ij

quaint mantle
#

how can i open a anvil so i can type a player name or sometihng

fluid river
#

where does compass point originally?

chrome beacon
#

World spawn I believe

fluid river
#

if i set compass target to null

#

would it just reset

#

back to what it should be

#

i mean player.setCompassTarget()

chrome beacon
#

It's marked as not null

#

🤷‍♂️

small timber
#

can I stop a permission set to a permission attachment being reset every time the player joins the server?

eternal oxide
#

apply it on join. Every time a client joins it gets a new Player object

hollow birch
#

i dont know what i changed but for some reason other classes cant find my main class?

eternal oxide
#

clear caches

echo basalt
quaint mantle
eternal oxide
#

impossible to review as you show no code

tardy delta
#

decompiling time

#

wait i dont have a decompiler

eternal oxide
#

I guarantee I could open a door in a claimed chunk though, even without seeing your code

tardy delta
#

com.yourname.claimplugin hmm

regal kernel
#

hello, can i receive help with my spigot acc in #help-server , right?

eternal oxide
#

no saving, so claims only last until server restart/reload

tardy delta
#

uh and dont expose collections, write a layer above them instead

eternal oxide
#

a static ClaimData class?

tardy delta
#

lemme guess that it was a record

#

but decompiler thing

eternal oxide
#

possibly

tardy delta
#

not much to look at meh

karmic phoenix
#

I'm trying to setup a cooldown for splash potions.
each time you throw a potion you gotta wait a few seconds to throw another one.
here's my code:

    @EventHandler
    public void onLaunch(ProjectileLaunchEvent e) {
        if (e.getEntity().getShooter() == null) return;
        if (e.getEntity().getShooter() instanceof Player) {
            if (e.getEntity().getType().equals(EntityType.SPLASH_POTION)) {
                Player p = (Player) e.getEntity().getShooter();
                Map<UUID, Long> cooldowns = FFASystem.getMain().getCooldown();
                if (cooldowns.containsKey(p.getUniqueId())) {
                    if (cooldowns.get(p.getUniqueId()) > System.currentTimeMillis()) {
                        long timeLeft = cooldowns.get(p.getUniqueId()) - System.currentTimeMillis() / 1000;
                        p.sendMessage(ChatColor.RED + "You must wait " + ChatColor.RED + timeLeft + ChatColor.RED + " second(s) to throw another potion!");
                        e.setCancelled(true);
                    }
                }
                FFASystem.getMain().getCooldown().put(p.getUniqueId(), System.currentTimeMillis() + 3000);
            }
        }
    }
tardy delta
#

eaerly returns my friend

karmic phoenix
#

I cant attach images?

#

i wanna show the problem

tardy delta
#

and you can leave that first if away

#

?img

undone axleBOT
karmic phoenix
#

ah 1s then

eternal oxide
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

tardy delta
#

if its null it wont be an instance of a player

regal kernel
#

!verify AngeloContre4324

karmic phoenix
undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

karmic phoenix
#

also when u keep triggering the event it resets the timer

tardy delta
#

id recommend you to work with Instants instead of longs that say nothing

#

you probably want / 1000 after you substract curr millis ig

quaint mantle
# karmic phoenix I'm trying to setup a cooldown for splash potions. each time you throw a potion ...

@EventHandler
public void onLaunch(ProjectileLaunchEvent e) {
if (e.getEntity().getShooter() == null) return;
if (e.getEntity().getShooter() instanceof Player) {
if (e.getEntity().getType().equals(EntityType.SPLASH_POTION)) {
Player p = (Player) e.getEntity().getShooter();
Map<UUID, Long> cooldowns = FFASystem.getMain().getCooldown();
if (cooldowns.containsKey(p.getUniqueId())) {
if (cooldowns.get(p.getUniqueId()) > System.currentTimeMillis()) {
long timeLeft = (cooldowns.get(p.getUniqueId()) - System.currentTimeMillis()) / 1000;
p.sendMessage(ChatColor.RED + "You must wait " + ChatColor.RED + timeLeft + ChatColor.RED + " second(s) to throw another potion!");
e.setCancelled(true);
return;
}
}
FFASystem.getMain().getCooldown().put(p.getUniqueId(), System.currentTimeMillis() + 3000);
}
}
}

tardy delta
#

that code could use a lot of cleanup 😢

echo basalt
#

ew

#

damn

#

no

river oracle
karmic phoenix
tardy delta
#

just round up

karmic phoenix
#

I would like it to send
You must wait 3 seconds > You must wait 2 seconds > You must wait 1 seconds

tardy delta
#

Math.ceil i believe

quaint mantle
#

ohhh i see

tardy delta
undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
quaint mantle
# karmic phoenix I would like it to send You must wait 3 seconds > You must wait 2 seconds > You ...

@EventHandler
public void onLaunch(ProjectileLaunchEvent e) {
if (e.getEntity().getShooter() == null) return;
if (e.getEntity().getShooter() instanceof Player) {
if (e.getEntity().getType().equals(EntityType.SPLASH_POTION)) {
Player p = (Player) e.getEntity().getShooter();
Map<UUID, Long> cooldowns = FFASystem.getMain().getCooldown();
if (cooldowns.containsKey(p.getUniqueId())) {
if (cooldowns.get(p.getUniqueId()) > System.currentTimeMillis()) {
long timeLeft = ((cooldowns.get(p.getUniqueId()) - System.currentTimeMillis()) / 1000) + 1;
p.sendMessage(ChatColor.RED + "You must wait " + ChatColor.RED + timeLeft + ChatColor.RED + " second(s) to throw another potion!");
e.setCancelled(true);
return;
}
}
FFASystem.getMain().getCooldown().put(p.getUniqueId(), System.currentTimeMillis() + 3000);
}
}
}

tardy delta
#

and use getOrDefault for the sake of god

undone axleBOT
quaint mantle
#

oh my bad

tardy delta
#

when you write smth long you should wonder twice whether you can shorten it and how

young knoll
#

Well the first line null check can be removed

#

InstanceOf returns false for null

tardy delta
#

we are repeating each other

quaint mantle
#

how do i put code blocks morice?

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
warm mica
river oracle
quaint mantle
#

This better?

public void onLaunch(ProjectileLaunchEvent e) {
    if (!(e.getEntity().getShooter() instanceof Player)) return;

    if (e.getEntity().getType().equals(EntityType.SPLASH_POTION)) {
        Player p = (Player) e.getEntity().getShooter();
        Map<UUID, Long> cooldowns = FFASystem.getMain().getCooldown();
        long currentTime = System.currentTimeMillis();
        UUID playerUUID = p.getUniqueId();

        if (cooldowns.containsKey(playerUUID) && cooldowns.get(playerUUID) > currentTime) {
            long timeLeft = ((cooldowns.get(playerUUID) - currentTime) / 1000) + 1;
            p.sendMessage(ChatColor.RED + "You must wait " + ChatColor.RED + timeLeft + ChatColor.RED + " second(s) to throw another potion!");
            e.setCancelled(true);
        } else {
            cooldowns.put(playerUUID, currentTime + 3000);
        }
    }
}
river oracle
#

also didn't know you could store json in SQLite

warm mica
#

Then it's likely worth it to implement something properly if it's supposed to run on production

young knoll
#

Json is just a string

warm mica
river oracle
#

damn that is dope

tardy delta
#

think about it

river oracle
#

shhhh

tardy delta
#

what are you gonna declare you column as? varchar(10000)?

#

working with text in databases generally goes brr

warm mica
tardy delta
#

oh god

river oracle
#

that seems like the best datatype

#

hey I don't wanna be using SQLite but there is no equivalent for NoSQL

tardy delta
river oracle
#

he can suck my big MongoDB

#

ALL THAT DATA

#

mmmmm

tardy delta
#

last one probably

young knoll
#

Maven

tender shard
#

My neighbor is called Marvin

tardy delta
#

i somehow want to use gradle to avoid using xml but that stuff caches half the universe lol

river oracle
#

I'm about to go put JSON in a relational database and no one can stop me 😈

tardy delta
#

i live in your walls

river oracle
#

I really don't want to 😭

tender shard
river oracle
#

but I also don't want my tables to have 10,000 columns

young knoll
#

How many variables do you have m8

#

Well, evidently 10000

river oracle
#

🤷‍♂️ not 10,000 but its abit of an overexageration

#

like idk how well sql would handle a query of player settings if it had like idk 100 settings

#

that isn't a ton

#

but probably hurts response time

tender shard
#

Overexxegeration, nice neologism

tardy delta
#

use a bitset id say

tender shard
#

Kinda redundant

#

Oxymoron

young knoll
#

Or use a row per setting instead

#

Player, SettingKey, SettingValue

river oracle
#

how would you do that though because can't you only query 1 key
UUID would be my main key

#

could I do like

#

SELECT WHERE UUID = ? and SETTING = ?

young knoll
#

Yes

river oracle
#

oh okay

tender shard
river oracle
#

makes sense

tender shard
#

PRIMARY KEY (uuid, settingKey)

tardy delta
#

ok this really is the last one

river oracle
tardy delta
#

another table

river oracle
#

that's the only place I'm actually hung up

tardy delta
#

relational databases my friend

tender shard
river oracle
#

its just how my brain be working

tardy delta
#

same

#

but i dont like mongodb syntax so i keep using sql

river oracle
#

which is why it takes me like .3 seconds to setup mongo but 10,000 years to setup proper sql

tardy delta
#

or gson

#

sounds like a skill issue

tender shard
#

Skull* issue

river oracle
tender shard
#

💀

river oracle
#

I'm just kinda confused on how to structure the queries

#

would I need a table for every sub setting

tardy delta
#

multiple queries

#

reminds me i have a database assignment for within a few days

river oracle
#

I've yet to take a database class

#

as you can tell I just wing everything

tardy delta
#

clearly forgot that stuff bruh

young knoll
#

Writing queries is very boring

tardy delta
#

ah fun i gotta make this a db

young knoll
#

Like woo I have to join 5 tables

river oracle
#

is this a public dependency

#

you sir

#

are evil

#

please

#

open source

tardy delta
#

when you're too lazy to write sql

young knoll
#

There’s others like it

#

JOOQ iirc

river oracle
#

JOOQ

young knoll
#

Java object oriented query

river oracle
#

hmm honestly this sql from non relation database thing looks like a huge pain json time 😈

tardy delta
#

i once wrote a reflective pojo mapper but i got scared of myself

river oracle
#

its so fun

tardy delta
#

soo much awful stuff exists

young knoll
#

I’ve made one of those for configs

#

It’s a bit yikes to look at but shhh

#

Just don’t look at it

tardy delta
#

mine was with annotations and it looked awful, couldnt even handle all possible cases

river oracle
#

my mapper is quite the monstrosity

young knoll
#

It’s painful to look at but very pleasant to use

river oracle
#

you aren't doing it right if its not both painful to use and look at

tardy delta
young knoll
#

If it was painful to use I wouldn’t use it

#

It just magically turns maps and shite from and to config files

sullen marlin
#

Y'all need jooq or whatever

young knoll
#

Jooq deez nuts

river oracle
#

IS THAT MD_5

#

ADMINISTRATOR OF SPIGOT!

sullen marlin
#

No

eager jacinth
#

Is there any way to bypass the f character limit for player names? I mean over the head. The only thing I've come up with is to hide the name and then add an ArmorStand passenger with the desired name 💀

river oracle
sullen marlin
#

Prefix and suffix with scoreboard give you more characters to play with

river oracle
#

oh this is help dev

wise mesa
hazy parrot
#

What is more safe about it

wise mesa
#

type safety

#

no malformed query

#

knowing that your statements are valid at compile time

#

of course doesn't replace testing

#

but assists it

tawdry echo
#

someone know how to do darkmode in jd-gui?

sullen marlin
#

Lol

#

Why

tawdry echo
#

why not

sullen marlin
#

How long are you spending decompiling things

tardy delta
#

24/7 ofc

young knoll
#

I used to spend a fair amount of time in one

#

But now I can just view NMS in my ide

keen charm
#

Hey guys

#

Anyone has an idea to turn TextComponent to a String with it's properties, or return TextComponent in PlaceholderAPI?

#

I'm trying to return a text with a custom font & the custom font is in resource pack.

#

Aka: /tellraw @p {"text":"SpigotMC", "font":"test"}'s return value should be the same as %customfonts_convert_test_SpigotMC%

chrome beacon
#

I don't think that's possible

keen charm
#

Oh...

frail pilot
#

You want the JSON format of a TextComponent ?

keen charm
#

I want to return a text with a custom font (basically a TextComponent) in PlaceholderAPI

frail pilot
#

Oh ok

sullen marlin
#

your obfuscator probably removing event listeners

#

need to retain methods with @EventHandler

river oracle
#

just don't obfuscate

#

its pointless anyways

#

but md_5's solution works

golden turret
#

why??? 😭

river oracle
#

oh right it will take 30 seconds

#

instead of 5

#

obfuscation is pointless

#

your code is unimportant and ultimately useless

#

if a dev wants your code soo bad which I doubt they would

#

they will get it and you can't stop them

#

You are selling to consumers not developers, if you're worried about piracy it'll happen anyways, keeping yourself open source and non obfuscated will likely protect those who wanted to pirate anyways. No one deserves malware not even people who pirate

#

People who would buy or use your plugin probably can't code anyways

#

youre protecting yourself from developers who have the know how and persistence to break obfuscation

#

a good friend? yet you are obfuscating your plugin

#

seems fucking stupid

#

I'd just throw my friends source code lol

#

especially if they have devs

#

what does your plugin do

#

oh lol yeah no not worth it that thing has been done a billion times and probably been done better by someone out there. Its really not worth the time or effort

#

who cares if they decompile it anyways

#

non obf makes life easier on developers if there is an issue

wise mesa
#

for displays, if I only need one rotation, should I prefer left or right rotations

rotund ravine
#

Both

chrome beacon
#

ProGuard

rotund ravine
#

?obfuscate

#

Dang

river oracle
#

I've alreday said there is no point

#

Obfuscation won't help you nor will it help anyone

rotund ravine
#

Just write in kotlin. It pukes out weird jvm code

river oracle
#

lol

#

the best obfuscation is kotlin

wise mesa
river oracle
#

nah there is no point

#

lol

#

I think most people here share this sentiment

wise mesa
#

there is no point, but additionally we're not gonna spoon feed you

river oracle
#

you are making code for FOSS I think most things should be Open Source

#

there are plenty of premium plugins open source

wise mesa
#

someone gave you the name of a tool

#

google it

river oracle
#

isn't ProGuard payed

#

lol

chrome beacon
#

No

river oracle
#

oh I thought it was

wise mesa
#

open source actually I think

chrome beacon
#

ProGuard is the free version

wise mesa
#

but definitely free

chrome beacon
#

They have other paid options

river oracle
#

ahh its a code shrinker

young knoll
#

The best way to protect your code is to write code that’s so bad no one wants it anyway

river oracle
#

doesn't want anyone to look at their shit code

echo basalt
#

obfuscators only hide how shitty your code truly is

#

There's no other point

#

If you want a code shrinker then minify() on gradle's shadowjar thing

#

and fuck off

#

DRM is stupid and only slows things down

wise mesa
echo basalt
#

clockwise

wise mesa
#

okay yea

#

so right

#

why are there two?

#

I guess for axis angle you can't do all rotations with just one

#

I think

#

but for quaternions you definitely can so

#

idk its weird

young knoll
#

Wait

#

What’s minify

undone axleBOT
echo basalt
wise mesa
#

if left is left-hand

#

then that one would be clockwise

#

uhhhhhh

#

just gonna google

young knoll
#

Ah yeah minimize

#

Doesn’t shrink your code itself though

#

PlayerInteractEvent

weak meteor
#

Is there any way to check for special characters?

#

like $%&/

#

and stuff

#

only abc123

river oracle
#

regex

weak meteor
#

thx

wise mesa
#

so does anyone know if left rotation or if right rotation is clockwise

#

I guess I can just test it out

#

see protocollib

#

lol

sullen marlin
#

?xy

undone axleBOT
wise mesa
#

they want to know why you need to get the tick that a packet is sent on

sullen marlin
#

What things, why?

#

Why must it be tick based instead of time based?

#

Still unclear why that needs to happen on ticks

#

But packets are sent, received, and perceived by time

#

You don't view the world by ticks

#

Not to mention they're sent/received async anyway

#

It sounds like you're trying to make a replay system

#

Unclear why that system would be tick based rather than time based

#

If it is time based it will replay the events as they occurred to the real world perceiver (players)

#

System.currentTimeMillis

regal scaffold
#

I used the gradle maven publish plugin to add a library to my local repo

#

I've gone to the folder to check and it's indeed there

#

But when trying to depend on it from a maven project it says artifact not found

sullen marlin
#

Unclear how ticks solves that issue

#

Also unclear how it's an issue

young knoll
#

You’ll never really be able to know when the other clients get the packet

#

I guess you could estimate based on ping

sullen marlin
#

If you assume it's constant it doesn't matter

regal scaffold
#

I used the gradle maven publish plugin to add a library to my local repo.

I've gone to the folder to check and it's indeed there
But when trying to depend on it from a maven project it says artifact not found

cloud cipher
#

im trying to add tab completion to my commands that use a executor class to be added to the commandMap but i cant get the tab completions to work. the commands all still work on their own but just no tab completion, the relevant(ish) code for the executor class is in this pastebin: https://pastebin.com/bGS0XB9Y

and some of the tests i'm trying with the tab completes are:

            @Override
            public List<String> onTabComplete(CommandSender sender, String [] args) {
                if (args.length == 1) {
                    return Collections.emptyList();
                }
                return Collections.emptyList();
            }
            }```
```java
            @Override
            public List<String> onTabComplete(CommandSender sender, String [] args) {
                System.out.println("On tab complete called");
                if (args.length == 1) {
                    ArrayList<String> options = new ArrayList<>();
                    options.add("name");
                    options.add("lore");
                    options.add("makeUnstackable");
                    return options;
                }
                if (args.length == 2) {
                    if (args[0].equalsIgnoreCase("name")) {
                        ArrayList<String> options = new ArrayList<>();
                        options.add("<name>");
                        return options;
                    }
                    if (args[0].equalsIgnoreCase("lore")) {
                        ArrayList<String> options = new ArrayList<>();
                        options.add("add");
                        options.add("clear");
                        return options;
                    }
                    return Collections.emptyList();
                }

                return Collections.emptyList();
            }

        };```
neither of those code examples for tab completions are working
wise mesa
#

minecraft does not organize events into ticks like other games

#

when the packet gets there it gets there

#

like the server has ticks

#

but its not realllllly synchronizing them with the client for the most part

timber mural
#

Hello everyone so i was wondering how to make a plugin that removes specific blocks in newly generated chunks? I have spent a lot of time researching the right way to do it and a way to make it not crash the server by overloading it but unfortunately i have not found a decent way. I believe that once i've succeeded but my server crashed because i was trying to replace all ores to stone so it basically overloaded

#

I just need to know the event for generating new chunks and a proper way to loop through blocks to check which should be replaced/removed but also a way to optimize it

viscid fractal
#

this might be of some help

vocal cloud
timber mural
vocal cloud
#

Well you'll be doing that regardless

young knoll
#

The best way would be to remove the ore populators

timber mural
young knoll
#

I believe they are part of the biome

timber mural
#

I'm okay with modifying the core

young knoll
#

Actually

#

A datapack could do it too

tough crater
#

Hey I need help I keep having a exception in server tick loop and I can’t find any videos on how to solve it

timber mural
#

what i want to do is a kind of complex anti xray which removes all ores on server and sets a tag on each replaced block, then whenever the player is around it sets the block to the tag that it has

#

by looping through players and getting blocks in 10 radius distance

echo basalt
#

pov: paper's anti xray

timber mural
#

it has no anti xray

young knoll
#

It does if you turn it on

echo basalt
#

it literally has an anti-xray that sends fake block data to the client until you can actually see the blocks themselves

timber mural
#

it's not what I'm trying to do

#

sending block data to client

echo basalt
#

And you can make it either mask the real blocks as something else

#

or mask everything as a fake real block

#

one makes your client go completely transparent

timber mural
#

I'm sure that's bypassable

echo basalt
#

it's not

#

It intercepts existing packets instead of sending new ones overriding old data

young knoll
#

People just reverse engineer the ore spawning code anyway

echo basalt
#

run a custom world generator

young knoll
#

Yeah that’s a decent solution

#

Also stops people using a seed cracker to find where ores would be

timber mural
#

that's interesting

#

how do they work?

young knoll
#

They generate the world

timber mural
#

seed crackers

young knoll
#

Oh

#

Usually the work off of stuff that’s tied to the seed

#

Structures, slime chunks, etc

echo basalt
#

bedrock formations

#

Basically they reverse the RNG's seed

young knoll
#

The pillars in the end too I believe

timber mural
echo basalt
#

You can still find out by other stuff

#

end pillars, portal locations

timber mural
#

how would i go about it

echo basalt
timber mural
#

yes

#

that's exactly what I'm asking

#

how exactly would i make it change

young knoll
#

Use an existing plugin for it

#

Like Terra

#

Or write your own

echo basalt
#

or Iris

timber mural
#

how about i just move all structures by 1-5 chunks in random x z coordinates

young knoll
#

I mean structures are just one method

#

Plus you can already move them using the seeds in spigot.yml

viscid fractal
#

Have a problem of my own. working on a crate plugin and on the gui side of things I am struggling with getting events to run. The event I am trying to call on is the InventoryClickEvent. The event will run the first time an inventory slot is clicked on but the second time I click on an inventory slot it won't work. I am using this library for 1.8.8 https://github.com/hamza-cskn/obliviate-invs . I'm really not too sure on what is causing this. the event is stored in the same class as the gui class. There is no error code and it shows no sign of the event being run as "onClick" is not printed to the console.
Event:

@EventHandler
    public void onInvClick(InventoryClickEvent event){
        System.out.println("onClick");
        if(!Objects.equals(event.getClickedInventory().getName(), getTitle())){
            ItemStack item = event.getCurrentItem();
            System.out.println(item.getType().name());
            addInvItem(item);
            player.getInventory().remove(item);
        }
    }

Registering event:

public void loadCrateEditMenu(Player player, String crateName){
        EditCrateMenu menu = new EditCrateMenu(plugin, player, crateName);
        plugin.getServer().getPluginManager().registerEvents(menu, plugin);
        menu.open();
    }
regal scaffold
#

I used the gradle maven publish plugin to add a library to my local repo.

I've gone to the folder to check and it's indeed there
But when trying to depend on it from a maven project it says artifact not found

remote swallow
#

Do you use shadow jar

regal scaffold
#
publishing {
    publications {
        TSansHolo(MavenPublication) {
            from components.java
            groupId = 'me.tomisanhues2.lib'
            artifactId = 'hololib'
            version = '1.0.0-SNAPSHOT'
        }
    }
    repositories {
        maven {
            // Adjust the path to your local Maven repository
            url "file://${System.getProperty('user.home')}/.m2/repository"
        }
    }
}
#

It doesn't even find it on my other projects pom.xml

remote swallow
#

That repo being on there isnt needed

#

Just publishToMavenLocal

timber mural
#

How does item pickup event work? How is it handled? Can someone send the source code page for it because I've tried and i haven't found anything on it

regal scaffold
#

It's in my .m2 local

#

I see it

#

But the project says not found

remote swallow
#

Check if the jar has -all at the end

regal scaffold
#

-dev

#

tsansholo-1.0.0-SNAPSHOT-dev

#
        <dependency>
            <groupId>me.tomisanhues2.lib</groupId>
            <artifactId>tsansholo</artifactId>
            <version>1.0.0-SNAPSHOT</version>
        </dependency>
remote swallow
#

Theres the issue

#

In shadow jar add archiveClassifier.set(''

#

With closing parenthrsis

regal scaffold
#

In the gradle task?

young knoll
#

I believe gradle will also make a publishShadowJar task automatically

regal scaffold
#
tasks {
    // Configure reobfJar to run when invoking the build task
    assemble {
        dependsOn(reobfJar)
    }
    compileJava {
        options.encoding = 'UTF-8' // We want UTF-8 for everything
        options.release = 17
    }
}
remote swallow
#

In shadowJar block if you have one

regal scaffold
#

It's probably cause I'm using paperweight isn't it

remote swallow
#

You can use shadow jar to run reobf jar

regal scaffold
#

I never even touch shadowJar

#

I just run

remote swallow
#

Check the githud for how to run it with shadow jar

#

I always use it with modules so im not muxh hepp

quaint mantle
#

Doesn't maven publish have a task to publish to local

young knoll
#

Yes

quaint mantle
#

yeah

remote swallow
#

Issue is it adsing -dev classifer

quaint mantle
#

And then you just add mavenLocal() to repos

remote swallow
#

If you just want that add the classifier thing in maven

regal scaffold
#

Ok so

remote swallow
#

Top one

regal scaffold
#

Alright then

#

just do classifier?

#

There it goes

remote swallow
#

Yeah

regal scaffold
#

Jesus i have no clue why that happened

#

But thank god

#

Thanks for the help

wise mesa
#

how can I see if a bounding box is intersecting with the ground

#

or with blocks in general

#

and like maybe what direction that's happening in

#

I want to implement ground collision for an item display

cloud cipher
wise mesa
cloud cipher
wise mesa
#

i think that's a paper thing

#

might be wrong

#

I may be confused

young knoll
#

I thought so too

#

Apparently not though

#

Paper just gives the option to disable it

ivory sleet
#

Also

cloud cipher
ivory sleet
#

Consider implementing TabExecutor

cloud cipher
#

yeah i tried that

#

still not working

ivory sleet
#

Yeah how do u register the commands

#

Mind showing me that part?

ivory sleet
cloud cipher
#
@Override
    public void onEnable() {
        // Plugin startup logic
        instance = this;
        new IdolTest();
        new edit();

ivory sleet
#

Just a bit shorter

cloud cipher
#

true

ivory sleet
#

Why do you extend BukkitCommand if I may ask first of all lol

#

Anyway

#

Override tabComplete instead

#

No need to use TabCompleter with BukkitCommand

#

Its for PluginCommand only

cloud cipher
ivory sleet
#

Extremely bad tutorial

cloud cipher
#

Yeah

ivory sleet
#

Did the tutorial tell you to reflect the command map also?

cloud cipher
#

i dont think it did

ivory sleet
#

Well then that’s on you

echo basalt
#

reflect the command map and extend bukkit command are only meant to be used in very niche scenarios where you hate adding stuff to plugin.yml

cloud cipher
#

ok then i think it was the tutorial then

ivory sleet
young knoll
#

If you are just starting stick with the plugin.yml method

ivory sleet
#

Follow that tutorial

cloud cipher
#

yeah honestly that seems like a good idea

echo basalt
#

I only do so because my command engine is part of my utils and I just copypaste across projects

#

It also lets me not register certain commands if a database didn't load, for example

ivory sleet
#

And then for TabCompleter,

implement the interface (or TabExecutor) and override onTabComplete(…)

where you use setExecutor(…) use setTabCompleter(…) also
you may have to do sth like
PluginCommand command = getCommand(…)
TabExecutor tabExecutor = …
command.setExecutor(tabExecutor);
command.setTabCompleter(tabExecutor);

young knoll
#

I feel setExecutor also runs setCompleter

ivory sleet
#

No?

young knoll
#

I might be wrong but I don’t recall ever having to run both

ivory sleet
#

My spigot api impl doesnt do that

#

😭

young knoll
#

Hmm

cloud cipher
young knoll
#

Idk don’t take my word

#

I’ve been using my own system for long enough that I don’t remember

ivory sleet
#

Coll thats not a thing

#

Unless md5 prd it post 1.18

#

Havent read that source file regarding 1.19

young knoll
#

Fair enough

ivory sleet
#

Ye I wish tho 🙏

young knoll
#

Seems like a fairly simple change

#

If the provided instance also implements tabcompleter then do the do

#

(Or tab executor)

ivory sleet
#

I think a better way is to have
<T extends CommandExecutor & TabCompleter> setTabExecutor(T tabExecutor)

#

But ye

wise mesa
#

Is there any way to check if a bounding box is intersecting the ground

#

Or like blocks or something

young knoll
#

That’s an even better idea

wise mesa
#

I want to make it so an item display can “””collide”””

young knoll
#

Wait can generics do that

#

Extends A & B

ivory sleet
#

Yea

wise mesa
#

Yes but

young knoll
#

Neat

ivory sleet
#

:3

wise mesa
#

I don’t think it would allow it as an overload

#

Maybe not sure

#

Because of type erasure

young knoll
#

Pretty sure that’s a unique name

ivory sleet
#

Hmm might be that type param is only allowed at classes and not methods idr honestly

wise mesa
#

Should work with a unique name

ivory sleet
#

Oh acruallt it should work

#

Java does have proper support for intersection types

wise mesa
#

Not specific ones

#

Any blocks that aren’t air

#

Do I gotta for loop through the adjacent blocks and do .contains?

cloud cipher
#

mkay doing the command without the weird command handler thing fixed the autocomplete nonsense, also .setExecutor did in fact use the tab executor!

wise mesa
#

That feels slow

young knoll
#

Oh so it does handle both

#

Nice

ivory sleet
#

But you still have to set the tab completer to be the same instance

fervent robin
#

How would I go about getting the location of the BlockFace that a player placed a block on?

ivory sleet
ivory sleet
#

you have the block itself and place against block

fervent robin
#

Well yeah ik that i meant actually getting the specific blockface it was placed on

ivory sleet
#

just call getFace

fervent robin
ivory sleet
#

BlockPlaceEvent#getBlockAgainst?

chrome beacon
#

Conclure time to sleep it's 3 am

fervent robin
ivory sleet
#

Block#getFace

chrome beacon
#

Or just calculate it from the placed location and placee against block

fervent robin
#

alright thank u both for the help

wet breach
fervent robin
wet breach
fervent robin
#

oh i see

#

How would I check if that BlockFace was in the line of sight of a player?

#

Id have to use raycasting right?

young knoll
#

You can cast a ray from the players eyes to the center of the target block face

#

Of course a player doesn’t have to see the center of a face to place against it so that’s not perfect

wet breach
#

Depends on some factors which would be more ideal

fervent robin
young knoll
#

Oh wait yeah you can just check if the players line of site collides with that block face

#

I’m fairly sure there is a getHitFace

#

RayTraceResult#getHitBlockFace

#

Ray trace from the player -> check if the hit block is your block and the hit face is your face

wet breach
fervent robin
wet breach
#

That is alright you will just have to implement raycasting yourself

fervent robin
#

yeah ik

#

thanks for help guys

wet breach
#

But reason i mentioned line of sight is raycasting has a performance hit or should say it takes a bit more power to do it. So if you dont really need it then dont use it. But do use it if its needed

young knoll
#

Smells to me like anti schematica printer

fervent robin
regal scaffold
#

Hey

#

I'm trying to do something for a specific player depending on the location

#

I need it to be extremely efficient. I was thinking of listening to the Update Entity Position packet. and perform as little calculations as I can

fervent robin
regal scaffold
#

I want to send a packet to the player if they are in range of the hologram

tall furnace
#

Please don't raycast for that.

regal scaffold
#

I need to be able to loop through a lot of hologram locations efficiently. Would a better way be just spawning it for every player on the server?

tall furnace
#

So you want the hologram to only be visible to specific people based on their location?

wet breach
regal scaffold
#

Yeah so

#

Just to make sure frost

#

Keeping 1000+ holograms in a map on runtime

#

And looping through that is most efficient?

wet breach
#

You dont need to loop

fervent robin
regal scaffold
tall furnace
#

Isn't there a player#hideEntity method? Seems like it could be better than messing with packets. Or maybe it's only a hidePlayer...

young knoll
#

Yes there is a hideEntity

wet breach
#

Its not an issue to store 1k holograms in a map. However it is more important the map is setup correctly

tall furnace
#

That's what I would do, personally.

regal scaffold
#

Gotcha

wet breach
#

You want location as the key as that is what you have readily

#

Then each location has the hologram as value

tall furnace
#

That way you don't have to use a function just to get the data you need to check against all the time

regal scaffold
#

But isn't that still heavy on the server?

wet breach
#

No looping needed

regal scaffold
#

If I want to get all the location within 20 block radius of a player

wet breach
regal scaffold
#

packets

#

Dont apply

wet breach
regal scaffold
#

Isn't that still looping through the map?

wet breach
#

No

regal scaffold
#

Getting a "box" of 20 radius from the player and then fidning all the locations in the map that are inside that value

young knoll
#

map.get(key) doesn’t loop

wet breach
#

You find the locations first

regal scaffold
#

.filter does

tall furnace
#

Does map#contains loop?

young knoll
#

containsKey doesn’t

tall furnace
#

Beautiful

wet breach
#

Your only other check is to ensure you skip duplicate holograms. Or holograms you already pulled from map

regal scaffold
#

But that still didn't answer

#

How do I get all the valid locations from a map without looping through it

#

It's not just 1 location, it could be up to like 50

wet breach
#

Its fine to have a loop for math. Thing we are avoiding is looping through an array or map

regal scaffold
#

So you're saying not to go through every map element and checking if the key is within the player radius?

wet breach
#

Correct

regal scaffold
#

How is that even possible I am so confused

#

I thought to find all the keys that are within 2 values in a map I still need to loop through all of them

tall furnace
#

If it's a square of 20 blocks width and length, check for(i=0; i < 20*20; i++)

wet breach
#

So we get our locations first and then check if any exist in the map. Using get. Get will return something or nothing

regal scaffold
#

But locations from a 20 radius from a player

tall furnace
regal scaffold
#

Is literally every possible block

#

in a 20 radius

regal scaffold
#

That's like a sphere of locations around the player

wet breach
#

20+cuurent location. Make this loop to get all locationa first

fervent robin
#

its fast enough it wouldnt harm performance id imagine

tall furnace
#

8,000 isn't that many tbh

regal scaffold
#

tf

#

Seriously

tall furnace
#

Is just numbers

#

If it was objects it would be different

regal scaffold
#

So getting ~500 possible locations and then getting the keys from a map

#

Is more efficient than looping through a map

wet breach
#

Yes

fervent robin
#

yes as you skip the ones you dont need

young knoll
#

Alternatively you could use some kind of spatial partitioning

wet breach
#

Because get fails fast

regal scaffold
#

So where do I store the locations?

wet breach
#

You dont

regal scaffold
#

I thought we're avoiding going through stuff

#

My brain cannot seem to wrap my head around this

wet breach
#

Check in the loop as you do the math. Then pull the holograms you found into temp array

regal scaffold
#

Should I use location or vector?

wet breach
#

Location

tall furnace
#

You're only looping over an iterating integer, not over a map or list

regal scaffold
#

Map<Location, Hologram> hologramList;

#

Then using math get a possible location radius X

#

Around the player

#

Then try to get that location from the map

#

And store into a temp array

#

And then eventually loop through the array

wet breach
#

I would make it a concurrenthasmap

#

This loop for locations and checking map can be done in a separate thread per player

regal scaffold
#

Tell me something, how much more efficient is this than doing hologramList.filter

#

Lets say, 1000 locations

#

for 100 players

fervent robin
#

a lot more id think

regal scaffold
#

So 1000 map elements for 100 players being checked every move event.

fervent robin
#

since filter loops and get doesnt

regal scaffold
#

This is without optimizing stuff like filtering out micromovements and useless stuff

#

I just want to get a raw estimate of how much better this can be

wet breach
#

Will have to wait till my break to explain it to you in why it is better

regal scaffold
#

I would appreciate it

#

Thank you

tall furnace
#

What you could do is ONLY check the locations that are 20 blocks away. If you check every time their block location changes, that's all you need to update.

#

Then you only track those very few that are in range until they leave range.

regal scaffold
#

Actually that's true

#

Alright time to do some testing now

tall furnace
#

Good luck

wet breach
fervent robin
wet breach
#

Its not even the mid of my shift

#

I practically started it. I work from 7:30pm to 6am

#

But yes i commonly while at work help people from my phone lmao

fervent robin
#

u must have a job that doesnt require that much attention lmao

wet breach
#

I am a tire technician

echo basalt
#

pay too little attention and you'll have a fancy projectile heading someone's way

wet breach
#

Lmao

#

I dont repair tires unless we have none

#

I just replace them and that doesnt involve removing from rims or anything

#

Only tires i commonly mount or unmount is super singles

young knoll
#

I happen to be a super single

#

Not a tire though

river oracle
#

Java Developers are Tires confirmed

tall furnace
#

I really don't get it but she will sit there for hours, alternating between scrolling through social media and watching me code.

echo basalt
wise mesa
#

which coordinates correlate to which cardinal directions

#

too lazy to open the game

tall furnace
#

Oof

#

Isn't North positive Z?

wet breach
#

If i recall its. X is east and west

#

And z is north and south

tall furnace
#

^

wise mesa
#

appreciate

#

positive x is east?

wet breach
#

Correct

#

And y for up and down

wise mesa
#

thanks

#

yea I knew that one 😄

wet breach
#

Since it gets a direction too

wise mesa
#

that ones hard to mix up

#

well unless you deal with other coordinate systems regularly i guess

#

omg this is gonna create so much garbage

#

but I'm too lazy to figure out a smarter way

wet breach
#

Smarter way for what?

wise mesa
#

doing the thing I'm doing

#

too lazy to explain as well

#

I'll just send code

#

?paste

undone axleBOT
river oracle
#

Most people die of boredom at the site of coding

wise mesa
#

there is also a lot of code replication

#

because once again im too lazy to extract it out

#

just look at checkUp and you'll get the idea

wet breach
#

They probably just like seeing the work even if it doesnt make sense to see the end result. Its like acknowledging the beauty in how things work from start to finish even if you really dont understand how or why it needs to be that way

#

Why are you using vector3f?

wise mesa
#

making physics

#

also I forgot to finish that function lol

#

clearly

wet breach
#

All that could be condensed into just a single method of 3 for loops

wise mesa
#

I knowwwww

wet breach
#

Direction is going to be the opposite of the side

#

Unless you want the side direction

wise mesa
#

I want to check the square on that side

#

of the box

#

to see if its colliding with terrain

#

for example up should see if there's anything intersecting the top of the box

wet breach
#

Anyways, your only issue is going to be working with negatives and positives together

wise mesa
#

yup

#

i was just worried about making all those block objects

wet breach
#

But that shouldnt be hard really. Only need to compare the x's with each other. If both x's are negative then the smallest x is east. If one is negative the other positive. The positive is east

wise mesa
#

okay

#

that helps

#

appreciate it