#help-development

1 messages Β· Page 2025 of 1

worn tundra
#

Inside configuration

#

Specify this:

<outputDirectory>PathToYourFolder</outputDirectory>```
midnight shore
#

i did that but nothing popped out in the folder

#

@worn tundra

worn tundra
#

What command do you use

#

To run maven

midnight shore
#

and then i build the plugin using IntelliJ artifacts

midnight shore
#

now it dropped this WilloCore-1.0-SNAPSHOT-shaded.jar

echo saddle
#

anyone know if the protocol was changed in 1.18.2?

sharp flare
#

when was Tag.ITEMS_MUSIC_DISCS added? what spigot version, etc helps

smoky oak
#

they definitively chamged something ...

#

i just know it broke datapacks

echo saddle
#

so it's like v1_18_R2?

young knoll
#

Yes 1.18.2 is a new NMS version

sharp flare
#

appreciate it

echo saddle
#

okey, thx

dapper ether
#

.

tender shard
dapper ether
#

{}

quiet ice
#

!!!

tender shard
#

fun fact:

if(true) {
  System.out.println(";");;;;;;;;;;;;;
;;;;;
} ;;;
``` is valid, but
```java
return true;;

is not

dapper ether
#

nice

#

what is the meaning of an integer

#

the word it self?

tender shard
#

"whole number"

dapper ether
#

no

#

i mean the word

#

from what language

#

like String

tender shard
#

its latin

dapper ether
#

string in englisch

tender shard
#

it means whole number

dapper ether
#

ohh

#

thanks

tender shard
#

numerus integer = "number of integrity" = not just a fraction or sth πŸ™‚

drowsy helm
#

pretty sure string is because it is an ordered set of characters

#

dont quote me on that

dapper ether
#

And why Foo?

drowsy helm
#

ive got no clue actually

tender shard
#

ugh FML, I am wondering since hours why my base64 decode isnt working

#

then I found this somewhere in the class

#
baseXX = baseXX.substring(4);
cold field
#

Heya guys, question. I need to patch a plugin but it requires as dependency spigot-src how do I install that? Using some sort of buildtools'flag? https://i.imgur.com/3DTW2XD.png

tender shard
#

just remove it

#

never seen that before

#

is that the source code?

cold field
#

It's the pom

tall dragon
#

any1 any ideas?

tender shard
cold field
#

Hum okay. ty.

tender shard
#

I'm using a HttpUrlConnection with a URL like "https://1.2.3.4/". of course that throws an exception since I only got certificates for domain names, any idea on how to ignore the SAN mismatch?

#

erm wtf a I stupid or blind?

enum WhitelistHostnameVerifier implements HostnameVerifier {
    // these hosts get whitelisted
    INSTANCE("localhost", "sub.domain.com");

    private Set whitelist = new HashSet<>();
    private HostnameVerifier defaultHostnameVerifier =
            HttpsURLConnection.getDefaultHostnameVerifier();

    WhitelistHostnameVerifier(String... hostnames) {
        for (String hostname : hostnames) {
            whitelist.add(hostname);
        }
    }

    @Override
    public boolean verify(String host, SSLSession session) {
        if (whitelist.contains(host)) {
            return true;
        }
        // important: use default verifier for all other hosts
        return defaultHostnameVerifier.verify(host, session);
    }
}

HOw is the INSTANCE(String, String) line supposed to work? shoudln't it be something like WhitelistHostnameVerifier INSTANCE = new WHielistHostnameVerifier(String, String) instead? o0

hybrid spoke
vocal cloud
#

You mean the material?

#

Why not get it from the itemstack?

undone axleBOT
main dew
#

?jd-s itemstack

undone axleBOT
main dew
#

This isn't working πŸ˜…

quaint mantle
#
                            <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                            <srgIn>org.spigotmc:minecraft-server:spigot-1.18.2-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
                            <remappedDependencies>org.spigotmc:spigot-1.18.1-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
                        </configuration>

Could not find artifact org.spigotmc:minecraft-server:txt:maps-mojang:spigot-1.18.2-R0.1-SNAPSHOT in spigot-repo

#

i forgot how to do mapping and remapping

#

can someone help me with 1.18.2

quiet ice
#

Did you Run buildtools yet?

quaint mantle
#

java -jar BuildTools.jar --rev 1.18.2 --remapped ?

#
<configuration>
                            <srgIn>org.spigotmc:minecraft-server:spigot-1.18.2-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
                            <reverse>true</reverse>
                            <remappedDependencies>org.spigotmc:spigot:spigot-1.18.2-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
                            <remappedArtifactAttached>true</remappedArtifactAttached>
                            <remappedClassifierName>remapped-obf</remappedClassifierName>
                        </configuration>
#

this is the other part of it

tender shard
#

I have changed the code to a normal class

#

and totally forgot that the code I orignilly copied was an enum

sacred mountain
#

whats better to get the majn class instance?

private final Main plugin;

public className(Main plugin) { this.plugin = plugin; }```

or ``Main.getInstance();`` with the main class being 

```java
static Main instance;

public static Main getInstance() { return instance }

@Override
public void onEnable() { instance = this } ```
tall dragon
#

the former

patent quarry
#

Hey is there an existing method to simply run the chorus fruit "effect" (the random teleportation) ?

tall dragon
#

probably not in the api

#

but its pretty easy to recreate

sacred mountain
tall dragon
patent quarry
#

Yes ty, just want to be sure that there is not an existing method in the API πŸ˜‰

sacred mountain
#

thanks

#

What about Main plugin = Main.getPlugin(Main.class);

eternal night
#

that has the same issues (if not more) than the 2nd one

sacred mountain
#

yeah mk

#

thanks as well

main dew
#

How I can update libraries in spigot? I should use BuildTools?

vivid egret
#

experienced plugin dev, dm me if you are available for a job :))

sacred mountain
#

are you asking people here or are you the experienced dev

#

also ask on the forums not here

vocal cloud
#

99% chance It's not a job worth working

sacred mountain
#

iirc theres a thread collection called hiring developers on the main forums page

#

i think most do it for experience

tender shard
#

does someone know how the "Nag author of XYZ for using stdout" message works?

sacred mountain
#

wht

tender shard
#

I wonder how the server detects when someone uses stdout

sacred mountain
#

idk ive never seen that lol

tardy delta
#

if i just create a new logger in my application using java.util.logger.Logger logger = Logger.getLogger("some name"), and i call logger.info("test") will that log something to the stdout or do i need to add a handler?

#

seems to work without console handler

eternal night
dire salmon
#

😳

tardy delta
#

is SSS the millis?
HH:mm:ss.SSS

