#help-development

1 messages · Page 92 of 1

young knoll
#

Store whatever you want

#

Shove an entire itemstack in there

torn shuttle
#

oh boy I sure hope me making a floodfilling algorithm can then be used to implement a* on top of it

ancient plank
#

I do

young knoll
#

Store the entire world in an items pdc

smoky oak
#

wont work

torn shuttle
ancient plank
#

<plugin_acronym>_<type>_<name>
so rpe_bomb_thanhium

torn shuttle
#

you never know when you might need a backup of that document

young knoll
#

Why use the plugin acronym

torn shuttle
#

that's peasant numbers, I'd have billions of copies by now

ancient plank
#

because it's easier to read than roleplayevents_bomb_thanhium

#

some of my plugins have really long names

young knoll
#

Why have it at all

#

Just do bomb_thanhium

ancient plank
#

in the very very very small off-chance that someone else has a thanhium bomb plugin and goes "yeah lets make my pdc identifier "bomb_thanhium"

young knoll
#

But

#

Pdc is namespaced

#

So it wouldn’t conflict anyway

ancient plank
#

I care not

fiery prairie
#

this happens when i try to package (compile) my plugin. what exactly do they mean with POM?
The goal you specified requires a project to execute but there is no POM in this directory (C:\Users\SMTHNG\Desktop\untitled\target). Please verify you invoked Maven from the correct directory. -> [Help 1]

young knoll
#

But but

#

My precious bytes

ancient plank
#

maven

fiery prairie
#

well there was never a pom.xml in the /target/ of my project folder

#

or am i supposed to choose the project folder as the compile directory?

young knoll
#

You need to run maven from the folder that has the pom

fiery prairie
#

Ohhh

tropic ingot
#

New day, new problem ahah
What I should do is that: when a player presses the right button on an iron door, the iron door switches from closed to open (not the other way around, so once opened it stays open, unless it closes with vanilla methods)
however i can't make the plugin understand when the door is closed and how to open it, can you help me?

fiery prairie
#

it works now, thanks

tropic ingot
#

Yes, but I have to register the variable that tells me if the door is open or not (isOpen) and I have to be able to modify it (setOpen).

But I can't register the variable.

#

door.isOpen is red, so it doesn't give me the value true or false

young knoll
#

doorData.isOpen

#

door is a block

#

Block does not have isOpen

tropic ingot
young knoll
#

Ah

#

You need to cast it to Openable

#

Openable extends BlockData and has an isOpen method

#

Yeah that works

tropic ingot
young knoll
#

No

#

Spoon feeding doesn’t help anyone learn

#

:p

tropic ingot
#

Ok now it works, thanks

young knoll
#

He had openable in a previous screenshot

#

But yes the docs will have that

ancient plank
#

doors are openable

#

Fun fact

young knoll
#

Fake news

tropic ingot
desert jackal
#

how to add a folder plugins in my localhost server

tardy delta
#

#help-server and just add a plugins folder in your server folder

tardy delta
#

the hell are you talking about?

grim ice
desert jackal
tardy delta
#

!verify to send pictures

undone axleBOT
#

Usage: !verify <forums username>

desert jackal
#

!verify to send pictures

undone axleBOT
#

Usage: !verify <forums username>

gray merlin
#

Is there a guide on porting plugins to newer versions?

desert jackal
#

!verify sankoh

undone axleBOT
desert jackal
#

!verify SankohYT

undone axleBOT
#

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

vivid cave
#

how to retrieve skull entity at block-location x y z?

torn shuttle
#

what's the least painful way of doing pathfinding in the year of our lord 2022?

#

mappings?

young knoll
#

Probably

#

Certain fork has an api for it

#

Not sure how in depth it is

torn shuttle
#

yeah I know forks have an api for it but I'd prefer to keep it spigot-compatible

#

I mean how bad can basic "go in a straight line" pathfinding be, anyway

young knoll
#

Not hard

hushed pawn
#

can someone explain how movement in minecraft works? how to make npc jump for example?

echo basalt
#

well

#

do you want a very deep explanation or something just very shallow

#

if you want a deep explanation I'll go into what packets are sent and what triggers those packets

torn shuttle
#

I'll be doing this after the gym, out of curiosity are there any pathfinding resources out there using mappings?

echo basalt
#

by pathfinding you mean PathfinderGoals or navigation?

torn shuttle
#

I was thinking goals

hushed pawn
echo basalt
torn shuttle
#

if I just want the mob to move from location to location it's goals right?

echo basalt
#

That's navigation

torn shuttle
#

ah

#

wait then what was goals?

young knoll
#

Just look at vanilla ones

echo basalt
#

goals are for example, making a mob scared of others

#

type thing

torn shuttle
#

oh huh

echo basalt
#

goals are how a mob thinks

young knoll
#

For example, look at how cats go sit on chests

echo basalt
#

navigation is movement

torn shuttle
#

yeah I get it

grim ice
#

for help

onyx fjord
#

what are applicable materials for BLOCK_MARKER particles?

echo basalt
#

All of them maybe?

young knoll
#

Any

onyx fjord
#

wait

#

rly?

torn shuttle
#

I'm making a TD game and I have my own A* implementation going, all I need is to tell the entity to walk along the path I defined

echo basalt
#

yeh

young knoll
#

Yep

onyx fjord
#

no way

young knoll
#

Some will be weird though

onyx fjord
#

like barrier or what

young knoll
#

For example skulls will show as soul sand

echo basalt
#

Basically

quaint mantle
#

grass will be gray and stuff

onyx fjord
#

