#help-development

1 messages · Page 1559 of 1

mystic tundra
#

ok

#

I'm using Eclipse

#

so it should be in the Eclipes marketplace?

eternal oxide
#

no

#

sec

hardy swan
#

if your dependencies are other plugins, chances are you dun have to shade anything too, because they should also be present in runtime

mystic tundra
#

I have jsoup

hardy swan
mystic tundra
#

ah

hardy swan
eternal oxide
#

?paste

undone axleBOT
mystic tundra
#

yeah I used other plugins once as well

#

what should I paste there?

hardy swan
#

he is pasting in it for you to refer

mystic tundra
#

ah

eternal oxide
mystic tundra
#

oh ok

#

and then that automatically includes all dependencies?

eternal oxide
#

well almost, remove the comment junk on line 15

mystic tundra
#

yeah

#

I have another plugin ther

#

maven-compiler plugin

eternal oxide
#

yep

mystic tundra
#

that's fine?

eternal oxide
#

just add the shade section into your existing plugins section

hardy swan
#

yea it is supposed to be there

#

if you use maven to build of course

mystic tundra
#

and the indents are fine?

#

yep

#

I have them like this

grave kite
#

How do I check if a bed was clicked? This code doesn't work

eternal oxide
#

you can fix all indents with CTRL+A then CTRL+I

mystic tundra
#

oh thx

hardy swan
#

or a formatter to format on save 😎

mystic tundra
#

and now I just run the build configuration?

hybrid spoke
mystic tundra
#

true but that'd be complicated 🙂 im a beginner

#

eh now I have two exported jars

#

ima just re-run it

#

yeah there's an original- file and then the normal one

eternal oxide
#

one will be a minimized jar, so no dependencies

mystic tundra
#

oh ok

eternal oxide
#

teh larger one will have your depends

mystic tundra
#

kk

grave kite
mystic tundra
#

it's 20mb

#

isn't that too big?

eternal oxide
#

probably

#

open it up and see whats in it

hybrid spoke
eternal oxide
#

default is to shade everything you didn;t set to provided

mystic tundra
#

oh ok

#

how do I set it to not shade the spigot.jar

eternal oxide
#

add a configuration section...

grave kite
#

there are beds with different colors, but there is no bed type for all colors

mystic tundra
#

yeah the jsoup is there

mystic tundra
radiant aspen
eternal oxide
mystic tundra
#

oh ok

eternal oxide
#

add that in the shade plugin section

mystic tundra
#

hey that's better

#

420kb

eternal oxide
#

open it and make sure it included jsoup

mystic tundra
#

ok

#

uh I'm about to freak out like a 9 y/o (i'm 14)

grave kite
mystic tundra
#

it did and my plugin works

#

it gave me a bald head

eternal oxide
#

nice

mystic tundra
#

theres another problem with the rendering tho

#

hold on

#

I'm a mac user

#

how do I screenshot on windows?

eternal oxide
#

you have to verify on here to upload SS

#

!verify

undone axleBOT
#

Usage: !verify <forums username>

mystic tundra
#

is there a way to change my forums username

hybrid spoke
#

donating

mystic tundra
#

the website is glitched

#

!verify Simoooooooon_

#

something like that

undone axleBOT
mystic tundra
#

!verify Simooooooon_

undone axleBOT
#

This account is already verified!

mystic tundra
#

right it's on my deleted account

#

I forgot

#

discord deleted my old acc for no reason

#

it was also Simo

#

what do I do

eternal oxide
#

Probably contact a mod

radiant aspen
mystic tundra
#

I know

radiant aspen
#

Because discord 100% deletes accounts because they are bored

mystic tundra
#

I have no way to prove it

#

no the minimum age here where I am is 14

#

and when I was 13 I entered that I'm 13

#

and it banned it

eternal oxide
#

Contact a mod and you'll need to prove to them you are teh account holder

tiny wolf
#

It still fully works just sends the error once in a while

radiant aspen
#

just spam ping md a bunch of times, im sure he will fix it

eternal oxide
#

I'd probably ping steel.

mystic tundra
#

ok

eternal oxide
#

as I've no clue how to go about fixing it

mystic tundra
#

I actually started making a plugin for someone

#

he might be able to vouch idk

#

he's a server booster rn

eternal oxide
#

you'll probably only need to log in to yoru forum account to prove it

mystic tundra
#

yeah the website is glitched rn

supple elk
#

Can I cast from EntityPlayer to OfflinePlayer?

mystic tundra
#

oh no it's not

eternal oxide
#

EntityPlayer is nms?

supple elk
#

yes

eternal oxide
#

in which case, no

mystic tundra
#

lol 65 alerts on my account

supple elk
#

anyway to convert then?

#

I want to add my fake EntityPlayer to a team

mystic tundra
#

ehm

#

To verify your discord account, please click this link.
Note that this cannot be undone

#

oopsie

supple elk
#

tab list can be order by teams

runic mango
#

q:

where should I put a Random generator?
putting it in onCommand doesn't seem right but intellij doesn't like it being in onEnable

eternal oxide
supple elk
#

what if i have multiple fake players with the same name?

#

I want to add serveral fake players with no name to the scoreboard

eternal oxide
#

good luck? Entities are added by UUID, Players are added by name

#

well UUID.toString

supple elk
#

there's a deprecated function to add a Player

mystic tundra
#

how do I check if my args[1] of my plugin command is a player's username?

eternal oxide
#

try adding by name and see what happens

supple elk
#

can I not just get the UUID of my fake player?

#

a player is an entity right so can I not add it by UUID?

eternal oxide
mystic tundra
#

actually args 0

eternal oxide
#

ok, is the player going ot be online?

supple elk
#

it's a fake player I've made, which I've not spawned in for the sole purpose of displaying on tab

mystic tundra
#

yes but I think I have it

