#help-development

1 messages · Page 153 of 1

young knoll
#

I do love the random bullshit go approach

torn oyster
#

also is it like a new trend or something to use custom entity models

#

idk i see a few servers doing it now

torn oyster
#

i have no experience in graphic design nor 3d modelling so i cannot create models

#

and if that's what people are expecting from servers then idk what to do

fluid river
torn oyster
#

like, this is what i designed for my server's logo

#

it's so bad

young knoll
#

Times be changing

#

I think origin realms popularized a lot of it

young knoll
floral drum
fluid river
#

random bullshit

torn oyster
floral drum
#

lol fuck gfx design

#

the best I can do is this:

#

spaceship go brt

fluid river
#

working for this guys

#

coding interplanetary travels

floral drum
fluid river
#

basically several systems

floral drum
#

ima kms

fluid river
#

in each system a star and planets

#

planets rotate around the sun on circles

young knoll
#

What is this, no man’s sky

torn oyster
#

should I have an AFK kick system in my server?

fluid river
#

like 5 real days = 1 year on one planet

#

and so on

torn oyster
#

and also is TCPShield good DDoS protection?

floral drum
#

yes

fluid river
#

when you come close to the planet you get teleported to another bungeecord server

#

which contains several worlds for some of the planets

#

so there are servers for space(systems) only and for planets only

#

Moving is made with movecraft or how is this thing called

#

i just coded bungee sync

torn oyster
#

k‎‎‏‏‎ ‎y‏‏‎ ‎s = know your stuff

fluid river
#

and actual maths of planets

torn oyster
#

don't worry

fluid river
#

so they rotate around the star

#

plugin is kinda frozen cuz i'm studying

torn oyster
#

.

#

.

#

why isn't it working

#

ugh

#

_ .

#

H e l l o  t h e r e

#

there

fluid river
floral drum
#

k y s

#

ez bypass

fluid river
#

cuz k y s ¯_(ツ)_/¯

#

true

#

Choco logs in...

floral drum
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

floral drum
#

577 😭

torn oyster
#

nuker is 1st

#

lol

#

?tas

undone axleBOT
torn oyster
#

?jd

floral drum
#

L

torn oyster
#

?paste

undone axleBOT
torn oyster
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

fluid river
torn oyster
#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

fluid river
#

mommy says i'm always first

floral drum
#

?mydata

undone axleBOT
#
CafeBabe Help Menu
Syntax: ?mydata 
Commands which interact with the data CafeBabe has about you.

More information can be found in the End User Data Documentation.

**__Subcommands:__**

3rdparty View the End User Data statements of each 3rd-party mo...
forgetme Have CafeBabe forget what it knows about you.
getmydata [Coming Soon] Get what data CafeBabe has about you.
whatdata Find out what type of data CafeBabe stores and why.

torn oyster
#

?wow

#

?amanda

#

?joel

floral drum
#

?whatdata

torn oyster
#

?learnjava

undone axleBOT
fluid river
#

?getmydata

torn oyster
#

?jd Player

torn oyster
#

bruh

young knoll
#

?mydata whatdata

undone axleBOT
#

This bot stores some data about users as necessary to function. This is mostly the ID your user is assigned by Discord, linked to a handful of things depending on what you interact with in the bot. There are a few commands which store it to keep track of who created something. (such as playlists) For full details about this as well as more in depth details of what is stored and why, see https://docs.discord.red/en/stable/red_core_data_statement.html.

Additionally, 3rd party addons loaded by the bot's owner may or may not store additional things. You can use ?mydata 3rdparty to view the statements provided by each 3rd-party addition.

floral drum
#

cap

torn oyster
#

?mydata joel

undone axleBOT
#
CafeBabe Help Menu
Syntax: ?mydata 
Commands which interact with the data CafeBabe has about you.

More information can be found in the End User Data Documentation.

**__Subcommands:__**

3rdparty View the End User Data statements of each 3rd-party mo...
forgetme Have CafeBabe forget what it knows about you.
getmydata [Coming Soon] Get what data CafeBabe has about you.
whatdata Find out what type of data CafeBabe stores and why.

torn oyster
#

?mydata

undone axleBOT
#
CafeBabe Help Menu
Syntax: ?mydata 
Commands which interact with the data CafeBabe has about you.

More information can be found in the End User Data Documentation.

**__Subcommands:__**

3rdparty View the End User Data statements of each 3rd-party mo...
forgetme Have CafeBabe forget what it knows about you.
getmydata [Coming Soon] Get what data CafeBabe has about you.
whatdata Find out what type of data CafeBabe stores and why.

torn oyster
#

?mydata whatdata

undone axleBOT
#

This bot stores some data about users as necessary to function. This is mostly the ID your user is assigned by Discord, linked to a handful of things depending on what you interact with in the bot. There are a few commands which store it to keep track of who created something. (such as playlists) For full details about this as well as more in depth details of what is stored and why, see https://docs.discord.red/en/stable/red_core_data_statement.html.

Additionally, 3rd party addons loaded by the bot's owner may or may not store additional things. You can use ?mydata 3rdparty to view the statements provided by each 3rd-party addition.

torn oyster
#

what the fuck

#

how is that even possible

young knoll
#

Oh no

#

Don’t look at my message count

torn oyster
torn oyster
young knoll
#

:D

floral drum
#

probs choco

torn oyster
#

it's my goal to beat him in messages

floral drum
#

62k from choco

#

wtf

echo basalt
#

13k from me wtf

floral drum
#

Holy shit

echo basalt
#

I don't even speak that much

floral drum
#

ye bro

fluid river
floral drum
#

only 2K L

fluid river
#

just joined this month

echo basalt
#

bandit

floral drum
#

L

echo basalt
#

so are you so stfu

fluid river
#

baang

#

Fales

floral drum
#

HOLY SHIT

#

kacper?!?!

fluid river
#

freak

crimson terrace
floral drum
#

fairs shreb

fluid river
crimson terrace
#

I try my best to keep the things I wanna say together so that people who just joined the convo can get an easy view of my mental deterioration

fluid river
#

of your mental destruction

crimson terrace
#

whats the difference, really

fluid river
#

idk

floral drum
#

Found more @quaint mantle

crimson terrace
#

alex is one of if not the best person who could help you here, always active and pretty much always correct XD

crimson terrace
#

if not ima call defamation

floral drum
#

L

#

nah fam haven’t talked to raye in a month

#

someone

#

there

crimson terrace
floral drum
#

there my bio uwu

floral drum
#

lol I remember when I said this 😭

crimson terrace
rough drift
#

@floral drum

floral drum
#

see @crimson terrace

crimson terrace
#

I actually remember that message when it was sent XD

#

are you male?

#

then its normal

#

carry on, soldier

rough drift
#

my generator is um

#

Not family friendly

floral drum
#

alex can pound me 😭

crimson terrace
#

going right for the feels, huh

rough drift
#

development and sleeping

crimson terrace
#

development, sleeping and playing ark or barotrauma

rough drift
#

tf is MDMA

#

