#help-development

1 messages Β· Page 1802 of 1

misty current
#

Only the player can see it

sullen marlin
#

Player

misty current
#

As the class name suggests

karmic grove
#

ok just making sure

onyx fjord
#

Doesn't it send message as player?

#

Or it sends it to him

sullen marlin
#

to

onyx fjord
#

I was always wondering why spigot enchant and potion effect names are different from the game

#

Why is that

sullen marlin
#

because theyre very old

onyx fjord
#

you don't plan updating them?

sullen marlin
#

they are both Keyed though so you can get the actual names

onyx fjord
#

Oh

ember estuary
#

How can you config.save() your own configs? (not the default config) (to memory, not to disk)

sullen marlin
#
BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

ember estuary
#

ty

ancient plank
#

md's- dare I say- on fleek today

ember estuary
#

yeah xD

#

is it a good practise to save a config on WorldSaveEvent

#

so that world and config are always "synced", especially looking at server crashes

#

or when do u guys safe ur config?

#

only at onDisable?

#

or everytime something changes?

ivory sleet
#

I never save my config

#

well not the classic yml ones

#

as they're intended user configs

#

not (arbitrary) data holders/carriers

ember estuary
#

so u use a database i assume

#

thats the more pro approach i guess

#

but if a starter wanted to use a config for saving data

#

what would u suggest

ivory sleet
#

no

#

I just never save it

#

only load it

ember estuary
#

wym u dont save data

unreal quartz
#

by 'config data' do you mean data relating to players

ember estuary
#

yeah

unreal quartz
#

so not configuration data

ivory sleet
#

uh then its different

ember estuary
#

playerdata/<playername>.yml

unreal quartz
#

either queue changes for immediate saving off-thread or save at given intervals and when the player disconnects

ember estuary
ivory sleet
#

I save on connect and disconnect, as well when I mutate the data transfer objects, so I save whenever the data is changing (almost, some exceptional cases), I also leave a config option in case someone wants a synced buffer.

ember estuary
#

alright, thanks guys

ivory sleet
#

Hmm I don't use the bukkit config api for general serialization or deserialization nor as a data transfer model

ember estuary
#

what do u use to save data

unreal quartz
#

a database

#

lol

ember estuary
#

i asked him xD

unreal quartz
#

it's what they're for

ember estuary
ember estuary
#

yeah it does

#

xD

#

but database is faster

eternal oxide
#

that depends on teh database

ember estuary
#

and better if u have lots of data

unreal quartz
#

the pitfall is that you must write entire files at a time

#

you cannot incrementally save a yml file with bukkit

eternal oxide
#

correct ^

tender shard
#

but you can easily put the save thing inside an async task

eternal oxide
#

Its all about what data and how you are going to use it

unreal quartz
tender shard
#

yeah I always use YAML for everything that an admin might want to adjust themselves

#

for everything else, I use PDC lol

#

thank god someone fixed the 1.18 PDC bug

#

I couldn't sleep the whole night until it was fixed

eternal oxide
#

there was a bug?

ivory sleet
ivory sleet
#

the linkedhashmap is slow and not thread safe which FileConfiguration uses iirc

sullen marlin
#

Math.max(1, Math.min(5, i))

#

this clamps in the range [1,5] right?

eternal oxide
#

ah pdc not being detected as a chunk change so wasn;t saved by the looks

#

good to know. Someone will be in here at some point with it

tender shard
unreal quartz
sullen marlin
#

hmmmm must be a plugin causing this crash then

ivory sleet
sullen marlin
#

netty Channel has definitely not been removed

#

did you read the release notes

eternal oxide
#
        <!--Bukkit/Spigot NMS -->
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>${project.spigotVersion}</version>
            <classifier>remapped-mojang</classifier>
            <scope>provided</scope>
        </dependency>```
#

io.netty.channel si there just fine

golden turret
#

iforgot the param for the remapped 😭

eternal oxide
#

I use maven and its just fine, so long as you use teh remapped flag when running buildtools

#
@echo off
curl -z BuildTools.jar -o BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
set /p Input=Enter the version: || set Input=latest
java -jar BuildTools.jar --generate-source --generate-docs --rev %Input% --remapped
pause```
#

don;t avoid it, its so handy

#

I was avid against using it a couple of years back. I would not move off Ant

#

However, if you are refusing to use maven, which jar are you actually adding to yoru project?

#

\Spigot\Spigot-API\target\spigot-api-1.18-R0.1-SNAPSHOT.jar

ivory sleet
#

G r A d L e 🎡

eternal oxide
#

oh god no. If he's anti maven he would blow a gasket at gradle

left swift
#

Hey, I have a question what can I do about it, how can I get the texture out of it?

tender shard
#

why?

#

I also used to hate it

#

until I understood it

eternal oxide
#

^ Yep, until I used it I hated it

#

I think for me it was more a dislike of everything being internet based. I like everything local. I didn;t understand .m2

tender shard
#

DOesn't GameProfile has a property for the texture?

tender shard
left swift
tender shard
#

anyway, maven is heaven sent and it works really really well with IntelliJ

eternal oxide
#

works well with eclipse too.

#

The only issue it has is downloading javadocs, you have to update project to get it to do that

tender shard
#

yeah well

#

eclipse ignores / overwrites many pom stuff when you still have this .eclipse directory or whatever it uses

#

at least it did 2 years ago

tender shard
#

so basically just print out all the properties. Then you can see how the property you need is called

#

probably it's just "textures"

lavish hemlock
#

ew

tender shard
#

?

lavish hemlock
#

use a lambda

tender shard
#

why? it's just for debugging

lavish hemlock
#

because even if it's just for debugging, it's faster to type

tender shard
#

I let intellij create the anonymous class lol

left swift
tender shard
#

but here, to make you happy @lavish hemlock

#
profile.getProperties().forEach((s, property) -> System.out.println(s+": " + property.getValue()));
lavish hemlock
#

thank you

tender shard
lavish hemlock
#