rough drift
#

yep

#

but it should be SSSS

#

iirc

vocal cloud
tardy delta
#

:o

quaint mantle
#

Minecraft services down for anybody else?

#

Cant test anything while that happens

next stratus
crude loom
#

When I choose a mod platform (Spigot or Bukkit) does that mean that it will only work on the specific server type?
For example if I choose bukkit will it only work on bukkit servers?

tardy delta
#

do people put their public static void main above the constructor or are there no rules for it?

tender shard
#

I usually put it into a new class

#
package com.jeff_media.discordspigotupdatebot;

public final class Main {
    public static void main(final String[] args) {
        new DiscordSpigotUpdateBot(args);
    }
}
tardy delta
#

oh ye

tender shard
#

and then I let maven generate the manifest so one can just use java -jar ...

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <finalName>discord-spigot-update-bot</finalName>
                    <archive>
                        <manifest>
                            <mainClass>com.jeff_media.discordspigotupdatebot.Main</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
tardy delta
#

dunno what that is

tender shard
#

when you put your staff into a .jar, you normally have to pass the class name containing a main method

tardy delta
#

so it can find the main class?

tender shard
#

e.g.

java -jar discord-bot.jar com.jeff_Media.discordspigotupdatebot.Main
tardy delta
#

ah doesnt intellij automatically do that when you made a main method?

tender shard
tardy delta
#

oh

tender shard
sharp flare
#

is there any way to check if jukebox is done playing a music disc

tardy delta
#

ye

tender shard
#

a jukebox is never "done" playing

#

it only has two states: disc inserted, and no disc inserted

sharp flare
#

well thats unfortunate

tender shard
#

what are you trying to do?

sharp flare
#

its a jukebox player, it can loop disc in the slots after playing the current disc

tender shard
#

ah like my JukeboxPlus plugin

sharp flare
main dew
#

Mojang API stop working?

tender shard
#

yeah but as said, you can't check if it's done playing. the jukebox doesn't know anything about the inserted disc

tardy delta
#

logger doing crazy things

main dew
sharp flare
#

thanks though, I guess the player has to click the arrow manually

main dew
#

namemc work for me but mojang api don't work

tender shard
#

while one might have normal stal sound for stal disc, another player might have that sound replaced with a 6 hour opera song lol

quaint mantle
#

Just wait

sharp flare
#

yeah fair, would be dope if #getCurrentDuration method exist

main dew
#

a oke ':D

tender shard
#

does someone know a good IDE for iOS apps that also runs on windows? I'm paying >60€ per month for a mac mini server and I'd like to stop having to pay that lmao

tender shard
sharp flare
#

aight thanks i'll just make it manual

tender shard
#

seems like the backend server is down

tardy delta
#

lol Logger#setUseParentHandlers fixed my issue

main dew
tender shard
#

it took me a minute to load lol

dire marsh
#

maybe they're trying to disable mojang accounts and failing bad lol

tender shard
#

?userinfo @tender shard

undone axleBOT
#

Chilling in offline status

Joined Discord on

<t:1570988034>
(<t:1570988034:R>)

Joined this server on

<t:1647393867>
(<t:1647393867:R>)

Roles

<@&690689768996208726>, <@&695824786605080576>

dire marsh
#

they said you'd be forced to migrate from march 10th but you've still been able to use mojang accounts for days

tender shard
# undone axle

Uuuugh it says I joined today >.< my userinfo is broken

tardy delta
#

joined this server 12 hours ago

tender shard
#

yeah I was perma banned

vocal cloud
tardy delta
#

aa πŸ‘€

dire marsh
#

ban evasion wtf

tender shard
#

I got unbanned after 45 minutes lol

dire marsh
#

we all know you hacked md_5 to unban yourself

tardy delta
#

what did you do?

tender shard
tardy delta
#

kekw

vocal cloud
#

Someone mistyped a >ban again

tender shard
#

someone reported my messages and the mod who banned me didnt read the entire context of the messages lol

tender shard
#

oh wait, now it's offline again lmao

dire marsh
#

smh mojang

#

you thought disabling mojang accounts was that easy? you fools

sharp flare
#

hey alex, how do u loop the disc just like in ur jukeboxplus plugin, very dope plugin

hasty prawn
quaint mantle
#

most likely fixing bugs or adding/removing features

rough drift
#

mojang servers are down

tender shard
#

don't wanna connect it to my monitors everytime I wanna work on an app

#

I usually only need the server for 2-3 weeks and then I cancel the server until I do a new app

#

unfortunately the setup fee is also one month's fee lol

#

so I usually pay ~120€ every other month. maybe I should really get my own mac mini and a keyboard/hdmi switch etc

hasty prawn
#

Yeah definitely should.

#

Gotta love how Apple basically forces the use of their hardware

viral crag
#

really depends on the language you are working in, but most should have cross compiler or remote compiler support

#

Apple says Xcode

hasty prawn
#

XCode is what most iOS devs use iirc

#

Only runs on MacOS though lol

viral crag
tender shard
#

in a VM?

river oracle
#

Make your own ide

tender shard
tender shard
#

I am still upset

river oracle
#

Uh oh

viral crag
hasty prawn
#

Lol what happened

tender shard
#

I'll let the real pros create IDEs lol

tender shard
viral crag
#

setting up a crosscompiler?

river oracle
#

Intellij πŸ‘Ž
Plain text file πŸ‘

viral crag
#

yeah that too

tender shard
#

btw does Dreamweaver still exist?

#

I remember how I used Dreamweaver for all my websites but now I've switched to PhpStorm

#

dreamweaver was awesome

#

but it got too expensive

viral crag
#

think adobe rolled it into one of their other programs

river oracle
#

For my websites I use Nano text editor

tender shard
#

how else would you do website stuff / APIs etc? πŸ˜„

#

uuugh

viral crag
#

ruby, rails, asp, rust , etc etc

tender shard
#

no thinks, I'll rather stick with PHP

#

also did you just tell people to use ASP?!

#

propriatory microsoft shit?

#

although PHP was a huge mess, PHP8 is a lot better

viral crag
#

i did not tell anyone to use anything, just that they exists

rough drift
#

Robux: 0.125 USD
Ruble: 0.0093 USD

#

Lmfao

tender shard
#

I mean PHP is totally fine, the only bad thing about PHP is the weird method names

tender shard
rough drift
#

you can buy stuff with BTC

quaint mantle
#

True

tender shard
#

sure you can but there's no guarantee it will be worth anything in the future

quaint mantle
#

Also true

tender shard
#

most real currencies are bound to some "real" values like hundreds of tons of gold the issuing bank has laying in a safe somewhere

