#help-development

1 messages · Page 1423 of 1

quiet ice
#

I have no idea why I thought this convo talked about PDC, disregard my comments 😅

vernal basalt
#

ok so ```java
org.bukkit.inventory.meta.Damageable helmetdamagedam = ((org.bukkit.inventory.meta.Damageable) p.getInventory().getHelmet().getItemMeta());
helmetdamagedam.getDamage()

gets the damage but why dont items with damage have item meta?
#

how do i get the item meta from an item that has damage but no meta

wraith rapids
#

there is no such item

#

the only item without item meta is air

#

and air is not damageable

quiet ice
#

in pre 1.13 it is a bit different

wraith rapids
#

yeah that shit uses like damage values or some shit, dunno

cold field
#

Guys, just wondering, why doesn't my compiler give "method not used" warning on method with annotation @fresh templetHandler?

wraith rapids
#

because you have the mcdev plugin

#

that does it by default

cold field
#

oh

#

wow

wraith rapids
#

you can also manually tell your IDE not to give the warning if a method is annotated with a specific annotation

cold field
#

that was I were actually searching

#

How can I do that?

devout estuary
#

So how do you make a plugin compatible from 1.8 to 1.16.5? You just develop for 1.8 and hope for the foreward compatibility?

wraith rapids
#

it's under the "more actions" drop down

cold field
#

I was expecting something that does it automatically

#

XD

#

Do I need to write my own plugin for IntelliJ or it exists something more fast?

wraith rapids
#

why

cold field
#

I just don't like warnings

wraith rapids
#

just click the button?

cold field
#

mhh

#

I could do that

wraith rapids
#

you only need to do it once

cold field
#

Oh really?

#

Wow

wraith rapids
#

or did you think you'd have to do it for every method individually

cold field
#

every method XD

wraith rapids
#

dumb

cold field
#

I know

opal juniper
#
[21:33:52] [Server thread/WARN]: Tried to load a DUMMY block entity @ BlockPosition{x=16, y=11, z=-117} but found not block entity block Block{minecraft:stone} at location
[21:33:52] [Server thread/WARN]: Tried to load a block entity for block Block{minecraft:stone} but failed at location BlockPosition{x=16, y=11, z=-117}
[21:33:52] [Server thread/ERROR]: Block at 15, 11, -115 is Block{minecraft:stone} but has net.minecraft.server.v1_16_R3.TileEntityChest@772398c2. Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
[21:33:52] [Server thread/ERROR]: Block at 15, 11, -115 is Block{minecraft:stone} but has net.minecraft.server.v1_16_R3.TileEntityChest@772398c2. Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.
[21:33:52] [Server thread/ERROR]: Block at 15, 11, -115 is Block{minecraft:stone} but has net.minecraft.server.v1_16_R3.TileEntityChest@772398c2. Bukkit will attempt to fix this, but there may be additional damage that we cannot recover.

Anyone know why this is?

#

Code:

#
    @EventHandler
    public void chunkLoad(ChunkLoadEvent event){
        if (!event.isNewChunk()) return;
        Chunk chunk = event.getChunk();

        for (int y = 0; y <= 150; y++) {
            for (int x = 0; x <= 15; x++) {
                for (int z = 0; z <= 15; z++) {
                    Block block = chunk.getBlock(x,y,z);
                    setBlockFast(block,Material.STONE);
                }
            }
        }
    }

    public void setBlockFast(Block block, Material type) {
        CraftBlock cb = (CraftBlock) block;
        net.minecraft.server.v1_16_R3.Chunk chunk = ((CraftChunk) block.getChunk()).getHandle();
        IBlockData data = CraftMagicNumbers.getBlock(type).getBlockData();
        chunk.getWorld().notify(cb.getPosition(), cb.getNMS(), data, 0);
        chunk.setType(cb.getPosition(), data, false);
    }
#

i feel like it is because they have not been set yet, therefore there is a placeholder block

#

However i am not familiar with world gen

sharp bough
#

how can i acces that chest var in a scheduler ?

lilac dagger
#

that's a local variable

sharp bough
#

yea

#

but i cant use it?

lilac dagger
#

only from an inner scope

#

but wait

#

a schelduer loses variable info

sharp bough
#

this works

lilac dagger
#

it can only work if you use an atomic integer that way

sharp bough
#

is that the best way of doing it?

lilac dagger
#

well

#

that's a constant

#

so yes

#

better

#

but better is an atomic integer

gaunt eagle
#

I'm going to make an arena joining sign for a minigame.
How can I see the exact spawn location of the sign here?

#

i know this is a stuip question xD

opal juniper
#

What?

#

Like what are the coords?

gaunt eagle
#

so

#

The sign is placed in the 2nd block. Can I find it by climbing above block 1, or can I find it by climbing above block 2?

sharp bough
#

event.getblock.getlocation

#

lol

#

on right click

#

if the block is sign

modern fox
#
piece.getItem().isSimilar(e.getNewArmorPiece())

for some reason this doesn't work

gaunt eagle
sharp bough
#

like X Y Z?

gaunt eagle
#

yeap

vast quest
#

Can someone tell me whats wrong I get this error while trying to package my plugin using Intelij Maven Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project ServerGlobal: Fatal error compiling

sharp bough
#

event.getblock.getlocation.getblockX

#

i think

#

event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.CHEST

#

Block b = event.getClickedBlock();

#

b.getLocation().getBlockX();

vast quest
#

.

sharp bough
#

or just block b = event.getclickedblock.getlocation.getblockx

modern fox
#
piece.getItem().isSimilar(e.getNewArmorPiece())

for some reason this doesn't work

vast quest
torn oyster
#

uhh i managed to change name above player but i kinda have an issue

#

why is their name red there

rotund pond
#

Hey !
How is that possible ? xD
There's nothing to help me 😦

somber hull
#

Are webhooks integrating with discord and Minecraft simple to use?

#

Or will that be confusing to figure out

torn oyster
#

@rotund pond i can't do anything with that

#

send the whole error

quiet ice
#

The JVM is eating the exception

rotund pond
wispy fossil
#

where

torn oyster
#

oh

#

lol

rotund pond
#

How the fuck is that possible xD

quiet ice
#

Basically try-catch everywhere, make sure to not use any JVM flags that can cause this

#

Additionally this exception might have been suppressed by the JVM because it got fired too often, in that case you would need to check whether it was thrown anytime prior

rotund pond
#

Oooh okay

torn oyster
quiet ice
#

The third cause is a plugin misbehaving (for example a plugin calling Syserr.println(ex.toString()))

rotund pond
#

Well wtf xDD

queen dragonBOT
torn oyster
#

?paste

quiet ice
torn oyster
main dew
quiet ice
#

?

#

did you try git clone https://gitlab.com/Dymeth/physicscontrol.git?

#

Alternatively, import to github (it supports cross-site repo migration) and clone from there

#

Alternatively, import to github (it supports cross-site repo migration) and clone from there

#

If I posted that twice, then sorry, discord is strange

main dew
quiet ice
#

I do not have an idea on what you are talking about

main dew
quiet ice
#

Ah you mean that

#

You can always clone manually and import as a maven project

rotund pond
#

Hey, by the way, I've found my error...

I've added something like 20 entries in my config file, but I didn't delete my last one 😦

main dew
#

how now work xD

quiet ice
#

nuke all .iml files

#

Or just ignore them

#

And that people, is why you should not commit IDE config files

opal juniper
#
[22:02:46] [Server thread/WARN]: Tried to load a DUMMY block entity @ BlockPosition{x=-98, y=20, z=-325} but found not block entity block Block{minecraft:stone} at location
[22:02:46] [Server thread/WARN]: Tried to load a block entity for block Block{minecraft:stone} but failed at location BlockPosition{x=-98, y=20, z=-325}

anyone know what this is?

#

I am setting blocks to stone

#

and i have dealt with the tile entities

#

however i still get an error with the Dummy block entities

quiet ice
#

you could use bukkit to handle blocks with the block entities instead of whatever you are using; even if it will be slower

opal juniper
#

this is mostly nms stuff, i didn't know there was a bukkit interface

quiet ice
#

use the bukkit setblock one, but idk

#

anyways, gtg, cya

opal juniper
#

oks

livid tundra
#

how can you share an array across two event classes? I want to store the blocks players place in an array that will be changed when an entity moves

opal juniper
#

Do you mean Classes or methods?

torn oyster
proper notch
sage swift
#

why are you changing the player's name

torn oyster
#

im chaing the name above their head

#

it works

#

it just does that though

#

and i dont rlly like it

sage swift
#

that's gonna cause a lot of issues with other plugins i think

torn oyster
#

im only gonna be using worldedit, worldguard and luckperms

#

and my plugin

#

and changing names isn't for ranks

#

its to show their team in the minigame

sage swift
#

not using other plugins is not really an excuse for bad code

#

look at how TAB does it, go from there.

torn oyster
#

tab?

#

oh

#

i know

#

okayt

#

where would be the part

#

where they get the name

#

and change it

#

or whatever

#

@sage swift what is the class where they change it

#

im trying to make it 1 method ideally

#

cuz im only trying to change their name

#

not add like 50 other lines

sage swift
#

why would i know

torn oyster
#

idk

sage swift
#
    private void loadNametagFeature(TAB tab) {
        if (tab.getConfiguration().config.getBoolean("change-nametag-prefix-suffix", true)) {
            if (tab.getConfiguration().config.getBoolean("unlimited-nametag-prefix-suffix-mode.enabled", false) && ProtocolVersion.SERVER_VERSION.getMinorVersion() >= 8) {
                tab.getFeatureManager().registerFeature("nametagx", new NameTagX(plugin, nms, tab));
            } else {
                tab.getFeatureManager().registerFeature("nametag16", new NameTag(tab));
            }
        }
    }```