or use method handles if you call getProperties often

tender shard
#

I wonder

#

why do you even need reflection?

left swift
#

i found this soulution

tender shard
#

yeah but can't you easily do sth like this?

#

one sec, gotta type it

#
        SkullMeta headMeta = (SkullMeta) item.getItemMeta();
        Field profileField;
        try {
            profileField = headMeta.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            GameProfile profile = (GameProfile) profileField.get(headMeta);
            String texture = profile.getProperties().get("textures").stream().findFirst().get().getValue();
        } catch (NoSuchFieldException | IllegalArgumentException | IllegalAccessException exception) {
            exception.printStackTrace();
        }
left swift
#

hmm, I will try this

autumn talon
#

How do I get a net.minecraft.server.network.ServerPlayerConnection to be able to send packets from a org.bukkit.entity.Player/org.bukkit.craftbukkit.v1_17_R1.entity.CraftPlayer object? I don't see any fields that will do the conversion, and casting doesn't work.

tender shard
#

no idea whether it'll work, just try it

tender shard
autumn talon
tender shard
#

you believe? πŸ˜„

autumn talon
#
import net.minecraft.core.BlockPos;
import net.minecraft.server.network.ServerPlayerConnection;
import net.minecraft.network.protocol.game.ClientboundBlockUpdatePacket;
import net.minecraft.world.entity.item.FallingBlockEntity;
#

These are my imports, I'm pretty sure that this is using the Mojang mappings.

tender shard
#

that's mojang mappings

#

yes

#

okay in 1.17 idk, I'm using obfuscated for 1.17

#

I only switched to mojang in 1.18 so sorry

#

but maybe this will help you anyway:

#

this is how I send packets in 1.18 mojang mapped

autumn talon
#

I'll give it a shot, thank you!

tender shard
#

np but probably it won't work by copy pasting

#

e.g. connection.connection is just connection in 1.17 IIRC

autumn talon
#

It's connection.connection in 1.17 it looks like.

tender shard
#

ah okay

#

wasn't sure, as said I'm using obfuscated in 1.17 because back when 1.17 came out I was too stupid to figure out how maven modules work

tender shard
#

np πŸ™‚

#

tbh I'm surprised it works lol

#

I just typed it down without checking it lol

dry forum
#

is it possible to detect right/middle clicks on an item in a gui?

ivory sleet
#

Yeah iirc it is

#

InventoryAction is the closest you can get

maiden thicket
#

is there a way to toggle online mode without nms

ivory sleet
#

Gonna go ahead and say no

#

As far as I am concerned there is not

maiden thicket
#

πŸ˜”

sullen marlin
#

What possible reason could you have for that

lavish hemlock
tender shard
#

I think that detecting middle click is no longer possible in 1.18

#

at least not for empty slots

tender shard
#

but why would you ever need to change it at runtime?

#

just stay in online mode lol

sullen marlin
#

I just cannot see a legitimate use

tender shard
#

me neither. anyway, setting onlineMode to true in MinecraftServer should be enough from a first glance

#

or false

wild reef
#

Hey guys I got a question.

  1. I need to check if the player has an inventory opened
  2. I need to get that inventory and for example fill it with items.

Question:
Is there a pretty way to accomplish that, some method for the player - getting an topInventory if there is one or do I really need to store it basically if an inventory opens / closes?

tender shard
#

btw is it still possible to access private fields via reflection? I heard that this illegal-access flag was removed

eternal oxide
#

I'm not sure that would even be possible. It would invalidate every players UUID

tender shard
maiden thicket
wild reef
maiden thicket
#

i didnt make it

#

so idk why it exists

#

but anyways yeah thats why

#

trying to remove any nms usage in this plugin

tender shard
#

except maybe their own inventory

#

but you can't detect that anyway

#

it's client sided

maiden thicket
#

i dont know if u know of this server but its like one of the top 3 mc servers still existing or smthn

#

was created back in like 2009

wild reef
sullen marlin
#

That supports piracy

wild reef
#

thanks for your help @tender shard

maiden thicket
#

yeah i dont know, they dont do offline mode anymore

tender shard
#

not sure what top and bottom inventory will return when the player doesn't have an inventory open, just try it πŸ˜›

sullen marlin
#

Well if they don’t do offline mode then they don’t need to switch to it πŸ˜‰

tender shard
#

but anyway, either the top or the bottom one will be the player's inventory

tender shard
#

just add some debug statements and see πŸ™‚

tender shard
#

the only legit reason to use offline mode is when running behind a proxy imho

sullen marlin
#

That and bots for testing

#

Everything else is just stealing

tender shard
#

yes

