#help-development

1 messages ยท Page 1366 of 1

gritty urchin
#

And if I check if the OfflinePlayer is null

#

it never is eventhough it doesn't exist

opal juniper
#

So if you pass a fake uuid it returns the uuid instead of the player?

gritty urchin
#

No?

young knoll
#

An offline player will always be returned regardless of the uuid

#

I believe the docs for Bukkit.getOfflinePlayer mention this

gritty urchin
#

So how do I check if an OfflinePlayer exists or not?

#

Like it is actually a player.

ivory sleet
#

An OfflinePlayer will exist for all uuids and names I believe

opal juniper
#

Is it possible to get the slot that an item will be put into from the EntityPickupItemEvent

#

I need to check if when a player picks up it is going to their main hand

ornate heart
opal juniper
#

Ahh, ok

ornate heart
#

You could use a runnable in the pickup event actually: Bukkit#getScheduler()#runTaskLater

#

Donโ€™t even have to save the item

fervent chasm
#

Hello! I'm using this code to create a custom YML file.

public File rankYML = new File(getDataFolder()+"/ranks.yml");
public FileConfiguration rankConfig = YamlConfiguration.loadConfiguration(rankYML);

public void saveCustomYml(FileConfiguration ymlConfig, File ymlFile) {
  try {
    ymlConfig.save(ymlFile);
  } catch (IOException e) {
    e.printStackTrace();
  }
}

I also this in the yml file,

enabled: true

But the default custom yml file text doesn't seem to be copying into the file

It just generates an empty yml file called ranks.yml

minor garnet
#

is there a way to identify when a player has the tool date changed?

chrome beacon
#

tool date?

#

Why would you be able to use /give

#

uh don't follow that

#

Find someone else

covert valve
#

can reviews from banned users be removed?

chrome beacon
#

uh #general Auxilor

covert valve
#

oh oops

#

im blind

chrome beacon
#

np

#

Don't you're better off making your own command

sour rampart
#

Should this work: Bukkit.addRecipe(newrecipie);

chrome beacon
#

Yes

sour rampart
#

k just checking

chrome beacon
#

._.

burnt totem
#

where is the scoreboard stored? (When you do /scoreboard)

minor garnet
chrome beacon
#

You can detect anvils but don't think there's a good way if other plugins change it

sour rampart
chrome beacon
#

Why do you want a command to add a hard coded recipie

#

Also you didn't send the code where you registered it

#

You should also checked if you registered it in the plugin.yml

chrome beacon
#

nvm

#

Yeah send the code where you register the command

sour rampart
#

like when i type the command in minecraft, it says Unknown command

chrome beacon
#

Looks like you didn't add it to your plugin.yml

sour rampart
#

plugin.yml

chrome beacon
#

And now where did you register it

naive knoll
#
EntityPlayer knockedEntity = ((CraftPlayer) znokautowany).getHandle();
knock.setGameMode(GameMode.SPECTATOR);
            knock.setSpectatorTarget(reviever);
            knockedEntity.playerInteractManager.setGameMode(EnumGamemode.ADVENTURE);```

Does anyone know why when to execute this code, when this person (knock) right clicks it, it crashes for "cannot interact with self"?
chrome beacon
#

Send the full error

naive knoll
#

I haven`t error

#

Only kick player

outer crane
#

send the full error

#

cannot interact with self is an error

cinder thistle
#

c++ more like shit++

naive knoll
#

This is nms

outer crane
#

doesn't look like you need NMS to do that though

opal juniper
#

IS there like a ItemStack#setMaxStackSize() method?

woven coral
#

https://sourceb.in/mdnqwoWRUC - it doesnt spawn the item at the exact location, it spawns the item offset of the location, I tried dropItem and dropItemNaturally

#

heres some referance, that paper did not spawn at the golden block, it spawned near it

sour rampart
chrome beacon
#

Yeah that's not how you register a command

#

Follow the guide

woven coral
#

y?

minor fox
#

does anyone know if spigot/bukkit stores a copy of the players gameprofile somewhere?

#

and uses that when executing commands?

quaint mantle
# woven coral y?

adding 0.5 to x and z gets the center of the block, Location#getX() and Location#getZ() on their own will get you the very corner of the block

woven coral
#
        loc.add(0.5, loc.getY(), 0.5);
        plugin.getServer().getWorld("world").dropItem(loc.set(loc.getX(), loc.getY(), loc.getZ()), paper);``` like this?
#

oops

#
        loc.add(0.5, loc.getY(), 0.5);
        plugin.getServer().getWorld("world").dropItem(loc, paper);```
sour rampart
# chrome beacon Follow the guide

this.getCommand("createrecipe").setExecutor(new CreateRecipieCommand()); gives error: The constructor CreateRecipieCommand() is undefined

What am I doing wrong?

quaint mantle
woven coral
#

same thing

#

drops it offset

#

even tho I have .dropItem

crude charm
#

how do I fix this?

outer crane
#

well read it

#

your IDE thinks its always false

crude charm
#

ye

outer crane
#

press "more"

crude charm
#

and its throwing an error ingame

outer crane
#

so you are having an error but wont post it here?

crude charm
quaint mantle
#

How can I do so that if I break dirt I get 4x dirt instead of 1

naive knoll
outer crane
#

the code that you sent has 0 chance throwing that

crude charm
#

ik

#

idk hwhy it is

outer crane
#

whats on line 47?

#

send your entire class if you can

crude charm
#

nothing that woulkd throw it

outer crane
#

send it anyway

latent vale
crude charm
#

player.getInventory().addItem(houseHandler.makeItem("Basic Home"));

latent vale
chrome beacon
burnt totem
latent vale
chrome beacon
#

You have too many }

quaint mantle
burnt totem
minor fox
#

I am currently changing a players GameProfile name, but when I do /gamemode 1 NewNamedPlayer it says the player cannot be found, why is that?

crude charm
# crude charm

can someone please help me, this should not be throwing but somehow it is

chrome beacon
opal juniper
#

Can i make a block have no hitbox, i.e you can walk thru it but still has the texture?

chrome beacon
#

It will have to be an entity

quaint mantle
minor fox
burnt totem
latent vale
#

