#help-development

1 messages ยท Page 5 of 1

torn shuttle
#

not to the best of my knowledge

noble lantern
#

A way to counteract that is allow users a config option for the event priority

Other than that, just store the Player EXP values on player join and when a player gets EXP in a map

torn shuttle
#

right that's what I feared, thanks

noble lantern
#

I wish there was a way to get the state of an entity a tick before its death

torn shuttle
#

me too

spring minnow
buoyant viper
#

time to PR Pre events uwu

spring minnow
noble lantern
#

it would just be the dead player instance

spring minnow
buoyant viper
noble lantern
spring minnow
noble lantern
#

the actual Player object youll get wont be cloned

#

iirc Player is immutable so you cant have seperate states of it

#

yeah cant clone() player which makes sense

compact haven
#

that's not what immutable means, but the idea was correct

spring minnow
#

ohhhh ok i got it

spring minnow
#

basically you can't even store the instance of a player

noble lantern
#

close enough

compact haven
#

You can, but it's not recommended at all

noble lantern
#

You can but its a live updating instance

#

better to store UUIDs tho in a map

spring minnow
compact haven
#

^ it's mutable & can't be cloned

#

you can store any object in java

noble lantern
#

you can but its just uncesary ram

buoyant viper
#

that does not mean u cant store

#

it just means u shouldnt

noble lantern
#

getPlayer returns from the map bukkit has of players on the server

spring minnow
#

you can store the object but not the content because that will still get updated

noble lantern
#

yep pretty much

compact haven
#

you can store the content as well, as long as it is cloned before returned from the Player object or if it's a primitive

noble lantern
compact haven
#

so you can store a Player's health at the time, or their flight state

#

int and boolean respectively

buoyant viper
#

can even store their name!

compact haven
#

well String is immutable kekw

buoyant viper
#

shut the Up

noble lantern
compact haven
#

and guaranteed to not change during the lifetime of the object

buoyant viper
#

even better ๐Ÿ˜Ž

buoyant viper
#

conection

spring minnow
#

btw its 4:19 am to me

noble lantern
#

every class i have has a HashMap<UUID, Player>

That way i can access my Player object whenever i need

#

its so fast

buoyant viper
#

22:19 get owned

compact haven
#

why are you both trolling lmao, this is a serious answer to a serious question(?)

spring minnow
buoyant viper
#

i take help development very seriously

spring minnow
#

just normal programmer life

noble lantern
#

well question was answered ๐Ÿ˜›

buoyant viper
#

wasnt this topic trying to get the player state before death

spring minnow
#

now i go to die/bed, goodbye to y'all and thanks for the help

noble lantern
#

it was originally about getting the exp levels before death reliably

buoyant viper
#

so listening EntityDamageEvent and if health - dmg <= 0 ?

noble lantern
#

what if health - dmg > maxEntityHealth

#

my maths fucked ik

buoyant viper
#

hw the fuck u do negative damage

noble lantern
#

dmg - health

#

im horrible at math okay

#

just let me write multithreaded stuff z_aCRYYY dont make me do math

buoyant viper
noble lantern
#

indeed but i can do that instead of math

compact haven
#

if you think that threading is easier than subtraction then you're doing "multithreaded stuff" wrong ๐Ÿ˜ฆ

noble lantern
#

negative

buoyant viper
#

just like ur numbers

noble lantern
#

my thousands of requests per second on my socket server disagrees

compact haven
#

sockette server?

#

like a princess sock?

#

๐Ÿ˜ must be beautifully coded

noble lantern
#

cant find the dang videos

#

sec

noble lantern
#

has auto parsing requests to pojo classes (JSON Requests)

buoyant viper
#

nice ips

#

theyre mine now

compact haven
noble lantern
#

for testing purposes

noble lantern
compact haven
#

oh shut up that's clearly to make a tweet "Significantly shortened processing time on backend services by ~700ms"

noble lantern
#

you know damn well it is too

#

its still in the code too

#

i forgot about it until now

#

no wonder testing was so slow

noble lantern
#

my ip

#

what am i gonna doooo

compact haven
#

lel

#

prime reaction

noble lantern
#

ill just turn my wifi off

#

ez

compact haven
#

lucky

#

dynamic ip people have no care

buoyant viper
#

cries in static ip

noble lantern
#

most times you can change static ips

buoyant viper
#

i had the same ipv4 for like 10 fucking years

noble lantern
#

user: admin
password: admin

compact haven
#

198

#

the fuck

noble lantern
#

i think i butchered that

compact haven
#

192.168 is the regular one

noble lantern
#

yee

compact haven
#

yeah u butchered it

noble lantern
#

that one

buoyant viper
#

laughs in 10.0.0.1

#

and 192.168.1.1

noble lantern
#

ive had like 4 beers today gimme abreak

#

gross

#

10.0.0.1

#

192.168.0.1 supremacy

compact haven
#

the one at my grandparents is like 192.168.1.254 or some crap

#

it makes no sense

#

literally had to ipconfig to find it

#

it's bullshit

buoyant viper
noble lantern
#

its the routers ip

buoyant viper
#

no shit

#

sorry

noble lantern
#

but

compact haven
#

we know xd

noble lantern
#

10.0.0.1 is even weirder

compact haven
#

the routers decide their own IP address

#

given that they process all LAN traffic

noble lantern
#

my router decided shit for me

compact haven
#

can be 69.69.69.69 if they wanted

buoyant viper
#

i shit on my router

noble lantern
#

my pc ip is like 192.168.0.17 and not 192.168.0.69

#

its kinda bs

buoyant viper
#

800% OC with DDWRT

compact haven
#

u can change it

buoyant viper
#

fried instantly

noble lantern
#

yee im just lazy

compact haven
#

tell ur router to static assign you 0.69

#

instead of using DHCP

#

