#help-development

1 messages ยท Page 527 of 1

ivory sleet
#

sometimes

young knoll
#

Depends if you are hourly or salary

topaz atlas
#

LMAO

ivory sleet
#

ye lol

#

well

#

comments represent failure to express ur intent in code

orchid gazelle
#

There is some interesting thing, think about it. No matter when the hell, maybe in 50 years, somewhere there is just a standalone letter i. We all will remember the good old times when we used i as an iterator every day

ivory sleet
#

(mostly) not always

topaz atlas
#

The reason comments is useful everywhere is that, it can actually help you debug by seeing what each aspect of your code without like, being stuck in programming mode

orchid gazelle
# ivory sleet (mostly) not always

I sometimes use comments to mention possible issues, todos, what things can be done better in the future when I have time or to describe the limits of a functionality

ivory sleet
topaz atlas
ivory sleet
#

i think there is a rly good yt vid on it

orchid gazelle
#

Lmao uncle bob

topaz atlas
#

Oh god thats 1hr

#

lol

ivory sleet
#

that series will make u a better programmer instantly

young knoll
#

But will it make me laugh

topaz atlas
#

Java is annoying because there is just so much properties/methods in it, like, its not like js. For almost all my programming languages i used to learn by playing around with a library, any new term i hear about i look it up, like throwing a snowball down a hill, i expand my knowlage. And this sorta worked fine. but for java i have to watch and look at hours worth of content

#

idk if that made sense

ivory sleet
#

well java is harder than js at the end so it does make sense to some extent

young knoll
#

Tfw types

topaz atlas
#

js is like, java had a child, but the child was adopted, and it hate the child, and tried to drown it in a river.

#

Im actually trying to teach my friends java based on my experince..

harsh mirage
#

Hi. I want to use the NMS ItemStack from version 1.19.4 but the IDE does not find the NMS ItemStack. How do I import it? Other NMS classes are shown.

shy finch
#

Hello! Looking to contribute to spigot adding LivingEntity#playHurtAnimation(). It requires me to add a method into Bukkit and implement that in CraftBukkit. Does this mean I open 2 separate pull requests? (Fork and clone both repos, then open 2 separate pull requests?)

(Please @shy finch me)

shy finch
young knoll
#

Although you should already be able to do this with LivingEntity#playEffect

shy finch
#

I'll be sure to provide those details in the PR

#

Thanks for the quick response! Just trying to make sure I don't blatantly misuse the PR system ๐Ÿ‘

ivory sleet
#

I feel like there arenโ€™t that many guides that take a completely green field beginner friendly path

#

Like I never understood why youโ€™d use some symbols and not others in the very beginning when I was learning

topaz atlas
# ivory sleet Ye thatโ€™s nice

Yeah, currently im focusing more on keeping them instrested than fully correct, I rather have someone start off doing things a bit wrong and faulty than loosing interest altogether.

ivory sleet
#

Thatโ€™s a good principle

topaz atlas
#

Minecraft is actually a good motivation to learn java

ivory sleet
#

True

young knoll
#

Make it work before you make it look nice

#

As a bonus you can always skip the make it look nice part and ship it early

topaz atlas
#

The only lanuuage most people care about is python, which sucks, because i hate python

ivory sleet
#

Yeah well py does have a big eco system

#

And is easy to get into

livid dove
#

Man talking to spider about all this when raz could of got a cheeky code review xD

#

:L

topaz atlas
topaz atlas
#

for like functions

#

I know pythin forces you to indent

#

but...

young knoll
#

If youโ€™re really bold you can even skip the making it work part and just ship it

topaz atlas
#

lmao

young knoll
#

But then youโ€™ve made sonic 06

ivory sleet
#

Because it motivates you to create smaller functions

#

As to not get too nested

topaz atlas
#

My next exam is to make a website with CSS and html, advertising some role in IT.
So im sorta glad I can do CSS and html now

#

I learnt C# from unity, CSS cant be that diffrent

#

Although i did say that about java

young knoll
#

C# is very different than CSS lol

ivory sleet
#

CSS is just ehm well, I mean the language semantically isnt hard

#

But u gotta remember like a lot of stuff from the dom model etc

young knoll
#

Making anything look good with css is hard

#

But that may be more an artist issue than a programming issue

orchid gazelle
#

Making anything look good with anything is hard

young knoll
#

After all why not

#

Why shouldnโ€™t I make the background neon pink

topaz atlas
#

I just wanna go back to js ๐Ÿ˜ญ

ivory sleet
orchid gazelle
#

Tbh I prefer Java Syntax

ivory sleet
#

Ew

topaz atlas
#

I use js for node.js

orchid gazelle
#

Js syntax is too minimalistic

ivory sleet
#

Static + strongly typed >>>

orchid gazelle
#

Yeah

topaz atlas
#

npm is the best package system

#

PIP aint that good

orchid gazelle
#

I've used npm before and I agree there

topaz atlas
#

thanks for coming to my ted talk

orchid gazelle
#

But yeah

young knoll
#

Found 56 vulnerabilities in 3 packages

orchid gazelle
#

package manager is not everything of a language lol

ivory sleet
#

Yeah npm pretty nice

topaz atlas
#

Also, you should probably look at the code from the package ur downloading

#

because a bunch of packages

orchid gazelle
#

Lmao

topaz atlas
#

literally, redirects another package to you

young knoll
#

Didnโ€™t like

topaz atlas
#

like alot of these packages aint anything unique

orchid gazelle
#

The thing with npm is

young knoll
#

A tiny package disappear once and break half of the universe

#

๐Ÿ’€

ivory sleet
#

Yea

orchid gazelle
#

You get to 2 Terrabytes of dependencies very quick

topaz atlas
#

tru

#

which is why i rather read and copy the code from packages tbh

orchid gazelle
#

I always use as few libraries as I can at all tbg

topaz atlas
#

I dont need 50 dependencies just to make a fucking api call

orchid gazelle
#

I prefer writing everything how I want it to be, not relying on others

ivory sleet
ivory sleet
topaz atlas
#

Sometimes I download packages that does like, things like recursive functions or things like that, because i cant be damned to fix it, and convenince

ivory sleet
#

Library commitment is sth to be careful about

orchid gazelle
#

Aight but now, good night. I gotta go to school in 5 hours

#

So get up in like 4.5h

ivory sleet
#