maiden thicket
#
        for (OfflinePlayer player : Bukkit.getOfflinePlayers())
        {
            player.setWhitelisted(false);
        }```
tender shard
#

although I remember notch once tweeted he's okay with people pirating the game if they can't afford it

sullen marlin
#

Seems correct

maiden thicket
#

lesgoo

tender shard
#

however he's gone for a long time now lol

sullen marlin
tender shard
#

didn't he also tweet some racist things or something? πŸ˜„

maiden thicket
#

i opened this class and i was like wtf

round finch
#

How can i practice the Logic Gates + programming

maiden thicket
#

they were using nms for managing whitelist

#

i was like

#

what

tender shard
#

the first 4 levels are fine

lavish hemlock
tender shard
#

but when it comes to the adder, you will die lol

tender shard
round finch
#

i wanna be able to understand the underlining thing

tender shard
#

underlining thing?

#

wdym?

maiden thicket
#

are we speaking of notch

maiden thicket
#

isn't he transphobic and a white supremist or smthn

buoyant viper
#

he's quite the labyrinth

autumn talon
tender shard
#

I once dated a trans dude and he was transphobic himself lmao

maiden thicket
#

excusemewhat

autumn talon
round finch
#

he was inspiration for me the idea of making unique games but i never cared of his whatever

buoyant viper
maiden thicket
#

cancel each other out

#

ez

lavish hemlock
#

We could sit here and debate Notch all day and neither side of that ongoing argument would be fully correct.
Join the neutral side, where you're never not correct :)

round finch
#

people can self hate

maiden thicket
#

Bukkit#getBukkitVersion would return like

#

"1.17.1"

#

or smthn right

tender shard
sullen marlin
#

theres no real reason a plugin should check that tbh

maiden thicket
#

it's not to check it's just to print out

buoyant viper
maiden thicket
#

for like motd and stuff

lavish hemlock
#

I follow him on Twitter because sometimes he makes funny tweet.

tender shard
#

or e.g. to check what particle names to use

maiden thicket
#

it's getBukkitVersion right xd

sullen marlin
# tender shard NMS?

there's a getMappingsVersion for NMS, and for particles and other stuff capability testing is the better way

buoyant viper
#

i mean maybe if a plugin needs to behave differently depending on the game version

late sonnet
sullen marlin
#

stuff changes within versions

tender shard
#

I'm using this to get the NMS version:

#
        try {
            final String packageName = JeffLib.class.getPackage().getName();
            final String internalsName = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
            //abstractNmsHandler = (AbstractNMSHandler) Class.forName(packageName + ".internal.nms." + internalsName + ".NMSHandler").newInstance();
            abstractNmsHandler = (AbstractNMSHandler) Class.forName(packageName + ".internal.nms." + internalsName + ".NMSHandler").getDeclaredConstructor().newInstance();
maiden thicket
#

would Server.Spigot#getConfig return spigot.yml

tender shard
maiden thicket
#

alr

lavish hemlock
#

I prefer abstraction over reflection in the case of NMS.

maiden thicket
#

tyty

lavish hemlock
#

But then again I never use it.

tender shard
#

?javadocs

tender shard
#

?jd

lavish hemlock
#

And then again I haven't made a plugin in like, 2 years.

#

"Why are you in this server then? thonk "

Because fuck you, that's why.

tender shard
round finch
#

i don't understand the half of it

#

but java doc...

tender shard
tender shard
lavish hemlock
#

everything

#

life itself

#

the universe

round finch
#

the mns

lavish hemlock
#

m&ms

round finch
tender shard
#

skittles

lavish hemlock
tender shard
#

❀️

lavish hemlock
#

skittles are preferable

round finch
#

there is also smarties

lavish hemlock
#

I mean yeah but

quaint mantle
#

looooo

lavish hemlock
#

they make my mouth dry

tender shard
#

there's also dog poo

#

but

buoyant viper
#

tittie skittles

lavish hemlock
buoyant viper
#

estradiol

lavish hemlock
#

oh

tender shard
#

oh man

#

I just see spigot removed a rule violating review from one of my plugins lol

#

would not have expected this

#

normally they don't really care about review reports

karmic grove
#

Is there a tuturial i wanna change where blocks spawn

tender shard
#

Asking again because noone replied - is it still possible to change private fields of another class using reflection?

tender shard
ivory sleet
#

Yes mfnalex

tender shard
#

thx

ivory sleet
#

But only certain ones

sullen marlin
#

or whatever the new Handle method is if youre using that

tender shard
#

so what does the removed flag with "illegal access" do?

#

I thought it was about this

karmic grove
sullen marlin
#

reflection into Java internal classes is blocked

tender shard
tender shard
lavish hemlock
karmic grove
sullen marlin
karmic grove
#

Is there any tuturials for it i cannot find

#

Anything about it

primal kite
#

Question on whether I am doing this right or not, am I missing something?
I have a villager that I run remove() on.
However no other villager will claim the bed or workstation that they had.
I checked the poi nbt and both have free_ticket set to 0(i.e. unclaimable).
Am I missing something, doing it wrong, or should this be a potential bug?

lavish hemlock
tender shard
# karmic grove Yea

you want to implement a custom WorldCreator or something like that then. For minor changes, you could probably also rely on some events and change the chunk after it already was generated

round finch
#

how do i learn Logic gates with programming?

sullen marlin
#

if you murder the villager is it ok?

round finch
tender shard
#

when their deals are shit, yes

sullen marlin
#

Maybe .remove doesn't run the necessary cleanup, in which case probably a bug worth reporting

regal dew
#

Poor villager

karmic grove
lavish hemlock
round finch
tender shard
round finch
tender shard
lavish hemlock
#

Either that, or you can use the internal IMPL_LOOKUP

tender shard
#

just promise to never try nandgame @round finch

round finch
tender shard
#

you will never be happy again after getting to level 4 or 5

sullen marlin
#

plot twist, already not happy πŸ˜‰

primal kite
#

killing the villager in game removes the poi/memory of home and jobsite. remove() from code does not seem to do so.

tender shard
#

correction: Full Adder is the nandgame level that will kill you

#

it's the 7th level I think

sullen marlin
#

yeah .remove is brutal, it doesn't run the death logic which is where the poi releasing code is

#

.setHealth(0) or something might be a workaround, though I think it's worth a bug report. I am a little concerned though because .remove is meant to be a hard kill and not do other things like drop items

tender shard
#

what does poi even mean?

round finch
#

pooi

eternal night
#

point of interest

primal kite
#

points of interest

tender shard
#

and what is a POI in regards to entities? I'm confused lol

sullen marlin
#

maybe just overriding .remove for CraftVillager would be ok, but in any case open a bug report

quaint mantle
#

why i dont see any kill player method other that hard-set the health to 0?

primal kite
#

right now i am getting the poi block from memory and doing a destroy/create on it

lavish hemlock
sullen marlin
#

wait

#

what method are you actually calling

#

I dont see Entity.remove() in the API ?

primal kite
#

villager.remove()

sullen marlin
#

nevermind, IDE being weird

#

open a bug report

primal kite
#

i need to verify it still exists in 1.18 but will do....

tender shard
#

are there already any datapacks out for 1.18 that add custom biomes? I want to check whether my NMS code is working to get custom biome names

#

I'm talking about datapacks that use an actual namespacedkey to add new biomes

#

e.g. terralith in 1.17

#

or however it was called

sullen marlin
quaint mantle
#

datapacks use what to add more things in mc?

tender shard
#

oh it's released? nice

quaint mantle
#

use java?

#

or what?

tender shard
#

they are mostly some json stuff IIRC? no idea

#

yep

#

here's how terralith looks like @quaint mantle

quaint mantle
#

yeah just json

#

hmm

#

so...

#

the json access the api like plugins in spigot right?

tender shard
#

no

#

it's a vanilla thing

young knoll
#

Datapack

tender shard
#

doesn't have anything to do with spigot

#

or bukkit

quaint mantle
#

huh? it still somehow access the api?

#

for it to work

tender shard
#

no

quaint mantle
#

api for datapacks.

tender shard
#

minecraft itself reads the datapacks

round finch
#

i always wanted to learn Data Packs and modeling + texturing for spigot plugin making

tender shard
#

me too

quaint mantle
tender shard
#

minecraft reads the json files inside the datapack and then does stuff with it lol

#

it has nothing to do with the bukkit api

quaint mantle
#

then how can datapacks do custom biome better than nms...?

round finch
#

Herobrine.json

primal kite
#

a few of the old school bukkit stuff was implemented by the microsoft/mojang team. i think they even hire some to help with the modding portion of the vanilla api

quaint mantle
young knoll
#

It's not really an API

quaint mantle
#

yea

tender shard
#

just wanted to say that

#

there's no MC / vanilla API

round finch
#

it is in the game

lavish hemlock
#

anything can be an API

round finch
#

you can use datapacks in single player

lavish hemlock
#

APIs don't have to be public after all

quaint mantle
primal kite
#

there is a vanilla api. that is where the resource/datapacks are implemented

young knoll
#

They can't

#

Have you not seen what has been made with NMS?

tender shard
quaint mantle
lavish hemlock
#

what constitutes source code tho

tender shard
primal kite
#

datapacks are implemented via a application programing interface(API)

quaint mantle
#

an*

tender shard
#

lol

#

md_5 can you confirm there is literally no way to check when a player opens their own inv?

sullen marlin
#

[[insert big stretch meme here]]

#

No way to check

tender shard
#

I looked through the whole NMS code for hours but it seems like it's impossibler in 1.13+

#

well

#

that's bad

young knoll
#

Just uhh

#

Make a PR

#

To Mojang themselves

tender shard
#

lol

#

nice idea but I doubt they'd care

#

what I also don't understand

#

bundles are working fine since 1.17

#

but now we have 1.18 and they are still not obtainable in vanilla

#

whyyy

young knoll
#

"They aren't finished yet"

tender shard
#

yeah...

young knoll
#

Meh, just use a datapack

#

Or my plugin

misty current
#

Can you make an entity that acts like some blocks don't exist? I wanna create a custom mob that can walk through doors

quaint mantle
#

they arent allow it yet πŸ†—

tender shard
#

what plugin @young knoll ?

#

send link send link

young knoll
misty current
tender shard
tender shard
misty current
#

I meant closed ones

quaint mantle
#

like that?

young knoll
#

Only if they are chasing someone through a door

tender shard
#

ah closed ones, okay

misty current
#

Or actually any type of block

tender shard
#

9 3/4

quaint mantle
round finch
#

UH! DataPack coding!?

tender shard
misty current
#

Only thing that comes to my mind is making fake blocks for each player

tender shard
#

I don't find it lol

young knoll
#

Recipes

round finch
#

is it Javascript?

tender shard
#

datapcaks are json

young knoll
#

But I mean if you only want bundle recipes, just use the VanillaTweaks version

tender shard
round finch
#

Extended from: JavaScript

#

i see

young knoll
#

I hit the picture limit

#

I think I can use more with embeds though

tender shard
#

it's neither a scripting nor coding language

#

it basically just describes things, like HTML or yaml

round finch
#

where i find to learn it

primal kite
#

@misty current get the pathfinding, override it for the location it wants, when it hits the block that it should go through teleport.

tender shard
#

learn what? datapacks?

round finch
#

json and datapack

misty current
#

Since a mob needs a clear path to pathfind to somewhere

round finch
young knoll
#

Json is basically yaml

#

But with more {}

lavish hemlock
#

no, JSON is JS but with more ""

wicked lake
#

One or the other is basically a version of the other, I can't remember which is which

lavish hemlock
#

although JSON is apparently valid YAML πŸ€·β€β™‚οΈ

wicked lake
#

YAML is a superset of JSON

sullen marlin
#

Allegedly

#

I'm not sure it actually works well in practice

primal kite
#

@misty current that is where the pathfind override comes in. Get what it should be looking for, if blocked by "door" set pathfind anyways. if door still blocking, teleport.

misty current
#

Oh that's interesting

#

I'll do some testing tomorrow

tender shard
#

every json file is valid yaml but not the other way around

misty current
#

Thanks

lavish hemlock
#

most languages shouldn't be compatible with one another

#

unless it's like a programming lang

#

I think most of Java is valid Groovy, but they're both JVM langs so it kinda makes sense

primal kite
#

@misty current leverage the near by entities method. should get you close to what you are trying to do. also, if you what to make it look like it is still "walking" through the "door", you might want to implement a runnable to do the teleport portion in smaller increments so that the player "see's" it "phase" through the door. not sure the actual distance needed from when the door is blocking to when the are actual through it based off hit box

misty current
#

Aight thanks

tender shard
#

kotlin

#

ugh

#

I don't like kotlin

#

in german kot means shit

#

so I like to call it shitlin

lavish hemlock
tender shard
lavish hemlock
#
public static void main(String[] args) {
    System.out.println("Hello, World!");
}
lethal path
#

Short question: When I'm converting a player (entity Player) into a string using Player.toString() and afterward try to get a Player from that string using .getPlayer() it gets me a null. Is that intended and I'm using getPlayer in a wrong way or is something else broken? I'm to dumb to find something online

lavish hemlock
#

In Kotlin, that has to be

fun main(args: Array<String>) {
    println("Hello, World!")
}
tender shard
#

Player.toString() will return sth like "CraftPlayer{18241195}" or sth like that

#

to get the player's name, use Player.getName()

#

then you can get the player back through Bukkit.getPlayer("name")

#

but I'm wondering, why do you even want to store the player by their name?

lavish hemlock
#

store players by UUID

tender shard
#

it's better to use UUIDs in 99% of all cases

#

^

wicked lake
#

Players can change their names, UUID doesn't change with em

lavish hemlock
#

yeah

buoyant viper
lethal path
tender shard
lavish hemlock
#

void is Unit

buoyant viper
#

scala???

lavish hemlock
#

and return types are postfix as well

#

they're just implicitly defined

#

if you wanted to be perfectly explicit in Kotlin

#

you could declare the above as

tender shard
#

I hate gradle so much

buoyant viper
#

if i want to be explicit ill just write Scala

#

😎

tender shard
#

I just created a new kotlin project in intelliJ and now gradle is taking 2+ minutes to set everything up

lavish hemlock
#
public fun main(args: Array<String>): Unit {
    System.`out`.println("Hello, World!")
}
tender shard
#

maven just works out of the box

#

people always claim "gradle is so much faster" but erm no

#

at least not for me

buoyant viper
#

i use gradle bc i cba to understand xml

tender shard
#

cba?

buoyant viper
#

cant be asked

lavish hemlock
#

can't be asked/assed iirc

tender shard
#

oh

#

I think the pom.xml s are way easier to understand than gradle files

#

but thats obviously because Im used to maven

wicked lake
buoyant viper
#

i just write stuff and pray it works

wicked lake
#

Ah the good ol shotgun approach

lavish hemlock
#

bold of you to assume people other than Maow understand anything

summer scroll
#

Quick question, Is creating a spigot plugin considered as Software dev?

tender shard
tender shard
#

I always thought every java code is also correct kotlin code

buoyant viper
tender shard
#

I must have confused it with something else

lavish hemlock
#

:)

tender shard
#

yes, I know about this fact

#

I know that I don't know enough about it to call it shitty

unreal quartz
#

i will now call kotlin shitlin for the rest of my life

buoyant viper
#

shitlin, i like that

tender shard
#

I dislike it anyway

#

it's ugly

unreal quartz
#

ouch

#

languages have feelings

tender shard
#

sorry but

#

it IS ugly

#

e.g. why is the type behind every parameter name?

buoyant viper
#

could be worse, could be java

unreal quartz
#

it is optional

tender shard
#

java is nice and appealing lol

buoyant viper
#

oh i am never using that sticker again that is GROSS

lavish hemlock
#

Java is not appealing

wicked lake
#

First to remake Minecraft in brainfuck wins my sympathy

tender shard
#

and also why does kotlin think that every method is funny lol

summer scroll
tender shard
#

most of the methods I wrinte aren't fun lol

#

they're sad

lavish hemlock
#

e.g. it would be weird to do val/var and then not have postfix on methods

tender shard
#

yeah I get it. I just don't like it

#

I don't even have a proper reason not to like it

buoyant viper
#

if im using val/var ill just write js 😎

tender shard
#

I just don't like it because I'm stubborn

sullen marlin
#

the : seems redundant though

tender shard
#

yes

buoyant viper
#

yeah

tender shard
#

many things in kotlin seem redundant

lavish hemlock
#

the ; in all of your Java projects is redundant

#

:)

buoyant viper
#

no ; = no 1 line class files

#

:(

tender shard
#

why? a space would be enough for separating stuff

lavish hemlock
#

none of you understand how lexers/parsers work

buoyant viper
lavish hemlock
#

most of the time, whitespace is ignored

sullen marlin
#

also why is out in backticks

lavish hemlock
#

although I found out you don't actually need to use a verbatim literal for it

#

only with in

tender shard
sullen marlin
#

galaxy brain move there

lavish hemlock
#

cuz y'know, unlike Java, Kotlin gives you the option to name shit after keywords :p

tender shard
#

I can do that too πŸ˜„

buoyant viper
#

so you can do that in java, just not before compilation

lavish hemlock
#

because after compilation, it's not Java

buoyant viper
#

technically u can

lavish hemlock
#

it's JVM bytecode

#

the two are separate languages

buoyant viper
#

Java virtual machine

unreal quartz
#

technically i can write haskell in java then

buoyant viper
lavish hemlock
unreal quartz
#

just cant compile it y'know

tender shard
#

right

lavish hemlock
#

the Java language does not support verbatim literals

tender shard
#

anyway why would anyone wanna name their variables "for" or "if"?

unreal quartz
#

default

lavish hemlock
#

but class, fun, out, in, pretty much anything Kotlin takes that may be useful as a name otherwise

buoyant viper
lavish hemlock
#

also default yes

#

actually I believe default doesn't need to be backticked

tender shard
buoyant viper
#

just makes using the decompiled output harder to get working

tender shard
buoyant viper
#

allatori is a meme

tender shard
#

actually it's doing a really good job when you're not using the demo version

buoyant viper
lavish hemlock
#

All obfuscators are memes.

buoyant viper
#

java is a meme

#

ezpz

lavish hemlock
#

that is true

buoyant viper
#

and yet here we are. still using it :(

lavish hemlock
#

I get happy about new Java features not because they improve Java

#

but because they'll probably improve Kotlin due to their effects on bytecode

tender shard
buoyant viper
#

all i needed was java 11, that built-in HttpClient is fan-fuckin-tastic since i dont use Apache

lavish hemlock
#

I could probably make a tool that remaps invalid names to valid ones before decompilation.

#

Would take me like what

#

a day?

#

maybe less than a day?

#

All I would have to do is loop through the constant table, check for keywords in Utf8 constants, and then add a 1 or smthn to the end of them.

tender shard
#

I don't wanna say I don't think you can do it, but I'd indeed love to see it happen

buoyant viper
lavish hemlock
#

aight then give me a class to test on

tender shard
#

I'll dm you the jar I just send a screenshot on

#

done

lavish hemlock
#

ok immediately

#

why the fuck

#

do you have a package named daddy

tender shard
#

haha

#

the new version is actually called stepsister

lavish hemlock
#

containing a class called Stepsister

buoyant viper
#

dont worry about it

lavish hemlock
#

de.jeff_media.autocomposter.daddy.Stepsister

tender shard
#

I used to do that for AngelChest to distinguish between paid and free version

#

I can do stuff like

#

if(Daddy.allows(Feature.SOMETHING))

buoyant viper
#

obfuscation but your dictionary is all vaguely porn-ish words

lavish hemlock
#

Squirt.class

#

Moist.class

tender shard
buoyant viper
#

Moist.class

lavish hemlock
#

HAHAHA

#

dumbass minds think alike

buoyant viper
#

oh_no.stepbro.ImStuck.class

tender shard
#

πŸ˜„

#

Stepsisters tend to be stuck sometimes

#

thats how I came up with the name

lavish hemlock
#

everyone is always stuck

tender shard
#

because Daddy had a bug where it was in an endless loop

#

so I renamed it to Stepsister

dry forum
#

i have a set that = [10, 20, 30] is it possible to use it like an array list and get the 1st one in the set? or some sort of work around?

lavish hemlock
#

sexual programming

the newest design paradigm

tender shard
#

do you guys want to see an actual plugin in meme form?

tender shard
lavish hemlock
#

It would be more inefficient to use something like a toArray

tender shard
#

I mean, sets are not in any order

dry forum
lavish hemlock
#

Nope

tender shard
#

so there basically is no "first" element in a set

undone light
#

My plugin wont load, I am using the api build with build tools i also tried download form the website for the api

lavish hemlock
#

Set doesn't have get

buoyant viper
dry forum
#

ah

lavish hemlock
#

Sets are mainly for iteration.

#

List is where you can do actual manipulation.

tender shard
#

anyway @lavish hemlock if you get the jar (de)compiled into actually readable source, pls don't send it here, it's a paid plugin

lavish hemlock
#

I'll make sure to send it here

#

you're welcome

tender shard
#

thanks

hasty prawn
tender shard
#

lol

#

go ahead, I'm waiting πŸ˜›

lavish hemlock
#

you gotta give me some time I gotta code it bitch

tender shard
#

alr alr

lavish hemlock
#

I also have to stare intensely at the JVMS again to remember how to read classfiles.

undone light
undone light
late sonnet
tender shard
undone light
#

Last line here

#

Its what doc said

tender shard
#

remove the recipe before adding the same namespacedkeyed recipe again

undone light
#

Wait can you turn quarts blocks bak into quarts now?

#

By default?

buoyant viper
#

yes

undone light
#

I feel really dumb now lol. Thanks everyone

late sonnet
young knoll
#

You can?

tender shard
#

I just realized

#

THERE'S A NEW MUSIC DISC

#

and it's πŸ”₯

#

it's so shitty

#

I love it

young knoll
#

How is it shitty

tender shard
#

but nothing beats the stal flute solo

young knoll
next fossil
#

Its not as good as pigstep

tender shard
#

NOTHING beats the stal flute solo

next fossil
#

Pigstep and the broken 11 and 13 discs set the bar too high for me

tender shard
next fossil
#

Tommyinnit has left the chat

sullen marlin
#

Only the ambient music is good

#

The other stuff is weird

tender shard
#

the other stuff, how you call it, is GOLD

#

I want to have this guy play flute at my funeral

lavish hemlock
#

Fun fact: Kotlin has a ===

#

This is not a compare by type thing like in JS btw

#

It's actually just the equivalent to Java's ==

#

Since Kotlin's == is equals

tender shard
#

ugh

#

typical asshole move invented by this evil dude who invented kotlin

lavish hemlock
#

Well most of the time you're gonna want to use equals anyways

#

Plus I'm pretty sure classes can operator-overload equals to do identity comparison anyways

#

Like enums

tender shard
#

tbh I just went through my lib

#

I used equals() 41 times

tender shard
#

and == 100+ times

next plume
lavish hemlock
#

Yeah same with JS

tender shard
tender shard
lavish hemlock
#

mew

tender shard
#

and with cat dude I'm referring to @lavish hemlock who couldnt spell "Meow" correctly lol

young knoll
#

Minecraft has the perfect music when you’re burning an entire village to the ground

tender shard
#

πŸ˜„

lavish hemlock
#
  1. Maow is closer to the sound a cat makes than Meow
  2. Meow was already taken
  3. That is the name of my cat (technically, although her name is Maow-Maow considering that is the sound she makes constantly)
tender shard
#
  1. depends on the language
  2. valid reason
  3. ooooooooh :3 please send a picture of her
lavish hemlock
#

you know

#

Maow is taken basically nowhere

#

it is weirdly uncommon

tender shard
#

yeah well

#

maybeee

lavish hemlock
#

except for the few cases where I have to use Maow_

tender shard
#

because Mao was the chinese hitler

lavish hemlock
#

lmao

#

eh who cares

tender shard
#

πŸ˜„

young knoll
#

Maoware Bytes

tender shard
#

probably every country had their hitler. its just that some of them were more "successfull" in their genocide than others. thats why most people know hitler and stalin and mao, but not everyone knows paul potts etc

tender shard
lavish hemlock
#

who was the American Hitler?

tender shard
#

the one who got his election "stolen"

lavish hemlock
#

also oh no we're getting into politics lmao

tender shard
#

yeah lets not do that πŸ˜„

sullen marlin
# young knoll Minecraft has the perfect music when you’re burning an entire village to the gro...

[Screen Themes 'Ride of the Valkyries' series - 6 of 6]

The most famous, and possibly the best, use of this piece of music in film. Because as terrifying as death from the sky must be, it's much worse if they are playing Wagner at full blast.

Starring Robert Duvall, Martin Sheen, Laurence Fishburne, Marlon Brando, Frederic Forrest, Harrison Fo...

β–Ά Play video
lavish hemlock
#

they're going to take our shins, Alex

#

watch out

tender shard
#

I have to google that idiom

lavish hemlock
#

it's not an idiom

tender shard
#

I'm not native english lol

lavish hemlock
#

it's just a Maow thing

sullen marlin
#

Ye idk it either

tender shard
#

hm I still don't get it

#

what does it mean to "take ones shins"?

#

google wasnt helpful

lavish hemlock
#

to forcibly acquire ones shins

young knoll
#

They’re going to saw off my fingers if I don’t pay my taxes

tender shard
#

isn't shin the thing in your leg?

#

I really don't understand lol

#

a shin is the thing where it hurts so much when you get kicked into it

#

like the "testicles of the leg" lol

tender shard
#

or get a fake hand for them to chop off

tender shard
#

recently the police knocked at my door

#

because they thought I was selling kidneys

#

and now the funny part

#

after I explained to them that i don't, i got a letter from the tax authority a few months later

#

and they asked whether I have income from selling kidneys that I did not declare

young knoll
#

Well

#

Do you

tender shard
#

haha

#

no

sullen marlin
#

Haha wtf

tender shard
#

but if you google "sell kidney seriously" in german my website comes up first on google

#

its a satire website

#

some people just dont understand it

sullen marlin
#

LMAO

#

Link?

tender shard
#

its actually kinda sad

#

sometimes I get phone calls from people who actually wanna sell their kidney and think its real

#

because I have to provide my real phone number in the imprint, its a law in germany

young knoll
#

See, this would be a great front for someone who actually did sell kidneys

sullen marlin
#

Is that whole website satire?

tender shard
#

yes

#

the whole website is just stupid jokes

young knoll
#

I don’t know German

tender shard
#

it pretends to be "news"

young knoll
#

But I see a marque, which is a sign of quality

tender shard
#

this is google translated

#

obviously the puns dont work in english but you get the general idea

#

btw the last paragraph which is about taxes is actually true

young knoll
#

Why the heck is a heart worth less than a kidney

tender shard
#

if you indeed decide to sell your newborn's kidney, you must pay taxes for it unless your child is older than 1 year

sullen marlin
#

Hah so you mentioned tax at the end

tender shard
#

I looked up the price on some suspicous websites and just quoted them

young knoll
#

Good to know my eye is worth less than the new iPhone

tender shard
#

XD

young knoll
#

Or should it be eyePhone

tender shard
#

I especially love this:

#

A skull without teeth (1,200 euros)

#

like

#

imagine you want to buy a skull on the black market

#

and the dealer is like "with or without teeth?"

young knoll
#

I’ve got a hammer I can remove them myself

tender shard
#

XD

#

I also got a website that tells people how smoking is awesome and healthy. somehow people are also too stupid to realize it's a joke. I often get hate emails insulting me for promoting smoking lol

#

probably also doesnt make much sense in english, but whatever

#

it also doesnt make much sense in german sooo

#

ugh google does a very bad job in translating the smoker website

tender shard
#

I think my chrome is a bit spammed with tabs

tribal gyro
#

how do you change a players skinm

#

with like mineskin

tender shard
#

do you want to change the skin yourself, or do you want to use some kind of API like mineskin?

#

I dont know what mineskin is

#

so sorry if this question doesnt make sense

#

is mineskin a website or a plugin?

tribal gyro
#

its a website

#

actually idk

#

its supposed to like

#

give u some key thingy

#

idk

#

lol

tender shard
#

I am not 100% sure on that, but:

#

wait

#

first let's talk about what you're trying to do

#

what are you trying to do? πŸ˜„

tribal gyro
#

i want to try to make like

#

a skin animator

#

thingy

#

liek it changes your skin

#

every like

#

idk

#

.1 sec

#

for example

tender shard
#

that won't be possible

tribal gyro
#

why?

tender shard
#

you know, the server doesn't really care about the player's skins

tribal gyro
#

?

tender shard
#

only the clients are looking up and downloading each other players' skins

tribal gyro
#

wdym

tender shard
#

I mean: skins are client sided

tribal gyro
#

wait what

#

then how come people can do it with spigot

tender shard
#

by faking player's UUIDs or something, it might be possible

#

but definitely not possible to have the skin change every second

tribal gyro
#

why not

next fossil
#

Ok I've been stuck on this for the past hour
SynchedEntityData sed = npc.getEntityData();
EntityDataSerializer<Byte> eds;
FriendlyByteBuf buffer = new FriendlyByteBuf(buffer);
EntityDataAccessor<Byte> eda = new EntityDataAccessor(npc.getId(), eds.read(buffer).getSerializer());

tender shard
#

because the mojang skin server has some kind of rate limit

next fossil
tender shard
#

i.e. what doesn't work?

next fossil
#
  1. Idk how to
tribal gyro
#

`