torn oyster
#

what do i do with that

#

how do i use the TAB api

#

i need documentation

sage swift
#

you dont use the api, you look at how they do it

#

i provided a starting point.

torn oyster
#

i could try using teams

#

idk how to start

#

i update scoreboards every second so i think that will bug out teams

#

do you know how to use teams for updating name above heads

opal juniper
torn oyster
#
                if (location.getWorld().getNearbyEntities(location, 1.0, 1.0, 1.0).size() != maxIdleEntities) {
                    location.getWorld().dropItemNaturally(location, drop);
                }```
#

the maxIdleEntities is 4

#

and there is 7 diamonds just sitting there

wraith rapids
#

=

torn oyster
#

oh lmao

#

im so dumb

#

also im getting kicked for this

#

by this code

#

?paste

queen dragonBOT
torn oyster
#

i copied it cuz idk how

#

apparently it changes ur name

#

which it does

#

but it kicks u

#

when u kill someone

#

or reload

random epoch
#

The name field cannot be greater than 16 characters

torn oyster
#

yeah but my minecraft name is Quared

#

and it adds a chatcolor to the start

#

wait

#

does this method change the .getName() method

#

in a player

random epoch
#

It also counts color characters

torn oyster
#

how do i make it not do that

#

would this change a player .getName()

#

@random epoch

wraith rapids
#

i'm sure he appreciates the ping

sand vector
#

In my Yaml file i have itemNames which holds different strings. Is there an easier way to get the total amount of children stored in itemNames, or do you have to loop through it?```
itemNames:
1: thing 1
2: thing 2
3: thing 3

wicked remnant
#

or getStringList

#

or whatever else the values may be

#

then .getLength or whatever

sand vector
#

ok thanks

maiden thicket
wicked remnant
#

^^ better

#

You'll be querying less data with taahanis way, which is better

sand vector
#

ok

graceful turret
#

how to get number of mined stone?

wraith rapids
#

ask the player nicely

bitter mural
#

Hey! Any great videos for getting set up with intellij? I'm an experienced Java Developer with limited intellij experience and beginner-level spigot plugin development experience. In other words, I know how to code, I just need the specific knowledge for creating spigot projects in intellij

eternal night
#

besides that, plugin development on intellij really just mirrors development of any java project with the respective build tool

#

besides that, plugin development on intellij really just mirrors development of any java project with the respective build tool

bitter mural
#

Thank you!

sharp bough
#

whats the state of a block? ```BlockState getState()
Captures the current state of this block. You may then cast that state into any accepted type, such as Furnace or Sign.
The returned object will never be updated, and you are not guaranteed that (for example) a sign is still a sign after you capture its state.

Returns:
BlockState with the current state of this block.```

#

like if its placed or not?

#

im using
Block b = chestLocation.getBlock();
Chest chest = (Chest) b.getState();

#

tag me please

quaint mantle
sharp bough
#

i always do it this way, get the block, cast the state of the block to a chest and then get the inv of the chest

#
        Chest chest = (Chest) b.getState();
        Inventory chestInv = chest.getInventory();```
#

but never really understood what the state of a block is

sage swift
#

Tile entity

#

For example a chest has tile entity info on whether it's open, what items are inside, etc.

wraith rapids
#

the state of a block represents a snapshot of a block's state

#

that is, a snapshot of all information pertaining to that block

#

orientation, location, type

#

for tile entities, the actual tile entity itself

#

the written text on a sign, the contents of a chest

sharp bough
#

ah thank you

stone light
#

So I'm trying to create a plugin that is like hungergames and the seed will reset every game I'm just wondering how I would go about doing that, I'm pretty new to plugin dev

leaden imp
#

Could someone help me please?
There is a trouble with creating somekind of "SignEditor" (sign inputs) for 1.12.2 version - player is able to see sign and sign's updated content, but editor doesn't open.

Code - https://pastebin.com/xDqW0Mee (this class doesn't contain listener, because i'm in halfway of rewriting deleted version in rage)
Original post with images - https://spigotmc.org/threads/opensigneditor-packet-doesnt-work-properly.504262/

torn oyster
#

when i do World#dropItemNaturally or World#dropItem it spawns in with a momentum

#

to the side

#

why

#

why cant it just spawn there

#

and not move

wispy fossil
#

hmm
try treating it as an entity and #setVelocity?

torn oyster
#

setVelocity to 0,0,0?

wispy fossil
#

try that
idk if itll work

leaden imp
wispy fossil
#

your profile picture hurts me

leaden imp
#

why 3:

wispy fossil
#

i am in genuine throbbing pain

torn oyster
#
                    Item i = location.getWorld().dropItemNaturally(location, drop);
                    i.setVelocity(new Vector(0.0, 0.0, 0.0));```
#

or dropItem

#

which one

leaden imp
#

.dropItem(...) + .setVelocity(new Vector())

young knoll
#

If I recall correct dropItemNaturally adds random offsets

#

So you probably want dropItem

wild steeple
#

anyone knows whats the material for crops ?

#

i need wheat, carrots and potatoes.

young knoll
#

Pretty sure it’s just Wheat, Carrots, and Potatoes

wild steeple
#

if (data == 7) {
e.getPlayer().sendRawMessage("This worked. Here's a cookie !");
ItemStack cookie = new ItemStack(Material.COOKIE, 1);
e.getPlayer().getInventory().addItem(cookie);
e.getPlayer().updateInventory();
}

#

^ im trying to do something simple here, this works. but I need it to work for certain stuff.

#

for example

#

how do i use the black thing around the code

young knoll
#