Sleep well bro

topaz atlas
#

I should probs go, bye

ivory sleet
#

Cya bud :)

orchid gazelle
#

Cya^^

topaz atlas
#

e.getClickedBlock()

#

How do I get the name of the block

#

from clicked block

#

i just checked the forums

#

i cant see anything

young knoll
#

What do you mean name

#

The material?

topaz atlas
young knoll
#

Block#getType

topaz atlas
#

how do you get the materia

#

ok thanks

shy finch
# shy finch Hello! Looking to contribute to spigot adding `LivingEntity#playHurtAnimation()`...

So what is the standard way to send a packet to "all players that can see this".

I see this method in internals, but obvious it is unsafe:

    @Override
    public void playHurtAnimation(float yaw) {

        /*
         * Vanilla degrees state that 0 = left, 90 = front, 180 = right, and 270 = behind.
         * This makes no sense. We'll add 90 to it so that 0 = front, clockwise from there.
         */
        float actualYaw = yaw + 90;
        ClientboundHurtAnimationPacket packet = new ClientboundHurtAnimationPacket(getEntityId(), actualYaw);

        // TODO send packet to players in radius
        // this is unsafe
        ((ChunkProviderServer) getHandle().getLevel().getChunkSource()).chunkMap.broadcast(getHandle(), packet);
    }
#

Or is the standard broadcast all?

    @Override
    public void playHurtAnimation(float yaw) {

        /*
         * Vanilla degrees state that 0 = left, 90 = front, 180 = right, and 270 = behind.
         * This makes no sense. We'll add 90 to it so that 0 = front, clockwise from there.
         */
        float actualYaw = yaw + 90;
        ClientboundHurtAnimationPacket packet = new ClientboundHurtAnimationPacket(getEntityId(), actualYaw);

        // TODO send packet to players in radius
        getHandle().getServer().getPlayerList().broadcastAll(packet, getHandle().getLevel().dimension());
    }
small holly
#

does gradle have built in resource filtering? (so I can add ${project.version} in my plugin.yml?)

#

or do I need to install a gradle plugin for it

shy finch
#

I use a gradle plugin... One sec let me get you a link

small holly
#

cool thanks

shy finch
#

The link is at the top comment ++ an example usage

small holly
#

oh that one generates the the plugin.yml?

shy finch
#

Yes

small holly
#

nice

#

oop thanks so much for that because next im gonna be adding modules for different versions lol

#

I have done that once before lol

shy finch
#

Yeah that repo is funny because it:

  1. Compiles to 2 jar files
  2. Has a module for each NMS version (1.12+) (it actually has 2 modules.... one for each jar)
sullen marlin
shy finch
#

Well this is in the living entity class, replacing LivingEntity#playEffect(EntityEffect.HURT)

#

There isn't a player involved (except for the people receiving the packets)

#

Looking at the source for playEffect, they use broadcastEntityEffect, which doesn't apply anymore since in 1.19.4 we have to use the ClientboundHurtAnimationPacket

small holly
#
Build file 'C:\Users\selen\Dropbox\GlitchMC\Hordes2.0-1.8\build.gradle' line: 87

A problem occurred evaluating root project 'GlitchMCHordes'.
> No signature of method: build_cs1dxgpbzjvnqu203tc6dv6un.bukkit() is applicable for argument types: (build_cs1dxgpbzjvnqu203tc6dv6un$_run_closure6) values: [build_cs1dxgpbzjvnqu203tc6dv6un$_run_closure6@49a9e221]
  Possible solutions: wait(), wait(long), mkdir(java.lang.Object), uri(java.lang.Object), split(groovy.lang.Closure)