at this point I don't even play that much on my own

#

I just play if asked

crimson terrace
#

you only realize what you had when you lose it. serotonin included

#

but if you get off that it should go back to normal within some time, right

rough drift
#

I am bad at biology, what is serotonin

crimson terrace
#

happy chem

rough drift
#

I do not think I have that /s

#

that's why the /s

crimson terrace
#

not everyone knows what /s means, even I had to think

#

it means sarcasm

rough drift
#

sarcastic

#

I like killing children

crimson terrace
#

I think its more of a "I take this and get used to high af levels of serotonin"

rough drift
#

Why take happy drugs when you can just ignore the unhappy

#

ez

crimson terrace
vocal cloud
#

Imagine going to parties

rough drift
#

I actually enjoy being alone

#

as I mostly talk to myself

crimson terrace
#

what does your physique have to do with EDM

#

"big" :3

#

damn I forgor the /s

#

ik

earnest forum
#

how do I make an entity walk smoothly to a block?

crimson terrace
#

you need nms

earnest forum
#

I've been trying that but it's been weird

#

do i just have to set the navigator's target and it does it on its own?

crimson terrace
#

I think the method for entities to walk somewhere only works for a certain range

earnest forum
#
Zombie z = (Zombie) block.getWorld().spawn(block.getLocation().add(0,1,0), EntityType.ZOMBIE.getEntityClass());

        ((CraftMob)z).getHandle().getNavigation().createPath(((CraftPlayer)p).getHandle(), 1);
#

this is what i've been doing but the mob does nothing

#

¯_(ツ)_/¯

#

any idea why its not working?

#

I've found a way to use A* pathfinding to get an array of locations

#

but I don't know how to make the entity move

#

doubt it would work

#

the player's an entity anyways

#

i tried with x,y,z values didnt work either

smoky oak
#

spawn a invis villager without collision

#

try setting that as target

earnest forum
#

navigation target or regular target?

#

this happens though

#
 Villager v = (Villager) block.getWorld().spawn(block.getLocation().add(5,1,0), EntityType.VILLAGER.getEntityClass());
        v.setCollidable(false);
        v.setInvulnerable(true);
        z.setTarget(v);
#

this is my code

#

they do pathfind to it

smoky oak
#

aint that what u want

#

and just set im invisible

rapid vigil
#

Hello, I'm facing something weird, why is my NMS classes like that:

import net.minecraft.network.chat.ChatMessage;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.PacketListenerPlayOut;
import net.minecraft.network.protocol.game.PacketPlayOutNamedEntitySpawn;
import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo;
import net.minecraft.network.protocol.game.PacketPlayOutScoreboardTeam;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.EntityPlayer;
import net.minecraft.server.level.WorldServer;
import net.minecraft.world.scores.Scoreboard;
import net.minecraft.world.scores.ScoreboardTeam;
import net.minecraft.world.scores.ScoreboardTeamBase;```
Shouldn't they be coming from `net.minecraft.server.v1_17_R1` since it's my version?
```java
import org.bukkit.craftbukkit.v1_17_R1.CraftServer;
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
import org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboard;
import org.bukkit.craftbukkit.v1_17_R1.scoreboard.CraftScoreboardManager;```
Those are the only ones that contain  `v1_17_R1` for me
remote swallow
#

1st load of mc mappings
2nd load look like spigot or bukkit mappings

rapid vigil
eternal oxide
#

NMS = Mojang. CraftBukkit = Spigot. Two different imports

rapid vigil
#

For my build tools I ran: java -jar BuildTools.jar --rev 1.17.1 then I ran java -jar BuildTools.jar --rev 1.17.1 --remapped

rapid vigil
eternal oxide
#

for what?

rapid vigil
#

For nms

eternal oxide
#

You don;t see to understand what is NMS

#

NMS = all imports which start net.minecraft.server

rapid vigil
#

Yes I know but shouldn't

import net.minecraft.network.chat.ChatMessage;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.PacketListenerPlayOut;
import net.minecraft.network.protocol.game.PacketPlayOutNamedEntitySpawn;
import net.minecraft.network.protocol.game.PacketPlayOutPlayerInfo;
import net.minecraft.network.protocol.game.PacketPlayOutScoreboardTeam;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.EntityPlayer;
import net.minecraft.server.level.WorldServer;
import net.minecraft.world.scores.Scoreboard;
import net.minecraft.world.scores.ScoreboardTeam;
import net.minecraft.world.scores.ScoreboardTeamBase;
``` start with `net.minecraft.server` for me?
eternal oxide
#