river oracle
#

Minecoin to usd

rough drift
#

bro its worth almost as much as a ruble

#

lmao

viral crag
tender shard
#

my next ios app will be a blood alcohol calculator lol

#

for 0.99$

viral crag
#

whitebox

tender shard
#

there is no decent one so I hope some people will buy it

rough drift
#

should i save up for a mac laptop or get one from like dell or smt

viral crag
river oracle
#

Dell laptops 😐

tender shard
#

depends whether you want to use mac

rough drift
#

no i don't have money to waste lmao

tender shard
#

mac is really awesome, if you have the money

#

if you don't have so much money, obviously it's not worth it

viral crag
#

then business/game class laptop - avoid retail/consumer

tender shard
#

it's like a normal car vs a mercedes. ofc mercedes is way more pricy but it's also more comfortable. if you only have 50k€, you probably don't wanna spend 45k€ on a car, but if you have half a million, you'd probably get the mercedes lol

rough drift
tender shard
#

I got two macbooks and I used to have an iMac and it's really a way better experience than windows

viral crag
#

they are mass produced and disposable in large

tender shard
viral crag
#

a low-end business class is better than any high-end retail

#

you will easily get 5+ years out of a business/game class device. retail, maybe 3 years

rough drift
#

I can actually almost buy the left one lmao, but i probs won't

rough drift
#

game class like gaming laptop or what

#

business is like

#

the one ppl carry in briefcases?

viral crag
#

when you go to a site you will see the different categories

#

business and game will have higher class of cpu, ram speed, graphics, etc

rough drift
#

ohhhhhhhhhhhhh

#

i guess they are more pricy than consumer?

viral crag
#

a bit, they also tend to have longer warranties and upgrade support

rough drift
#

since consumer is probs the chromebook shit that schools get right?

viral crag
#

consumer is usually what you see in stores with a few game systems sprinkled in

rough drift
#

ohhh

viral crag
#

so they usually have low performing components where the manufacturer cut costs

tender shard
#

macs are awesome for many stuff including coding, music production, video editing, photoshop, ...

viral crag
#

yes/no

tender shard
#

show me another laptop with builtin ASIO

viral crag
#

the cult is strong and delopers like the cult because they spend money

rough drift
#

i mostly code or play games

#