3 `

torn oyster
#

how do i set what y level the void is

#

cuz i want it to be at Y 0

#

but its -63

young knoll
#

Probably a hardcoded value in NMS

wild steeple
#
        e.getPlayer().sendRawMessage("Yes, This worked. Here's a cookie !");
        ItemStack cookie = new ItemStack(Material.COOKIE, 1);
        e.getPlayer().getInventory().addItem(cookie);
        e.getPlayer().updateInventory();
        }
drowsy helm
#

void is hardcoded in minecraft

young knoll
#

But you could probably use a runnable or the move event to damage players

drowsy helm
#

it's not something you can change

torn oyster
#

bruh moment

drowsy helm
#

you can probably replicate it but can't change it

young knoll
#

You need to wrap all your || in another pair of brackets

torn oyster
#

can i fire the damage event with EntityDamageEvent.Cause.VOID when someone goes below Y=0

drowsy helm
#

that will never get satisfied

young knoll
#

If (A && (B || C || D))

wild steeple
wild steeple
drowsy helm
young knoll
#

How do you event damage a player with a certain cause

drowsy helm
#

a block can't be a carrot

#

or wheat

wild steeple
#

well, it's a crop not a block.

young knoll
#

Yes it can?

drowsy helm
#

ah gotcha

young knoll
#

What do you think the block form is called

drowsy helm
#

forgot crops were a thing hush

wild steeple
#

still doesn't work

torn oyster
#

how do i call and event

#

an

drowsy helm
#

why not use a collection or array and matc hit

#

instead of doing it one by one

young knoll
#

Are you in modern versions

wild steeple
torn oyster
#

wdym

#

who u talking to

young knoll
#

Ah, legacy material names, good luck

torn oyster
#
    @EventHandler
    public void onMove(PlayerMoveEvent e) {
        Player p = e.getPlayer();
        if (p.getLocation().getY() <= 0) {
            Bukkit.getServer().getPluginManager().callEvent(???);
        }
    }```
#

what

#

what do i do from here

drowsy helm
#

create a new event

torn oyster
#
new EntityDamageEvent()```
#

lol

#

prolly so wrong huh

drowsy helm
#

yes

#

with parameters

#

not sure if cerating an event will actually damage them tho

torn oyster
#

ik

#

it wont

young knoll
#

No, neither will calling it

#

You have to damage them yourself

torn oyster
#

i know

drowsy helm
#

well it actual might damage the player

#

it's a cancellable event, thus meaning theres a handler that damages them at the end

torn oyster
#

there is a damage parameter

young knoll
#

It doesn’t damage the player

astral zodiac
#

Description: Exception in server tick loop

java.lang.NullPointerException: Exception in server tick loop
at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:343)
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:218)
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:809)
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164)
at java.lang.Thread.run(Unknown Source)

#

can somone help?

torn oyster
#

works ty

astral zodiac
#

wdym?

drowsy helm
#

this is help-dev

torn oyster
#

that isnt code

astral zodiac
#

So where do i get help for that?

drowsy helm
#

what is it relating to

#

because "help please" doesn't give much background

#

when does it happen

quartz anchor
sullen marlin
#

perhaps share what the issue was?

wild steeple
#

okay i made my switch to the latest version.

#

if (ageable.getAge() == ageable.getMaximumAge() && b.getType() == Material.WHEAT || b.getType() == Material.POTATO || b.getType() == Material.CARROT)

#

for some reason it works with wheat but not carrots.

#

idk about potatoes ill check

#

yeah also doesn't work with potatoes.

summer scroll
#

what are you trying to do?

wild steeple
#

I'm trying to detect whether the crop is fully grown before harvested.

summer scroll
#

and also add a ( )

wild steeple
#

perhaps it is Material.POTATOES and Material.CARROTS ??

summer scroll
#

yeah, change it to that material.

#

(A && (B || C || D))

wild steeple
#

Yeah, I changed it. had to change the code so i figured removing the whole thing and i forgot to add it.

wild steeple
young knoll
#

Plural is the crop, singular is the item

#

Why? Who knows

worldly ingot
#

mojang

#

however it does kind of make sense. there is a single carrot in the item texture, but multiple carrots in the crop texture ;p

summer scroll
#

How can I convert &bPrefix to &b[Prefix] with code?

dusty herald
#

wym? 👀

summer scroll
#

Example I have a command with argument &bPrefix

#

oh god, bit hard to explain

dusty herald
#

That would be a hassle to implement, I suggest just adding the brackets manually Kek

summer scroll
#

yea i thought so, it's gonna be complicated

dusty herald
#

it would give the end-user more customization, if they want to use brackets, parenthesis, or nothing at all

summer scroll
#

agreed, i'm just wonderin' anyway

#

thanks

dusty herald
#

np c:

shut fractal
#

Currently trying to make a plugin and i am using the playerDeathEvent i am trying to respawn the player after using Player player = e.getEntity(); then using player.spigot().respawn() to respawn the player. this works if i do /kill myname but if i die to a skeleton it gives a null error saying Removed entity while ticking.

sage swift
#

add a delay possibly?

shut fractal
#

to the respawn or entire but of code on death?

sage swift
#

respawn

#

unless you do other stuff after the respawn, then put that stuff in there too

#

whyy does BlockPistonRetractEvent get called once for the piston itself and once for all the blocks

#

in one the direction is the way the piston is facing and getBlocks is empty

shut fractal
#

i died to a spider and it worked with the delay. that may have fixed it. Thank you 🙂

sage swift
#

in the other the direction is the way the blocks are moving and getBlocks actually has blocks

slate pendant
#

Is this discord server also related to Bungeecord (I wanted to ask a question)? Or I should try search for it again in google

sullen marlin
#

yes

#

see topic

slate pendant
#

can I connect a player to a server which is not in the config?

sullen marlin
#

not without a plugin designed to do that

slate pendant
#

or I should update and reload config

#

I mean with plugin

sullen marlin
#

you need to create a ServerInfo and add it, see ProxyServer.constructServerInfo

slate pendant
#

ok, thank you

torn oyster
#

why is this getting a skeleton_skull im on 1.8

                    ItemStack skull = new ItemStack(Material.SKULL_ITEM);
                    SkullMeta skmeta = (SkullMeta) skull.getItemMeta();
                    skmeta.setOwner(ChatColor.stripColor(pp.getPlayer().getName()));
                    skmeta.setDisplayName("e");
                    skull.setItemMeta(skmeta);```
#

nvm

#

had to set the durability

#

lmfao

sage swift
#

1.8, lol

#

never gets old

#

(the meme, not 1.8)

quaint mantle
#

how can i properly copy world and load it without getting error?
So i have a folder in my plugin where you have three variants of worlds that will copy to player and then load it but i am getting an error when loading the world.

Code: https://paste.md-5.net/oximenajuh.java
Error: https://paste.md-5.net/zitinozuje.sql
outer crane
chrome beacon
#

^^ Now that's a good idea if you're making a minigame

outer crane
#

Which sounds like something they're doing since i cant imagine anyone wanting to handle large file operations in a plugin

chrome beacon
#

^^

quaint mantle
#

i didnt

chrome beacon
#

What are you using this for then?

quaint mantle
#

So i have a folder in my plugin where you have three variants of worlds that will copy to player and then load it but i am getting an error when loading the world.

chrome beacon
#

Yeah we know that but why

quaint mantle
#

what why

outer crane
#

that sounds like a perfect use for a-swm, either way, you might want to consider using java 14+ for useful nullpointers

quaint mantle
#

okayy

#

@outer crane

outer crane
#

objectset is null

quaint mantle
#

yeah and what is that?

outer crane
#

at pavlyi.customer.worldcontrol.utils.WorldHandler.createWorld(WorldHandler.java:45) ~[?:?]

quaint mantle
#

Hello, here! What should I do so that only certain players can see and pick up items? I looked it up on Google, but it's not there. I think we should use the packet.