plugins {
...
    id 'net.minecrell.plugin-yml.bukkit' version '0.5.3'
}
...
/* line 87 */ bukkit {
    main = "dev.selena.glitchmc.GlitchHordesMain"

    authors = listOf("Selena", "GlitchMC")
    depend = listOf("WorldGuard")
    softDepend = listOf("PlaceholderAPI")
}
``` hmm
#

(Following what it shows on the github for groovy)

shy finch
#

using intellij?

small holly
#

yep

shy finch
#

Don't click refresh gradle when installing a new plugin, click the one that looks more like a file

#

After that, click the refresh gradle

#

(at least I think that is the issue)

shy finch
small holly
shy finch
#

invalidate caches and restart is not a bad bet

small holly
#

oh ye I forget thats a thing lol

#

hmm nope same issue

shy finch
#

Unsure...try ChatGPT

#

might be groovy related, I prefer kotlin

small holly
#

oh wait I might know

#

I added the bukkit task before reloading with the plugin

small holly
small holly
shy finch
#

you can use kotlin for JUST the build file

#

but that shouldn't be the problem

round finch
#

Minus 180 & plus 180 = 360
in between 0

small holly
#

huh the bukkit task has not been added to my task hierarchy

shy finch
#

trying to keep things consistent

small holly
#

I remember I had this issue with shadowJar but I don't recall how I fixed it

#

for some reason the issue is regarding these

    depend = asList('WorldGuard')
    softDepend = asList('PlaceholderAPI')
#

if I remove them it works fine

weak meteor
#

i changed the config for my pom.xml to output the plugin in the plugins folder in my localhost, the problem is that, i literally get folders with my stuff in .class.

pom: https://paste.md-5.net/jisudugevi.xml
Folder:

small holly
round finch
#

.asList("a", "b")

#

idk maybe it is ' that is the problem

small holly
#

nope just tried changing

round finch
#

nice

small holly
#

:/

#

its not asList

#

I just do = ['a', 'b']

round finch
#

sowy idk gradle ๐Ÿซค
i just know the basic of java

small holly
#

ye dw Im still learning gradle XD

round finch
#

good luck

#

seems quite the deal to learn

small holly
#

eh its not too bad lol

#

its maven but way more powerful

wise mesa
#

if I have an old instance of player

#

and said player leaves

#

and then they rejoin

#

and i try to run functions on the old instance

#

like teleport

#

what will happen

#

i know i should just try it

#

but im too lazy

sullen marlin
shy finch
#

Yeah play sound used a slightly different method, but they used volume * 16 for distance... I don't know what arbitrary number I should choose.

wise mesa
#

md 5 if I get an offline player object while a player is offline

#

and then later they come online

#

two questions

#

first will isOnline become true

#

on the old offlinePlayer

#

and second is it safe to cast this offlinePlayer to Player

sullen marlin
#
  1. probably; 2) no
shy finch
#

I can change it to use the same method as playSound with an arbitrary distance if you'd like... 96 should be more then enough.

shy finch
wise mesa
#

very cool

#

thank you

sullen marlin
#

There's absolutely a method - have you checked the entity tracker?

wise mesa
#

I was just curious what would happen

shy finch
#

but this has an unsafe cast that I'm not sure how to avoid

#

that is the backend code that entityeffect used... I am not too familiar with NMS, so if I just do an instanceof check and return otherwise... I don't know the sideeffects. Like, would this make the method unusable in certain situations?

sullen marlin
#

Check the swing code above your method maybe

shy finch
#
    public void swing(EnumHand var0, boolean var1) {
        if (!this.swinging || this.swingTime >= this.getCurrentSwingDuration() / 2 || this.swingTime < 0) {
            this.swingTime = -1;
            this.swinging = true;
            this.swingingArm = var0;
            if (this.level instanceof WorldServer) {
                PacketPlayOutAnimation var2 = new PacketPlayOutAnimation(this, var0 == EnumHand.MAIN_HAND ? 0 : 3);
                ChunkProviderServer var3 = ((WorldServer)this.level).getChunkSource();
                if (var1) {
                    var3.broadcastAndSend(this, var2);
                } else {
                    var3.broadcast(this, var2);
                }
            }
        }

    }
#

They do the instanceof

#

I'll update the PR

sullen marlin
#

Level will always be server

quaint mantle
#

md_5, what are plans regarding Material enum due to recent changes in 1.20 snapshots?

#

I was writing a small library that really made use of the enum. I have no idea how I could prepare from it.

shy finch
#

What does 1.20 change that would require the enum to change?

quaint mantle
#
Mojang yeeted most of their material stuff this snapshot```
#
There are plans underway to change the way many enums in the API are handled so that custom content can be better supported. These changes are not expected to break most plugin jars (backwards compatibility will be provided), however they may unavoidably break plugin source code (though the Maven version will be bumped if this occurs). To reduce the risk of breakage, please consider avoiding the use of switch statements and EnumSet over enums which implement 'Keyed'.```
#

I make use of Material.valueOf throughout all my plugins

#

Guess I will have to refractor to Material#getMaterial

shy finch
#

Oh that was announced I believe in the 1.18 spigot update? To watch out for enums.

#

valueOf should still work since they will implement the valueOf function (to try to keep backwards support)

quaint mantle
#

Perfect

#

Awesome work with WM by the way ๐Ÿ˜„

shy finch
slim wigeon
#

Randomly crashed client[23:34:00] [Server thread/INFO]: CommandBlock at 211,64,-140 issued server command: /killall monsters world [23:34:00] [Server thread/INFO]: MrnateGeek lost connection: Disconnected [23:34:00] [Server thread/INFO]: MrnateGeek left the gameReason: Update video drivers

#

You had that issue before where MineCraft just crashes for no reason as shown above?

orchid gazelle
tardy delta
terse ore
vast ledge
eternal oxide
#

Seriously weak AI if thats all it can remember before going off the rails.

tardy delta
#

๐Ÿ™

#

sometimes it randomly stops outputting

eternal oxide
#

does it do the same if you ask it to recite the digits of pi separated by spaces?

hybrid spoke
tardy delta
#

lol

remote swallow
#

its just stopped lmfao

#

oh its going now

tardy delta
hybrid spoke
remote swallow
#

good

fringe yew
#

I am attempting to make a command for my spigot plugin (I am also using the wiki for help) and I am wondering how to add sub commands (i.e. "/example a" "/example b" and so on)

#

do I just wrap a command in a command inside plugin.yml?

remote swallow
#

check arg length and switch args[num]

fringe yew
#

huh

#

i'm a beginner btw

ivory sleet
hybrid spoke
fringe yew
remote swallow
#

you should also check the length so you dont get errors

fringe yew
#

with a, b and c all being different arguments

#

like player, position et cetera

remote swallow
#

you would probably want to if (args.length < 3) return false so that would work with out the rest, but if it needs them use ==

fringe yew
#

how would I make one command require two arguments and one require like 5 arguments for example?

remote swallow
#

if (args.legnth != 2) return false

#

if it relies on sub commands check if it has atleast one arg, then check for more

fringe yew
#

couldn't i just wrap the if statement into each case and tweak it to how many arguments must be provided?

remote swallow
#

you can handle it in ifs, but early returns are better in this case

fringe yew
#

for now i'll just wrap the if in every single case as i believe that's easier, but of course, i can tweak that in the future.

#

also, what is args[]? I'm assuming it's a list, right?

hybrid spoke
#

?learnjava

undone axleBOT
hybrid spoke
#

it's an array of strings

fringe yew
#

thanks

#

also, does args.length include the subcommand itself (i.e. does /example a have 1 argument)

hazy parrot
#

Yes

#

It's not including base command

fringe yew
#

thank you

#

also, how do i send a message to a player locally (i.e. to send an error message in chat). do I need to use tellraw?

young knoll
#

Player#sendMessage

fringe yew
#

thanks

#

how do i include two .yml files in the plugin folder? just by making a new file/folder in resources?

young knoll
#

Yes

#

And use plugin.saveResource

eternal oxide
#

no need, he's talkign about a plugin.yml and a bungee.yml

fringe yew
#

i'm talking about language files

eternal oxide
#

ah, not same as yesterday then

fringe yew
#

nope

hybrid spoke
fringe yew
hybrid spoke
#

so en-us.properties

fringe yew
#

you would make a .properties file for that?

hybrid spoke
#

i was just creating confusion

#

but yes, its common practice

fringe yew
#

would it matter if i made it a yml file?

young knoll
#

No

fringe yew
#

i'll just stick to yml then considering i've never used properties files before

orchid gazelle
hybrid spoke
orchid gazelle
#

.properties is ugly lol

#

Its so unsatisfying to see that file extension

fringe yew
#

the file type itself is ugly ngl

#

and yeah the file extension is ugly too.

orchid gazelle
#

I'd personally really use .lang, although I never bother with translations anyways

floral drum
#

en_US.toml

fringe yew
#

:o

orchid gazelle
#

Naaah no toml

#

en_US.lang

hybrid spoke
#

its the main way in java

floral drum
#

nerd

hybrid spoke
#

which you really want to use

orchid gazelle
#

Bro look at the name

#

Its ugly asf

hybrid spoke
#

since its integrated

hybrid spoke
orchid gazelle
#

en_US.lang looks 10x more clean

floral drum
#

.toml is amazing!

fringe yew
#

how about we just use json :)

floral drum
#

๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€๐Ÿ’€

fringe yew
#

lmao

hybrid spoke
fringe yew
#

yea

floral drum
#

lets use hex

orchid gazelle
#

Lets use NO file extension at all

hybrid spoke
#

for each text a new file

floral drum
#

lets use binary (.bin)

hybrid spoke
#

just dont use any text

fringe yew
#

lets use tyd

hybrid spoke
#

problem solved

orchid gazelle
#

Or use en_US.US

hybrid spoke
#

symbols are universal

floral drum
#

oh so real godcipher

orchid gazelle
#

Then you can read SUS

#

Or just do en_US.sus

fringe yew
#

i'm intentionally calling my en-us language file en-uk to annoy the hell out of people

floral drum
#

death

orchid gazelle
#

Omg if imma make a new file ext the next time imma make .sus

floral drum
#

do an underscore and capitalize the UK then

#

nerd

#

en_UK

#

beautiful

fringe yew
#

it's already working

orchid gazelle
#

en_UK.lang

#

Beautiful

fringe yew
#

en_UK.amogus

floral drum
#

en_UK.toml

orchid gazelle
#

Or en_UK.sus

floral drum
#

beautiful

orchid gazelle
#

Lmao

hybrid spoke
#

en_UK.languagefile

floral drum
#

die

#

ingame

hybrid spoke
#

nah id rather in real life

floral drum
#

oh fairs

orchid gazelle
floral drum
#

wanna do it together?

hybrid spoke
#

sure

#

where do we jump from

floral drum
#

bet

fringe yew
#

i'm going to intentionally make a custom parse file for parsing a .amogus file and i'm going to add a amogus_IMPOSTER language file

floral drum
#

im not gonna say any more before I get in trouble ๐Ÿ’€

orchid gazelle
#

en_US.wnry

#

wannacry encrypted file :(

dense falcon
#

There is an event when a player place a block?

karmic salmon
#

Any one Have Any idea why this not working java if (chest.getPersistentDataContainer().has(new NamespacedKey(plugin, filenamelol + "-Chesttrue"), PersistentDataType.STRING)) { System.out.println("2"); player.sendMessage(TreasureHunt.Prefix + ChatColor.RED + "Sorry But This Chest Is Aready In Chest List, Try Again!"); player.playSound(player.getLocation(), Sound.ENTITY_VILLAGER_NO, 10, 29); return; } it should check if this chest have NamespacedKey that called filenamelol + "-Chesttrue" but when i run it, it not working there are no errors or soemthing like that and How to Then All NameSpacedkeys of the chest to check it really set to the chest or not

sly venture
young knoll
#

Chests can

#

Since they are block entities

hybrid spoke
tender shard
#

Maybe it was a bug, or maybe its normal, idk

#

I can only always tell people to use CBD for blocks

#

That works reliantly at least

karmic salmon
young knoll
#

It should work just fine with the state being updated

#

And unlike your block data you donโ€™t have to worry about removing it manually

tender shard
karmic salmon
#

huh

young knoll
#

Does it handle every way the block could be destroyed

tender shard
karmic salmon
#

huh

#

so the block don't keep the data that i put in, in reload or close server????

orchid gazelle
#

Spigot? Github?

tender shard
young knoll
#

All fun and games until someone worldedits the block away

tender shard
sly venture
# hybrid spoke second, since you are not supposed to throw NPEs yourself

Thank you for your answer. I have modified the code as you suggested. How does it look?

import java.util.Objects;

public class PreCondition {

    private PreCondition() {
        throw new IllegalStateException("Utility class");
    }

    public static void nonNull(Object object, String message) {
        if (Objects.isNull(object)) {
            throw new IllegalArgumentException(message);
        }
    }

    public static void nonNullOrEmpty(String str, String message) {
        if (str == null || str.isEmpty()) {
            throw new IllegalArgumentException(message);
        }
    }
}

tender shard
#

But at least it works, people constantly have issues with PDC on tile entities

karmic salmon
#

PersistentDataContainer customBlockData = new CustomBlockData(block, plugin);??

karmic salmon
#

Customblockdata

young knoll
#

Gotta get that BlockBecomeAirEventโ„ข๏ธ

karmic salmon
tender shard
young knoll
#

But then you also need the reverse

#

AirBecomeBlockEvent

hybrid spoke
#

BlockTypeChangeEvent

young knoll
#

Big brain

orchid gazelle
tender shard
#

same as every other persistent data container

orchid gazelle
#

Like do I have to worry if I read a stupid amount of them in a second

tender shard
#

no but if you really store a huge amount, it slows down chunk loading

#

it's NOT meant for huge amounts of data, same like every other PDC

#

in the end, it's just regular NBT data

hybrid spoke
#

wasnt also there an exploit where you could overload chunks with nbt data

young knoll
#

You still can

orchid gazelle
#

So its no issue if I read like 200 blocks/tick?

tender shard
orchid gazelle
#

Ok

tender shard
#

never got any reports about it being bad in performance

#

oraxen uses it too

orchid gazelle
#

I mean im kind of interested in coding a house system in the future, thats why I just wondered what I could use

#

The thing is that this obviously needs precise regions

#

That can be checked very quickly

young knoll
#

I think the main issue with an event that catches any block change is that it might be really heavy

#

Granted probably still not as heavy as the physics event

hybrid spoke
#

if you change 2k blocks it probably will lag

young knoll
#

Itโ€™s a shame because it would also be very convenient to know when a block changes to air for any reason

orchid gazelle
#

Can pdc be read async?

hybrid spoke
#

could call it async

#

or dump it together, which would be harder to make and understand and use

fringe yew
young knoll
orchid gazelle
hybrid spoke
#

possible, but it would be very confusing on multiple changes

young knoll
#

It would also lead to people making big loops

#

Which isnโ€™t ideal for performance either

hybrid spoke
#

thats their problem

orchid gazelle
#

User error

young knoll
#

Hmm

hybrid spoke
#

i mean you could test it and benchmark it

quaint mantle
#

i got nullpointerexpection for tostring why ?

#

can i ignore this ?

orchid gazelle
#

If md does not accept the PR then, imma write a mixin-injector and make it myself ;)

hybrid spoke
hybrid spoke
dense falcon
#

To avoid repetition I created a command /cc cps [player name -> target] and I don't know how to call this cmd from a player?

remote swallow
#

paper moment

quaint mantle
#

actually i wonder what u prefer ?

#

if u can dm me

quaint mantle
#

ะšั‚ะพ ะฝะฐ ะ ัƒััะบะพะผ ั€ะฐะทะณะพะฒะฐั€ะธะฒะฐะตั‚

remote swallow
orchid gazelle
#

I prefer monke

dense falcon
orchid gazelle
#

Omg I gotta call my next API "monke"

quaint mantle
#

Who speak Russia

remote swallow
#

spigot api is better, if you use paper api cant publish on spigot and you loose support here

hybrid spoke
#

nobody, speak english

quaint mantle
#

And who know write mods?

orchid gazelle
hybrid spoke
#

?whereami

remote swallow
#

wrong place to write mods

fringe yew
#

i use... purpur

remote swallow
#

purpur api?

fringe yew
#

nah

orchid gazelle
#

rrrrrreeee

fringe yew
#

just for my server

hybrid spoke
#

i use nms

orchid gazelle
#

I use pure asm to write plugins

remote swallow
#

inject into server

fringe yew
#

tbh i find spigot quite slow when used on servers

hybrid spoke
#

buy a better server then

fringe yew
#

no

#

ยฃ20 p/month is already too much

orchid gazelle
#

the thing is

#

there is a point where a better server won't make your performance better

fringe yew
#

what i mean by "quite slow" is it uses like 15% more cpu utilisation

orchid gazelle
#

what you want is the most insane singlecore speed you can get

hybrid spoke
fringe yew
orchid gazelle
fringe yew
#

the server i got rn has a 5950x so

orchid gazelle
#

lol

#

thats huge

fringe yew
#

mhm

orchid gazelle
#

but not the best

fringe yew
#

oh no it's a 5800x actually

hybrid spoke
#

VPS?

fringe yew
#

no

#

it's a stupid pebblehost server

orchid gazelle
#

there is no ryzen 9 5800x

#

you mean r7?

fringe yew
#

yes

orchid gazelle
#

yeah you can get about 45% more raw singlecore performance

#

then overclock it to hell

#

but then, you reached the limit

fringe yew
#

i've been forced to pay for a stupid premium plan because the lower tier literally gives you a XEON E5-1630v3!?

orchid gazelle
#

lmao

dense falcon
fringe yew
#

it literally loaded 5 chunks a second

#

with one player

orchid gazelle
#

yeah thats a stupid cpu for minecraft

#

you don't want server cpus for minecraft servers

#

you want the maxed out high-end consumer cpu

#

(i9-13900KS is the best you can get rn)

fringe yew
#

my pc has a 3600x and 64gb of ram (i use adobe software, that's why) so i'd be better off self-hosting

hybrid spoke
#

host-unlimited has good servers

fringe yew
#

they brag about it

hybrid spoke
#

otherwise get a hetzner server

#

or better ovh

orchid gazelle
fringe yew
#

mhm

#

to be fair i believe that amd is slightly better than intel anyways

#

idk why

orchid gazelle
#

if you don't care about money, no

remote swallow
orchid gazelle
#

from pure performance, intel outperforms amd

fringe yew
#

i mean i've switch hosting provider so many times

orchid gazelle
#

same

remote swallow
#

bloom is the current best

dense falcon
orchid gazelle
#

for now, some friendly guy just gave me a free server on his homeserver on an i9-9800K

#

the issue with it tho is that I kinda need other server applications, not only mc

fringe yew
#

from shockbyte (ew) to apex to enderchest to cooekie to now pebblehost

remote swallow
#

fuck shockbyte

fringe yew
#

ikr

#

shockbyte was too good to be true (terrible performance), apex too expensive, enderchest closed down (it's back now), cooekie literally gave no documentation for anything and pebblehost is still expensive but also really good in terms of performance

remote swallow
#

bloom has decent plans and a good price

quaint mantle
#

!dmca

remote swallow
#

?dmca

undone axleBOT
fringe yew
remote swallow
#

why not

fringe yew
#

3900x and 8gb for the same price as my hosting (which gives the 5800x instead)

#

for cheaper

quaint mantle
#

oh

#

nvm

remote swallow
#

someone who did a lot of work on cb

fringe yew
#

what does it mean "create multiple servers"

remote swallow
#

you can buy 1 plan, and run bungee off it

#

or multiple severs

#

you get to split it

fringe yew
#

misleading

#

pebblehost can too

remote swallow
quaint mantle
#

whixch versions got removed

remote swallow
#

pre 1.8.8

fringe yew
#

pebblehost provides both a ded. ip and multiple servers

remote swallow
quaint mantle
#

the other versions

remote swallow
#

spigot relies on craftbukkit

quaint mantle
#

ok

remote swallow
#

the only reason spigot exists is because of buildtools

quaint mantle
#

ok

dense falcon
fringe yew
#

we love forking a fork of a fork of the fork

fringe yew
remote swallow
#

the spigot versions before that still exists just not through bt

fringe yew
#

or we'll just ignore you

remote swallow
dense falcon
fringe yew
#

?

#

a few of my questions were not answered but I didn't spam people begging for them to answer, did I?

eternal oxide
dense falcon
fringe yew
#

that's going to make your server 5tps mate

#

or anyone elses'

eternal oxide
#

you are saving the config on every damage/click

dense falcon
#

Yeah and because it's a test?

eternal oxide
#

massive lag spikes

dense falcon
#

It's not for a "server".

#

Just tests.

#

Idc if it's lag, I am alone.

#

I have no lags with my alt as well.

fringe yew
#

server lag

eternal oxide
#

We are stating facts, not arguing

dense falcon
#

I will use a database or json/yaml file for example if it was a real thing for a server.

fringe yew
#

not client lag

eternal oxide
#

even a database is going to lag unless you do it all async

dense falcon
#

๐Ÿคทโ€โ™‚๏ธ nvm.

fringe yew
#

btw how do I load a yml file from {pluginfolder}/lang/

eternal oxide
#
File file = new File(new File(plugin.getDataFolder(), "lang"), "lang.yml");```
fringe yew
#