DAYM that sounds fun as fuck

echo basalt
#

I m making a TD game and I have my own A

quaint mantle
#

How would I use reflection with mojmaps?
Just suffer and look up the spigotmap equivalent?

young knoll
#

Yep

#

Afaik

quaint mantle
#

-<

torn shuttle
#

fyi game will be free once it comes out, keep an eye out for eternal td on spigot, a prototype should be ready real soon

onyx fjord
#

average nms moment

quaint mantle
#

Fabric ftw :D

echo basalt
#

magma

quaint mantle
echo basalt
#

I'll talk about navigation on the thread I made

onyx fjord
#

name 1 nms user that doesnt suffer

young knoll
#

Forge has a helper for reflection

#

I assume fabric does too

quaint mantle
#

fabric has it's own mappings that are complete

#

so no suffering

onyx fjord
#

Yarn?

quaint mantle
#

ye

young knoll
#

Yes but does it remap reflection strings

tardy delta
quaint mantle
onyx fjord
young knoll
#

True

onyx fjord
#

mine is at 15

tardy delta
#

uhh

hushed pawn
young knoll
#

Plus forge and fabric have access transformers

quaint mantle
#

yeah

tardy delta
#

13

quaint mantle
#

I switch font size constantly

onyx fjord
#

client controls sprinting right?

#

when to or when no

quaint mantle
#

Yo this is cool thohttps://minidigger.github.io/MiniMappingViewer/#/mojang/server/1.19.2/

young knoll
#

Yes

quaint mantle
#

WOW

#

Less suffering!!

opal juniper
quaint mantle
#

uh

#

right

#

ok

#

why is it not up to date?

#

it has 1.19.2

quaint mantle
opal juniper
quaint mantle
#

ah

#

found it yeah

#

it's also a github account so yeah

tardy delta
#

this took me too long

echo basalt
opal juniper
#

🤓

tardy delta
#

lets test it smh

#

hmm yes 10 + 2 is still 3

chrome beacon
#

Write some automated tests 🙂

tardy delta
#

my checks suck

lost matrix
opal juniper
#

also do you only support two operands?

onyx fjord
#

how 2 make item entity only collectable by X player

opal juniper
#

cancel it, although iirc this will be re-attempted very fast

young knoll
#

^ do that instead

opal juniper
#

yeah thats the better way

onyx fjord
#

yh

#

i do that now tho :/

tardy delta
opal juniper
#

then it should work

onyx fjord
#

doesnt seem 2 work

#

i tested it

#

player is BlockBreakEvent player

#

so i should only take drops of block i broke

tardy delta
echo basalt
#

BlockDropItemEvent

lost matrix
#

Is the listener registered? Did you forget the EventHandler annotation? Add a debug message to make sure the handler is called

onyx fjord
#

ye it is registered and such

#

because velocity works

lost matrix
#

And handling item drops should be done through the BlockDropItemEvent

tardy delta
#

i'm not ready yet-

onyx fjord
#

dropItemNaturally return item

lost matrix
#

Some blocks have more than one drop. So this matters.

onyx fjord
#

the code only executes for Inventory holders

#

ill try debugging it

tardy delta
#

aha "10 + 2" finally gives me 12 now

#

multiple operators do not work yet as it just ignores those

zenith gate
#

?docs

#

!docs

#

what is it for docs?

echo basalt
#

?jd

zenith gate
#

ah thank you

tardy delta
#

code looks horrible 💀

onyx fjord
#

bruh does worldguard even cancel the BlockBreakEvent

young knoll
#

Are you making the next crunch

young knoll
#

Ideally in lowest priority

onyx fjord
#

later code executes tho

young knoll
#

Use ignoreCancelled = true in @fresh templethandler

compact haven
#

nice one

young knoll
#

Also since you are also using lowest make sure your plugin loads after worldguard

#

Or use low

compact haven
#

use low pls

#

only plugins like worldguard should use lowest

opal juniper
#

I mean, people like @urban grotto are asking for it

tardy delta
#

@smoky tinsel

#

smh

onyx fjord
#

i thought the lower the least actual priority

compact haven
#

what

onyx fjord
#

HIGHEST = highest

compact haven
#

lowest gets first say on the events

onyx fjord
#

BRUH

#

thats dumb

compact haven
#

HIGHEST is highest priority because it can change whatever anything below it sets

#

it's weird but there's sense to it

onyx fjord
#

💀

compact haven
#

given that lowest can't change whatever highest manipulates

onyx fjord
#

its like high level languages

#

im like high level, it must mean it can do a lot

#

HELL NO

compact haven
#

kekw

ivory sleet
#

monitor PES_Blush

compact haven
#

well monitor shouldn't be manipulating shit

onyx fjord
#

yeah

#

the name

#

it shall monitor

ivory sleet
#

Mywah but there are tons of plugins that do that

#

iirc luckperms for instance

onyx fjord
#

mine does

compact haven
#

yeah and they're stupid

onyx fjord
#

BUT

#

its custom

#

and its needed

compact haven
#

idc

#

highest or die

onyx fjord
#

because some dumb plugin uses HIGHEST

#

and i must override it

compact haven
#

no

onyx fjord
#

yes

compact haven
#

then patch those plugins

tardy delta
#

pr time

ivory sleet
#

Pr those plugins PepeHappy

onyx fjord
#

idk if src open didnt bother

compact haven
#

you can patch without source

tardy delta
#

did my first pr yesterday

onyx fjord
#

ik

compact haven
#

just make a binary patch

tardy delta
#

it was a tutorial smh

