#help-development

1 messages · Page 2072 of 1

spring pike
#

just want to keep track of grass blocks placed by a specific group of players

#

and that should work

tender shard
#

then I'd use the chunk's pdc

spring pike
#

ty 🙂

tender shard
#

np 🙂

noble lantern
#

okay im slightly angry at myself

#

spent all day playing with spawners trying to get them to work for custom blocks lmfao

#

tried noteblocks

#

keep in mind my server tps is like 11

vocal cloud
#

scareDog 11 tps

noble lantern
#

for some reason my i7 cant run 20tps

#

probably because i spent all day running /reload confirm on it

vocal cloud
#

Core i7-920?

noble lantern
#

9750H

vocal cloud
#

How can that not run 20TPS?

noble lantern
#

i have no idea tbh

#

i do have a bunch of stuff open too

#

this doesnt help either

wet breach
#

also they are probably not using optimal JVM flags for both client and server

vocal cloud
#

It's a pretty mid tier CPU lol

tender shard
#

maybe do a timings report 😛

wet breach
#

I have an i7-4770K so I am going to assume its the non optimal flag usage 😛

noble lantern
#

yep its just normal java -jar

#
  • only 16 gigs of ram
#

Only issue with note blocks is event at 20tps you can slightly see the block its at beforehand even at 20tps :((

tender shard
#

you can definitely prevent that

#

how are you setting the blockdata?

noble lantern
#

This is just testing code, so its not organized at all

#

so ignore unchecked casts etc

#

i think my servers still struggling from spawners earlier

#

ill send a new video at 20 tps

tender shard
noble lantern
#

after setting block data correct

#

ill try

tender shard
#

yes

#

I think currently the client thinks they set a noteblock but then it doesn't happen since there's already a block there, idk

#

so maybe the client thinks for 1 tick that a regular noteblock is sitting there

noble lantern
#

cancelling event just cancels block however

#

you gave me an idea

#

one sec

tender shard
#

or manually do setType(Material.NOTEBLOCK)

#

before applying the block data

noble lantern
#

my idea i had was cancelling blockplaceevent before setting the type but same behavior

#

just cancels place alltogether

fervent gate
#

Is there a way to directly get the direction to the player from a certain location?

noble lantern
#

you can just get the player and then getFacingDirection cant you?

fervent gate
#

is that a thing? Lemme try that

noble lantern
#

Location#getDirection returns a Vector

#

cant remember what vectors translate to in the terms of north south east west etc

tender shard
tender shard
sharp bough
noble lantern
tender shard
#

this gets a location that looks at another location

noble lantern
tender shard
#

ItemsAdder too

noble lantern
fervent gate
tender shard
#

e.g. if you want the direction from Loc1 to Loc2, use Loc1 as original, Loc2 as destination and it returns a location that is at the same "location" as Loc1 but is directly facing Loc2

fervent gate
#

I'll try that, thank you!

tender shard
#

np

noble lantern
summer scroll
#

So I have this code where it will get the yaw and pitch to make player look at specific location, but for some reason the player looking at the opposite way rather than looking at the exact location.

Location subtracted = enterLocation.setDirection(modelLocation.subtract(enterLocation).toVector());
tender shard
#

switch the args

#

enterLocatino.setDirection(enterLocation.substract(modelLocation)).toVector());

tender shard
# noble lantern see here

try this

    @EventHandler
    public void onDeath(BlockPlaceEvent event) {
        Block block = event.getBlock();
        event.setCancelled(true);
        BlockData data = Bukkit.createBlockData(Material.RED_CANDLE);
        Candle candle = (Candle) data;
        candle.setCandles(4);
        candle.setLit(true);
        event.getBlockReplacedState().setBlockData(candle);
    }
#

this way you can cancel the event and set the blockdata in the same tick

noble lantern
#

weird that getBlockReplacedState doesnt exist on 1.18.2

tender shard
#

I am on 1.18.2 too

noble lantern
#

herderder

#

i did block

#

sorry its 6am

tender shard
#

no, it's 15:21

worldly ingot
#

👀

tender shard
#

choco I decided to rename MessageAPI to Oyster Message

#

it can't get fancier than that

tardy delta
#

MessageConsumer

#

MessageEater

summer scroll
#

Still testing it, one sec.

tender shard
worldly ingot
tender shard
#

everyone loves oysters

worldly ingot
#

I guess unless you have a shellfish allergy

summer scroll
noble lantern
#

Essentially same issue, where the block is stone for a slight millisecond

However when its 20tps this is a lot less noticable

#

when i record my tps drops lmao

worldly ingot
#

Yeah you're not going to be able to get around that

#

Client is placing stone, server tries to place stone, calls event, you tell it otherwise, server has to tell the client "no no no, it's not stone anymore"

noble lantern
#

time to make a new MC client

#

xD

worldly ingot
#

Only way you'll fix that is by giving the player a model data'd note block

#

even then I think it will show as a note block for a sec

noble lantern
#

ah when i actually add the system for this it will be a modeled data note block

#

rn its just a modeled data stone atm

#

i could

#

make it netherrack/similar material

#

would make it a lot less noticable

worldly ingot
#

Yeah slightly

#

Better yet, you can try to make use of BlockDataMeta

glass mauve
#

can I add custom data to an Player with a method? smth like player.add(Role.A);, Role could be an enum

worldly ingot
#

Give a note block item with custom model data, set its BlockDataMeta to the note block you want to place

#

Should be seamless

worldly ingot
noble lantern
#

thanks!

glass mauve
#

yea, I dont want to add a new method, my question was if Player already got a method for custom data, bc I couldnt find one

tender shard
tender shard
golden turret
#

is the potion drinking sound sent by the server or it is played by the client?

tender shard
#

have you never played on a server with lag? 😛

golden turret
#

i only play at 127.0.0.1

tender shard
#

@golden turret

golden turret
#

thanks

noble lantern
#

Choco

#

ily

worldly ingot
#

😄

noble lantern
#

sorry for talking im in vc lmao

#

i can now sleep

worldly ingot
#

lol npnp. Glad you got it sorted

tender shard
noble lantern
#

lmao i was silent the whole time figuring this out

#

that flicker was gonna drive my crazy

#

and with this i dont even need to handle anything for block place

#

okay but i will have to handle block break but imma have to do that anyways

#

You basically just create your own parser

#

if string endswith "m"

string.remove("m")

Integer.parseInt(thatString);

ban for thatparsedint

tender shard
#

I'd use regex

([0-9]+)([a-z]+)
noble lantern
#

i cant use regex for shit

tender shard
#

the first group will be the number, the second group the uit

tender shard
#

[0-9] means 0 to 9

#

and + means (1 or more of the previous thing)

noble lantern
#

alex is smart asf

#

i should really dedicate a day to learning regex

brave goblet
#

same honestly

#

wait

#

wait

noble lantern
#

?

brave goblet
#

why is there a ":"

noble lantern
#

he was prolly string.split(":")

brave goblet
#

Oh makes sense

noble lantern
#

dalton the human compiler

brave goblet
#

Oh makes sense

summer scroll
#

@tender shard , I think I found the problem since it's only occurs in 1.16, basically I'm trying to spawn a packet-based armor stand that looking at specific direction, but for some reason the method to set armor stand location in 1.16 is causing the issue.

brave goblet
#

i made sum

#

for my discord bot

#

i can share the code if u want

tender shard
#
    public static void main( String[] args ) {
        String string = "52w";
        Pattern pattern = Pattern.compile("([0-9]+)([a-z]+)");
        Matcher matcher = pattern.matcher(string);
        if((matcher.find())) {
            int number = Integer.parseInt(matcher.group(1));
            String unit = matcher.group(2);
            System.out.println("Number: " + number);
            System.out.println("Unit: " + unit);
        }
    }
noble lantern
#

ELGAR THE GM DEV

tender shard
#

np

tender shard
#

btw you wanna compile the pattern only once, you can put it in a static final variable

#

nothing

#

it's just not needed

#

it's just a tiny waste of CPU everytime

brave goblet
#

that looks easy

noble lantern
#

regex is easy if you know how to write it

brave goblet
#
 String[] splitMessage = e.getMessage().getContentRaw().split(" ", 4);
                        int endpos = splitMessage[2].length();
                        int beforeEnd = endpos-1;
                        String del = splitMessage[2].substring(0,beforeEnd)+"";
                        String time = splitMessage[2].substring(beforeEnd,endpos)+"";
                        int delay = Integer.parseInt(del);
                        TimeUnit unit = getUnit(time);```
noble lantern
#

i just steal it from google

tender shard
#

regex isn't hard at all, the syntax is just a bit complicated sometimes

noble lantern
#

thats js btw

brave goblet
#

It's the only way ik how to do it

brave goblet
noble lantern
#

wait no its not

#

sorry

#

7am

brave goblet
#

lmao

#

it's ok

noble lantern
#

i read int as let lmao

brave goblet
#

sleep exists yk?

noble lantern
#

im addicted to answering spigot questions

glossy kraken
#

I'm editing the commands.yml file and adding alliases, but some of then don't show up/work.

oponly:
  - execute if entity $$1[tag=op] run $$2-

unban:
 - oponly @s tellraw @s {"text":"Trying to unban $$1...","color":"red"}
 - oponly @s pardon $$1 -
  
unban-ip:
 - oponly @s tellraw @s {"text":"Trying to ip unban $$1...","color":"red"}
 - oponly @s pardon-ip $$1

Edit: Found the problem was something else i accidentally edited 🤦‍♂️

noble lantern
#

besides that one

brave goblet
#

also could have a 99% chance of breaking if changing situations lol

noble lantern
#

idk jack shit about that

noble lantern
#

okay gnight yall

brave goblet
#

gn <3

#

ty :D

steady rapids
#

hello, anyone knows what regulates the distance at which a mob spawner works? in the server code

brave goblet
#

wait

glossy kraken
brave goblet
#

the issue might be where u do -ip $$1

noble lantern
brave goblet
#

the yml file might idk how it works but ye skip it idk

#

ANy ways off to help mom rq

hybrid spoke
#

only thing bothering me are the double parantheses around matcher.find()

glass mauve
#

how can I create a chat message with a chat command linked, like Click here and then a command get triggered

eternal night
#

?chatapi

#

sad

glass mauve
#

thanks

warm trout
#

Trying to do an async block search, how can I execute a task after it’s done?

#

Can I someone how tell the program to run something after it”s done?

eternal oxide
#

runtask

warm trout
#

Oh wait

eternal oxide
#

simply use runTask in the Scheduler

warm trout
#

I can just check for a Boolean

#

True

#

I’m dumb

faint harbor
#

Does anyone know what causes the /command:command syntax to show up in the tab completer, as it only seems to happen sometimes and I'm not sure what causes it

vocal cloud
granite owl
#

short question

faint harbor
#

As far as I know, no

granite owl
#

whats the difference between .getPlayer() and getPlayerExact();

#

the docs dont really give much info

vocal cloud
faint harbor
#

^

granite owl
#

kk ty

faint harbor
vocal cloud
#

Whats the name of the command

faint harbor
#

and the tabcomplete shows as /tag:tag

vocal cloud
#

There is a vanilla tag command I imagine

faint harbor
#

I'll go investigate

vocal cloud
#

I mean you can investigate but your command conflicts with a vanilla tag

#

so you have to specify the namespace

faint harbor
#

this has happened with non-vanilla commands though

vocal cloud
#

You can execute commands with a namespace

granite owl
#

is this okay to retrieve the UUID of a player regardless of if hes online or not? ```java
public static UUID getPlayerUUID(String player)
{
Player pOn = Bukkit.getPlayer(player);
OfflinePlayer pOff = null;

    if (pOn == null)
    {
        for (OfflinePlayer p : Bukkit.getOfflinePlayers())
        {
            if (p.getName().equalsIgnoreCase(player))
            {
                pOff = p.getPlayer();
                break;
            }
        }
    }
    
    return ((pOn != null) ? pOn.getUniqueId() : ((pOff != null) ? pOff.getUniqueId() : null));
}
#

then he should be targeted by the last known name

#

last known to the server

#

which would also be the last known name to the admin retrieving the uuid

vocal cloud
#

Which could be wrong

granite owl
#

yea but

#

getOfflinePlayers() what i iterate is retrieved from the known player list

vocal cloud
#

If you're doing something that has the word "admin" in it use a database

molten hearth
#

anyone here have experience with QualityArmoryVehicles? It seems that PlayerEnterQAVehicleEvent never fires for me

#
public class Mission1PlayerEnterVehicleHandler implements Listener {

    @EventHandler
    public void onCarEnter(PlayerEnterQAVehicleEvent event) {
        System.out.println("cancelled");
        event.setCanceled(true);
        return;
    }

    @EventHandler
    public void onTurn(VehicleTurnEvent event) {
        System.out.println("turn");
        return;
    }

}
``` it never seems to print fired when I enter a vehicle but turn works correctly
summer scroll
#

Have you registered the listener?

molten hearth
#

I mean yeah since the turn shows up

vocal cloud
#

Do they have a support discord? Ask there

granite owl
summer scroll
#

Yeah you should ask them directly

molten hearth
#

I couldnt find it so im assuming its private for buyers and it came with a setup that the server owner purchased

granite owl
#

ive worked myself in how command maps work the last few days, when registering a command the command gets registered multiple times

vocal cloud
#

Well you'd have to ask whoever made the API

granite owl
#

namespaced, non namespaced, aliases

#

and all the commands then link to one and the same command instance

#

thats why u get /minecraft:op and /op

#

/bukkit:reload /reload /bukkit:rl /rl

faint harbor
#

Thanks for the help people

granite owl
#

ive actually written this

#
public static void patchOpCommand()
    {
        Bukkit.getServer().getConsoleSender().sendMessage("CONSOLE: " + ChatColor.DARK_RED  + "Patching OP Command, this must occur after loading.");
        
        try
        {
            Field mapField = Bukkit.getServer().getClass().getDeclaredField("commandMap");
            mapField.setAccessible(true);
            SimpleCommandMap commandMap = (SimpleCommandMap) mapField.get(Bukkit.getServer());
            
            Field cmdsField = SimpleCommandMap.class.getDeclaredField("knownCommands");
            cmdsField.setAccessible(true);
            @SuppressWarnings("unchecked")
            Map<String, Command> cmds = (Map<String, Command>) cmdsField.get(commandMap);
            
            Command opCmd = new OpCommand("minecraft:op");
            Command deopCmd = new DeopCommand("minecraft:deop");
            
            cmds.replace("minecraft:op", opCmd);
            cmds.replace("op", opCmd);
            cmds.replace("minecraft:deop", deopCmd);
            cmds.replace("deop", deopCmd);
            cmdsField.set(commandMap, cmds);
            
            mapField.setAccessible(false);
            cmdsField.setAccessible(false);
        } 
        catch (Exception e) 
        {
            e.printStackTrace();
        }
    }
#

to override the op command for example

#

but you can still disable namespaced commands in the Bukkit.yml

#

if you hate it too much

granite owl
warm dust
#

Hello can someone explain me how to use this : java Event.getClickedInventory().getHolder()

grim ice
#

loop through Bukkit.getOnlinePlayers() and getOfflinePlayers()

granite owl
#

.getOfflinePlayer() is deprecated

grim ice
#

if the name equals the input then return the uuid found

worldly ingot
granite owl
worldly ingot
#

Can't tell you how to use it if you have no reason to use it

granite owl
#

ik

#

well yea

#

thats why i wrote my method

#

to get the uuid of a player

grim ice
#

ur method has a lot of useless checks

#

and its obfuscated as well

#

if you wanna avoid requests to mojang just do as i said

#

loop through both offline and online players, then in each loop check if the name of the entity equals the input

#

if so return it

vocal cloud
#

Or use a databse. Log on join.

grim ice
#

that sucks

#

reinventing the wheel

#

and taking space for no reason

vocal cloud
#

If you want to mess with offline players it has a reason

granite owl
vocal cloud
#

getOffline does

granite owl
warm dust
#

I create a gui but idk how to check if is the ClickedInventory is the gui

#

Someone know

grim ice
#

just loop through online players and offline players

granite owl
#

thats why i want to avoid iterations if possible

vocal cloud
#

Databasee

granite owl
vocal cloud
#

Use the UUID as the key not the value

#

Or use a database

grim ice
#

no

#

WHY ARE YOU STORING

#

IT.

#

bukkit already does that for you

#

youre doing the same

#

LMFAO

#

youre gonna loop anyways?

vocal cloud
granite owl
#

what if i cast getOfflinePlayers() into an ArrayList, getOfflinePlayer() and then check if the arraylist contains the offline player. then this could only be jinxed if 2 players on my server swap names which is highly unlikely XD

#

yea ik thats what i mean

#

i just didnt write it out now

vocal cloud
#

Well usually you want to avoid being stuck in that scenario

#

Hence using some sort of database

granite owl
vocal cloud
granite owl
#

yea database

vocal cloud
#

Store

  1. Last known name -> UUID
#

When they join. Do a quick verify and voila it's always up-to-date

#

OfflinePlayer

worldly ingot
#

Minecraft pulls the skin asynchronously

vocal cloud
worldly ingot
#

Yeah. player.getPlayerProfile().getTextures()

vocal cloud
#

http://textures.minecraft.net/texture/b3fbd454b599df593f57101bfca34e67d292a8861213d2202bb575da7fd091ac

cursive loom
#

Hey I have a problem with a plugin, when the do /fly i put him in a ArrayList but if the player leave the server and come back he is on the ArrayList but when he do /fly the plugin put him again in the list, do you know what I can do to patch that ?

                    if (TFLY_UTILS.isFlyer.contains(p)) {
                        Bukkit.broadcastMessage("1");
                        endFly = (Long)this.getFlyer(p).get(p.getUniqueId());
                        now = System.currentTimeMillis();
                        diff = endFly - now;
                        if (diff <= 0L) {
                            this.getFlyer(p).remove(p);
                            if (TFLY_UTILS.TempFly.containsKey(p)) {
                                TFLY_UTILS.TempFly.remove(p);
                            }

                            p.sendMessage("§B§LFLY §8§l» §cVotre de temp de fly est désormais finie.");
                        } else {
                            if(!p.isFlying()){
                                p.setAllowFlight(true);
                                p.setFlying(true);
                            }
                            p.sendMessage("§B§LFLY §8§l» §aTemps restant: §e" + TFLY_UTILS.getTime(endFly) + "§a.");
                        }
                    } else {
                        Bukkit.broadcastMessage("0");
                        if (TFLY_UTILS.getRank(p).equals("capitaine")) {
                            endFly = System.currentTimeMillis() + tickUtils.getTick("Heures", 4);
                            this.setFlyer(p, endFly);
                        } else if (TFLY_UTILS.getRank(p).equals("second")) {
                            endFly = System.currentTimeMillis() + tickUtils.getTick("Heures", 2);
                            this.setFlyer(p, endFly);
                        }else if (TFLY_UTILS.getRank(p).equals("maître_d'équipage")) {
                            endFly = System.currentTimeMillis() + tickUtils.getTick("Heures", 1);
                            this.setFlyer(p, endFly);
                        } else if (TFLY_UTILS.getRank(p).equals("quartier-maître")) {
                            endFly = System.currentTimeMillis() + tickUtils.getTick("Minutes", 30);
                            this.setFlyer(p, endFly);
                        }

                        p.setAllowFlight(true);
                        p.setFlying(true);
                        TFLY_UTILS.isFlyer.add(p);
                        p.sendMessage("§B§LFLY §8§l» §aVotre fly est activé profités en sinon il sera perdu pour ajourd'hui.");
                    }
public static ArrayList<Player> isFlyer = new ArrayList();
worldly ingot
#

Because Player instances are invalidated when they leave

tardy delta
#

mwoa the bible

worldly ingot
#

Quick fix would be to use a Set<Player> but I personally advise a Set<UUID>

cursive loom
#

You think if I put the UUID thats work ?

vocal cloud
#

Yeah don't store the whole player object just use UUIDs

worldly ingot
#

Using a List<UUID> would work too, but a Set<UUID> is preferrable

cursive loom
#

Ok I gonna try thx !

tardy delta
#

if you use a list check if the list contains the player before, otherwise use a set and use Set#add which returns whether or not the player could be added

#

but ye uuid's are preferrable

grim ice
#

Literally no point of using it

tardy delta
#

lol just dont use a list

#

thats why i said check List#contains

cursive loom
rough drift
#
for (int x = minX; x <= maxX; x++) {
  for (int z = minZ; z <= maxZ; z++) {
    for (int y = minY; y <= maxY; y++) {
      if(world.getBlockState(loc.set(x, y, z)) instanceof InventoryHolder) {
        ...
      }
    }
  }
}
```This is looping from 2 chunks away in each direction (so diag -2 chunk 0 0 to diag +2 chunk 15 15), and its taking a second or two, is there a way i can speed it up
viral crag
#

what are you trying to do, that looks rather inefficient

#

almost looks like you are trying to xray

rough drift
#

I am trying to find blocks that are chest-like

rough drift
ancient plank
#

imagine

viral crag
#

well you are only moving in a diagonal line ... you could use a vector for that

ancient plank
#

16x16x256

rough drift
#

i am using a diagonal to find the corners

#

and then going trough each block

ancient plank
#

a chunk has a lot of blocks

viral crag
#

that code will only run the match when you increment x,y,z so you are moving diagonal only

hasty prawn
#

Chunk#getTileEntities ?

rough drift
ancient plank
#

lol

rough drift
#

rn it only does stuff like, chests, barrels, furnaces, etc

#

will getTileEntities do the same?

hasty prawn
#

Yes

rough drift
#

oh

#

pog

ancient plank
#

it gets tile entities

viral crag
#

you can find all the silverfish you want now

rough drift
#

like it has an array of tileentities and whenever one gets added/removed it updates that?

hasty prawn
#

I have no idea how it works tbh

rough drift
#

Anyways, there is an event named PlayerInteractEvent, is there one for when the player stops using an item as well?

brave goblet
#

Guys join the Alex cult today

rough drift
brave goblet
rough drift
#

ohk

vocal cloud
#

So what exactly is the purpose of this

rough drift
#

wdym

vocal cloud
#

What is the purpose of searching through an entire chunk for inventories

rough drift
#

I am makin a plugin for someone just wanted to know if I could have made the search faster

#

as I don't really work with blocks most of the time

#

mostly player-related data

vocal cloud
#

Are you searching every chunk on-load?

rough drift
#

nah

#

its an item

viral crag
#

searching for mines and the end portal

rough drift
#

lol

viral crag
#

otherwise its an abusive greifing plugin

tardy delta
#

how would i call the two generic types when the one is the start value and the other one is a value after transformation?

#

K V isnt what im looking for

tardy delta
#

hmm

rough drift
#

Before After

tardy delta
#

mhm ye

rough drift
#

I am just makin what I am told xD

viral crag
#

that worked out well for a lot of people

rough drift
#

y e s

tardy delta
rough drift
#

but like

tardy delta
#

T is the applying function

#

maybe i should change that to F

rough drift
vocal cloud
#

To Be or not To Be

viral crag
#

TBA x-rated

rough drift
#

hold on

#

what

rough drift
#

Modifier

viral crag
#

doesnt search for carwash in tenor gifs

rough drift
#

whayt

#

the

#

fucik

tardy delta
#

maybe

viral crag
#

football function

rough drift
#

Facebook function

viral crag
#

then it would be M E T A

vocal cloud
#

change the A to an I

rough drift
tardy delta
#

mhmmh

grim ice
#

or was this suggested

#

btw

#

after talking about getting uuid from name

#

i searched in my old projects and found dis

rough drift
#

gettin name from UUID?

grim ice
#
    private UUID getPlayerUUID(String nameOfPlayer) {
        return Optional.of(Bukkit.getOnlinePlayers().stream()
                .filter(onlinePlayer -> Objects.equals(onlinePlayer.getName(), nameOfPlayer))
                .collect(Collectors.toList()).get(0).getUniqueId())
                .orElse(Optional.of(Arrays.stream(Bukkit.getOfflinePlayers())
                        .filter(offlinePlayer -> Objects.equals(offlinePlayer.getName(), nameOfPlayer))
                            .collect(Collectors.toList()).get(0).getUniqueId()).orElse(null));
    }
rough drift
#

oh

#

my

#

fucking

#

god

#

what

#

the

#

fuck

grim ice
#

thats so messy LMAO

rough drift
#

I can't even read this

grim ice
#

I CANT EITHER

tardy delta
#

one liner

#

fancy

rough drift
grim ice
#

its kinda cool that its a one line

#

but also unreadable without rainbow plugin

rough drift
#

to do what 52 characters also can

grim ice
#

this is rainbow plugin btw

vocal cloud
#

if you need that plugin you're just bad at bracket management kekw

grim ice
grim ice
#

it makes thing look more readable eitherway

rough drift
#

i have something else

grim ice
#

i have that too but its rainbow

rough drift
#

but why

cosmic pelican
grim ice
rough drift
grim ice
cosmic pelican
#

Bro 💀

grim ice
#

Lol

rough drift
#

The youngest picture of you, is also the oldest picture of you

cosmic pelican
#

Jesus christ

grim ice
#

OH RIGHT I REMEMBER YOU RELOC

#

ur the one who interviewed me in neptune services

rough drift
#

You can only buy used mirrors

cosmic pelican
#

Performance on that thing would definitely be 0

tardy delta
#

aaaaah

cosmic pelican
cosmic pelican
#

I just rate code that Luuk sends me.

grim ice
#

yeah

cosmic pelican
#

I've never passed anyone

rough drift
#

I have to manually give it performance

grim ice
#

LOL

cosmic pelican
rough drift
grim ice
#

and its O(n) as well

cosmic pelican
#

getOfflinePlayer won't crash your server.

grim ice
#

itll freeze

cosmic pelican
#

& if you need to you can run it async.

rough drift
cosmic pelican
#

Maybe on legacy versions?

grim ice
#

it will if player u want doesnt exist

#

in server

cosmic pelican
#

Oh yeah

grim ice
#

data

rough drift
#

offlinePlayer will run async iirc

grim ice
#

since itll send a blocking request

rough drift
#

o

#

bukkit bad

#

L

#

get rekt

cosmic pelican
grim ice
#

oh yeah

#

but my method is O(n)

grim ice
crisp steeple
cosmic pelican
crisp steeple
#

indefinitely being frozen is pretty much the same as crashing

fleet pier
grim ice
#

Thread.sleep(10000);

#

WHY IS MY SERVER LAGGING

#

SPIGOT SUCS

cosmic pelican
crisp steeple
#

For real

cosmic pelican
#

Thread.sleep(Long.MAX_VALUE);

fleet pier
rough drift
#

no no

fleet pier
#

LMAO

grim ice
#

that wont work

#

i think

cosmic pelican
#

I got you a better one @grim ice

grim ice
#

cuz it doesnt accept a long

rough drift
#

Thread.currentThread().interrupt();

cosmic pelican
#

System.exit(0);

cosmic pelican
#

are you dumb

viral crag
fleet pier
#

yuh ik

#

but idk why

#

🤔

rough drift
#
public void crash() {
  crash();
}
grim ice
#

OH VM

cosmic pelican
#

@grim ice It is a long...

grim ice
#

NVM

cosmic pelican
#

LOLLLLLLL

grim ice
#

yeah

#

LMAO

#

I FORGOT

rough drift
#

don't call crash()

cosmic pelican
rough drift
#

The JVM: yep that's fine

#

int[][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][][] crashArray = new int[100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100][100];

cosmic pelican
#

Not sure as I've never looked into structures myself, but @grim ice should be able to comment on that.

grim ice
crisp steeple
grim ice
#

its fine as long as u dont spam them

#

However IO Operations should be done offthread yk

#

like deleting a structure

rough drift
#

so um

#

I realized a problem

#

does getTileEntities get echests?

cosmic pelican
grim ice
#

Yeh

rough drift
#

ohk

grim ice
#

saving is io too

#

lol

rough drift
#

now, can i check when a player stops using an item? (Such as: Spyglass, Bow, Trident, etc)

grim ice
#

from 1.17.1 yeah structures exist

#

thats why my entity serializer only works for 1.17.1 :(

#

kinda limits it tbh

rough drift
#

#OldVersionsShouldntBeSupported

grim ice
#

lol

#

i cant support it even if i want to

rough drift
#

which is

#

amazing

grim ice
#

my whole library is just abstracting an already abstracted concept but add to that a cool strategy

rough drift
#

and that's when you give the middle finger to 1.16.5 and lower users

#

because old versions shouldn't be supported

grim ice
#

i also have chunkserializer btw Lol

rough drift
#

iirc 1.16.5 is like 1-2 years old

grim ice
#

it just takes a chunk makes it a structure and done

#

but it prob bugs a little

#

yeah its bugged rn i fucked a little

rough drift
#

L

grim ice
#

i forgor structures only contain 48x48x48

rough drift
#

L

#

L

#

L

#

make multiple

grim ice
#

yeah

rough drift
#

do var count = world.getMaxHeight() / 48

grim ice
rough drift
#

o ye

#

or ceil it

fleet pier
rough drift
grim ice
#

yeah my bad

#

i said the wrong thing

rough drift
#

if you floor it you might loose data

grim ice
#

ik

#

wdym

vocal cloud
#

Fred. James. Bill

distant forge
#

Im trying to make a custom turtle mob right now, but im so confused about all the Classes/Interfaces and when to use what.
There is org.bukkit.turtle, org.bukkit.craftbukkit.v1_18_R2.entity.CraftTurtle and net.minecraft.world.animal.Turtle.
Does anybody know some good resources about all of these?

opal juniper
#

you can use JavaPlugin#getConfig to get the config of that plugin

#

and then getString(path) to get a string set at a path

undone axleBOT
midnight shore
#

Hi, how can i set a block to be a Crop with a specific state? For example wheat state 1

vocal cloud
#

Probably by getting the state of the wheat and setting it

sullen dome
#
    @Override
    public void onEnable() {
        protocolManager = ProtocolLibrary.getProtocolManager();
        System.out.println(protocolManager);
        Bukkit.getPluginManager().registerEvents(this, this);
    }```
and ideas how this is possible? or why it's happening at least?
#

with ProtocolLib*

vocal cloud
sullen dome
#

both yes

#

its loaded actually at the server startup before worlds

#

no errors no nothing

crisp steeple
sullen dome
#

i dont think so if it has it as depend

vocal cloud
#

They recommend loading the manager in the onLoad. I wonder if moving it there would do anything

sullen dome
#

lets try

jagged thicket
#

WHY

sullen dome
#

no i'm not lol

jagged thicket
#

oh good

sullen dome
#

if you could read correctly lol

jagged thicket
#

yea i coudn't

sullen dome
#

also no, on load load does same result

vocal cloud
quaint mantle
#

how else would he compile it

sullen dome
#

yea else i wouldn't even get the classes

vocal cloud
#

No no like scope

sullen dome
#

uhh

quaint mantle
#

there would be a ClassLoadError otherwise

#

or something like that

sullen dome
#
            <repository>
                <id>dmulloy2-repo</id>
                <url>https://repo.dmulloy2.net/repository/public/</url>
            </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.18.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.comphenix.protocol</groupId>
            <artifactId>ProtocolLib</artifactId>
            <version>4.8.0</version>
        </dependency>
    </dependencies>```
vocal cloud
#

Just for fun add a <scope>provided</scope> under the protocollib version

#

and try it

sullen dome
#

i guess

#

uhhh

#

that does fix it lmfao

sullen dome
#

why tf

#

does it fix that

vocal cloud
#

I'm guessing because you're shading it in and calling the plugins copy and not the servers shrug1

sullen dome
#

aight i guess

#

thanks

vocal cloud
#

Anyways have fun with it mmlul

sullen dome
#

i won't lol

#

i'm like completely dumb in terms of packets

rough drift
#

Is there a stop interact event? (like stop pulling a bow, stop using spyglass, etc?)

wet breach
# sullen dome does it fix that

the answer you seek is when you use the maven shade plugin, maven shades in all dependencies listed unless you use the provided scope (Telling it not to)

vocal cloud
#

Basically

wet breach
vocal cloud
#

Could probably listen for the packets

rough drift
wet breach
#

don't think a packet gets sent back to the client to stop doing it

sullen dome
#

ah more packet errors

#

love it

rough drift
#

PlayerAnimationEvent go brrrrrrrr

vocal cloud
#

The client would send one

sullen dome
#

i hate packets

vocal cloud
#

Client -> Server

#

Heck spigot can even see Forge packets

wet breach
sullen dome
#

is it actually possible to send a "custom" packet from a server to the client, which contains the uuid and an integer? if yes, how tf

rough drift
#

that's so useful

quaint mantle
#

it might actually disconnect

vocal cloud
rough drift
#

the client is modded

sullen dome
#

that's the thing

#

i got a fabric mod which sends a packet to the server, perfectly fine

vocal cloud
rough drift
sullen dome
#

now i need to send a packet to all connected clients with the sent information (uuid and an integer)

wet breach
#

if you send a custom packet to the client that doesn't have a mod to recongize it, odds are the client is going to ignore it or in extreme cases either disconnect or crash the client

rough drift
#

Just a scheduler?

wet breach
sullen dome
#

gotta love it

rough drift
#

but idk if it does for others

wet breach
#

either a event exists for it, or if not you are going to have to use NMS to hook into the relevant packet

rough drift
#

such as spyglass/trident

vocal cloud
sullen dome
#

so

#

what can i do there
when a client mod is present

wet breach
#

almost anything really

vocal cloud
#

I use forge for my stuff LUL

sullen dome
#

i mean like
how would i send that packet with that 2 tihngs
protocolManager.sendWirePacket(p, 9000, b); this apparently isn't te right thing... i guess bc the id isn't existing?

wet breach
#

you would have to implement your own packet and inject it into MC packet/protocol handler stuff

sullen dome
#

god

vocal cloud
#

Did somebody saw raw netty

wet breach
#

you wouldn't be able to use protocollib because it only helps with mc protocol nothing more

sullen dome
#

so protocollib goes away

vocal cloud
#

ProtocolLib has a mental breakdown if it tries to read my custom packets

#

Like huge mental breakdown

sullen dome
#

like how do i even create such a packet

wet breach
#

its just a class that implements the packet structure

#

and then you inject it into the nettty

#

and hopefully the client gets it

vocal cloud
#

Gonna need NMS

sullen dome
#

i do what? KEKW

wet breach
#

netty is the dependency that mc/spigot uses for network handling stuff

vocal cloud
#

Good ol Neti

#

Injecting that Neti right into my veins

wet breach
#

lol

sullen dome
#

so i guess like this? lol, gotta love nms when i see that a methods already

wet breach
#

reflection is going to be your friend here

#

actually not sure if reflection is needed 🤔

vocal cloud
#

I think the netty instance is public?

wet breach
#

yeah if they were going to mess with already existing packet stuff they would need reflection

#

but since its a custom packet

sullen dome
#

i have honestly no idea what tf you guys are talking about ngl

wet breach
#

wouldn't be required just inject it into the netty instance

vocal cloud
#

Client will need to have something to receive it

sullen dome
#

i'm already confused about those a()

#

like wtf

vocal cloud
#

Forge has something a lot more cute which is

#

Oh you might wanna slap on some mappings where you can

sullen dome
#

i mean

#

fabric has this ig? seems to be the same, but idk

  ClientPlayNetworking.registerGlobalReceiver(new Identifier("channelName"), (client, handler, buf, responseSender) -> {

  });```
#

i mean it listens to incoming packets

vocal cloud
#

I assume that's for intermod communication.

sullen dome
#

i can send packets perfectly fine from fabric to spigot

#

works fine

#

but i am only confused now about the other way

#

spigot to fabric

vocal cloud
#

Probably going to need NMS

sullen dome
#

such names

    @Override
    public void a(PacketDataSerializer packetDataSerializer) {

    }

    @Override
    public void a(PacketListener packetListener) {

    }```
already nms'd me lol
#

i'm just confused about everything rn

#

i guess first is the sending action, and second the receiving action? idk

vocal cloud
#

An incoming and outgoing packet

sullen dome
#

aha

#

?

#

is there something that could help me understand this pile of nms?

wet breach
#

there is channels for sending and receiving

sullen dome
#

only the packet stuff

proper pawn
#
@EventHandler
public void kaas(InventoryMoveItemEvent event) {
    System.out.println("kaas");
}

why does this even not get called when i move an item from one inv to another one?

wet breach
#

you hook into the channel you want for what you are wanting

#

if you are wanting to intercept packets you hook into the receiving channel

#

if you want to send packets you hook into the sending one

sullen dome
#

i just want to send a packet with a player's uuid and an integer to the client.
that's bascially all

jagged thicket
proper pawn
wet breach
#

not when you move it to another slot in the same inventory

#

IE, chest to player inventory or hopper to chest for example

proper pawn
#

i checked both and it still didnt fire

wet breach
#

then only way you are not catching the event if that is indeed the case is you really are not registering it

#

or doing so improperly

proper pawn
#
Bukkit.getPluginManager().registerEvents(new shopsystem(), this);
sullen dome
#

so... is there any "tutorial" or explaination about those packet shit online somewhere?

proper pawn
vocal cloud
#

entityPlayer.playerConnection.sendPacket(); Just shove stuff down the pipe till something works kek

sullen dome
#

god

wet breach
proper pawn
#

1.16.5

candid jacinth
#

How do I get the itemstack of a custom skull

wet breach
#

figured, have no idea if it has changed since then

sullen dome
#

excuse me, what? BlobConfused

wet breach
#

I only use latest api

vocal cloud
#

Also name your classes correctly. ShopSystem not shopsystem sad

vocal cloud
#

That's like part of the experience

sullen dome
#

how tf would i know what tf a is

#

or b

#

or c

#

or so on

vocal cloud
#

Welcome to obfuscated code

sullen dome
#

lmfao

vocal cloud
#

obfuscate means render obscure, unclear, or unintelligible.

#

In your case the second definition fits better which is bewilder

wet breach
#

this is what IDE's are for, I usually just have my IDE open up those methods for me

#

so I can see where they are at

vocal cloud
#

ctrl+b

wet breach
#

and then guess further which I need

#

sometimes its trial and error

#

you just pick one and hope it does something you want

vocal cloud
#

System.out.println("a(xyz) was called uwu")

#

Override a base out packet and just override all the methods with super() calls to see what does what.

#

You have to send it of course

sullen dome
#

uhh i guess? 😕

#

looks right, but you never know...

wet breach
#

worse that happens

#

is you kill the client

sullen dome
#

happened many times

#

so...

this is it for this packet class? or do i need something else for it?

vocal cloud
#

Alright I have a test plugin. I assume you're using 1.18.2

sullen dome
#

yea

#
    @EventHandler
    public void onChat(AsyncPlayerChatEvent e) {
        if (e.getMessage().equalsIgnoreCase("send packet")) {
            ((CraftPlayer) e.getPlayer()).getHandle().b.a(new CustomPacket());
        }
    }```
i guess...
#

btw yes, i was just too lazy to make a command

vocal cloud
#

I just do it on the join listener

#

Crash em as they come in

sullen dome
#

funny as always

#

lol

#

anyway, let's test ig

#

YEAAAAAAAAAAAAAAAAAAA

#

NICE

#

so... that means what?

vocal cloud
#

That means step 1 complete

sullen dome
#

i guess?

vocal cloud
#

Okay wait I need to make a meme

sullen dome
#

oh no

vocal cloud
#

Or I can't because unreal engine is preventing me from using my PC

sullen dome
#

saved

#

anyway
what is step 2?

vocal cloud
#

Getting minecraft to not do that

sullen dome
#

wow

#

i mean... thanks i guess haha

vocal cloud
#

Ikr I'm so helpful happy

sullen dome
#

yea agree

vocal cloud
#

Figure out how to register a packet on fabric

#

So you can handle it

sullen dome
#

uh

rough drift
#

i forgot how to do so

#

but it was easy

sullen dome
#

tho
how would i make it realize that those are the same packet? like... where in spigot (i guess) can i say like an id or something that the packet has

vocal cloud
#

There should be an ID field

rough drift
#

yes

sullen dome
#

how would i find that like wtf

vocal cloud
#

Well I'd open up a few packets and see what they share in common

sullen dome
#

is it an int?

#

i guess so

vocal cloud
#

It's most likely a byte

#

Example

#

0x03

sullen dome
#

i mean, doesnt look like htat to me

vocal cloud
#

I think a would be it since it's a read byte

sullen dome
#

i mean, b is a minecraftKey

#

which is the identifier in fabric

#

which i can listen to

#

that may be the "id"

viral crag
#

wonders if today is i hate fabric day?

sullen dome
#

lol

ancient plank
#

owo?

viral crag
#

i dont suppose you could just catch the packet in wireshark and determine it?

ancient plank
#

communicating with the client from aplugin ?!?!?!

sullen dome
#

yea with a mod

ancient plank
#

I was gonna do smth like that for smooth end crystal beams using plugin messaging

#

with choco's veinminer mod as an example

midnight shore
#

Hi, how can i set a block to be a crop with a specific state? for example the images i've sent

vocal cloud
#

You get the state

midnight shore
#

didn't see your message actually

vocal cloud
#

Then set it to whatever state you want

ancient plank
#

Ageable

midnight shore
#

the question is exactly that

#

how do i set the state?

earnest forum
#

blockstate

vocal cloud
wet breach
#

cast it to blockstate

#

or cropstate if its a plant like thing

viral crag
grim ice
#

bro

#

IT DOESNT WORK WITHOUT HTML

#

LMFAOO

wet breach
#

um....

viral crag
wet breach
#

almost all websites don't work without html

grim ice
#

i meant

#

the .html

#

at the end of the url

earnest forum
#

yeah obviously

viral crag
earnest forum
#

that's how Websites work

wet breach
#

that has to do with server settings and what not

earnest forum
#

they just direct you to a file

grim ice
#

No?

grim ice
earnest forum
#

Not all websites use html

grim ice
#

dude

wet breach
#

most webservers are configured to just ignore the ending

grim ice
#

ive seen no website that uses html

#

that would break if u remove .html

#

or .php

wet breach
#

I have seen plenty of websites not use .html

#

seen plenty of them that do

viral crag
#

it has to do with teh server hiding get and put commands

wet breach
#

no

grim ice
#

i mean its just a configuration

wet breach
#

it just has to do with url rewrite rules as well as you can just tell the webserver to ignore the endings unless those files actually exist

grim ice
#

u can fix it by using this on ur htaccess:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
wet breach
#

that is one way

#

the other way is just telling the server to ignore the ending 🙂

viral crag
#

if your server parses multiple file types, that can have unexpected results

wet breach
#

index and index.php are generally the same and you could have your server set to serve php files by default thus you can also put a index.html file in there without problems

grim ice
wet breach
#

I usually put index.html files that have something different 😛

#

since most of my sites just serve php files lol

grim ice
#

ive only seen .html and .php extensions

#

on my country websites

#

(3rd world dumb country)

#

where knowing how to open a pc is genius

wet breach
#

depending how you configure the webserver you can literally use any ending you want

#

or no ending

grim ice
#

yea

wet breach
#

you can use .html ending for .php files 🙂

grim ice
#

lol

ancient plank
#

mine works with and without the file extension

wet breach
#

confuses some people who try to do some weird things 😛

viral crag
#

asp, rb, pl, etc

grim ice
#

btw im seriously bad at front end

#

i know basic css properties but

#

i cant make anything that looks good

tardy delta
#

i cant either

#

i have to make a website for school and it looks horrible

wet breach
#

you can

tardy delta
#

anyways goodnight

wet breach
#

just have to stop building the walls without the floor

tardy delta
#

true

grim ice
#

oh u mean html

tardy delta
#

but with the html and css knowledge we got from school we arent going to get far

vocal cloud
#

Make your own simple css lib and use it for everything. Do a mobile-first approach and you'll make beautiful websites

tardy delta
#

what is a css lib

grim ice
#

I BARELY KNOW CSS U WANT ME TO MAKE A LIB FOR IT

vocal cloud
#

You make a giant css file with all your goodies in it

#

avoid javascript that's for nerds

tardy delta
#

ah lol

grim ice
wet breach
#

you need to flesh out your back end design first and then you need to figure out what it is you want to show, then you can connect the relevant pieces to the back end. The prettiness comes once you have things working

grim ice
#

Bootstrap as well

tardy delta
#

we are all supposed to be nerds here

#

🤓

vocal cloud
#

Bootstrap is ew

tardy delta
#

but ye

#

cya

viral crag
#

get a box and sharpie, draw a square and some smaller squares inside - call it done

#

when they ask, say you cant afford a computer

grim ice
#

SO is there to code your backend for you 😊

wet breach
#

that gives me a great idea

#

I have a new competition for around this years christmas time 😉

#

depending how things go, I will host the event 🙂

viral crag
#

or you could get a spider collection and squish it on paper

wet breach
#

not much of a collection if you are squishing them

rough drift
#

TIL: player.getItemInUse() does not do what it says on the tin

viral crag
#

it has tin?

wet breach
#

I can't tell you now

grim ice
#

is that for spigot devs

wet breach
#

yes it will be like a hack a thon

#

but you gave me an idea for the theme

grim ice
#

o

#

pog

ancient plank
#

elfmas

tender shard
wet breach
#

and?

grim ice
#

better

viral crag
#

gives you time to learn websites

grim ice
#

oh fuck its about websites

#

is it about websites frostalf

wet breach
#

no that would be too easy

grim ice
#

good

#

i hope its bout java

tender shard
#

maybe it's about drinking jägermeister

#

a jägermeistathon

wet breach
#

if this event gets popular enough, we could probably get a physical location for it 😄

viral crag
#

2hex's place

wet breach
#

Should call it 2hexate10

grim ice
#

lol

grim ice
#

perform unauthorized trespassing into a random african kid's house and host an event in it

#

kekw

viral crag
#

sounds like my neighbors

rich inlet
#

Hey, I'm getting an internal error with NametagEdit, I don't get what the problem is. Stopped, reinstalled the plugin, started already a few times. Here is the error from the console: https://pastebin.com/H1sKe5gP

vocal cloud
#

Yes I too love trespassing into random African kid's houses and partying

wet breach
#

shame no one liked the name I gave

viral crag
grim ice
#

2hexateyourmotherandfather

wet breach
vocal cloud
#

Or shoes

#

I get more ads about old jewish ladies

wet breach
#

interesting

viral crag
#

your search history determines the ads you get you know @vocal cloud ?

vocal cloud
#

It's TV

#

I'm pretty sure it doesn't

viral crag
#

if its the digital service, you are out of luck

#

but it does make one wonder what channels you watch

vocal cloud
#

Jeopardy weeknights at 8

wet breach