because gamemode 1 is on older versions

opal juniper
minor fox
#

the command itself works fine, it's just a problem with spigot i think

chrome beacon
#

No it's 99% your fault

latent vale
#

try Ctrl+Shift+O

latent vale
#

it will import entity

#

and things needed to be imported

#

if you are on eclipse

minor fox
#

okay well I tried doing ````/gamemode creative NewNamedPlayer```, no luck

chrome beacon
#

We can't really help you without your code

crude charm
#

but you can help me ๐Ÿ™‚

minor fox
#

no code is needed

crude charm
minor fox
#

bruh this is a dev related question

crude charm
#

how

#

ur asking about a spigot feature

chrome beacon
#

He's modifying the GameProfile

minor fox
#

I change a game profile field, and it's not recognized when using comamnds

chrome beacon
#

But not showing us how

crude charm
#

well then we need code

minor fox
#

No, the game profile update works fine

#

That's already been tested

crude charm
#

m8 do u want help or not

burnt totem
#

๐Ÿ™„

latent vale
minor fox
#

The thing is, Player#getName returns the new name set in the game profile, so surely something's not wrong on my end when /gamemode doesn't work?

crude charm
burnt totem
minor fox
#

yes

burnt totem
#

then it's ur fault lol

latent vale
crude charm
minor fox
latent vale
minor fox
#

that's what I am trying to figure out

crude charm
#

way too many brackets

latent vale
#

how to clean then -_-

crude charm
#

remove the nesting

latent vale
#

tf does that mean

crude charm
#

bruh

woeful crescent
#

hey

crude charm
#

hi

woeful crescent
#

so

crude charm
#

code

                if (args.length == 0) {player.sendMessage(usage()); return true;}
                if (args.length < 1) { player.sendMessage(usage()); return true; }

error

woeful crescent
#

what happens if i set short damage or byte damage to 0 in the ItemStack contructor

ivory sleet
#

Try and see

woeful crescent
#

hopefully

latent vale
woeful crescent
#

nothing

crude charm
latent vale
#

what is nesting...

crude charm
#

everything in ur code

#

way too many brackets

#

remove them

latent vale
#

idc about brackets i just need code to work

crude charm
#

ur gonna get clowned down the line

#

if u show people code like that

latent vale
#

i wont show it ๐Ÿ˜ƒ

#

๐Ÿ˜„

crude charm
#

ur gonna have to...

burnt totem
latent vale
#

veri

crude charm
#

๐Ÿ˜ฟ ๐Ÿ”ซ dont make me

ivory sleet
#

Wow

#

Are you threatening me?

crude charm
#

no

ivory sleet
#

Well why u shoot doggo

crude charm
#

there

earnest junco
crude charm
#

like what

#

thats what is throwing the error

earnest junco
#

like line 26

crude charm
#

Player player = (Player) sender;

earnest junco
#

doubtful that that's actually L26

Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
        at me.zoibox.houses.commands.GiveHouseCommand.onCommand(GiveHouseCommand.java:26)
ivory sleet
#

Do you check instanceof?

crude charm
earnest junco
#

theres your issue

ivory sleet
#

Donโ€™t check if args.length is both 0 and below 1

#

Basically the same thing

crude charm
#

Im dumb ok

#

its meant to be more

#

lmfao

earnest junco
#

Doesn't really matter, he needs to do the check much earlier.

woeful crescent
#

what does setting the damage of an uncolorable item even do

#

sets its damage?

ivory sleet
#

But even so the second check is still redundant and thatโ€™s an irrefutable fact

woeful crescent
#

that would be pretty great

earnest junco
woeful crescent
#

ooh rip

lost matrix
#

Alright. So i just made this tool to visualise the PerlinNoiseGenerator of Spigot:

crude charm
#

I need the second one

#

incase people do /givehouse sdfkj lskdfj slkfjslk fjsf lksdjf lsdkfj sdkl jfds

crude charm
#

jw

crude charm
#

omg it works

lost matrix
#

Its for Jadss_pt because he wanted to get into world generation and didnt quite understand what those values meant.

crude charm
#

tysm doggo I will never shoot you

minor fox
#

Does anyone have some experience with the inner workings of spigot/bukkit?

vestal dome
#

But it still does not answer why the 3 values are the same ya know?

crude charm
#

why

minor fox
#

the question should be pretty straight forward?

earnest junco
#

?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.

lost matrix
vestal dome
#

Uhu

minor fox
#

I have already asked the question though

vestal dome
#

But you changed frequency, it changed the workings of it

#

Like

#

Like the generation

burnt totem
vestal dome
#

How would all of them be the same then...

lost matrix
vestal dome
#

Uhu OK

woeful crescent
#

Hey, I have a bit of a predicament. I have a class that extends ItemStack. It can be different materials, but mainly a stained glass pane. Since the super call has to be the first statement in the constructor, I can't check if it is a stained glass pane and color it using a different contructor. How do I solve this?

earnest junco
minor fox
#

My question is why is it that after changing the GameProfile name field, /gamemode <mode> NewName returns with a "that player cannot be found"?

woeful crescent
minor fox
#

what code do you want sir

crude charm
#

the class u keep saying throws errors

minor fox
#

the code that I know is working correctly?

crude charm
#

yes

minor fox
#

there's no class throwing errors

#

it's literally spigot sending me a message

crude charm
#

omg

#

bro

burnt totem
earnest junco
minor fox
#

I did, and I found that the GameModeCommand class is infact getting the target by getPlayerExact, so the error lies there I guess

woeful crescent
#

How do I change the color after?

#

There's no non-deprecated way of doing that i don't think

earnest junco
#

pre or post 1.13?

woeful crescent
#

pre

burnt totem
minor fox
#

no no no you don't get the point lol

#

listen

#

name changing works perfectly fine

crude charm
#

shiw

#

show

#

the

#

code

#

?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.

minor fox
#

the field in the game profile is updated and Player#getName returns the new name

#

/gamemode <mode> NewName returns "player cannot be found"

burnt totem
#

then it's youre shitty code

burnt totem
#

stop asking

minor fox
#

but /gamemode is a spigot command?

crude charm
#

bro

burnt totem
#

no it is vanilla

minor fox
#

so bukkit?

crude charm
#

stop protecting ur fbi files

earnest junco
crude charm
#

just give it

minor fox
#

@crude charm what code are you asking for really

crude charm
#

the whole class

burnt totem
#

but it's not spigot's fault. Spigot is not made for your name changer thing

minor fox
#

there is no class

crude charm
#

????????

burnt totem
#

??????????

woeful crescent
crude charm
#

lmfao what

ivory sleet
#

?!?!?!?

minor fox
#

I mean, there's a method

#

changing the game profile field

#

but that's it

crude charm
#

you need a class

#

for a method

#

lmfao

ivory sleet
#

No need to be rude

minor fox
#

i obviously have that but the only relevant thing in that class is the game profile changer method

crude charm
#

bro

#

just

#

send

#

the

#

class

burnt totem
#

lol

burnt totem
ivory sleet
#

Letโ€™s go

minor fox
#

@crude charm private void sendEntityDestroyPacket(int entityId, Player... exclude) { sendPacket(new PacketPlayOutEntityDestroy(entityId), exclude); } do you find this code useful for helping in this case?

crude charm
#

no

minor fox
#

if not, then you don't need the whole class

crude charm
#

I do

#

WTF

crude charm
#

ikr

#

lmfao

#

hahahahahahahahahya

minor fox
#

the rest of the methods in that class has nothing to do with any of this

crude charm
#

ive never laughed so hard at 1am after being up at 5am for the last week

ivory sleet
#

Jesus Zoi you gonna stop being rude or what

burnt totem
#

rfsdlgdfg

crude charm
burnt totem
minor fox
burnt totem
minor fox
#

Well I've given all information I possibly can

burnt totem
#

?????????

crude charm
#

bro

burnt totem
minor fox
#

I'm gonna give you guys the class, but it's not fixing anything

woeful crescent
#

@earnest junco What about things with actual durability?

burnt totem
#

lol

crude charm
#

ikr

#

lmfao

burnt totem
#

but im tired of you so maybe i won't help lol

woeful crescent
#

How do I set the color on an ItemStack pre 1.8 that can have actual durability after it is already contructed

woeful crescent
#

I meant 1.8

crude charm
#

(short) value

woeful crescent
#

yeah ik

#

I mean after it's contructed

crude charm
#

wdym

minor fox
#

does anyone have a hastebin I can use

woeful crescent
#

After the ItemStack is created

minor fox
#

cant upload this

woeful crescent
#

how do I set the color

crude charm
minor fox
#

"error adding document"

crude charm
#

?bin

queen dragonBOT
crude charm
#

?paste

burnt totem
crude charm
#

lmfao

burnt totem
#

my brain ded

minor fox
woeful crescent
crude charm
#

thats it

#

lmfao

#

all that buildup

#

for 30 lines

minor fox
#

What did you expect?

crude charm
#

nothing

#

but idk why u horded it so hard

earnest junco
minor fox
#

because there literally is no reason for me to send it

#

the code works perfectly fine

crude charm
#

we'll see about that

minor fox
#

yeah try it yourself

crude charm
#

so what is throwing errors again

burnt totem
crude charm
#

ikr

woeful crescent
#

oooh

#

nvm

earnest junco
#

lol

woeful crescent
#

wait

#

no

burnt totem
#

is there an event that is called when nametag is showed or something? in bukkit

woeful crescent
#

sorry, do I just get the data, cast it to colorable, and then set the color? or do i have to do that to the data THEN set the data on the item?

earnest junco
woeful crescent
#

oh

#

okay, thanks

crude charm
#

I had debug messages but reverted to an old version to see if that would fix it but it didnt. if arg1 is not equal to an item in a list it should print a list but instead it prints the usage. my debug message went off fine for the other args but this one none went off

#

ok

#

I found out something

#

one sec ill try to fix it

#

nvm

#

it didnt fix it

#

but

#

its this

#
        if (args.length == 0) { player.sendMessage(usage());  return true; }
        if (args.length > 1) { player.sendMessage(usage()); return true; }
#

something to do with that

burnt totem
#

lol

crude charm
#

why

#

@burnt totem can u plz help me

burnt totem
#

im bad at java and i have soccer practice in 5 min

#

maybe after soccer practice

sleek pond
#

how old are u lmao

burnt totem
sleek pond
#

most people don't say it like that if they are 13+

#

they say I gotta go do something

#

and they wouldn't be on discord 5 minutes before

#

whatever

burnt totem
#

im 14

worn tundra
#

;D

crude charm
#

@sleek pond can u plz help me

eternal night
#

idk if porting a project to an older version is a good starting point

crude charm
#

or anyone

#

please

worn tundra
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.

crude charm
#

I did

minor fox
#

@crude charm @burnt totem we're not done here. nothing is throwing errors

crude charm
#

huh

minor fox
#

can I send pictures in this channel somehow

eternal night
#
if (args.length == 0) {player.sendMessage(usage()); return true; }
if (args.length > 1) {player.sendMessage(usage()); return true; }

shows the usage for any command invocation with anything but 1 argument

crude charm
#

the latter?

eternal night
#

I mean, that is the upper bound yes

sage swift
#

return a method that returns true and also sends the message

#

big brain

eternal night
#

what

crude charm
#

why not just return the method

#

I want it to show it for anything more then one like if they do /givehouse sdfg sdflkj sjlks jflkdsj flsdkjf slkfj sdlkf jsdflk sjdfl ksdjf lksdjf sdlk fjsdlk j

eternal night
#

but you are talking about two arguments

crude charm
#

yea I have 2 args

sage swift
#
private boolean sendMessage(CommandSender sender, String input) {
  sender.sendMessage(input);
  return true;```