Spigot API/Bukkit = all imports which are org.bukkit, but non API (implementation are org.bukkit.craftbukkit

eternal oxide
#

NMS is ONLY those starting net.minecraft.server

#

well anythign net.minecraft really

rapid vigil
#

So those imports aren't NMS?

subtle folio
subtle folio
rapid vigil
#

Then why does they not start with net.minecraft.server

eternal oxide
#

anything net.minecraft

rapid vigil
#

And they don't have v1_17_R1

eternal oxide
#

NMS is a misnomer

rapid vigil
#

Ok but shouldn't they contain the version? 1_17_R1?

eternal oxide
#

v1_17_R1 is CraftBukkit

subtle folio
grim ice
#

I imagine it would be fun but i cant bother

vocal cloud
#

Responding to an hour old message

grim ice
fluid river
#

love my country

#

police going through universities

#

grab guys to pre-army

vocal cloud
#

Sounds like sarcasm

fluid river
#

yeah

#

most of migration ways are blocked

#

you can escape getting to Ukraine if you change sex xD

#

or if you have billion usd dollas

vocal cloud
#

Or you're super out of shape.

lost matrix
vocal cloud
#

I'm glad to live in Canada.

eternal night
#

72h operation for sure 🙏 (tho I guess more of a #general discussion lol)

fluid river
#

but still

#

it's kinda scary

vocal cloud
#

Don't get drafted

fluid river
#

government stated that students are not touched

vocal cloud
#

Lots of noobs need java lessons

fluid river
#

from state universities

#

from commercial nobody gives a fuck

#

commerical students get drafted first

fluid river
eternal night
#

I presume the commercial uni students 🤔

lost matrix
#

Everyone who suffers under this extended war. So pretty much the whole world.

fluid river
#

i'm a part of endangered species

#

ones who have communist ideals

lost matrix
#

This looks like ww2 propaganda signs XD. What does it say?

smoky oak
fluid river
#

and

in our friendship we gain our power

#

300 years of ukr+rus reunion

eternal night
#

#general wen Sadge

fluid river
#

like 1960s

lost matrix
#

The statistical probability of a communist country failing is dangerously close to 100%

fluid river
#

i already discussed it here

#

guys forget to give real proofs

smoky oak
#

mostly cuz humans arent as dumb as peope believe them to be

#

its psychology

#

you get the same as everyone else

#

so working more gets punsied and working less gets rewarded

#

and it quickly collapses

fluid river
#

not true

lost matrix
#

There are real proofs. Countless. Read a history book from the last century.

fluid river
#

#general

rapid vigil
#

Hello, why does this happen when I use Mojang mappings:

fluid river
#

and i know own history more than any other country

lost matrix
rapid vigil
#

The line:
NPCManager npcManager = new NPCManager();

fluid river
earnest forum
#

this was happening to me too

fluid river
#

nms can't be found

earnest forum
#

are you using mojang mappings?

#

you need to remap it

#

its called like specialsource or something

smoky oak
#

yea theres that 1 plugin

rapid vigil
#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.17.1-R0.1-SNAPSHOT</version>
            <classifier>remapped-mojang</classifier>
            <scope>provided</scope>
        </dependency>```
#

This is my pom

smoky oak
#

look up nms mappings spigot

rapid vigil
#

Dependency

smoky oak
#

u should find a forum post by md_5

earnest forum
#
<plugin>
                <groupId>net.md-5</groupId>
                <artifactId>specialsource-maven-plugin</artifactId>
                <version>1.2.2</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-obf</id>
                        <configuration>
                            <srgIn>org.spigotmc:minecraft-server:1.19-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
                            <reverse>true</reverse>
                            <remappedDependencies>org.spigotmc:spigot:1.19-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
                            <remappedArtifactAttached>true</remappedArtifactAttached>
                            <remappedClassifierName>remapped-obf</remappedClassifierName>
                        </configuration>
                    </execution>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-spigot</id>
                        <configuration>
                            <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                            <srgIn>org.spigotmc:minecraft-server:1.19-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
                            <remappedDependencies>org.spigotmc:spigot:1.19-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
#

change 1.19 to whatever version you have installed of buildtools

smoky oak
#

?paste exists yknow

rapid vigil
#

Do I add that to my <plugins> in pom?

undone axleBOT
earnest forum
smoky oak
#

yes

earnest forum
rapid vigil
#

Oh do I just replace all the 1.19 with 1.17?

smoky oak
#

what ur compiling to

earnest forum
#

1.17.1

#

in ur case

rapid vigil
#

Lemme try

earnest forum
#

just keep in mind

#

console errors will not show unobfuscated

#

it will show as the letters

rapid vigil
#

It seems to work

#

Thanks sm :D

smoky oak
#

IntelliJ constantly tells me to download shared indexes, anyone knows what thats about?

lost matrix
smoky oak
#

lright thanks

#

also

#

do you know how annoying it is to be unable to ask this in the intelliJ discord cuz i only have one phone and two discord accounts

harsh totem
#

I added event.getInventory().setRepairCost(1); and it did nothing

lost matrix
crimson terrace
tepid ore
#

I'm trying to make a projectile invisible. I know I need to use packets for this, but I don't know how to get the packet I require. I found that I need the PacketPlayOutEntityDestroy, but I don't know how to get it. I can't find the class path for it anywhere, anyone who knows?

crimson terrace
#

or scheduling a task for the same tick is what it said exactly

smoky oak
#

can u spawn particles into world async

harsh totem
crimson terrace
#

did you delay the setting of the repair cost

harsh totem
#

no

crimson terrace
#

then I will not help you since you choose not to listen to me or smile

echo basalt
crimson terrace
#

just a quick hint tho

smoky oak
#

k thx

crimson terrace
harsh totem
#

thx

crimson terrace
#

you literally replied to the link

spiral ice
#

Hey! Might be a dumb question here but I'm trying to log bans, now obviously when someone who was online is banned that's easy. It's a kick and a ban check. But when someone is banned whilst offline it's a bit trickier.

Obviously most people would just do /ban Notch in chat, but I want to store UUIDs (for obvious reasons) so I can't just parse the arg straight up. In banned-players.json the UUID exists, but it doesn't seem to exist on the BanEntry interface, is there a way to get it easily or should I simply do an API call to mojang to get the UUID from the username that I parse from the command event?

hybrid spoke
#

you cant get something thats not there. if the server doesnt know the uuid either, you'll have to query it from mojang

spiral ice
#

I mean, technically the server knows it no? Otherwise how can it populate it in the JSON file 😛

#

But yea, querying it is 😄

crimson terrace
#

log bans as in get all bans or get all new bans?

spiral ice
#

More as in detect when a new ban is placed and do something with it

hybrid spoke
#

oh, misread. yeah well either read the file directly or query it then

crimson terrace
spiral ice
#

Yea I'm hooking into litebans etc separately, this is more for servers that don't use such a plugin

#

So for all intents and purposes I assume the vanilla ban command specifically is used for this

#

But yea, seems like easiest is still to just parse input from the command events and do the querying myself to get a UUID and go from there

#

Was hoping to avoid that due to laziness ngl 😛

smoky oak
#

is

a:b: int
a:c: int

valid? ie, can i call config.getInt("a.b") and config.getInt("a.c") ?

lost matrix
smoky oak
#

cuz this looks better than that

particle:volume: int
particle:size: double
``````yml
particle:
  volume: int
  size: double
#

1st world problems i know i know

analog vapor
#

How do I start coding spigot plugins ?

#

I have 0 knowledge about it and any coding languages

lost matrix
analog vapor
#

Ok codeacademy is good?

lost matrix
#

?learnjava

undone axleBOT
analog vapor
#

Ok thanks matey

eternal night
#

I shall also call smile matey from now on

lost matrix
analog vapor
smoky oak
#

id suggest w3 schools

lost matrix
#

Not sure what that means...

analog vapor
lost matrix
analog vapor
lost matrix
#

I learned most of my experience in spigot actually

analog vapor
smoky oak
#

well
code is mostly just locic pressed into a specific form
example
teleportation has the 'logic' of:

take object to teleport
take location to teleport it to
change the location of the object to the target location

and code just translates that into something readable for machines

public static void teleport(Object o, Location target){
    o.setLocation(target);
}
#

depending on how fast you grasp the basic concepts i guess

#

after that its not that difficult

analog vapor
#

Public static void etc I never understood what that mean

#

When i put a hour into java

lost matrix
harsh totem
#

is there a way to open an shulker box itemStack's inventory withour placing it down?

smoky oak
#

'public' -> access modifier, other things can see and use this
'static' -> can be used immediately
'void' -> what the method returns

lost matrix
#

If you got a background in maths or physics then you should be able to learn a bit faster.

analog vapor
smoky oak
#

so a 'private int' is a method that can only be used in the file its written, and it gives back an int

analog vapor
#

Yeah I am in physics maths and chemistry

quaint mantle
#

Is it good practice/safe to use methods like this? public Object getFieldValue(String field, UUID uuid) { try { PreparedStatement preparedStatement = connection.prepareStatement("SELECT " + field + " FROM players_data WHERE uuid = ?;"); preparedStatement.setString(1, uuid.toString()); ResultSet resultSet = preparedStatement.executeQuery(); if (resultSet.next()) { Object object = resultSet.getObject(field); preparedStatement.close(); return object; } } catch (SQLException exception) { exception.printStackTrace(); } return "?"; }

analog vapor
#

(i am Walter white)

lost matrix
lost matrix
hazy parrot
#

also you probably want to save uuid as byte array

#

altrought it doesn't matter much

lost matrix
#

uuids are natively supported by pretty much any sql database (excluding sqlite)

lost matrix
quaint mantle
#

so should I use method like this or no

lost matrix
#

For what purpose?

quaint mantle
#

getting values from database

lost matrix
#

I would add a type safety feature

quaint mantle
#

how can i do that

lost matrix
#
  public <T> T getPlayerValue(String fieldName, UUID uuid, Class<T> type) {
    try {
      PreparedStatement preparedStatement = connection.prepareStatement("SELECT " + fieldName + " FROM players_data WHERE uuid = ?;");
      preparedStatement.setString(1, uuid.toString());
      ResultSet resultSet = preparedStatement.executeQuery();
      if (resultSet.next()) {
        Object object = resultSet.getObject(fieldName);
        preparedStatement.close();
        if (type.isInstance(object)) {
          return (T) object;
        }
      }
    } catch (SQLException exception) {
      exception.printStackTrace();
    }
    return null;
  }
quaint mantle
#

tysm

smoky oak
#

i can feel my sanity slipping. This removes duplicates from the list right?

if(displayTimes.size()>1) displayTimes = new ArrayList<>(new HashSet<>(displayTimes));
lost matrix
# quaint mantle tysm

Btw you should not have a single connection and reuse it. For every query there should be a new connection.
A connection pool like HikariCP helps a lot with this.

hasty obsidian
smoky oak
#

k thx

lost matrix
hasty obsidian
#

ioasuihgiusdhfidfh

#

look

#

I just recently started developing with spigot

lost matrix
#

Any exceptions?

hasty obsidian
#

uhhhhhhhhh no

lost matrix
# hasty obsidian I just recently started developing with spigot

Here. I cleaned the method a bit

  @EventHandler
  public void onClick(PlayerInteractEvent event) {
    if (event.getAction() != Action.RIGHT_CLICK_BLOCK) {
      return;
    }

    ItemStack usedItem = event.getItem();
    if (usedItem == null) {
      return;
    }

    if (!ItemManager.isEffectToken(usedItem)) {
      return;
    }

    Player player = event.getPlayer();
    player.getWorld().spawnParticle(Particle.EXPLOSION_NORMAL, player.getLocation(), 1616);
    Random random = ThreadLocalRandom.current();
    int roll = random.nextInt(1, 12); // rolls from 1 to 11 (12 is excluded)

    // This should be an array to be honest
    PotionEffectType type = switch (roll) {
      case 1 -> PotionEffectType.INCREASE_DAMAGE;
      case 2 -> PotionEffectType.SPEED;
      case 3 -> PotionEffectType.JUMP;
      case 4 -> PotionEffectType.FAST_DIGGING;
      case 5 -> PotionEffectType.FIRE_RESISTANCE;
      case 6 -> PotionEffectType.WATER_BREATHING;
      case 7 -> PotionEffectType.ABSORPTION;
      case 8 -> PotionEffectType.CONDUIT_POWER;
      case 9 -> PotionEffectType.HERO_OF_THE_VILLAGE;
      case 10 -> PotionEffectType.DOLPHINS_GRACE;
      default -> PotionEffectType.LUCK;
    };
    
    PotionEffect effect = new PotionEffect(type, 1_000_000, 1);
    player.addPotionEffect(effect);
    player.getInventory().removeItem(usedItem);
  }
opal wedge
#

Hello, I am currently trying to change the world a person is sent to after defeating the Ender Dragon. I originally used the PlayerPortalEvent, but it is not called. Likewise, the PlayerTeleportEvent, for example, is not called. Is there another event than PlayerChangedWorldEvent, since I can not change the toWorld in this.

lost matrix
#

Code looks like this for people with less experience. Its fine.

lost matrix
hasty obsidian
lost matrix
#

?pdc

lost matrix
opal wedge
small current
#

right?

opal wedge
hasty obsidian
lost matrix
small current
#

oh ok

#

wait she?

lost matrix
small current
#

what does that mean

opal wedge
#

Well, at least one kind of solution thanks

lost matrix
#

Yeah but thats a bit hacky

small current
#

also couldn't we use Integer.MAX_INT as the duration ?

hasty obsidian
lost matrix
small current
#

looks ugly tbh

#

Integer.MAX_INT feels better

lost matrix
hasty obsidian
#

uhhhhhhhhhhhh

rapid vigil
#

Hey, question rq, is there a way to make Git bash use a specific java version you choose?
Let's say you have 3 java versions, and you want to let Git bash use a specific one that u choose is it possible

lost matrix
opal wedge
#

Hm, PlayerMoveEvent is not called :/ then i have to use the changedworld event.

lost matrix
rapid vigil
#

Ohh thanks so much

hasty obsidian
lost matrix
hasty obsidian
#

ok

opal wedge
#

All good, I'll settle for the bypass :p

rapid vigil
lost matrix
hasty obsidian
rapid vigil
lost matrix
hasty obsidian
lost matrix
hasty obsidian
lost matrix
#

Then add debug messages and see where you messed up

hasty obsidian
lost matrix
# hasty obsidian ._.

So this method simply says "Whatever you pass me, its my special effect token. Doesnt matter."

hasty obsidian
#

so uhhhhhhhh how do I not do that

lost matrix
#

Only return true if the passed ItemStack is your special effect token

hasty obsidian
#

so like if(ItemStack == effecttoken){
return true;
}

grizzled pollen
#

do not use == here

#

use #equals() or ItemStack#isSimilar

hasty obsidian
#

oke

lost matrix
#

For custom items you should always use pdc

#

But this is maybe too complex for you right now... So isSimilar should work for now

grizzled pollen
#

I did not copy because then there would be no fonts, and without fonts it is not beautiful ;-;

hasty prawn
#

You need an /equals raw that sends it with the markup

grim ice
#

What is the best way of recognizing inventories

#

I assume it's not using inventory holders

grizzled pollen
#

actually for that too

lost matrix
hasty prawn
#

You need to compare 2 itemstacks

#

usedItem.isSimilar(tokenItem)

fickle mist
#

Hi all! Now I'm redoing the plugin for Stamina, and I have a question how to make a separate action bar like in the EXP action bar

hasty prawn
#

Wdym a separate action bar?

#

There's only the single action bar in vanilla above their health, if you want to make a custom one then you need resource packs

lost matrix
hasty prawn
#

You'd still use the regular actionbar, you'd just send things with different ascent values for the lines

#

Or negative space if you want to go to the left

hasty obsidian
hasty prawn
#

Then they aren't similar

remote swallow
hasty obsidian
#
        if (usedItem.isSimilar(effecttoken)) {
            return true;
        }
        return true;
    }

}```
remote swallow
#

Where are you setting effecttoken

#

Also your gonna need an else statement on that

hasty obsidian
remote swallow
#

Add
else {
Return false;
}

hasty obsidian
#

ok

hasty prawn
#

Or just make the 2nd one return false

#

Or even better just return usedItem.isSimilar(effecttoken); 😛

untold jewel
#

This is not spigot related, but is there any way to make a good UI with java? The normal GUI is just so ugly and extremely wack to use

hasty prawn
#

Swing and JavaFX are the only official options I think

#

But they have LookAndFeel "themes" to make them look less shit KEKW

untold jewel
#

kekw

#

thanks!

lost matrix
#

A Player will never be equal to a String

#

And no this doesnt crash the server

hasty prawn
#

It cant

#

I can almost guarantee that if you send a crash report, those two lines are not why it happened.

wind tulip
#

Just a heads-up, the tag namespace is from another plugin

rapid vigil
#

Helloo,
I wanna ask about something that seems a bit weird.
Why when I run BuildTools on a version other than 1.17.1, such as 1.16.3 it just works how I want it to, it allows me to use all the NMS classes and they are just net.minecraft.server.v1_16_R2
But when I run BuildTools on 1.17.1, It's different the classes are like:
net.minecraft.network.protocol.game.PacketPlayOutScoreboardTeam So 1.16.3 is: net.minecraft.server.v1_16_R2.PacketPlayOutScoreboardTeam why is that happening in 1.17.1?

wind tulip
#

that is not on the server, but that shouldn't matter I think?

eternal oxide
#

net.minecraft.server.v1_16_R2 does not exist

rapid vigil
lost matrix
# rapid vigil Helloo, I wanna ask about something that seems a bit weird. Why when I run Build...

Since 1.17 there are no spigot mappings anymore. If you want to use nms then read this page and scroll down to nms:
https://www.spigotmc.org/threads/spigot-bungeecord-1-17-1-17-1.510208/

eternal oxide
#

v1_16_R2 is a CraftBukkit identifier and nothing to do with NMS

eternal oxide
#

org.bukkit.craftbukkit.v1_16_R2exists. There is nonet.minecraft.server.v1_16_R2`

hasty prawn
wind tulip
#

yeah wait that's an oopsie

lost matrix
#

Ah nullVar is the opposite of what you want to check? You should still overwrite equals

wind tulip
#

ah alright nevermind it is being found I'm an idiot

#

thanks

hasty prawn
#

Doesn't IntelliJ intelligently generate equals() or am I on drugs

wind tulip
#

I think the real issue was that I put DFType.TXT instead of DFType.NUM in the 2nd constructor

#

I thought the tag was just not being found but oh well

#

yeah alright that fixed it

lost matrix
hasty prawn
#

Right yeah

#

I knew you could manually do it but I couldn't remember if it just does it by default

lost matrix
hasty prawn
#

Yeahhhhh

#

prayge intelliJ

lost matrix
#

This does the same

hasty prawn
#

I refuse to use Lombok

#

Not for any reason in particular I'm just stubborn

last igloo
eternal night
#

are you using the properly remapped 1.19 dep ?

#

or how are you setting up NMS

honest echo
#

hello

#

when i try sending message with a unicode it works fine but when i try getting a string from config that has unicode

#

it dosent work

#

is there something wrong i am doing

#

my config is formatted in UTF-8 and afaik it supports unicode

eternal oxide
#

How are you reading from your config?

honest echo
eternal oxide
#

Then your config file can;t be saved as UTF8

honest echo
#

i opened it with a text editor and it says my config is UTF-8

eternal oxide
#

is that the config on your test server or the one in the project before you build?

honest echo
#

in test server

eternal oxide
#

Then you'll need to show us your loading/reading code you use to access the filer

#

?paste

undone axleBOT
eternal oxide
#

replace all that saving code with in your onEnablejava saveDefaultConfig();

#

That creates folders if it needs to and only saves the resource if it doesn;t exist

#

as for the rest, looks fine

#

args[0] is the first argument for a length == 1

warm light
#

default spawned mob's PersistentData will always be empty right?

honest echo
remote swallow
#

?configuration

honest echo
#

and it does the same the way how im saving

remote swallow
#

i can never get those right

untold jewel
#

so if the config does not exist you save it?

remote swallow
honest echo
untold jewel
# honest echo ...

try converterting the char to unicode value and save this int to your yml file. And for loading vice versa: load the int from the yml and convert from unicode value to character.

#

could work, there may be a better method but I dont know it

eternal oxide
#

Config fully supports unicode

honest echo
eternal oxide
#

If its not working for you its in how you are saving/loading. Which is why I asked to see code.

untold jewel
#

ElgarL do you put yourself with * perm on GroupManager?

eternal oxide
#

myself?

#

no

remote swallow
#

setting * perm is just a bad idea in the first place

untold jewel
#

Just read a post the other day where you answered someone and said you did, but you only played on your server or something so it didnt matter

eternal oxide
#

No, I was included in the sample file as mod

untold jewel
#

oh nvm then

eternal oxide
#

I recently removed all examples though. It got annoying when people didn't see the purpose of an example.

mellow edge
#

Inside InventoryMoveItemEvent when I try to just cancel the event and remove an item from the hopper, instead of one item being removed, the hole stack is removed. I have been stuck in that problem for hours now.

  e.setCancelled(true);
  ItemStack stack = e.getItem();
  inv.removeItem(stack); //with amout of 1
#

does anyone know why?

eternal oxide
#

you told it to remove a stack

#

adjust stack size

mellow edge
#

how did I told it to remove a stack? The item stack has the amount of 1. I printed the value out

tardy delta
#

heehee

eternal oxide
#

if there is only 1 in the stack then removing 1 IS the stack

mellow edge
#

no, for example if I have 32 items in the hopper, executing this code will remove all 32 items

#

(in the same stack)

remote swallow
#

do end crystals and tnt trigger the BlockExplodeEvent if a block explodes

eternal oxide
#

It will try to remove 'as much as possible' from the types and amounts you give as arguments. ```
mellow edge
#

what should I use then?

eternal oxide
#

setAmount

mellow edge
#

ok

#

do I need to update the slot after setting the amount?

eternal oxide
#

test and see

#

no clue

mellow edge
#

ok thanks

tardy delta
#

afaik not

eternal oxide
#

probably not though

tardy delta
#

the only time i worked with inv api is when i made a hardcoded shop gui

civic wind
#

Can anyone tell me why it won't let me call getDataConfiguration? Am i missing something?? I'm trying to recode an old plugin i had made for my server and can't work out why it won't let me call for it when i'm pretty sure I have everything there??

tardy delta
#

getter where

harsh totem
#

I'm trying to open a shulker box ItemStack's inventory and for some reason it does not work. it does'nt open the shulker box's inventory at all. any ideas?

            if(item.getItemMeta() instanceof BlockStateMeta){
                BlockStateMeta im = (BlockStateMeta)item.getItemMeta();
                if(im.getBlockState() instanceof ShulkerBox){
                    ShulkerBox shulker = (ShulkerBox) im.getBlockState();
                    event.getPlayer().openInventory(shulker.getInventory());
                }```
#

the item is the shulker i already checked

civic wind
tardy delta
#

uhh idk i refuse to use lombok

civic wind
#

and why?

tardy delta
#

why are you showing getter for chrystal class tho

#

yes

lost matrix
harsh totem
#

it opens the inventory of the shulker for like a tick and then closes it

lost matrix
#

Show what the "end" is

harsh totem
lost matrix
#

Oh it actually opens it?

#

Well then its clear. One tick later.

harsh totem
lost matrix
#

Yes this one line

harsh totem
lost matrix
#

Show your new code pls

harsh totem
# lost matrix Show your new code pls
    public void onRightClick(PlayerInteractEvent event){
        if (event.getAction() == Action.RIGHT_CLICK_AIR && event.getItem().getItemMeta().getPersistentDataContainer().has(new NamespacedKey(plugin, "Insee"), PersistentDataType.INTEGER) && event.getItem() != null){
            ItemStack item = event.getItem();
            System.out.println(1);
            if(item.getItemMeta() instanceof BlockStateMeta){
                System.out.println(2);
                BlockStateMeta im = (BlockStateMeta)item.getItemMeta();
                if(im.getBlockState() instanceof ShulkerBox){
                    System.out.println(3);
                    ShulkerBox shulker = (ShulkerBox) im.getBlockState();
                    Bukkit.getScheduler().runTaskLater(plugin, () -> {event.getPlayer().openInventory(shulker.getInventory());}, 1);
                }
            }
        }
    }```
tardy delta
#

early returns where

#

atleast people know that && exists

#

:D

harsh totem
#

are you still here?

#

😢

lost matrix
#

Just tested your code. It works without a problem for me.

  @EventHandler
  public void onRightClick(PlayerInteractEvent event) {
    ItemStack usedItem = event.getItem();
    if(usedItem == null) {
      return;
    }

    ItemMeta meta = usedItem.getItemMeta();
    if(!(meta instanceof BlockStateMeta stateMeta)) {
      return;
    }

    BlockState blockState = stateMeta.getBlockState();
    if(!(blockState instanceof ShulkerBox shulkerBox)) {
      return;
    }

    event.getPlayer().openInventory(shulkerBox.getInventory());
  }
tardy delta
#

yes

harsh totem
#

how is this working for you and not me

lost matrix
harsh totem
#

it couldn't have messed with it

lost matrix
#

Did you try out exactly this piece of code?

harsh totem
# lost matrix Did you try out exactly this piece of code?
    public void onRightClick(PlayerInteractEvent event){
        if (event.getAction() == Action.RIGHT_CLICK_AIR && event.getItem().getItemMeta().getPersistentDataContainer().has(new NamespacedKey(plugin, "Insee"), PersistentDataType.INTEGER)){
            ItemStack usedItem = event.getItem();
            if(usedItem == null) {
                return;
            }

            ItemMeta meta = usedItem.getItemMeta();
            if(!(meta instanceof BlockStateMeta stateMeta)) {
                return;
            }

            BlockState blockState = stateMeta.getBlockState();
            if(!(blockState instanceof ShulkerBox shulkerBox)) {
                return;
            }

            event.getPlayer().openInventory(shulkerBox.getInventory());
        }
    }```
lost matrix
#

Try opening the inventory you get from getSnapshotInventory()

#

What version are you on?

harsh totem
lost matrix
#

Do you have any other plugins installed?

harsh totem
harsh totem
lost matrix
# harsh totem also, that did not help

Well ive tested this exact code on 1.17 1.18 and 1.19 without any problem. You broke something somewhere.
Try getting the inventory snapshot beforehand and open the inv 5 ticks later. idk

harsh totem
#

i will restart the server

lost matrix
#

Dont you dare telling me that you used /reload

harsh totem
trim creek
#

if reload is that bad, why does it exists actually?

lost matrix
#

There is a good reason that the reload command tells you that it practically destroys your server.

remote swallow
#

isnt /reload an mc command

lost matrix
#

Reload is not supported by spigot

trim creek
harsh totem
#

@lost matrix I restarted it and it still didn't change anything

lost matrix
#

Like... is this message not enough?

trim creek
#

i understand that message, but then if it is not supported, why don't they remove it?

lost matrix
#

Because some people actually understand how to utilize this method

trim creek
#

now, that tells everything

harsh totem
#

why doesn't it work 🥹

trim creek
lost matrix
harsh totem
#

i used the exact code that you sent me. you say it works for you but it doesn't work for me

lost matrix
#

Create a clean plugin. Create a clean server. Only add this one listener to your plugin and then test it out in a clean environment.

harsh totem
#

I can screen share it

lost matrix
#

Create a clean plugin. Create a clean server. Only add this one listener to your plugin and then test it out in a clean environment.

harsh totem
#

the server has no plugins other than this one and i already told you that none of my listeners can even effect the problem

remote swallow
#

do it anyway

lost matrix
civic wind
#

It's saying error on the material id but im using 1.19???

#

This is correct for 1.19 no??

harsh totem
#

@lost matrix Ok idk what i did but it does open it now. the only problem is that it does not save the inventory after i close it which mean that i can take stuff out and it would still be in the shulker box. you have any ideas?

harsh totem
#

don't use legacy materials

civic wind
#

Why?

#

It was working on my other server

remote swallow
#

There legacy

harsh totem
#

it's not java edition

civic wind
#

what do i use instead?

remote swallow
#

GRAY_STAINED_GLASS_PANE

harsh totem
#

the normal material without the legacy

#

yes

civic wind
#

hmm im confused bcos i didnt type legacy

harsh totem
#

the ide

civic wind
lost matrix
harsh totem
#

idk how

civic wind
harsh totem
civic wind
#

they arent

#

thats a small portion of the config

harsh totem
#

ok, still. why are all the 4 things the same

civic wind
#

Its a gui...

harsh totem
#

ok

civic wind
#

Why is it making it legacy I don't understand

harsh totem
#

idk

#

sorry

eternal oxide
#

legacy materials = didn;t include an API version in your plugin.yml

civic wind
#

ahhhhh

#

thanks man

elfin folio
#

Hi, I am working on a plugin that stores a lot of data, and I saw in the papermc changelogs that yaml files are default limited to 3mb because of an "upstream commit". I was wondering if that commit is from spigot (or if spigot shares the same upstream commit)

eternal night
#

spigot does also have said limit

elfin folio
#

the original plan was to leave the option for YML as a legacy feature, but if the size limit also applies to spigot I would need to remove yml entirely in 1.19+

#

3mb? Paper changed the default to 64 because of YML misuse but I'm assuming spigot does not change it

opal juniper
#

if you have a 3MB yaml file, its time to use a database

#

especially if you are making the plugin now

elfin folio
#

Was the limit introduced in 1.19 or has it been around for a while?

eternal night
#

spigot has an open issue about it

#

the limit was introduced midway through 1.19.2

opal juniper
#

it was less that spigot introduced it and more that they bumped the version of a lib

eternal night
#

as snakeyml had a vuln

elfin folio
#

Okay thank you guys

opal juniper
eternal night
#

well

#

their 1.32 also had bugs 😂

#

paper's limit increase didn't even work

#

until like just now

opal juniper
#

Ah yes

eternal night
#

not because of paper just snakeyml being dumb

elfin folio
#

Me and the other maintainer already wanted to phase out yml in favor of SQLite, and if there's a 3mb limit in 1.19 now seems like the opportune time to drop yml support entirely

eternal night
#

yea I'd highly suggest so too ^

elfin folio
#

If you guys don't know this answer that's fine, but is there a way to increase the size limit in code or is it hard set by the API?

opal juniper
#

time for spigot to bring back the plugin beans ORM database

eternal night
#

code wise you are fucked

#

on spigot

elfin folio
#

It would be nice be able to do the migration in 1.19 instead of making the user downgrade their version to migrate the data

eternal night
#

I mean, paper fixes it

#

so that should be most of your userbase I presume

#

but the value is sadly hardcoded

#

if spigot updates to 1.33 snakeyml you can fix it with reflection (or potential API)

elfin folio
#

Okay so I'll just put a really big warning on the download that says MIGRATE BEFORE YOU UOGRADE

eternal night
opal juniper
eternal night
#

you can watch this issue for spigot

elfin folio
#

I have a love hate relationship with reflection

eternal night
#

Well, the issue suggests API or increase in the limit

#

I am certain one of the things will happen

#

as enough plugins use yaml like that sadly

#

so spigot should get a few reports here and there till its "fixed"

opal juniper
#

reminds me of that python thing the other day. they introduced a integer limit for the int() function

#

at least, i think it was limited to that

eternal night
#

avrg python moment

elfin folio
#

Lol

#

Python moment

#

Well thanks for the info, I think we'll just drop yml support entirely for 1.19+

opal juniper
#

what is the plugin?

elfin folio
#

Signshop

opal juniper
#

ok makes sense that a big yaml file would appear

#

does worldguard still use yaml?

elfin folio
#

Yeah some of the files are in excess of 50MB so a storage overhaul is well overdue

#

We're defaulting to SQLite going forward and I've always hated the YML implementation signshop uses it's really ugly

opal juniper
elfin folio
#

2.1gb 😭

#

In a YML file 💀

eternal night
#

Lol XD

#

Speed

smoky oak
#

but its bad

elfin folio
#

Eh huge DBs are not as bad

#

That's me, all the time

smoky oak
#

does anyone know what the client particle lifespan is?

#

looks like the minecraft demo world

#

wdym how?

red sedge
#

Okay lets say I have 1000+ custom items, would it be better to always store them in a hashmap on memory or construct them from a file when needed?

#

I feel like while yes constructing them would take more power it wont waste as much memory

#

but idk how big an ItemStack is so I cant really say much

#

?

compact haven
#

keep them in memory

#

unless you don't plan on all of them being used in the duration of the plugin

shy forge
#

PreparedStatement.getResults() returning null

compact haven
#

if then, then load the config into memory, and when needed load it then

#

at that time, keep it cached as an itemstack or whatever

tardy delta
#

i made a LazyValue<T> class which only loads stuff when needed

red sedge
#

Well I mean I dont expect all 1000 items to be used at any given time

compact haven
#

then load whatever file it is into memory (memory is cheap, i/o is not)

#

then parse once needed, keep cached

#

now the only time that doesn't hold true is if your file is literally gigabytes large

#

is it?

red sedge
#

Uh I dont think so

compact haven
#

then yes do what I suggested xd

red sedge
#

Okay okay

#

so

#

instead of loading everything at the start

#

i'd just laod the items as theyre asked for

compact haven
#

what's the context in which they're asked for

#

like how does that work

#

as in, what event prompts you to load the items

red sedge
#

well

#

All custom items are already gotten from a method

#

so I can just add a check to see if that item with that id isnt loaded

#

load it and then give it back

compact haven
#

that is not what I asked

red sedge
compact haven
#

my only problem with loading them at the time they're requesting is the small amount of processing time it'll take to parse the content

#

whatever, just do as I said, I'm sure it's fine

#

but regardless, even 1,000 itemstacks in memory is likely quite handleable

#

I don't know what your plugin is and you don't seem to want to elaborate given your answers, so just choose either; they're both fine

#

loading them at load time would increase the time it takes for the server to start, loading them at "an item being required"-time is negligible given it's only 1 at a time and the file is already in memory

#

make sure your file is in either yml or json objects when loaded into memory, definitely do not parse it over and over again each time it's required

vivid skiff
#

How can i fix this error:

org.bukkit.command.CommandException: Unhandled exception executing command 'malatiadicacca' in plugin Diarrea|
 v1.0                                                                                                        |
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[patched_1.12.2.jar:git-Paper-162|
0]                                                                                                           |
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[patched_1.12.2.jar:git-P|
aper-1620]                                                                                                   |
        at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:685) ~[patched_1.12.2|
.jar:git-Paper-1620]                                                                                         |
        at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1492) ~[patched|
_1.12.2.jar:git-Paper-1620]                                                                                  |
        at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1297) ~[patched_1.12.2.jar:|
git-Paper-1620]                                                                                              |
        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[patched_1.12.2.jar:gi|
t-Paper-1620]                                                                                                |
        at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.12.2.jar:git
-Paper-1620]
        at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtil```
#
s.java:14) ~[patched_1.12.2.jar:git-Paper-1620]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) ~[patched_1.12.2.jar:git-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:850) ~[patched_1.12.2.jar:git
-Paper-1620]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.2.jar:git
-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.2.jar:git
-Paper-1620]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.12.2.jar:g
it-Paper-1620]
        at java.lang.Thread.run(Thread.java:829) [?:?]
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
        at me.gurwi.commands.DiarreaCommand.onCommand(DiarreaCommand.java:28) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[patched_1.12.2.jar:git-Paper-162
0]
        ... 15 more```
smoky oak
#

so 1st off format it properly or use ?paste

#

2nd ly it says right there

#

DiarreaCommand line 28

#

ur telling it to fetch a value it doesnt have

shy forge
lament swallow
#

hey does anyone know why minecraft doesn't autocomplete with large data sets?

@Override
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
    if(args.length == 1) {
        ArrayList<String> possibleArgs = new ArrayList<>();
        possibleArgs.add("set");
        possibleArgs.add("remove");
        return possibleArgs;
    } else if(args.length == 2 && args[0].equals("set")) {
        ArrayList<String> stringParticles = new ArrayList<>();

        for(Particle particle : Particle.values()) {
            stringParticles.add("minecraft:" + particle.toString());
        }

        return stringParticles;
    } else {
        return new ArrayList<>();
    }
}```