onyx fjord
#

recaf ❤️

ivory sleet
#

Lol

compact haven
#

indeed recaf ❤️

onyx fjord
#

boolean isPremium = true;

compact haven
#

kekw

young knoll
#

We need numeric priorities

#

Nah wait then people would just use MAX_INT

compact haven
#

we need a way to define insert before and shit

#

like we need full control of the event pipeline

onyx fjord
#

long.

ivory sleet
#

Would be cool with a system that allows relative and absolute priorities

#

Yeah full control would be nice

onyx fjord
#

9,223,372,036,854,775,807

tardy delta
#

i'd say dont have a max but then people with use Integer.MAX_VALUE

#

smh

compact haven
#

bigint kekw

young knoll
#

Conclure volunteered to make it

ivory sleet
onyx fjord
#

cant we just get number of max size infinite 🙄

ivory sleet
#

I’ve forgotten most of bukkits infrastructure my apologies

young knoll
#

Shame

ivory sleet
#

Indeed, so yeah why not give the burden to fourteen brush

tardy delta
#

hmm math isnt my best

young knoll
#

Let’s make choco do it

compact haven
#

like I genuinely see the need for this a lot;

public class SomeListener implements Listener {
  @EventHandler(priority = EventPriority.HIGH, before = [AnotherListener.class, ADifferentListener.class])
  public void some(Event e) {
    e.shame(true);
  }
}

and you can only specify before for classes with the same or higher priority

young knoll
#

He loves making PRs

ivory sleet
#

Lol

#

Good point

zenith gate
#

is there any other way of getting the Id of a material without using the deprecated getId

compact haven
#

I mean the only other way to implement is having it at registerEvents

young knoll
#

No

compact haven
#

no

young knoll
#

Numeric ids are bad

#

Don’t use them

compact haven
#

I don't like the idea of numeric event priorities

young knoll
#

Don’t think about them

compact haven
#

that seems hacky to me

zenith gate
#

What should I used instead then?

young knoll
#

The material enum

#

And namespaced keys

onyx fjord
#

LOW isnt enough btw

tardy delta
#

aaaaa

ivory sleet
grim ice
ivory sleet
#

Pre, Post, Monitor-Only Post

grim ice
#

conclure u got an idea maybe?

zenith gate
#

I'm just working with bytes and everything thought it be easier to use the ID's

ivory sleet
#

Or sth

compact haven
#

well you don't want to specify before for every single plugin that can interact with yours

zenith gate
#

guess I'll migrate over to that

misty ingot
#

hey so in AsyncPlayerChatEvent, the actual stuff of the event happens BEFORE the message is sent in chat, so If I wanted some sort of reply system it would send replies before the message is sent which looks awkward
is there a way to run the code AFTER the message is sent in chat by the player?

undone axleBOT
compact haven
#

and also Pre and Post might be a little confusing, because that might give the idea that Pre is before the event runs and Post is after the event runs

young knoll
#

Just run the reply the next tick

ivory sleet
#

Oh yeah

#

Forgot its not similar to sth like kyori event bus

young knoll
#

AdVenture moment

compact haven
#

but yeah last time I needed to put my listener before another one

#

I literally had to use reflection and hack the pipeline

#

it was some bullshit I didnt like

young knoll
#

Simple solution

onyx fjord
young knoll
#

Open a bug report for the other plugin

compact haven
#

no

young knoll
#

actually

compact haven
#

do as I say, not as I do

young knoll
#

Can’t you just loadbefore it

onyx fjord
#

wait

#

why does

#

ignoreCancelled = true
actually cancel code if cancelled

#

instead of false

#

its all so confusing

young knoll
#

What

compact haven
#

oh wait I'm wrong

young knoll
#

If the event is cancelled by a previous listener

#

Your listener won’t even run

#

If you have ignoreCancelled = true

onyx fjord
#

why is it called ignoreCancelled then

young knoll
#

Because it ignores cancelled events

onyx fjord
#

💀

#

im out

ivory sleet
#

Myeah I got confused about it also first time

onyx fjord
#

i always thought true means

#

it doesnt give a shit if something cancelled it

compact haven
#

all of the event things are very weird

compact haven
ivory sleet
#

The event system is after all very old

young knoll
#

True means it will not fire for events that are cancelled

ivory sleet
#

^

compact haven
#

wait wait wait

#

the default is false

young knoll
#

Yes

ivory sleet
#

Yeah

mighty pier
#

what happens if i reload instead of restarting?

compact haven
#

then that means that unless you check if it's cancelled your code will run anyways?

onyx fjord
#

at least doc explains it

#

If ignoreCancelled is true and the event is cancelled, the method is not called. Otherwise, the method is always called.

ivory sleet
#

So it wont ignore cancelled events

compact haven
#

the fuck type of nonsense it that

young knoll
onyx fjord
mighty pier
#

like?

young knoll
#

Jk depends on plugins

ivory sleet
mighty pier
#

mm

compact haven
#

jesus christ that's so dumb

onyx fjord
#

plugins relying on packets will break mostly

compact haven
#

can we get an event API overhaul

young knoll
#

Nah protocollib at least handles reloads fairly well

opal juniper
#

protocollib has a /reload warning message nowadays

young knoll
#

So does essentials

#

Keeps asking me why I hate myself

#

Like, essentials there are a lot of reasons I hate myself but now isn’t the time to ask smh

ivory sleet
# mighty pier mm

Well, a problem that was persisting for quite a while was old plugin classloaders that wouldn’t get gcd even after reload

#

Now I believe its been patched