tysm

eternal oxide
#

ah you do

dense falcon
eternal oxide
#

no you don;t

#

ignore me

dense falcon
#
        config.set("cps." + target.getUniqueId() + ".enabled", true);
        config.set("cps." + target.getUniqueId() + ".counter", 0);
        plugin.saveConfig();
#
if (config.getBoolean("cps." + player.getUniqueId() + ".enabled")) {
  ....
}
eternal oxide
#

So what was your actual issue again?

dense falcon
#

When I get the final result in 10s, -> CPS/10.

But when I see the result, it's strange, for example with my mouse + a macro I do in normal cases 16 CPS and no "8-7" like it shows in game.

eternal oxide
#

I very much doubt every click will be sent from teh client

worldly ingot
#

I also doubt it. Otherwise it'd be a great way to DDoS a server just with an auto clicker ;p

loud herald
#

How can i send a PluginMessage from the Bungee to a Server like Spigot? I searched through the forum on SpigotMC but i just found the same question but no answers. I want to send data to the spigot server without the player receiving that data.

dense falcon
loud herald
dense falcon
#

...

loud herald
#

:D

fringe yew
loud herald
#

you have to use yaml config provider i think

eternal oxide
eternal oxide
fringe yew
loud herald
#

atleast in bungee and spigot has built in but its for config.yml. you could search up for an "config api / lib" and then permantently borrow their code

