#help-development

1 messages ยท Page 378 of 1

rapid topaz
#

yeah

#

but i dont uinderstand the line under it

tender shard
#

that's because there you think that magically the value returned by getItemInMainHand() got saved into a variable called "ItemInMainHand"

#

there is no variable called "ItemInMainHand" so it fails to compile. why don't you replace that non-existing variable with the actual method call?

rapid topaz
#

so i have to do something like. ItemInMainHand = player.getINventory().getItemInMainHand()

tender shard
#

if you need it more than once, yes

#

if you only need it once, just use the method directlry

#

and your variable names should have lowerCamelCase, so it should be "itemInMainHand" instead of "ItemInMainHand"

rapid topaz
#

this?

tender shard
#

@remote swallow have you ever seen this before?

#

this is my first time writing tests in gradle

tender shard
# rapid topaz ?

yeah but you have another huge mistake in your code, you compare strings using ==

#

do never do that

rapid topaz
#

why not

#

how should i compare then

tender shard
tender shard
rapid topaz
#

uuid.equals("The uuid here")

tender shard
#
String firstString = "a";
String secondString = "a";
firstString.equals(secondString)); // will always be true
// but
firstString == secondString; // This will only sometimes be true, expect to get some random behaviour, NEVER do this unless you know exactly what you're doing
#

although both strings are "a", they are usually NOT ==

#

they are two different strings that just happen to randomly have the same "contents"

rapid topaz
#

ohh

#

makes sense

#

thank you

tender shard
#

np

#