sometimes i stream on twitch but i gotta check if my new internet can handle it (old internet couldn't)

tender shard
#

yeah for gaming you can forget them

rough drift
#

k

#

any suggestions on what to get

#

ohk

#

ty

viral crag
#

write down what you need it use it for (specific applications etc), then match components to your use

#

since you said programming, i'd suggest a builtin+extra graphics support

tender shard
#

I've looked for a way to get Http requests from websites directly using the IP, so without valid certificate, and it turns out it was way easier than I though - just create a new HostnameVerifier that returns true:

public final class WhitelistHostnameVerifier implements HostnameVerifier {

    private Set<String> whitelist = new HashSet<>();
    private HostnameVerifier defaultHostnameVerifier =
            HttpsURLConnection.getDefaultHostnameVerifier();

    WhitelistHostnameVerifier(String... hostnames) {
        whitelist.addAll(Arrays.asList(hostnames));
    }

    @Override
    public boolean verify(String host, SSLSession session) {
        if (whitelist.contains(host)) {
            return true;
        }
        // important: use default verifier for all other hosts
        return defaultHostnameVerifier.verify(host, session);
    }
}

viral crag
#

mmm will that work on IPv6?

tender shard
#

sure

#

"host" in this case ia not an IP but the actual hostname

viral crag
#

IPv6 rarely resolves to a hostname

tender shard
#

that's not what it's about

#

it works like this:

#

so that's what my above class is for

viral crag
#

aside from the security problem, yeah that works and makes sense

#

security problem being that you just whitelisted every account on that IP if its a host

#

not a big issue if the host is decent

red sedge
#

how can i make a static variable for every class that extends my class

viral crag
#

why static? you can make an enum if it never changes

red sedge
#

Okay so

tender shard
#

because obviously static means part of THIS class

red sedge
#

yeah that checks out

#

ig ill just put the statics into the classes that extend it

tender shard
#

what are you actually trying to do?

red sedge
#

I need to store a hashmap

#

i need it static cuz i want that hashmap to be unique only for that type of class

tender shard
#

RIP, my java book doesn't cover reflection

worldly ingot
#

Yeah so you're going to need a new Map for each sub type

tender shard
#

yep

#

yeah kinda

worldly ingot
#

which should really be avoided if possible

tender shard
#

of course, I just wanted to read something about it because I'm bored

#

if you can avoid reflection, you should avoid it

#

but sometimes it's just needed

#

e.g. to create a generic array

worldly ingot
#

A generic array?

#

You mean an array list? lol

#

bonus, it's resizable!

tender shard
#

nah I actually mean arrays lol

#

like a <T> method(T something) that returns a T[]

#

also fuck java 9, RIP this is no longer possible

Function<String, String> function = __ -> "Test"; 
worldly ingot
#

Why not?

worldly ingot
#

String[]::new

tender shard
viral crag
#

hmm, perhaps that is why 1.17+ broke reflections with java 16

tender shard
#

no idea why

worldly ingot
#

Ah, right

tender shard
#

I always used __ if I didn't actually need the lambda variable

#

but I still use java 8 anyway for most stuff so I'm fine lol

rough drift
#

bro why

#

java 17 is so much better

tender shard
#

to avoid one star reviews saying "why plugin no workings"

#

yeah sure java 17 is better, of course

rough drift
tender shard
#

but also the changes they added aren't that important for me that I'd actually see the need to update

#

well

#

java 8 is longer supported than java 17

#

java 8 is in no way dead

worldly ingot
#

They intend on using the underscore for language features in the future so they're discouraging its use

viral crag
#

the _ might have to do with preprocessor or linker changes

tender shard
worldly ingot
#

I tend to name it "ignore"

tender shard
#

my java books tells people to name it like the class if it's unused

Consumer<String> stuff = String -> System.out.println("I don't need the variable");

or __ when using java 8

#

yeah ignored is better lol

worldly ingot
#

Yeah that's a bit clearer than naming it a class name

#

I do wish we could use underscores though as I thought that was going to be a feature, nameless functional interface parameters

#

e.g. (_, _, _, something) -> System.out.println(something) being valid

tender shard
worldly ingot
#

I think JS does allow that though

#

The lambda feature I mentioned, that is

#

Or maybe I had always done (_, __, ___)

tender shard
#

that might be true, I only know the veeery basics of js lol

worldly ingot
#

I can't remember

tender shard
#

like I can make a browser copy a text if you click on some text, that's about all I can do lmao

ancient plank
#

js is demonspawn

tender shard
#

someone please suggest me some java features on which I could read stuff about

#

If two people eat at the same time, that's parallel, but when someone eats and breathes, that's what it looks like from the outside at the same time, but it's not, but swallowing and breathing are sequential
lol

ivory sleet
#

Java’s concurrent package (:

#

Very useful to be knowledgeable about

tender shard
#

alrighty!

golden turret
#

hello

#

i want something similar to ray trace

#

but i dont want to use the rayTrace method

#

because it would loop in all entities in the world

#

and i am using the EntityDamageByEntityEvent so i already have the entities i want

#

how could i do something like the rayTrace?

#

?jd

golden turret
#

will that method do this

#

or this

worldly ingot
#

It can do both

narrow stag
#

Hi, i have question about how to make search system with gui.
So this what i mean:
You click a slot, inventory closes, you are name a player that you're searching for in chat, and then it opens the GUI to the page of that player with details for example health.

#

Is there a code or something : )

worldly ingot
#

You give it a start, direction, and distance. If it intersects with the bounding box you'll see it in the result

narrow stag
#

i found one but i didn't understand anything

#

Its:

buoyant viper
narrow stag
quaint mantle
#

Do you know how to add a custom texture to a custom item in a plugin?

golden turret
worldly ingot
#

You give it a start, direction, and distance.

#

(x, y, z) -> (dx, dy, dz), distance in blocks

#

If you give it 0, 0, 0, and a direction of 0, 1, 0, it's going to go from 0, 0, 0 upwards to whatever distance you give it

narrow stag
worldly ingot
#

Imagine shooting a bow in Minecraft. It starts from your player's eye location (roughly), and uses the direction you're looking. The arrow is pretty much your ray trace, only it doesn't arc like an arrow does. It just goes straight

viral crag
#

if it does not work, it would not be in the api

eternal night
#

what lib is that o.O

viral crag
#

are you using a plugin that manipulates packets?

#

yeah, then you are doing what it says

#

my guess is whatever your listener is doing it does not like

eternal night
#

your packet adapter

#

you need to overwrite the onPacketReceiving and onPacketSending method

#

welp find out which one you failed to setup

#

and is one not overwriting the onPacketSending method

vague swallow
eternal night
#

that is the point

#

LOL

heavy void
#

What java version do i use when creating plugins to do a multi-version plugin between 1.8 - 1.18

eternal night
#

they all HAVE to have that method

eternal night
#

if you register them for outgoing packets

heavy void
viral crag
eternal night
#

if you register a PacketAdepater for packets send from server to client then your adapter needs to overwrite onPacketSending

heavy void
smoky oak
#

anyways
does anyone here (choco cough cough) know how to get the (visual) hitbox of a raised shield?

viral crag
#

imo it usually a waste to try and support 1.8

heavy void
#

If i create a plugin with java 17, 1.8 - 1.18 will can run it?

viral crag
#

no

abstract sleet
#

i thought yes?

viral crag
#

well I shouldnt say that. as long as you use java 8 conventions taht still exist in 17 and do not force requirement it might work

eternal night
#

Class version would still error

abstract sleet
#

java is forwards compatible but not backwards compatible.

viral crag
#

thats a lot of broken stuff to try and emulate

eternal night
#

since when is java forwards compatible πŸ˜‚

abstract sleet
eternal night
#

that is backwards compatibility

#

wait

#

no

viral crag
#

java 16 still has compatibility but 1.18 won't run the code

eternal night
#

they literally don't

tender shard
abstract sleet
#

it just turned midnight sorry if I make no sense rn.

eternal night
#

java 17 compiled plugins will fail on java 8 runtimes

#

yes, java 8 compiled plugins will run in java 17 jvms

heavy void
#

I only want to create a multi-version plugin for 1.8 - 1.18 and idk what java version to use ,_,

eternal night
#

not the other way around

abstract sleet
#

if you dont mind missing out on the new features like records then use java 8

eternal night
#

if you want your plugin to run on java 8 runtimes (which most 1.8 servers use) you will have to use java 8

tender shard
abstract sleet
#

yeah it can be replicated manually

#

and I don't like how record's getter methods are not prefixed with get anyways

tender shard
#

I just use lombok's @ Data whenever I would normally use a record

tender shard
#

send*

abstract sleet
#

I think I'll switch to kotlin at some point and it'll have built in data classes :)

viral crag
abstract sleet
#

have you tried kotlin alex?

tender shard
#

it doesn't add anything that's useful for me

viral crag
#

materials vs blockData etc

tender shard
#

I'm not saying it's bad, I just don't like it because it has no advantages for me

abstract sleet
viral crag
#

yeah

abstract sleet
#

e.g. java 8 vs java 17 for a plugin that wants to be compatible with 1.8+

#

is there any disadvantage with using api-version: '1.13' btw?

tender shard
#

nope

#

I always use api-version 1.13

viral crag
#

newer 1.18+ support is going to get messier

dire marsh
viral crag
#

look at the api and note all the depreciated

dire marsh
#

you should always prioritise new versions over old imo, use something like XMaterial if you really must

viral crag
#

boats and minecarts are now vehicles, water and lava now have a new level/flow class

#

etc etc

dire marsh
#

weren't boats and minecarts always vehicles

#

:thonk:

abstract sleet
#

only a small subset of plugins would be affected by that right

abstract sleet
dire marsh
#

wait what article

abstract sleet
#

blog post *

dire marsh
#

cool

crude loom
#

If a server has multiple versions, for examle 1.8 - 1.15 or something like that
What version my plugin should be at?

abstract sleet
#

but it can support multiple client versions

#

so your plugin should be built for the server's version

crude loom
#

Ah, I see, thank you!

abstract sleet
#

plugins like viaversion will handle any differences for the clients :)

dire marsh
#