dense falcon
#

And how a modo check CPS then :>?

eternal oxide
#

Not unless the client actually track it and sends to the server

loud herald
eternal oxide
#

modo?

dense falcon
#

Moderator.

loud herald
#

make a command?

eternal oxide
#

a Moderator?

loud herald
#

/getcps <player>

#

idk

loud herald
fringe yew
#

github is your best friend

worldly ingot
#

The solution is often to use an in-memory database like Redis which has a pub/sub feature

dense falcon
worldly ingot
#

If you're heard of RedisBungee, the entire premise of that plugin is exactly that

eternal oxide
#

I'd guess a Mod not a plugin

fringe yew
dense falcon
loud herald
eternal oxide
#

called what?

dense falcon
#

It's getting CPS of the player.

fringe yew
worldly ingot
#

If anyone intends on making a large proxied network, they should have a Redis instance

#

Great for synchronizing data

fringe yew
fringe yew
worldly ingot
#

YamlConfiguration#load() does

#

May have been what he meant

young knoll
#

YamlConfiguration.loadConfiguration

worldly ingot
#

ye that one

fringe yew
#

thanks

worldly ingot
#

You can set it to null

dense falcon
young knoll
worldly ingot
#

Yeah, so you can set it to null

#

config.set("key", null);

#

Yes