I'm returning all of the particles in the game but the game doesn't seem to autocomplete when I type stuff (It still shows all of the particles as arguments tho)
tardy delta
#

return Arrays.asList hehe

hasty prawn
#

You have to use StringUtils.copyPartialMatches() for it to return the ones that match whatever you're typing

tardy delta
#

i love that method

hasty prawn
#

Otherwise I think it just always suggests all of them no matter what you're typing

hasty prawn
#

👌

red sedge
#

is there anyway to have a string list in a pdc

graceful magnet
#

no, not directly. you can use a byte array though
what most plugins do though is something along the lines of String.join("\n", List) though, and then #split on the way out. which may or may not work for what you want.

green prism
#

Do you guys have any fancy portfolio to take inspiration?

echo basalt
#

I just look at 7smile7's code until I feel sad

eternal night
#

the best way to spend an evening

echo basalt
#

worst way to spend 5 minutes

hasty prawn
#

That's the way I feel when I look at any of you people's code

#

Makes me feel like a dumbass angery

green prism
#

could you give me an opinion about my portfolio design? maybe in dm

#

please

echo basalt
#

Im... Still busy

#

Buying candy so I can cope with this crippling anxiety

green prism
#

take a look at my dm

sterile token
#

Hi how are you people?

#

Im again fucking up haha