viaversion messes up packet order a lot :(

viral crag
#

packets dont arrive in order

tender shard
#

many people hate me for that opinion but yeah it's just my opinion on how the laws work

#

I'm not saying people should ignore the GPL

abstract sleet
tender shard
#

I just say that in 99% of cases it's just not valid to plugin devs

viral crag
#

...

dire marsh
#

this guarantees a packet order

lost matrix
viral crag
lost matrix
tender shard
#

As long as the two messages were sent on the same TCP connection, order will be maintained. If multiple connections are opened between the same pair of processes, you may be in trouble.

dire marsh
#

1.8 sends swing packet then attack, 1.9 sends attack then swing, but viaversion messes this up and makes 1.8 clients have the 1.9 packet order instead

viral crag
#

part of the TCP protocol is that it knows where to put the packets in the receive buffer when they arrive and dumps all the duplicates

dire marsh
#

IPC?

viral crag
#

Inter-process communication

#

how and what order processes/systems/components talk to each other - thats a pretty generalized explaination

#

anyway it seems viaversion determined that 1.9 rules are good enough for 1.8 and do not justify a different handling , or the latency was too great in conversion

simple anvil
#

how to stop players from clicking there inventory

#

should we be using threds?

viral crag
#

they work better for finding things in one spot

tender shard
#

well unless they immediately joined the thread

#

nice

#

but in general you could say, threads are only useful here if many people are asking different questions at once

#

if you're the only one, / chat is currently idle just directly ask without a thread

sage dragon
#

How would I smoothly rotate an entity? Just teleporting it a little every tick sounds a bit disgusting if done too multiple entities at once

simple anvil
#

?jd-s

rich inlet
#

My PlayerInteractEvent which executes when a player steps on a pressureplate is spam-called, that means it gets called very often as long as the player stays on the pressureplate. is there a solution to this?

golden turret
#

so why would your for that just teleports each entity each tick lag the server?

sage dragon
golden turret
#

bro

#

1 entity crashed the server

#

fuck spigot 😑

golden turret
#

or just an idea of what you did

primal kite
golden turret
#

i do a lot of things each tick

golden turret
#

heavier than simply teleporting entitnties

#

and it doenst lag

sage dragon
#

Well, maybe the teleportation was just a bit too excessive πŸ€”

Will try again with bigger numbers and see if it's still smooth.

Also, this time I only want smooth rotation, not movement, so that might be another plus 🀷

golden turret
#

entity.setVelocity maybe

primal kite
#

could you leverage setVelocity

sage dragon
sage dragon
rich inlet
#

good idea, but how do I detect if they step away?

#

without PlayerMoveEvent if possible

viral crag
#

hmm do you get a playerLevelChangeEvent when you stop off teh plate?

rich inlet
#

No, sadly not

#

is this only possible with playermoveevent?

sage dragon
viral crag
#

plates would be so much easier if they were part of switch

rich inlet
#

Hmm, or I could check if the block underneath is redstone-powered

#

Yes 😭

primal kite
rich inlet
#

you're right.. it would matter, the pressure plate represents a checkpoint

viral crag
#

i was lookting at all the plates

rich inlet
#

how do I use this?

primal kite
viral crag
#

would have to test if each player is independent or not

simple anvil
#

for saving my code should i use github or gitlabs?

viral crag
#

you would should still be able to know who is on the sensor, if it changes press state for that entity or player is the question

viral crag
rich inlet
#

where would I test for this (in which event etc)

viral crag
#

myself, i would test as soon as I could when I expect the earliest activation could be identified from other actions using the same event - you want to skip processing and exit if they did not get off the sensor

primal kite
simple anvil
#

hmm ok

#

thanke

viral crag
#

driving again ..

sage dragon
#
Player player = (Player) sender;
Pig pig = (Pig) player.getWorld().spawnEntity(player.getLocation(), EntityType.PIG);


Bukkit.getScheduler().scheduleSyncRepeatingTask(this.mobRush, () -> {
    Location location = pig.getLocation();
    if (location.getYaw() >= 360)
        location.setY(0);
    location.setYaw(location.getYaw() + 0.1F);

    pig.teleport(location);
}, 1L, 1L);

This does literally nothing, nice πŸ‘

rich inlet
tardy flame
sage dragon
#

location.setYaw(location.getYaw() + 0.1F);

crude loom
#

Any idea as to why my events aren't firing? here is my code:

public final class Ranks extends JavaPlugin {

    @Override
    public void onEnable() {
        this.saveDefaultConfig();
        getServer().getPluginManager().registerEvents(new MyListener(), this);

    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
 @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event){

        event.getPlayer().sendMessage("Welcome!");
    }
tardy flame
#

@NotNull
private static Vector getVelocityVector(@NotNull Vector vector, Player player, float side, float forw) {
vector.setX(0.0D);
vector.setZ(0.0D);
Vector mot = new Vector((double) forw * -1.0D, 0.0D, (double) side);
if (mot.length() > 0.0D) {
mot.rotateAroundY(Math.toRadians((double) (player.getLocation().getYaw() * -1.0F + 90.0F)));
mot.normalize().multiply(0.25F);
}

    return mot.add(vector);
}
sage dragon
smoky oak
tardy flame
#

I had the same problem (still happens on 1.16.x version) so that's what I used to fix it

sage dragon
#

Whatever this method does, it does not rotate these pigs πŸ˜…(Or I'm using it wrong)

crude loom
smoky oak
#

mind dming me the full classes?

#

or here

tardy flame
#

Try removing teleport method - it COULD mess up something - not entirely sure though

smoky oak
#

?paste

undone axleBOT
tardy flame
#

Maybe you have also set somethinv with entity settings

crude loom
# smoky oak considering the code shown is correct the issue has to be somewhere else. Did yo...

That is my full code:

package com.shalev.ranks;

import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;

public class MyListener implements Listener {

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event){

        Bukkit.broadcastMessage("Welcome to the server!");
    }


}
package com.shalev.ranks;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

public final class Ranks extends JavaPlugin {

    @Override
    public void onEnable() {
        this.saveDefaultConfig();
        getServer().getPluginManager().registerEvents(new MyListener(), this);

    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (label.equalsIgnoreCase("HelloWorld")){
            sender.sendMessage("Hello World!");
        }
        return true;
    }
}
sage dragon
smoky oak
#

wait lemme lookup the javadoc for bukkit rq

#

so um

#

it sys that Bukkit::broadcastMessage() sends a message to all players

#

I've worked with events extensively

#

i know that your code is correct

smoky oak
#

the only thing i can think of is that you forgot to upload your plugin or reload said plugin

#

@sage dragon afaik its an internal one

tardy flame
crude loom
smoky oak
#

do you have a config.yml in the resources folder

sage dragon
crude loom
#

on the server?

smoky oak
#

no in the plugin

quaint mantle
#

Any way to prevent a user from joining if they dont have texture packs for the server set to enabled>

simple anvil
#
public ItemStack glass(){
        ItemStack glass = new ItemStack(Material.RED_STAINED_GLASS_PANE);
        ItemMeta glassmeta = glass.getItemMeta();

        List<String> lore = new ArrayList<>();
        lore.add("Only hot bar challenge");

        glassmeta.setLore(lore);
        glassmeta.setDisplayName("Challenge");

        return glass;
    }
smoky oak
#

saveDefaultConfig only saves something to drive if you include a config.yml in the resources tab of your plugin

simple anvil
#

how can i accses the glass from anywhere?

quaint mantle
#

as a list

sage dragon
crude loom
smoky oak
#

yea

tardy flame
smoky oak
#

its flagged @NotNull

#

so

smoky oak
#

if you dont have a config.yml

#

it fails

tardy flame
crude loom
smoky oak
#

it saves the preset config file to the server

#

if you want to make an empty config file

tardy flame
smoky oak
#

File.mkdirs(); File.create()

crude loom
#

Ah, I see, thanks!

simple anvil
tardy flame
simple anvil
#

uh

#

how u mean

tardy flame
#

Do you want to save it with a key or as a key

#

Or maybe just save it to have it later on

simple anvil
#

i have no clue

tardy flame
#

For what do you need it?

simple anvil
#

ok so i want to make a glass item stack in the main class
and accsess it from 4 different events

tardy flame
#

Then you can use hashmap

#

HashMap<K, ItemStack> hashMap = new HashMap<>();

#

and then access it by using own getters

#

and setters to the hashmap

quaint mantle
# tardy flame Got it https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerRe...

Thanks!

@EventHandler
    public void ResourcePack(PlayerResourcePackStatusEvent event){
        if(event.getStatus().equals(PlayerResourcePackStatusEvent.Status.DECLINED) || event.getStatus().equals(PlayerResourcePackStatusEvent.Status.FAILED_DOWNLOAD)){
            event.getPlayer().kickPlayer(ChatColor.RED + "You need to have resource packs enabled, and download the resource pack to play on this server!");
        }
    }
simple anvil
#

does it need to be in its own class?

tardy flame
simple anvil
#

so where do i put HashMap<K, ItemStack> hashMap = new HashMap<>()

main dew
#

How I can update libraries in spigot? I should use BuildTools?

simple anvil
#

kk

#

whtas the k for

tardy flame
#

This can be any parameter which you will use to recognize the value (item stack) from others

#

It is mostly replaced with String / uuid

#

Not entirely sure if you want this but you could also use pdc

#

?pdc

tardy flame
#

which could work even better-

#

but that's up to you

simple anvil
#

but i got lost

tardy flame
#

i can help you with it

lilac merlin
#

i have alot of questions can i ask them here?

tardy flame
quaint mantle
#

Why does kicking sometimes result in an Internal Exception: java.net.SocketException: Connection reset?

#

How do I make it ALWAYS leave a kick message?

#
event.getPlayer().kickPlayer(ChatColor.RED + "You need to have resource packs enabled, and download the resource pack to play on this server!");
#

Cause this doesnt seem to work sometimes

simple anvil
quaint mantle
lilac merlin
#

ok so i followed a youtube tutorial to make a spigot world, well i made the server and i can start it by using the .bat file, but my reason was so i could transfer my solo world to a server so i could use worldedit, but im not even op and i cant get the world to transfer idk how

simple anvil
#

is that a question?

lilac merlin
simple anvil
tardy flame
viral crag
# rich inlet so how do I use this?

As zacken02 said, you would use a set and the isPressed() to see if they are new or if its the same, if they are new you would run all your normal stuff, if the same, skip everything until the next call. You want to leave as quick as possible if the pressureplate spams events. - I suspect that you will also receive an event when they leave. The big question is if each player will have separate pressureplate states or not. - If not, then you will need to check the players movement to the blocks surrounding the plate

simple anvil
#

@tardy flame idk how to add people to the thread

#

i think u have todo it

main dew
#

How I can update libraries in spigot? I should use BuildTools?

viral crag
simple anvil
#

kk

viral crag
main dew
dark arrow
#

In entitiydamagebyentity Event Does getEntity means the entity who got damaged?

viral crag
main dew
chrome beacon
dark arrow
#

In entitiydamagebyentity Event Does getEntity means the entity who got damaged?

viral crag
main dew
chrome beacon
main dew
dark arrow
#

ok

#

?javadocs

main dew
#

?jd s

chrome beacon
dark arrow
#

it only says about the getdamager

chrome beacon
dark arrow
#

How i can get the MainHandItem of an entity

tardy delta
#

wondering if they would produce something usefull

tender shard
dark arrow
tender shard
#

okay then get the EntityEquipment

#

then do EntityEquipment#getItemInMainHand

#

LivingEntity has a method getEquipment()

viral crag
dark arrow
tardy delta
viral crag
#

well seconds will be affected first , if your TPS goes to 19.5 how many are in a second?

tender shard
#

20 ticks are 1 second if you have 20 tps

#

if you only have 19.5 tps, then 19.5 ticks are 1 second

dark arrow
#

How can i get the entity which got damged in EntityDamgeByEntity event?

viral crag
#

at 19.5, your minutes will still be close to valid

tardy delta
#

the input basically comes from a calculation between two earlier saved epoch times

tall dragon
dark arrow
tall dragon
# tall dragon also you could make a method to add the plural for you, could make this a bit cl...

this is what i do for example

          /**
     * If the count is 0 or over 1, adds an "s" to the given string
     *
     * @param count
     * @param ofWhat
     * @return
     */
    public static String plural(final long count, final String ofWhat) {
        final String exception = getException(count, ofWhat);

        return exception != null ? exception : count + " " + ofWhat + (count == 0 || count > 1 && !ofWhat.endsWith("s") ? "s" : "");
    }
dark arrow
#

how to add potion effect to an entity

tender shard
tender shard
crude loom
#

How do I check if a path in a config file exists?

chrome beacon
#

Use contains

crude loom
tall dragon
chrome beacon
#

or that

crude loom
#

Oh ok , thanks :D

tall dragon
#

you want the whole piece ?

tardy delta
#

oh

#

i got enough with this thanks

tall dragon
#

alright :)

tardy flame
#

?pdc

tender shard
tardy flame
#

let me live

tender shard
#

Oki :3

sage dragon
#

Why is literally any mob which is not a player immune to rotation teleportation πŸ˜’

#

Well, for some reason they are on my localhost server...

Trying to make a mob spin

#
Player player = (Player) sender;
Zombie zombie = (Zombie) player.getWorld().spawnEntity(player.getLocation(), EntityType.ZOMBIE);


Bukkit.getScheduler().scheduleSyncRepeatingTask(this.mobRush, () -> {
    Location zombieLocation = zombie.getLocation();
    Location location = new Location(zombieLocation.getWorld(), zombieLocation.getX(), zombieLocation.getY(), zombieLocation.getZ(), zombieLocation.getYaw() + .1F, zombieLocation.getPitch());
    zombie.teleport(location);
}, 1L, 1L);

Right now it's this

#

setRotation? That didn't work either

#

Thanks, that seems to be working...

But why didn't it work with good old yaw and pitch?

tall dragon
#

lol

simple anvil
#

@tardy flame what is group id again

wary harness
#

So I am made plugin for a customer and I want they don't redistribute it, so they can only use it for there server.
Now question is there any licence I can use for that?

simple anvil
#

what kinda plugin?

#

what does it do

viral crag
#

your limitations depends if you included others code

lost matrix
simple anvil
#

what should my group id be, and what should my artifact id be?

quiet ice
#

probably just ARR

#

the group id should usually be your reverse domain name. I.e. example.org becomes org.example

simple anvil
#

so
me.CyberWolfie?

quiet ice
#

if you own the domain, yes

#

Even though many do it anyways

#

just note that it should be lowercase

lost matrix
# wary harness legal

I think just the thing that companies use for their games. Copyright <YEAR> <COPYRIGHT HOLDER>
Something something BSD i think

quiet ice
#

BSD allows redestribution

lost matrix
#

It does?

quiet ice
#

Yeah, it's about as lax as MIT

wary harness
quiet ice
#

You just cannot use it for advertisements

#

Some people use their email addresses for this

simple anvil
quiet ice
#

However some time ago it used to be convention to use have groupId and artifactId be identical if I look back at very old maven artifacts

#

This might have reasons that are no longer valid however

main musk
#

how do you call an entities main hand?

quiet ice
#

?jd-s

undone axleBOT
viral crag
simple anvil
#

what is a vcs

viral crag
#

version control system

quiet ice
#

Github

simple anvil
#

oh, i can

quiet ice
#

or gitlab

simple anvil
#

so myplugin\username\com.github?

viral crag
#

you could set your ID to correspond to your location

#

other direction if i recall

simple anvil
viral crag
#

com.github.username.myplugin

quiet ice
#

io.github.exampleuser

simple anvil
#

oh

quiet ice
#

com.github is less conventional

simple anvil
#

io.github.thestorm?

lime jolt
#

anyone know how to place a block in a specific x, y and z location

quiet ice
simple anvil
#

kk

viral crag
lost matrix
lost matrix
viral crag
#

its actually one of the features of java that I appreciate, saves searching for a lot of stuff

quiet ice
#

what?

viral crag
#

reversing the id and ending up in or near the code

lime jolt
#

also does anyone know how to make a specific location for a Player unbreakable

lost matrix
lime jolt
#

how would I go about making a specific block unbreakable

#

or even a large selected area unbreakable

lost matrix
#

Those are 2 completely different requirements

lime jolt
#

how would I go about doing one of them

lost matrix
#

Which one?

simple anvil
viral crag
#

the one without doing anything is to use your spawn protection

lime jolt
#

but ehtier or, just learning

lost matrix
lime jolt
#

which do u recomend

quiet ice
#

github.io is valid as that is github pages, so if you set it up you have a small web-page you can use

viral crag
simple anvil
#

should i?

lost matrix
#

Depends on what you are trying to do.
Do you want protect areas or do you want to
protect random blocks which have no correlation to each other

lime jolt
#

protect areas

lost matrix
#

You can span a BoundingBox with 2 corner Blocks

raw ibex
#

quick question, can 1.18.1 plugins work on 1.18.2 servers?

raw ibex
#

also, how would I transfer a plugin to an updated version

raw ibex
simple anvil
#

what licens should i use on github so people can use my stuff, but they can share it with other people

lost matrix
lime jolt
raw ibex
#

yes just the api

lost matrix
viral crag
simple anvil
#

no

lost matrix
ivory glacier
#
net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:120)
net.minecraft.server.v1_16_R3.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:536)
net.minecraft.server.v1_16_R3.World.getType(World.java:745)
org.bukkit.craftbukkit.v1_16_R3.block.CraftBlock.getNMS(CraftBlock.java:79)
org.bukkit.craftbukkit.v1_16_R3.block.CraftBlock.getBlockData(CraftBlock.java:162)
com.welcome234.infgenerator.OreVein.generate(OreVein.java:42)
com.welcome234.infgenerator.BetaPopulator.populate(BetaPopulator.java:157)
net.minecraft.server.v1_16_R3.Chunk.loadCallback(Chunk.java:891)
net.minecraft.server.v1_16_R3.PlayerChunk.lambda$a$15(PlayerChunk.java:775)
net.minecraft.server.v1_16_R3.PlayerChunk$$Lambda$4034/559373399.run(Unknown Source)
net.minecraft.server.v1_16_R3.PlayerChunkMap$CallbackExecutor.run(PlayerChunkMap.java:204)
net.minecraft.server.v1_16_R3.ChunkProviderServer$a.executeNext(ChunkProviderServer.java:1080)
net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119)
net.minecraft.server.v1_16_R3.ChunkProviderServer.getChunkAt(ChunkProviderServer.java:536)
net.minecraft.server.v1_16_R3.World.getType(World.java:745)
org.bukkit.craftbukkit.v1_16_R3.block.CraftBlock.getNMS(CraftBlock.java:79)
org.bukkit.craftbukkit.v1_16_R3.block.CraftBlock.getBlockData(CraftBlock.java:162)```

My generator causes the server to crash on load
simple anvil
#

only if they use it in a yt vid

ivory glacier
#

It infinitely repeats

#

Really long

lost matrix
viral crag
simple anvil
#

thanks

ivory glacier
#

This is inside the BlockPopulator for my generator

#

public void populate(final World world, final Random random, final Chunk chunk)
It's inside this

#
if (var26 * var26 + var27 * var27 + var28 * var28 < 1.0 && world.getBlockAt(x, y, z).getBlockData().getMaterial() == Material.STONE) {
   world.getBlockAt(baseX, baseY, baseZ).setType(minableBlock, false);
}```
This part is crashing it
#