#

Just be sure to save the file as well in order for the changes to be written to disk

young knoll
#

config.set(โ€œChocoโ€, null)

eternal oxide
# dense falcon ?

I just looked at the CheckCheat plugin source. It's as badly written as yours ๐Ÿ™‚

fringe yew
#

yuea

eternal oxide
#

It does nothing special

fringe yew
fringe yew
eternal oxide
#

It also loads a config during the PlayerInteractEvent

fringe yew
#

which will conveniently lag the server to hell

eternal oxide
#

final YamlConfiguration config = YamlConfiguration.loadConfiguration(file);

dense falcon
#

And what do you purpose to save a data ?

fringe yew
#

this is your code btw

eternal oxide
#

Config is file which is VERY slow. You do not save/load in an event

dense falcon
#

json?

worldly ingot
#

JSON would also be a file

fringe yew
#

database

worldly ingot
#

Keep things in memory until you need to save them persistently. You can do it periodically asynchronously

eternal oxide
#

as you are not retaining the data, you reset to zero after 10 seconds you have no need at all to save it

dense falcon
worldly ingot
#

That's a message link

fringe yew
#

discord really made it more difficult to tell

#

regardless

dense falcon
#

I know it's uselesss to save it.

eternal oxide
#

in CheckCheat he at least does not save the data, he stores in a map

dense falcon
#

And how they got a map from another class which is inaccessible?

eternal oxide
#

all he is using teh config for is to see if teh user is verified

dense falcon
#

Imagine a command + events.

eternal oxide
#

?di

undone axleBOT
eternal oxide
#

The alex link will likely be simpler to read

dense falcon
#

Well alr.

#

It's not about CPS but velocity, I used my hand + sticks and do you think these values "are good" ?

        // Not moving :          0.0, 0.0, 0.0
        // Running :    0.02, -0.2, -0.2
        // KB 1 (do not move) :    0.0, 0.1, 0.0
        // KB 2 (do not move) :    0.0, 0.3, 0.0
eternal oxide
#

Yes they look like vectors

#

do they mean something?

dense falcon
#

?

eternal oxide
#

You are going to have to use more words

dense falcon
#

?

upper vale
dense falcon
#

...

#

No.

upper vale
#

then wtf is that for

#

would be helpful if you like

dense falcon
#

Tests.

upper vale
#

used more than punctuations

dense falcon
#

I am trying to check if someone has an anti kb with a cmd.

eternal oxide
#

You are not even telling us what you are testing

upper vale
fringe yew
upper vale
#

Jesus Christ

dense falcon
#

It's not for an anticheat ๐Ÿคทโ€โ™‚๏ธ.

fringe yew
#

but you're trying to detect cheats

#

so

#

it is

dense falcon
#

Anti cheat should ban instantly.

fringe yew
#

no?

dense falcon
#

It's not that.

upper vale
#

๐Ÿ’€

dense falcon
fringe yew
#

no?

eternal oxide
#

ok, I'm sorry I'm not here to help you test random things. If you actually need help with something ask a cogent question with a goal.

fringe yew
#

anticheats detect cheats

#

that's it

dense falcon
#

Moderator commands are like this, an anti cheats detect cheats auto and ban instantly if they are good.

fringe yew
#

no they dont

#

anticheats detect cheats

dense falcon
#

They do :>.

fringe yew
#

and the owner of the server will decide what to do

dense falcon
#

Nope lol.

fringe yew
#

...

#

i am done

#

sorry

dense falcon
#

Anticheat do not just detects cheats lol.