quaint mantle
outer crane
#

either WorldCreator returned null or instance returned null

#

likley something with worldcreator

quaint mantle
#

ill try bukkit

#

bcz instance cant be null

#

tried World newWorld = Bukkit.getServer().createWorld(creator); same error

chrome beacon
#

What spigot version are you using?

quaint mantle
#

1.16.4

chrome beacon
#

Update

quaint mantle
#

what?

chrome beacon
#

Update to the latest version of Spigot

quaint mantle
#

okay

tepid willow
#

Hey ya'll.

I cannot figure out this error:

04:01:35 ERROR]: Could not load 'plugins\GarrysEmeralds-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Symbol does not appear in the shape:83
quaint mantle
#

could you send full stack trace?

tepid willow
#
[04:01:35 ERROR]: Could not load 'plugins\GarrysEmeralds-1.0-SNAPSHOT.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.IllegalArgumentException: Symbol does not appear in the shape:83
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:139) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
    at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:382) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
    at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:224) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
    at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:928) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
    at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_282]
#
Caused by: java.lang.IllegalArgumentException: Symbol does not appear in the shape:83
    at org.apache.commons.lang.Validate.isTrue(Validate.java:93) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
    at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:128) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
    at org.bukkit.inventory.ShapedRecipe.setIngredient(ShapedRecipe.java:113) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
    at io.github.garrysemeralds.EmeraldHelm.<init>(EmeraldHelm.java:52) ~[?:?]
    at io.github.garrysemeralds.MainPlugin.<init>(MainPlugin.java:12) ~[?:?]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_282]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[?:1.8.0_282]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:1.8.0_282]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[?:1.8.0_282]
    at java.lang.Class.newInstance(Class.java:442) ~[?:1.8.0_282]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:76) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:135) ~[spigot.jar:3059-Spigot-4225eac-7ea8b96]
    ... 7 more
quaint mantle
#

whats at the line 52 in EmeraldHelm?

#

and at line 12 in MainPlugin?

tepid willow
#

Line 52:
recipe.setIngredient('S', Material.STICK);
Line 12:
EmeraldHelm emeraldHelm = new EmeraldHelm(this);

chrome beacon
#

And S is inside the recipie?

quaint mantle
#

could you send the whole method in EmeraldHelm?

tepid willow
#
public class EmeraldHelm {

    private final MainPlugin mainPlugin;

    public EmeraldHelm(MainPlugin plugin) {

        this.mainPlugin = plugin;
        // Our custom variable which we will be changing around.
        ItemStack item = new ItemStack(Material.DIAMOND_HELMET);

        // The meta of the diamond sword where we can change the name, and properties of the item.
        ItemMeta meta = item.getItemMeta();

        // We will initialise the next variable after changing the properties of the sword

        // This sets the name of the item.
        // Instead of the § symbol, you can use ChatColor.<color>

        assert meta != null;
        meta.setDisplayName("§aEmerald Helmet (Blue)");

        // Set the meta of the sword to the edited meta.
        item.setItemMeta(meta);

        // Add the custom enchantment to make the emerald sword special
        // In this case, we're adding the permission that modifies the damage value on level 5
        // Level 5 is represented by the second parameter. You can change this to anything compatible with a sword
        //item.addEnchantment(Enchantment.DURABILITY, 3);

        // create a Namespaced Key for your recipe
        NamespacedKey key = new NamespacedKey(plugin, "emerald_helmet");

        // Create our custom recipe variable
        ShapedRecipe recipe = new ShapedRecipe(key, item);

        // Here we will set the places. E and S can represent anything, and the letters can be anything. Beware; this is case sensitive.
        recipe.shape("EEE", "E E", "   ");

        // Set what the letters represent.
        // E = Emerald, S = Stick
        recipe.setIngredient('E', Material.EMERALD);
        recipe.setIngredient('S', Material.STICK);

        // Finally, add the recipe to the bukkit recipes
        Bukkit.addRecipe(recipe);
    }
}
#

OH

#

DERP

quaint mantle
#

you dont have S anywhere?

tepid willow
#

S isn't in the recipe

#

im so dumb

quaint mantle
#

yeah things happen sometimes

tepid willow
#

I was copy pasting this across so many methods and this is the first one that had a blank in a row

#

or not use a stick

#

thank you

faint shadow
#
        Iterator<Recipe> it = Bukkit.getServer().recipeIterator();

        Recipe recipe;
        while (it.hasNext()) {
            recipe = it.next();
            if (recipe instanceof FurnaceRecipe || recipe instanceof BlastingRecipe) {
                if (((CookingRecipe<?>) recipe).getInput().getType() == Material.NETHER_GOLD_ORE) {
                    it.remove();
                }
            }
        }
#

why isnt this working

quiet ice
#

in what type

faint shadow
#

it isn't removing recipe

quaint mantle
#

Hello, here! What should I do so that only certain players can see and pick up items?
Here's my code:

ItemStack i = new ItemStack(Material.OAK_LEAVES);
                    EntityItem item = new EntityItem(((CraftWorld) event.getEntity().getWorld()).getHandle(), 1, 1, 1);
                    item.setLocation(smarlet.getLocation().getX(), smarlet.getLocation().getY(), smarlet.getLocation().getZ(), 0 ,0);
                    item.setItemStack(CraftItemStack.asNMSCopy(i));
                    PacketPlayOutSpawnEntity packet = new PacketPlayOutSpawnEntity(item, 2);
                    ((CraftPlayer) entity).getHandle().playerConnection.sendPacket(packet);``` But not working. and not erros
#

just do event PlayerPickupItemEvent or smth like that

#

no thanks, i don't want do that 🙂

pine crystal
#

how should i register a command?

quaint mantle
#

getCommand("commandName").setExecutor(new CommandClass());

pine crystal
#

i tried that and got java.lang.NullPointerException: null

quaint mantle
#

could you send whole error?

pine crystal
#

yea 1 sec

#
java.lang.NullPointerException: null
        at core.Main.initilize(Main.java:19) ~[?:?]
        at core.Main.onEnable(Main.java:14) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.16.5.jar:git-Paper-648]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:380) ~[patched_1.16.5.jar:git-Paper-648]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.16.5.jar:git-Paper-648]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:501) ~[patched_1.16.5.jar:git-Paper-648]
        at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:415) ~[patched_1.16.5.jar:git-Paper-648]
        at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:591) ~[patched_1.16.5.jar:git-Paper-648]
        at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:281) ~[patched_1.16.5.jar:git-Paper-648]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1065) ~[patched_1.16.5.jar:git-Paper-648]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:289) ~[patched_1.16.5.jar:git-Paper-648]
        at java.lang.Thread.run(Thread.java:830) [?:?]
quaint mantle
#

whats on this 19 in Main

pine crystal
#

this.getCommand("spawn").setExecutor(new SpawnCommand());

quaint mantle
#

do you have spawn in plugin.yml?

pine crystal
#

oh

#

i didnt do that

quaint mantle
#

then ig that is error

pine crystal
#

there isnt a way to register commands without adding each one in plugin.yml?

quaint mantle
#

nope

chrome beacon
#

There is but don't

quaint mantle
#

wait there is?

pine crystal
#

why not?

chrome beacon
#

You can mess directly with the command map

#

Please don't do that

faint shadow
pine crystal
#

would that require reflections or something

chrome beacon
#

Don't be lazy and add it to your plugin.yml

quaint mantle
#

yeah its quicker

pine crystal
#

alright thanks

chrome beacon
pine crystal
#

oh ok

pine crystal
ivory sleet
#

That won’t work

#

It just throws NullPointerException if the value passed is null

pine crystal
#

Oh alright

ivory sleet
#

I mean I would do smtng like this

PluginCommand command = super.getCommand("spawn");
if (command == null) {
  new RuntimeException("Missing command property in plugin.yml").printStackTrace();
  super.getServer().getPluginManager().disablePlugin(this);
  return;
}
command.setExecutor(new SpawnCommand());
pine crystal
#

I'll just make sure to add each command in plugin.yml, I won't be making this plugin public anyways

#

Thanks for the help, I just started java yesterday

violet depot
#

How Can I Replace All Mobs Texture With One Mob Texture Eg. Creeper?

ivory sleet
#

Oh yeah then just ignore the warning prim

pine crystal
#

👍

ivory sleet
#

You’d have to use some sort of resource pack I guess

#

Or maybe that’s not even enough

#

Well, you could technically do nms stuff

#

And mess with packets

potent condor
#

yeh, packets

violet depot
#

Yes I tested it with resource pack by replacing every mob png with Creeper.png but You know every mob have different Head and Body texture etc.

pine crystal
#

You can override the mob geometry in a resource pack too

ivory sleet
#

Hmm yeah jackwasd probably a very hacky solution if it even works

pine crystal
#

Couldn't you set the custom geometry for the entity through the api?

potent condor
#

you could set the mob invisible if it's not what mob you want them to look like them use a mob of whatever type you want them to look like with no ai at the location of those mobs, you'd probably wanna do quite a bit of trial and error to find your preferable method for look/feel but this way could work
however if you can achieve this differently with a resource pack that'd be better for sure
a datapack may work for you aswell?

ivory sleet
#

Ultimately setup a packet listener which listens for outcoming packets then manipulate all entity related packets so that they contain the entity type id of a creeper.

violet depot
pine crystal
#

Do what conclure just said

violet depot
pine crystal
#

I didnt really help much but you're welcome

ivory sleet
#

I think protocollib has an api or smtng for doing that so you don’t have to mess with raw netty and nms

violet depot
#

I prefer making plugin rather than a resource pack.

ivory sleet
#

Sure

sage dock
#

and it is possible to make the spigot server send packets to bungeecord? Or is it impossible to do this?

quaint mantle
sage dock
#

thx

maiden briar
vast quest
#

How can I detect if the player is jumping

outer crane
#

its hard- jumping is mostly client side

quaint mantle
outer crane
#

(if you are making a paper plugin you can use Paper's jump event)

quaint mantle
#

You should use the pick up item event. Listen to it and simply cancel the event.
Depending of your minecraft version, you have the PlayerPickupItemEvent or the EntityPickupItemEvent (you'll have to check if the entity is a player).

#

Or you can try Player#setCanPickupItems(); but idk if that works

vast quest
vast quest
young knoll
#

Listen for the statistic increment event and check if it’s the jump stat

#

Probably the most reliable ish way

vast quest
#

yeah but uh... jump stat increases when water makes u jump aswell

summer scroll
#

check if the player is in water, maybe?

young knoll
#

Yeah you can do some filtering to try and make it more accurate

wraith rapids
#

or just use paper :fingerguns:

quaint mantle
quaint mantle
#

i want another player not to see

wraith rapids
#

send a entity destroy packet in the pickup event for every other player

young knoll
#

For see you probably need some packets

wraith rapids
#

the picking up animation is clientside

quaint mantle
#

yaaa

young knoll
#

I’m curious on the implementation of papers event

#

You could probably copy it

wraith rapids
#

which event are we talking about

quaint mantle
#

hmm

#

you meant, we need destory packet in pickup event?

#

ok i'm going to start learn event packet

young knoll
#

The jump event

quaint mantle
#

what

wraith rapids
#

it's in the playerconnection class

#

basically just checks if the player is trying to move upwards and if the player is currently on the ground

#

with a few other checks here and there

quaint mantle
#

hmm

#

im first at packet, and I can't understand sryt

#

What I understand is as follows. PickupItemEvent uses Destory packets to do well.

young knoll
#

Interesting

sour rampart
#

is there something like config.getRecipe() because my plugin needs to save custom recipes in the config so they can be accessed when the server restarts

plain quest
#

how can i import a decompiled jar to intellij and edit it as if it were a normal one that i created? (it doesn't have to do directly with spigot but i'm really confused)

quiet ice
#

IntelliJ isn't the best IDE for that, I recommend recaf or similar

#

Otherwise, decompile manually with Fernflower or another decompiler

wraith rapids
#

serialize your recipe into something that can be stored in the config

chrome beacon
#

Recaf = Epic

opal juniper
#

So, i am trying to make it so that the terrain only genertates in a, lets say, 2 block wide strip on the x axis, as if you were playing terraria. There are two ways of doing this as far as i am aware and wondered if i could get some help:

  1. Make a custom terrain generator that only generates the blocks needed. This would be ideal, however i do not know if i can 'inherit' the default algorithm and then manipulate it so that things like lava pools still form, just only 2 blocks of them.

  2. Listen to an Event such as the Chunk load event and then manipulate the block data. This is definitely more expensive, but i am just trying to get it to work. I keep getting this error:

[12:17:31] [Server thread/WARN]: Tried to load a DUMMY block entity @ BlockPosition{x=-223, y=22, z=-535} but found not block entity block Block{minecraft:stone} at location
[12:17:31] [Server thread/WARN]: Tried to load a block entity for block Block{minecraft:stone} but failed at location BlockPosition{x=-223, y=22, z=-535}

When i set blocks like this:

    @EventHandler(
            priority = EventPriority.HIGHEST,
            ignoreCancelled = true
    )
    public void onPopulate(ChunkPopulateEvent event) {
        Chunk chunk = event.getChunk();
        BlockState[] tileEntities = chunk.getTileEntities();
        for(BlockState blockState : tileEntities) {
            net.minecraft.server.v1_16_R3.Chunk nmsChunk = ((CraftChunk) chunk).getHandle();
            nmsChunk.removeTileEntity(new BlockPosition(blockState.getX(),blockState.getY(),blockState.getZ()));
        }
        for (int y = 0; y <= 150; y++) {
            for (int x = 0; x <= 15; x++) {
                for (int z = 0; z <= 15; z++) {
                    Block block = chunk.getBlock(x,y,z);
                    setBlockFastnms(block,Material.STONE);
                }
            }
        }

    }

I think that it is due to the chunk possibly not being generated fully however a delay doesn't fix it

#

the setBlockFastnms is:

    public void setBlockFastnms(Block block, Material type) {

        net.minecraft.server.v1_16_R3.Chunk chunk = ((CraftChunk) block.getChunk()).getHandle();

        chunk.removeTileEntity(new BlockPosition(block.getX(),block.getY(),block.getZ()));

        CraftBlock cb = (CraftBlock) block;

        IBlockData data = CraftMagicNumbers.getBlock(type).getBlockData();
        chunk.getWorld().notify(cb.getPosition(), cb.getNMS(), data, 0);
        chunk.setType(cb.getPosition(), data, false);
    }
#

I realise now that the top blockstate remover is redundant

#

Any ideas?

#

Ideally i would like to actually change blocks, and avoid packets

wraith rapids
#

have you tried doing it through the api

#

setting almost every block in a chunk every time the chunk generates is going to be slow as balls anyway, so you might as well put the nms hacks in the corner and just embrace having to pregenerate the world

opal juniper
#

Hmmm, that would potentially work

wraith rapids
#

most people pregenerate worlds anyway

faint shadow
#
        Iterator<Recipe> it = Bukkit.getServer().recipeIterator();

        Recipe recipe;
        while (it.hasNext()) {
            recipe = it.next();
            if (recipe instanceof FurnaceRecipe || recipe instanceof BlastingRecipe) {
                if (((CookingRecipe<?>) recipe).getInput().getType() == Material.NETHER_GOLD_ORE) {
                    it.remove();
                }
            }
        }

it isn't removing recipe

wraith rapids
#

especially on splögget since they haven't invented async chunk generation yet I don't think

opal juniper
#

Idrk how to go about this tbh

#

i was going with nms cause it was faster than the bukkit route

quaint mantle
#

how do i convert 60 days to millis?

wraith rapids
#

with math

quaint mantle
#

ty

opal juniper
#

lmao

wraith rapids
#

how many hours are there in a day?

quaint mantle
#

24

wraith rapids
#

how many minutes are there in a hour?

quaint mantle
#

60

wraith rapids
#

how many seconds are there in a minute?

opal juniper
#

60x24x60x1000

#

i think

#

where the first 60 is 60 days

wraith rapids
#

milli is the SI prefix for one thousandth

quaint mantle
#

or can i use TimeUnit.DAYS.convert(60, TimeUnit.MILLISECONDS);?

wraith rapids
#

yeah

opal juniper
#

yuhuh

wraith rapids
#

that is the noob way of doing it

quaint mantle
#

well im not good at math

wraith rapids
#

i'm sure you can still multiply a few numbers together

solemn shoal
#

best warning lol

opal juniper
#

literally gave you the formula

wraith rapids
#

but yeah, the TimeUnit conversion is fine

outer crane
#

Hey! I'm making a spigot plugin an i have a TOML Configuration:

[commands]
    "* * * * *" = [
        "say This Message Is Sent Every Minute!",
        "alert This Message Is Broadcasted Every Minute!"
    ]

    "0 0 * * *" = [
        "say Midnight Strikes!"
    ]
``` ideally i'd want to get all the keys and all the values from the `commands` section, and then read the key and the value.