On the getBlockData part

lost matrix
quiet ice
#

Likely because the getBlockData call requires the chunk to be generated first

#

But I have no further idea without further context

ivory glacier
#

The long stack trace is from a for loop thing

quaint mantle
#

how can i create yml file for each player?

lost matrix
quaint mantle
#

ok

quiet ice
ivory glacier
#

Wait I did world.getBlockAt(x, y, z).getType() instead

#

Since it will return the same result

ivory glacier
simple anvil
#

what do i put in artifact iD?

ivory glacier
#

On same line again

lost matrix
ivory glacier
#

How would I fix

#

chunk.getBlock?

lost matrix
#

get the data from the generation context

#

the world doesnt know about the chunk yet because you are still generating it

quaint mantle
#

how can i use FileConfiguration outside of main folder?

#

its just showing error when i use it in another class

ivory sleet
#

what error specifically?

quaint mantle
#

Cannot resolve method 'getDataFolder' in 'JoinLeaveListener'

#

it works in main class

eternal night
#

probably a learnJava moment

lost matrix
eternal night
#

^

lost matrix
#

i smell a learn java coming

lime jolt
ancient jackal
undone axleBOT
ivory glacier
#
   public boolean generate(final Material minableBlock, final int numberOfBlocks, final World world, final Random random, final int baseX, final int baseY, final int baseZ) {
        for (int var13 = 0; var13 <= numberOfBlocks; ++var13) {
            for (int x = var20; x <= var23; ++x) {
                final double var26 = (x + 0.5 - var14) / (var18 / 2.0);
                if (var26 * var26 < 1.0) {
                    for (int y = var21; y <= var24; ++y) {
                        final double var27 = (y + 0.5 - var15) / (var19 / 2.0);
                        if (var26 * var26 + var27 * var27 < 1.0) {
                            for (int z = var22; z <= var25; ++z) {
                                final double var28 = (z + 0.5 - var16) / (var18 / 2.0);
                                if (var26 * var26 + var27 * var27 + var28 * var28 < 1.0 && world.getBlockAt(x, y, z).getType() == Material.STONE) {
                                    world.getBlockAt(baseX, baseY, baseZ).setType(minableBlock, false);
                                }
                            }
                        }
                    }
                }
            }
        }
        return true;
    }```
I truncated all variables since it's too large
ivory glacier
#

public void populate(final World world, final Random random, final Chunk chunk)
I am using the world variable from this

hollow bluff
#

decompile much? πŸ₯±

lost matrix
ancient jackal
# quaint mantle it works in main class

basically, the main class extends JavaPlugin which has its own methods. one of its own methods include that, so only classes extending the javaplugin can use it. but only your main can extend javaplugin, so you can include a static instance of the main class within your main and access it from everywhere with public static PluginName plugin; and plugin = this; in the onEnable

#

you should see hierarchy and access modifiers

quaint mantle
#

thanks

viral crag
simple anvil
#

what is artifact id?

ancient jackal
#

basically project name but not

simple anvil
#

ok if im wroking on a particles plugin what should it be calledf

quaint mantle
#

This how i was supposed to make it?

ancient jackal
simple anvil
#

@quaint mantle making events in the main class isent recommanded

quaint mantle
#

ik just removed it

ancient jackal
#

now whenever you need to do something specific to your plugin, say getting data folder, you can just use it from your main TestPlugin.plugin....

lost matrix
pliant oyster
#

How can I get a player who clicked a certain item in a inventory

lost matrix
pliant oyster
#

yeah but on a certain item

cosmic arrow
#

is there a way to get the itemstack of a Projectile on 1.8?

lost matrix
simple anvil
#

->

pliant oyster
lost matrix
lost matrix
tardy delta
#

when i declare Supplier<String> sup = obj::getName the getName method wont be called until i call Supplier#get right?

tardy delta
#

great

simple anvil
#

?tabexicuter

#

?TabExecutor

#

?js-p

tardy delta
#

fail

simple anvil
#

no

tardy delta
#

?jd-s

undone axleBOT
simple anvil
#

ee

#

see

#

it worked for me

tardy delta
#

just an interface which extends both CommandExecutor and TabCompleter

ancient jackal
simple anvil
#

no

#

TabExecutor

#

its one class

#

but has all the funcs of CommandExecutor and TabCompleter

ivory glacier
tardy delta
ancient jackal
#

Interfaces extend 0 classes

tardy delta
#

interface extends other interfaces lol

ancient jackal
#

False, can't extend interfaces

#

wait can they?

#

oh thats cool they can

tardy delta
#

yes they can

#

theoritcally it should be implements Otherinterface but as the current class is already an interface it is 'extends' πŸ€·β€β™‚οΈ

pliant oyster
lost matrix
ancient jackal
#

I thought "interfaces cant be extended but can be implemented" but then wondered how an interface would implement another

#

what themes do we use?

pliant oyster
tardy delta
#

themes?

ancient jackal
lost matrix
tardy delta
#

check the InventoryClickEvent#getSlot

ancient jackal
somber hull
#

Current*

crimson terrace
#

getClickedItem()?

somber hull
#

Doesn’t exist

tardy delta
#

ye forgot about that method

somber hull
#

It’s current

somber hull
#

7smile

#

Is there a bot in this server to show documentation for a method?

pliant oyster
lost matrix
pliant oyster
lost matrix
pliant oyster
#

that's what I wanna do

somber hull
#

Oh ok

tardy delta
#

anyways if im listening for console input (not in the context of spigot), do i need to do that on another thread than the thread when the other code runs on?

somber hull
lost matrix
somber hull
#

Alr

tardy delta
#

ye

#

unfortunately

pliant oyster
signal meteor
#

why am i getting an error message with "Non-static method 'openTeleporterGUI(org.bukkit.entity.Player)' cannot be referenced from a static context" in this code ?


        gui = Bukkit.createInventory(null, 9, "Lobby Teleporter");
        gui.setItem(0, new ItemCreator(ChatColor.RED + "Bedwars", Material.RED_BED).build());
        gui.setItem(2, new ItemCreator(ChatColor.RED + "PVP", Material.DIAMOND_SWORD).build());
        gui.setItem(4, new ItemCreator(ChatColor.GOLD + "Spawn", Material.COMPASS).build());
        gui.setItem(6, new ItemCreator(ChatColor.RED + "Survival Server", Material.GRASS_BLOCK).build());
        gui.setItem(8, new ItemCreator(ChatColor.RED + "Events", Material.CAKE).build());
        player.openInventory(gui);
    }```

```public void OnKeyClick(PlayerInteractEvent event) {

    if(event.getItem() != null) {
        if(event.getItem().getType().equals(Material.COMPASS)) {
            TeleporterGUI.openTeleporterGUI(event.getPlayer());
        }
    }
}```
tardy delta
#

there should be like ?jd-s Command#getName command

lost matrix
somber hull
#

Cause your not instantiating the class

#

Your trying to use it like TeleporterGUI.method

lost matrix
crimson terrace
#

thats not it i believe

somber hull
#

You need to create an instance

somber hull
lost matrix
somber hull
#

@signal meteor

#

?learnjava

undone axleBOT
tardy delta
#

which is also the place for the outputstream i guess

somber hull
#

Look up how object oriented programming works if you don’t know how to instantiate @signal meteor

signal meteor
#

ty