#help-development

1 messages · Page 1710 of 1

carmine nacelle
#

yeah spot the issue here

#

fml

native nexus
#

I don't see it

formal dome
#

where can i find the syntax for shading libraries into my plugin.yml

lavish hemlock
carmine nacelle
#

So likee...has anyone here ever worked with custom beehive stuff before..?

#

or know how they work

#

like when one is placed, do the bees automatically look for the nearest flowers or

quaint mantle
quaint mantle
#

Yiu can just Bukkit.getOnlinePlayers()

#

Don't need Bukkit.getServer().getOnlinePlayers()

native nexus
#

or use dependency injection

carmine nacelle
#

Well, trying to make a custom entity and already stuck.

    public CustomBee(Location location) {
        super(EntityTypes.BEE, ((CraftWorld)location.getWorld()).getHandle());
    }

EntityTypes is only giving me the option for EntityTypes.g, b...

#

have they changed that again too?

ivory sleet
#

Yes

carmine nacelle
#
java: cannot access net.minecraft.network.chat.ChatComponentText
  bad class file: /C:/Users/jflee/.m2/repository/org/spigotmc/spigot/1.17.1-R0.1-SNAPSHOT/spigot-1.17.1-R0.1-20210708.170253-1.jar!/net/minecraft/network/chat/ChatComponentText.class
    class file has wrong version 60.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
#

Uhhhh wut