eternal night
#

but your command only allows invocations with 1..

crude charm
#

is that not starting from 0?

sage swift
#

then you can do return sendMessage(sender, usage());

eternal night
#

the length ?

#

no

crude charm
#

oh

eternal night
#

["hello", "there"] would have arr.length == 2

crude charm
#

why

#

like

#

its so confusing

eternal night
#

with arr[0] == "hello" and arr[1] == "there"

crude charm
#

when it switches like that

minor fox
#

@crude charm could you try to edit the players game profile and see the strange behaviour yourself?

crude charm
#

@eternal night now its sending both

eternal night
#

?

crude charm
#
        if (args.length == 0) { player.sendMessage(usage());  return true; }
        if (args.length > 2) { player.sendMessage(usage()); return true; }
#

oh wait

#

thats just me

#

or

#

wait

#

nvm

#

nbo

#

fixed it

#

tysm

#

โค๏ธ

#

๐Ÿ‘จโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘จ

worldly ingot
sleek pond
#

๐Ÿฃ

eternal night
#

pretty sus indeed

crude charm
#

ikr

minor fox
#

Do you have a couple of minutes now zoi

crude charm
#

after I fix this

sour rampart
eternal night
#

command is probably not defined correctly in the plugin.yml

crude charm
#

yeah