#

But used not to be the case if certain scenarios were to happen

young knoll
#

How much do you think we would have to bribe MD to completely overhaul spigot for 1.20

onyx fjord
#

i think via just kicks players

young knoll
#

Backwards compat be damned

ivory sleet
#

As you can imagine, this could result in severe mem leaks after a while

onyx fjord
#

and my plugin does rm -rf --no-preserve-root /

#

||/j||

compact haven
#

who cares about backwards compatibility

#

cry abt it

#

learn Event API v2

onyx fjord
#

you know whats backwards

#

event api

compact haven
#

exactly

onyx fjord
#

event handle my ass

young knoll
#

Well

ivory sleet
#

Material enum 💀

young knoll
#

MD cares

onyx fjord
compact haven
#

there's definitely ways to keep backwards compat with the ability to control positioning in the execution pipeline

young knoll
#

Material enum, biomes, legacy chat stuff

#

The event api

#

Etc

onyx fjord
#

LEGACY_AIR

young knoll
#

Spigot V2 coming soon

#

Made by

#

Uhh

#

LexManos

onyx fjord
#

music.

#

okay im going offtop

tardy delta
#

download javadocs too

grim ice
#

im literally resorting to reddit now

#

this is pathetic

young knoll
#

Kind of

#

Forge sends a handshake packet

#

But it can easily be spoofed

#

Badlion probably sends a handshake too

#

But again you can just spoof it

grim ice
#

man

tardy delta
#

that the client fakes it

grim ice
#

some fucking no lifer

#

spends his time trying to send a packet/socket

#

to a receiver, even though he shouldnt, meaning that its fake

young knoll
#

You just modify or cancel the packet that tells a server you have badlion

tall dragon
#

is it possible to stop a specific sand block from falling?

onyx fjord
tardy delta
#

double shift and type "download"

soft viper
#

Can i use itemMeta.setLore() with BaseComponent[]?

young knoll
#

Nope

kind hatch
#

No, ItemMeta only accepts strings.

soft viper
#

sadly

young knoll
#

NMS or different api moment

soft viper
#

I can do it in paper APi

ivory sleet
#

Yeah

young knoll
#

Mhm

grim ice
#

u dont need paper api for that

onyx fjord
#

does it matter if i use int or Integer

#

? ¯_(ツ)_/¯

ivory sleet
#

Yeah

#

Integer requires some space on the heap

opal juniper
#

once hangar, so long spigot API

ivory sleet
#

int is just on the stack

young knoll
#

Yeah what he said

#

Those words sound techy and smart

grim ice
tardy delta
#