I'm using `com.moandjiezana.toml`, and this is my code, Toml#entrySet() however it doesn't return the value, just the raw text separated
My code:
```java
        Toml commands = toml.getTable("commands");
        for (Map.Entry<String, Object> entry : commands.toMap().entrySet()) {
            LoggerAdapter.info(logger, entry.getKey() + ": " + entry.getValue());
        }
[13:24:56 INFO]: [execute] Enabling execute v0.1.0
[13:24:56 INFO]: "0 0 * * *": [say Midnight Strikes!]
[13:24:56 INFO]: "* * * * *": [say This Message Is Sent Every Minute!, alert This Message Is Broadcasted Every Minute!]
solemn shoal
#

why TOML tho

wraith rapids
#

it could be argued that it indicates your intention better and as such is better code

solemn shoal
wraith rapids
#

but using the actual numbers makes it look more 1337 so that's not an argument

solemn shoal
#

why does this remind me of crontab?

outer crane
#

its a cron thing

solemn shoal
#

explains why youre using a crontab like syntax lol

outer crane
#

yeah, so any idea on how i would get stuff like 0 0 * * * instead of "0 0 * * *"

quaint mantle
#

ig use replace?

outer crane
#

but i dont think thats a very proper way of doing it, plus using replace on something else like [say This Message Is Sent Every Minute!, alert This Message Is Broadcasted Every Minute!] would be horrible

quaint mantle
#

i meant on the key not value

solemn shoal
#

dont put the "" in your config?

opal juniper
#

@wraith rapids should i use a WorldCreator?

wraith rapids
#

i don't know

solemn shoal
#

i think toml lets you have spaces in keys

wraith rapids
#

i don't really fuck with world generation

opal juniper
#

idk what it is a placeholder for though

wraith rapids
#

you should ask on the paper discord, they'll probably help you with how to set up a decent world generator and maybe be able to answer your inheritance question

outer crane
#

nope doesent work

solemn shoal
#

screw jsoup for html formatting

#

im just gonna make my own html formatter

tepid willow
#

does anyone here use intelliJ idea

hybrid spoke
#

?ask

queen dragonBOT
#

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.

tepid willow
#

that was the question lmao

quaint mantle
#

yes

ebon peak
#

can anybody help me i wrote a report plugin when i open the reportsmenu i can take the items out of the inventory the code:

quaint mantle
#

try debugging it where it stops

#

or is in the line 95 supposed to be this Reportmenü instead of Reportmenu

opal juniper
wraith rapids
#

quite a few things are paper specific :fingerguns:

ebon peak
wraith rapids
#

code should generally be written in english

ebon peak
#

yeah but its a string its only like a message i cant write also RePorTsMenu yk ?

tepid willow
# quaint mantle yes

Do you use maven too? it becomes tedious to package > copy > paste > /reload every time i want to check/test/anything like that. Is there a way to tell maven where to put the jar every time i package?
it really is a quality of life question but thought i'd ask anyway haha

wraith rapids
#

ah yes, messages

ebon peak
#

yes xd

wraith rapids
#

ideally they would be localized and pulled from somewhere else but yeah messages are fine to be in whatever ching chong language you prefer

ebon peak
#

yeah i know i can also use another language like spanish you know what i mean

chrome beacon
wraith rapids
#

i'm sure there's also some maven plugin out there solely for changing the output directory

tepid willow
#

Not ever used Maven shade before, don't want to trip up on too many things at once while im still learning 😆

solemn shoal
wraith rapids
#

wow

solemn shoal
#

rate my html formatter

tepid willow
#

wow

wraith rapids
#

what is that gay shit in the bottom right hand corner

tepid willow
#

thats his clock dumbass

#

god pay attention

solemn shoal
#

bruh

#

lol

chrome beacon
#

Ofcourse you can change the path to anything you'd like

solemn shoal
#

maven

chrome beacon
#

oh and if you don't have a build section just add <build></build> and put it in there

tepid willow
#

funnily enough i've never actually had a build section. can i just throw a
<build>
<outputDirectory>
</
</
at the end

#

oh okay cool

quaint mantle
#
package soldier;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class Commands implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label,
                             String[] args) {

        //Here we have our basic command

        if(sender instanceof Player) {
            Player player = (Player) sender;
            player.sendMessage("Hello Player!");
        } else {
            sender.sendMessage("§cYou need to be a player to run this command!");
        }

        return true;
    }


}
wraith rapids
#

i see you've gone back to eclipse

quaint mantle
#

could you send the screen without that message

quaint mantle
wraith rapids
#

the method signature looks right to me

eternal oxide
#

Expand your imports

quaint mantle
#

show the imports

wraith rapids
#

they were included in the message he sent before

quaint mantle
#

oh yea my bad

wraith rapids
#

unless he changed them in between sending it and taking the screenshot

quaint mantle
#

ig try reloading the ide

wraith rapids
#

which, like, knowing him 👀

eternal oxide
#

Right click your pom -> maven -> update project

#

ensure the bottom 3 options are ticked and press ok

quaint mantle
abstract spindle
#

Hey guys, can anyone tell my why my stream is running the isPresent and also the else of it. (The isPresent he should run)

List<String> jobsList = communications.getLoader().getSmsManager().jobsList;

if(jobsList.isEmpty()){
                    jobsList.add("DAB");
                    jobsList.add("KSPD");
                    System.out.println(jobsList);
                }

jobsList.stream()
                        .filter(job -> job.equalsIgnoreCase(args[0]))
                        .findFirst()
                        .ifPresentOrElse(run -> {
                            communications.getLoader().getSmsManager().sendSMS(rpPlayerSender, args, false, args[0].toUpperCase());
                        }, () -> communications.getLoader().getSmsManager().sendSMS(rpPlayerSender, args, false, ""));
eternal oxide
#

It can;t run both ifPresent and OrElse

#

ifPresent will give you args[0].toUpperCase() OrElse will give you ""

abstract spindle
#

Thx I found the problem. I forgot an return in my other class

cold field
#

Is it a problem have many threads? Like 100actives and 300sleeping?

wraith rapids
#

depends on what they are doing

#

that does sound kind of high though

eternal oxide
#

So long as you are not creating and disposing of threads all teh time its ok

cold field
#

ook.

wraith rapids
#

just keep in mind that each thread allocates memory for its stack

silk mirage
cold field
#

Mh, I probably should have a powerful machine...

silk mirage
#

no clue how it can be null

eternal oxide
#

I'd probably look into why you are using so many. If you really need them

wraith rapids
#

can you list the thread names

cold field
#

I don't really need them. But I need to do a thing fast

wraith rapids
#

i know luckperms had an issue at one point where it spawned like 100s of worker threads

#

well 100 threads don't make a thing do fast

#

100 threads makes 100 times more context switching

silk mirage
#

uh

#

no replies for my issue?

wraith rapids
#

you only have x physical processors and they can only spin x threads at once

ebon peak
cold field
#

No, I don't mean fast execution, I mean that this is the first idea that i came up with

wraith rapids
#

sounds like bungee's scheduler system

#

which just spawns and sleeps a fucking thread every time you schedule something

cold field
#

I could do all of the work in just one thread, but i should synchronize everything...

wraith rapids
#

use a thread pool

#

a bounded one, ideally

cold field
#

yeah, I will.

#

Now that I think, I could do all I need without synchronizing anything. I just need a thread that runs every tick..

#

Is it better?

wraith rapids
#

i don't know

#

i have no idea what you're doing

#

or what you mean by synchronization

#

you ask very vague questions

cold field
#

I know, bc it is long to explain...

#

I don't wanna bother anyone

opal juniper
#

lmao

wraith rapids
#

you should fill the air with barriers so players don't fall out

opal juniper
#

thats not the pressing concern

#

in the world gen i have to:

    @Override
    public boolean shouldGenerateStructures(){
        return true;
    }

#

So you end up with stuff like this:

silk mirage
wraith rapids
#

uh

#

iirc structures can only spawn in certain biomes

#

you could try setting the biome of the empty chunks to something that can't spawn any structures

#

of course you would still have structures hanging off the border of the filled and empty chunks, because structures can't really be cut in half

minor garnet
#

some know why i getting that error ?

wraith rapids
#

have you tried using maven

quartz anchor
#

check your permission

lusty cipher
quartz anchor
#

or even better, try using maven

opal juniper
#

thats a shout about the biomes, i have set the empty ones to 'void' now

worldly ingot
#

"just use Maven" is as bad as the people that say "just use IntelliJ"

#

like, that wasn't the fucking question lol

opal juniper
#

lmao

worldly ingot
#

Sure. Explore Maven, but that's not going to answer the question that was asked

opal juniper
#

do you know how to prevent structues from generating choco

#

with a ChunkGenerator that is

solemn shoal
#

lol

wraith rapids
#

you don't always need an answer to the question asked

#

sometimes you need an answer to the problem you're having

solemn shoal
#

i could just say "use gradle"

#

lol

opal juniper
#

no

#

just add each one as a dependency

solemn shoal
#

just tried building Geyser (uses maven) and its SOOO SLOW

#

took like, 5 minutes, just to give me a compiler error lol

#

doesnt even tell me what went wrong

opal juniper
#

lmao

solemn shoal
#

Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project bootstrap-spigot: Fatal error compiling

#

lmao

opal juniper
#

handy

quaint mantle
#

what does @Override mean ex for onCommand?

solemn shoal
#

regardless i ended up using their ci builds instead

eternal oxide
minor garnet
#

i alread solved

solemn shoal
wraith rapids
#

override means that you are overriding a command declared by a class you're extending/implementing

minor garnet
#

but other thing

quaint mantle
#

okay ty

wraith rapids
#

the CommandExecutor interface declares a method, and you implement it by overriding it

minor garnet
#
    private void drop(final Player player) {
        final Inventory inventory = player.getInventory();
        final World world = player.getWorld();
        final Location local = player.getLocation();

        List<ItemStack> items = new ArrayList<ItemStack>();
        for(int i = 0; i < player.getInventory().getSize(); i++) {
            items.add(inventory.getItem(i));
        }
        items.stream().filter(e -> e != null).forEach(e -> world.dropItem(local, e));
        items.clear(); inventory.clear();
//        Arrays.asList(inventory.getContents()).stream().forEach(item -> { 
//            inventory.remove(item);  player.getWorld().dropItem(player.getLocation(), item); }
//        );
    }```