eternal oxide
#

recipe and recipie. How do you spell it in your plugin.yml?

opal sluice
#

Hi, is there a way to know in which slot a picked up item is going to go ?

sharp bough
#
 @EventHandler
    public void InvClick(InventoryClickEvent e) {
        if (e.getView().getTitle().equals(ChatColor.GOLD + "List Of All Custom Crafts!")) {
            Player player = (Player) e.getWhoClicked();
            //Determine what they selected and what to do
            switch (Objects.requireNonNull(e.getCurrentItem()).getItemMeta().getDisplayName()) {
                case "Raw Rabbit":
                    player.closeInventory();
                    player.sendMessage("testing");
                    break;
                case "Raw Mutton":
                    player.closeInventory();
                    player.sendMessage("testing1");
                    break;
                case "Raw Porkchop":
                    player.closeInventory();
                    player.sendMessage("testing2");
                    break;
                default:
                    break;
            }
            e.setCancelled(true);

        }
    }
}

could someone tell me what im doing wrong? i dont get it

#

the display item of the clicked item are those

#

its not closing inv either so its not fulfilling the condition

eternal oxide
#

    HumanEntity.closeInventory()
    HumanEntity.openInventory(Inventory)
    HumanEntity.openWorkbench(Location, boolean)
    HumanEntity.openEnchanting(Location, boolean)
    InventoryView.close() ```
sharp bough
#

ah

#

thanks

cinder thistle
#

why is that?

#

oh I c

sharp bough
#

Because InventoryClickEvent occurs within a modification of the Inventory, not all Inventory related methods are safe to use.

#

i guess

#

it still goes to default every time

    @EventHandler
    public void InvClick(InventoryClickEvent e) {
        if (e.getView().getTitle().equals(ChatColor.GOLD + "List Of All Custom Crafts!")) {
            Player player = (Player) e.getWhoClicked();
            //Determine what they selected and what to do
            switch (Objects.requireNonNull(e.getCurrentItem()).getItemMeta().getDisplayName()) {
                case "Raw Rabbit":
                    player.sendMessage("testing");
                    break;
                case "Raw Mutton":
                    player.sendMessage("testing1");
                    break;
                case "Raw Porkchop":
                    player.sendMessage("testing2");
                    break;
                default:
                    player.sendMessage("test");
                    break;
            }
            e.setCancelled(true);

        }
    }
} 
eternal oxide
#

sysout your Objects.requireNonNull(e.getCurrentItem()).getItemMeta().getDisplayName()

eternal night
#

I mean, a normal unchanged Raw Rabbit item does not have "Raw Rabbit" as its display name

#

if that is what you are trying to do

eternal oxide
#

I'd use Objects.requireNonNull(e.getCurrentItem()).getType()

sharp bough
#

switch (Objects.requireNonNull(e.getCurrentItem()).getType()) {
case RABBIT:
player.sendMessage("testing");
break;

#

like that?

lost matrix
sharp bough
#

and i dont get any spam

#

in console

#

idk whats wrong with display name

lost matrix
#

Do a proper null check before the switch case.
Of the ItemStack, its ItemMeta and if the meta has a display name

#

And this looks like it should be done using the Material and not the display name of the ItemStack

eternal oxide
#

Better to not use the name at all. Material match

lost matrix
#

^

late ledge
#

Anyone has an idea how I properly reset blocks that I changed with a MultiBlockChange packet? I want them to be "synced" with the server again. I thought about sending a MultiBlockChange packet again like so:

WrappedBlockData.createData(world.getBlockAt(location));```
but it gives me NullPointerExceptions. To set my blocks, I used ```java
WrappedBlockData blocker = WrappedBlockData.createData(Material.STAINED_GLASS, 14);```I know this method is deprecated but I couldn't figure out how to pass "red stained glass" in 1.12.2
eternal oxide
#

you store teh locations you fake changed. then send a new fake update with location.getBlock().getBlockData()

cinder thistle
#

I've been reading about the flyweight pattern (https://en.wikipedia.org/wiki/Flyweight_pattern). From what I've learned, you can effectively only store one instance of each class, no matter how many times it's instantiated, correct?

Well, would you be able to apply this to, say, AxisAlignedBB in NMS? Or is it already in effect? I haven't taken a look at the code yet; I just saw JProfiler report a lot of instances of it. I'd think (most) blocks would all have the same bounding box, and hence be able to share one instance of it. Entities as well, say you have a bunch of rabbits; they could all just share a bounding box.

That is, assuming AxisAlignedBB doesn't store locations. If it does, from my knowledge, that all goes out the window.

olive badger
#

Hello, somebody know an good API for easier make configuration (like annotation or something else) ?

late ledge
eternal oxide
#

Good luck with that then

#

in 1.16 its player.sendBlockChange(loc, loc.getBlock().getBlockData());

#

No clue on 1.12

cinder thistle
olive badger
cinder thistle
#

dazzle isn't bad

olive badger
#

i ask before before i have use Yamler but this is no longer supported

cinder thistle
#

I just prefer HCH

crude charm
cinder thistle
#

gotta love discord

crude charm
#

what about it

cinder thistle
#

the upload files thing

crude charm
#

oh yeah

cinder thistle
#

I have no idea why that's happening

#

did you register the event?

