#help-archived

1 messages Β· Page 45 of 1

frigid ember
#

im thinking i should go on the safe side with the items, however i dont think its possible for someone to spawn in an item with custom lore in survival or use anvil

#

idk

whole niche
keen compass
#

either it is something in the config or it has to do with your startup arguments o.O

#

somewhere you have priority 0 specified

whole niche
#

so i tryna change from premium server to crack server, i need a login server so i add it. before this i put lobby in it and it works fine tho

vernal spruce
#

sadly you might not receive help

#

as spigot doesnt support cracked..

keen compass
#

@whole niche yes, server auth must not be defined as a valid server

whole niche
#

ok i found it

#

i forgot to add itto bungee config

#

it to*

vale slate
#

cracked mc is a no go

whole niche
#

my friends doesn't have an id so..

keen compass
#

not like mc costs all that much to get

#

instead of compromising your entire network by setting online mode to off, why not help your friend get an MC account πŸ˜‰

vernal spruce
#

yeah.. dem unmigrated accs going for less than 1$..

gloomy dew
#

Hello

#

Guys i have a question

#
    #Runner
        if argument 1 is "Runner":  
            console command "/clear %player%" 
            give player a iron sword named "<red>Knight's Sword"
            give player a diamond named "Gem of death"
            equip player with all iron armor  
            set {%player%.class} to "runner"```
#

How to add speed to the kit ?

vernal spruce
#

speed like potion?

gloomy dew
#

Yes.

vernal spruce
#

oh wait

gloomy dew
#

But Infinite

vernal spruce
#

its skript

#

nvm

gloomy dew
#

Speed I

#

Infinite

vernal spruce
#

ask here

gloomy dew
#

Ok thanks ❀️

#

But how to ask

#

._.

narrow crypt
#

i saved an chestinventory using this:

ItemStack[] chestinv = chestblock.getInventory().getContents();

and i am trying to get it back with

chestinv.setStorageContents((ItemStack[]) chestloot.get("loot.chest" + listnumber));
#

but this seems not to work

gloomy dew
#

Wdym?

#

Do you need to do a GUI ??

narrow crypt
#

nope

#

i save a chestinventory with 1 command

#

and on an event set the chest inventory with that saved one

#
Could not pass event LightningStrikeEvent to Airdrop vBeta 0.9.2
java.lang.ClassCastException: java.util.ArrayList cannot be cast to [Lorg.bukkit.inventory.ItemStack;
#

how do i fix that

gloomy dew
#

Umm.

fleet crane
#

.toArray

gloomy dew
#

WTF

#

md_5 !!!!!!!!

fleet crane
#

Can’t just cast a list to array

gloomy dew
#
    #Runner
        if argument 1 is "Runner":  
            console command "/clear %player%" 
            give player a iron sword named "<red>Knight's Sword"
            give player a diamond named "Gem of death"
            equip player with all iron armor  
            set {%player%.class} to "runner"```
#

How to add speed to the kit ?

#

Do you know Rik ?

narrow crypt
#

eclipse suggested it me so I tried it @fleet crane

tiny dagger
#

don't take suggestions for granted

narrow crypt
#

no

#

but trying is worth the error

#

what do i .toArray md_5

vernal spruce
#

??

limber sierra
#

probably should do it on wherever eclipse told you to

narrow crypt
#

where do i add .toArray @fleet crane

vernal spruce
#

show the code

#

on what ur trying to achieve

#

Don't ask java basics to md5..

narrow crypt
#

okay

#

well i got it to work but im suppressing "unchecked"

#

and don't feel comfortable

#
  @SuppressWarnings("unchecked")
    List<ItemStack> theinv = (List<ItemStack>) chestloot.get("loot.chest" + listnumber);
    ItemStack[] invarray = (ItemStack[]) theinv.toArray(new ItemStack[0]);
    chestinv.setStorageContents(invarray);
vernal spruce
#

ahm.. getInventory.getContents return an array

narrow crypt
#

i need to convert "loot.chest" + listnumber" to an ItemStack[]

#

ItemStack[] chestinv = chestblock.getInventory().getContents();

vernal spruce
#

yes..

narrow crypt
#

that is what i used to save the inventory at first

#

that is the right way?

vernal spruce
#

it returns an array of the inventory

narrow crypt
#

yes

vernal spruce
#

lmao typing yes 2x got a warning πŸ˜‚

narrow crypt
#

but to add it to a chest it needs to be an itemstack right

#

xD

vernal spruce
#

once you do that you can simply loop

#

for(ItemStack itm : chestinv){ otherInventory.addItem(itm)}

#

this works if you dont care about order/slots

tiny dagger
#

you can also get from the list the array but the proper way to do it is

#

List#toArray(new Element[sizeoflist]);

bronze marten
#

I think sizeOfList can even be ignored and set to 0?

vernal spruce
#

hmm it may do the size by itself

narrow crypt
#

which method should i use?

vernal spruce
#

overall all will work

#

its up to you

bronze marten
#

toArray(Arr[]) btw does the exact same you do

#

It also suppresses the unchecked warning

narrow crypt
#

ah okay

bronze marten
#
    @SuppressWarnings("unchecked")
    public <T> T[] toArray(T[] a) {
        if (a.length < size)
            // Make a new array of a's runtime type, but my contents:
            return (T[]) Arrays.copyOf(elementData, size, a.getClass());
        System.arraycopy(elementData, 0, a, 0, size);
        if (a.length > size)
            a[size] = null;
        return a;
    }
narrow crypt
#

but im trying stellrow's idea atm

#

but chestinv is from the yaml right?

vernal spruce
#

do w/e you think fits,overall all methods will work

narrow crypt
#

i would like to try yours

vernal spruce
#

hmm you want to take a list of items from config?

narrow crypt
#

yea i saved an chestinventory in the a yaml called chestloot.yml

#

and now i need to get that chestinventory and put it in a chest

vernal spruce
#

do you also have a getinventory for config? or you only save the object itself?

#

show the code how ur saving it

narrow crypt
#

1 sec

#

ItemStack[] chestinv = chestblock.getInventory().getContents();
this is how i get the inventory and then i do:
chestloot.set("loot.chest" + chestcount, chestinv);

sacred wave
#

Hi, is there any Event to detect (and possibly cancel) spectator dismount from an entity? I tried VehicleExitEvent, but as expected not every entity is a Vehicle...

vernal spruce
#

technically its not set as passanger or a vehicle

#

the camera follows him

#

you could make a runnable cancelling any target

narrow crypt
#

stellrow should i just leave it like this since it works or is this a bad behaving method

 @SuppressWarnings("unchecked")
    List<ItemStack> theinv = (List<ItemStack>) chestloot.get("loot.chest" + listnumber);
    ItemStack[] invarray = (ItemStack[]) theinv.toArray(new ItemStack[0]);
    chestinv.setStorageContents(invarray);
sacred wave
#

@vernal spruce I will try that, thank you!

vernal spruce
#

@narrow crypt if you like it,leave it like this,you will eventually get better and find a better way

narrow crypt
#

hmm okay

peak marten
#

Question (again) sorry. I managed yesterday to get everything working as expected. all great. But now I stumbled upon the issue that I can't store like 1000+ block locations in the memory of the plugin

#

And yes it needs to be in the memory

vernal spruce
#

why is that?

#

is there a limit?

peak marten
#

Limit as in?

vernal spruce
#

why not more than 1000+

frigid ember
#

How to send Json message (clickable) to players ?
(ping me fucking)

peak marten
#

It's either the packets that are causing the issue ,or the data

#

So let me explain my use case

vernal spruce
peak marten
#

I got a class named "Zone"

#

for each zone I want users to be able to add as many points as they want (BorderPoint)

frigid ember
vernal spruce
#

You can convert json for it..

sacred wave
#

@vernal spruce so it will detect mount itself (but it will not cancel it) but dismount is not detected this way... 😦

vernal spruce
#

@sacred wave the spectator will always be teleport

peak marten
#

But If I load the points that were placed before, that becomes alot, very fast

frigid ember
#

with bukkit api

vernal spruce
#

because you cant do a perfect location on him,just call setTarget to null on the spectator when the teleport happens

#

@peak marten load the points before? arent every position set?

peak marten
#

Yes that's not the problem. There is some kind of editor mode. And if I edit the zone, those border points become visible again

#

But it can up to a few thousand easily

sacred wave
#

@vernal spruce so there is no effective way to lock spectator to certain target except for constantly re-setting its target?