#

i have that method for drop all itens of player

opal juniper
#

Wait, how do you set the biome of a chunk

minor garnet
#

but dont drop my armor

wraith rapids
#

a chunk doesn't have a biome

#

but the 4x4x4 little cubes in a chunk do

solemn shoal
#

arent biomes per block/column?

wraith rapids
#

not anymore

opal juniper
#

what does the biomegrid contain then?

wraith rapids
#

it used to be a grid of 16x16 columns going from bedrock to sky

#

then it was per-block

#

now it's per 4x4x4 cube

solemn shoal
#

for performance and memory i guess?

opal juniper
#

do i have to iterate over all of them to set them?

wraith rapids
#

probably, dunno

eternal oxide
minor garnet
#

i tried it and i getting null exception

eternal oxide
#

only drop if not null

opal juniper
minor garnet
#
    private void drop(final Player player) {
        final Inventory inventory = player.getInventory();
        final World world = player.getWorld();
        final Location local = player.getLocation();
        Arrays.asList(inventory.getContents()).stream().filter(e -> e != null)
        .forEach(item -> { 
            inventory.remove(item);  
            player.getWorld().dropItem(local, item); }
        );
    }```
eternal oxide
#

I'd drop them all then just perform a clear on teh inventory once done

wraith rapids
#

it's not per block anymore, but it used to be

opal juniper
#

but why are the params 0-15

#

if it is 4x4

wraith rapids
#

because it used to be that way

opal juniper
#

x4

#

but that is the latest jd?

wraith rapids
#

and the api needs to reflect what a biome is, not how it's implemented

wraith rapids
#

the api also can't just change the way how it treats parameters

opal juniper
#

ok

wraith rapids
#

because that would break the fucking 1.8 plugins that nobody uses anymore

minor garnet
#

dont drop my armor

wraith rapids
#

like the javadocs say

#

getContents doesn't return armor slots

minor garnet
#

so ?

opal juniper
#

so it won't drop it

wraith rapids
#

you aren't iterating over the fucking armor slots

#

because it doesn't return the armor slots

#

so you aren't dropping the armor slots

minor garnet
#

so how i get it

wraith rapids
#

see the docs

minor garnet
wraith rapids
#

those are not the fucking docs

opal juniper
#

Player.getInventory().getArmorContents()

minor garnet
#

yes ik

opal juniper
minor garnet
#

tilt

wraith rapids
#

i'm calm

#

i'm fucking glacial

minor garnet
#

the problem that doesnt necessarily have to be docs just looking at the methods that exist within a class

#

and there is no armorcontets method

opal juniper
#

I mean it exists for me

#

what version?

summer scroll
#

PlayerInventory inventory = player.getInventory()

#

then you can get the armor contents

worldly ingot
#

^ Inventory != PlayerInventory.

#

same reason you can't call getItemInMainHand() on Inventory

tepid willow
opal juniper
#

wooah, can you

#

?paste

queen dragonBOT
tepid willow
#

sure lol. if i was on the receiving end i just would have preferred to not have to click a link :p

opal juniper
#

np, just a big thing of text 😄

graceful turret
#

why i cant add enchants to chest item using this chestMeta.addEnchant(Enchantment.DURABILITY, 10, true);?

lusty cipher
#

have you re-applied the new meta? @graceful turret

summer scroll
worldly ingot
#

yeah because it returns a PlayerInventory ;p

#

You're right, I was clarifying why

tepid willow
#

It's weird, because using another plugin (like mcmmo), there is absolutely no difference between grass and dirt

#

I want to replicate that effect

summer scroll
sharp bough
#

this will create a random num between 0 and 100 right?

        return r.nextInt(100);```