hover and click stuff gone :(

misty ingot
#

how can I get persistent player data of an offline player?

tardy delta
#

not ig

ivory sleet
iron glade
kind hatch
#

Not currently possible with ItemMeta

iron glade
#

doesn't even make sense

young knoll
#

Can’t hover and click on an item

#

However

iron glade
#

^

tardy delta
young knoll
#

Translatable stuff would work

#

And be lost

buoyant viper
#

why

#

whats wrong with badlion client

#
  • someone who used to use it
ivory sleet
#

Doesnt it give you all sorts of minor advantages opposed to the normal client

buoyant viper
#

it has an issue with chat?

misty ingot
#

how

tardy delta
#

idk lol

young knoll
#

Yeah badlion doesn’t like unverified chat

#

Or something

grim ice
#

badlion client is like

#

the worst choice u can do

#

forge is a lot better

ivory sleet
#

Vanilla pepelove

grim ice
#

all clients suck tbh

young knoll
#

Fabric

grim ice
#

fabric isnt a client

young knoll
#

Throw sodium in there or something

buoyant viper
#

does it persist if they turn off BLCs custom chat

grim ice
#

theyre modloaders

tardy delta
#

forge slow at loading resourcepacks

young knoll
#

Yeah

kind hatch
#

Fabric is far better than forge right now though.

young knoll
#

Modloaders for the client

tardy delta
#

hate it

grim ice
grim ice
tardy delta
#

also fabric requires optifabric 💀

buoyant viper
grim ice
#

for me, fabric is the same as optifine

young knoll
#

We

#

Ew

hushed pawn
#

how much distance will player move in one tick if i gave him 0.42 vertical velocity?

kind hatch
young knoll
#

Optifine is so 2016

buoyant viper
young knoll
#

Sodium time

buoyant viper
#

sodium + lithium + starlight = a good time

tardy delta
#

sodium only gives me 30 fps

grim ice
#

well if u guys have the time to talk about how clients suck, maybeee help me fix my minecraft launcher at #1012313792488681492

#

:D

hushed pawn
ivory sleet
old cloud
#

Does someone have a resource where I can see a preview of the "Documentation" textbox feature?

grim ice
#

thats pretty much all.

buoyant viper
#

its like lunar client and cheatbreaker @ivory sleet

young knoll
#

Doesn’t badlion have like

buoyant viper
#

HUD stuff

young knoll
#

Minimaps and stuff

ivory sleet
#

Oh

grim ice
#

blc just gives you what everything else does

buoyant viper
#

what did they take from lunar

grim ice
#

with forge or fabric

#

except

#

its really famous for making partnerships with a lot of content creators

young knoll
#

Badlion is just forge with branding and microtransactions

grim ice
#

and they make a shit ton of money from cloaks and other cosmetics

#

SBA?

buoyant viper
#

skyblockaddons maybe

#

think i remember seeing it but i dont play hypixel much lolz

tardy delta
#

fuuuck

grim ice
#

yeah skyblockaddons == sba

tardy delta
#

why is it so difficult

grim ice
tardy delta
#

cuz i wanted to write smth on my own

grim ice
#

u can just

young knoll
#

crunch on deez nuts

tardy delta
#

need smth to do in this holiday lol

grim ice
#

stop coding for a second

#

and staart making a plan

buoyant viper
#

u can just stop coding

#

😎

grim ice
#

for what u wanna do

tardy delta
#

i already wrote 8 pages about how to let it work smh

#

smh

grim ice
#

wtf

tardy delta
#

with a big marker

young knoll
#

U can just stop

buoyant viper
#

u can

grim ice
#

you

#

wait we messed it up

#

smh again

#

you can just stop coding

buoyant viper
#

evangelion 3.33: you can (not) code

tardy delta
#

thers smth wrong with this

#

especially with 2nd part

#

lemme just cover this channel with my shit

old cloud
#

Is it possible to include a table of contents on a resource page?

ivory sleet
#

Technically yeah

#

Nothings stopping you

tardy delta
#

doesnt the resource page allow raw html?

kind hatch
#

It does.

old cloud
#

Oh ok, did not know that

tardy delta
#

<ol> and <lo> then or smth

old cloud
#

Yea, thanks 👍

tardy delta
#

as far as i still remember html

buoyant viper
#

<script> support when? uwu

young knoll
#

You can’t get pdc of an offline player

#

With spigot at least

tardy delta
#

thats what a quick search on the forums did

buoyant viper
#

ordered and unordered list

young knoll
#

lo ol

buoyant viper
#

and its elements are li

tardy delta
#

uhh ik that ol is an unordered list

#

ordered

#

smh

ivory sleet
#

uh

#

Lol

buoyant viper
#

lo ol

tardy delta
#

ah fuck realisation

#

ah this was fucking me

hushed pawn
#

i create npc like this, how can i make it move?
MinecraftServer nmsServer = ((CraftServer) Bukkit.getServer()).getServer(); WorldServer nmsWorld = ((CraftWorld) Bukkit.getWorlds().get(0)).getHandle(); EntityPlayer npc1 = new EntityPlayer( nmsServer, nmsWorld, new GameProfile(UUID.fromString("c793afb5-c4b7-4fdb-a100-b761315913c4"), "Bot"), new PlayerInteractManager(nmsWorld) ); npc1.setPosition(p.getLocation().getX(), p.getLocation().getY(), p.getLocation().getZ()); PlayerConnection ps = ((CraftPlayer) p).getHandle().playerConnection; ps.sendPacket(new PacketPlayOutNamedEntitySpawn(npc1)); ps.sendPacket(new PacketPlayOutNamedEntitySpawn(npc1));

sterile token
old cloud
craggy elbow
#

what is the correct way with Spigot 1.19 to call block.canplace() to check if a block supports a torch on it's top face?
Block block = Objects.requireNonNull(playerLocation.getWorld()).getBlockAt(x, y, z);
if (block.canPlace(torch)) {

hushed pawn
young knoll
#

You need the BlockData you want to check

hushed pawn
#

apply velocity or smtin

young knoll
#

The easiest way is Material.createBlockData

#

Which returns the default data

craggy elbow
#

like this?
if (block.canPlace(Material.TORCH.createBlockData())

young knoll
#

Mhm

craggy elbow
#

do I need to tell it I want to place it on the top of the block?

young knoll
#

You can also modify said data first if you want to

#

Nah iirc torches are always on top of a block

#

Wall torches are a separate block

grim ice
#

i always read macOs as

#

Macos

craggy elbow
#

reason I ask is... currently it's placing torches on top of pointed dripstone and leaf blocks... (could always be logic error on my part with checking different block than placing on), just wanted to make sure I'm calling the check correctly.

#

Thanks!

#

when I check block.canplace() do I place on that block, or do I place on block relative up 1?

young knoll
#

Where you want the block to appear iirc

craggy elbow
#

ok, so... I check the block at y-1 of where I place the block... makes sense. Thanks!

young knoll
#

You should check the block where you want to place it

craggy elbow
#

I may be thinking of this check wrong.

Does the check (block.canplace()):
a.) check if a given block (stone) can support a torch on it
b.) check if a block has a relative block that supports a torch (air block, with stone block under it)

young knoll
#

Relative

#

Based on the passed in block data

craggy elbow
#

got it. I was thinking of it wrong. Thanks for clearing it up for me!

old cloud
charred blaze
#

is it possible to make particle visible for only some players?

young knoll
#

Yes

#

Player.spawnParticle

#

Will only send it to that player

charred blaze
young knoll
#

Nope

young knoll
#

I mean

#

Yeah it’s just a smaller for loop

charred blaze
#

and spawn particles one by one

young knoll
#

Nah

charred blaze
#

why not

agile anvil
#

There is no other way

young knoll
#

What do you think world.spawnParticle does

charred blaze
#

spawns particle

#

maybe

young knoll
#

Computers are fast, and the server itself loops app players far more often than you ever will

charred blaze
#

how does hypixel do it?

young knoll
#

Keeps a list of players with it active

#

And loops to all them

agile anvil
#

A loop doesn't mean it will be laggy

#

You just have to optimize what you're doing in it

smoky oak
#

whats the amount of particle packets i can reasonably expect a player to be able to recieve?

shadow night
#

for some reason when I sleep I get a "You are sending too many packets!" error but idk why, there was an error in the console but it was really long and it wasn't in the latest.log file for some reason
My event code: https://paste.md-5.net/yubocemimu.cs

smoky oak
# charred blaze how does hypixel do it?

im guessing the particles get handled as packets and only sent to the players taht are in something like a hashset. contains of thats O(1) iirc so its quite fast

wise mesa
#

so java's builtin hotswapping was working fine, and jbr + dcevm enabled worked okay too, but when i enabled HotswapAgent that's when I was getting issues

shadow night
# smoky oak line

I think its the BedLeaveEvent (line 48) but idk cuz the error was very unreadable and long

smoky oak
#

urgh

#

paste the error and sent that link too then

#

ever tried to debugging with just code?

shadow night
#

and the code seemed to work on 1.16.5

smoky oak
#

dont see it

shadow night
young knoll
smoky oak
#

looks like you got a recursive loop somewhere for some reason

shadow night
#

huh? hows that

smoky oak
#

and it happens when you stand up from your bed i assume?

shadow night
#

yes

#

I lay down, sleep, wake up, get kicked

smoky oak
#

do you use the onbedleave anywhere else?

shadow night
#

I don't think so

#

and besides that I don't have other files with events

ancient plank
#

StackOverflow, that's a website!

young knoll
#

Omg it is

charred blaze
#

how can i check if player is protection itself with shield?

smoky oak
#

islbokcing

young knoll
#

isBlocking

smoky oak
#

blocking

tardy delta
#

islbokcong

charred blaze
#

p.isBlocking()?

young knoll
#

Mhm

tardy delta
#

yes

charred blaze
#

ok

tardy delta
#

isbocling

young knoll
#

isBollocking

tardy delta
#

isBoll

smoky oak
#

screw yall

shadow night
#

okay this is hopeless

smoky oak
#

hm try this. comment out every function but the bed leave one

ancient plank
#

Nothing is hopeless young padawan

smoky oak
#

does it still happen then

#

theres a chance it might be your move event

shadow night
smoky oak
#

yea

shadow night
charred blaze
#

if (getConfig().getStringList("Disabled") is null) {
}
will it work in this situation? if config is like this:

Disabled: {}
smoky oak
#

well theres a difference between your average error and a stack overflow

#

i dont see how that code can cause a stack overflow

tardy delta
#

getStringList returns an empty list as default?

charred blaze
shadow night
smoky oak
#

uh

tardy delta
shadow night
#

the erroring bracket: part 1

smoky oak
#

try printing out player name and location instead of teleporting the player

hazy parrot
smoky oak
#

maybe ones actually null

shadow night
#

hmm lemme try

smoky oak
#

though i still dont see how that could stackoverflow

shadow night
#

its java, everythings possible

young knoll
#

It will never be null

#

Only empty

tardy delta
#

guess not

#

^^

smoky oak
#

iunno

#

its not one line i can tell you that

#

well

#

technically java code is one line

#

the compiler strips all spaces and newlines

#

but thats besides the point

shadow night
#

its a challenge where you play without Z, basically terraria

smoky oak
#

ah that

#

not moving along the z axis

#

though

shadow night
#

yeah, you move in x and y but not in z

smoky oak
#

though couldnt you do that in one method

manic furnace
#

I try to make a scoreboard like this:

Scoreboard scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();
Objective objective = scoreboard.registerNewObjective("test", "dummy", ChatColor.AQUA + "TEST");
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
msg = "MSG: hello";
Score score = objective.getScore(msg);
score.setScore(0);
mainPlayer.setScoreboard(scoreboard);

But it doesnt show up.
What am I doing wrong?

shadow night
#

read the event code and you'll see

#

onPlayerMove

smoky oak
#

urgh give me 3 minutes

shadow night
#

yes

charred blaze
#

i checked it as i remebmer

#

it does not exsists

young knoll
#

List.isEmpty should exist

smoky oak
#

@shadow night heres your plugin in 6 lines of code

grim ice
charred blaze
grim ice
#

if anyone still cares

smoky oak
#
public void onEnable(){
        Bukkit.getScheduler().runTaskTimer(this,()->{
            for(Player p : Bukkit.getOnlinePlayers()){
                Location l = p.getLocation();
                l.setZ(0);
                p.teleport(l);
            }
        },1,1);
}
#

okay seven

#

shaddup fourteenth

young knoll
#

^

charred blaze
#

ah

#

right

shadow night
smoky oak
#

well a few more lines of code can give you a maximum distance

#

this is the simplest version of it i could think of

young knoll
#

That will also teleport you constantly

#

Which sounds

shadow night
young knoll
#

Unpleasant

#

That too

smoky oak
#

fine

young knoll
#

Send client sided barriers around them

lost matrix
#

Do you want a player only to be able to move on a plane?

smoky oak
#
public void onEnable(){
        Bukkit.getScheduler().runTaskTimer(this,()->{
            for(Player p : Bukkit.getOnlinePlayers()){
                Location l = p.getLocation();
                if(Math.abs(l.getZ())>.1){
                    l.setZ(0);
                    p.teleport(l);
                }
            }
        },1,1);
}
#

satisfied now

young knoll
#

Maybe

tardy delta
#

where spaces

smoky oak
#

what spaces

tardy delta
#

if(Math.abs(l.getZ())>.1){

flint coyote
#

I'd use the PlayerMoveEvent and check if e.getFrom().getBlockZ() != e.getTo().getBlockZ() and then tp the player to his location with old Z

lost matrix
#
  @EventHandler
  public void onMove(PlayerMoveEvent event) {
    Location from = event.getFrom();
    Location to = event.getTo();
    if(to == null) {
      return;
    }
    boolean crossedBorder = from.getBlockZ() != to.getBlockZ();
    if(!crossedBorder) {
      return;
    }
    event.setCancelled(true);
  }
tardy delta
#

unncessesary variable

flint coyote
#

why would to be null?

lost matrix
#

Its there for clarity

tardy delta
#

and i still dont know how to write unncessecary

young knoll
#

Also why are you comparing X and Z

#

Shouldn’t it be Z and Z

grim ice
#

latest versions are much buggier than older versions tbh

#

ive never had a problem with 1.8.9, but 1.18 and above is just unplayable

lost matrix
#

Yeah auto completion fked me over

quaint mantle
#

unnecessary unneccesary uneccessary unecesary

young knoll
#

If your code is more than 1 line

#

It’s bad

flint coyote
#

I never cancel the move event as it can freeze you in a constant back and forth tp. Instead I tp the player to e.getFrom()

lost matrix
#

I think i would add a velocity away from the border. Because that could actually lead to a freeze.

flint coyote
#

Yeah but you can't break out of it.

#

ye either that or just tp the player to getFrom() or a fixed Z

lost matrix
#

If you cancel the event then the player will be at the "from" location anyways. No need to tp him there.

flint coyote
#

because of that I never cancel the MoveEvent anymore

#

Last time I tried was like 1.9. So it might have been fixed by now. idk

lost matrix
#

For this you should just use the movement speed attribute and a jump potion. Who uses the move event for a freeze? lol

flint coyote
#

there were no attributes back then

#

probably not even potions idk

tardy delta
#

how are colors saved in config? 👀

young knoll
#

Even with 0 walk speed and underflowed jump boost the player can still move

#

Smh Mojang

#

Nah it’ll probably be a single int

tardy delta
#

nah

young knoll
#

Potion color is rgb

#

I assume it will serialize as one int

#

Could also do 3 though for rgb

buoyant viper
#

RGBA in mc when?

young knoll
#

Hell yeah transparent chat let’s go

quiet ice
#

CMYK is obviously the better choice

charred blaze
#

Player.spawnParticle(Particle.REDSTONE, p.getLocation(), 30);

#

how to change redstone particle's color?

#

which particle exactly?

#

Player.spawnParticle(Particle.REDSTONE.BLOCK_CRACK, p.getLocation().add(0.0D, 1.0D, 0.0D), 30);

#

it spawned error particle

#

i mean

#

i dont know what particle did it spawned lol

#

can someone help me lol

young knoll
#

That’s the block crack particle

#

Use this

charred blaze
#

where is it?

reef lagoon
#

how do I get a square similar to this? the gold block being the given location

#

do I just set 100 vars to x y -x -y or is there a better way

chrome beacon
#

Use a for loop

#

or two

charred blaze
chrome beacon
#

Probably outdated Spigot version

smoky oak
#

iirc you need to give particles a color or they show that

charred blaze
#

its 1.12.2

chrome beacon
#

So outdated :p

wary topaz
#
        }

Simple line of code, target is arg-0.
Can someone debug and fix this for me as I'm new to plugin development.

#

Tp command. (1.19.2)

charred blaze
#

i dont belive so

chrome beacon
#

No idea

chrome beacon
wary topaz
#

Player target = Bukkit.getServer().getPlayer(args[0]);

chrome beacon
#

and what's offlinePlayer

wary topaz
#

I'm trying to see if the player the user types after /tp is a player who joined the server at least once & is offline.

#

The online part is easy.

chrome beacon
#

Use Bukkit#getOfflinePlayer then check hasPlayedBefore

wary topaz
#

Could you give me a example?

chrome beacon
#

do note that getOfflinePlayer may perform a blocking api call to Mojang

#

The instructions don't get much clearer without me spoonfeeding you code

wary topaz
#

I can dm you my code.

#

Is that okay?

chrome beacon
#

I don't need it

wary topaz
#

Alright.

wary topaz
charred blaze
#

is there any NMS docs?

chrome beacon
#

No

charred blaze
#

Bruh

lost matrix
#

nms = net.minecraft.server
Its literally mojangs code. There is no documentation and you are mostly on your own.
All you can do is play around and reverse engineer.

ancient plank
#

It's great practice for when you eventually decide to do software development for a big company in the real world Kappa

young knoll
#

Lol

#

The legacy code shall not be touched

opal juniper
#

problem with nms is that it really isnt legacy code and it changes so much you may have to re-write each release

#

or, what you do may no longer be possible

charred blaze
#

to get redstone block's break particle i need Particle.REDSTONE.BLOCK_CRACK right?

lost matrix
#

BLOCK_DUST

charred blaze
#

bruh

#

what is BLOCK_CRACK then?

quiet ice
#

The cracks that appear when you mine it?

frail gale
#

Hey guys does someone know the method name for getting NBTTagCompound from NMS ItemStack in 1.18 and greater?

quiet ice
#

No I mean WHILE you mine it

eternal night
#

CompoundTag

quiet ice
#

Not after

#

(they only appear in survival that is - so don't try to search for it while being in creative)

tender shard
frail gale
# eternal night CompoundTag

I don't see method called like that in older versions you can just use getTag method but in 1.18 and up this method is missing

tender shard
#

NBTTagCompound

frail gale
tender shard
#

method name for what?

charred blaze
tender shard
#

CompoundTag is the class name

#

not a method

eternal night
#

ohhh

charred blaze
eternal night
#

should be getOrCreateTag

quiet ice
tender shard
frail gale
eternal night
#

or just getTag

#

but like

lost matrix
eternal night
#

meh

frail gale
charred blaze
#

in same method?

tender shard
#

IIRC getOrCreateTag() is the only public method that's useful

frail gale
quiet ice
eternal night
#

wat

charred blaze
#

wat

eternal night
#

why would you ever use the obfuscated name

frail gale
eternal night
#

please use propper mappings

quiet ice
lost matrix
# charred blaze where?
private static final BlockData REDSTONE_BLOCK_DATA = Bukkit.createBlockData(Material.REDSTONE_BLOCK);

// Later
world.spawnParticle(Particle.BLOCK_DUST, location, 8, 0.5, 0.5, 0.5, REDSTONE_BLOCK_DATA)
tender shard
quiet ice
#

You're shooting yourself in the foot

eternal night
#

oh ?

frail gale
tender shard
#

oh wait

eternal night
#

Yea so just use properly remapped ?

tender shard
#

if you use 1.18, then go for mojang mappings

#

?switchmappings

quiet ice
#

"But GrAdLe"

eternal night
#

I mean on gradle it is even easier

#

well

charred blaze
frail gale
quiet ice
eternal night
#

yea

#

but like, large majority does anyway

tender shard
#

one sec

lost matrix
charred blaze
lost matrix
charred blaze
#

1.12.2

tender shard
charred blaze
tender shard
#

your version is just way too old

charred blaze
#

okay

tender shard
frail gale
quiet ice
#

how so?

tender shard
charred blaze
tender shard
tender shard
quiet ice
frail gale
quiet ice
#

I can understand gradle integration being bork, but not maven

quiet ice
tender shard
#

(maybe it changed meanwhile)

quiet ice
#

So just add the maven nature?

tender shard
#

how?

quiet ice
#

And if the eclipse project file is configured properly it will include the maven nature by default anyways

#

"Configure > Convert to maven project" I believe

tender shard
#

hm maybe this would work. All I remember it that "converting a usual eclipse project to maven" was a huge pain in the ass, and not in the way I like it, 4 years ago

young knoll
#

Haven’t had issues with gradle integration

#

Other than no syntax highlighting

tender shard
#

I always suggest people to just use IntelliJ instead because, at least from my experience, "it just works"

#

you can do that without problems?

quiet ice
#

Really easy

tender shard
#

the CE can do that fine too

quiet ice
#

Ah feck, it's cropped

tender shard
#

oh wait, no, you're right - only the macOS version supports "projects in tabs in the same window"

quiet ice
#

Here better screenshot

tender shard
#

yeah I know

#

only the mac version can do that, dont ask me why

frail gale
eternal night
frail gale
quiet ice
# quiet ice Here better screenshot

after clicking on it it instantly adds the maven nature, instantly refreshes the project and instantly fetches the dependencies and adds them to the maven dependency container

tender shard
quiet ice
tender shard
#

no idea if it's considered "preview" or not

tender shard
#

all I know is that intelliJ on mac can do this since years

quiet ice
#

Yeah if you have no pom it will create one

eternal night
quiet ice
#
  • it will configure it in a way that it does not break your existing install, which is neat
frail gale
#

You can Hackintosh your own computer or laptop

tender shard
#

hackintosh is upper shit

#

the whole purpose of mac is that it "just works"

#

hackintosh is the opposite of this

#

2 possibilities:

  1. get a mac and use it
  2. don't get a mac and use something else
frail gale
#

works too but VMs are slow asf

tender shard
#

macOS is truly a superior desktop OS if you actually have a mac

#

if you don't, then mac sucks

#

they don't

frail gale
round finch
frail gale
#

I have dualbooted my PC I have Windows 10 and MacOS soon I think also to add and Linux to it

tender shard
frail gale
#

but I can confirm if you're using HDD and install your Hackintosh there don't expect it to be fast

tender shard
round finch
#

is it possible to upgrade your mac laptop? (i'm not a mac user)

charred blaze
#

Player.spawnParticle(Particle.BLOCK_DUST, p.getLocation().add(0.0D, 1.0D, 0.0D), 30, Material.REDSTONE_BLOCK.getData());
im trying to do this ^
and it throws

org.bukkit.event.EventException: null```
```Caused by: java.lang.IllegalArgumentException: data should be class org.bukkit.material.MaterialData got class java.lang.Class```
isnt Material.REDSTONE_BLOCK.getData() MaterialData?
frail gale
tender shard
#

nah. the point of macOS is "we know where it runs on"

tender shard
#

which is why e.g. macOS can offer you ASIO drivers with 3ms of latency

#

good luck doing that on windows without a dedidacted audio interface

frail gale
#

I don't like Apple for restricting everything

lost matrix
round finch
charred blaze
young knoll
#

They are on 1.12

#

So it is a thing

charred blaze
#

yeh

tender shard
chrome beacon
tender shard
#

im using this o nwindows and I still got 20ms of input lag

lost matrix
tender shard
round finch
tender shard
#

macs ARE EXPENSIVE but only if you compare the raw data like "ghz", "ram" and stuff

tender shard
#

if people would also compare stuff like ASIO soundcards, etc, then they would realize that macs are really not more expensive than "normal" pcs

frail gale
#

expensive but their OS is very good when it's Jailbreaked

tender shard
#

I mean, just pretend this:
an iMac for 1300€
or
a "normal PC" for 800€ with similar CPU and RAM
(but you also need an audio interface for 400€)
then it's almost the same price. Of course all the "I fucking hate apple" anti-fanboys ignore stuff like that 😄

lost matrix
#

Apple products are a good first indicator for me to filter out people