upper vale
#

Weโ€™re trying to help you not argue abt the terminology weโ€™re using

#

holy

fringe yew
#

hmmm. i wonder where the name "ANTI CHEAT" comes from

dense falcon
fringe yew
#

we don't speak spanish

dense falcon
#

It's FRENCH OMG.

wise mesa
fringe yew
fringe yew
dense falcon
#

Well I can not change you, I did not know you can not understand what means "auto ban".

fringe yew
#

autoban isn't an anticheat at all

fringe yew
#

autoban isn't a thing

#

if it was, you would have 0 players

#

... because it would ban everyone

dense falcon
#

I have never heard so much boulshit. "If there is auto ban you would have 0 players", bro use your brain?

fringe yew
#

bro really tried to cuss and completely messed it up ๐Ÿ˜ญ

dense falcon
#

I didn't know that an anti cheat with "auto ban" bans everyone :>.

fringe yew
#

Definition from the Urban Dictionary for 'Anti Cheat': "A program made to detect cheaters and people using unfair advantages in video-games."

#

no mention of banning there?

wise mesa
#

So most servers donโ€™t just ban everyone they detect

fringe yew
#

they flag them in chat

wise mesa
#

They manually review warnings that the anti cheat gives them

#

In chat

fringe yew
#

which then lets admins review

#

yeah

#

smaller servers would typically make it automatic due to the lack of staffing

wise mesa
#

And if youโ€™ve got a real complex system you can have something like hypixel where admins can replay the instance after the fact

#

And then you could avoid having to have staff 24/7

fringe yew
#

yeah.

wise mesa
#

This wouldnโ€™t even be that difficult hooking up an anticheat to that one plug-in thatโ€™s like replaymod

#

I have a plug-in idea

fringe yew
#

is it an anticheat like hypixel's?

wise mesa
#

โ€ฆ

#

Yes

fringe yew
#

don't make it paid if you actually make it

wise mesa
#

But not even

fringe yew
#

for the love of god

wise mesa
#

Because Iโ€™m not smart

#

And I canโ€™t make an anticheat

#

Of course not

fringe yew
#

i mean

#

you have this channel

wise mesa
#

Iโ€™m just going to hook into an existing anticheat

fringe yew
#

spigot forums

wise mesa
#

Much easier solution

fringe yew
#

github (best)

wise mesa
#

Just hook into one that already exists

fringe yew
#

fair

wise mesa
#

And hook into that replay plugin

#

And it would always be recording and save the previous 30 seconds after a detection

fringe yew
#

hook it into nocheat+

wise mesa
#

Yea thatโ€™s probably what Iโ€™d do

fringe yew
#

it's openly sourced under gpl-3.0

hollow grotto
#

How can I customize the name tag of each players? instead of a plain name

fringe yew
fringe yew
#

like are you asking in terms of programming or plugin management

hollow grotto
fringe yew
#

ah ok

wise mesa
#

Oh but Iโ€™m going to make it 1.19 because fuck 1.8

#

Even though thatโ€™s most of the potential users

#

My@idea is falling apart

#

Oh well

dense falcon
#

How can I spawn heads with a custom id/tag or something else ?

fringe yew
eternal oxide
#

?jd-bc

fringe yew
#

when i try run my command, it ALWAYS prints out the command name to minecraft chat

#

doesn't run anything it's supposed to

#

code

eternal oxide
#

add debugs

#

also, do you have a lang folder in yoru plugin folder?

fringe yew
eternal oxide
#

not resources, plugin folder

#

on the server

fringe yew
#

no it hasn't appeared

eternal oxide
#

then you didn;t create it nor save any language files

fringe yew
#

then how am I meant to do that?

eternal oxide
#

saveresource

fringe yew
#

in app.java?

eternal oxide
#

uh?

fringe yew
#

anywhere then

#

ok

#

do i save the folder or just the files

eternal oxide
#

files

fringe yew
#

will the folder also sync over

eternal oxide
#

unless you want to leave them in the jar

#

if you leave them in the jar you can read them from there

#

easier to update too

fringe yew
#

then how would i do that

eternal oxide
#

teh loadConfiguration can accept a stream

#

a reader

fringe yew
#

what is that supposed to mean!?!?!!?!?!

#

ahhh

eternal oxide
#

plugin.getResource("lang/en_UK.yml")

#

instead of using File

#

loadConfiguration(new InputStreamRerader(plugin.getResource("lang/en_UK.yml")))

eternal oxide
#

it will need a try/catch probably

#

better to do it in a try with resources

fringe yew
#

i'm getting really confused now

eternal oxide
#

๐Ÿ™‚

fringe yew
#

also

#

on the spigotmc wiki

#

it says i need to register the command

#

... but where do I register it

eternal oxide
#

in your plugin

fringe yew
#

no like

eternal oxide
#

usually in onEnable

fringe yew
#

can you have more than one onEnable

eternal oxide
#

no

arctic shuttle
#

hi

fringe yew
#

then how do i put it in app.java!?

eternal oxide
#

You need to follow a tutorial if this is your first time making a plugin

fringe yew
#

i'm following the wiki

#

which is a tutorial

eternal oxide
#

getCommand("yourCommandNameAsYouWroteInThePluginyml").setExecutor(new Commands());

fringe yew
#

oh

#

in the wiki it's new CommandKit not new Commands

#

and new Commands doesn't error

#

so

#

uhhh

#

misleading wiki!!!

#

anyways

#

back to the language file stuff

fringe yew
eternal oxide
#

second one, plugin being yoru plugin instance

fringe yew
#

where do I put it? app.java I'm assuming right?

eternal oxide
#

depends

#

if you set it when you start the plguin yes

#

FileConfiguration languageConfig = YamlConfiguration.loadConfiguration(new InputStreamReader(this.getResource("lang/en_UK.yml")));

quaint mantle
#

can i give this animation to item oninteract
or this client side ?
for example here will be paper

eternal oxide
#

what animation?

#

you mean swing arm?

quaint mantle
#

hit animation

#

yes

quaint mantle
#

to wan't to seed from paper

#

so arm will swing when player right click to farmland

eternal oxide
#

if you tell it to

#

in the interact event

quaint mantle
#

im trying swingmainhand

fringe yew
#
FileConfiguration languageConfig = YamlConfiguration.loadConfiguration(new InputStreamReader(getPlugin().getResource("lang/en_UK.yml")));
eternal oxide
#