vernal spruce
#

can a spectator switch targets?

sacred wave
#

@vernal spruce I want to prevent that...

#

switch to another target and dismount from target

vernal spruce
#

well.. that runnable and setting target will do the job..

sacred wave
#

@vernal spruce ok, thank you!

sturdy lotus
#

I got bug

#

Can someone help me

narrow crypt
#

how do i get the 5th element from data.loot

#

someone suggested

#

chestloot.get("loo.chest").get(5);

wanton delta
#

@sturdy lotus that is a crash report

hoary parcel
#

Your swag plugin is doing dum shit

wanton delta
#

Your server crashed

hoary parcel
#

And the server is outdated

#

Use 1.15

wanton delta
#

1.13 is such an odd version

#

No reason to stay there tbh

narrow crypt
#

but anyone?

hoary parcel
#

Ppl who didn't upgrade to 1.14 stayed on 1.13

#

Since 1.14 was a shit show

wanton delta
#

@narrow crypt gonna need more jnfo than that

narrow crypt
#

i have a yml file :

loot:
  chest0:
    items etc
  chest1:
#

and i need the second item(chest1) without knowing the name

wanton delta
#

So i assume you have configuration section

#

Ur gonna use YamlConfiguration#getList::get(4)

narrow crypt
#

i think i got it to work

#

chestloot.getList("loot").get(4);

sturdy lotus
#

@wanton delta how to fix it

wanton delta
#

Idk

#

It means your server crashed

#

I have no clue why

#

@narrow crypt

#

Thats fonna get the 4th chest

narrow crypt
#

yea

wanton delta
#

Not the 2nd item right

narrow crypt
#

yep

wanton delta
#

πŸ‘

narrow crypt
#

i still got some errors but im trying to figure it out

silent pulsar
#

hi

narrow crypt
#

hmm getlist(loot) gives null

#

System.out.println(chestloot.getList("loot")); tried to see but it gives me null @wanton delta

#
loot:
  chest0:
#

it should give a list [chest0]

#

am i right?

wanton delta
#

Oh that code was for the list of items

#

Try to do getKeys

narrow crypt
#

System.out.println(chestloot.getConfigurationSection("loot").getKeys(false));

#

i can't put .get after it

#

but printing just the keys does give me the list

wanton delta
#

It returns a Set<String>

narrow crypt
#

yea just found that out

vernal spruce
#

mhmm why would this not trigger?

#

if(b.getLightLevel()>=15){

#

if its in the open sky during day

wanton delta
#

is b for block

vernal spruce
#

yes

wanton delta
#

Test if getLightFromSky is 15

narrow crypt
#

martoph, any idea how i should continiue to get the index?

#

i need to make it a list

wanton delta
#

Look up somthing on converting a set to a list

#

You mght be able to do

#

.stream().Collect(Collectors.toList());

#

@narrow crypt

#

That would return a list

narrow crypt
#

yea it works :D

#

thank you

silver pewter
#

Hello, I need some help with my runnable as it won't cancel thanks ```java
public void onStart(Player player) {
Runnable runnable = new Runnable() {
int time = checkTime(player);
@Override
public void run() {
if(time != 0) {
time--;
int hours = time / 3600;
int mins = (time % 3600) / 60;
int seconds = time % 60;
String timeTo = (hours > 0 ? hours + " Hours, " : "") + (mins > 0 ? + mins + " Mins " : "") + seconds + " seconds";
player.sendMessage(timeTo);
} else {
//stop runnable
//This works
Bukkit.getScheduler().cancelTask(TaskID);
}
}
};
TaskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, runnable, 0, 20);

    }``` ```java
   AutoMiner autoMiner = new AutoMiner(plugin);
    Bukkit.getScheduler().cancelTask(autoMiner.TaskID);
    player.sendMessage("ID:" + autoMiner.TaskID);```
vernal spruce
#

do this.cancel?

silver pewter
#

the task id returns 0 everytime

vernal spruce
#

also i never see you assign the task

#

to anything

#

Runnable runnable = new Runnable() {

silver pewter
#
   TaskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, runnable, 0, 20);```
wintry jasper
#

@crimson sandal You didn't fill out the CLA form correctly. You need to provide your full mailing address.

crimson sandal
#

@wintry jasper I thought I did? What is wrong with it?

wintry jasper
#

Its only a partial address. You need to fill the form out again.

crimson sandal
#

Oh damn it, Chrome auto filled the line when I entered my phone number

wintry jasper
#

oh I wonder if that what happens to the other people who do that. It happens pretty often that I will only get the one line. Its a legal agreement, so I can't take it like that.

crimson sandal
#

I've just submitted a new one! πŸ™‚

#

Yeah maybe, I guess most forms separate out the address from city, country and postcode.

#

That's why chrome only stores the first line I guess

wintry jasper
#

Ok James, you're all set.

dusty topaz
#

@wintry jasper how do you know when it is reviewed & good to go?

#

do you get an email or something

keen compass
#

if a PR was accepted, you are automatically notified by it being accepted. For other times, usually MD comments on the PR.

#

unless you mean the CLA

#

XD

dusty topaz
#

yeah i meant the cla

keen compass
#

In that case I am not entirely sure as I don't remember if I got an email or not

dusty topaz
#

does getting it approved give me access to something? i can check that i guess

#

it's not been 24 hours yet, and i don't plan to immediately contribute anything anyway but i'm curious

keen compass
#

getting approved gives you the ability to make PR's

rotund fulcrum
#

i need help w/ Votifier's port and stuff

#

im using superbvote + votifier

#

i need help w/ it

crimson sandal
#

Ok James, you're all set.
@wintry jasper Thank you! πŸ™‚

rotund fulcrum
#

The port on server lists always just dont work

#

If u can help w/ that and maybe other problems ping me

narrow crypt
#

quite a basic question but where do i put FileConfiguration data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml")); in my main class so i can acces it

#