tender shard
#

using backticks

tribal gyro
#

3 `

tender shard
#

^

next fossil
#
  1. I'm trying to transition from a DataWatcher to the SynchedEntityData, but the EntityDataAccessor<T> can't get the Serializer for the 2nd parameter in the Constructor
#
SynchedEntityData sed = npc.getEntityData();
EntityDataSerializer<Byte> eds;
FriendlyByteBuf buffer = new FriendlyByteBuf(buffer);
EntityDataAccessor<Byte> eda = new EntityDataAccessor(npc.getId(), eds.read(buffer).getSerializer());
tender shard
#

what's the type of "npc"?

#

also you never instantiate eds

tribal gyro
#

^ i was gonna say that

tender shard
#

πŸ™‚

tribal gyro
#

but i didnt know if u had to

#

lol

#

better shut then open

tender shard
#

it HAS to be intantiated

#

instantiated?

#

english is hard lol

tribal gyro
#

instaniatedd

#

idk

tender shard
#

insta*

#

lets use this lol

#

so yeah @next fossil

#

tell us what "npc" is

#

probably an NMS entity?

#

also what version? 1.18?

#

all of that is important for us to check what's wrong

#

@next fossil it's 5am here and I#d like to go to bed soon

#

so if you're still looking for an answer from me pls reply soon

#

aight I'mma update one server from debian 9 to debian 11, then go to sleep. So you'll have to ask someone else @next fossil

next fossil
#

Okay

#

Sorry I was afk for a while

tender shard
#

np

#

so what's npc?

next fossil
#

npc is the ServerPlayer instance

tender shard
#

kk

next fossil
#
ServerPlayer npc = new ServerPlayer(((CraftServer) Bukkit.getServer()).getServer(),
                ((CraftWorld) player.getWorld()).getHandle(), gameprofile);
tender shard
#

you have this line:

#
FriendlyByteBuf buffer = new FriendlyByteBuf(buffer);
#

it doesnt make sense

#

you basically say "buffer = new Something(buffer)"

#

that won't work, obviously

next fossil
#

It's this constructor that's confusing me the most:

#
EntityDataAccessor(int var0, EntityDataSerializer<T> var1)
tender shard
#

what do you need the EntityDataAccessor for?

next fossil
#

For setting the skin into the the NPC based on their ID, similar to DataWatcher, for the outer layers

#

Hence the bytes:

byte bytes = (0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40);
tender shard
#

hm

#

all I can see is that EntityDataAccessor.createAccessor(int) returns a new EntityDataAccessor<Byte>

#

but that probably doesn't help you lol

next fossil
#

And because DataWatcher's method originally was:

dataWatcher.set(DataWatcherRegistry.a.a(17), b);

I can't tell what the changes are. The first a's constructor is:

a(PacketDataSerializer packetdataserializer, Byte obyte) {

and the other a extends ByteBuf

public PacketDataSerializer(ByteBuf bytebuf) {
tender shard
#

hm sorry I can't help with that, my knowledge about NMS entities is very limited

#

maybe someone else can help

next fossil
#

Because the original method extends ByteBuf, I figured the FriendlyByteBuf method would be similar for calling the Serializer

tender shard
#

FriendlyByteBuf lmao

#

funny name

#

but yeah as said, I have no idea sorry

next fossil
#

Not friendly at all given the amount of time trying to fix this XP

tender shard
#

XD

#

maybe open a thread in the forums

next fossil
#

The trickiest part about the EntityDataSerializer<Byte> is its an Interface, it CAN'T be instantiated

#

So i'm not even sure how to fit it in a method call for

EntityDataAccessor(int var0, EntityDataSerializer<T> var1)```
fervent chasm
#