#
for(Player p : Bukkit.getOnlinePlayers()) {
                if(args[0] == p.getDisplayName()) {
supple elk
#

oh

mystic tundra
#

I just had args[1]

supple elk
#

sorry thought u were talking to me with the player stuff

eternal oxide
#

use .equalsIgnoreCase not ==

mystic tundra
#

oh ok

eternal oxide
supple elk
#

k I'll try this

eternal oxide
#

If its a fake player you may be limited to adding by name

supple elk
#

they still have UUIDs

eternal oxide
#

It seems to only match on name for Player entities

#

all non Plyer entities is uses teh uuid

mystic tundra
#

how do I get the star symbol? if I want to do something to everyone, like /smite *

eternal oxide
#

not sure what you mean

mystic tundra
#

like in essentials you can do /smite * and it smites everyone

#

how do I get the input of *

eternal oxide
#

ah, * is a special character in essentials

#

it literally looks for it then loops all players and kills them

supple elk
#

it looks like it works?

mystic tundra
#

ah ok

supple elk
#

but for some reason it causes a tonne of lag

eternal oxide
#

so if (args[0].equals("*"))

mystic tundra
#

oh ok

supple elk
#

and hasn't changed the order :/

eternal oxide
#

As I said, Teams may not accept them by UUID

supple elk
#

well it looks like it has worked if you look at what got printed

young knoll
#

The order is alphabetical

#

Based on the color code

supple elk
supple elk
#

which should overwrite the order of player names

eternal oxide
#

Yes, that only shows you added those UUIDs to the Team

supple elk
#
            team.unregister();
        }

        final OrderCounter counter = new OrderCounter(2);

        for (MCUTeam mcuTeam : teamManager.getTeamsList()) {
            final ChatColor teamColour = mcuTeam.getTeam().getColor();
            final Pair<String, String> skin = ColourMapper.getSkinfromColour(teamColour);
            final EntityPlayer entityPlayer = createFakePlayer(mcuTeam.getDisplayName(), skin.getFirst(), skin.getSecond());

            final Team team = scoreboard.registerNewTeam(counter.nextInt());
            team.addEntry(entityPlayer.getUniqueIDString());

            Bukkit.getLogger().info("" + team.getName());
            Bukkit.getLogger().info("" + team.getEntries());
            Bukkit.getLogger().info("" + team.getPlayers());

            final PacketPlayOutPlayerInfo packet = new PacketPlayOutPlayerInfo(
                    PacketPlayOutPlayerInfo.EnumPlayerInfoAction.ADD_PLAYER,
                    entityPlayer);
            for (Player player : Bukkit.getOnlinePlayers()) {
                ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
            }
        }```
eternal oxide
#

it doesn;t actually mean it recognises those fake players as those UUIDs

supple elk
#

how would i test if it's recognised?

eternal oxide
#

add a team prefix

supple elk
#

good idea

#

not a prefix in sight

eternal oxide
#

now add them by name not UUID

supple elk
#

still nothing

eternal oxide
#

I guess you are fubar then

supple elk
#

fubar?

#

I'm going to try to add myself to the team

#

perhaps the team is not displaying on the scoreboard or something?

#

I don't know if I need to set the scoreboard to display on the tab menu

eternal oxide
#

are you setting these teams on teh Main scoreboard?

supple elk
supple elk
#

I made my own scoreboard

eternal oxide
#

try it on main

#

as its the default

#

getMainScoreboard

supple elk
#

yeah that worked

eternal oxide
#

just remember Teams are persistent java if ((team = scoreboard.getTeam(TEAM_NAME)) == null) team = scoreboard.registerNewTeam(TEAM_NAME);

supple elk
#

oooh and it's ordered them 😄

supple elk
#

I unregister it every time

eternal oxide
#

k

supple elk
#

god why is making a good looking scoreboard so complicated

#

the other issue is that I still want to use teams to stop team killing

#

so if I want to have a player listed on the scoreboard

#

I guess I'll have to create a fake player to look like an actual player?

eternal oxide
#

probably

#

as players can only be in one team

supple elk
#

yep

#

god this is complicated

eternal oxide
#

You are going to have to completely disconnect players from teh scoreboard

supple elk
#

there's another issue still

#

and that's how do I actually clear the fake players from the tab menu

#

I don't know if there's an easy way to reset the tab menu?

#

and yeah the UUIDs don't work, only the name

#

meaning I'm gonna have to give them unique names somehow

#

and then change the display name

quaint mantle
#

Im looking here, someone is using packets to display particles to all players but is it better than doing World#SpawnParticle

supple elk
#

yeah I could set the name as a random UUID

#

ooooh

#

I could set the name and the UUID to the same random UUID

#

so then I can add them by UUID

#

perhaps not

#

yes, but would it be unique then?

#

is there not a chance it could be the same?

opal juniper
#

Well

#

It increases the chance a bit yes

#

Can you not use the most and least sig bits

#

I may not be remembering correctly

supple elk
opal juniper
#

I forget where the methods are but there is a way of taking the uuid to a string, think it is uuid.most/least significantbits

#

That may make it send?

#

Idk

undone axleBOT
quaint mantle
#

Hello, i'm making skin changer and it doesn't works (Only works in tab-list and no console errors)

#

what I tried: runTaskLater

crude hound
#

you need to refresh the others players vision

near crypt
#

?jdk

#

can anyone send me a link to the newest jdk?

crude hound
#

I need help because when I start my minecraft server I have this error : java.io.IOException: Le processus ne peut pas accÚder au fichier car un autre processus en a verrouillÚ une partie at sun.nio.ch.FileDispatcherImpl.write0(Native Method) ~[?:?] at sun.nio.ch.FileDispatcherImpl.write(FileDispatcherImpl.java:68) ~[?:?] at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:113) ~[?:?] at sun.nio.ch.IOUtil.write(IOUtil.java:58) ~[?:?] at sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:280) ~[?:?] at net.minecraft.server.v1_16_R3.SessionLock.a(SourceFile:40) ~[server.jar:3096-Spigot-9fb885e-296df56] at net.minecraft.server.v1_16_R3.Convertable$ConversionSession.<init>(Convertable.java:257) ~[server.jar:3096-Spigot-9fb885e-296df56] at net.minecraft.server.v1_16_R3.Convertable.c(Convertable.java:227) ~[server.jar:3096-Spigot-9fb885e-296df56] at net.minecraft.server.v1_16_R3.Main.main(Main.java:136) [server.jar:3096-Spigot-9fb885e-296df56] at org.bukkit.craftbukkit.Main.main(Main.java:202) [server.jar:3096-Spigot-9fb885e-296df56]

eternal oxide
#

google AdoptOpenJDK

eternal oxide
#

find the lock file and delete it (with the server stopped)

crude hound
#

it's the session.lock?

quaint mantle
#

I want to fix that

crude hound
#

I don't really know how to fix that so I think you can use google to search a packet in this style

quaint mantle
#

people says : hide and visible player(already do), use runTaskLater(already tried)

#

etc

hybrid spoke
#

so your only issue is, that you are invisible for yourself? @quaint mantle

worn sierra
#

how may I create my own fork of spigot? I want to be able to edit NMS as well

eternal oxide
#

?contribute

idle grotto
#

hey guys, I have a project with multiple maven modules that I am upgrading from java 8 to 16, should I implement java modules together with the maven modules?

quaint mantle
#

my skin only applied in tab-list

hybrid spoke
torn jewel
#

how do servers deal with client communication do they make a new thread for each client or something else

hybrid spoke
quaint mantle
torn jewel
hybrid spoke
# quaint mantle oh should I teleport?

most likely. idk if its enough if you just teleport him into the same world. you can try it. otherwise create a new world, teleport yourself in and out so the skin will load

proud basin
#

dope but how do I set the server thing up on my pc?

loud island
#

are you going to host the license server on your pc?

proud basin
#

Yeah on my second one

loud island
#

god no

proud basin
#

Why not?

summer scroll
#

bad idea

loud island
#

idk how your license system is made but if I had to guess, any power outage or network outage would mean broken plugins

hybrid spoke
loud island
#

and any user would just end up annoyed that the plugin they payed for isn't working

eternal oxide
#

also if you are not careful you could end up getting ddos'd by your own plugin trying to authenticate

quaint mantle
#

1.17.1?

dusty herald
#

yes

proud basin
timid kraken
#

guys i am trying to get an even when player recieves an achievement

#

does anyone know the even for it?

quaint mantle
#

player.teleport(new Location(Bukkit.getWorld("Dungeon"), 0, 0, 0)); << but it works

#

but I want not to teleport another world

silk mirage
#

When I takeout NBT tagged item, It despawns

#

what could be the cause and solution?

timid kraken
#

i want an event for when player gets an achievement like "We need to go deeper" etc

silk mirage
#

shh someone

torn shuttle
#

anyone know off the top of their heads if getHighestBlockAt() gets the highest block out of the chunk or the first available passable block?

torn shuttle
#

i.e. if I did it in the nether would it always give me the height of the nether ceil?

silk mirage
#

oh

eternal oxide
#

if you use it in the nether it will alwasy return the very top

torn shuttle
#

thanks

#

man I really wish minecraft wouldn't invent negative y coordinates

opal juniper
#

wdym its literally the most intelligent thing ever

torn shuttle
#

mhm

silk mirage
#

hmm

unreal quartz
#

nah they should've done away with the y plane and just have you play on a flat surface

silk mirage
#

Anyone gonna help me?

idle grotto
#

@silk mirage can you reproduce the issue on the latest version?

torn shuttle
#

bruteforcing valid spawn locations feels wrong

waxen plaza
#

I am using a chunk pregeneration plugin to generate chunks and I was wondering if there is a way to make my server use more resources. I am using this java -Xmx4G -jar spigot-1.17.1.jar nogui when launching the server.

silk mirage
#

specficy -Xms for minium resources

#

use aikari flags

waxen plaza
#

-Xms 4G ?

silk mirage
#

-Xmx4G

waxen plaza
#

I already have that

silk mirage
#

sorry

#

i meant -Xms4G

waxen plaza
#

oh

#

ok

#

btw do I use both? Xms and Xmx

silk mirage
#

yes

waxen plaza
#

ok

silk mirage
#

-Xmx is maxium ram

waxen plaza
#

ok

supple elk
#

how do I make an IChatTextComponent?

#

I tried this

lusty cipher
#

which one of these is better (i know, it doesn't really matter, just wondering)?

T[] values = x;
for (int i = 0; i < values.length; i++) {
  T value = values[i];
  if (value == null) continue;
  if (value.something()) return i;
}
T[] values = x;
for (int i = 0; i < values.length; i++) {
  if (values[i] == null) continue;
  if (values[i].something()) return i;
}
dusk flicker
#

not really a difference, personally id use the first one but its basically preference at this point

lusty cipher
#

I mean the second one is 2 array lookups so it's probably a little slower

dusk flicker
#

doubt thats a speed decrease you would notice

minor garnet
#

aah gentlemen, can someone please specify my problem

summer scroll
supple elk
foggy bough
#

quick question... does this code check if the button is right clicked? ```java
public void onInteract(PlayerInteractEvent e) {
Player player = e.getPlayer();
ItemStack block = new ItemStack(Material.ACACIA_BUTTON);
player.getInventory().addItem(block);
if(player.getMainHand().equals(block)) {

    }```
supple elk
#

it gives them a button on an interact event

stone sinew
#

You aren't even checking the type of the block clicked

foggy bough
supple elk
#

have a look what comes up when you do e.

#

.getClickedBlock()

foggy bough
#

ok

supple elk
#

then check if that block is a button

foggy bough
#

ok so like this? ```java
public void onInteract(PlayerInteractEvent e) {
Player player = e.getPlayer();
ItemStack block = new ItemStack(Material.ACACIA_BUTTON);
player.getInventory().addItem(block);
if(e.getClickedBlock() == block) {

    } else {
        return;
    }
}```
maiden briar
#

"C:\Users\<>\IdeaProjects\TvheeAPIRepositoryInstaller\test\apache-maven-3.6.0\bin\mvn.cmd", install:install-file, -Dfile="TvheeAPI-1.6.0-01.jar", -DgroupId=me.tvhee, -DartifactId=TvheeAPI, -Dversion=1.6.0-01, -Dpackaging=jar gives me

[ERROR] No plugin found for prefix 'C' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\<>\.m2\repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/NoPluginFoundForPrefixException
foggy bough
maiden briar
#

Why does this not work?

maiden briar
#

Oh my foult, I specified the directory 2 times...

summer scroll
#

getClickedBlock will return Block iirc.

foggy bough
chrome beacon
maiden briar
#

Yes I understand

#

Thx

summer scroll
foggy bough
supple elk
#

so you need to do e.getClickedBlock().getMaterial() == Material.ACACIA_BUTTON

foggy bough
supple elk
#

why do you want the button in your hand?

#

oh

foggy bough
supple elk
#

are you trying to test if they right click a button in their hand?

supple elk
supple elk
#

ok

supple elk
#

so you're not trying to test if they right click a button in the physical world

supple elk
#

right in which case you ahve the wrong event

foggy bough
supple elk
#

I think

foggy bough
#

it

supple elk
#

actually maybe you don't

#

lemme check

#

no I think you have the right one

#

in which case you want to compare player.getItem().getMaterial() to Material.ACACIA_BUTTON

#

or whatever it is

#

the docs for the event might help you

summer scroll
#

event.getItem() to get the item in hand

foggy bough
supple elk
#

oh yeah, event.getItem()

foggy bough
supple elk
#

so you get inventory first

#

then you can get the item in either hand

#

but the event already has a method for the same thing so you may as well use that

foggy bough
summer scroll
#

woah, nice theme - like that a lot

foggy bough
supple elk
#

I based it off of the darkest dark theme in eclipse

foggy bough
#

ok well thx

supple elk
#

my whole IntelliJ looks dope

supple elk
summer scroll
#

can i have that lol

supple elk
#

sure, lets go dms

foggy bough
#

or should I just keep the e.getItem

supple elk
#

why are you comparing it to the block?

foggy bough
#

OHHHHHHHHHHHHHH

#

I AM DUMB

#

YOU SEE

supple elk
#

e.getItem().getMaterial() == Material.ACACIA_BUTTON

supple elk
foggy bough
#

3IQ

supple elk
#

xd

#

the block is in the physical world

#

and you need to compare materials

hybrid spoke
wild vault
#

hey so im trying to do a basic plugin that multiplies diamond drops, but nothing ive found works

#

does anyone know the code for the drop multiplier?

chrome beacon
#

Do you know Java?

wild vault
#

a little, im still a beginner but i have experience

chrome beacon
#

Alright so what you can do is just use a Datapack instead of a plugin. If you do want to use a plugin listen to the BlockBreakEvent and set the drops in #getDrops

#

?eventapi

undone axleBOT
chrome beacon
#

Here's the guide on how to work with events

wild vault
#

thanks, ill try it 🙂

supple elk
#

is there a way I can get a list off all players being displayed to somebody?

#

currently I'm doing this to add fake players to the tab menu

hybrid spoke
#

are those all errors or is it your theme?

supple elk
#

theme

hybrid spoke
#

ugh

supple elk
#

you don't like my theme :?

hybrid spoke
#

no

supple elk
#

angee

chrome beacon
#

Red is for errors :kekw:

supple elk
#

is good theme D-:<<<

#

underlining is for errors

#

anyway back to the question

#

I can add players like this

hybrid spoke
#

themes with red colors for anything else than errors are a bad habit

supple elk
#

but I have no idea how to track them

#

they persist across reloads

hybrid spoke
#

store them

supple elk
#

they don't show up in Bukkit.getOnlinePlayers()

hybrid spoke
#

yeah obv.

supple elk
hybrid spoke
#

ya

supple elk
#

then send a packet to remove each one?

hybrid spoke
#

yup

supple elk
#

ok that's not gonna fly across reloads but if that's the only option then so be it

#

I find it weird how there isn't like a packet to just reset the tab menu

eternal oxide
#

you can store their data in the spawn chunk PDC so you know what fake players exist

supple elk
#

doesn't really matter as server shouldn't be reloaded in normal use

hybrid spoke
#

using a PDC would be the way to go if you wanna have it persist a reload

hybrid spoke
#

just remove them when disabling

#

and add them again on enable

supple elk
#

oh that's a good idea

hybrid spoke
#

then you have it "persistent"

supple elk
#

big brained man

opal juniper
#

out of interest @supple elk what are they for?

supple elk
#

the fake players?

opal juniper
#

yeah

supple elk
#

making a tab menu

opal juniper
#

ok

supple elk
#

it's how hypixel does it

#

well, I assume that's what they must do

proud basin
#

will keep that in mind

supple elk
#

I wish customising it was easier imo

sturdy patrol
#

mmmh

#

Is there no other way to do a custom tab?

#

You you really have to create fake players? 🤔

supple elk
#

yup

#

or if there is another way, I haven't found any mention of it

#

Hypixel is doing it, so I doubt there's a better way

quaint mantle
#

How can I refresh someone's skin without NMS? I'm changing their skin in their gameprofile which is fine, except it's not updated on the player's own screen

mystic tundra
#
    public final void reloadSkinForSelf(Player player) {
        final EntityPlayer ep = ((CraftPlayer) player).getHandle();
        final PacketPlayOutPlayerInfo removeInfo = new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, ep);
        final PacketPlayOutEntityDestroy removeEntity = new PacketPlayOutEntityDestroy(new int[] { player.getEntityId() });
        final PacketPlayOutNamedEntitySpawn addNamed = new PacketPlayOutNamedEntitySpawn(ep);
        final PacketPlayOutPlayerInfo addInfo = new PacketPlayOutPlayerInfo(EnumPlayerInfoAction.ADD_PLAYER, ep);
        final PacketPlayOutRespawn respawn = new PacketPlayOutRespawn(ep.dimension, ep.getWorld().getDifficulty(), ep.getWorld().getWorldData().getType(), ep.playerInteractManager.getGameMode());
        ep.playerConnection.sendPacket(removeInfo);
        ep.playerConnection.sendPacket(removeEntity);
        ep.playerConnection.sendPacket(addNamed);
        ep.playerConnection.sendPacket(addInfo);
        ep.playerConnection.sendPacket(respawn);
        player.updateInventory();
    }
#

thats what I use

#

could you try it out? Whenever I use this everything around me loses it's texture and becomes transparent for quite a long time

#

I wanna know if it's my computer's fault or the code's

#

@quaint mantle

quaint mantle
#

that uses NMS

sturdy patrol
supple elk
#

nah I don't wanna use an API

#

thx for the links tho

paper viper
#

Bro you leaked an IP address lmao

tiny wolf
#

so ?

ivory sleet
#

Against the rules

tiny wolf
#

oh lol

#

sorry

#

Its my dbs Ip

#

Ill remove it and resend it

#
found unexpected end of stream
 in 'string', line 11, column 1:
    
    ^```
#

is basically what it says, but why would it error..

supple elk
#

how do I copy across my mask?

#

It's actually a fake player in the second screenshot

#

I copy both skin texture and signature

mystic tundra
wild inlet
#
java.lang.NullPointerException: Cannot invoke "String.length()" because "<parameter1>" is null```
#

Getting this error compiling a pretty basic project with maven

#

Anyone any idea why?

eternal oxide
#

"String.length()" because "<parameter1>" is null

wild inlet
#

But it's not really something I know how to solve

eternal oxide
#

so where are you using .length()?

wild inlet
#

Yeah that's not the issue

eternal oxide
#

yes it is

wild inlet
#

as I don't use it in that project at all 🙂

#

Probably to do with JDK setup

quaint mantle
#

there's more info in that table

wild inlet
minor garnet
#
public void drawLine(final Location start, final Location end, final double space, final boolean third) {
        final double distance = start.distance(end);
        World world = start.getWorld();
        Vector point1 = start.toVector();
        Vector point2 = end.toVector();
        Vector vector = point2.clone().subtract(point1).normalize().multiply(space);
        List<Player> list = new ArrayList<>();
        
        if (third) world.getPlayers().stream().filter(all -> !all.equals(player)).forEach(all -> list.add(all));
        else list.add(player);
        
        for (double length = 0; length < distance; point1.add(vector)) {
            list.forEach(all -> {
                all.spawnParticle(Particle.CRIT, point1.getX(), point1.getY(), point1.getZ(), 0);
            });
            length += space;
        }
    }```
so, I am wanting to make a line of particles from point a to b, but I would need to make these particles visible only to all players except a specific player, the problem is that the lines of particles are appearing in a line, it only starts at the beginning and ends at the end, does anyone know why ?
granite stirrup
#

its probs for a older version of minecraft tho

last harbor
#

I'm trying to compile a class...

ToolProvider.getSystemJavaCompiler().getTask(null, manager, null, Arrays.asList("-classpath", "spigot.yml:plugins/PlaceholderAPI.jar"), null, cl)```
I can only use the objects from spigot.jar in that class, but I can't find a way to acces PlaceholderAPI.jar too
Does anyone know how can I do that?
granite stirrup
#

just randomly found it tho

granite stirrup
#

if your trying to do things with PlaceholderAPI use its api

last harbor
#

I want to acces the classes from that jar file from the compiled class

last harbor
#

because I need to?

granite stirrup
#

just use the api?

last harbor
#

.-.

#

ToolProvider.getSystemJavaCompiler().getTask(null, manager, null, Arrays.asList("-classpath", "spigot.yml:plugins/ArandomSpigotPlugin.jar"), null, cl)

granite stirrup
#

that tells you how to use the api

#

for placeholderapi

last harbor
#

that's not what I need

granite stirrup
#

WHy

#

you havent telled me why you want to access the classes in the jar

winged ridge
#

Hello, I'm having an issue when I try to find a UUID converted to a string in a List.
https://pastebin.com/HLWXnMhr

  1. So I have UUID uuid = p.getUniqueId(); which gets the player UUID
  2. I then convert it to a string using String uuidStr = uuid.toString();
  3. Then check it was converted properly with System.out.println(uuidStr); (yes it was)
  4. And finally checks if the uuidStr is in the List players with if (e.getAction() == Action.RIGHT_CLICK_BLOCK && !players.contains(uuidStr)) {}
  5. But when II click a block I get the error in the link above
chrome beacon
#

And what's the error

winged ridge
#

the pastebin link

stone sinew
#

line 67 is null

chrome beacon
#

Well then what does it say is null

#

I'd assume players is

winged ridge
#
String uuidStr = uuid.toString();
System.out.println(uuidStr);


if (e.getAction() == Action.RIGHT_CLICK_BLOCK && !players.contains(uuidStr)) {```
chrome beacon
#

Is players null

granite stirrup
#

give all the code ?

winged ridge
#

no

eternal oxide
#

ChestListener.java:67

winged ridge
#

line 67 is the if

winged ridge
eternal oxide
#

players is null as others have said

granite stirrup
#

players is defiantly null then

winged ridge
#

I can try printing players

granite stirrup
#

do you initialize the array list?

winged ridge
#

oh it is null in fact

chrome beacon
#

Mhm

granite stirrup
#

List<String> players = new ArrayList<>();

winged ridge
#

but then how can I check if the uuid is or is not in players, if it gives me an error

eternal oxide
#

what is players supposed to contain?

winged ridge
#

UUIDS

eternal oxide
#

uuids of what?

chrome beacon
#

Well you can't check if something is in a list that doesn't exist

winged ridge
chrome beacon
#

So start by creating that list

granite stirrup
#

List<String> players = new ArrayList<>();

eternal oxide
#

and where are you putting those players IN the players list?

winged ridge
granite stirrup
#

dont set it to null

granite stirrup
eternal oxide
#

ok, I'm backing out of this one

winged ridge
#

it supposed to serialize it a json and then deserialize it

eternal oxide
#

players is null, reader is null

winged ridge
chrome beacon
#

Just replace String with UUID

earnest sonnet
granite stirrup
#

are you storing the uuid as string?

earnest sonnet
winged ridge
#

I'm storing it in a list as UUID

granite stirrup
#

pretty sure also theres UUID.fromString(String str)

eternal oxide
#

ok, your path is wrong for reading yoru json

#

/home/yot/Documents/Java/MasterSword/src/com/yot/mastersword/players.json

winged ridge
#

why?

eternal oxide
#

thats not going to resolve from the Spigot plugins folder

earnest sonnet
winged ridge
#

its a personal plugin for now

#

and it does recognize the json

eternal oxide
#

its still nto going to resolve when teh base directory is the server

granite stirrup
#

pretty sure its this yourPlugin.getDataFolder().toString() + "/players.json"

#

if you have it in your data folder for your plugin

granite stirrup
#

your gonna have to store it as a string anyway in the json

#

atleast i dont think you can store objects in json

earnest sonnet
#

Does a JsonElement count as an object ?

winged ridge
#

If I cut the code to the if statement it works fine

#

it does print all uuids

pulsar zenith
#

hey is it possible to make it possible to somehow hit through a player?

granite stirrup
#

tho if you stored a object in there it wouldnt look that nice in the file

#

and also it would be uneditable

earnest sonnet
#

As for how with maths, I can't help you xD sorry

winged ridge
#

Everything works if I check if the UUID is in the players List, but if I check if it isn't in the players List, it does not work

granite stirrup
#

¯_(ツ)_/¯

urban lava
#

when creating the first eclipse project does the name and description matter

ivory sleet
#

uh not really

#

you can always change it later anyway

sharp bough
dusk flicker
sharp bough
#

    public boolean senderIsPlayer(CommandSender sender){
        if(!(sender instanceof Player)){
            sender.sendMessage("You cant run this command on console");
            return true;
        }
        return false;
    }
}```
its just that, but i plan on adding a few more things when the sender is not player
#

so they cun run a few commands from console

ivory sleet
#
  • private final whenever possible
  • implicit else
  • try to pull out logic into functions for composition and possibly re-usability.
  • also your kitmanager, why create new instances of it all the time?
sharp bough
#

doesnt the final thing delete the variable after the code runs?

ivory sleet
#

thats not true

#

it does for local variables

#

not for instance variables/fields, nor methods, nor classes

final fog
#
PotionMeta potion = (PotionMeta) player.getEquipment().getItemInMainHand().getItemMeta();
System.out.println(potion.getColor());``` Is this how you do PotionMeta, because getColor() returns null for me.
final fog
#

getBlockX()

final fog
proud basin
#

I seem to be getting a null pointer at this line eco.bankDeposit(killer.getName(), 5); even though eco isn't null and killer isn't null

ivory sleet
#

name is null perhaps

proud basin
#

hm

#

I don't see why it would be null though

dusk flicker
#

the stacktrace would tell you everything

smoky oak
#

How can i get a baked in config file? It isn't supposed to be changed, so I don't need to write it to disk, but getConfig() only seems to work for the default config.yml that way?

torn shuttle
#

is the negative y level here to stay or is it a placeholder while we don't have pt 2 of 1.17 aka 1.18?

smoky oak
#

considering it will come in 1.18 i doubt it'll vanish

proud basin
#

?paste

undone axleBOT
torn shuttle
#

I had doubts they would make negative y values to start with yet here we are

#

it's just I'm currently working on starting a multi-month long build project for which I need to make specific world painting plugins and it would suck to start only to have 1.18 show up in 6 months and wipe it clean

final fog
#
PotionMeta potion = (PotionMeta) player.getEquipment().getItemInMainHand().getItemMeta();
System.out.println(potion.getColor());```
#

Is this how you do potionmeta, because the getColor() is returning null.

eternal night
#

Afaik colour only returns something when a custom colour is applied

#

Default potion colours through potion effect types may not Return their colour there

final fog
#

that's probably whats going on

#

So is it completely impossible to get the default potion color?

#

Or is there another way I could do this

eternal night
#

I don't know of a place where the server tracks them sadly

#

But that's just my knowledge

final fog
#

Ah, alright. Thank you.

proud basin
eternal night
#

Would greatly benefit from those java 15 npe messages

proud basin
dusk flicker
#

at me.jm.core.utils.statistics.StatisticsData.KillStats(StatisticsData.java:58) ~[?:?]

#

whats on that line

#

exactly

dusk flicker
#

How are you telling if they are not null

ivory sleet
#

I wonder that too

proud basin
#

printing them

dusk flicker
#

Can you send the entire class rather then just the line

chrome beacon
#

You can also use a newer version of Java and it will tell you what's null

ivory sleet
#

I mean it's possible the underlying shit might be badly coded

lament bronze
#

Hey so I'm currently working on a plugin api for my friend and I wanna leave him javadoc or any form of documentation.

All I know atm is that you can package the plugin and use it as a dependency but of course that removes all of my documentation.

Can anyone point me in the right direction?

ivory sleet
#

Do you use gradle?

lament bronze
#

maven

ivory sleet
#

ah sry idk maven that well

lament bronze
#

f

proud basin
#
@EventHandler
    public void KillStats(PlayerDeathEvent e){
        Player killed = e.getEntity().getPlayer();
        Player killer = e.getEntity().getKiller();
        addDeath(killed);
        int randomAmount[] = new int[1];
        if (killer instanceof Player){
            for (int i = 0; i < randomAmount.length; i++) {
                randomAmount[i] = (int) (Math.random() * 30 + 1);

            }
            addKill(killer);
            eco.bankDeposit(killer.getName(), randomAmount[0]);
        }
    }
chrome beacon
#

?paste

undone axleBOT
lament bronze
dusk flicker
#

How are you testing it EXACTLY

#

How are you triggering the event

chrome beacon
lament bronze
#
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.3.0</version>
        <configuration>
          ...
        </configuration>
      </plugin>
#

ah

#

i see

#

ill try this

proud basin
dusk flicker
#

Show us setupEconomy

proud basin
#
public boolean setupEconomy() {
        if (getServer().getPluginManager().getPlugin("Vault") == null) {
            return false;
        }
        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
        if (rsp == null) {
            return false;
        }
        econ = rsp.getProvider();
        return econ != null;
    }
#

returns true

dusk flicker
#

How are you setting 'eco'

eternal oxide
#

You have two economy type variables, econ and eco.

proud basin
dusk flicker
#

Stop sending us single lines

chrome beacon
#

And now show us the getEconomy method

dusk flicker
#

send us methods or the entire class

proud basin
#
public Economy getEconomy() {
        return econ;
    }
dusk flicker
#

show us your onEnable

proud basin
#
public void onEnable() {
        instance = this;
        scoreboardManager = new ScoreboardManager(this);

        playerManager = new PlayerManager();
        textActionBar = new TextActionBar();
        kitGui = new KitGui(this);

        registerCommands();
        registerEvents();

        saveDefaultConfig();
        config();
        
        reloadConfig();
        setupEconomy();
        getLogger().info("Setting up economy: " + setupEconomy());

        if (!Bukkit.getOnlinePlayers().isEmpty()) {
            Bukkit.getOnlinePlayers().forEach(player -> {
                playerManager.addPlayer(player.getUniqueId(), new IPlayer(player.getUniqueId()));
            });
        }

        scoreboardManager.runTaskTimer(this, 20, 20);

    }
chrome beacon
#

You're registering events before econ

#

So your eco variable is null

proud basin
#

You are right

chrome beacon
#

Tip for next time debug the variable you're using and not something else

nova mirage
#

Hi, I've upgraded my servers to 1.17 recently and I can't seem to find net.minecraft.server.v1_17_R1 (or anything similar to that) in the jar file. I used this in 1.16 to send custom packets. Is there any workaround to this?

dusk flicker
#

they removed that

chrome beacon
#

1.17 uses vanilla package names now

dusk flicker
#

wont include v1_17_R1 or anything like that anymore

nova mirage
#

ah

smoky oak
#
InputStream customClassStream = instance.getClass().getResourceAsStream(path);
        InputStreamReader strR = new InputStreamReader(customClassStream);
        return YamlConfiguration.loadConfiguration(strR);```
I'm trying to load the baked in configuration, but I always get a NPE. What does 'path' have to look like if I place a structure_config.yml in src/main/resources, whereas the plugin entry file is in src/main/java/<github path>/<plugin_name> ?
chrome beacon
chrome beacon
smoky oak
#

because i dont want to save it to file

#

*drive

chrome beacon
#

Ah

smoky oak
#

It has to be changed only on my end

#

I'm making it so that the code is easier to understand but that config file isnt supposed to actually change

nova mirage
chrome beacon
#

Methods are named a() and such in NMS

nova mirage
#

ah

#

got it, thanks

chrome beacon
#

Read the 1.17 release post for setting up mappings

eternal oxide
#

this.getResource("resourcename") returns an InputStream

smoky oak
#

yes

#

but what string to put there

#

because everything i tried got a NPE

chrome beacon
#

Name of file

eternal oxide
#

no need to drill down to the class loader

#

just the file name

jagged badge
#

I want to detect when the player drops an item in an inventory. I use InventoryAction, except that there are too many possible cases to put an item in the inventory (click, shortcut, 1 item, half, or all etc). So I wanted to know if there is something that detects the action of putting an item in an inventory, no matter how.

#

thx

smoky oak
#

@eternal oxide same issue.

#
java.lang.NullPointerException: null
at java.io.Reader.<init>(Reader.java:167) ~[?:?]```
eternal oxide
#

open your jar and see if the file is in there

chrome beacon
#

Also what did you set the string to

smoky oak
#
io
META-INF
config.yml
plugin.yml
structure.yml
structures = getDefaultConfig("structure.yml");
//...
public FileConfiguration getDefaultConfig(String configFile){
        InputStream customClassStream = getClass().getResourceAsStream(configFile);
        InputStreamReader strR = new InputStreamReader(customClassStream);
        return YamlConfiguration.loadConfiguration(strR);
    }

All that in main plugin class

#

and the file is there

chrome beacon
#

Just use getResource like ElgarL said

smoky oak
#

I did

#

it got worse

#
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:178)```
```yaml
name: OfMagic
main: io.github.moterius.ofmagic.Echo
version: 1.0
api-version: 1.17
commands:
  setspell:```
#

@chrome beacon

dusk flicker
#

does the stacktrace send anything else

#

make sure your main package is correct and the class name is correct

smoky oak
#

that it is because the rest of it works

#

also

#
at java.util.zip.ZipFile$Source.zerror(ZipFile.java:1587) ~[?:?]
at java.util.zip.ZipFile$Source.findEND(ZipFile.java:1441) ~[?:?]```
#

the hell?

dusk flicker
#

what the fuck

#

lmao

#

thats a new one for me

smoky oak
#

same

#

like

#

reboot server

#

brb

#

nope same error

quaint mantle
#

?jd

smoky oak
#

wait wth

#

the plugin works

nova mirage
zinc yarrow
#

Is Player#setPlayerListName meant to only display the list name to oneself? that's the behavior I'm getting and I need everyone's list name to display to everybody else, yet I can't find any docs for it and all setPlayerListName docs says is that it sets the players list name ..

chrome beacon
lament minnow
#

Which version of the Spigot server jar would be best for developing a plugin?

#

as in, the default, or the remapped-obf, or the remapped-mojang

#

etc

nova mirage
lament minnow
#

assume that the plugin requires the server jar

#

i am making a fork of another plugin which makes use of the server jar

#

but updating to 1.17.1 changed some obfuscations so i want to know which jar would be best to use to make things easier

winged ridge
#

Hello again, so I have an if statement that checks if a block is touched and then do some things, but it only work once, then I need to reload the plugin for it work again .
the if statement : if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {...}

quiet ice
#

remapped-mojang should be the best for you in terms of binding into it, but outside of that it might be cancer to work with

lament minnow
#

see, this is why i want a guide to convert from nms to spigot-api code

quiet ice
#

The issue is that people use NMS for 20000 reasons

lament minnow
#

if i recall correctly, using the remapped-mojang requires obfuscating the jar, because legal reasons, right

quiet ice
#

Unlikely - why exactly this is done is beyond me

lament minnow
#

oh okay

#

well that makes things easier so i am fine with that

#

i did not feel like setting up obfuscation

quiet ice
#

As long as you do not distribute that jar you should be fine

#

In almost all occasions that I have seen usage of NMS I was unable to find a 100% ideal solution that did not use bukkit api or protocollib

#

You have to make compromises when converting code, which I would only do on a case by case basis

#

but if you have any questions on how to convert something, feel free to ask; someone should be able to find a solution

urban lava
#

how do i fill out this

#

to match to what im supossed to do here

lament minnow
#

you could just do it manually

urban lava
#

how

lament minnow
#

typing in the java file

urban lava
#

i cant type in it tho

#

its a package thing

ivory sleet
#

Fill the mandatory name field

lament minnow
#

just name the file, create it, and then type

#

or copy and paste, to make it easier

urban lava
lament minnow
#

and make the name of the class the same as the name of the file

#

what is the issue

ivory sleet
urban lava
#

ok

#

thanks

#

sorry i haent done much with java i just used online compilers for the basics

#

should the name be like the io.github thing

#

ohwait

ivory sleet
#

No

urban lava
#

nvm

#

artifact

ivory sleet
#

Read on Java naming specifications

lament minnow
#

yes, NAMING CONVENTIONS

#

blessed

urban lava
ivory sleet
#

Remove the curly brackets around RandomPotionPlugin

lament minnow
#

i would recommend intellij idea, but you do not know how to use java, and i doubt that you know how to use maven, so you can stick with eclipse

ivory sleet
#

IDE is totally irrelevant

lament minnow
#

yeah

#

just recommendations

ivory sleet
#

Still

#

Won’t help him in this very case

lament minnow
#

good point

dusk flicker
#

?basics

undone axleBOT
urban lava
#

im just tryna make a basic plugin

#

datapacks are easier but way more limiting

ivory sleet
#

Correct

lament minnow
#

and also inefficient when multiple are used, according to my plugin-developing friend

#

though they can easily implement things like advancements and worldgen

#

unfortunately, i do not think that any plugin exists for eclipse or intellij which allows for easier creation of data/resource packs

#

so that sucks

#

Anyone know what PacketPlayOutNamedEntitySpawn's remapped name is? I am thinking either ClientboundAddEntityPack, ClientboundEntityEventPacket, or DebugEntityNameGenerator.

pseudo raptor
#

guys, how do I make that when a player who is in an ArrayList disconnects, its inventory is cleared?

lament minnow
#

A Spigot event exists for logging off, I believe.

#

You could make an EventHandler for that event, and make it clear the inventory.

pseudo raptor
#

I used PlayerQuitEvent, wouldn't it do?

lament minnow
#

it would

#

i believe

pseudo raptor
#

So... from the tests I've done, when the player disconnects, he automatically leaves the list, so there's no way to clear his inventory.

lament minnow
#

Oh.

pseudo raptor
#

One second, can I add him to another list when he disconnects?

lament minnow
#
@EventHandler
public void onQuit(PlayerQuitEvent event) {
   // some code for clearing inventory 
}
tall ridge
#

why can't you clear the inventory

lament minnow
#

probably because the player is off

pseudo raptor
eternal oxide
#

the player is not yet disconnected in the event

pseudo raptor
#

I tried to clear the inventory when it re-enters, but it is no longer on the list.

tall ridge
#

you have a list?

lament minnow
#

actually

#

what if you do it so it clears on join instead

tall ridge
#

either one should work...

pseudo raptor
#

Yes. For ease, imagine that when the player runs / arena, he will enter an arena. I made a list so that the player who enters does not fulfill certain events when present on it.

tall ridge
#

so check your list before you remove the player from it!!!!

pseudo raptor
#

What would be a correct way to use an ArrayList in another class? I may be using a wrong method that may be causing this.

tall ridge
#

how are you doing it now?

#

I made this example class just to test this out and this clears the player inventory on disconnect for me...public class playerQuit implements Listener{ @EventHandler public void playerLeave(PlayerQuitEvent e) { e.getPlayer().getInventory().clear(); } }

pseudo raptor
#

`` @EventHandler
public void onQuit(PlayerQuitEvent e) {
Player p = e.getPlayer();
String nick = p.getDisplayName();

    if(PNaArena.contains(nick)) {
        e.getPlayer().getInventory().clear();
    }
}``
#

I'm doing it this way

tall ridge
#

what is PNAArena

#

PNaArena*

#

that is your list?

#

it's in the same class or different class, how is it being referenced?

pseudo raptor
#

is an arraylist with the players that are in the arena. I was testing

tall ridge
#

the list isn't empty?

pseudo raptor
#

is in the same class

tall ridge
#

p.sendMessage("PNaArena.toString()"); prints out what?

pseudo raptor
pseudo raptor
tall ridge
#

or something more like list.toArray().toString() xd

pseudo raptor
#

Okay, now it's no longer removing the player when it disconnects.

#

However, it's not cleaning up his inventory either.

#

Hmmmmm, wait

wild inlet
#

I have a plugin depending on a plugin with obfuscated nms, but I only have the remapped version as a dependency. When compiling, I get this error.
Error:(50,17) java: cannot access net.minecraft.nbt.NBTTagCompound

#

Anyone got any idea how to fix that?

#

It's trying to access the obfuscated version but apparently it's cant?

tall ridge
#

@pseudo raptor do you wanna show me your list? eg public static List<Schematic> Schematic = new ArrayList<Schematic>();

proud basin
#

Since when did Essentials Eco not support bank accounts?

tall ridge
#

when will people stop throwing their money away

pseudo raptor
tall ridge
#

and show me where you add players?

#

I'd make the list static btw

pseudo raptor
#

if(args[0].equalsIgnoreCase("entrar")) {
if(!(PNaArena.contains(p.getDisplayName()))) {
PNaArena.add(p.getDisplayName());

#

basically this

proud basin
#

uh

#

why are you storing their name

pseudo raptor
#

wouldn't it be easier?

tall ridge
#

uuid's are the norm

proud basin
#

use UUID

pseudo raptor
#

it was the way they taught me

tall ridge
#

old

pseudo raptor
#

i gonna try

tall ridge
#

but I think if you make the list static it would fix everything

proud basin
#

who taught you?

tall ridge
#

That doesn't really help solve his issue tho

proud basin
#

Oh I know

#

im just curious

#

What was his issue?

tall ridge
#

Any random old information

#

it's in the chat

wild inlet
pseudo raptor
#

taking advantage of the moment, if I want to "call" an arraylist in a class from another package... how would I do that?

proud basin
#

Is it static or not?

tall ridge
#

I already told him to make it static

pseudo raptor
#

now I put it as static, but before it was just public

tall ridge
#

so does it work?

pseudo raptor
#

I will test now

tall ridge
#

and yes to your calling of methods from other classes and packages

pseudo raptor
#

`` @EventHandler
public void onQuit(PlayerQuitEvent e) {
Player p = e.getPlayer();
String nick = p.getName();

    if(PNaArena.contains(nick)) {
        p.getInventory().clear();
    }
}``
#

its correct?

tall ridge
#

It looked fine to me

proud basin
#

uh no

pseudo raptor
#

shouldn't I use OffinePlayers or something?

tall ridge
#

that exists

proud basin
#

wait... Is your list in a different class from the onQuit event?

pseudo raptor
#

no

tall ridge
#

that was my example

proud basin
#

So then why is he making it static?

novel pendant
#

Hey, does anyone know how I can fix this issue? Basically what happening is when I load the server, it's supposed to start the plugin when launching the server, but for whatever reason, the only way to get it working is to do the reload command. Im aware that its a problematic command, but the plugin doesnt work at all otherwise. Here's my on Enable

@Override
    public void onEnable() {
        instance = this;
        // THIS MUST BE FIRST ^

        this.getServer().getPluginManager().registerEvents(this, this);

        CTeam redTeam = TeamManager.getInstance().registerNewTeam("redTeam", "[RED] ", ChatColor.RED);
        CTeam blueTeam = TeamManager.getInstance().registerNewTeam("blueTeam", "[BLUE] ", ChatColor.BLUE);

        redTeam.getBukkitTeam().setAllowFriendlyFire(false);
        blueTeam.getBukkitTeam().setAllowFriendlyFire(false);

    }

I don't see anything wrong but maybe I'm missing something

proud basin
#

if it's in the same class

pseudo raptor
#

oh, so, I removed the static and left it so public

#

I'm trying to literally do everything I've learned in this short time

proud basin
#

Show me your entire class

pseudo raptor
#

Some strings are in Portuguese-br, is there a problem for you?

tall ridge
#

not for me...

proud basin
#

nope

sharp bough
#

why is private KitManager kits; null if i do it like this
but private final KitManager kits = new KitManager(); works just fine? im trying to call a class without creating a new instance of it

quiet ice
#

private KitManager kits; = private KitManager kits = null;

tall ridge
#

unlesss... kits = new KitManager();

quiet ice
#

no

sharp bough
quiet ice
#

this applies to every Object, primitives are an exception here

sharp bough
#

i now see it haha

quiet ice
#

this is also why you cannot do private final KitManager kits; without assigning it (the kits variable) at the constructor

tall ridge
#
kits = new KitManager();```
is no? geol?
sharp bough
#

so should i make it static?

sharp bough
quiet ice
quiet ice
sharp bough
#

right?

tall ridge
#

yes I know it's null first

proud basin
quiet ice
#

if you do not need an instance then make your constructor private, the class (KitManager) final and make the constructor throw the UnsupportedOperationException

#

This should prevent you from doing anything wrong

tardy delta
#

if a player is flying and i use player.setAllowFlight(false); does he falls out of the air?

sharp bough
#

yes

tardy delta
#

ah sadly yes

urban lava
#

wher is a good tutorial on how to establish commands and stuff

dusk flicker
#

?wiki

undone axleBOT
sharp bough
urban lava
#

thanks to both of you guys

#

feel free to ping me btw

#

thats how i know to check

dusk flicker
#

It woulden't be a player, itd be an OfflinePlayer, and then you can use .getUUID or a similar method

wild inlet
#

Is there any way I can adapt the specialsource remapping to also install the mojang mapped version to my m2 for use as a dependency?

dusk flicker
#

also, if its a player name remove the UUID.fromString

#

Just caught that now

wild inlet
dusk flicker
#

I know

#

there isnt a great way to do it

#

yes

#

Just it's not recommended as names arent unique

wild inlet
#

@ivory sleet Know anything about this specialsource stuff?

dusk flicker
#

hmm

#

I suck at math so maybe someone else can help lol, but if you convert that it seems right to me

tired dagger
#

Am I designing this Config properly? I feel like I am doing it wrong because other classes can create an instance of the Config class so I feel like that will lead to future issues.

upper mica
#

Hello, is there a way to increase how many slime blocks can piston push?

dusk flicker
#

looks fine for me, not sure why you needed a class for a config but it works I guess

tired dagger
sturdy patrol
#

I don't think my proposition is a good idea though ^^'

ivory sleet
#

The Server#getOfflinePlayer(name) one?

vale cradle
#

What would be the better way to listen when a class gets loaded?

#

I'd like to inject code in them ;p

eternal oxide
#

He's talking about the code written by md-5 that is used in buildtools which is all rights reserved.

ivory sleet
onyx shale
#

id like to also inject somt..

#

nvm

tired dagger
#

Rack, you think I should put the Config in the main class anyway. Does putting it in a separate class seem redundant/more complicated?

vale cradle
#

I was thinking to override the classloader with my own implementation and the previous classloader as parent but I'm not totally sure how spigot and the other plugins will take that since they use a classloader for each

tired dagger
vale cradle
#

I'd like to cover EVERY class available

#

From NMS-like classes to plugin library ones

sharp bough
#

why isint kitsInv the same as event.getInventory if i create both inventories using the same method

earnest sonnet
#

don't do that 🤦‍♂️

sharp bough
#

do what

tired dagger
sharp bough
#

wdym

tired dagger
#

Your private final Inventory kitsInv = new InventoryGuiManager().buildKitsInv(); is a different instance than event.getInventory()

#

the event.getInventory() is fired when the event occurs whereas the kitsInv = new InventoryGuiManager().buildKitsInv(); is just creating a new instance

#

You'd need to grab the event.getInventory() instance, not create a new one

sharp bough
sharp bough
#

i always do it like this

mystic tundra
#

What are some features of NMS? I know you can modify a player’s gameprofile and make custom entities, but is there anything more?

sharp bough
#

i dont get why its not working now

#

this for example

#

i made it a while ago

#

and works just fine

whole stag