im confused cause i added it under here: public class Main extends JavaPlugin{ public static Main plugin; but then the plugin wont load

runic wadi
#

do you have an onEnable

narrow crypt
#

yes

#

thats under : public class Main extends JavaPlugin{ public static Main plugin;

#

@runic wadi ?

runic wadi
#

did you initialize plugin to be non null

hollow rivet
#

@rotund fulcrum which host are you using

narrow crypt
#
    public void onEnable() {
        
        plugin = this;
        plugin.saveDefaultConfig();```
#

this right?

runic wadi
#

yeah idk what you’re doing wrong

rotund fulcrum
#

@hollow rivet self-host

hollow rivet
#

on your PC

#

?

#

if you had to do port-forwarding for your server then you also have to do that for your votifier

vernal spruce
#

hmm did setClickEvent changed from textcomponent?

boreal tiger
#

JavaPlugin has a singleton you can use

#

JavaPlugin#getPlugin

narrow crypt
#

quite a basic question where am i supposed to

    public static Main plugin;
    FileConfiguration data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml"));
    
    @Override
    public void onEnable() {```
its about the data file, where do i put it
cause now it gives an error that it can't load the plugin
rigid nacelle
#

@boreal tiger Why not go ahead with dependency injection?

boreal tiger
#

yeah that would be better, but since he was using a singleton I suggested that

rigid nacelle
#

Right.

rotund fulcrum
#

for port forward

hollow rivet
#

Setting enabled to on would help also πŸ™‚

rotund fulcrum
#

yeah i was going to do that

#

so protocol: TCP is correct?

hollow rivet
#

Yes

rigid nacelle
#

@narrow crypt plugin is null when you're using it.

narrow crypt
#

oh yea

#

thanks

rotund fulcrum
#

@hollow rivet where inside of the SuperbVote config does it say what reward to give when someone votes?

narrow crypt
#

completely lookup over that

rotund fulcrum
#

and how do i get a platform to hook up votes

#

so something responds

#

found rewards

#

β˜‘οΈ

hollow rivet
#

i'm not sure idk much about superbvote

rotund fulcrum
#

does anyone else know a good SuperbVote tutorial?

narrow crypt
#

so i need to put it under plugin = this;
right @rigid nacelle

rigid nacelle
#

That initialization happens first. Just initialize it in your onEnable method.

#

What are you trying to accomplish anyways? You could define it in your onEnable and pass it through the classes constructors instead of using a singleton pattern.

narrow crypt
#

i want to be able to use data trough out the whole main class

rigid nacelle
#

Right, so, just initialize it in your onEnable. Should be fine.

ashen stirrup
#
        char[] msg = message.toCharArray();
        int msgLength = msg.length;
        int capitals = 0;

        for (char c : msg){
            if (Character.isUpperCase(c)){
                capitals = capitals + 1;
            }
        }

        int capitalPercent = (capitals/msgLength)*100;

I'm using this to calculate if the message is 25% capitalized, capitalPercent is always 0 unless 100% of the message is capital. Any help?

rigid nacelle
#

private final YamlConfiguration configuration = new YamlConfiguration(); then load it when necessary.

#

@narrow crypt

rotund fulcrum
#

does anyone else know a good SuperbVote tutorial?

hollow rivet
#

majority of people in here aren't going to be using tutorials for plugin configs tbh, your best way to learn would be reading the wiki that's linked on the superbvote page i'd think

#

just play around with it until it works

narrow crypt
#
public class Main extends JavaPlugin{
    public static Main plugin;
    FileConfiguration data;
    
    @Override
    public void onEnable() {
        
        plugin = this;
        plugin.saveDefaultConfig();
        data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml"));

did i do it right @rigid nacelle ?

#

no i didnt

#

it kind of works

crimson sandal
#

Hey when making a PR to both Bukkit and CraftBukkit how exactly do I link them together? Do I have to post them first and then can you edit the PR afterwards?

subtle blade
#

Yes. That's usually what I do. Or you can do some 300 IQ magic and look at the next PR number on the opposite repo and read the stash's mind

rigid nacelle
#

@ashen stirrup You probably want it the other way around for the percentage.

ashen stirrup
#

Oh okay

subtle blade
#

(ids are incremental so lol)

dusty topaz
#

@narrow crypt

data = new YamlConfiguration();
data.loadConfiguration(blah)
#

I think that is what you want

narrow crypt
#

its weird cause writing to the data.yml works but reading doesnt

rigid nacelle
#

It's just load fyi.

crimson sandal
#

@subtle blade Ah okay I'll just post and edit then πŸ˜›

dusty topaz
#

and you don't need to do Main.plugin.getDataFolder(), you just need to do getDataFolder();

subtle blade
#

Ye. Safer that way because otherwise there may have been a more recent declined PR you missed

rigid nacelle
#

@narrow crypt

data = new YamlConfiguration();
data.loadConfiguration(blah)

@dusty topaz loadConfiguration is a static method iirc.

narrow crypt
#

will that work with 3 yml files in the plugin folder

rigid nacelle
#

So if it's a new instance of the class it's most likely just load(...).

dusty topaz
#

yeah it's just load

#

I misremembered

crimson sandal
#

@subtle blade wait what exactly is the syntax to link them? Or can you just post a link?

narrow crypt
#

ill read that thanks

subtle blade
#

Yea just copying the link is fine

narrow crypt
#

there are so many methods( i believe) that im getting confused xD

subtle blade
#

There might be a #number syntax or something but idk. Haven't messed around too much

#

Like if you do SPIGOT-1234 it will link that issue automatically

crimson sandal
rigid nacelle
#

@ashen stirrup Also, I think you could just do String#chars() which returns an IntStream, with that you could filter the uppercased characters and then return the amount by invoking Stream<T>#count().

hoary parcel
#

,_space_1 πŸ˜„

#

oh and after getposotion too

#

and you really dont want to call getTileENtity.getWorld twice, assign that to a var

crimson sandal
#

Wait where is there a space missing? lol

hoary parcel
#

there is no easy way to get the open status, right?

subtle blade
#

Don't think so

#

I left my comment

crimson sandal
#

And well that code is literally ripped directly from the TileEntityChest

#

That calls .getWorld twice

subtle blade
#

Yea but that's NMS 😦

hoary parcel
#

see, you want to do better than mojang

#

πŸ˜„

#

and I bet it doesnt call getTileEntity twice

kindred slate
#

Alrighty... I'm sure this is a question that is asked waaaaay too much on here. But... How in the world do I get my Minecraft server to work?

crimson sandal
#

Ah okay, I'll change that then

subtle blade
#

Yea, variables and spaces after the ,s

#

That's about it

#

Rest looks good to me

kindred slate
#

I had one made that was working, 5 year old messed it up, so I decided to delete it and make a new one. Did everything the same as I did before and now it wont let me join my server

crimson sandal
#
        World world = getTileEntity().getWorld();
        
        world.playBlockAction(getPosition(), getHandle().getBlock(), 1, open ? 1 : 0);
        world.applyPhysics(getPosition(), getHandle().getBlock());
#

Do you include a space after the var?

#

or a line break I mean

subtle blade
#

Create a variable for getHandle().getBlock() as well, but yea, I'd break between the two like you've done there

#

Not sure it really matters

#

One for getPosition() too

#

Basically, anything you use twice lol

crimson sandal
#

Oh man 'org.bukkit.block.Block' is already used in this class

#

But it uses 'net.minecraft.server.Block'

dusty topaz
#

Β―_(ツ)_/Β―

#

full package names are the best!

subtle blade
#

Yea, you can inline specify the type

crimson sandal
#

I know they just make the code look ugly af lmao

subtle blade
#

CraftBukkit ain't supposed to be pretty!

#

Just good!

dusty topaz
#

shame, it's neither

crimson sandal
#

Wait what's the need in storing the getPosition() method... it literally references a variable itself? So it's no different calling getPosition() or assigning it to a var?

subtle blade
#

Ah does it? That's fine then

#

Other two can be vars because they're chained

crimson sandal
#

Yeah .getBlock() casts to Block as well so that makes sense

#

Oh man I just pushed a new commit and noticed IntelliJ automatically rearranged the imports

#
import net.minecraft.server.BlockChest;
import net.minecraft.server.Blocks;
import net.minecraft.server.ITileInventory;
import net.minecraft.server.TileEntityChest;
#

to

#
import net.minecraft.server.*;
subtle blade
#

monkaS

#

I usually turn off automatic import organizing for Bukkit & CB lol

dusty topaz
#

i have auto imports on but have the asterisk turned off

#

import everything individually to get line count up :D

subtle blade
#

Should clarify. Just Bukkit & CB I have it off for

dusty topaz
#

i have it off for all Β―_(ツ)_/Β―

dusty topaz
#

what happens if after setting it open a player opens and closes it?

crimson sandal
#

It would close

dusty topaz
#

i thought so

#

that's probably the best way to have it

crimson sandal
#

But that should be the expected behaviour

#

Yeah

#

If you don't want it to close you just listen for the inventoryopen/close event

dusty topaz
#

i imagine a big use case would be for stuff like hunger games, where it is open after being looted

#

but you would want it to close again if items remain in it (say a player desposits items), so i think it's the best way to have it πŸ‘

narrow crypt
#

that moment when u finnally fixed an bug but you dont now what u did....

rigid nacelle
#

Been there done that. πŸ‘€

crimson sandal
#

Yep, also my plugin opens a remote inventory when you open a chest instead of the chests own inventory so it's perfect for that πŸ˜„

vernal spruce
#

k boys most epic question,how th do i dismount a passanger

#

removing it from passangers list doesnt seem to do the job

#

do i force call the exit event?

narrow crypt
#
public class Main extends JavaPlugin{
    public static Main plugin;
    public FileConfiguration data;
    
    @Override
    public void onEnable() {
        
        plugin = this;
        plugin.saveDefaultConfig();
        data = YamlConfiguration.loadConfiguration(new File(Main.plugin.getDataFolder(), "data.yml"));

got it to work @rigid nacelle
problem was that the saving wasnt going right and i thought i didnt set up the file correctly

#

thanks :D

dusty topaz
#

Vehicle#eject

#

solving problems whilst he is in the shower! :D

vernal spruce
#

aham i see

rigid nacelle
#

@narrow crypt Glad you figured it out.

subtle blade
#

Sometimes I'm just that amazing, Avro

#

james, looks good to me oki

vernal spruce
#

Welp im getting an npe calling it

#

p.getVehicle().eject(); on command

#

Question being can a player ride another player? πŸ€”

subtle blade
#

Sure

tiny dagger
#

choco do you ever get account stolen reports? πŸ€”

#

i had a buyer today who had his account stolen and i could check it too

vernal spruce
#

@subtle blade then why would i get a npe on this? rider.getVehicle().addPassenger(p);

rigid nacelle
#

@narrow crypt Also, you don't need to use plugin.saveDefaultConfig(). You are in the main class at that point and you could just use saveDefaultConfig() or this.saveDefaultConfig() which just means current instance.

tiny dagger
#

savedefault config should be done after getting from config the values to generate the user config

rigid nacelle
#

You lost me at getting from the config. I would like to assume that the user wants to save the default config.yml resource? What's the point of getting if it doesn't exist?

#

I think I might've misunderstood what you meant.

#

@tiny dagger Feel like getting me on the same page as you? Because I am genuinely lost.

tiny dagger
#

savedefaultconfig also creates a config for the user to be able to edit

rigid nacelle
#

All saveDefaultConfig() does is it invokes JavaPlugin#saveResource("config.yml", replace) if the file doesn't exist AFAIK.

tiny dagger
#

yeah

keen compass
#

@vernal spruce either the vehicle is null or the player is. I am going to assume it is the vehicle

vernal spruce
#

Theyr both 2 valid players as im alrdy checking for null

slim hemlock
#

does the world#spawn() method trigger a CreatureSpawnEvent in case of a creature?

keen compass
#

@vernal spruce vehicle is possibly null

#

since you are using rider, it is possible for the rider to exit the vehicle in the time it takes to process the code to add a passenger to the vehicle the rider is on. Which would cause the vehicle to become null.

narrow crypt
#

@rigid nacelle oh yea thats true, thank you

vagrant rune
#

Hey guys!
Is there a way to.. see how many chunks and entities are loaded right now on my server?
Is there any command or something?

vernal spruce
#

type memory

#

/memory

vagrant rune
#

unknown command)
*paper.1.15.2

vernal spruce
#

it has it

#

i runned paper and it worked

devout sierra
#

Hi there, I know this might be a bit retarded to ask but I really hope that some plugin magic might be able to help me out because I didnt figure out a vanilla way to this (and I cant use mods as this is supposed to be added into my spiggot server).

https://cdn.discordapp.com/attachments/385167853919141889/704002829991411802/2020-04-26_00.53.32.png
I retextured the snow texture to grass so I could have a smooth terrain.
as expected, it only displays the snow texture but I instead want the snow to mimic the block below it so that the terrain can be made out of whatever block I want (smooth beaches, smooth hills, smooth mountains... you get the idea)

Overlaying does exist in this game but it only works with the block next to it while I kinda need to invert this data. any ideas?

vagrant rune
#

mb it was some plugin?
Coz I swear, console write me that it's unknown command)

vernal spruce
#

we dont have layered grass

#

its not rly possible yet

devout sierra
#

? we do have layered grass

#

you can even add arguments so it displays correctly depending on the terrain youre in

vernal spruce
#

where exactly?

devout sierra
#

1.15.2? I dont understand the question

#

there, layering works

#

if you wanted to, you could overlay the whole texture on top of another

vernal spruce
#

are you sure thats not ur texturepack

devout sierra
#

it is

#

thats what im talking about

vagrant rune
#

/memory
@vernal spruce it's and Essentials command, lol
btw, thanks)

vernal spruce
#

oh nice

devout sierra
#

I just need to find a way to trick the game into layering the block depended on the block underneath it and I hope that plugins might help me out with this because I cant find any options that allow me to do that otherwise

median abyss
#

Can someone explain to me how I could use date place holders with PAPI
Like I want est time like this along with date

vernal spruce
#

you know it means forcing players to use a specific texture pack wich they wont

devout sierra
#

they have to, you can disable that they can choose

#

and if they find a way arround it so be it i guess? then their whole map and game will look super weird

frigid ember
mellow wave
#

You probably want to look in to the amount of hoppers and armor stands

wanton delta
#

does anyone know the sound name for when a player shoots another player

#

the ding noise

cloud sparrow
#

entity.arrow.hit_player?

wanton delta
#

ill give it a try

cloud sparrow
#

I gave you what it's similar to

#

not what it is.

#

Dependent on the version will change the result ofc.

rigid nacelle
#

Infact, you gave the exact name of the sound enum.

#

Well, I mean a part from the uppercased letters and underscores. πŸ‘€

quartz kernel
#

I was wondering if I could get a bit of help with a listener that I'm coding right now, I'm trying to cancel the consumption of any suspicious_stew however it doesnt seem to work the way im trying to do it, could any of you point me in the right direction?

public class ConsumptionListener implements Listener {
    String prefix = ChatColor.GRAY.toString() + "[" + ChatColor.DARK_GRAY.toString() + "Qbit" + ChatColor.RED.toString() + "UHC" + ChatColor.GRAY.toString() + "] ";
    @EventHandler
    public void consumptionChange(PlayerItemConsumeEvent event) {
        if(event.getItem().isSimilar(new ItemStack(Material.SUSPICIOUS_STEW))) {
            event.setCancelled(true);
            event.setItem(new ItemStack(Material.BOWL));
            event.getPlayer().sendMessage(prefix + "Suspicious stews are disabled!");
        }
    }
}
rigid nacelle
#

Checking the type should be enough, huh? For example:

@EventHandler
void onConsume(final PlayerItemConsumeEvent event) {
    final ItemStack itemStack = event.getItem();    

    if (itemStack.getType() != Material.SUSPICIOUS_STEW) return;
    
    // type is SUSPICIOUS_STEW, do what you feel like
}
#

@quartz kernel

quartz kernel
#

I feel like I'm doing something wrong on the condition

#

o

#

I was doing everything wrong jesus

rigid nacelle
#

It didn't meet your condition because they're two different objects.

quartz kernel
#

I've got a lot to learn then

rigid nacelle
#

AFAIK, ItemStack#isSimilar is the same as Object#equals a part from isSimilar ignoring the amount.

median abyss
#

Can someone explain to me how I could use date place holders with PAPI or MVDW
Like I want est time like this along with date

rigid nacelle
#

Also, @quartz kernel. There's a utility method in the class String called format. You can do quite a lot with it, it is very useful. In your case of prefix, it could look a bit nicer using it. For example:

private final String prefix = String.format(
    "%s[%sSpigotMC%s]", GRAY, RED, GRAY
);
quartz kernel
#

That's way nicer wow

#

I'll look into it

#

thanks a lot!

rigid nacelle
#

πŸ‘

#

@median abyss With PAPI? Is there not a list of placeholder categories out there on (a) WIKI?

median abyss
#

There is @rigid nacelle, struggling to use it πŸ˜›

rigid nacelle
#

There is %server_time_<format>%, not sure if that's what you're looking for?

#

<format> being a DecimalFormat pattern.

median abyss
rigid nacelle
#

Did you download the extension and reload PAPI?

#

/papi ecloud download Server to be exact.

median abyss
#

Yeah downloaded

rigid nacelle
#

Is your scoreboard plugin supporting PlaceholderAPI at it's current state?

#

Infact, what scoreboard plugin are you running?

median abyss
#

Yeah it is, Featherboard

rigid nacelle
#

It does not support PAPI directly AFAIK.

#

You'll have to use {placeholderapi_<placeholder>} IIRC.

median abyss
#

Is there a MVDW placeholder for it?

rigid nacelle
#

What I sent should work.

#

I.e {placeholderapi_server_time_HH:mm:ss}.

#

@median abyss Got it to work?

median abyss
#

Awesome thanks πŸ™‚

rigid nacelle
#

πŸ‘

fleet burrow
#

About how long does getting persistent data from a block take?

vernal spruce
#

well it's found inside the block s data so i doubt its anything noticeable

wraith grail
#

Where is persistendatastorage saved (For example I create a item, grab it's itemstack. Add persistentdatastorage to it and give it back to the player) when server is stopped?
Does it have to load ALL of the "storages" of every single item that has it on server startup or is it only loaded if a online player actively has it in their inventory or if the item is in a loaded chunk? (or if I call for it otherwise for example messing about with a players dat file) I'm planning to store 42 bytes of data in the item and I'm trying to think a bit more future forward by considering what would happen if 1 million items were created. It's only 42 MB but it would be nice knowing if 42 mb has to be loaded into ram or not. Because eventually unless you start clearing items, 10 million items would be 420 mb and that would be 420 MB ram dedicated just to items.

vernal spruce
#

in the itemmeta itself

subtle blade
#

Depends on where it was written

vernal spruce
#

i think

subtle blade
#

Items are held in the player's inventory (player data), blocks are held in the world data, etc.

#

It's loaded just the same as all other NBT for that object

wraith grail
#

So it is as I described it? Only when a player is online OR if the chunk that has the item is loaded?

vernal spruce
#

i think its stored inside the item

sage flint
#

is there a possibility, if you have an bungeecord server ( so different servers etc pp) to make them visible for just some players.

sage flint
#

kiss

wraith grail
#

``
ItemStack itemStack = p.getInventory().getItemInMainHand();
NamespacedKey key = new NamespacedKey(mainclass, "waterbreathconfigurator");

        ItemMeta metadata = itemStack.getItemMeta();
        metadata.getPersistentDataContainer().set(key, PersistentDataType.INTEGER , Data);
        itemStack.setItemMeta(metadata);
        p.getInventory().setItemInMainHand(itemStack);

``

#

Seems to make sense. Thanks for the help guys.

finite pine
#

tr

analog roost
#

Hello

#

I'm trying to use this :

#

I paste all the custom event in a class

#

Then I write an @EventHandler with just event.getPlayer().sendMessage(Integer.toString(event.getPlayer().getName()));

#

But nothin appear

hollow willow
#

Is it a new spigot version? I'm getting a outdated-message now (came yesterday or something). Can't see a new version on the website.

rigid nacelle
#

@analog roost How come you invoke Integer.toString(Player#getName)?

analog roost
#

It's not rly this x)

rigid nacelle
#

Huh?

analog roost
#
    @EventHandler
    public void onVillagerTradeEvent(VillagerTradeListener.VillagerTradeEvent event){
        event.getPlayer().sendMessage(event.getPlayer().getName());
    }```
#

This πŸ™‚

zenith siren
#

When adding a potioneffect to an entity how do I make the duration unending?

analog roost
#

@analog roost How come you invoke Integer.toString(Player#getName)?
@rigid nacelle I change the code πŸ˜‰

zenith siren
#

I'm trying to make an invis armor stand but do I need to add a potion effect to make it invis or not?

golden vault
#

you can just setVisible() on the armor stand

rigid nacelle
#

^ ArmorStand#setVisible(bool)

pallid panther
#

Anyone interested in helping make a MineZ plugin

vernal spruce
#

is a Set concurrent?

#

nvm found it

frigid ember
#

help me !!!
on my server were players left without permission for anything? what to do?

rigid nacelle
#

What? Can you elaborate a bit more on that?

strange geyser
#

hello, I need some help with the simple portals plugin. I have it on my server, but my friends say they do not have permission to use any of the portals. I don't know what I am typing wrong for the command to work. Please and thank you.

frigid ember
#

my friends on the server were left without permission for anything

golden vault
#

use a permissions plugin such as Luckperms to give them permissions

frigid ember
#

@golden vault yes I already downloaded this, how do I configure it?

rigid nacelle
#

@strange geyser What permissions have you given them?

frigid ember
#

@golden vault ?

golden vault
#

make groups, put the permissions you want in the groups then assign the groups to the players, you will need to look at their wiki for specifics

strange geyser
#

@rigid nacelle I didn't give them any permissions nor did I take any permissions from them. I thought you were suppose to add in a command on the portal to allow them to use it

rigid nacelle
#

@strange geyser Exactly what plugin are you using? According to the first SimplePortals that I found, they need to have the permission simpleportals.portal.<portalname> or the wildcard (simpleportals.portal.*) in order to use them.

PS: Resource on Spigot.

pallid panther
#

How do I make a plugin compatable with multiple versions of Minecraft

strange geyser
#

@rigid nacelle See I tried typing in the command for that, but they say they still get this error message that they do not have permission. I'm trying to figure out what I'm typing wrong, or are they suppose to type it?

rigid nacelle
#

I'm not really sure what plugin it is, so I can't really help without any knowledge.

rigid nacelle
#

Could you provide me with the resource? @strange geyser

#

Thank you. I'm not really sure if you're allowed to send links in here. Just to make sure, delete the message.

strange geyser
#

ah I'm so sorry

rigid nacelle
#

That's not worries, I asked you to send the resource. That is my fault.

#

But yes, as I said before, simpleportals.portal.* - Allows the player to use all portals..

strange geyser
#

Thank you so much for helping me.

#

Hmm, I guess I'm just typing the command wrong?

rigid nacelle
#

What command are you executing?

strange geyser
#

/simpleportals addcmd <player name> simpleportals.portal.*

rigid nacelle
#

The thing is, the third argument, in your case simpleportals.portal.* is wrong.. What you're doing is adding a command to whenever a player enters the specific portal.

zenith siren
#

If I have a player then how do I get the location 0.5 blocks to their left? I can't use Location#subtract because that uses the X Y Z cords and a player might be standing diagonal or just looking in another direction

strange geyser
#

Ah, gosh. What.

rigid nacelle
#

You need to create a portal before actually adding a command to it. So steps for example:

  1. /simpleportals create <portal name> NOTE: You must select a region before executing this command, keep that in mind.
  2. /simpleportals addcmd <portal name> <command>
#

@strange geyser

strange geyser
#

Oh, gosh ok. I'm very stupid. Thank you so much for this and have a very nice day. πŸ™‚

#

@rigid nacelle

rigid nacelle
#

You too!

#

@zenith siren Perhaps the player's yaw & pitch?

late tangle
#

How would you code an async mysql database lookup with a bungeecord plugin?

#

I've got the lookup part working, just need to convert it to async.

rigid nacelle
#

The scheduler API perhaps?

#

TaskScheduler#runAsync(owner, task) should most likely do it. A part from that you could have a look at ExecutorService.

#

@late tangle

fleet burrow
#

An enchanting table's data extends tilestate right?

subtle blade
#

I don't think it does. It's not a tile entity afaik

#

yes, it does

#

TIL enchantment tables can have custom names... for some reason

rigid nacelle
#

Choco loco.

junior acorn
#

lucky perms did not work i imported groups but still could not get it to work... i am used to doing permission nodes manually and am used to group manager format i did find an updated group manager i would recommend: https://www.spigotmc.org/resources/groupmanager-1-7-1-15.40615/ my issue was it saying there is a newer update but learned i can just disable it in language but removing the text from update message i just left the coding format and nothing else. wanted to say that i have fixed my issue from last night

#

thank you all who helped me

late tangle
#

@rigid nacelle Thank you. Works perfectly.

rigid nacelle
#

Glad to hear it.

frigid ember
#

My resouce is still under review, I would like to update it though. Is that possible?

hoary parcel
#

no

chrome lark
#

There is no such thing as a maintained version of GM

#

ngl, I tried forking GM as I was using it for my own stuff because that's what the owner was familiar with and not 100% convinced about LP yet, the codebase is so terribad that large parts just literally need rewriting to go anywhere with it, I seriously doubt that anybody is actually looking after GM in the way that it would require

vernal spruce
#

why none of these methods work? ridee.eject();
ridee.leaveVehicle();
p.removePassenger(ridee);

#

none of them seem to dismount the rider

#

nvm fixed

zenith siren
#

How can I "rotate" a vector?

I got a vector like this

↑

I need to get it like this

⬈

frigid ember
#

rotate your screen 45 degrees

zenith siren
#

._.

crimson sandal
#

Question, is registering/deregistering listeners expensive or lightweight?

subtle blade
#

Vector#rotate(), Skrump

zenith siren
#

Wa

subtle blade
#

Well, not #rotate(), but there are rotation methods

#

Registering, sort of. It uses reflection to find methods with the event handler annotation, james

#

Removal, don't think so. Registered listeners are in hash maps

#

O(1) afaik

crimson sandal
#

Okay, cool

zenith siren
#

What sort of rotation methods are there?

#

I thought maybe get the crossproduct from a vector like this β†’

#

But idk how to get a vector like this β†’

boreal tiger
#

wdym like this ->

#

in PathFinderGoalSelector#a() what's the first argument for?

#

is it the priority?

subtle blade
#

afaik yes

boreal tiger
#

oh right cool πŸ‘ can multiple goals have the same priority?

subtle blade
#

Yes

boreal tiger
#

oh right cool πŸ‘ thank you πŸ˜„

tiny dagger
#

you should look into minecraft remapped source code tbh :d

boreal tiger
#

yeah I found it but I wasnt sure about the multiple goals with the same priority thingy xD

zenith siren
#

I got the vector rotation thing

boreal tiger
#

it's so useful the minimap thing

vernal spruce
#

k boys how do i do this better?

#
        messages.put("noplayerfound", ChatColor.translateAlternateColorCodes('&',pl.getConfig().getString("Messages.noPlayerFound")));
        messages.put("sentrequest", ChatColor.translateAlternateColorCodes('&',pl.getConfig().getString("Messages.sentRequest")));
        messages.put("cantcarryself", ChatColor.translateAlternateColorCodes('&',pl.getConfig().getString("Messages.cantCarrySelf")));
        messages.put("notcloseenough", ChatColor.translateAlternateColorCodes('&',pl.getConfig().getString("Messages.notCloseEnough")));
        messages.put("playerleftoraway", ChatColor.translateAlternateColorCodes('&',pl.getConfig().getString("Messages.playerLeftOrAway")));
        messages.put("alreadyinvited", ChatColor.translateAlternateColorCodes('&',pl.getConfig().getString("Messages.alreadyInvited")));
    }```
#

public HashMap<String,String> messages = new HashMap<>();

tiny dagger
#

createa general method? :p

#

tbh you shouldn't be doing this in first place imo

hoary parcel
#

you want an enum or a list of constants

#

so you dont have to reference messages by hand

sour gazelle
#

My bungeecord Network stopped working!! What do I do?

tiny dagger
#

not worry?

#

calm and see what the log spills

sour gazelle
#

No like the commands (/server) dont work anymore

sacred wave
#

Hi, does anyone know how to reset Advancement progress for a player (or at least for everyone) as would /advancement revoke <player> everything command do via the api? I could call the command, I am just wondering if there is a cleaner solution... Also is there a way to catch actual completion of advancemets and get their names? I know there is AdvancementDone event, but it spills to much information and I did not find effective way to filter out only the advancements (and not recipes etc..)

dusty topaz
#

AdvancementDoneEvent is probably the only way you'll get that

#

You can get the key of the advancement with #getKey

boreal tiger
#

mhm what would be the best way of preventing entities from leaving an area?
I thought about using a runnable every 3-5 seconds to reduce the load a bit instead of checking every second or tick.

Is there a better way of doing this?

dusty topaz
#

pretty sure aikar explained this the other day

#

saying it's not possible to do cleanly

sacred wave
#

@dusty topaz Thank you for answer, and can I somehow detect whether it is Advancement or Recipe unluck except by doing some Set of expected keys?

boreal tiger
#

ah right

dusty topaz
#

@boreal tiger you could alternatively set pathfinding goals I guess

boreal tiger
#

mhm

#

I'd have to make a custom one I think that checked if the distance is too big

#

from the center

dusty topaz
#

@sacred wave I'm unsure, not too familiar with Advancements (didn't even know it got called for recipes)

#

does #getCriteria spit out anything useful in identifying?

sacred wave
#

@dusty topaz I will try that, but I am sure key itself is totally useless... :/

dusty topaz
#

key will give you a unique identifier for each advancement

#

so you could always filter by key

boreal tiger
#

wait entities cant cross world borders πŸ‘Œ

sacred wave
#

@dusty topaz Yea, that is clear, unfortunately minecraft has tons of Advancements which are updated regurarly, and having a set of them is not really good solution imho...

dusty topaz
#

that is fair, check the output of criteria

#

and @sacred wave to reset, it looks like you have to

#
player.getAdvancementProgress(advancement).revokeCriteria(advancement.getCriteria());
subtle blade
#

You would have to foreach those, but yea, that's the way to do it

dusty topaz
#

ah yeah

subtle blade
#
AdvancementProgress progress = player.getAdvancementProgress(advancement);
progress.getAwardedCriteria().forEach(progress::revokeCriteria);```
dusty topaz
#

not doing it on one line isn't cool

subtle blade
#

Progress is used more than once

dusty topaz
#

my brain imagined it like:

#
criteria.forEach(c-> player.getAProgress(adv).revoke(c));
#

despite that being worse

#

Β―_(ツ)_/Β―

vernal spruce
#

@subtle blade btw is there a way to see inside caffebabe? Kapp πŸ€”

subtle blade
#

Dude, that's creepy

vernal spruce
#

didnt sound sexual at all

dusty topaz
#

whaaaaaa

vernal spruce
#

im interested in making one of em plugins

#

that i can connect to disc

dusty topaz
#

discordsrv is open source

#

CafeBabe isn't even on the server

vernal spruce
#

so i can most likely find everything in there?

#

nice

dusty topaz
#

yeah, either that or you just use JDA docs

#

it's pretty much the same, you just have to be careful to run things async

sacred wave
dusty topaz
#

but JDA makes that easy

sacred wave
#

this whole log contains only one Advancement πŸ˜„

dusty topaz
#

nice

#

Then unfortunately it looks like you're stuck to keys lol

#

unless there is something I do not know about

#

which is probable

sacred wave
#

@subtle blade thank you, I will try that, too bad there is not simple way

subtle blade
#

This is how vanilla does it too

dusty topaz
#

it seems pretty straightforward to me

sacred wave
#

@subtle blade @dusty topaz I know, but I hate to reinvent the wheel πŸ˜„

subtle blade
#

But this is the wheel πŸ˜›

dusty topaz
#

What do the keys look like for the advancements?

sacred wave
#

something:something

#

will do the output, mmt...

vernal spruce
#

most likely the usual

#

minecraft:advancement_..

subtle blade
#

Don't believe they're all prefixed with advancement_

dusty topaz
#

Just wanting to see what they look like to see if there is anyway to filter them

subtle blade
#

What's wrong with AdvancementDoneEvent again?

sacred wave
dusty topaz
#

well, there you go

#

story are advancements

#

recipe are recipe

sacred wave
#

@subtle blade I need ideally detect "Stone Age" advancement... and not the other stuff

subtle blade
#

wat. Are recipes filtered through AdvancementDoneEvent?

#

Or am I misunderstanding what you're showing us lol

sharp trout
#

Is it possible to intercept everything sent through the bukkit logger?

dusty topaz
#

That is what is happening I believe

vernal spruce
dusty topaz
#

Which surprised me

sacred wave
#

@EventHandler public void aaa(PlayerAdvancementDoneEvent e) { Bukkit.getLogger().info(e.getAdvancement().getKey().toString()); }

dusty topaz
#

Just check if the key is:

story:mine_stone
subtle blade
#

Recipes shouldn't be considered advancements

sacred wave
#

@subtle blade ah, that seems logical... I thought it is feature, so I did not report that πŸ˜„

subtle blade
#

If you're on the latest version, I would report that

#

Doesn't seem intentional to me

#

?jira

#

aw come on

worldly heathBOT
subtle blade
#

THANK YOU

sacred wave
#

@subtle blade git-Spigot-e7dc2f5-a8ec1d6 (MC: 1.15.2)

#

ok will report it, thank you

subtle blade
#

Yea you're a little behind

#

~8 versions

#

Though you should be fine to report it. No commits to have addressed that

vernal spruce
#

@subtle blade is there such a thing as food eating progress?

#

or its handled client side

subtle blade
#

Want to say that's client-sided

vernal spruce
#

hmm k

sacred wave
#

@subtle blade I update only when spigot starts bugging me with 20 secs update notification πŸ˜„

vernal spruce
#

yep

#

that hurts the most,thats why i updated as well

dusty topaz
#

I update only when spigot starts bugging me with 20 secs update notification

#

why is this so relatable

subtle blade
#

And that's why it exists

vernal spruce
#

noice

sacred wave
#

πŸ˜„

vernal spruce
#

well time to lay in bed

potent creek
#

hey what is the best-practise way to store an ItemStack with custom NBT on it to a database?

vernal spruce
#

sql or config?

potent creek
#

SQL database

vernal spruce
#

if its config,itemstack is serializable meaning you can simply call setItemStack

#

in that case not your man..

potent creek
#

I read that serialize removeed NBT data online, is that still true because it also seems to be what everyone is doing

novel phoenix
#

this is a bit hacky but

#

I usually store it as byte blob

potent creek
#

how is that hacky?

novel phoenix
#

well

potent creek
#

that sounds great

novel phoenix
#

I use NMS methods

potent creek
#

but how do you get the blob haha

vernal spruce
#

rip compatibility πŸ˜‚

novel phoenix
#

to convert NBT data into byte[]

#

so yeah

#

rip compatibility

#

you can use something like ProcotolLib or PowerNBT (idk if its updated)

#

as 3rd party library

#

instead of NMS

#

or write your own serializer using Bukkit API

potent creek
#

writing my own serializer sounds like more effort than the rest of the project in its entirely so that's definitely not the way to go

#

ProtocolLib has support for ItemStack serialization?

novel phoenix
#

I remember ProtocolLib having API for working with NMS stuff

inland meteor
#

i have a general dev question, not exactly related to spigot & bungeecord - am i okay to ask this in here? if not dw

novel phoenix
#

means you can serialize it on "low level" instead of going through every possible extension interface for ItemMeta

potent creek
#

minecraft items is a perfect example of OOP being used where it is not appropriate lol

novel phoenix
#

@inland meteor just ask lol

#

it was made so people won't break stuff

#

because in old minecraft versions corrupted NBT data would just crash the client

#

and for tile entities that meant that any client loading chunk with it would crash the client

potent creek
#

how does OOP help against crashes?

#

I would have imagined a component based approach would be much easier to work with

#

(and more moddable, which is of course interesting for us)

devout sierra
#

is it possible to force people into using optifine?

#

as far as I know you can force mods but optifine requires installation so im not sure

dusty topaz
#

why would you want to do that

devout sierra
#

Without it, you cant have merging textures

analog roost
#

Hello, i'm trying to check if player can hold (Has enough space) to hold my item stack

#

I found this java final Map<Integer, ItemStack> map = event.getWhoClicked().getInventory().addItem(recipe.getResult()); // Attempt to add in inventory if (map.isEmpty()) {} // If not empty, it means the player's inventory is full.

#

But this add items to the inventory

#

And I just want check without add

dusty topaz
#

There is no clean way that I know of to check if a player can hold an item (say it's full of 1 wood block in each slot, to check that he could pickup a wooden block but not a piece of redstone)

#

however, if you're not too bothered about that, Inventory#firstEmpty does that you need

boreal tiger
#

mhm, is it necessary to use nms to allow a zombie to break doors?

fathom shard
#

Zombies can break doors anyway?

vernal spruce
#

You can change vanilla behaviour(hardmode)

dusty topaz
#

In hardmode they can

vernal spruce
#

Zombir have a 5% to go for doors

#

You might be able to force target the player wich in theory should allow the zombie to go for the door

boreal tiger
#

mhm

vernal spruce
#

Basically spam the zombies with settarget till it doesnt lose player

dusty topaz
#

I think you have to use NMS

boreal tiger
#

yeah

dusty topaz
#

private final PathfinderGoalBreakDoor bA; in EntityZombie

vernal spruce
#

Or nms..

boreal tiger
#

yep

vernal spruce
#

Nothing better than good ol nms

#

I need to work more with it

late tangle
#

With a Bungeecord command, how would you allow tab completion, so I only have to type part of the command? Like /Di and then tab, and it would change it to /Discord.

keen compass
#

why does everyone suddenly care about tab completion o.O

upper hearth
#

It's fancy

slow tulip
#

Hey, I'm kind of new to world generation and I was wondering where can I see how the vanilla world generator is coded?

#

Or something that can help me get an idea of how is the correct way of handling terrain generation.

fleet crane
#

The vanilla generator is tens of thousands of lines of code

fair abyss
#

isn't another game was maded with codes of alpa versions of vanilla generator πŸ˜„

subtle blade
#

And spread out among numerous classes as well lol. I still remember your sufferings a few major versions ago

cinder schooner
#

I have a quick question, and the answer is probably fairly obvious - but I've only ever dipped my pinky toe in the world of networked servers using Bungee.

How would I totally prevent UUID spoofing - without using AuthMe type plugins?

subtle blade
#

Using online mode, preferably

cinder schooner
#

Right, so would I force the hosts then in order for the servers to be bungeed?

subtle blade
#

Or, rather, on bungee you would route it through the proxy

cinder schooner
#

I guess I'm a little confused - like I said, I've hardly ever used bungee.

subtle blade
#

Bungee acts kind of like its own authentication

cinder schooner
#

The servers have to run offline in order to be added to the 'bungee' config? no?

subtle blade
#

Correct

#

Bungee is your online mode defence

cinder schooner
#

So then the proxy running in online mode would prevent that/

subtle blade
#

Yes

fair abyss
#

so you say make bungee offline, make backens online? Or I got it wrong? choco

cinder schooner
#

no

#

bungee online, other servers offline

#

Whats the easiest way then to force clients through proxy, and disallow connections directly to the bungeed servers?

fair abyss
#

I have made a util for my projects. In this util some class has chain methods. And they are very useful for my some projects.

So, I want to use them like "LeaterUtil.chain(stuff)...."
And, abs dont want to do it with an instance of this class.

Everything goes good, until one of my project uses older libraries than others. So some part of some class's (includes the class which has chain methods) need to be different a bit.

Then my issue starts here. How can I make this?

I cant do it with abstract classes cus I dont want have an instace of classes which has chain methods. And dont want something like this

       public static void run() {
           xxxInstance.run()
       }
   }
``` because some class has really much method and dont want to add them and this can break my some chains.
frigid ember
#

@analog roost I have a method which checks if there is enough space in the inventory, if there is not it just drops the item on the ground at the player's location

#

if you want it you can have it :)

fair abyss
#

actually, addItem returns the items which cant fit inventory

#

so, addItem(items...).foreach((key,value) -> World#dropItem(Location, value)) something like will help

frigid ember
#

huh. the more you know!

#

yeah, that's a better version

fair abyss
#

and you can set dropped item's velocity to 0 to make that will drop yo the center of location

frigid ember
#

ye

#

also, a question about entities

#

actually

#

nevermind yeet

vital willow
#

Sorry if this is a stupid question... super novice dad that's been running a server for my kids and their friends for about a year now with no real issues... just went to spin up a new server, downloaded and compiled the latest build tools, but now every single time I launch the server, it rebuilds a new world. I assume I missed a change somewhere in the last few months. Can anyone tell me what I'm doing wrong?

safe mesa
#

quick question

#

its impossible to change the ip on a server right

fair abyss
#

@safe mesa check server.properties

safe mesa
#

like a port forwarded server

#

cause i have my server set up so i can play with friends

fair abyss
#

depending to your host

#

but mostly impossible

safe mesa
#

ok

fair abyss
#

@vital willowno have idea

#

maybe the issue of latest build

#

and why are you building from build tools?
if you dont need source codes theres sites you can simply download

upper hearth
#

Are you sure it's rebuilding a new world? Like log off, restart, and log back in the world is completely different?

#

@fair abyss You should build yourself instead of trusting 3rd party sites.

subtle blade
#

and why are you building from build tools?
if you dont need source codes theres sites you can simply download
No

#

Do not ever download Spigot from anywhere

upper hearth
#

Isn't illegal to do that anyways?

#

technically

subtle blade
#

BuildTools is the only legal method of obtaining the modded server jar

vital willow
#

@upper hearth Yep... I launched the server.. logged in... looked around... Shut the server down... restarted it. Logged back in, different world. Noted the spawn coordinates.

#

Tried it again... same thing... tried warping tot he spwn thinking ok maybe it was same world just different spawn.. but nope...

subtle blade
#

What plugins are you running?

upper hearth
#

I was gonna ask that >:l

subtle blade
#

The default server setup shouldn't be doing that

vital willow
#

none... I literally started this from scratch tonight. Started with nothing but spigot-1.15.2.jar and my start.bat in the folder... launched once and then edited the eula. on every restart since, i get a new world

subtle blade
#

Is a new world being generated every time? What's your server.properties look like? That's strange

#

?paste your properties here:

worldly heathBOT
subtle blade
#

(Ctrl + S to save, send the link back here)

upper hearth
#

I don't know what it would be doing with the old world file

vital willow
subtle blade
#

Is a new world being generated every time?

#

As in, do you have any worlds other than "world"?

#

(_nether & _the_end excluded - consider those just one world)

vital willow
#

I only have 'world' 'world_nether' 'world_the_end' folders.. and it appears to regenerate those every time I launch

subtle blade
#

Want to send a paste (same link above) of your latest and second latest log files?

#

I'm genuinely confused lol

vital willow
#

sure! thanks so much for taking a look! I appreciate it!

upper hearth
#

What's your start.bat? I wonder if it's deleting the world files before the server starts? Literally no clue

vital willow
#

oh... this last time... I ran save-all and now I go back into the same world when I log in... but if I place anything and then restart the things i just placed are gone...

#

My start.bat is just: java -Xmx4G -Xms4G -jar spigot-1.15.2.jar nogui

fair abyss
#

did you stop the server via command or just clicked x icon?

vital willow
#

i am literally not fancy

fair abyss
#

have you ever write stop to the console?

vital willow
#

I did just click 'X'

fair abyss
#

dont do that again

subtle blade
#

That may be why

keen compass
#

use the stop command

subtle blade
#

Surprised the server didn't yell at you while starting though πŸ€”

upper hearth
#

I can't imagine it would generate an entire new world because he clicked X

keen compass
#

on windows especially if using the x on the window, it sends the kill process and doesn't give the server a chance to stop properly

subtle blade
#

I think it would because nothing gets saved, Dessie

#

You'd have seen world save progress at the end of the log

fair abyss
#

should bukkit's autosave save the world every 10 minutes

keen compass
#

by default it should save it every 5 minutes

#

unless you changed it

upper hearth
#

Yeah that's why it would make sense that his blocks placed aren't there, but does the entire world not save after it's been generated?

fair abyss
#

maybe its disabled?

subtle blade
#

So Barahir, when stopping your server, run /stop (or just stop when from the console, no need for a /). Think beyond that you're all good to go

#

Reason it's regenerating is because world data was not yet written to disk

upper hearth
#

Guess that makes sense

vital willow
#

I kind of thought X-ing out might be why.. but i swear I've done this before and not had an issue. Like when I first started, creating a world, logging in.. and then logged right back out, closed the server adjusted the RAM in the bat, and restarted just fine...

#

but i could be wrong on that

#

like there was at least and initial auto save once the world created... but... that def doesn't seemt o be happening right now...

subtle blade
#

If that's the case, it may have saved at some point during run time. Though they've made a few performance improvements since then, this may be one of them

#

The stop command will ensure the server completes is shutdown processes

vital willow
#

I'll buy that... so... 'stop' command.. or at the very least.. wait 5 mins yea?

upper hearth
#

Always use stop command

subtle blade
#

Lol at the very least, yea. Though it's best to use /stop. Plugins will disable properly, server will disable properly, etc.

upper hearth
#

Doesn't X-ing out cause the the world to get corrupted sometimes?

subtle blade
upper hearth
#

wtf I thought you knew everything

vital willow
#

yeah.. i definitely don't want corruption.. I had a server we worked on for a few years that I stupidly didn't back up, corrupt when I tried to jump a few versions when i updated... it was a sad day. i don't want to go through that again.

subtle blade
#

I am all knowing... with the exception of whether or not worlds will corrupt with you x-it out of the console window

#

I lack knowledge in very specific areas

upper hearth
#

Tis a reasonable thing not to know

#

I thought I heard that I has the possibility to corrupt, but what do I know

proper cobalt
#

always x on my local server haven't ever corrupted lol

subtle blade
#

Lol, well I think that should fix your world issue, Barahir. Good luck with the server though πŸ˜„

#

?resources to browse plugins you can use on the server

worldly heathBOT
vital willow
#

well thank you guys so much! I really appreciate talking this through!

placid hamlet
#

I really need help with my servers tps issues

#

I've tried optimizastion files, chaning mob stacker, changing mob stacker size, testing plugins i just idk

subtle blade
#

You're on a fork. Not our problem

placid hamlet
#

What's a fork?

subtle blade
#

Not Spigot lol

placid hamlet
#

wait what

subtle blade
#

You're not running Spigot

#

If you own the server, I'd hope you know that o.o

placid hamlet
#

Paperspigot ?

subtle blade
#

Not us

placid hamlet
#

Oh damn lol

subtle blade
#

(and is the reason they changed their name to just Paper)

placid hamlet
#

I've had 6 years of experience and never knew that

#

I just assumed it was a diff ver

subtle blade
#

They have their own support Discord, though I don't have the URL on hand. I'm sure you can find it quickly on Google

alpine cypress
#

Having a looooot of players being kicked for a "broken pipe" error from our servers to our hubs. We have no idea why and it's just randomly started happening after no changes. Any ideas?

median wing
#

I made a pickaxe tool to mine in a 3x3x1 area, I used rotation to check which direction a player is facing and Blockface, the rotation works fine, and the 3x3x1 break does but only when I'm looking down, if I look up or in front of me, the blocks that are below my feet break in 3x3x1, but I want the target block that I'm breaking to break, can someone help me?

lusty vortex
#

Jesus man lol

#

Just use 45 degree's

median wing
lusty vortex
#

Just do something like Math.round(yaw / 45.0))) to get the direction. That'll probably work well

median wing
#

Could you explain where in my code?

#

I'm using triple for loops to break the blocks in 3x3x1

lusty vortex
#

What is "block"

median wing
#

Block block = player.getLocation().getBlock();

lusty vortex
#

Why wouldn't it break the blocks under your feet?

#

If you're doing y = -1

frigid ember
#

How can I turn ItemStack(Material.SKULL_ITEM); into a Wither skull?

lusty vortex
#

Pretty sure it's just a data id, no? At least for 1.8 it was

median wing
#

use Skullmeta

#

oh nvm

frigid ember
#

I believe both are deprecated

lusty vortex
#

BigBadDuck you're removing the blocks below their feet by doing y = -1

median wing
#

Ah, right, so how would I fix it so that no matter which direction the player is facing it always breaks in a 3x3x1.

lusty vortex
#

I would just get the target block tbh

#

If you're making a super pickaxee

median wing
#

example?

lusty vortex
#

Maybe just Set<Mateiral> now actually

#

player.getTargetBlock((Set<Material>) null, range)

#

Do that

#

Or better yet

#

Why don't you just do this on the interact event?

#

When they click a block

#

Then do that loop on the clicked block

median wing
#

I have it on the block break event

#

so you mean to do the for loop seperate on the blockinteractevent?

lusty vortex
#

Whaaat? Then why you doing Block block = player.getLocation().getBlock();?

#

Why not just use the Block provided by the event?

#

Destroy all the blocks around the destroyed

median wing
#

so Block block = e.getBlock()?

lusty vortex
#

Yeah

#

If you're doing what I assume you are doing πŸ€·β€β™‚οΈ

median wing
#

I'm trying to break the blocks around the targetted block so that it creates a 3x3x1

lusty vortex
#

Yup perfect

median wing
#

so no need for Block block = player.getTargetBlock?

lusty vortex
#

No I just said that because I was confused as to what your intention was

#

Then you just wanna do something like this:

#

for (int x3 = x; x3 <= x2; x3++) {
for (int y3 = y; y3 <= y2; y3++) {
for (int z3 = z; z3 <= z2; z3++) {

                Block b = world.getBlockAt(x3, y3, z3);
                }
            }
        }
    }
#

To loop in a square

#

x = min, x= max

#

So

#

x = (initialBlock.getX()) - radius;
x2 = (initialBlock.getX()) + radius;

#

Creates a box around it basically

median wing
#

x = (initialBlock.getX()) - radius;
x2 = (initialBlock.getX()) + radius;

lusty vortex
#

Or just do what you're currently doing in the loop. I just prefer to do a more direct approach

median wing
#

so in the for loop?

#

okay

lusty vortex
#

It's an option. The one you're doing should work too

median wing
#

Okay thank you, I'll try it and see

#
            for (int y3 = y; y3 <= y2; y3++) {
                for (int z3 = z; z3 <= z2; z3++) {``` doing this gives me an error
#

in the IDEA itself

lusty vortex
#

Do the x, x2, z2, z, y, y2 variables all exit?

#

Those need to exist. They're your axis aligned box's bounds basically

median wing
#

int y = block.getY(); yep so doing this basically

lusty vortex
#

int y = block.getY() - theRadius;

#

int y2 = block.getY() + theRadius;

median wing
#

What do you suggest my radius to be

lusty vortex
#

The size you want this box to be

#

so 5 would be: 5 to the left, 5 to the right, 5 below, 5 up, 5 forward, 5 behind

#

Or you could just stick to what you were doing. Same idea basically

median wing
#

so since its 3x3x1 my y would be 1 my x would be 3 and z would also be 3

#

but it will be different according to direction

lusty vortex
#

It's suppose to grow in a certain direction?

#

If that's the case

#

then just do what you've got atm, but change

#

block to

median wing
#

no I meant it's dependent on my rotation

lusty vortex
#

block = event.getBlock().getRelative(blockFace)

median wing
#

because without rotation it will just break 3x3x1 in one direction, I tried it before

#

Ah okay I see

frigid ember
#

there is no docs?

lusty vortex
#

There's docs

#

Just google Spigot javadocs

frigid ember
#

link pls?

#

oke

lusty vortex
#

Like when I wanna find documentation, I'll just google "Spigot Block" for instance

#

To find Block's documentation

frigid ember
#

wow, thanks got all of em πŸ™‚

median wing
#

Np

frigid ember
#

is that possible to run aternos server in local environment?

lusty vortex
#

Isn't that a host...?