lazy

#

lazy!

noble lantern
#

im legit slouched in my chair like the python logo rn

buoyant viper
compact haven
compact haven
buoyant viper
#

nah u can change it w stuff like ddwrt

noble lantern
#

it seems the convo has exceeded my knowledge

#

farewell

compact haven
#

ah ok u mean DIY

buoyant viper
#

yeah

compact haven
#

gotcha gotcha

#

yeah I haven't gone that route ever

#

heard a few people do it tho

buoyant viper
#

ive only killed one router so far

noble lantern
#

last time i did something more than port forwarding i bircked my router

buoyant viper
#

but it was entirely my fault

#

not ddwrt

noble lantern
#

and my cable company had to come fix my router

And guess what

buoyant viper
#

i fucked up the settings so bad it wont even power on

compact haven
buoyant viper
#

was that to my msg or

noble lantern
#

they said "Weird its like its IP isnt linked to our service" or someshit like that

And he decided it was the companies fault and i didnt have too pay lol

compact haven
#

nah that was a reply to burchard

buoyant viper
#

damn

noble lantern
#

and when i clicked update the entire router was bricked

buoyant viper
#

but yeah lesson learned is if i ever have an overclock option for ddwrt config.... do NOT set it to the highest MHz

#

(i was like 11)

#

sucks too, was a good fuckin linksys

#

WRT54GS model

noble lantern
#

how tf you remember that

buoyant viper
#

good memory idk

compact haven
#

must have ptsd

#

from the destruction of his router

buoyant viper
#

my new diy is a Netgear WNR2000v3

compact haven
#

wot

noble lantern
#

ahaha

#

netgear

#

pfffy

#

no wonder you have 10.0.0.1 as your admin panel ip

buoyant viper
#

the netgear one defaulted to 192.168.1.1

noble lantern
#

that

#

is even weirder

buoyant viper
#

the linksys router was also 192.168.1.1

compact haven
#

my netgear is configured to 192.168.0.1 kek

buoyant viper
#

uselessly making me believe 10.0.x.y is somehow modern compared to 192.168.x.y

noble lantern
#

reject modernity, embrace tradition

buoyant viper
#

pretty much

noble lantern
#

mike did you accidentally type

#

i sawu

vocal cloud
noble lantern
vocal cloud
#

If my router does 10.x I switch to 192

#

my brain is a 192

buoyant viper
#

but yeah Linksys WRT54GS (old mainnet, dead), Netgear WNR2000v3 (priv network for my "server" pc and my Wii), and an Arris T16<i dont remember> (current mainnet)

noble lantern
compact haven
#

u DONT REMEMBER?

noble lantern
#

wow

compact haven
#

off with ur head

noble lantern
#

shame hnnh

buoyant viper
#

i never interact with that router much

#

mostly because its all done through xfinitys dumb ass mobile app

#

not even the unit itself

#

10.0.0.1 is an overview page more than a configuration menu

#

i cant even edit DNS or the wifi ssids from the router iirc

vocal cloud
#

I hate the fact you need to have an internet connection to use the router from my ISP

buoyant viper
#

i actually cant edit the dns at ALL

compact haven
#

the fuck?

vocal cloud
#

The configuration is all in the cloud

buoyant viper
#

yeah im locked into whatever comcast/xfinity has

#

its like 75.75.75.75 75.75.76.76

#

idk

compact haven
#

wot

buoyant viper
#

sorry i remember a lot of random things

compact haven
#

it's not even the regulars like 1.1.1.1 or 8.8.8.8

buoyant viper
#

yeah no

#

1.1.1.1 1.0.0.1 my beloved

#

8.8.8.8 8.8.4.4 ๐Ÿ’ช

vocal cloud
#

8.8.8.8 is bae ngl

#

Used to work on school computers sometimes too

buoyant viper
#

oh yeah the S in WRT54GS stands for Speed or Superspeed btw

#

its so stupid i love it

compact haven
#

nice, glad u remembered that

buoyant viper
#

oh im sorry

#

SpeedBooster

#

this thing came out in like '02

#