pastel stag
#
        try {
            PreparedStatement ps4 = plugin.SQL.getConnection().prepareStatement("SELECT * FROM wb_blocks WHERE WORLD=? and X=? and Y=? and Z=?");
            ps4.setString(1, world);
            ps4.setInt(2, blockx);
            ps4.setInt(3, blocky);
            ps4.setInt(4, blockz);
            String breaker = player.getName();
            ResultSet results4 = ps4.executeQuery();
            while (results4.next()) {
                String blockowner = results4.getString("NAME");
                if(blockowner.equalsIgnoreCase(breaker)) {
                    return true;
                }
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return false;
    }```
#

anyone familiar w/ using sql in java have any idea what i am doing wrong here? getting hung up on while (results4.next()) { appears like the code never executed but everything above it does...

#

the query 'should' be returning this array from the database

tardy delta
#

any way to make this shorter?

ivory sleet
#

The fundamental rule of a function is that it should only do one thing

#

And one thing is usually defined by when you cannot meaningfully extract another function from it

#

As the function becomes more and more specific it’s also natural that the name of the function becomes longer because it does something more specific

tardy delta
#

if it would do one thing i need to have three methods :/

ivory sleet
#

Yes and that’s a lot cleaner

#

It allows the reader to exit early

tardy delta
#

so i should make a method that handles the cooldown and one for the teleport?

vernal pier
#

Can you spawn an item frame without a block next to

pastel stag
#

@ivory sleet any insight on the issue im having above w/ the sql nonsense?

opal juniper
pastel stag
#

or nawww lol im stumped

carmine nacelle
#

Why can't I cast CustomBee to Bee? it extends EntityBee

#

I can't add my CustomBee to the hive 😦

#

and can't use the bee methods from it

solar sable
#

how to set a hover event on a onPlayerJoin listener?

opal juniper
carmine nacelle
vernal pier
#

It doesn’t throw when there’s a block nearby tho*

carmine nacelle
#

I know I could implement Bee but that adds like 1000 methods

opal juniper
#

idk then sorry

opal juniper
carmine nacelle
#

do I have to do it anyway..?

#

like that's the only way?

vernal pier
#

Can’t u use getBukkitEntity()

carmine nacelle
#

omg i love u so much

#

homo intended

hard fractal
#

Anyone here have api for messages title subtitle actionbar etc 1.8-1.17?

carmine nacelle
#

other than ActionBarAPI...?

hard fractal
#

Yes

#

I know only mf-msg

deft patrol
#

im making a plugin with abilities per class atm and was wondering if i split event listener classes into like one for each class would listening to the same event once for each class be worse than just having it all in one?

torn shuttle
#
public class SpigotMessage {
    public static TextComponent simpleMessage(String message) {
        return new TextComponent(message);
    }

    public static TextComponent hoverMessage(String message, String hoverMessage) {
        TextComponent textComponent = simpleMessage(message);
        textComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(hoverMessage)));
        return textComponent;
    }

    public static TextComponent commandHoverMessage(String message, String hoverMessage, String commandString) {
        TextComponent textComponent = hoverMessage(message, hoverMessage);
        textComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, commandString));
        return textComponent;
    }
}

Rate how sexy my utility class is out of 10

#

I keep forgetting the syntax for these and I'm clearly going to be using it very frequently so here we go

lavish hemlock
#

Pretty alright

#

Although you are missing 2 things that would make that a pure utility class

#

final on the class declaration (prevents inheritance)
private constructor (prevents instantiation)

  • you can also avoid reflection via throwing an exception within the constructor
torn shuttle
#

private constructor?

lavish hemlock
#

It's like a private method

#

it can only be called by the class it belongs to

torn shuttle
#

why would I do that?

lavish hemlock
#

to stop people unnecessarily instantiating your utility class? (which is important for an API)
plus it provides a bit more context as to what the class is for

ivory sleet
#

Yeah

#

Even the class Objects do that

lavish hemlock
#

ye

ivory sleet
#

even throws an AssertionError in its init

lavish hemlock
#

I tend to throw UnsupportedOperationException myself

ivory sleet
#

I always throw AssertionError

#

but both works

torn shuttle
#

I guess I don't really see the point in doing that when this is for a solo project lol

ivory sleet
#

yeah its not necessary ofc

lavish hemlock
#

fair? I typically do it all the time tho just as a personal thing tho

ivory sleet
#

But I like to write my code defensively Ig

lavish hemlock
#

but uhhh that's coming from a person who uses final on 99% of his local variables

torn shuttle
#

I used to use final quite a bit more

ivory sleet
#

same

torn shuttle
#

but then I did a 250 class refactor

#

and uh

#

I changed my mind on that one

lavish hemlock
#

man I used to use it on fuckinnnnn

native nexus
#

im lazy

lavish hemlock
#

ARM resources and parameters

ivory sleet
#

I used final because it occasionally would spare some bytecode instructions

#

but its negligible

lavish hemlock
#

just kotlin it

ivory sleet
#

so stopped with the final clutter

lavish hemlock
#

ez

torn shuttle
#

it makes sense if you're working on a project with a lot of people but the opening statement of my project says I don't take pull requests lol

ivory sleet
#

hehe

torn shuttle
#

just want this to be a project I wrote from end to end

native nexus
#

"code is mine, no touchy"

torn shuttle
#

it's open source and gplv3, I just also want it to be something I made

ivory sleet
#

ye thats totally fine

lavish hemlock
#

I mean GPL isn't as open as it could be, but yeah I understand

torn shuttle
#

gplv3 is exactly what I want it to be

lavish hemlock
#

I'm an MIT License guy myself

ivory sleet
#

wtfpl 😄

lavish hemlock
#

...
if you look at any of my projects they're all under MIT

tardy delta
lavish hemlock
ivory sleet
#

I use mit mostly but yeah sometimes something else

tardy delta
#

Smh

lavish hemlock
#

that too ^

#

you can also use it if you want to force your class to use a builder

#

since nested classes are able to instantiate their parent classes if they have private constructors

ivory sleet
#

yea

#

parent classes constructors can be public also

lavish hemlock
#

ye I know

#

I was just stating that private works

ivory sleet
#

ah alr

lavish hemlock
#

I know everything about Java

#

don't test me, or you die

ivory sleet
#

Name every possible variable

#

🤡

lavish hemlock
#

what does that even mean

native nexus
#

hold your horses

lavish hemlock
#

oh fuck

tardy delta
#

Oh

lavish hemlock
#

well technically

#

every possible variable depends on the size of the call stack

torn shuttle
#

you know java? name every exception that I have triggered today

carmine nacelle
#

Is it a bad idea to save a list of custom objects? or should I just loop through the list and save the values I want

lavish hemlock
#

as you said "variable" and not "field"

ivory sleet
#

fields are variables in a sense

lavish hemlock
#

ehhhhh it's kinda like squares and rectangles

#

a field is a variable, but a variable isn't a field

ivory sleet
#

yeah

tardy delta
#

A rectangle is a square?

#

🤠

lavish hemlock
#

yeah

wide flicker
ivory sleet
#

square isnt a rectangle

ivory sleet
lavish hemlock
#

a rectangle is a square, it's a 4-sided, closed shape

#

the difference is l e n g t h

tardy delta
#

Ow i was thinking about the work Triangle smh

#

😔

ivory sleet
#

maow have u messed with jigsaw and serviceloader

native nexus
#

Can we take this to #general You guys are ignoring someones question

ivory sleet
#

I thought it was going to be tricky but it was quite simple despite going under one of the more advanced java topics

lavish hemlock
torn shuttle
#

ah feels good to use text components like this

#

should've done this ages ago

#
                TextComponent bossTrace = SpigotMessage.commandHoverMessage(ChatColor.BLUE + "Boss trace!",
                        "Remember, it requires debug mode to be on! This is used for advanced debugging, ask on discord if you want to know more about it.",
                        "/elitemobs trace " + customBossEntity.getEliteUUID().toString());

c o m f y

lost matrix
# lavish hemlock I know everything about Java

Lets see.
What does this code print out:

  public static void main(String[] args) {
    Integer a = 10;
    Integer b = new Integer(10);
    Integer c = Integer.valueOf(10);
    System.out.println(a == b);
    System.out.println(b == c);
    System.out.println(a == c);
  }
lavish hemlock
#

welllll

#

valueOf likely returns a cached version of the Integer

ivory sleet
#

ye

lavish hemlock
#

I wonder if the autoboxing would use valueOf or the constructor?

ivory sleet
#

former I presume

lost matrix
#

valueOf and implicit creation does

lavish hemlock
#

oh so then

false
false
true

?

lost matrix
#

Yeah. How big is the default Integer cache of the jvm?

eternal night
#

:>

ivory sleet
#

<:

lavish hemlock
#

hmm

hasty jackal
#

I think somewhere around 100-200 values iirc

ivory sleet
#

I'd guess 512

lost matrix
#

One byte in size
-127 to 128

ivory sleet
#

oh nvm

eternal night
#

2⁸

#

yea

vernal pier
#

How do I summon an item frame without a block next to

eternal night
#

tho can't you like, expand the integer cache ?

lost matrix
eternal night
#

yea ha

ivory sleet
#

Does Long also have a cache?

#

(by default)

lavish hemlock
#

all primitive wrappers do

lost matrix
ivory sleet
quaint mantle
vernal pier
lost matrix
vernal pier
#

It’s possible

eternal night
#

They die after a while don't they ?

vernal pier
#

When I use the minecraft summon command it works just fine

lost matrix
lavish hemlock
#

Hard question

#

I know from StackOverflow it's not very quick compared to ArrayList and it's very memory inefficient (as it uses linked nodes)

ivory sleet
#

What's the parallelism for the common pool?

lavish hemlock
#

aight well I don't even work with concurrency lol so

#

good job calling that out

lost matrix
#

For the LinkedList: Removal of elements while iterating is O(1) and the only thing its good at.

ivory sleet
#

oh lets skip that also

#

adding is also O(1) innit?

lost matrix
#

parallelism i would suspect the number of cores of the cpu?

carmine nacelle
#
    public boolean setupCore() {
        if (getServer().getPluginManager().getPlugin("CadiaCore") == null) {
            return false;
        } else {
            this.cadiaCore = (CadiaCore) getServer().getPluginManager().getPlugin("CadiaCore");
            return true;
        }
    }

Soooo..my core plugin is saying it's null, even though the return for this is "true" (meaning it successfully found the core dependency plugin)

carmine nacelle
#

whats up with that

lost matrix
ivory sleet
#

Yeah iirc something like that although changeable with a jvm flag

carmine nacelle
#

but if I try to reference the core, it says it's null

lost matrix
carmine nacelle
lost matrix
#

Let us see how you obtain your cadiaCore instance. A stack trace would be nice too 😄

carmine nacelle
lost matrix
#

And registerDependencies() calls setupCore()

carmine nacelle
#

So this:

this.cadiaCore = (CadiaCore) getServer().getPluginManager().getPlugin("CadiaCore");

it's null, otherwise it would return false, then disable the plugin

#

yeah

#
    public boolean registerDependencies() {
        if (!(setupEconomy() || !(setupCore()))) {
            return false;
        } else {
            return true;
        }
    }
native nexus
#

You can make nicer return statements

lost matrix
#

just

    public boolean registerDependencies() {
        return setupEconomy() && setupCore();
    }
carmine nacelle
#

done

#

but thats not my issue lol

native nexus
#

We are aware but looks cleaner 😛

carmine nacelle
#

true

#

i like clean

lost matrix
#

Could be. Your statement looks a bit off

carmine nacelle
#

hence grouping everything together and having my onenable just calling other methods to do the dirty work

#

Still have the error

lost matrix
carmine nacelle
lost matrix
#

Set the

<scope>provided</scope>

in your pom.xml

#

Or do you use Gradle?

carmine nacelle
#

I'm using it as a jar dependency

lost matrix
#

Ah. F i guess.

native nexus
#

Highly recommend looking into maven or gradle

carmine nacelle
#

I use maven for stuff like spigot

regal dew
#

just gradle

#

no maven

#

gradle kotlin dsl

native nexus
#

Why not maven?

lavish hemlock
carmine nacelle
#

but I dont really feel like pushing every change I make to the core plugin to github and stuff

native nexus
#

You don't have too

#

You can include the core via a dependency in maven

carmine nacelle
#

How?

#

they are both maven projects..so..

regal dew
native nexus
#

Yeah floats my boat

lavish hemlock
#

I fucking hate XML

regal dew
#

or cartesian product lookup of dependencies in repos

native nexus
#

I write XML daily

#
<repository>
  <id>project.local</id>
  <name>project</name>
  <url>file:${project.basedir}/repo</url>
</repository>
``` `mvn clean` `mvn install` Then you can include it as a dependency in any of your projects. Just make sure to shade it in ofc.
#

If there is a better way todo it lemme know lol

native nexus
#

Yes

carmine nacelle
#

Does that go with my other repos or up towards the top?

native nexus
#

Yep with your other repo's

carmine nacelle
#

and would the id be the same as my groupID?

native nexus
#

Yeah

#
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.huskydevelopment</groupId>
    <artifactId>HuskyCore</artifactId>
    <version>1.4</version>

    <properties>
        <maven.compiler.source>16</maven.compiler.source>
        <maven.compiler.target>16</maven.compiler.target>
    </properties>

    <repositories>
        <!-- This adds the Spigot Maven repository to the build -->
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>project.local</id>
            <name>project</name>
            <url>file:${project.basedir}/repo</url>
        </repository>
    </repositories>

    <dependencies>
        <!--This adds the Spigot API artifact to the build -->
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.17-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>
``` @lavish hemlock @regal dew This one is for you bb's
#

Example of my pom.xml @carmine nacelle

lavish hemlock
#

same thing can be done in fewer lines with a build.gradle.kts

regal dew
#

🤢

carmine nacelle
#

Could not find artifact com.squallz:CadiaCore:pom:1.0-SNAPSHOT in spigot-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/)

#

bruh

#

why is it looking there

native nexus
#

Show me your pom

carmine nacelle
native nexus
#

oh you can just have it as project.local

carmine nacelle
#

I do that then I click the little M at the top right to load maven changes

native nexus
#
<dependency>
  <groupId>com.huskydevelopment</groupId>
  <artifactId>HuskyCore</artifactId>
  <version>1.4</version>
</dependency>
``` You include it as a dependency not as a repo
carmine nacelle
#

ok removed that

#

Cannot resolve project.local:CadiaCore:1.0-SNAPSHOT

#

mvn clean mvn install
where do I run that.. cmd?

#

have to cd to my directory..?

native nexus
#

It's in your sidebar

carmine nacelle
#

I opened the terminal and ran them

#

[ERROR] Failed to execute goal on project CadiaBees: Could not resolve dependencies for project org.example:CadiaBees:jar:1.0-SNAPSHOT: project.local:CadiaCore:jar:1.0-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigot-repo has elapsed or updates are forced

regal dew
#

fixed it for ya

native nexus
#
<repository>
  <id>project.local</id>
  <name>project</name>
  <url>file:${project.basedir}/repo</url>
</repository>
``` Just copy and past this, don't change anything
dense remnant
#

Hey is there a way to increase knockback without the attack_knockback attribute? When I set that attribute to something like 1000 it doesnt really do more when at a lower level

native nexus
#

project.local and project are variables

native nexus
#

Your core Pom.xml

#

then run mvn clean mvn install

carmine nacelle
#

alright

#

I also keep getting this: Cannot resolve plugin org.apache.maven.plugins:maven-deploy-plugin:2.7

native nexus
carmine nacelle
#

Alright, I did that

#

Still getting red underlines in the other one

#

[ERROR] Failed to execute goal on project CadiaBees: Could not resolve dependencies for project org.example:CadiaBees:jar:1.0-SNAPSHOT: project.local:CadiaCore:jar:1.0-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigot-repo has elapsed or updates are forced -> [Help 1]

#

still the same error

native nexus
#

Show pom of both projects again.

carmine nacelle
#

reached my pastebin limit 🙄

#

wait

#

other way around.

native nexus
#

why is your group id for the dependency project.local? that is where you define the actual proper group id for the core

#
<repository>
  <id>project.local</id>
  <name>project</name>
  <url>file:${project.basedir}/repo</url>
</repository>
``` This goes in your core POM
#
<dependency>
  <groupId>com.huskydevelopment</groupId>
  <artifactId>HuskyCore</artifactId>
  <version>1.4</version>
</dependency>
``` This goes into your other projects POM
#

It's not hard

carmine nacelle
#

😮

#

works

native nexus
#

Yay!

carmine nacelle
#

wild

native nexus
#

There yah go!

carmine nacelle
#

so every time I update the core I have to run the mvn commands again..?

native nexus
#

Yep otherwise it won't know the changes

#

The best approach is to honestly use modules when utilizing a core

carmine nacelle
#

alright

#

but

native nexus
carmine nacelle
#

still getting the cast error..

native nexus
#

Could you show me that error?

#

and source

carmine nacelle
#
    public boolean setupCore() {
        if (getServer().getPluginManager().getPlugin("CadiaCore") == null) {
            return false;
        } else {
            this.cadiaCore = (CadiaCore) getServer().getPluginManager().getPlugin("CadiaCore");
            return true;
        }
    }

63 is

this.cadiaCore = (CadiaCore) getServer().getPluginManager().getPlugin("CadiaCore");
native nexus
#

What is the Declaration for cadiaCore variable?

carmine nacelle
#

Isn't that what I sent?

native nexus
#

What is the type for CadiaCore, did you make it Plugin or JavaPlugin?

carmine nacelle
#

public CadiaCore cadiaCore;

#

extends JavaPlugin ofc

native nexus
#

I have never casted to a JavaPlugin before

#

What happens when you create a static instance of your core class and get it that way?

carmine nacelle
#

No I just mean in the core:
public class CadiaCore extends JavaPlugin {

#

I always use dependency injection across classes instead of a static instance method

native nexus
#
public class CadiaCore extends JavaPlugin {

  private static CadiaCore instance;

  @Override
  public void onEnable() {
    instance = this;
  }  

  public static CadiaCore getInstance() {
    return instance;
  }
}
``` Try this and see if getting the static instance works.
carmine nacelle
#

Yes

wide flicker
#

Do you have CadiaCore set as a dependency for CadiaBees in the plugin.yml?

wide flicker
white thicket
#

How to create bungeecord config file?

native nexus
#

com.squallz.CadiaBees.CadiaBees seems incorrect

white thicket
#

this.getConfig() doesn't seem to work for bungeecord

carmine nacelle
wide flicker
carmine nacelle
#

ok but..

#

minor details

#

Idk why it suddenly can't find the main class of that plugin

native nexus
#

Yeah but that is important to run your plugin 😛

carmine nacelle
#

Well, the last build on it failed with this

#
WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.273 s
[INFO] Finished at: 2021-09-28T05:26:08-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project CadiaBees: Fatal error compiling: Failed to run the ecj compiler: source level should be in '1.1'...'1.8','9'...'14' (or '5.0'..'14.0'): 16.0.2 -> [Help 1]

wide flicker
carmine nacelle
#

pretty sure its cause it didnt build correctly

#

but uh... Failed to run the ecj compiler: source level should be in '1.1'...'1.8','9'...'14' (or '5.0'..'14.0'): 16.0.2 -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project CadiaBees: Fatal error compiling

#

wot

#

I dont get why its just now throwing this error

carmine nacelle
#

@native nexus Seems to have compiled fine but still not letting me cast it

#

java.lang.NullPointerException: Cannot read field "hologramManager" because the return value of "com.squallz.CadiaCore.CadiaCore.getInstance()" is null

#

this is so annoying holy shit.

#

depend: [ProtocolLib, Vault, CadiaCore] in my plugin.yml

pastel stag
#

@lost matrix yo do you know anything about java + sql?

#

like getting data from an sql database and using it in a method as a string or otherwise

deft patrol
#

why are there so many blockface directions? from what i can tell i only need north, south, east, west, up and down

quaint mantle
#

is there anyway to modify a sent packet ?

#

for example an armorstand's metadata

#

it's displayname forexample

wide flicker
deft patrol
#

which blocks does that apply to?

lost matrix
quaint mantle
wide flicker
quaint mantle
#

a sent packet that i have it's id

wide flicker
lost matrix
deft patrol
#

ah i see, alright thanks for the info

quaint mantle
quaint mantle
carmine nacelle
#

Protocollib? Trash plugin?? LOL WHAT

quaint mantle
carmine nacelle
#

Then how is it trash.

quaint mantle
#

the performance is trash

lost matrix
carmine nacelle
#

I've never had a single issue with it.

carmine nacelle
quaint mantle
wide flicker
carmine nacelle
#

Can't blame procollib for that one

#

Yep.

#

Even using static instance

wide flicker
#

Version of core the same as the one being used on the server? (No changes to that class?)

carmine nacelle
#

Well with static instance it's just null.

#

It's all up to date, restarted server

#

Re exported both.

lost matrix
wide flicker
#
RegisteredServiceProvider<CadiaCore> provider = Bukkit.getServicesManager().getRegistration(CadiaCore.class);
if (provider != null) {
  this.cadiaCore = provider.getProvider();
}```Try this
lost matrix
wide flicker
carmine nacelle
lost matrix
lost matrix
carmine nacelle
#

Build > build artifacts

lost matrix
#

Do you use maven?

carmine nacelle
#

Yeah but to make the jar I build artifacts

lost matrix
#

Then you can throw your pom.xml in the trash because it doesnt get used anyways.

carmine nacelle
#

Uhhh it does for my dependencies

lost matrix
#

If you dont know what all the maven lifecycles do then just use
mvn clean install

quaint mantle
carmine nacelle
#

If I delete my pom then I lose all my spigot API references, protocollib, it's 110% needed

lost matrix
carmine nacelle
quaint mantle
#

or it is the datawatcher of entityarmorstand

lost matrix
carmine nacelle
#

IntelliJ.

#

That's still not my issue though.

lost matrix
carmine nacelle
#

Once the plugins are in the server, how they're compiled changed nothing

lost matrix
carmine nacelle
#

Why is it just now an issue once I try using my own dependency

quaint mantle
carmine nacelle
#

Every entity has it's own.

quaint mantle
lost matrix
quaint mantle
#

you mean armorstand 1 and armorstand 2

quaint mantle
#

means if i do as.getDataWatcher()

#

it works with another armorstand right ?

carmine nacelle
#

"no valid maven installation found" excuse me what

carmine nacelle
#

I don't get how my maven home directory is inside

#

Invalid*

#

Already did that

#

And it's in my path

lost matrix
carmine nacelle
#

Got it

#

Shows a version now

#

its been showing this for a while but still works fine

#

idk what thats about.

lost matrix
#

Then type mvn clean install into the terminal window or use IJs helper buttons

carmine nacelle
#

It does that all the time idk why

#

But

#

I did the clean install thing again

#

Now what?

lost matrix
#

Did you build the plugin?

carmine nacelle
#

I clicked clean and install

#

If that builds it then yeah lol

#

It gave me a jar

lost matrix
#

In your "target" folder?

carmine nacelle
#

It's named very inconveniently

#

Yes

lost matrix
#

Try it out 😄

carmine nacelle
#

Ok...explain

#

and how can I make the mvn build export directly to my plugins folder instead of some random folder

lost matrix
#

Building artifacts doesnt use your pom.
Building with maven does.
So if you build an artifact then you copy your dependencies into your jar
if you use the pom then you can define the scope.
PS: There is also a way of not shading the dependencies without using maven

carmine nacelle
white thicket
#

Is there any event for when a falling block lands? Tag me if replying me pls ty

carmine nacelle
#

@lost matrix any idea...? it keeps exporting to the target folder in the project, I need it to export to my plugins folder like it was with the artifacts

fading lake
# white thicket Is there any event for when a falling block lands? Tag me if replying me pls ty

I detect falling block changes like this, it's probably not the best way, but the best way I can think of at this moment

@EventHandler
private void onBlockChange(EntityChangeBlockEvent event) {
    if (event.getBlock().getType() == Material.AIR || !event.getBlock().getType().isBlock()) {
        Bukkit.getScheduler().runTask(Main.getInstance(), () -> {
            if (event.getBlock().getType() == Material.SAND || event.getBlock().getType() == Material.GRAVEL) {
                event.getBlock().getWorld().playEffect(event.getBlock().getLocation(), Effect.STEP_SOUND, event.getBlock().getType(), 20);
                event.getBlock().getWorld().getBlockAt(event.getBlock().getLocation()).setType(Material.AIR);
            }
        });
    }
}
#

its just a simple thing that kills gravel and sand falls regardless of what they land on

lost matrix
#

Get the entitiy and cast it to FallingBlock. Then get the BlockData/Material from it.

fading lake
#

it works, somewhat

lost matrix
#

One moment

frank steeple
#

Is there maybe event.getentity.remove, it may prevent lag on large amounts of blocks

fading lake
#

oh so right start, wrong exit

frank steeple
#

Also why are u running it in scheduler?

lost matrix
# fading lake it works, _somewhat_
  private static final Set<Material> CLEANED_TYPES = EnumSet.of(Material.GRAVEL, Material.SAND);

  public void onFallingBlockHit(final EntityChangeBlockEvent event) {
    final Entity entity = event.getEntity();
    if (entity instanceof FallingBlock fallingBlock) {
      final Material material = fallingBlock.getBlockData().getMaterial();
      if (CLEANED_TYPES.contains(material)) {
        // Play sound here
        event.setCancelled(true);
      }
    }
  }
carmine nacelle
#

this mans a legend

carmine nacelle
#

Output path is... C:\Users\jflee\Desktop\Test Server\plugins
maven outputs to... C:\Users\jflee\IdeaProjects\CadiaCore

#

why.

lost matrix
fading lake
lost matrix
# carmine nacelle why.

You need to define the output dir in your pom somehow.
From now on everything compilation related is done in your pom.

white thicket
#

oh so we have to do that to wait a tick and stuff?

#

I am actually trying to make it so when any falling block is dropping and if block below it is something then it will break

carmine nacelle
#

ok got that but I dont want my output jar to have SNAPSHOT on the end it looks dumb & is unnecessary

lost matrix
lost matrix
carmine nacelle
#

I didn't want a version on it at all. I just wanted the plugin name but I figured it out, thx for the help guys

lost matrix
white thicket
#

What happens with you cancel the event?

lost matrix
#

I think the block just vanishes.

white thicket
#

can I break it instead?

#

like drop it in item form?

lost matrix
#

Sure

white thicket
#

How so?

lost matrix
#

Either dont cancel the event and break the block one tick later
or
Cancel the event and manually drop an ItemStack at the Location

white thicket
#

hmm I will actually just remove it

halcyon mica
#

So it looks like entities are unable to actually leave 2 block deep water

#

As in, jumping out

#

Did anyone figure out how to let them leave deep water yet

slim kernel
#

What ItemStack do I get when doing getCursor() in the InventoryClickEvent?

floral panther
#

hey can anyone help m

#

i am developing a server

#

but i can't make a void mutiverse

#

can anyone help?

solid cargo
#

why do i always misread "pom" to something else..

maiden briar
#

Why can't I update the scoreboard async? The timings told me it is 600% of a tick

tall dragon
slim kernel
hollow bluff
#

How may I go on about fixing this issue https://paste.md-5.net/yoyejiceke.sql ? I tried adding a delay for the method that loads a selected world but I don't think that one was the problem and I'm just not sure how to go on about this

maiden briar
#

The world does not exist @hollow bluff

hollow bluff
#

Everything works after when doing /rl but when first starting the server, it doesn't load

maiden briar
#

Then idk what is wrong here

quasi flint
#

do i smell 1.8?

hollow bluff
quasi flint
#

still,1.8 long depricated and abandoned by paper and shit

hollow bluff
#

The answer I got yesterday when I asked was that it takes time for a world to load, so I don't know how to even fix it

quasi flint
#

delay the execution of ur code

hollow bluff
#

I tried adding a delay but the error still came

quasi flint
#

long enough delay?

#

like 5 min after the world loaded

#

to make sure

hollow bluff
#

._. It's a minigame, for sure I dont need to wait 5min

quasi flint
#

just for testing my guy

hollow bluff
#

ah ye

quasi flint
#

to see if ur code works properly at all

hollow bluff
#

Added a delay, the error just comes regardless

#

Can't be the method I use to load them at all

quasi flint
#

then bad code

hollow bluff
#

thanks for the kind help 👍

quasi flint
#

wouldnt make sense if it wasnt faulty code

#

could i see the piece of code that errors?

hollow bluff
#

for sure! Gimme a second

quasi flint
#

and the onEnable line 38

#

thats one linethat throws an error

crude sleet
#

Hey guys, i have a Problem: I created an entityarmorstand and put it on the player's head, the only problem is if I move over 31 blocks away from the player and then come back again, he is no longer on the head of the other player. I could of course send the packet again in the move event, but I think that's a bad solution.

hollow bluff
quasi flint
#

config existing?

hollow bluff
#

yes

quasi flint
#

as a yml?

hollow bluff
#

in the server files? yes

quasi flint
#

because there has to be smth bad going on there

quasi flint
hollow bluff
quasi flint
#

sure u called the config creation thingy?

hollow bluff
#

It should be called

quasi flint
#

should

hollow bluff
#

haha yeah... the config.yml is called at the top, the arena.yml is called right under?

quasi flint
#

well now i am completly bamboozeled

#

u readin the right config

#

i dunno if i can help

#

maybe someone else

deft patrol
#

is a block iterator or block raytrace faster?

true perch
#

I have been studying java for the last 8 months and working on a spigot plugin for the last 2 months. I've already invested about 300 hours developing the plugin and nearly everything is running smoothly. I'd love to show my code to an experienced developer to get feedback; I was thinking it would be amazing to have a one on one in a voice call to go through the code and discuss what could be improved. I have some ideas for how I can improve on the areas that aren't as fast, but I would really like to talk to someone about it. If you're interested please dm me!

unreal quartz
#

stick it on github and let the masses rip into it

true perch
maiden briar
#
net.minecraft.server.v1_16_R3.PacketPlayOutScoreboardDisplayObjective
    net.minecraft.server.v1_16_R3.PacketPlayOutScoreboardObjective
    net.minecraft.server.v1_16_R3.PacketPlayOutScoreboardScore
    net.minecraft.server.v1_16_R3.PacketPlayOutScoreboardTeam

Can somebody tell me what the fields of these constructors mean?

eternal oxide
#

Theres nothing you have written thats not been written a hundred times before.

hollow bluff
quasi flint
crisp arch
#

If i did /foo bar baz, what would the args variable contain?

unreal quartz
#

[bar, baz]

crisp arch
#

would it contain ["foo", "bar", "baz"]
or
would it contain ["bar", "baz"] -

#

oh

crisp arch
quaint mantle
#

what is a task id and how to get it

eternal oxide
#

you get teh task id when you schedule it

hasty prawn
#

Aren't task ids deprecated

#

Supposed to be using BukkitTask now

opal juniper
#

yeah but it didn’t get removed

quaint mantle
#

what is a datawatcher

#

i used as.getDataWatcher() for example

#

but now i dont have an armorstand

opal juniper
#

data watcher handles sending packets iirc

#

as in

quaint mantle
#

how to get one

vernal pier
#

Hello I am trying to allow users to input a image that my plugin will read in the config, how should I do this. Ik I can let them put in a url or file path but how do I allow both to work

exampleimage: imgur.com/... or image: plugins/image.png

opal juniper
#

when a packet needs to be sent the data watcher detects it

quaint mantle
#

what should i set here

opal juniper
quaint mantle
#

bruh

#

what should i set

#

please tell

#

i dont have armorstand

#

but i have id

#

of the armorstand

opal juniper
#

idk how to get the data watcher of an entity that doesn’t exist lol

solid cargo
#

how can i get the servers' tps

quaint mantle
opal juniper
# solid cargo how can i get the servers' tps

on spigot the only way is to crudely calculate it yourself or reflect into a private field- on paper there are tick start / finish events as well as making the last tps accessible

maiden thicket
#

table doesnt exist

golden mortar
#

How can I get the orientation of an dispenser? (or, to ask the question more broadly, how can I retrieve metadata of a block)

tribal sparrow
#

does anyone know why when i spawn a boat and add the player as a passenger it add the player but you're looking the opposite way to which you I it?

                Boat boat = (Boat) player.getWorld().spawnEntity(event.getClickedBlock().getLocation(), EntityType.BOAT);
                boat.addPassenger(player);
eternal oxide
#

you are spawning your boat inside a block

tribal sparrow
#
Boat boat = (Boat) player.getWorld().spawnEntity(event.getClickedBlock().getLocation().add(0, 1, 0), EntityType.BOAT);
                boat.addPassenger(player);
``` no its spawned 1 block above i just removed that part to post here
eternal oxide
#

Not tyhe code you showed, but ok

tribal sparrow
#

and also is checked to see if on water etc... but im just wanting to know if there is a way to add the player facing the correct way

eternal oxide
#

You are getting the location from the block so your boat will use the facing of the block, if it has one.

tribal sparrow
#

is there a way to set it to the way the player is facing?

eternal oxide
#

yes, get the direction of the player and set it to the boat

tribal sparrow
#

i'm doing it by the clicked block as i'm detecting if a player has right clicked a block from the interact event, cancelling then spawning the boat and entering the boat.

maybe i should do it from the players loc and enter the boat?

#

player.getDirection?

quaint mantle
#

what kind of black magic have hypixel used, so the player's can't even break the blocks ?

dense remnant
#

Adventure Mode

quaint mantle
#

um that doesn't make sense

#

it shows u that u r mining the block

eternal night
#

Don't they give you mining fatigue or smth

quaint mantle
#

true

#

but doesn't ur hand move slowly if u have mining fatigue ?

stone sinew
#

Without adventure mode I think.

slim kernel
#

How can I check in the InventoryClickEvent if a Player clickes on a blank space? I tried both of these:

event.getCurrentItem().getType == Material.AIR
event.getCurrentItem() == null

but somehow it doesnt work

wild reef
#

Hey quick question. I want to deny a player to interact with everything like chests aso. But when I am opening the chest from a minecart it won't get blocked. Is there a special event for these cases?

quaint mantle
#

opening chest from lore?

#

wdym

wild reef
#

interacting with a Minecart which has a chest inside it

quaint mantle
#

you can just cancel playerinteract event

#

InventoryOpenEvent?

#

you keep in mind everything that is a container

#

inventoryOpenEvent

wild reef
#

Okay I will try that, but shouldn't be the interact event like superior?

#

just wondering

mystic tartan
#

is there a character limit to the player list header?

crisp arch
#
Cannot resolve org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT
#

one sec

eternal night
#

?paste

undone axleBOT
crisp arch
#

let me post my pom

eternal night
#

👌

crisp arch
#

this is a meme plugin im making for my friend

stone sinew
crisp arch
#

dont mind the package name

#

and stuff

eternal night
#

your java version needs to be 16

crisp arch
#

<java.version>1.8</java.version> oh shoot i switched my JDK to 16

#

why is this happening

eternal night
#

shade plugin will also not work in that version against java 16

#

well your pom file is just text

#

switching your jdk won't edit that

crisp arch
#

can i just edit the java.version to 16

eternal night
#

ye

#

16

crisp arch
#

hm its not working

eternal night
#

did you apply your changes ?

quaint mantle
#

pretty sure the latest version of the shade plugin should work fine

eternal night
#

oh did they release 3.3.3

crisp arch
#

ill try again

#

oh shoot what is this

quaint mantle
#

latest snasphot version*

eternal night
#

:bruh:

crisp arch
#

how can i do that

eternal night
#

its under the "File" menu

#

for intellij

crisp arch
#

oo ok

#

i did it, its loading stuff now

#

still error

#

nothing changed

quaint mantle
crisp arch
#

didnt work

#

oo i found some logs

#
[WARNING] Failure to transfer org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT/maven-metadata.xml from https://hub.spigotmc.org/nexus/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of spigotmc-repo has elapsed or updates are forced. Original error: Could not transfer metadata org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT/maven-metadata.xml from/to spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/): Transfer failed for https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.17.1-R0.1-SNAPSHOT/maven-metadata.xml
[WARNING] Failure to transfer org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT/maven-metadata.xml from https://hub.spigotmc.org/nexus/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of spigotmc-repo has elapsed or updates are forced. Original error: Could not transfer metadata org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT/maven-metadata.xml from/to spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/): Transfer failed for https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.17.1-R0.1-SNAPSHOT/maven-metadata.xml
[INFO] Validation error:

[ERROR] org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.spigotmc:spigot-api:jar:1.17.1-R0.1-SNAPSHOT
[ERROR] Maven server structure problem

[ERROR] org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.spigotmc:spigot-api:jar:1.17.1-R0.1-SNAPSHOT
Cannot resolve org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT
#

failure to transfer some stuff

#

macos

#

ok

#

ok

#

o ok

#

i dont get it, i can create a paper project perfectly fine

#

but spigot just breaks

#

hm

#

ok it started up

#

nope

#

nothing happened

#

same errors

#

package?

#

oh wait

#

a new folder appeared in the maven sidebar

#

the "plugins" folder wasnt here before

#

ok

#

lots of stuffs downloading

#

aand
Could not transfer artifact org.spigotmc:spigot-api:pom:1.17.1-R0.1-SNAPSHOT from/to spigotmc-repo (https://hub.spigotmc.org/nexus/content/repositories/snapshots/): Transfer failed for https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.17.1-R0.1-SNAPSHOT/spigot-api-1.17.1-R0.1-SNAPSHOT.pom

#

ill go on my phone's hotspot

#

its not blocked, but

#

my school just does that

#

so i cant access it

#

hm ill go on my phone hotspot

#

change the wifi

#

ok

#

im packaging now

#

no errors so far

#
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:03 min
[INFO] Finished at: 2021-09-28T12:52:29-04:00
[INFO] ------------------------------------------------------------------------```
#

this is still here

#

yessir

#

thank you ;)

#

still lots of red squiggles in the maven sidebar but i guess it works now

#

ok, thanks so much : )

gritty urchin
#

Hey, is it possible to have multiple lines (3/4) under a player's name (not using Bukkit scoreboard) that don't lag behind or cause server lag?

crisp arch
#

and position the armor stands above or below the player's name

quasi flint
#

How can i remove my npc from the tablist?

#

its an npc made via packets

dense remnant
#

Is there a way to copy an entity but just with a different type?

slim kernel
#

Does the InventoryClickEvent even get fired if you click on an empty space

solid cargo
#

ugh... this does not work. porque?

#

also no errors in the console

quaint mantle
#

hello i have a problem with ubuntu 20.04.3, gradle and adoptopenjdk 16
when i compile my gradle project in intellij with adoptjdk 16
it is weird.
some listeners doesn't get registered
error line 113
my class is 90 lines
when i switched to windows 10 (im using grub dualboot) the problem was solved
and i opened a project created in intellij 2020 and gradle 5
what could be the problem ? if i compile with a newer version of gradle or create the project IN ubuntu will it be fixed ?

slim kernel
#

you mean the number of slot that is clicked?

#

And how can I check when someone clicks on an empty slot?

golden turret
#

how do i do something like this:

#

i have this regex: test (\S+) (\S+)?

slim kernel
#

like this:

event.getCurrentItem().getType() == Material.AIR
golden turret
golden turret
solid cargo
#

@last temple ok i added this. the Score score1 = blah blah blah thing

#

so i need more?

#

for it to work?

slim kernel
#

so its right how I did it?

solid cargo
#

but @last temple , when i watched kody Simpson, i believe he didnt add criteria

gritty urchin
solid cargo
#

like, i did manage to make a sidebear, but im struggling with the player_list

#

ok

slim kernel
young knoll
#

Item is null

tardy delta
#

can someone explain me what a CompletableFuture<T> is?

quasi flint
solar sable
slim kernel
#

@solar sable wait i think i got it

ivory sleet
solar sable
quasi flint
#

Own

solar sable
#

well how are we supposed to know if its your own?

#

show the info or something to let us see how to remove it

quasi flint
#

Gimme a quick sec

solar sable
quasi flint
#

this is how i send the packets to the player

solar sable
#

this is like the carpet mod lmao but anyways

#

so maybe

#

wait

#

you havent made anything to remove it yet right?

#

like a command to remove it or something

quasi flint
#

Yea i Made it

#

Just acouple lines below it

#

Sende the PacketPlayOutDestroyEntity

#

Or what ITS called

#

Not in PC rn

solar sable
#

hmm

quasi flint
#

And the EnumPlayerInfo.Remove_Player

solar sable
#

well have you tried /kill @e yet?

#

because if the command doesnt work then idk what does

quasi flint
#

Not completly remove it

#

Just hide it in the tablidt

#

The removing Part already works

solar sable
#

aah

quasi flint
#

But it completly

#

Without the way of only deleting it out of the tablist

solar sable
#

well most of plugins online like citizens and such, do have that type of stuff when you are far away from the npc and then goes back to it, it loads in the name in the tablist and then dissapear

#

well im not an expert in this, so i will let an expert take handle of this situation

ivory sleet
#

Imagine if minecraft just would add native npc support

quasi flint
#

So they do it somehow

quasi flint
solar sable
#

cries in java

ivory sleet
#

🥲

quasi flint
#

So nobody knows the answer for it?

solar sable
#

just wait until an expert of this type to respind

#

respond*

ivory sleet
#

Yeah, create a thread maybe

solar sable
#

yuh

quasi flint
#

Ok will do

solar sable
#

how to detect when a player chat in mc?

quasi flint
#

Delete Packet NPC only out of Tablist

#

First thread I ever made ;7

solar sable
ivory sleet
quasi flint
#

.contains and so on

solar sable
#

aah

#

okie doke

#

also i asked this before but it didnt work so imma ask it again, how to set a hover event using just basic java language and not json format

quasi flint
#

What in god's name is a hover event

solar sable
#

cause i want to make it when i join it just puts a hover event saying something like "hello"

solar sable
#

what about click event?

quasi flint
#

Well that sounds more familiar

solar sable
#

hover event is just basically

#

shows a text above a text

#

so like "hello" and then when you put your mouse over it, it shows a text

quasi flint
#

No clue tho sorry :c

solar sable
#

component builder?

ivory sleet
#

Yessir

#

?bc-c

#

1 sec

solar sable
#

whats that?

ivory sleet
#

?bcc

#

A command

#

Supposed to work

solar sable
#

i mean like whats a component builder lol

ivory sleet
#

?jd

ivory sleet
#

Oh

quasi flint
#

But no workin

ivory sleet
#

Here

#

Find the ComponentBuilder

#

It’s basically a class to concatenate components

solar sable
#

uh okay

#

does it have anything to do with hover event?

ivory sleet
#

Indeed

solar sable
#

GOT IT!

#

time to leaarn

ivory sleet
#

Well easiest way to do what u want is something like
BaseComponent b = new TextComponent("text");
b.setHoverEvent(HoverEvent(HoverEvent.Action.SHOW_ITEXT, new Text("hover text")));
player.spigot().sendMessage(b);

#

I think

ivory sleet
#

Typed on phone so yeah

tardy delta
#

aha a thing that will be completed at some time

solar sable
ivory sleet
#

Well

solar sable
#

ill check on intellij and see if it understands it lol

ivory sleet
tardy delta
#

mmmmh

#

sounds difficult

ivory sleet
#

Not at all

#

Have you messed with streams?

tardy delta
#

uhh no?

ivory sleet
#

Stream<T>

#

no?

tardy delta
#

wdym messed?

ivory sleet
#

Used them

#

In your code that is

tardy delta
#

well just .stream()

ivory sleet
#

Because streams also have a lot of similar methods to completablefuture

#

Main difference is that streams are for processing a sequence, whilst completablefuture process a single value with the help of your callbacks (usually on another thread)

tardy delta
#

mmh

#

and what is a callback?

#

i heard of it but i dunno exactly what it is

solar sable
#

damn theres so many error in this just hurts my brain tryna think

ivory sleet
#

Technically every method you declare is a callback

#

It’s a function which at some point later gets called back when some event happens

#

In async context it could be when a large computation is done

#

Or when a file is downloaded

#

Etc

solar sable
#

well this is a mess because i dont get this

ivory sleet
#

You sure don’t

#

new HoverEvent(...)

#

Forgot the new before HoverEvent(

#

And

#

That needs to be inside a method most likely

solar sable
#

hmm

#

by method you mean like?

ivory sleet
#

No

#

A method as the term in Java

#

?learnjava

undone axleBOT
ivory sleet
#

I believe one of those sites cover it

#

Or in fact all of them

hasty jackal
#

I think you'd be hard pressed to find a resource for learning java that doesn't cover methods

ivory sleet
#

Yeah lol

solar sable
#

oh i managed to fix it a bit

#

but

#

there still an error in the player.spigot() and i changed from player to "e"

#

managed to do this

ivory sleet
#

I’m confused that it works

solar sable
#

im confused on what to change .spigot to

ivory sleet
#

e.getPlayer().spigot()

solar sable
#

fixed now?

#

wait i made it e.getPlayer().spigot().sendMessage(b);
will that work or no?

quiet ice
#

Does some random gradle fanboy know how to fix

Could not download annotations-19.0.0.jar (org.jetbrains:annotations:19.0.0)
Could not get resource 'https://repo.maven.apache.org/maven2/org/jetbrains/annotations/19.0.0/annotations-19.0.0.jar'.
Could not HEAD 'https://repo.maven.apache.org/maven2/org/jetbrains/annotations/19.0.0/annotations-19.0.0.jar'.
The server may not support the client's requested TLS protocol versions: (TLSv1.2). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.1/userguide/build_environment.html#gradle_system_properties
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
unable to find valid certification path to requested target
[...]
ivory sleet
#

Send ur build script (:

quiet ice
ivory sleet
#

Understandable

astral imp
#

how do you hide the "No Effects" on a potion?

#

Is that an item flag?

hasty jackal
#

unable to find valid certification path to requested target
that sounds more like a cert issue than a gradle issue. but the root cert I get should definitely be in the root store

solar sable
#

holy sh- @ivory sleet it works aaahh im screaming inside my self conscious!!

#

aaaahhh

ivory sleet
quiet ice
hasty jackal
#

well it could also just be that one of the certs in your personal cert store got removed (for whatever reason), though obviously very unlikely

quiet ice
#

Firefox is able to download it without much issues directly, is gradle using a seperate cert store or something?

hasty jackal
#

most browsers have their own cert store, yes

quiet ice
#

RIP, in that case porting that mess over to maven would be my only solution

hasty jackal
#

the other alternative I could think of is that some caching issue was present and the wrong cert got served (like an ad-hoc self signed one)

#

I don't think that maven will make any difference; if it requests the same location of the library using the same java version, it would result in the same problem

#

unless it's a temporary issue

quiet ice
#

it could help that I'm using IntelliJ to build it - perhaps that is the issue

solar sable
#

anyone know how to put a player's name at the end of the line?

quiet ice
#

trying it out standalone, perhaps the most obvious thing is the thing to break

hasty jackal
#

I mean it does often run using it's own bundled JRE which might have that pooped cert store

quiet ice
#

yep, it's IntelliJ being broken. Guess a reinstall is all I can do

ivory sleet
#

oh rip lol

#

weird that issue never happened to me

hasty jackal
#

I guess it wasn't so unlikely after all heh

ivory sleet
#

geol using IntelliJ 😮

quaint mantle
#

Eclipse pfp
Uses intellij

#

eclipse is shit in everything

quiet ice
#

I'm kinda forced to when it comes to using kotlin gradle.

ivory sleet
#

fair

quaint mantle
#

it has like no good themes, the code completion is non existent

quiet ice
#

Minimal code completion is best

solar sable
#

oh wait nvm

quaint mantle
#

you're high

solar sable
#

i think i already figured it out

ivory sleet
quiet ice
#

Wat

carmine nacelle
#

are entity IDs persistent through reload/restart?

ivory sleet
#

nope

carmine nacelle
#

F

#

ok i have another way

quaint mantle
quiet ice
#
Could not download commons-lang-2.6.jar (commons-lang:commons-lang:2.6)
Could not get resource 'https://papermc.io/repo/repository/maven-public/commons-lang/commons-lang/2.6/commons-lang-2.6.jar'.
Could not HEAD 'https://papermc.io/repo/repository/maven-public/commons-lang/commons-lang/2.6/commons-lang-2.6.jar'.
papermc.io: Name or service not known

yep, IntelliJ is def. broken

ivory sleet
#

oh like
code inspections - finds issues in your code, for instance "turn anonymous functional interface instantiation into lambda"
code gen - when you press enter at the end of { it'd gen a }

carmine nacelle
#

is there a way I could like..."inject" data into a beehive's custom data? like if I wanted to keep track of how many bees the hive had and stuff

quiet ice
ivory sleet
#

havent used eclipse since the last blue moon so cant tell which one excels here

quiet ice
#

I was talking about stuff like auto-completing entire sections of code, i. e. "machine learning"

ivory sleet
#

oh

#

yeah those are often somewhat too aggressive imo

quiet ice
#

Okay, Imma try using raw ip addresses, let's see if intelliJ can handle that at least

ivory sleet
#

will be interesting

native nexus
#

It's hard to convince a person who has their pfp as the eclipse logo to switch to IntelliJ

hasty jackal
#

I mean you could try changing the boot runtime of intellij idea to fix it 🙃

quiet ice
#

At least some success there

#

declared mavenLocal, now it's down to a single depend that I'll likely have to build myself

trail remnant
#

am i doing something wrong? i followed the directions on the vault api page, i did https://pastebin.com/ZzKS75fz in my main class and in another class im doing main.getEconomy().depositPlayer(p, Double.parseDouble(args[1])); and im getting this error Caused by: java.lang.NullPointerException at com.abk.commands.economy.ecogive.onCommand(ecogive.java:119) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.16.5.jar:git-Paper-786]

quiet ice
#

main or main.getEconomy() is null. Please use Java 15 or higher for extended troubleshooting

trail remnant
#

.... i cant...

#

and how could they be null with my code?

quiet ice
#

they have to be

#

If you were using J15 it would be openly yelling at you what's null

#

Did you call #setupEconomy anyways?

trail remnant
#

yeah in the code i sent? thats everything that involves vault

quiet ice
#

You declare that method, yes, but you don't call it from the code you sent

trail remnant
#

wdym by "call"?

eternal oxide
#

line 3 you are returning true, it should be false

quiet ice
#

Invoke, run, whatever you call it

carmine nacelle
#

Whats the right way to stop the player interact event firing twice? if(event.getHand().equals(EnumWrappers.Hand.OFF_HAND)) return; doesnt seem to be working

trail remnant
#

invoke run...? what

quiet ice
#

Do you have something like myPluginInstance.setupEconomy()?

trail remnant
#

uh no

quaint mantle
#

thats why

#

its never called

#

hence its null

quiet ice
#

well, it's needed otherwise econ will stay uninitalized

trail remnant
#

but dont i just call it from my command? main.getEconomy().depositPlayer(p, Double.parseDouble(args[1]));

quiet ice
#

no, you call getEconomy() with will just return econ

#

as such you can just short-circuit it with main.econ.depositPlayer(p, Double.parseDouble(args[1]));

#

if econ is never set to a value, it will be null, thus throwing a NullPointerException

trail remnant
#

i did what you sent and in intellij it just shows up in red with no context

quiet ice
#

That's because it's likely not valid code and I just made it to simplify it for you

#

You should be doing it the way you did it before, but initalize econ properly

ashen flicker
#

Make sure you either A have a static instance of main that you’re using, or B, you’re properly passing around the main instance. If you do that, and the economy is already set up. You should be fine.

trail remnant
#

i already do if this is what you mean private static Economy econ = null;

quiet ice
#

Sigh

wicked fulcrum
#

guys can i use always static or its bad?

ashen flicker
#

That doesn’t need to be static if your main instance is

quaint mantle
#

its bad to use all the time

quiet ice
#

Just add setupEconomy(); at the top of your onEnable()

solar sable
#

i need help

quaint mantle
#

player.getName()

quiet ice
solar sable
ashen flicker
#

Static isn’t always bad, it had a purpose other wise it wouldn’t exist. It’s good for functional programming, not everything has to be OO.

quaint mantle
#

idk what you're on about imma simplify this
in main @trail remnant

// onEnable method
this.setupEconomy();

Command

private final MyPlugin plugin;

public MyCommand(MyPlugin plugin) {
    this.plugin = plugin;
}

// Command method
plugin.getEconomy().// whatever
quiet ice
#

^

trail remnant
#

ok ill try it thanks

ivory sleet
quaint mantle
carmine nacelle
quaint mantle
quiet ice
quaint mantle
#

also that

quaint mantle
solar sable
#

it only gives me e.getPlayer()

quaint mantle
quaint mantle
solar sable
#

oh wow that was easy to fix

#

Thanks to all of you! <3

ashen flicker
#

Yea I use the singleton pattern in my plugins. I like it

quaint mantle
#

I transfer the Config||.java|| to the class, and then I work with this class, it already has a built-in method for reloading the config, as well as receiving messages from it

trail remnant
#

all i did was add what you said this.setupEconomy(); and i tried to use plugin.getEconomy() but intellij auto corrected back to what i originally had, main.getEconomy() and it still isnt working, same errors

quaint mantle
# quaint mantle what if you wanna reload the config
public class Config {
    private final Main pl;
    private final FileConfiguration config;
    
    private String playersOnly, usage, testMessage;

    public Config(Main pl, FileConfiguration config) {
        this.pl = pl;
        this.config = config;

        reload();
    }

    public void reload() {
        pl.saveDefaultConfig();
        pl.reloadConfig();

        playersOnly = config.getString("players-only");
        usage = config.getString("usage");
        testMessage = config.getString("test-command.message");
    }

    public String getPlayersOnly() {
        return color(playersOnly);
    }

    public String getUsage(String label) {
        return color(usage).replace("%command%", label);
    }

    public String getTestMessage() {
        return color(testMessage);
    }

    private String color(String s) {
        return ChatColor().translateAlternateColorCodes('&', s);
    }
}
public final class Main extends JavaPlugin {
    @Override
    public void onEnable() {
        Config config = new Config(this, getConfig());

        Objects.requireNonNull(getCommand("test")).setExecutor(new TestCommand(config));
        Objects.requireNonNull(getCommand("suicide")).setExecutor(new SuicideCommand(command));
    }
}
public record TestCommand(Config config) implements CommandExecutor {
    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (!(sender instanceof Player p)) {
            sender.sendMessage(config.getPlayersOnly());
            return true;
        }
        if (args.length < 1) {
            p.sendMessage(config.getUsage(label));
            return true;
        }
        
        config.reload();
        p.sendMessage(config.getTestMessage());
        return true;
}}
#
@Getter
public class Messages implements ConfigFile {
    private final String prefix = "Hi";

    @Getter(AccessLevel.PRIVATE)
    @IgnoreField
    private final Plugin plugin;

    public Messages(Plugin plugin) {
        this.plugin = plugin;
    }

    public void loadConfig() {
        try {
            YmlGenerator.generateConfig(plugin, this);
        }
        catch (IllegalAccessException | IOException exception) {
            Logger.log("&4Cannot load config! Report this to the Discord server:");
            exception.printStackTrace();
        }

    }

    @Override
    public @NotNull String getName() {
        return "messages.yml";
    }
}

GalaxyLib 😩

undone axleBOT
ashen flicker
#

Do you understand instances? ABK? It will be difficult for you to solve your problem if you don’t

quaint mantle