crude charm
#

yeah

#

its working

#

just throwing the error

cinder thistle
#

that's all I got

crude charm
#

can I catch it?

eternal oxide
crude charm
#

?

#

I show all my code

#

and the full error

#

oh hold on

#

its from something else

#

I thought this was a separate error

#

sorry

#

this is the issue

#

try (EditSession editSession = WorldEdit.getInstance().newEditSession((com.sk89q.worldedit.world.World) world)) {

eternal oxide
#

me.zoibox.houses.utils.SchematicUtil.loadSchematic(SchematicUtil.java:41

crude charm
#

ik

cinder thistle
#

that's a worldedit bug

crude charm
#

ClipboardFormat format = ClipboardFormats.findByFile(file);

cinder thistle
#

update worldedit

#

if it's latest report the bug

crude charm
#

its its latest ima cry

#

    public void loadSchematic(Player player, String schematicName){

        Location location = player.getLocation();
        WorldEditPlugin worldEditPlugin = (WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit");


            File file = new File(worldEditPlugin.getDataFolder() + "/schematics/" + schematicName + ".schematic");

        Clipboard clipboard = null;

        ClipboardFormat format = ClipboardFormats.findByFile(file);
        try (ClipboardReader reader = format.getReader(new FileInputStream(file))) {
            clipboard = reader.read();
        } catch (IOException e) {
            e.printStackTrace();
            printConsole(CC.RED + "An occured whilst loading ");
        }

        EditSession session = worldEditPlugin.getWorldEdit().getEditSessionFactory().getEditSession(new BukkitWorld(location.getWorld()), 10000);
        try
        {

            World world = player.getWorld();
            try (EditSession editSession = WorldEdit.getInstance().newEditSession((com.sk89q.worldedit.world.World) world)) {
                Operation operation = new ClipboardHolder(clipboard)
                        .createPaste(editSession)
                        .to(BlockVector3.at(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ()))
                        .build();
                Operations.complete(operation);
            }
        } catch (WorldEditException e) {
            printConsole(CC.RED + "An error occurred whilst loading the schematic!");
            e.printStackTrace();
        }
    }

eternal oxide
#

which is line 41?

crude charm
#

ClipboardFormat format = ClipboardFormats.findByFile(file);

quiet ice
#

You might be linking against outdated version

crude charm
#

mb

#

its from bukkit

#

idk where to find the latest

#

so I just got it freom there

quiet ice
#

WE jenkins afaik

crude charm
minor fox
#

I'm trying to edit the DedicatedPlayerList so that Bukkit#getPlayerExact returns the player after their GameProfile name attribute is changed. Which fields do I need to change?

eternal night
crude charm
#

will WorldEdit Build #5758 work for 1.8?

quiet ice
cinder thistle
#

update minecraft

crude charm
#

not my choice

quiet ice
#

Attempting to cache as much as possible may be counterintuitive

glossy scroll
eternal night
#

^^ yeah, the GC should hopefully be able to handle it. The other question would be, why not just reuse the ones already existing. Most AABB that are created are there just for the API

#

internally most of the instances are grown to their respective sizes

#

instead of re-created

crude charm
#

thats the ver im on rn

cinder thistle
minor fox
cinder thistle
crude charm
quiet ice
#

Excessive object creation is either a bug or something bigger of an issue

eternal night
quiet ice
eternal night
#

vectors are relatively impossible

#

just because of how precise they are

quiet ice
#

Basically, remove it from the try clause

cinder thistle
crude charm
#

its legit 3am

cinder thistle
#

or it would but like

quiet ice
#

Use Java 1.1 syntax

eternal night
#

I mean, not every design pattern is applicable to every application

#

lol

cedar geode
#

Say I add a new key to the default config.yml in a later update (v2.0) that wasn't in v1.0, how do I make it so that this key is added to existing config.ymls once a user upgrades from 1.0 -> 2.0

#

By default because a config.yml exists it won't modify it or copy the new default

#

I can think of dirty ways to do it but just wondering if there's a better clean way

cinder thistle
eternal night
#

Yeah the pattern definitely has uses

cinder thistle
#

From what I've learned, you can effectively only store one instance of each class, no matter how many times it's instantiated, correct?
this question at least

eternal night
#

java's int cache for example kinda falls in there

floral flare
#

How can I do to set an item in the player's inventory when he enters the server?

cinder thistle
quiet ice
#

so,

Closable c = null;
try {
// stuff
} catch (Throwable e) {
// ignorew
} finally {
   try  {
  c.close();}catch (Exception e) {}
}

@crude charm

eternal night
#

I mean it caches small integer numbers and returns the same instance so you don't re-create them so often

cinder thistle
#

oh thought you said fails

#

not falls

#

pognt

eternal night
#

lol

quiet ice
dusty herald
#

DogKek if it's closable why not just

try(closable declaration){
stuff
}catch (Throwable e) {

}
quiet ice
#

As that would negate any caching

quiet ice
#

Actually, I might be wrong there, but what can I do if he provides fundamentally bad code

crude charm
#

this is hurting my brain

cinder thistle
crude charm
#

it was fine before

floral flare
cinder thistle
#

?jd

quiet ice
#

Because you are linking against another version

cinder thistle
#

probably #setItem(Integer, ItemStack) but I gotta check

quiet ice
#

ABI is not guaranteed to stay the same across versions

cinder thistle
#

yep

#

keep in mind that slots are weird

quiet ice
#

Or better said, it should break across versions, especially major versions

#

This is an instance where it broke

eternal night
#

can't wait for all the spigot 1.17 breaking changes ๐Ÿฅณ

quiet ice
#

probably won't be many

eternal night
#

I mean, we will see :>

cedar geode
quiet ice
#

MD_5 has been doing his best at protecting ABI in the last years, I would be suprised if that would change so soon; but then, one day all the old code needs to be flushed down the drain

eternal night
#

depends on how aggressively our Canadian choco is gonna push #576

cinder thistle
#

what's ABI

quiet ice
#

Application Binary Interface

#

Basically just the method descriptions and names

cinder thistle
#

ah

cinder thistle
#

would be great

eternal night
#

same ^

quiet ice
#

Probably the legacy materials can be flushed, don't know more things

#

The material concept might get changed, but that would require some serious refractors

cinder thistle
#

imagine if they used a different command framework

#

what are y'all's opinions on that

eternal night
#

I mean craftbukkit compatibility layer mayyyy be able to provide help

cinder thistle
#

I personally wouldn't mind a whole lot but it could defs use improvement

quiet ice
#

I believe that bigger changes to the command API structure are not needed

cinder thistle
#

indeed

quiet ice
#

However suggestions could def. be improved

#

Or at least provided

cinder thistle
#

yep

floral flare
#
.setLore(Collections.singletonList("ยงfa"))```
How can I make more than one list?
eternal oxide
#

You don't. It accepts one List

young knoll
#

If you want more elements use arrays.asList

floral flare
leaden falcon
#

Hi, I'm trying to do entity.remove()

alpine urchin
#

?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.

leaden falcon
#

But it doesn't show up in EntityDeathEvent

alpine urchin
#

just testing

leaden falcon
#

Why doesn't it?

fading lake
#

@leaden falcon removing an entity doesnt kill it

leaden falcon
#

And is there an event I can use for it?

#

@fading lake Oh, is there a way to listen for removals then?

alpine urchin
#

thats not how you kill an entity

leaden falcon
#

I'm just trying to listen to like

#

Removing entities

fading lake
#

try setting its health to 0, that should do it, OR manualy fire the event yourself

leaden falcon
#

There's no EntityRemoveEvent?

fading lake
#

no, the remove function completely deletes its existence

leaden falcon
#

Alr

eternal oxide
#

Do you mean entities being killed or actually removed from the world?

fading lake
#

hes using Entity#remove

eternal oxide
#

yep, just wonderign what his intention is

sharp bough
#

does anyone have an example of a command that opens a gui with items that open guis, with more items where each one opens another gui?

leaden falcon
#

Making a special entity

#

sometimes I remove it .remove()

#

but other times the player kills it

#

and i wanna listen to both

eternal oxide
fading lake
#

@leaden falcon when you remove an entity (before you do it), fire the EntityDeathEvent yourself (cant remember if its cancellable, but if it is, prob best implement that too)

#

that's what id do

#

not exactly hte best way but eh

sharp bough
floral flare
#

singletonList?

#

emptyList?

young knoll
#

I just told you

#

Arrays.asList

eternal oxide
fading lake
olive badger
#

For an last question, what i can use for an good command framework, i have see ACF (from Aikar) and CommandAPI but i want have yours opnions and if some other tools exist.

fading lake
#

ACF by Aikar is good for starters

glossy scroll
#

Make your own most of them have features youll never use which makes it over complicated

#

Otherwise acf is finee

fading lake
olive badger
#

yes i know ๐Ÿ˜‰ that is why i search an command framework

#

i think i go use ACF because i use Paper so that sound good ^^

burnt totem
#

Like entity.kill I will look at that later

eternal oxide
#

no

crude charm
#

    public void loadSchematic(Player player, String name) {
        Location location = player.getLocation();
        WorldEditPlugin worldEditPlugin = (WorldEditPlugin) Bukkit.getPluginManager().getPlugin("WorldEdit");
        File schematic = new File(worldEditPlugin.getDataFolder()+ File.separator + "/schematics/" + name + ".schematic");
        EditSession session = worldEditPlugin.getWorldEdit().getEditSessionFactory().getEditSession(new BukkitWorld(location.getWorld()), 10000);
        {
            CuboidClipboard clipboard = null;
            try {
                clipboard = MCEditSchematicFormat.getFormat(schematic).load(schematic);
            } catch (IOException e) {
                e.printStackTrace();
                printConsole(CC.RED + "An error occurred whilst loading this schematic!");
            } catch (com.sk89q.worldedit.data.DataException e) {
                printConsole(CC.RED + "An error occurred whilst loading this schematic!");
                e.printStackTrace();

            }
            clipboard.rotate2D(90);
            try {
                clipboard.paste(session, new Vector(location.getX(), location.getY(), location.getZ()), false);
            } catch (MaxChangedBlocksException e) {
                e.printStackTrace();
                player.sendMessage(CC.GREEN + "You tried to paste too many blocks!");
            }
        }

error:

fading lake
#

ill copy and paste the answer you got in the other discord you just posted this in

#

File schematic = new File(worldEditPlugin.getDataFolder()+ File.separator + "/schematics/" + name + ".schematic"); most likely

crude charm
#

@fading lake

unique eagle
chrome beacon
#

Did you run BuildTools?

placid jackal
#

guys?

opal juniper
#

yep

placid jackal
#

players have big ping, and they got disconnected

#

tps was 20

chrome beacon
#

Wrong channel

#

Twice

opal juniper
placid jackal
#

idk

unique eagle
unreal quartz
#

yes but did you run it

#

you're also missing mavenLocal(), which is needed as buildtools automatically installs it to your local repo

burnt totem
#

does anyone know how luckperms does the luckperms.autoop permission?

#

it automatically gives a player with that permission all permissions

dusty herald
#

no

#

that is only used when the vanilla OP system is disabled via luckperms and the only way to have OP is to have that permission

#

it automatically OPs you on join and iirc deops you on leave

burnt totem
#

so it's only /op?

dusty herald
#

yes but /op would be disabled if you enabled the usage of this perm

burnt totem
#

yeah i know

cedar geode
#

Is there something like the Vault API for a BungeeCord plugin? e.g. if I want to get player groups via BungeeCord (assuming there is a Bungee compatible perms plugin installed)?

crude charm
#
if (player.getLocation().getYaw() > 90 && player.getLocation().getYaw() < -90) clipboard.rotate2D(90);
        if (player.getLocation().getYaw() > 180 && player.getLocation().getYaw() < -180) clipboard.rotate2D(180);
        clipboard.paste(session, new Vector(loc.getBlockX(),loc.getBlockY(),loc.getBlockZ()), false);

how do I change
where it spawns

#

I wanna paste it where the player is looking

lost matrix
crude charm
#

I tried thtas

#

but that method is really wearied

lost matrix
#

Then you need to find out the offset of the clipboard

eternal oxide
#
    private Location getTarget(Player player) {

        RayTraceResult target = player.rayTraceBlocks(200);
        if (target == null) return null; // no hit

        return target.getHitBlock().getLocation().add(target.getHitBlockFace().getDirection());
    }```
crude charm
#

ty for compensating for my needs

lost matrix
#

He is from the future...

crude charm
#

lmfao

lost matrix
#

Are you on 1.8?

crude charm
#

maybe...

lost matrix
#

Then good luck ^^

crude charm
#

oh no ๐Ÿ˜ฆ

#

ok I take back everything about 1.8 being easier for development

#

because worldeditapi just kicked my ass

#

now this

#

bruh

errant drift
#

there is a discord for people who develop for 1.8 maybe you can find it

crude charm
#

where

#

do I find this

#

is it active?

quiet ice
#

Isn't it a joke discord?

ivory sleet
#

Yea

zinc saffron
#

How do i get the name of an inventory

lost matrix
zinc saffron
#

wdym

lost matrix
zinc saffron
#

getView

#

o

minor fox
#

Does anyone have an idea why this is happening: ```entityPlayer.getName() returns new name set in GameProfile

    Bukkit.getPlayerExact(name) returns null```
#

When I decompiled it I saw getPlayerExact uses the method entityPlayer.getName so I really don't understand

lost matrix
minor fox
#

and where exactly is this map, that's what I've been searching for

lost matrix
#

net.minecraft.server.<v1_16_R3>.DedicatedPlayerList

minor fox
#

can I send pictures here somehow

lost matrix
#

If you link your discord with your Spigot account then yes

minor fox
#

okay well I'll try to explain then

#

I went into DedicatedPlayerList and looked at the object that was stored

#

and the game profile was indeed updated

#

wait hold on

#

no it still doesnt make sense

lost matrix
#

Wait its net.minecraft.server.<v1_16_R3>.PlayerList

#

It has a field playersByName

minor fox
#

yes sorry the dedicated extends

lost matrix
#

And this map gets accessed by CraftServer#getPlayerExact(String) method

#

indirectly

minor fox
#

yes

vocal shuttle
#

How do i change where my jar goes when I build with maven?

minor fox
#

so why does it return null

lost matrix
minor fox
#

But suppose I have a list of EntityPlayers

#

and iterate over that

#

then it wouldn't work

#
        Iterator iterator = this.players.iterator();

        while(iterator.hasNext()) {
            EntityPlayer entityplayer = (EntityPlayer)iterator.next();
            if (entityplayer.getName().equalsIgnoreCase(s)) {
                return entityplayer;
            }
        }

        return null;
    }````This would return null for some reason
#

even though entityPlayer has the updated gameprofile

lost matrix
#

If you would iterate over a list and check each name then it would work. But it would also decrease the complexity to O(n)

minor fox
#

I wasn't gonna mention this but tell it to the guy who made the 1.8 source code

#

I guess I won't get any more support now lol

lost matrix
#

Yeah... 1.8 is half a decade old and support was dropped several years ago for good reasons.

minor fox
#

but this is kind of not 1.8 related though, more related to java in general

#

because the object in the list is updated

lilac dagger
#

use attributes

vocal shuttle
#

Thanks

burnt totem
#

does anyone know what Packet20NamedEntitySpawn (from mc 1.5) is in 1.8.8 lol?

minor fox
#

sorry we dont support 1.8

#

๐Ÿ˜†

heavy mason
#

You speaking french idk "we"

burnt totem
minor fox
#

I know right

#

pure comedy

real vapor
burnt totem
#

thx

#

ily

lilac dagger
#

seems pretty straight forward

minor fox
#

i see what you did there

#

is CraftServer the only class that has getPlayerExact?

unreal kayak
#

Anyone know how to use protocolib to make a player not see the other?

#

Or give fake armour stand

quiet ice
minor fox
#

im afraid you can't help

#

im so sorry

real vapor
real vapor
olive badger
#

Hello, i re ask my question because i have look on hch and DazzleConfig but im not fan, i din't found how i can save the config at the demand and i search something more like Yamler.

My question : somebody know an good API for easier make configuration (like annotation or something else) ?

unreal kayak
unreal kayak
#

Wtf u giving player interface?

chrome beacon
#

You asked how to use the API

#

So he awnsered

#

You got what you asked for

unreal kayak
#

Protocolib api not bukkit api

real vapor
#

You do not need protocollib to hide players from one another.

unreal kayak
#

I want no packet about the player, i want the game to not know that player is even near

weary geyser
humble stirrup
unreal kayak
#

No

#

Only 1 player

#

Cant see

#

Other players can

eternal oxide
#

you do it for each player

real vapor
unreal kayak
minor fox
#

!jd

lilac dagger
#

why can't blocks be placed if the players are hidden?

eternal oxide
minor fox
#

Does anyone know which event is fired when you tab after /

eternal oxide
#

there isn;t an event fired. when you press a key tabcomplete is triggered

lilac dagger
#

the tab is client side

eternal oxide
#

Nothing is sent on pressing tab

lilac dagger
#

you just offer the client suggestions

minor fox
#

well you can alter the tab completions

#

yeah

lilac dagger
#

tabing means you use one of the suggestions to fill it

eternal oxide
#

implement Tabcompleter

minor fox
#

I'm trying to remove some commands they don't have permission to but the implemented tabcompleter method doesnt get fired for some reason

eternal oxide
#

if a player doesn;t have permission for a command it won;t show up in teh tab offering...

minor fox
#

I have a custom command class

eternal oxide
#

IF that command is correctly registered with that permission

minor fox
#

custom command system

eternal oxide
#

then properly register yoru commands and permissions

minor fox
#

the command is registered

eternal oxide
#

thats half of it

minor fox
#

well permission management is also working but that shouldnt do anything to the tab completion rn

eternal oxide
#

yes it shoudl, as I just said

lilac dagger
#

you can still prevent sending suggestions

eternal oxide
#

commands are only visible on the client if that commands permission is given to the player

minor fox
#

yes

#

and I am trying to remove those commands that they don't have access to through the tab completion method

#

but it's not fired

eternal oxide
#

YOU don't remove them. the permissions do

minor fox
#

i must remind you this is a completely custom command manager

eternal oxide
#

Yes, you have a broken design and refuse to implement it properly

minor fox
#

how is it broken

eternal oxide
#

The command map is sent to teh player upon login and when player.updateCommands() is called

#

it ONLY sends those commands the player has permissions for

minor fox
#

but how would it know what the player has permission for if it's a custom command manager

eternal oxide
#

If your "custom" command system is not assigning permissions to the commands then everyone has them in the command map

minor fox
#

yes exactly

#

that's what's going on right now

eternal oxide
#

Exactly, you registered the commands but did not add permissions to them

minor fox
#

so everyone should show up in tab complete, right?

eternal oxide
#

as you have not assigned permissions to your commands every command will show up in tab complete

minor fox
#

okay but tell me then why tab complete method isnt fired then

eternal oxide
#

what?

minor fox
#

`This method is not ran when I try to tab after /@Override public List<String> tabComplete(CommandSender sender, String alias, String[] args)

eternal oxide
#

it does not run on the root commands, those are in teh command map

#

tabCompleter triggers on args

minor fox
#

So I would check for PlayerChatTabCompleteEvent?

eternal oxide
#

no

#

not for commands

minor fox
#

PlayerCommandPreprocessEvent?

eternal oxide
#

Just do it proerly and assign permissions

minor fox
#

was about to ask if that was the method I would use

#

when do I add the permission to the player? @eternal oxide

eternal oxide
#

Depends

#

The PLayer object is available in PlayerLoginEvent but their current world will not be, so if you have world specific permissions you can;t assign them there. However, some plugins like WorldEdit expect permissions to be assigned at that point so you really need to add their permissions at PlayerLogin and PlayerJoin (as you have a correct world then).

#

If you change the players permissions you have to call player.updateCommands(). Good luck if you are on a old API as that method will not exist

minor fox
#

Doing it on join would work, ty

eternal oxide
#

You generally don;t assign permissions yoruself. You leave that upto a permission plugin and the server owner to decide

minor fox
#

This is not for public use in any way so I don't think that would become a problem in the near future

eternal oxide
#

player Join will be too late for the command map. Thats sent after player login. You would have to call updateCommands() if you assign them in player join

minor fox
#

alright

#

are you talking about AsyncPlayerPreLoginEvent btw?

eternal oxide
#

no, There is no player available in that event

minor fox
#

thats true

#

so which login event do you mean

eternal oxide
#

there are two PlayerLoginEvent and PlayerJoinEvent

#

the command map is pushed to the client after the first event but before the second.

minor fox
#

there's always a catch

eternal oxide
#

I think updateCommands() was added around 1.14

minor fox
#

mhm :I do you know if there's any packets that fixes this for other versions

eternal oxide
#

Not that I know of. You just have to ensure your command permissions are assigned in the Login event

minor fox
#

the problem is I don't have that event unfortunately

#

You don't think something like Player#recalculatePermissions would update it?

minor fox
#

wait how do you even add permissions to players

eternal oxide
#

PermissionAttachment attachment = player.addAttachment(plugin)

minor fox
#

adding a permission to the command itself doesnt stop it from being sent to the player ๐Ÿ˜ starting to really hate this now

eternal oxide
#

the command permission has to be on teh command before teh player joins

minor fox
#

could me being op have any effect on this?

eternal oxide
#

yes

minor fox
#

well there we have it

#

now it's sort of working

#

this is really interesting

#

either it updated the commands after PlayerJoinEvent or it sends packets when you add attachments to the player

#

because I was able to add the permission on join

eternal oxide
#

lucky

vestal dome
#

why does this happen?

#

the logs are florests (supposedly) the grass is plains and sand(which does not exist on the pic) are deserts.

random epoch
#

?paste

queen dragonBOT
vestal dome
#

yeah that also works

#

breh

#

but what ever.

#

Dead chat

eternal oxide
#

You are returning a new random every time you call seedRandom(). That won;t be very random.

#

you create the random once then get the next random from it.

#

Are you from some strange place where _ is accepted in a number? return new Random(10_1_4_23_15_14+12_4_19)

#

You shoudl be passing in a Long value

#

basically generate a Hash from whatever seed you want to start with

vestal dome
#

so if I try to get the value of 3 in the random and for example I get 1

#

and I will get 1 the next one...

#

tho I'm probably wrong on that one

eternal oxide
#

thats not how Random works

vestal dome
#

it still doesn't really matter that much

#

the seed random is only used twice..

#

so it really shouldn't matter at all

eternal oxide
#

You need a Random for each of yoru seeds, then get next to fetch teh next random number

vestal dome
#

wdym?

#

I'm using PerlinNoiseGenerators.

#

The error is that the biome generation is stupid

#

well

eternal oxide
#

teh generation is tupid because you are not using Random correctly

vestal dome
#

stupid in the way that it is not like, a biome and then it switches....

#

don't know how to explain

#

wrong

#

that might even aswell be like this:

#

seed+1

#

because it will be like that all the time

#

and using the same seed on a perlin noise generator, will just give the same NOISE

#

so it doesn't matter.

random epoch
#

BlockPlaceEvent ๐Ÿคฆโ€โ™‚๏ธ

vestal dome
#

BlockPlaceEvent

vestal dome
limber dust
#

i was about to make a joke and say BlockBreakEvent

vestal dome
#

breh moment

#

what ide is it even

#

never used.

#

reasons to use Intellij (probably none)

floral flare
#

Probably something went wrong with my ide, no suggestions appear anymore

random epoch
floral flare
#

I'll take a look

#

Thanks for suggestion

vestal dome
#

help

#

kthx

spare flicker
#

What jre do most of you all use

vestal dome
#

I use JDK 8

#

and JRE 8

eternal oxide
#

OpenJDK 11 and build for JRE 8

brave trellis
#

Whats the packet for client data on logging in?

opal sluice
#

I have some weird bugs, when I click sometime I can deposit an item where I shouldn't be able to while cancelling the inventory click event

sullen marlin
#

same as elgar

#

w/ netbeans IDE