#

I would like to learn if its possible to catch the netty instance from the spigot

graceful magnet
#

could you elaborate on what you mean by "catch the netty instance from the spigot"? what are you trying to do and how would you define success?

sterile token
#

Im looking a way to get the spigot netty instance

#

I ask it because im on holidays and i need to relax a bit

echo basalt
#

What for?

sterile token
#

I will do some hacky things

#

Its for a self Project

#

I just need to know if posible or not?

eternal night
#

Generally tho ServerConnectionListener

#

holds the channel futures and connections

#

I presume that is what you mean with "netty instance from spigot"

graceful magnet
#

you can also use ChannelInitializeListener for a less hacky solution

sterile token
#

Hmn

graceful magnet
#

oh that is paper only though, sorry. won't work on spigot.

sterile token
#

I need the boostrap one if possible

#

Because i need to register a custom protocol

fluid cypress
#

is it fine if i use a Location object as key for a hashmap?

small current
#

What is the map for

fluid cypress
#

a map of invisible armor stands, using its location as key

#

floating text basically

agile anvil
#

Why would you need to store them within a location ?

small current
#

Why not the entity

agile anvil
#

Are you ever going to fetch then by there location ?

fluid cypress
#

i want to be able to toggle setCustomNameVisible at will, and i can do that after i spawn the armor stand of course, and store it somehow