i still miss it :(

#

ive tried to 30-30-30 reset it so many times to see if itll revive it but

#

my baby is Gone

#

the Baby

noble lantern
#

you just want to flex the star wars poster

#

smh

buoyant viper
#

the other one (and my moca setup for ethernet to my room)

noble lantern
#

damn your routers are next to your bed

#

thats cool af

#

10/10

buoyant viper
#

oh dont worry the one i actually use is across the house

vocal cloud
#

So you can hit it when it stops working

buoyant viper
#

netgear is only for wii and spare pc

echo basalt
#

reminds me of my old networking teacher

buoyant viper
#

my moca setup is fucked up so my wifi is quicker than ethernet

noble lantern
buoyant viper
echo basalt
#

dude was talking about his cisco router and home server for storing a 27tb anime collection

noble lantern
buoyant viper
#

did u guys know the cables used for tvs (coaxial) can transfer (multi-)gigabit speeds?

noble lantern
#

ohhh coaxal

buoyant viper
#

yeah

noble lantern
#

was about to say i thought your hdmi cord had a side cable attatched

vocal cloud
#

Want an old cisco

buoyant viper
#

my monitor uses DisplayPort

#

(hdmi isnt compatible with nvidia gsync)

echo basalt
# vocal cloud

why does that look exactly like the networking equipment my school's server was running

vocal cloud
#

2004 router, works just fine

echo basalt
#

like not even joking

noble lantern
vocal cloud
#

Yup probably is

echo basalt
#

the "modern cisco-certified computer lab"

vocal cloud
#

I got mine from a server shop when I bought my server. 5 bucks each

echo basalt
#

running 2004 routers

vocal cloud
#

Probably a newer model than mine

echo basalt
#

is there even a server shop?

buoyant viper
noble lantern
#

^

#

its where i got mine

buoyant viper
#

oh yeah even though my linksys is fried i can kinda use it as a switch

vocal cloud
#

No I bought mine from a hipster who runs a server shop

echo basalt
#

I feel like shipping would be a little pricy

buoyant viper
#

the power is still functional just not the router itself

echo basalt
#

I'm into running a home server and all but like

vocal cloud
echo basalt
#

I live in some exotic part of a tiny european country

#

shipping a server from NY was like 400$ last time I checked

vocal cloud
#

Bought a HP DL380 G6 for $600. Came with I think 64GB of ram but he said he'd give me 196 for no extra cost

echo basalt
#

wtf

#

school was running a DL240 G4 iirc

vocal cloud
#

it's old but it does work.

echo basalt
#

Not sure what they were using it for

#

but we had a major power outage and fried one of the 160gb hdd's

#

๐Ÿฅฒ

vocal cloud
#

that's why RAID exists

echo basalt
#

Not sure if it was running in RAID or not

#

just knew that a replacement was 10$ + 40$ shipping

#

I asked the networking guy if it was worth buying a new drive

#

man just said "we accept donations"

vocal cloud
#

Literally the first thing I did was run the drives I got in RAID and pull one for fun to pretend I was hot swapping

echo basalt
#

We might've been running raid? could be a multi-drive failure thing

#

server was mid-configuration when the electricity guys cut the wrong cable

#

half the city ran out of power

vocal cloud
#

I stopped running RAID cause I wanted more than 300GB of storage

buoyant viper
#

F

echo basalt
#

the spigot community seems to have 2 sides

buoyant viper
#

couldnt u just configure for less redundancy

echo basalt
#

one side is the beginner developer that wants to make a tiny plugin

buoyant viper
echo basalt
#

the other side is the maniac developer that micro-optimizes everything including their home server rig

vocal cloud
#

I hate the RAID controller software ngl

buoyant viper
echo basalt
#

I've been doing spigot for like 5 years now

buoyant viper
#

youll get there in time

echo basalt
#

don't have a home server yet

vocal cloud
#

See I bought an actual server because I'm mentally insane

echo basalt
#

I'll just add more ram to my desktop PC and run a VM to pretend

buoyant viper
#

everybody has a home server it came free with their PC

echo basalt
#

I mean with a Ryzen 5 5600x and 32gb of ram it might as well be a home server

vocal cloud
#

I use a 2003 monitor to access it

buoyant viper
#

i have a vnc server

echo basalt
#

I seem to have got fancy everything except for monitors

#

paid like 20$ second-hand

buoyant viper
#

currently inflating a beach ball rn

#

i want to die

#

i forgot how to blow something efficiently

carmine nacelle
#
             ItemStack beeItem = new ItemStack(Material.BEE_SPAWN_EGG);
            ItemMeta beeMeta = beeItem.getItemMeta();
            PersistentDataContainer itemPDC = beeMeta.getPersistentDataContainer();
            cadiaBees.hivePDCManager.setBeeUUIDOnItem(itemPDC, UUID.fromString(beeUUID));

            beeItem.setItemMeta(beeMeta);

Any idea why this isnt storing my value?

echo basalt
#

Ask some friends for tips on how to blow

carmine nacelle
#

its an itemstack in a gui

vocal cloud
buoyant viper
#

debian on CRT โค๏ธ

vocal cloud
#

Ignore the failed to mount

echo basalt
#

windows 10 on CRT

vocal cloud
echo basalt
#

why was that a thing at my school

#

I regret doing IT management there

vocal cloud
#

Only monitor that works the server is VGA

buoyant viper
#

its a shame i never volunteered to work IT at my school

echo basalt
#

mine wasn't volunteered

#

I'm on a weird programming course (want a free degree yay) and we have to do internships

#

You can pick a tech-related company

#

I picked interning at the school

#

we just deleted teacher accounts off of the windows registry

#

type of thing

buoyant viper
#

wtf my programming course was using some shitty javascript library to make Pong game

echo basalt
vocal cloud
#

I'm taking a course that I had a JS course where I literally never attended class and got 100% it was too easy

echo basalt
#

it was fun

#

I made a tiny program that did all the manual work for me

vocal cloud
#

Oh and the HTML course I'd take the teachers code run it through WebStorm, format it properly and hand it in for 100%

echo basalt
#

then copied it onto like 5 different USB drives and we did entire computer rooms in like 5 minutes

#

We did a week's worth of work in about 3 hours

#

Then went to the pool in the afternoon

#

Or the beach or something

carmine nacelle
#

can anyone help me pls :I

vocal cloud
#

Don't you have to set the PDC back onto it? I'm not sure I haven't used Spigot in a while.

#

?jd-s

undone axleBOT
carmine nacelle
#

shouldnt have to

vocal cloud
#

And you're doing this?

carmine nacelle
#

its an itemstack not a block

vocal cloud
desert frigate
#

does anyone know why i get a bow with no lore or color?

echo basalt
#

lol hypixel clone lookin

desert frigate
#

shush

#

im tryna do smth

echo basalt
#

man can't even add meta to an item, tryna copy hypixel

desert frigate
#

shuddup

#

im not

#

well

#

i am

#

but

echo basalt
#

I mean that code looks fine to me

desert frigate
#

its giving me a normal bow bur

echo basalt
#

did you compile it right lma

vocal cloud
#

I can't see any issues with it

desert frigate
#

yes

vocal cloud
#

mvn clean

#

mvn package

echo basalt
#

did you restart the server

desert frigate
#

yes

echo basalt
#

try again

desert frigate
#

i just restarted 3 times

vocal cloud
#

decompile the jar and check OMEGALUL

echo basalt
#

^

#

I do that more often than I'd like to admit

carmine nacelle
#

BRUH IM SO STUPID OMG

#

I WAS SETTING IT AS A STRING AND GETTING AS AN INT ๐Ÿคฆโ€โ™‚๏ธ

echo basalt
#

spigot dev moment

#

like that time I made players phase through the floor on a minigame

#

and dying to the void crashed the server

vocal cloud
#

Oh that reminds me. I need to shut the server in the background of my computer that's stuck in a gradle task

carmine nacelle
#

ok its still erroring ๐Ÿ˜

vocal cloud
#

Oh shoot I don't have OP to shut it down.

desert frigate
#

i got it

carmine nacelle
#

any other ideas

buoyant viper
#

buy a cisco device

#

ezpz

#

solves all of lifes problems

lapis moon
#

Hello all, I have a quick question. How would I be able to give a player a shulker box with items already in it. Cheers : D

vocal cloud
#

Honestly the fact they haven't updated the interface in 10+ years is pretty sad

buoyant viper
#

well if it works

vocal cloud
#

Works? I'll give you one and you can tell me it works

buoyant viper
#

yes

vocal cloud
#

If by works you mean causes endless human suffering

carmine nacelle
#

holy shit im ACTUALLY dumb as hell

#

i spent 2 hrs checking the PDC on the WRONG ITEM

vocal cloud
#

This is why we need unit testing in spigot

carmine nacelle
#

?

compact haven
#

I mean he'd still have written the wrong test so it wouldn't have helped xd

vocal cloud
#

The test would fail though

compact haven
#

tests only help for updates to the code, assuming those updates aren't meant to change the overall functionality (judged by the test)

vocal cloud
#

and it's 100% faster to write a test

#

and run it

compact haven
#

well no I do agree with u

#

everything needs tests

#

a shame we don't have that power

vocal cloud
#

I'm working on integrating spigot servers into a gradle task to speed up running the thing

#

Should make running and testing faster

noble lantern
#

I need someone whos really well knowledgeable about either:

CitizensNPC's way they move entities without an NMS Navigator (Not all entities in mc have a Navigator)

OR

Making a ServerPlayer (remapped NMS's Player) move like an actual player does (Eg taking steps and moving smoothly)

I am NOT wanting to use CitizensNPC's setTarget method, this method applies the citizen's pathfinding, I am using a custom pathing so I already have my point so need my entity to move to, I just need the actual entity to MOVE to these points (I'm fine without using CitizensAPI for this)

I was told in the citizens discord, that using NMS#setDestination on their NPC's allow them to move, but this simply just rotates the NPC and makes him face the target

Any advice on this is greatly appreciated, have been stuck on this for a few days

#

sorry for spam

#

Also:

NMS Entity#moveTo Entity#move Entity#travel are all invalid on ServerPlayer, these methods need a navigator and will throw errors if you try using them

Spigot Entity#setVelocity doesnt work on players either while it may work on other things like pigs

quaint mantle
vocal cloud
#

Unless I'm mistaken it's not an actual server?

quaint mantle
vocal cloud
#

Yeah, I'm attempting to integrate a server into the IDE

#

Emphasis on the attempt

quaint mantle
#

how to get victim in EntityDamageByEntityEvent?

echo basalt
#

bro essentials has an items.json file with 40k lines that just has name -> material abbreviations

#

wtf is this shit

noble lantern
#

the i command

#

so if you use /i dpick

echo basalt
#

I'm fine with typing the full name

noble lantern
#

it uses that list lol

echo basalt
#

to save on 200mb ram

noble lantern
#

nah its like

#

maybe a mb max

#

maybe 2-5

echo basalt
#

I ran it through yourkit

#

seems like 4mb actually

#

still too much

noble lantern
#

yeah overall not much but they havent updated it in years

#

which is prolly the reason why

echo basalt
#

my entire zombies minigame plugin is consuming 30kb

echo basalt
ancient plank
#

essentials is like

noble lantern
#

essentials code is not the best

echo basalt
#

I know

#

I forked essentials once as part of a commission and wasn't satisfied

ancient plank
#

essentials is me when I wake up in the morning

noble lantern
#

you forked essentials? im sorry

echo basalt
#

essentials is me when I wake up in the afternoon

noble lantern
#

oh wtf i just found

#

the most amazing thread

echo basalt
#

at a code-level

#

to not leak anyone's ip

noble lantern
noble lantern
noble lantern
echo basalt
#

oh yeah you could just look at Mob#move

#

๐Ÿคฆ

noble lantern
#

those dont work

echo basalt
#

I mean the nms one

#

EntityInsentient

noble lantern
#

yes

#

oh

echo basalt
#

it does stuff

#

had to modify it like 2 nights ago

noble lantern
#

Does it successfuly Move ServerPlayer's?

echo basalt
#

not sure, I use it for zombie fakeblock detection

noble lantern
#

cryy

echo basalt
#

and removing some stuff like fire checks

noble lantern
#

ServerPlayers dont have Navigation

echo basalt
noble lantern
#

So any move, moveTo, travel calls get exceptions

echo basalt
#

this is called by the navigator

noble lantern
#

Not sure what the other thing is

echo basalt
#

it just sets a delta movement

noble lantern
#

How can you get it from the NMS Entity?

#

i can get it via citizens

echo basalt
#

get what?

noble lantern
#

but would be nice to use raw NMS

#

EntityInsentient

echo basalt
#

Ah

#

you cast it

noble lantern
#

direct to entity?

echo basalt
#

it's basically bukkit's Creature

noble lantern
#

mb

echo basalt
#
Entity nmsEntity = ...;

if(!(nmsEntity instanceof EntityInsentient insentient))
  return;

insentient...
#

It's like casting an EntityLiving

#

I'm using mojmappings for this

#

but you can do without

#

you're looking for a(EnumMoveType, Vec3D)

noble lantern
#

Yee i have same remappings

#

one more question

#

sorry

echo basalt
#

what

noble lantern
#

Vec3d argument

Is this the direct location i want the entity to go? Or is it transformed between 2 distances somehow?

echo basalt
#

relative pos

#

The equivalent of what you call setVelocity to

#

it grabs the current AABB, expands in the vec3d's axis and does checks

#

and then performs collisions and stuff

noble lantern
#

fuck me math

#

alright ill have to play with this a bunch, thank you for this info tho

echo basalt
#

just subtract 2 points and wrap it to a Vec3

noble lantern
#

oh

#

enty start vec - entty target vec?

#

multiplied by speed

echo basalt
#

yeah

noble lantern
#

ohh

echo basalt
#

something like that

noble lantern
#

thats ez

#

yeah sounds like setVelocity method ngl

#

its how i did it to make shit like a pig go whoosh

echo basalt
#

but with more details

noble lantern
#

Ill try SELF first since the thread i saw said he used that

#

if not then PLAYER

echo basalt
#

set it to piston to make sure you crash stuff

noble lantern
#

i see you learned that the hard way

echo basalt
#

nah

noble lantern
#

oh xD

echo basalt
#

I mean given this is a minigame I deleted piston checks

#

and fire checks

#

because zombies can't really walk through lava on a city map

noble lantern
#

interesting my remappings dont have EntityInsentient

noble lantern
noble lantern
echo basalt
#

on mojmap

noble lantern
#

oh

#

imma try this first

#

then go with that

Update: Yep i know .multiply is on the wrong vector

#

๐Ÿคž

#

even getting him to move a million blocks is progress kek

#

ahhh ffs

#

i hate this different remapping citizens does

#

okay nice

#

progress

#

yo wtf

#

at y73?

#

oh wow

#

yeah, i like this

#

i think this issue is MC auto teleports past 8 blocks iirc

quaint mantle
#

looks hot

#

better than mine ๐Ÿ’€

noble lantern
#

I beileve its OneDark IIRC

#

its a plugin too

#

so simple install

quaint mantle
#

ye

echo basalt
#

you can do some interpolation at your own time

#

welp I'm going to bed

#

it's like 6am here

noble lantern
#

gnight! Thanks for the help too!

quaint mantle
#

bro tf did i do

noble lantern
#

wym?

quaint mantle
#

i broke my intellij

#

i just can't change my theme anymore

noble lantern
#

do you have 2 theme plugins installed

quaint mantle
#

like ew. tf is this

quaint mantle
noble lantern
#

LMAO ILLUSION HES SO FAST

river oracle
quaint mantle
#

what's the best way to make a region? so if the player is between the region something happens im guessing worldguard?

noble lantern
#

i do have methods though to get him to pathfind right to them

#

just cant get him moving properly

noble lantern
carmine nacelle
#

Hey does anyone know how I could support the output formatting from this site? ChatColor#translateAlternateColorCodes doesnt work: https://rgb.birdflop.com

sly venture
#

How do I resolve build errors?
WGRegionEvents is in use.

error: package de.netzkronehd.wgregionevents.events does not exist
import de.netzkronehd.wgregionevents.events.RegionEnterEvent;

carmine nacelle
#

like #084CFB

quaint mantle
#

this function supports hex codes

#
    private static final Pattern pattern = Pattern.compile("#[a-fA-F0-9]{6}");

    public static String color(String text) {
        for(Matcher match = pattern.matcher(text); match.find(); match = pattern.matcher(text)) {
            String color = text.substring(match.start(), match.end());
            text = text.replace(color, ChatColor.of(color) + "");
        }

        return org.bukkit.ChatColor.translateAlternateColorCodes('&', text);
    }```
#

there

#

anyways

#

does anyone know the event for a regionleaveevent in worldguard api?

carmine nacelle
#

thx man u a real one

quaint mantle
#

np

carmine nacelle
#

I think its RegionExitEvent..?

quaint mantle
carmine nacelle
#

join their discord

torn badge
hoary perch
#

some people of you may know, that you can leftclick a entity in spectator mode to get into it. is this possible with spigot?

#

like this

#

got it. its player.setSpectatorTarget

wet breach
#

have to ensure the player is in spectator mode first

#

before using such methods

hoary perch
#

i did that

onyx fjord
#

So bad that people make APIs to fix the original

wet breach
#

it isn't bad, just the features that most want are outside of the scope of the plugin

#

however the author has done a decent job in allowing others being able to hook into it though if you want to extend it

#

same is true of worldedit

granite burrow
#

how can I strip and clear any color codes from a message? I used ChatColor#stripColors(); but it doesn't remove the &[letter / number] from the string. Is there a good way to remove that

torn shuttle
#

that's not actually a color code

#

but to make a long explanation short apply the color code via the api and then strip it

#

ChatColor.translateAlternateColorCodes('&', string);

carmine nacelle
#

Is there a way to see if a player's message contains hex formatting?

granite burrow
#

I've already done that, it doesnt remove the colors & colors, I found a different way to do it anyways so im good now thanks

noble lantern
#

How can i override a method of a class im extending, if the method is not abstract?

#

Is there a way to do that

#

CitizensNPC has this same method with return value getMoveControl, just wanted to override its return to use my own PlayerMove Control

#

oh nvm

#

i had wrong object

#

ignore me

#

/whoosh

shadow zinc
#

?paste now

undone axleBOT
shadow zinc
#

My plugin is meant to listen for redstone activity, cancel it, store it in hashmap and then play it back when its told to

#

for some reason when it comes to one tick it doubles it

#

i have no idea why its doing this

noble lantern
#

cancel the event

#

dont set the block state to act as the event cancellation (Unless that events not cancellable?)

#

your making a double loop that way iirc

(Considering redstone turning off fires that event too)

vernal minnow
#

does anyone know how to serialize a player?

noble lantern
#

sigh

#

May i ask why

#

serializing a player would be a redonky amount of data

#

my IDE lags just showing tab completions for the NMS methods of the player class lol

tardy delta
#

I underztandbthe pain

#

Understand smh

#

Phone moment

vernal minnow
#

i mean i have to send a list of Players via Bungeecord messaging channel to another server

shadow zinc
#

i've been stuck on this for nearly a month now its ridiculous

#

whatever I try doesn't work, if feels like a bug now

noble lantern
#

if its the block you just modified return

shadow zinc
noble lantern
#

Yes but i mean your not even checking the block state in that event

#

your just putting into a map

#

and updating a block state

#

theres no checks inside the actual event to see if the previous block state was even checked

shadow zinc
#

sorry my brain is fried I got covid, im not really following

noble lantern
#

this event right here

#

Your simply putting

#

your not checking if the block you just updated is the one inside this event

#

so naturally when this runs, its gonna overwrite the previous key set and lead to the weird issue you have now when iterating over the map again later because the value isnt the one you originally though was set, its instead the second time after you called update()

#

put() overwrites existing keys

#

putIfAbsent wont

shadow zinc
#

does setting the power in my restore code call the event?

noble lantern
#

i would assume so as that redstone

#

lemme check

#

yeah im gonna assume it fires when a signals turned on/off

#

its the same thing with BlockPhysicsEvent

#

you gotta be really careful cause you can get in a loop of updating the previous block you just edited

#

this one is only a one time loop because the states already 0

#

so when you call update() it already has the same value (0, off) and stops looping since it didnt actually signal a current change

#

So all in all: use putIfAbset and use Location not block state for the key

#

storing the BlockState of the redstone seems pointless, since you know all redstone block in that map are "halted"

#

so all you need to do is just iterate and power them again

shadow zinc
#

alright, ill give that a go

noble lantern
#

You honestly could pull this off with just a List of Location of halted redstone blocks

#

might be a lot easier

#

and you can just if (list.contains(location)) return;

shadow zinc
#

use location to get the block

noble lantern
#

yep, its the smoothest option imo

#

storing BlockState seems a little dirty

#

unless absolutely neded like say crops

#

cause they have 0-7 as an Ageable trait, instead of true/false for redstone power

shadow zinc
#

because it doesnt work

#

still doubling the pulse

shadow vine
#

how do i make an event work on command ( i want to enable and disable on command)

shadow zinc
#

beats me champ, im only level 9

noble lantern
shadow zinc
#

1 tick to 2 ticks

noble lantern
#

and then register it back normally

noble lantern
#

is it duplicate entries in the map thats causing it twice?

shadow zinc
#

its a hashmap it cant have duplicates

noble lantern
#

the info for running twice needs to be very percise

shadow zinc
#

hold up

#

does that make sense?

#

also its not lagging like that

#

ubuntu is just bad

shadow zinc
noble lantern
#

im not a redstone wizard

#

but that looks like a clock

#

i might be wrong, im horrible at redstone

#

does it to it with just a button, redstone and piston?

#

try testing simple stuff first like that

shadow zinc
#

its meant to do what it was doing before it halted

#

and thats not extending the pulse

noble lantern
#

oh is the pulse on that supposed to die out?

#

sorry im

#

VERY bad at redstone

#

but i think thats what you mean

shadow zinc
#

its just meant to keep going around as 1 repeater

#

when its restored its two repeaters

#

so something is doubling it

tender shard
#

well idk I never had any performance problems. except on my laptop and there sodium also wouldnt help lol

shadow zinc
#

'are you drunk' bruh

tender shard
#

I can prove that I'm not drunk

#

see? only 0.67 permille, that's only a bit over the "you may still drive a car" limit

noble lantern
#

6-7??

#

.67???

#

go to

#

a fucking hospital

#

jesus christ

#

how are you alive

shadow zinc
#

bruh who has a breathalyzer in their house

noble lantern
#

i do

chrome beacon
#

Germans

noble lantern
#

i need to see how drunk i am

shadow zinc
#

lol

noble lantern
#

but like

#

.67??

tender shard
noble lantern
#

BRE

#

the legal limit

shadow zinc
#

in Australia we don't give a fuck

noble lantern
#

in the USA is 0.08

tender shard
#

well

#

you use %

#

we use โ€ฐ

noble lantern
#

oh

#

ohhh

tender shard
#

so per thousands, not per hundred

#

lol

noble lantern
#

OHH

shadow zinc
#

lol

noble lantern
#

so your .067

#

fucking christ

#

you scared me

tender shard
#

yeah

#

0.67 % would be a bit much lol

noble lantern
#

yeah thats why i was freakin out kek

#

i thought i was talking with a dead man for a sec

tender shard
#

๐Ÿ˜„

shadow zinc
#

maybe this recording is a bit more clear

#

see how there is 1 repeater?

noble lantern
#

it looks like

shadow zinc
#

then when I restore it there are 2

noble lantern
#

your giving power to 2 repeaters at once

shadow zinc
#

see the chat?

#

Im outputting the hashmap

noble lantern
#

wait

#

so then why is the size 15

#

only like maybe 2 blocks actually have a powered redstone state i think

#

if a state turns to off you should ditch its instance

#

cause theres no need to halt it

#

its off

#

15 seems like all the repeaters there on screen

shadow zinc
#

again my brain is fried

#

and no

noble lantern
#

all good

shadow zinc
#

its not size

#

15 is the redstone power

#

i just 0>power to get true and false

#

and then when it comes to redstone dust I just set the power

noble lantern
#

to its original value right

shadow zinc
#

i believe so

noble lantern
#

cause that can cause issues to if you dont set it back to original

#

and its like in a block per say

#

like yours is

#

cause when its in a clock the signals lowered iirc

#

(Again i suck at redstone)

#

so double check that one

shadow zinc
#

they shouldn't be lowered?

#

considering repeaters repeat the signal to the maximum strength

#

and im currently only testing the repeaters, not the redstone dust sides

crystal palm
#

why does enchantment.level.0 keep appearing? here's the code:

        ItemStack inHand = target.getInventory().getItemInMainHand();
        ItemStack inOffHand = target.getInventory().getItemInOffHand();

        Enchantment enchant = Enchantment.getByKey(NamespacedKey.minecraft(enchStr));
        if (enchant == null) {
            sender.sendMessage(instance.translate("messages.command.invalid.unknown-ench"));
            return;
        }

        Map<Enchantment, Integer> enchants = inHand.getEnchantments();

        if (enchants.isEmpty()) {
            sender.sendMessage(instance.translate("messages.command.invalid.item-not-enchanted"));
            return;
        }

        if (!target.getInventory().getItemInMainHand().getEnchantments().containsKey(enchant)) {
            sender.sendMessage(instance.translate("messages.command.invalid.item-does-not-contain-ench"));
            return;
        } else {
            Economy economy = QuickDisenchant.getEconomy();
            double withdraw = instance.getConfig().getDouble("price");
            if (economy.has(sender, withdraw)) {
                //REMOVE ENCHANT
                inHand.removeEnchantment(enchant);

                //OFFHAND BOOK CHECK
                if(inOffHand.getType().equals(Material.BOOK)){
                    //ADD TO BOOK
                    int levels = inHand.getEnchantmentLevel(enchant);
                    inOffHand.addUnsafeEnchantment(enchant, levels);
                }
chrome beacon
#

Looks like you're adding a level 0 enchant

crystal palm
#

im getting the enchantment from the main hand item, along with it's level int levels = inHand.getEnchantmentLevel(enchant);

#

it was sharpness 5

#

ohh wait. i see the issue.

#

i removed the enchantment first, it seems

tender shard
#

I wonder whether negative levels work

shadow zinc
#

work?

#

depends on what you mean by works

crystal palm
#

mm sharpness -1 gives hp to enemy

noble lantern
crystal palm
azure dirge
#

excuse me, is there any ways that decrease player swim speed....?

noble lantern
#

does changing theyre normaly spee dnot work

noble lantern
crystal palm
#

nvm it isnt.

chrome beacon
#

Probably a mod

#

Looks like it at least

tender shard
noble lantern
#

ahh prollly is

azure dirge
noble lantern
#

was about to say dang i know the storage size of my item stacks im gonna serialize

chrome beacon
crystal palm
#

cant just setting player velocity do the trick??

noble lantern
#

Does setting the players speed like not work lol

crystal palm
chrome beacon
#

You can launch the player but it don't be smooth

crystal palm
#

oh right.

azure dirge
#

๐Ÿ˜‚

noble lantern
#

i would assume swimming goes off walking speeds

noble lantern
#

then likely what olivo said

#

or NMS

chrome beacon
#

Movment is client side. Depth Strider or Dolphin effect

#

Those are your options

azure dirge
urban kernel
#

how would i run some code constantly until something i sthe same as something else (i.e 2 strings)

noble lantern
#

run a bukkit timer, if strings are equal cancel timer

How ide do it

chrome beacon
#

Constantly; a while loop

#

You probably don't want that though

#

Use the scheduler

noble lantern
#

While loop is okay if you do it async and use a callback

urban kernel
#

ok, how

noble lantern
#

i do something similar in my plugin

chrome beacon
#

?scheduling

undone axleBOT
chrome beacon
noble lantern
#

its a blockingqueue

shadow zinc
urban kernel
#

and i can register an event if it is true, yez?

noble lantern
#

its all done in runnables now

noble lantern
#

i meant

#

sorry bukkit task***

#

Cancel the task after registering the event *

urban kernel
#

so like so?

#
new BukkitRunnable() {
  @Override
  public void run() {
    if(stringA.equals(stringB)) {
doSomething()
this.cancel(); // <--
      return;
}
  }
}.runTaskTimer(plugin, 1L * 1L /*<-- the initial delay */, 20L /*<-- the interval */);```
noble lantern
#

i would make your interval higher

#

maybe like 5L-10L

urban kernel
#

what is 1L in seconds

noble lantern
#

1 tick

#

so that runs 20 times a second

urban kernel
#

ok

#

ill do it 20L

noble lantern
#

Yep thats fine, just really depends on how fast you need the result after its set

urban kernel
#

pretty much asap

shadow zinc
#

then do 1 tick

urban kernel
#

1s is hardly noticeable

noble lantern
#

~10L-20L is pretty good then

#

1 tick isnt the best for things

shadow zinc
#

cant get any more asap than that

hot wolf
#

Couldn't find anything about this. What can I use instead of those two: ```java
team.setNameTagVisibility(NameTagVisibility.ALWAYS);
team.addPlayer(player);

urban kernel
#

yeah but wont that cause performance issues

shadow zinc
#

depends on what you are doing

noble lantern
urban kernel
#

chyecking if a command has been run by looking at a file it writes to when it has been run

hot wolf
#

Yeah, custom name tag and stuff

noble lantern
#

Entity#setCustomNameVisible(true)

Will always show a entities name tag

false = only shows on hover to the hovering player

Entity needs a custom name set ofc tho

hot wolf
#

Thanks!

noble lantern
#

however

#

not sure if it works on players

#

might

#

try and see

#

100% perfect for all other entities tho

urban kernel
#

a player is anb entity

#

so shd do ?

shadow zinc
#

find a similar plugin and see if they are open sourced

#

might help

noble lantern
#

Players have certain methods cut out

#

eg a player doesnt have AI

#

cause well

#

yeah lol

#

theres a few others thing the player also doesnt have idk all of them

urban kernel
noble lantern
#

as well as things that player has other entities dont

noble lantern
#

its mainly just a pc entering human inputs

urban kernel
#

so is this correct

new BukkitRunnable() {
            private Plugin plugin;
            FileReader input;

            {
                try {
                    input = new FileReader(Bukkit.getServer().getPluginManager().getPlugin("Heartrows").getDataFolder() + "/status.txt");
                } catch (FileNotFoundException e) {
                    throw new RuntimeException(e);
                }
            }

            @Override
            public void run() {
                if(input.equals("true")) {
                    getServer().getPluginManager().registerEvents(new DeathEvent(), this.plugin);
                    this.cancel(); // <--
                    return;
                }
            }
        }.runTaskTimer(this, 1L * 1L /*<-- the initial delay */, 20L /*<-- the interval */);
urban kernel
#

it was a joke

urban kernel
#

whats the issue

grim ice
#

well try it

#

you will get an NPE

urban kernel
#

whats an NPE

grim ice
#

NullPointerException

urban kernel
#

y

grim ice
#

" private Plugin plugin;
"

#

u didnt initialize the plugin

urban kernel
#

intellij idea suggestions be like

crystal palm
#

does this look fine?

noble lantern
#

did you code in C# before this

crystal palm
#

no lol

#

why do you ask?

noble lantern
#

other than the null warning, make sure to collow java conventions

#

all variables are camelCased in java

#

unless

#

its like a public static

crystal palm
#

gotcha

noble lantern
#

you can do like INSTANCE_THINGY if you want to

#

or just keep it camel

#

and yeah null check enchantment meta

#

not all items can have enchants legally

#

(air)

crystal palm
#

alright.

urban kernel
#

@noble lantern this better?

Plugin plugin = this;
        new BukkitRunnable() {
            FileReader input;

            {
                try {
                    input = new FileReader(Bukkit.getServer().getPluginManager().getPlugin("Heartrows").getDataFolder() + "/status.txt");
                } catch (FileNotFoundException e) {
                    throw new RuntimeException(e);
                }
            }

            @Override
            public void run() {
                if(input.equals("true")) {
                    getServer().getPluginManager().registerEvents(new DeathEvent(), plugin);
                    this.cancel(); // <--
                    return;
                }
            }
        }.runTaskTimer(this, 1L * 1L /*<-- the initial delay */, 20L /*<-- the interval */);```
crystal palm
#

IDE added assert enchantMeta != null;. look good to you?

noble lantern
#

it throws exceptions if its false

#

AssertionException

crystal palm
#

how about an if?

noble lantern
#

try and see

urban kernel
#

ok

noble lantern
crystal palm
noble lantern
#

that way you can handle null values and alert the player they fucked up somehow

crystal palm
#

if book doesnt exist in offhand it just skips it - its taking an enchant from item in main hand

noble lantern
#

if your 100% absolutely certain of this

#

assert is okay, but generally if is more commonly welcomed as you can handle it and return

crystal palm
#

ight

shadow zinc
crystal palm
#

everything seems to be fine and i see nothing that's exploitable. thanks a ton, burchard.

tender shard
#

fun fact

#

a writable book has no data when new. when adding one letter, it's 17 bytes. when removing it again, its still 14 bytes instead of having no data

shadow zinc
#

whats on the item data?

tender shard
#

idk one sec, let me turn it to json

#

nothing interesting

shadow zinc
#

hmm

tender shard
#

so basically just "pages:[]"

hot wolf
#

To make sure, that we're on the same page. What I was trying to do is setting the name of the player (above his head)

quaint mantle
#

how do I fix the net.minecraft server error?

#

Cannot resolve symbol 'mojang'

#
import com.mojang.authlib.properties.Property;
#

how do I fix dis?

eternal oxide
#

Fix? There is nothing wrong with that

#

oh missing symbol, you need the import

#

err dependency

eternal oxide
#
        <repository>
            <id>minecraft-repo</id>
            <url>https://libraries.minecraft.net/</url>
        </repository>``````xml
        <!--Mojang -->
        <dependency>
            <groupId>com.mojang</groupId>
            <artifactId>authlib</artifactId>
            <version>3.5.41</version>
            <scope>provided</scope>
        </dependency>```
quaint mantle
#

thanks man

eternal oxide
#

Players don;t have a respawn point.

quaint mantle
#
import de.ancash.craftinginjector.IRecipe;
eternal oxide
#

If they have a Bed in that world, they respawn there

quaint mantle
#

is there something called as dis ^

eternal oxide
#

or they respawn at teh world spawn

tender shard
#

does anyone know why most of those methods take an int instead if the proper type?

#

e.g. writeChar takes an int, why not a char?

eternal oxide
quaint mantle
#

hm

#

then what is it

eternal oxide
#

Somethign German de.ancash

young knoll
#

Players do have a spawn point

eternal oxide
#

FancyCrafting plugin

#

Players don;t have a spawn point

young knoll
#

Yes they do

quaint mantle
#

look

#
import java.util.ArrayList;
import java.util.HashMap;

import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;

import de.ancash.craftinginjector.IRecipe;```
young knoll
#

/spawnpoint is per player

#

/setworldspawn is global

eternal oxide
#

um, why is this not exposed in spigot I wonder?

young knoll
#

No idea

quaint mantle
#

hm

eternal oxide
#

Ok, In Spigot players don;t have individual spawn points ๐Ÿ˜‰

young knoll
#

NMS

quaint mantle
#

or?

eternal oxide
#

I just told you want it was. Its a plugin

#

FancyCrafting plugin

quaint mantle
#

then why does it not work

#

OH

eternal oxide
#

all I had to do was search for java de.ancash

quaint mantle
#

does it have an api?

eternal oxide
#

No idea