getPlugin() is your own invention. it doesn't exist

fringe yew
#

how do i get the plugin then lol

eternal oxide
#

at least its null

#

?di

undone axleBOT
eternal oxide
#

or you use yoru static instance

fringe yew
#

but

#

how

eternal oxide
#

App.getInstance()

fringe yew
#

thanks

#

i've already done all that static instance stuff

#
    private static App instance; {
        instance = this;
    }

    public static App getInstance() {
        return instance;
    }
#

The method getPlugin(Class<T>) in the type JavaPlugin is not applicable for the arguments ()Java(67108979)

#

oh yeah

eternal oxide
#

delete getPlugin()

fringe yew
#

yeah i did

#

forgot getinstance

fringe yew
#

how do I add to this list in my config file in my java code?

players:
- "example"
eternal oxide
#
List<String> players = config.getStringList("players");
players.add("newPlayer");
config.set("players", players);
config.save()```
fringe yew
#

The method save(File) in the type FileConfiguration is not applicable for the arguments ()Java(67108979)

#

and

#

do i need to reload the config after?

royal hawk
#

Hello who encountered with problem with colors in console? In console see this message:

[21:12:15 INFO]: ยง6-> ยงfGreenLibrary ยง6(Version - 1.0.0.b50) <- ยงfSuccessfuly load file ยงbDatabaseSettings.json

this code

Bukkit.getLogger().log(Level.INFO, ChatColor.translateAlternateColorCodes('&', "&6-> &f" + info.getName() + " &6(Version - " + info.getVersion() + ") <- " + msg));
hazy parrot
#

You can't send colored logs

#

Aside from different colors for error and warning

royal hawk
tawdry echo
#

Remove colors?

hazy parrot
#

Simple solution ^

royal hawk
#

no colors doesn't work

hazy parrot
#

remove colors

#

You don't need colors in logs

river oracle
hazy parrot
#

yeah i was lying, you have to love looking at rainbow while actually looking at logs

echo basalt
#

subway surfers gameplay

river oracle
#

Personally my panel supports Colo codes stay mad

young knoll
#

Colors make the serotonin go brrrrrr

royal hawk
#

I'm ask how this fix..

eternal oxide
#

if it's your plugins config

fringe yew
#

ty

quaint mantle
#

someone give me idea for setblock to location with state

#

set block after setblock data with scheduler is good idea ?

young knoll
#

Set the block data

#

And then get and update the state

quaint mantle
#

is there a better way?

young knoll
#

Shouldn't need a delay

#

Sadly not yet, we don't have a Block#setState

quaint mantle
#

wanna see my code ?

#

bcs i need get block up

#
public class Crops implements Listener {
    @EventHandler
    public void onPlaceSeed(PlayerInteractEvent e) {
        Player player = e.getPlayer();
        Block block = e.getClickedBlock();
        ItemStack item = player.getInventory().getItemInMainHand();
        ItemMeta meta = item.getItemMeta();
        if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
            if (item.getType() == Material.PAPER && meta != null && meta.getDisplayName().contains("test") && block !=null && block.getType() == Material.FARMLAND) {
                player.swingMainHand();
                World world = block.getWorld();
                world.playSound(player.getLocation(), Sound.ITEM_CROP_PLANT, 1,1);


                Block up = block.getRelative(BlockFace.UP, 1);

            }
        }
    }```
young knoll
#

Crops don't have a state

#

Just data

quaint mantle
#

alright

young knoll
#

So you can just do up.setBlockData

tardy delta
#

id love block?.getType() in java

young knoll
#

Kotlin moment

echo basalt
#

c# moment

young knoll
#

That too

#

That just returns null if block is null, right?

tardy delta
#

disapointed that c++ doesnt have that

#

js does

dense falcon
#

How can I spawn heads with a custom id/tag or something else ?

tardy delta
worldly ingot
#

C++: Get fucked

young knoll
#

Python?

quaint mantle
#

i try works and no errors

#

but my syntax is true ?

young knoll
#

That will work but you can simplify it

eternal oxide
#

this will not work

quaint mantle
quaint mantle
eternal oxide
#

you are getting the state at the end and then applying it

#

wiping any changes

young knoll
#
Block wheat = block.getRelative(BlockFace.UP, 1);
Ageable age = (Ageable) Material.WHEAT.createBlockData();
age.setAge(1);
wheat.setBlockData(age);
quaint mantle
#

๐Ÿ˜„

worldly ingot
#

Javadocs mostly

#

Exploring your IDE's suggestions to figure out what methods exist

young knoll
#

Stealing other peoples code

#

I mean what

worldly ingot
#

Or that

#

If you're feeling sneaky

#

I am genuinely looking forward to being able to create generic BlockData though

#

Ageable ageable = BlockType.WHEAT.createBlockData(); PES3_Wow

remote swallow
#

no

#

you can look forward to that after the material enum leaving

young knoll
#

Yes

worldly ingot
young knoll
#

Tf do you think BlockType is from

#

Epic you spoon

worldly ingot
#

freakin' dumdum head

remote swallow
#

you think i would even remember that?

fringe yew
#

in a command, is args[1] the subcommand itself or the first argument?

young knoll
#

2nd arg

worldly ingot
#

Second argument

#

COLL YOU WANNA TYPE SLOWER OR SOMETHING?

young knoll
#

no

worldly ingot
#

tnx

fringe yew
#

so args[0] is the first argument?

young knoll
#

Yep

quaint mantle
#

can i ignore nullpointerexception at this code ? ?

    public void onPlayerInteract(PlayerInteractEvent e) {
        Block block = e.getClickedBlock();
        if (e.getAction().equals(Action.PHYSICAL)){
            if (block.getType().equals(Material.FARMLAND)) {
                e.setCancelled(true);
            }
        }
    }```
tardy delta
#

no

worldly ingot
#

I mean you can if you want lol

remote swallow
#

dont you dare use #equals for that

young knoll
#

Or you could just do a null check

remote swallow
#

if you do that im taking chocos dogs

worldly ingot
#

Theoretically, yes, you could ignore it. There are no instances of physical interactions that don't have a block. Though that's not to say there won't be one later down the line. You're always best to do a null check just to be certain

quaint mantle
remote swallow
#

if (block == null) return;`

#

boom