#

but then, after i restart the server, i need to get that entity object again somehow, right?

small current
#

Spawn a new one

fluid cypress
#

so i guess i will get those entities objects again on an entity load event or someting

agile anvil
#

i'd rather go for a List of entities or Armorstands

fluid cypress
small current
#

Exactly

agile anvil
#

Or just add a PDC to the entities to mark them as holograms

small current
#

Thats why you shouldnt do holograms with entities

fluid cypress
#

how then

#

well, thats basically what i was planning to do

small current
#

You can do the pdc thing and load them from world getentities or something

small current
agile anvil
#

I'd rather work with packets in that case. No need to worry about the entity

fluid cypress
#

mm and how do i do that

small current
#

👍

fluid cypress
#

packetlistener api or something like that

#

?

agile anvil
#

No need

small current
#

You have to send packets not listen

wet breach
#

for what?

fluid cypress
#

and how do i do that, i dont really know much about the spigot api

wet breach
#

UUID gets you the entity everytime

small current
#

Well the problem is

#

Its not spigot api

wet breach
#

what isn't spigot API?

#

o.O

small current
#

Nms

#

👍

wet breach
#

entities have UUID's because it comes from NMS

fluid cypress
wet breach
#

spigot API isn't what gives entities UUID's

small current
wet breach
#