(it would probably work for the first 1000 comparisons or so, because the JVM caches strings, but after that you'll just get weird results)

rapid topaz
#

well i think i fixed it

tender shard
#

nice

#

"uuid" is a string though, right?

rapid topaz
#

yeah

tender shard
#

or is it actually an UUID?

rapid topaz
#

String uuid =

tender shard
#

ah ok

#

yeah then just do equals()

rapid topaz
#

i need the ;

tender shard
#

ok two more things haha

#

you got a typo in "receive"

rapid topaz
#

well

#

yeah

#

i will fix

tender shard
#

and it's usually not needed to check the "cmd"'s getName(), unless you register the same CommandExecutor for different commands

#

(but it's no problem, just something that'd annoy me)

rapid topaz
#

but it works?

tender shard
#

yeah sure it works, it's just useless

#

it's simply not needed

rapid topaz
#

i only have one command

tender shard
#

then it's double useless

#

no idea why every tutorial suggests to do that

rapid topaz
#

how could i make it "less" useless

tender shard
#

just get rid of the "if(cmd.getName()..." line

#

the name will ALWAYS be equal to "recieve"

#

so no need to check it

rapid topaz
#

oh

eternal night
#

alex what gradle version are you on

#

iirc there was a regression in 7.5

tender shard
#

7.6

eternal night
#

try 8.0

tender shard
#

I can't D:

eternal night
#

why not ?

tender shard
#

because I am doing an IntelliJ plugin, using the IJ builtin "IJ plugin template", and it uses 7.6, and it also says I'm using "deprecated API and my plugin will fail to build in 8.0"

#

well I could try 8.0

#

how would I change the version? I am very new to gradle

rotund ravine
#

Just chance the wrapper i guess.

#

Wrapper config

eternal night
#

./gradlew wrapper --gradle-version 8.0.1

#

run that twice tho iirc

tender shard
#

thanks, will try

#

twice? o0

#

erm ok

#

ah yeah it's downloading

#

let's see :3

#

hm now I get this

#

using 8.0.1

#

running it from CLI shows this

#

it now says my build file is corrupted or sth, however it's the same as what I sent earlier ^

#

(IJ btw doesn't complain about this file)

rotund ravine
#

I never update my wrapper

#

I have no need for it haha

tender shard
#

can I downgrade it again using the same command as earlier?

#

there's probably a reason why IJ defaults to 7.6 instead of 8.0.1

tender shard
#

ugh I also can't downgrade anymore, it keeps showing this msg even when just running ./gradlew wrapper --gradle-version 7.6.0 D:

tender shard
#

why is gradle such a pain

hybrid wadi
#

Hey, I am stuck at a problem. I am creating a chest shop plugin and how do I get the amount in a whole inventory at a certain block type? For example if the amount, you want to sell is 100: How do I remove a stack of the type and then 36 from the other stack?

tender shard
tender shard
hybrid wadi
#

Thanks ๐Ÿ˜„

tender shard
#

just a tiny example

    public static int getAmountOfBlocks(PlayerInventory inventory, Material material) {
        int amount = 0;
        for (int i = 0; i < inventory.getSize(); i++) {
            if (inventory.getItem(i) == null) continue;
            if (inventory.getItem(i).getType() != material) continue;
            amount += inventory.getItem(i).getAmount();
        }
        return amount;
    }
#

yeah that basically does the same

#

morice can you help me with my gradle issue D:

#

np, me too

#

but this time I have to use it

#

wdym with "anvil combine system"?

#

can't you just loop over the enchantments of the left side, enchantments of the right side, then check which enchantments are present in both things, then ++ that level?

#

did you manually extend the bukkit enchantment class? because you are usually not supposed to do that

#

it should but IIRC it doesnt. extending that oneself also is not supported, as explained on the overview page of the javadocs

#

using a custom PDC tag to detect your enchantment

#

e.g. a boolean "hasMyEnchant" or an int "myEnchantmentLevel"

#

the anvil should keep your custom PDC tag intact. to however "stack" the enchantments, you gotta code that yourself

#

np

#

you are always free to submit a pull request lol

#

I agree however that this should be builtin, yes

#

only takes 20 seconds to do it

eternal night
#

Seems like a purpur thing to add

tender shard
#

you could also send me your pull request, then I'll submit it haha

eternal night
#

Doesn't the cla specifically state it has to be your code

tender shard
#

I don't recall it completely

#

but isn't it my source when someone sent it to me and told me I could use for whatever I want?

eternal night
#

No

small hawk
#

I want to make custom items in items.yml

  1. How can i detect how many items to create ? (Loop over every key and create ItemStack?)
  2. How to tell apart which item is which, I mean when it comes to Events, how do I know which custom_item I am holding? (PDS?)
tender shard
#

what is "items.yml"? your own custom yaml file?

small hawk
#

for example

tender shard
#

usually you wanna assign a custom PDC tag to each of your items, e.g. a PDC tag like "my-item-id": "MY_AWESOME_RUBY_SWORD"

#

then you can just use that to detect your custom items

small hawk
#

oh, yeah, that's smart to give PDC a special line in config

tender shard
#

hm I wouldn't make this tag configurable, but you do you

#

maybe you can share how you imagine your items.yml to look like, then people would give you suggestions on how to do it

#

also, can somebody answer my gradle question pls ๐Ÿฅฒ

small hawk
#

ya, sure, one sec pls

eternal oxide
#

gradle traitor

tender shard
#

i HAVE to use gradle for this

#

it's an IntelliJ plugin

#

I would use maven if I could

#

I would also not use kotlin for my build.gradle lol

eternal oxide
#

oh my, can it get any worse

tender shard
#

yeah it's called "gradle 8"

#

that one stops to read my build.gradle completely haha

#

gradle gets worse with every new version they release

eternal night
#

The intellij plugin isn't compatible I presume

earnest oasis
#

how can I enable that i can break Bedrock and dupe Tnt with spigot

small hawk
eternal night
#

What local gradle version do you have installed

tender shard
eternal night
#

Not the wrapper

tender shard
tender shard
small hawk
tender shard
#

yeah, otherwise admins will have to care about it, and trust me, they'll forget it

tender shard
#

sure

eternal night
#

Yea so you can just gradle wrapper

#

That iirc should downgrade

tender shard
#

I already downgraded the wrapper in the repo to 7.6

eternal night
#

Ah kk

tender shard
#

but still got the issue that it complains about NoClassDefFoundError when running tests

eternal night
#

It's a gradle regression in 7.5

#

Idk if .4 is working

#

Could always try that

earnest oasis
#

how can I enable that i can break Bedrock and dupe Tnt with spigot

hazy warren
#

is there a maven shade plugin that works with java 19

rapid topaz
#

what does this error message mean

#

ok

eternal oxide
#

or you just returned false after processing your command

rapid topaz
#

it saysa plugin is disabled

#

it worked like 5 minutes ago

tender shard
#

I mean it can't be possible that gradle 7.5+ doesn't work with junit anymore

hazy warren
#

How do you access 3.4.1? Latest I can seem to find is 3.3.0

tender shard
#

you just set the <version> to 3.4.1 in your pom

rapid topaz
tender shard
hazy warren
#

๐Ÿ™

tender shard
tender shard
hazy warren
#

Yeah thanks

tender shard
tender shard
hazy warren
#

I was under the assumption that intellij was listing all the stuff available haha

tender shard
#

yeah no, you gotta click the "maven reload button" for intellij to recognize the changes you did

#

this one

#

intelliJ is a bit stupid

eternal night
#

It's a regression with the 7.5 and intellij plugin plus junit

tender shard
#

uuugh

eternal night
#

Prior works later works tho I guess intellij plugin isn't 8.0 compatible?

tender shard
#

okay lemme try 7.5

#

or which version should I use?

eternal night
#

Well 7.4 maybe

tender shard
#

ok lemme try, one sec pls

#

or rather, one minute

#

or 5

#

lol

eternal night
#

Idk what 7.x version introduced it ๐Ÿ˜…

#

Lmao

#

I think it was 5

short galleon
#

Hey,
I started using ProtocolLib and tried the given example code on their GitHub Readme (github.com/aadnk/ProtocolLib).

Somehow the example is failing for me. Does someone have experience with Lib and could help me?
This is my error: "Caused by: com.comphenix.protocol.reflect.FieldAccessException: Field index 0 is out of bounds for length 0"

tender shard
#

hm 7.4 is now stuck infinitely at "instantiating tests" D:

#

(I just ran ./gradlew test using the same build.gradle.kts as above, with an empty @Test annotated method

#

hm now it finished after a minute:

Starting Gradle Daemon...
Gradle Daemon started in 1 s 674 ms
Download https://plugins.gradle.org/m2/org/jetbrains/kotlin/kotlin-stdlib/1.5.31/kotlin-stdlib-1.5.31.jar, took 814 ms (1,51 MB)

> Configure project :
[gradle-intellij-plugin :SpigotPluginGeneratorPlugin] Gradle IntelliJ Plugin is outdated: 1.8.0. Update `org.jetbrains.intellij` to: 1.13.0
> Task :setupDependencies
> Task :patchPluginXml UP-TO-DATE
> Task :processResources UP-TO-DATE
> Task :setupInstrumentCode
> Task :generateEffectiveLombokConfig
> Task :compileJava
Note: C:\Users\mfnal\IdeaProjects\SpigotPluginGeneratorPlugin\src\main\java\com\jeff_media\spigotplugingeneratorplugin\dependency\RepositoryList.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :classes
Download https://cache-redirector.jetbrains.com/intellij-dependencies/org/jetbrains/annotations/20.1.0/annotations-20.1.0.pom, took 70 ms (1,35 kB)
Download https://cache-redirector.jetbrains.com/intellij-dependencies/org/jetbrains/intellij/deps/jdom/2.0.6/jdom-2.0.6.jar, took 163 ms (339 kB)
> Task :generateTestEffectiveLombokConfig
> Task :instrumentCode
> Task :postInstrumentCode
> Task :processTestResources NO-SOURCE
> Task :jar
> Task :prepareTestingSandbox
> Task :compileTestJava
> Task :testClasses
> Task :instrumentTestCode
> Task :postInstrumentTestCode
> Task :test
> Task :classpathIndexCleanup SKIPPED
BUILD SUCCESSFUL in 1m 37s
15 actionable tasks: 13 executed, 2 up-to-date

#

no clue whether this is something good or bad

#

seems like it actually ran the tests I guess

#

hm seems like it didnt. I now edited my test to do assertNotNull(null), but gradlew test runs without throwing any errors, UUUUGH D:

tardy delta
#

thats why i dont use gradle

tender shard
#

I have to use gradle for this

tardy delta
#

forked a gradle project and ij needed 10 minutes to download stuff

tender shard
#

it's an IntelliJ plugin

#

that is totally normal

tardy delta
#

thats why

tender shard
#

I'm now at the point where I'd pay someone 20โ‚ฌ to fix this for me

#

or 50

#

whatever

#

I just want it to work

#

TL;DR:
Gradle 7.4: it just skips all my tests
Gradle 7.6: It claims "no class def found" error when running tests
gradle 8.0.1: It complains about my build.gradle being corrupt without explaining what exactly the problem is

quaint mantle
#

is it possible to get a list of another plugins commands

#

making a "build mode" thing rn. i want to block worldedit commands for the player if their build mode is disabled

tardy delta
#

reflections ig

tender shard
tardy delta
#

im generally doing too much reflections and unstafe stuff so no clue if theres an api way

quaint mantle
tender shard
#

hm weird, but okay: Bukkit.getCommandMap() returns the commandmap

quaint mantle
#

which version is that

tender shard
#

it has a method getKnownCommands() that is basically just a HashMap<String,Command>

#

what is your version

quaint mantle
#

16.5

tender shard
#

it existed in 1.16

quaint mantle
#

it says The method getKnownCommands() is undefined for the type Bukkit

tender shard
#

Bukkit.getCommandMap().getKnownCommands()

quaint mantle
#

same thing for commandmap

#

yeah getCommandMap is not exists too

tender shard
#

btw when 1.16.5 came out, I was still straight and not gay lol

tender shard
#

hm I could have sworn that getCommandMap() always existed

#

you can still get it easily:

#
  1. cast Bukkit.getPluginManager() to SimplePluginManager
  2. call getCommandMap on that one
kind hatch
#

Don't you need reflection to access the commandMap?

tender shard
#

not in 1.19.3

#
    /**
     * Gets the CommandMap
     */
    public static CommandMap getCommandMap() {
        CommandMap commandMap = null;

        try {
            if (Bukkit.getPluginManager() instanceof SimplePluginManager) {
                final Field field = SimplePluginManager.class.getDeclaredField("commandMap");
                field.setAccessible(true);

                commandMap = (CommandMap) field.get(Bukkit.getPluginManager());
            }
        } catch (final NoSuchFieldException | IllegalAccessException | IllegalArgumentException | SecurityException e) {
            e.printStackTrace();
        }

        return commandMap;
    }
#

this should do in outdated versions

quaint mantle
quaint mantle
#

ok thanks

tender shard
quaint mantle
#

thanks

buoyant viper
#

?jd-s

undone axleBOT
ancient jackal
#

What data structure could adequately represent TabCompleter?

ivory sleet
#

it is (winnpixie)

#

its sort of a tree

ancient jackal
#

That's what I was thinking

ivory sleet
#

myes

#

thats how its dealt with in nms

#

(brig)

ancient jackal
#

Mmmm alright

#

I'll use a tree then

ivory sleet
#

ik some plugins that just use a List<Function<List<String>,String>>

#

like luckperms iirc

#

well a bit more sophisticated than that nested type

#

but ye

#

why skull?

#

:C

tender shard
ivory sleet
#

its actually a fairly nice way of handling it given bukkits functional interface api for it

tender shard
#

oh wait

#

in this single project, where I tried it, I actually do use paper api

#

my bad

#

fuck paper api

tender shard
#

"lol we added a single method but nobody of us dared to sign the cla to contribute it" like wtf

mortal hare
#

list that holds lambdas?

ivory sleet
#

yes essentially

tender shard
#

why are paper contributors always afraid to sign a contract that simply states "I didnt steal it from somewhere else"

ivory sleet
#

so for first argument, there's a function that takes the entire command line and produces a token of it

mortal hare
#

that they might stole it accidentally

tender shard
#

you cannot steal sth accidentally

eternal night
#

Alex my bre

tender shard
#

you either wrote it or you didnt

eternal night
#

Your test class name is wrong

#

They have to end in Test

tender shard
#

wdym? They have to start or end in Test

mortal hare
#

no you should name it like in baeldung's tutorials

eternal night
#

In Jupiter 5

#

?

tardy delta
#

๐Ÿ’€

tender shard
#

hm lemme try again

#

renamed it to "YamlTest", still nothing

eternal night
#

Omeglul

tender shard
#

bless you lol

#

TODAY'S MY BIRTHDAY AND ALL I GOT WAS A BUNCH OF GRADLE ISSUES haha

eternal night
#

It's a present

tender shard
#

why does this not run

#

and why does gradle never output its version when it gets run

mortal hare
#

is trie worth to implement

#

for command dispatching

tender shard
#

wdym

mortal hare
#

Trie tree

#

aka Prefix tree

tender shard
#

?

ivory sleet
#

u have brig

#

does everything for u in principle

mortal hare
#

this is a trie tree

tender shard
#

here's my cli output of ./gradlew test btw @eternal night. still not running any tests D:

ancient jackal
tardy delta
#

is there a way to use another Component as placeholder for another one?

#

liek Component.text("some text: %s", other)

tender shard
tardy delta
#

translatable supports that syntax but idk if thats how im supposed to use it

mortal hare
tardy delta
#

ya

mortal hare
#

TranslatableComponents are only needed to support locale inside clients

tardy delta
#

looks like im abusing it then

eternal night
#

Ehm

mortal hare
#

they're sent differently

#

from the server

#

internally

eternal night
#

@tender shard are you usipkg the right test annotation

mortal hare
#

you cant just change the component and abuse it

eternal night
mortal hare
#

just use string.replace()

tender shard
#

is this not the correct one?

eternal night
#

Try the linked one

tender shard
#

ok1 sec

tardy delta
#

works but looks awful

#

those goddamn components

chrome beacon
#

MiniMessage

tardy delta
#

no no no that looks even more awful

tender shard
#

> Configure project :
[gradle-intellij-plugin :SpigotPluginGeneratorPlugin] Gradle IntelliJ Plugin is outdated: 1.8.0. Update `org.jetbrains.intellij` to: 1.13.0
> Task :setupDependencies
> Task :patchPluginXml
> Task :processResources
> Task :setupInstrumentCode
> Task :processTestResources NO-SOURCE
> Task :generateEffectiveLombokConfig
> Task :compileJava
Note: C:\Users\mfnal\IdeaProjects\SpigotPluginGeneratorPlugin\src\main\java\com\jeff_media\spigotplugingeneratorplugin\dependency\RepositoryList.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :classes
> Task :instrumentCode
> Task :postInstrumentCode
> Task :jar
> Task :prepareTestingSandbox
> Task :generateTestEffectiveLombokConfig
> Task :compileTestJava
> Task :testClasses
> Task :instrumentTestCode
> Task :postInstrumentTestCode
> Task :test FAILED
> Task :classpathIndexCleanup SKIPPED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test'.
> There were failing tests. See the report at: file:///C:/Users/mfnal/IdeaProjects/SpigotPluginGeneratorPlugin/build/reports/tests/test/index.html
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 5s
15 actionable tasks: 15 executed
eternal night
#

Lol

tender shard
#

soooo

  1. thanks for telling me that I used the wrong annotation, that was indeed very helpful
#

but

#
  1. I still want it to work on the actual gradle version IJ's template wants me to use
#

I really don't get it

#

how can "latest junit" be compatible with gradle 7.4 but not with gradle 7.6 and in gradle 8.0 it fails completely lol

eternal night
#

It's not junit

#

It's the intellij plugin

#

Lemme get you the regression issue

tender shard
#

yeah it fails in gradle 8.0.X but the plugin itself works fine in 7.6

#

fuck gradle, everything always only causes problems

#

how can people use it on purpose

eternal night
#

It's a lot of moving parts

buoyant viper
eternal night
#

So thinks break

tender shard
eternal night
#

Well it got fixed

tender shard
#

and how? what do I gotta do? I only created this IJ plugin today, using the builtin "new IDE plugin" wizard

eternal night
#

Well it got fixed in 8.0 RC1

#

Idk why the intellij plugin shits the bed in 8.0

ivory sleet
#

might wna use that :>

eternal night
#

Check if their GitHub has anything about 8.0 support

ivory sleet
#

or Star minimessage Star

tender shard
#

but using 8.0.1 won't read my build.gradle at all

eternal night
#

Well check why not

buoyant viper
#

ah, Gradle.

tender shard
#

I would, if I could

#

but gradle doesnt tell me anything

eternal night
#

Check the plugins GitHub

tender shard
#

it says the error is "line 1, column 1"

eternal night
#

Intellij plugin

#

Open the issue page

tender shard
eternal night
#

Search the issue page for 8.0

#

Profit

tender shard
#

how can anyone, in the history of anything, ever came to the conclusion that gradle would solve any issues

eternal night
#

Venting won't help you here

tender shard
#

I have been spending hours now, getting a simple thing to work

eternal night
#

Lol

tender shard
buoyant viper
eternal night
#

You can do things in gradle that just aren't as nicely possible in maven

#

Especially caching

ivory sleet
buoyant viper
#

yea :(

tender shard
#

yeah for example "spending 4 hours to get it to work"

eternal night
#

Sure that too

buoyant viper
#

wish they would integrate some sort of components directly into Bukkit

tender shard
#

like this, for example

#

(using version 8.0.1 - do not ask me why gradle thinks it shouldnt output its current version)

buoyant viper
eternal night
#

Integrate adventure

#

Woop

buoyant viper
#

integrate bungee chat duke

eternal night
#

BaseComponent[]

buoyant viper
#

or yet another component api

eternal night
tender shard
#

spigot's components are the worst shit ever invented, everyone knows that

cunning canopy
#

Is there a raytraceentities that gets multiple hit entities?

tender shard
#

no

cunning canopy
#

There should be an api for that

eternal night
#

Just recast the Ray

worn tundra
buoyant viper
#

haha, no

eternal night
#

The fact that your base unit is an array

#

Triggers me

tender shard
cunning canopy
tender shard
#

?stash

undone axleBOT
buoyant viper
eternal night
#

No recast it from the hit entity

tender shard
#

anyone who complains about missing API features should contribute those "missing features" instead of just complaining

cunning canopy
#

I will

buoyant viper
#

CLA scawy md_5

tender shard
#

CLA not scary

buoyant viper
#

i still have some server api stuff i needed to PR actually

tender shard
#

CLA just says "I hereby say that if I copy/pasted other people's code, it's my problem and not md5's problem"

buoyant viper
#

i should probably make an outline of all the stuff i think could be edited on the fly

tender shard
buoyant viper
#

and possibly some stuff from paper, reimplemented in my own way

tender shard
#

unless you regularly steal other's people's code, you can sign it without problems

buoyant viper
#

thats usually all it boils down to

#

and inb4 "my full legal info is on my website <links website>" not everyone is U

tender shard
#

hm idk but if someone wouldnt even tell their name/address info, I also wouldn't want to accept their PRs

buoyant viper
#

idk

#

Paper seems to get by just fine without a CLA

#

and plenty of other forks

tender shard
#

also, I wanna add that whatever someone puts into the CLA is not public

#

only md5 can see it

buoyant viper
#

true

tender shard
#

and he also doesnt check whatever you fill in there

#

I could have said "123 Whatever Street", he wouldnt have noticed

cunning canopy
#

Whst is cla and md5 as in the hashing algorithm?

tender shard
#

?stash

undone axleBOT
tender shard
#

?cla

undone axleBOT
sterile token
#

What the best way for creating a custom editable menu?

cunning canopy
#

If bukket.world is just an interface where us the actual location?

#

Pf the implementation

eternal oxide
#

CraftBukkit

sterile token
eternal oxide
#

?stash

undone axleBOT
cunning canopy
#

Thanks. I don't really see why you wouldn't kust directly use the craftbukkit?

tender shard
#

because you want your plugins to work in both 1.18 and 1.19 and 1.20

#

and that's why you are supposed to use bukkit instead of CraftBukkit

eternal oxide
#

because you don;t want implementation directly accessible

tender shard
#

you should not rely on implementation, but only on interfaces

crimson scarab
#

this may seem like a silly question but how do i use a library from github

cunning canopy
#

Ah gotcha. So there is a lot of versions of craft bukket,but you can use onr api for them all?

eternal oxide
#

You'd have to release a new plugin build per version

tender shard
crimson scarab
#

not that i can see

tender shard
#

also do you, yourself, use any build tool, like maven or gradle?

icy beacon
#

can you send the repo?

tender shard
#

yeah sending a link to the repo would be helpful

rustic birch
#

hello im tryna remove 0,5 level from a player but i cant seem to do it

crimson scarab
icy beacon
#

ah

#

empty readme

tender shard
rustic birch
tender shard
eternal oxide
#

or add it using jitpack

final monolith
#

Hey guys, question about minecraft sessions... Its possible to a pirate user fake their uuid?

crimson scarab
tender shard
#
  1. File -> New Project -> New Projhect from CVS -> Insert the github link of that lib
  2. Run "maven install"
  3. In your other project, use the dependency, groupID: de.domisum, artifactId "CompitumLib", version "2.0.0-SNAPSHOT"
cunning canopy
#

Looking through the source code is actually pretty fun some times

#

Gives me inspiration on how to do certain things

rustic birch
#

i learned coding by mostly reading other people's codes and tryna understand what they do and why they do that

tender shard
#

usually you can just read the docs instead

rustic birch
tender shard
#

yeah true, but tbh everyone who didn't get a huge shit pile in their head DOES write proper docs

buoyant viper
#

/ md_5

#

he owns spigotmc

tender shard
rustic birch
tender shard
rustic birch
tender shard
mortal hare
#

yey

#

my Trie tree work

final monolith
tender shard
#

oooooh protocollib

mortal hare
#

btw this is a real word

buoyant viper
#

to check if a player is real, use online mode

tender shard
#

protocollib is known to have the shittiest docs EVER

final monolith
tender shard
#

if you can, try to avoid using protocollib at ANY costs

rustic birch
#

i have 8gb ram rn and it crashes when i have my server + mc and intelli j open if i get 8gb more will it work?

mortal hare
#

you cant really check if player is using vanilla client or not

#

since it can be spoofed easily

tender shard
#

@rustic birch

rustic birch
tender shard
#

wrong channel

#

oh my bad

#

I only just read it

#

sorry

buoyant viper
tall dragon
#

intellij often uses 4 + on its own

buoyant viper
#

i think the UUIDs still end up different, so it just might not work in the end

rustic birch
final monolith
mortal hare
#

UUID's are randomly generated in offline mode

#

for all players

tender shard
#

8gb is usually not even enough to stream netflix
but it should be enough for IJ

mortal hare
#

cracked or premium

tall dragon
buoyant viper
#

just use online mode :P its much less of a hassle

rustic birch
final monolith
final monolith
tender shard
#

how can people still survive on 8GB? I mean... even my laptop got 64gb of ram

mortal hare
#

serverside

eternal oxide
#

offline UUID is based upon the players name

buoyant viper
#

server

mortal hare
#

check usercache.json

rustic birch
tall dragon
#

yea i always want enough ram as well i also have 64

mortal hare
#

in that file player UUID's are being stored

tall dragon
#

i sometimes have like 3 servers and 3 clients with intellij open so

buoyant viper
#

i think its literally generated as "OfflinePlayer:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"

rustic birch
#

i have to close im intellij when testing the server and client cuz of crashes

final monolith
buoyant viper
tender shard
#

idk anything about those "windows" comments, just use a proper operating system like macOS and you won't have to complain about "I got too little ram" anymore

tall dragon
#

get yo self some more ram

rustic birch
mortal hare
sterile token
buoyant viper
#

just dont short urself on RAM, idk

#

futureproof ur PC

final monolith
mortal hare
#

man, people get to see sun in southern countries more

#

in whole January my city only got 5 hours of sunlight lmao

sterile token
mortal hare
#

5hours per month

rustic birch
#

i think january

tender shard
#

btw since somebody said sth about "no proper docs" earlier: if your library doesn't have at least have proper javadocs, it's a shitty lib and you shouldn't use it in the first place. this is how proper javadocs looks like:

sterile token
mortal hare
#

its measured in cloudiness

#

basically whole january was cloudy

#

and only 5 hours there was sunny weather

tall dragon
buoyant viper
tender shard
#

I would never publish some library without writing proper javadocs

#

if you can't even manage to write javadocs, you shoudln't publish your stuff

#

that's my opinion at least

rustic birch
tender shard
rustic birch
#

i started java for minecraft i had experince with javascript its kinda near syntax , but other stuff is very diffrent

buoyant viper
tender shard
#

the greatest difference between JS and java is that java forces you declare proper typies, while JS just htinks "lol let's just see what happens"

buoyant viper
buoyant viper
mortal hare
#

yea

#

thats why i hate js

tender shard
#

yeah, lose typing is so stupid haha

mortal hare
#

you cant really encapsulate stuff

#

in js

rustic birch
#

but the most thing i hate about web development is styling

buoyant viper
#

oh yeah fuck css

mortal hare
#

i made this in vanilla css html and js

#

it even works on IE lol

tender shard
#

except maybe kacperleague

buoyant viper
#

cant stand responsive design

mortal hare
#

yea CSS is cancer

buoyant viper
#

i love it, but i dont love trying to write it

mortal hare
#

its not as if its hard

#

ITS support is crazy

kind hatch
#

That's why you don't write normal css. Use SASS or tailwind.

buoyant viper
#

i simply write for Desktop first, fuk mobile devices

rustic birch
#

those are helpful but

rustic birch
buoyant viper
#

dw, my pages still look /fine/ on most mobile screens

rustic birch
#

how does coal write like is it "Coal" or "coal"

eternal night
#

@tender shard did you get your testing thing to work btw ?

#

id("org.jetbrains.intellij") version "1.12.0" seems to work with gradle 7.6

#

at least judging from the MinecraftDev plugin ๐Ÿ˜…

buoyant viper
#

just change width var and make sure u include <meta name="viewport" content="width=device-width, initial-scale=1.0" /> in html sunglasses

eternal night
#

which is usually my go to "imma be inspired by an intellij plugin" repo

tender shard
eternal night
#

what intellij plugin version are you rocking ?

cunning canopy
#
Vector startPos = player.getEyeLocation().toVector()
Vector dir = player.getEyeLocation().getDirection().normalize().multiply(8);
BoundingBox ray = BoundingBox.of(startPos, startPos).expandDirectional(dir);
Collection<Entity> entities = player.getWorld().getNearbyEntities(ray);
``` Does my vector math to get all entities in a players line of sight seem reasonable?
#

Am I in the ballpark?

eternal night
#

apparently the workaround might be testRuntimeOnly(libs.junit.platform.launcher)

mortal hare
#

its so weird that you can return primitive arrays

#

in java

#

since in cpp its black voodoo

#

magic

#

to do that

#

unless you use std::array,vector,list or pointer

eternal night
#

but in java it is literally a pointer

#

so is it really that weird

cunning canopy
#

Pointers in java is not a thing right?

mortal hare
#

internally they exist

#

in code they dont

cunning canopy
#

Thank god

tender shard
mortal hare
#

Objects are passed by reference

#

primitives by value

eternal night
#

in what error ?

#

and no

tender shard
#

1 sec

eternal night
#

that is not what runtimeOnly is

#

compileOnly is provided

sterile token
#

Please!! I need help to design a simple menu system for editable menus? I cant the propaper logic

tender shard
eternal night
#

what gradle version are you on ?

#

also, your interllij plugin seems outdated af

#

might wanna fix that

tender shard
#

8.0.1

buoyant viper
eternal night
#

yea okay

#

so

sterile token
mortal hare
#

can you reserve arraylist capacity

#

like in cpp?

#

in java

eternal night
#

MinecraftDev uses:

gradle 7.6
intellij plugin 1.12.0

#

and then also includes the junit launcher as a runtime dep

buoyant viper
#

was just poking fun at what i assume was a typo, u probably meant the word proper if i had to guess

eternal night
#

might wanna try that combination

tender shard
#

hm ok lemme try

sterile token
#

that why i type so fast cuz im running out of ideas

mortal hare
#

why dont you just use minecrell's plugin.yml generator instead

#

i use it in gradle

#

it works fine

tender shard
#

funny thing though, how it's a common for gradle users, to just downgrade to fix issues

eternal night
#

well

#

looks like you downgraded yopur intellij plugin

#

1.13 seems to have gradle 8.0 support

#

but you are on an ancient version

gleaming grove
tender shard
#

I did not, I today did File -> New project -> IDE plugin

eternal night
#

mate

tender shard
#

and then just used what it came up with

eternal night
#

intellij wizards are

#

trash

#

everyone knows that

#

they ship like, angular 2

#

lmao

tender shard
#

no clue what they do, their official docs told me to do that

mortal hare
#

i use 7.5 currently

pseudo hazel
#

ofc you wouldnt know, they arent called wizards for nothing

eternal night
#

idk, don't use intellij native creation wizards

#

they are basically guaranteed to be outdated af

tender shard
#

if the intelliJ docs tell me do exactly this, then the only person to blame is the dudes who wrote the docs, not me

quaint mantle
#

whats the best spigot version to run a barebone server litterly just they join and i kcik them with a code

eternal night
#

I mean, keeping docs up to date is a task not very easy to acomplish

quaint mantle
#

1.6 with via version?

#

idk

quaint mantle
#

why tho

#

i dont need terrain

#

or anything

#

no players on server

crimson relic
#

Why

tender shard
#

idk but maven somehow manages to not have this problem

eternal night
#

this is literally not gradle

#

you are getting shitty docs from intellij plugin peeps

#

ยฏ_(ใƒ„)_/ยฏ

#

also you don't need to update maven docs because maven has not seen any actual changes in eternity

tender shard
#

I am getting the docs from the jetbrains website, which is the company that releases IntelliJ. I have also checked the official gradle docs and what they claim also doesn't work.

so, if

  1. the intelliJ intelliJ plugin template doesn't work, and also
  2. the official gradle docs don'T work

then... I wonder where else I should get proper information from

eternal night
#

me 5Head /s

tender shard
#

for maven I just always use their website and it always works

pseudo hazel
#

easy fix, dont use gradle

eternal night
#

idk what exactly you checked on a gradle doc

#

cooncerning that all of your issues (except the wrong @Test annotation) were caused by the intellij plugin

tender shard
#

I would go for maven anytime

pseudo hazel
#

well I wasnt there for those 20 times ๐Ÿฅฒ

eternal night
#

just, upgrade your shit to latest versions

#

1.13 is the latest gradle intellij plugin

#

either go with 7.6 gradle that should be a safe bet

#

or 8.0

#

on 7.6 you might need the previously mentioned junit laucnher as a runtime dependency during test

mortal hare
#

use gradle god damnit

#

i like gradle

#

you like gradle

sterile token
mortal hare
#

we all love gradle

#

He should've named it Gravel

#

look

#

even papermc

#

uses gradle

#

cool dudes

eternal night
#

big win

mortal hare
#

compile times go brrrrr

#

compared to maven

eternal night
#

even intellij uses gradle

#

cool dudes

mortal hare
#

do you guys use default collections in your plugins

#

or use smth like fastutil

tender shard
eternal night
mortal hare
#

i heard goldman sach's libs are good too

alpine swan
#

in bungee, how do you get the player/proxiedplayer from a connection

eternal night
#

didn't I link the upgrade wrapper command ๐Ÿค”

#

or are you asking how to upgrade the plugin

tender shard
#

I doubt that there is any problem in my line 1

mortal hare
#

encoding?

tender shard
fallen patrol
#

Hey I am currently working on a hide and seek plugin. But I want to spawn a falling block that gets teleported to the player on the PlayerMoveEvent. However it is very slow and only teleports every X ticks, anyone happen to know how to fix this ๐Ÿ˜…

tender shard
#

I also have to add, it works fine in gradle 7.4, it fails to run tests in gradle 7.6 and it completely fails to parse the build file in gradle 8

marsh burrow
#

Hey does anyone know why in the latest build of intelliJ I can no longer compile my project?

tender shard
marsh burrow
#

nothing on google knows what this error is about

tender shard
marsh burrow
#

maven, my debug list is like 1k lines long, I'll post a paste bin

mortal hare
#

PlayerMoveEvent is not slow at all

#

it gets called hundreds of times after invoking it

tender shard
#

show the output of mvn compile clean package -X

eternal night
#

falling blocks are only ticked iirc, every 5 ticks ?

fallen patrol
#
    @EventHandler
    public void onPlayerMove(PlayerMoveEvent e) {
        e.getPlayer().sendMessage(String.format("You're at x:%s y:%s z:%s", e.getPlayer().getLocation().getX(), e.getPlayer().getLocation().getY(), e.getPlayer().getLocation().getZ()));
        if (!fallingBlockHashMap.containsKey(e.getPlayer().getUniqueId())) return;
        FallingBlock fallingBlock = fallingBlockHashMap.get(e.getPlayer().getUniqueId());
        fallingBlock.setTicksLived(100);
        fallingBlock.teleport(e.getPlayer());
    }
mortal hare
fallen patrol
#

I've included a log, just to display how often it gets called but it is very fast, but the teleportation is not

remote swallow
marsh burrow
fallen patrol
#

Yea, but the issue is the block only seem to follow every X ticks, like 20 ish ticks it seems :?

kind hatch
alpine swan
#

why are using strings in sendMessage (bungee) deprecated?

tender shard
#

use spigot, then you can stop worrying about this shit

alpine swan
tender shard
#

bungeecord does NOT deprecate all the string methods

kind hatch
marsh burrow
tender shard
#

please show your build.gradle or pom.xml fle

alpine swan
#

sendMessage("any string") is deprecated (as in you are supposed to use a textcomponent)

#

but what is better about textcomponents

tardy delta
kind hatch
#

Oh.. you don't know do you?

wary topaz
#

Just woke up, thanks.

tardy delta
#

item.hasItemMeta() meh

#

just check the impl and you'll see why

wary topaz
#

if ((item.getItemMeta() == reviveToken().getItemMeta())) {
So this is what I did, I also made sure they had the exact item meta.

#

I'll test it.

#

Yikes, it made the beacon

kind hatch
#

Several things can affect the item meta. Just a simple character addition or color change will cause it to be different. You might want to use the PDC instead and compare values from that.

wary topaz
#

But it is the exact same item? There is absolutely no changes

#

I'll upload my code.

undone axleBOT
wary topaz
#

Yeah no shoot

tall dragon
#

CraftItemEvent will not stop it from showing up tho

#

did u try actually crafting it?

wary topaz
#

Yes.

tall dragon
#

ok

wary topaz
#

Even frosty was struggling on this lol

tall dragon
#

u should just tag ur custom items

#

way less of a hastle

wary topaz
#

How so?

#

Is it a hassle*

#

if ((item.getItemMeta().isUnbreakable() == reviveToken().getItemMeta().isUnbreakable())) {
Boom

#

I'll try that

kind hatch
wary topaz
#

Oh

kind hatch
#

Or #isSimilar

wary topaz
#

booleans dont have .equals?

kind hatch
#

ItemStack does though.

tall dragon
#

should be using isSimilar with itemstack yea.

#

but he really just should be using pdc tags

wary topaz
#

if ((item.getItemMeta().equals(reviveToken().getItemMeta()))) {

#

But that's the hasle

kind hatch
rustic birch
#

should i use rebuild or build

wary topaz
#

build

kind hatch
#

In what?

rustic birch
wary topaz
#

It worked!

#

How can I prevent the beacon from showing up?

marsh burrow
#

idk what Provider me.lucko.helper.plugin.ap.PluginProcessor not found would mean, why would it start to error out?

wary topaz
#

Show full error @marsh burrow

kind hatch
wary topaz
#

Alr.

marsh burrow
tall dragon
wary topaz
#

Im pretty sure hypixel had this same error, i'll just leave it.

wary topaz
#

That's why.

#

Please use ?paste.

#

?paste

undone axleBOT
tall dragon
#

whats wrong with using a different paste tool xd

wary topaz
#

Syntax

tall dragon
#

syntax?

#

its a log

wary topaz
#

Yeea

#

me like color :0

#

Also you have like 20 plugins.

#

Try disableing all of them but your plugin to find the correct error.

sterile token
#

Why people from Paper ask support on Spigot ๐Ÿ’€

wary topaz
#

lmfao

#

i think

#

maybe somethin else

sterile token
#

I dont think its difficult to understand that they are diferent plugins apis, which means they are totally diff communities

rustic birch
#

bruh like its hey burger king wheres mcdonalds

sterile token
wary topaz
#

its like using bungeecoord for a bukkit server

#

alr but I did have one more questino

#

I have this arraylist: public static ArrayList<UUID> custombans = new ArrayList<>();

How can I make a gui with all of the players that are in this and if multible pages, add pages

#

i'm not that good with guis

marsh burrow
tall dragon
#

since paper is build on top of spigot

#

that does make some difference

mortal hare
#

๐Ÿ˜

wary topaz
#

uhh thats your ide not your console

#

am I wrnog?

#

wrong

ivory sleet
#

I mean if u're knowledgable regarding paper, you can still use that knowledge here

tall dragon
#

indeed

ivory sleet
#

but obv, papermc's discord is more suitable

wary topaz
#

yeah i dont know paper

#

i'd rather play minehut than learn it

marsh burrow
#

its nothing to do with paper though, my project just straight up no longer compiles

eternal night
#

And got an answer

wary topaz
#

try making an ew project and putting your code in

eternal night
#

Specifically about you using http instead of Https

#

And getting clapped by the maven blocker

wary topaz
#

LMFAO

marsh burrow
#

no ones answered me yet

gleaming grove
eternal night
#

What

marsh burrow
#

why, is maven banned on there?

rustic birch
#

yes its a word

eternal night
wary topaz
#

english be like

eternal night
#

Lmfao

wary topaz
#

alr ill make a static to open a gui

#

public static void openBansGUI(Player p2) {

}
gleaming grove
#

Ye Pagination is keyword of what are you tring to achieve

marsh burrow
wary topaz
#

wtf is ChatPaginator

#

(its a function)

tall dragon
wary topaz
#

its gonna be used by 2 classes

#

its not aboose

tall dragon
wary topaz
#

i dont want to duplicate code

tall dragon
#

?di

undone axleBOT
wary topaz
#

true

#

alr ill use main class

rustic birch
#

how can i make cooldown(for each player)

wary topaz
#

scheduler

tall dragon
#

u dont need a scheduler for cooldowns

wary topaz
#

oh plugin.yml

#

nvm

rustic birch
#

im using if statement i need cooldown there that is need to be set for each player

wary topaz
#

i want to know too

tall dragon
#

when u add a cooldown store the time it started & how long it takes, when u check for the cooldown check if that time has passed

#

remove the cooldown if enough time had passed

wary topaz
#

ohh

rustic birch
#

how can i do that for each player tho

#

oh like a new object would work

kind hatch
# eternal night

I think part of your issue is using profiles instead letting the compiler plugin do all the work.

rustic birch
#

hmm

tall dragon
#

Map<UUID,CooldownObject>

#

for example ^

kind hatch
#

Wrong reply

wary topaz
#

very smart

tall dragon
#

or Map<UUID,List<CooldownObject>>

rustic birch
#

hm i think it can work

kind hatch
wary topaz
#

is there a player rightclick event?

sterile token
#

Index 16 out of bounds for length 0, what means that while working with menus? Its related to title right?

wary topaz
#

or is it just itemconsume

tall dragon
#

or evenMap<UUID,Map<String,Cooldown>> so u can store a map of cooldowns identified by a string for each player

rustic birch
#

can i just make a function instead of map

wary topaz
#

vernano the 15's slot

sterile token
#

Its a slot issue?

wary topaz
#

pretty sure

tall dragon
sterile token
#

Okay weird

wary topaz
#

what else would it be

sterile token
#

I dont have any item on slot 15

#

๐Ÿ’€

wary topaz
#

check 16

sterile token
#

Yes i have on slot 16 an item

rustic birch
sterile token
#

But why the exceptions?

wary topaz
#

how big is the gui

sterile token
wary topaz
#

hmm

tall dragon
wary topaz
#

check the name of the gui

rustic birch
wary topaz
#

no wait

#

idk lol

#

ask epicgodmc

sterile token
#

1 rows = 9 slots

tall dragon
#

Maps that is

wary topaz
#

1row is 8 slots because starts on 0

sterile token
#

right, must be that tho

#

Im doing rows * 9

tall dragon
#

does ur inv have 2 rows?

wary topaz
#

yes

sterile token
wary topaz
#

try * 8

sterile token
#

ok

tall dragon
#

nah * 9 is right

mortal hare
#

who tf mentioned

sterile token
#

Hmn ok

mortal hare
#

that sendMessage is deprecated

sterile token
#

So doesnt make sense

mortal hare
#

yesterday

#

String version of sendMessage is not deprecated wtf

sterile token
#

I will send full code Epic, because im in a nightmare

marsh burrow
sterile token
mortal hare
wary topaz
mortal hare
#

yes

wary topaz
#

check if the entity is player

mortal hare
#

also people try new ui

#

in intellij

#

it looks cool

tall dragon
#

bruh its made for toddlers

wary topaz
#

haha

tall dragon
#

i hate it

mortal hare
#

its good

wary topaz
#

mylife

mortal hare
#

its way more cleaner

wary topaz
#

crap dont hate on my class names

tall dragon
#

like why

#

its an ide

#

its supposed to be functional

mortal hare
#

you have context menus

#

there's nothing i couldnt find

tall dragon
#

idk its just my preference i guess

#

i like the old style way better

sterile token
#

Oh im an idiot

#

I realized the issue

wary topaz
#

what was it

sterile token
#

๐Ÿ˜ก

sterile token
#

๐Ÿ˜ก

wary topaz
#

fff

sterile token
#

sorry LMAo, im really idiot

wary topaz
#

why be sorry?

#

we all learn here

sterile token
#

oh thanks cuty

wary topaz
#

tee hee

sterile token
#

others will swear me

wary topaz
#

i know that feeling

tall dragon
#

nah kidding xD

wary topaz
#

LFMAO

sterile token
#

Imagine telling paper this isue, they ban you directly

wary topaz
#

oh god

sterile token
#

๐Ÿ˜‚

wary topaz
#

I went to bukkit as a joke and asked for help on a spigot plugin