daring whale
#

1uestion

#

plesa

#

s

#
16:54:10 [SEVERE] java.lang.IllegalArgumentException: Server lobby (priority 0) is not defined
16:54:10 [SEVERE]     at com.google.common.base.Preconditions.checkArgument(Preconditions.java:359)
16:54:10 [SEVERE]     at net.md_5.bungee.conf.Configuration.load(Configuration.java:135)
16:54:10 [SEVERE]     at net.md_5.bungee.BungeeCord.start(BungeeCord.java:272)
16:54:10 [SEVERE]     at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62)
16:54:10 [SEVERE]     at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)```
#

help

sharp bough
#

show code

daring whale
#

this is from

#

bungee proxy

#

just wanted to ask

#

for help

#

Bruh

#

wwwwhy didnt

#

i

#

google

#

sorry to disturb your programming

#

continue

sharp bough
#

lmao

#

the most polite question ever

tepid willow
#

could someone point me in the right direction to putting an item in the creative menu

#

i've looked in classes that i thought make sense but don't see anything about putting items in creative menu

sharp bough
#

creative menu?

tepid willow
#

yeah like list of all items

sharp bough
#

like the gui when you press e

tepid willow
#

yes

sharp bough
#

in gm1

#

you sure that possible?

tepid willow
#

wait what? you don't think it's possible? :O

sharp bough
#

well theres mod that do that

#

i think

#

lol

opal juniper
#

Is there a way to stop structures from generating in specific chunks when using a ChunkGenerator

worldly ingot
# daring whale

One of your servers has to have priority 0. It will be the server to which it connects players first (i.e. the lobby). You do not have that.

tepid willow
#

you can make new achievement and advancement tabs but not a new tab or entry in the items list in creative mode? :O

daring whale
worldly ingot
#

In your bungee config

daring whale
#

Like

#

wwhere in the bungee config

#

Please tell

#

i am very clueless to bungee

worldly ingot
#

There's a priorities option in the bungee config

#

It's a list of servers

#
listeners:
  priorities
  - yourhubserver
daring whale
#

OHOO

#

thank you

worldly ingot
#

If you have multiple lobby servers, list them all

opal juniper
worldly ingot
#

They'll be in order from most important (highest) to least important (lowest) but they'll all try to be connected to

#

afaik

quaint mantle
#

Choco

#

Do you still play rocket of the league

vast quest
#

how can I teleport the player to a random location in a 5000 block radius

summer scroll
vast quest
#

and?

#

how can I teleport it

summer scroll
#

create a location with x and z as the random number

vast quest
#

but around the playter?

summer scroll
#

wdym?

vast quest
#

like

summer scroll
#

you can teleport using Player#teleport(location)

vast quest
#

Iwant it to be like

#

/spreadplayersd comamdn

summer scroll
#

yes

vast quest
#

so how can I do that

summer scroll
#

create a command

vast quest
#

command?

summer scroll
#

loop through all online players

#

and spread them

#

with teleport

vast quest
#

uh what?

#

Ok imam reexplain it sorry for bad english

#

I want it so the player gets randomly teleported to a location around the player in a radius of 5000 blocks

glass sparrow
#

why around the player

vast quest
#

cuz I need it to be around the player

summer scroll
#

same thing, generate the random number

glass sparrow
#

but all you would do is as @summer scroll said, get a random number for x and z, then add the players x and z to allow for offset

#

then do some stuff with negatives

opal juniper
#

Can i hide certain Console Warnings?

#

Because ik why they are happening but there is nothing i can do about them

#

So i just need to stop them

vast quest
#

how can I add?

#

to a location

glass sparrow
#

just teleport the player to an x, y, z

opal juniper
#

.add()

vast quest
#

add doesnt seem to work

vast quest
glass sparrow
#

playerLocation.getX() + randomX, y, playerLocation.getZ() + randomZ

#

thats your coords

vast quest
#

also how can I use the random method to well

#

generate numbers in negative

opal juniper
#

do a range between positive and negative

#

?

vast quest
#

how

glass sparrow
#

or generate between 2500 and have a 50% chance to be negative

opal juniper
#

how are you generating the number?

vast quest
#

Random ran = new Random();
return ran.nextInt(5000);

opal juniper
#

can you do (-5000,5000)

glass sparrow
#

thats a 10k radius

opal juniper
#

well do (-2500,2500)

vast quest
#

oh ok

#

Cannot resolve method 'nextInt(int, int)'

chrome beacon
#

You need to use an offset

vast quest
#

?

chrome beacon
#
ran.nextInt(upperbound-lowerbound) + lowerbound;
vast quest
#

so

#

return ran.nextInt(2500-(-2500)) - 2500;

#

wait no in that case upperbound shoudld be 5000

glass sparrow
#

no

vast quest
#

yes cuz if its not 5000

#

it could be 0

#

since we are removing 2500

glass sparrow
#

yeah it could be

vast quest
#

also uh

#

how can I get the highest solid block

#

so they dont sufficate

chrome beacon
#

World#getHighestBlockAt

vast quest
#

what am I doing wronmg

#

event.getEntity().teleport(loc.getX(), loc.getWorld().getHighestBlockAt(loc), loc.getZ());

glass sparrow
#

did you add the offset

#

also i thought you were making a command

vast quest
#

nvm

chrome beacon
#

Well World#getHighestBlockAt returns a block

#

Not a y location

vast quest
#

so

#

u h

#

loc.setY(loc.getWorld().getHighestBlockAt(loc.getX(), loc.getZ()).getY());

chrome beacon
#

Yeah

vast quest
#

Cannot resolve method 'getHighestBlockAt(double, double)'

chrome beacon
#

use getBlockZ and getBlockX

eternal oxide
#

why not just loc.setY(loc.getWorld().getHighestBlockYAt(loc);

vast quest
#

oh well

#

Ok

#

whats wrong with this

#

player.addPotionEffect(PotionEffectType.BLINDNESS, 60, 5, true, false, false);

#

Cannot resolve method 'addPotionEffect(org.bukkit.potion.PotionEffectType, int, int, boolean, boolean, boolean)'

glass sparrow
#

you just said whats wrong with it

#

look at jd

vast quest
#

yes but it should?

chrome beacon
#

Yeah no

glass sparrow
#

no

#

thats not the addpotioneffect method

vast quest
#

no? ok

chrome beacon
#

You need to create a potion effect then add it

#

Just wrap new PotionEffect() around your arguments

vast quest
#

oh

#

like this?

#

player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 60, 5, true, false, false), false);

hybrid spoke
#

include the last boolean too

#

oh

#

nvm

vast quest
#

idk what the last boolean does

glass sparrow
#

force - whether conflicting effects should be removed

hybrid spoke
#

no need to force since multiple effects of the same type are now supported.

glass sparrow
#

depreciated method type beat

vast quest
#

so I dont need the last boolean

#

?

hybrid spoke
#

nope

vast quest
#

ok

#

Huh

#

uh another question... can I make it so it doesnt crash

#

cuz of the chunks are not loaded

lofty mulch
#

check if chunk is loaded or not

vast quest
#

can I not load the chunk myself

#

at that lcoation

pulsar path
#

Can someone send me an example on how to use websocket protocoll in a plugin (client side)? Cant find one atm

lofty mulch
#

not mc?

vast quest
#

I want to load the chunk

#

so I can teleport the player there

opal juniper
#

just load the chunk

vast quest
#

I dont see anything about loadin g

lofty mulch
#

check if the chunk is loaded, if not load it

#

then tp