oh ok

fluid cypress
#

well, its for a specific location and a single use on my server, so i will just create entities

wet breach
fluid cypress
#

but then i need to fetch those entities again somehow on each server startup

small current
#

Store the uuids

fluid cypress
#

can i use World#getEntities for that?

small current
#

Why not

wet breach
#

you need the location so you can load the chunk

#

use the UUID to fetch the entity there

fluid cypress
#

because i read in the spigot forum that sometimes it doesnt return all the entities

#

maybe that was fixed long time ago

small current
#

Yes cause chunks

wet breach
#

not sure what you been reading o.O

silk elk
#

I'm trying to prevent players from removing items from a GUI but cancelling InventoryClickEvent sometimes doesn't work and they can move the items out of the GUI. Any ideas?

small current
#

Ghost items?

silk elk
#

Nope they're real

small current
#

Errors?

silk elk
#

None

small current
#

Inventories are scary... debug

fluid cypress
#

so, i can just do World#getEntities and look for the one with the same uuid? or should i get the chunk first?

wet breach
fluid cypress
wet breach
#

it will only get entities of currently loaded chunks

fluid cypress
#

well, then thats the problem

small current
#

You will stop caring about these stuff as you learn more

wet breach
#

but I told you to just store the location of the entity so you can load the chunk at will