I'm trying to have a thing where if you click an item in your inventory, it will take it, and then put it in a gui, but I'm also trying to make it so that you can only put 1 of the item in. So, here's what I got.

ItemStack newitem = e.getCurrentItem().clone();    // cloning the item player pressed
newitem.setAmount(1); // setting the amount to one
e.getView().getTopInventory().setItem(25, newitem); // putting one of them in the gui
p.getInventory().remove(newitem); // then removing 1 from the user

But this somehow just does not take 1 away from the player, it just puts 1 of them in the gui, but the amount the player has stays the same.

flat perch
#

Im trying to set a join message and have the whole message ChatColor.YELLOW

But because Teams.getClanPrefixName returns both colored prefixes and the username - it overrides the ChatColor.YELLOW.

event.setJoinMessage(message);```
#

how would you override all colors to yellow?

crude charm
crude charm
fervent chasm
flat perch
#

that was just for demonstration purposes

crude charm
crude charm
flat perch
#

I don't see any static abuse, and I need to keep the prefix colors for other classes

#

is there no method to override all colors?

crude charm
#

No you just have bad java practices which are interfering with it

#

?learnjava

undone axleBOT
crude charm
#

@flat perch ^

flat perch
#

I found a workaround, thanks

fervent chasm
#

Yeah, I don't understand what you by removing the item. Are you saying I add it to the gui, and just remove all of same items from the inventory?

karmic grove
#

so i want to replace all stone with sand so far my code is ```java
@EventHandler
public void walkEvent(PlayerMoveEvent e) {
int raduis = 2;
Block middle = e.getTo().getBlock();
for (int x = raduis; x >= -raduis; x--) {
for (int y = raduis; y >= -raduis; y--) {
for (int z = raduis; z >= -raduis; z--) {
if (middle.getRelative(x, y, z).getType() == Material.STONE) {

                }
            }
        }
    }
}
#

but it does not work

#

like at all

dry forum
#

List<String> l1 = sec.getStringList(stdata2.get(player)).add(text);
Required type:
List
<java.lang.String>
Provided:
boolean

what.... why is this happening

drowsy helm
#

.add returns a boolean

#
List<String> l1 = sec.getStringList(stdata2.get(player));
l1.add(text);```
smoky oak
#

the Equals sign is for null checking

drowsy helm
#

no, enums can use == aswell

karmic grove
#

so use == instead

smoky oak
#

is it faster?

drowsy helm
#

negligible

karmic grove
#

so do .equals or == lol

#

i see lots of different opinions on the forums

rough basin
#

Aye Hello, I can't find EntityZombie class to extend.

import org.bukkit.entity.Entity;

public class sentrytest extends EntityZombie { }

if i Alt + Enter, intelij Just keep say make a new class.
Should I import more Things?

smoky oak
#

its an interface

#

implement

#

instead of extends

#

you cant extend a interface

drowsy helm
#

i think EntityZombie may be in spigot-api

smoky oak
#

its an interface

#

three second google search lol

rough basin
#

Damn

#

I saw 2014 tutorials

#

Sorry for the silly question

#

🀦

smoky oak
#

thats exactly the kind of mistakei i would make