fluid cypress
#

there will be no chunks loaded when starting the server

small current
wet breach
#

you can't interact with entities in unloaded chunks anyways

fluid cypress
#

right, and just by getting the chunk it will be loaded?

small current
#

Yeah ig

wet breach
#

there is methods in the API where you can stick the location into it and it will load the chunk

#

and then instead of searching the chunk of entities, you just use the method to of getEntity() and stick its UUID in that

#

now you have your entity object

fluid cypress
#

ok i will do that then, thanks

wet breach
#

idk

near kite
#

Accidently sent it

#

Before I was finished

#

How can I Make spigot mc api load a Java class from something that isn’t related to Minecraft

wet breach
#

you don't need the spigot api for that

#

you could just make your own classloader

near kite
wet breach
#

but you only need a classloader if the classes weren't loaded before

near kite
#

Because I wanta run something that isn’t mc related

#

Aka doesn’t effect the mc server but loads with the plug-in folder

wet breach
#

Ah, yeah you can just easily make your own classloader

near kite
#

ok

#

Ima google

wet breach
#

just keep in mind, the spigot API will not be exposed to that thing

near kite
#

How would I make the class loader work with spigot mc though

wet breach
#

so if you need that thing to access spigot API, your plugin will need to expose it to that thing

near kite
#

Will it just load it

#

Anyway

wet breach
#

it will just load it given there is no errors

#

but I am just informing about the API thing, because your classloader will prevent it from accessing classes from the parent classloader due to how hierarchy works

vestal moat
#

creeperz, you still have to figure out how to actually get the prebot jar lol

vestal moat
#

you want to load a "class"

#

but you forgot, where this class is

near kite
#

ok

vestal moat
#

most likely, inside a jar

near kite
#

I’ll look at files

vestal moat
#

but wait.. what jar?

near kite
#

Why’s prebot so complicated

#

Wats core for

vestal moat
#

what?

#

any noob developer will understand it

near kite
#

I know what core does

#

But why? Do you need it

vestal moat
#

core is the core of prebot lol

#

the actual prebot

#

ok mind moving from here?

near kite
#

Also you don’t have fking a run_mac.bat

#

Lmao

vestal moat
near kite
#

Still should be supported

vestal moat
#

let's move from here please

near kite
#

why

vestal moat
near kite
#

no it doesn’t

#

Dms