#help-archived

1 messages ยท Page 217 of 1

frigid ember
#

I assume it's *, /, %, +, and - (from left to right)?

formal nimbus
#

alright

wispy pewter
#

SO now there is always one instance of the calss

#

unless someone manually creates a new instance.

mellow wave
#

The static way I showed always creates the instance the first time the class is accessed either way both works

wispy pewter
#

Yep

#

They both works

mellow wave
#

How you choose to do it is up to you

wispy pewter
#

But its always better to prevent access to the Field

formal nimbus
#

how do I get the class instance?

wispy pewter
#

Just copy this and rename Class1 to your class name

#
private static Class1 _instance;

public static Class1 getInstance() {
     if(_instance == null)
         _instance = new Class1();
     return _instance;
}
mellow wave
#

^

#

and use Class1.getInstance();

wispy pewter
#

the new Class1() line creates a new instance object of the class and sets it to the private instance field

#

^^

#

The null check makes sure it wont create a new instance everytime the static method is getting called

mellow wave
#

oh and make the constructor

private Class1() {}
#

This way no one can create a new instance

wispy pewter
#

it doesnt require to have a constructor

mellow wave
#

That just makes the constructor private

wispy pewter
#

You can create new instances without having a constructor

formal nimbus
#

ah ha

#

got it

mellow wave
#

It will stop users from using new Class1() outside of the Class1 class

wispy pewter
#

Yeah thats true

formal nimbus
#

yus

mellow wave
#

Now do whatever you'd like. Let's say add those constructor values you wanted in to the private constructor

formal nimbus
wispy pewter
#

@formal nimbus The reason why the field is private is because if there is allot a data being stored in the class people cant reset the instance.

formal nimbus
#

ok so that means I can make those things not static

#

since I'll only ever have 1 instanceo f the class anyway

wispy pewter
#

yep

#

Now you can delete all redundant static fields.

formal nimbus
#

yes

#

but it does mean I have to make even more getters ;-;

mellow wave
#

use Lombok

#

:)

formal nimbus
#

lombok?

mellow wave
#

It's an utility that adds annotations such as @Getter and it will generate getters for you

formal nimbus
#

o

mellow wave
#

It's quite convenient when you have a lot of getters and setters

wispy pewter
#

^

formal nimbus
#

aight

#

well I might look into it then

#

I have another question

wispy pewter
#

@formal nimbus TIP: Use as less static members as possible

formal nimbus
#

kk

#

why?

wispy pewter
#

If you're working with interfaces you can use dependency injection

formal nimbus
#

dependency injection?

wispy pewter
#

Because static members should only be used when needed

mellow wave
#

^

wispy pewter
#

otherwise your program can become filthy

formal nimbus
#

lmao ok

wispy pewter
#

I forgot how to explain it in englishKEK

formal nimbus
#

we have a code purist over here

mellow wave
#

There are certain cases when you need static but usually you don't need them very often

formal nimbus
#

:p

#

anyway my other question

wispy pewter
#

Its preffered to only use static members for Utily/Helper classes

formal nimbus
#

I have a list of objects which I want other plugins to be able to use

wispy pewter
#

And ofcourse when you're working with Singletons

formal nimbus
#

how do i do that?

wispy pewter
#

Make a getter for it

mellow wave
#

^

wispy pewter
#

People should never be able to directly access the fields

formal nimbus
#

so they'll be able to use the public getter?

mellow wave
#

Yes

wispy pewter
#

since they are major to your code

formal nimbus
#

k cool

wispy pewter
#

Yes

#

Exactly

mellow wave
#

If they can get the instance of the class they can use a public method

wispy pewter
#

^

formal nimbus
#

how would they get an instance of my class?

wispy pewter
#

with the getInstance method

mellow wave
#

^

wispy pewter
#

When its called for the first time it creates a new instance of the class and sets it to the private field

formal nimbus
#

heh

wispy pewter
#

This makes sure there is always a single instance floating around

formal nimbus
#

aight

wispy pewter
#

Which means: Less memory usage = faster and responsive code

formal nimbus
#

but how do you set it up so the 2 plugins cace?n interact in the first pla

wispy pewter
#

You mean when 2 plugins call it at the same time?

formal nimbus
#

how would somebody else make my classes become visable to their IDE?

mellow wave
#

You add the first plugin as a dependency

formal nimbus
#

ah

mellow wave
#

How you do that is up to you

formal nimbus
#

ok, so like you do with spigot API

mellow wave
#

Yes

formal nimbus
#

ok I get it now

#

thx for the help ๐Ÿ™‚

wispy pewter
#

let me create a example for you

formal nimbus
#

sure

wispy pewter
#

With some explenation about what it does

formal nimbus
#

it's annoying, every day I find some new thing I've been doing wrong with my code xD

#

but on the plus side I guess it means I'm learning

mellow wave
#

It will always be like that

#

Keep learning

wispy pewter
#

I've been programming in C# for 4 years and still learning everyday

mellow wave
#

I started Java 3 years ago

#

Still learning too

wispy pewter
#

When you know C#, java is childs play

echo path
#

i need some help im getting a error for my plugin cn anyone help me

wispy pewter
#

and vice versa

#

@echo path Sent your error in here

mellow wave
#

They're very close

echo path
#

i cant send pictures idk why can i dm them to u?

wispy pewter
#

Sure go ahead

#

@mellow wave Dumb question. How to create a summary about a member?

#

in C# you can like /// <summary>

formal nimbus
#

They're very close
@mellow wave nice ๐Ÿ˜ฎ

wispy pewter
#

Dumb question tho ๐Ÿ˜‚

formal nimbus
#

I guess learning C# should be no problem then

#

I guess it's similar to learning languages

#

natural ones I mean

#

except coding languages will be even more similar, just with different syntax

wispy pewter
#

Wait, why i'm i trying yo create a whole summary when i can create a comment

#

๐Ÿ˜‚

formal nimbus
#

oh yeah

#

why did you do _instance

#

instead of just instance?

wispy pewter
#

Syntax

formal nimbus
#

?

wispy pewter
#

So you can sort your varialbes

#

so you know which ones are privvate and public

formal nimbus
#

? ?

wispy pewter
#

constant variables should be UPERCASE

formal nimbus
#

o

wispy pewter
#

So other people know they are constants

formal nimbus
#

I haven't been following that scheme

mellow wave
#

It's naming conventions

formal nimbus
#

I've just been using camel case

#

for everything ;-;

mellow wave
#

You can find them if you look them up

wispy pewter
#

Naming conventions is not a mandetory thing to do

formal nimbus
#

right

mellow wave
#

^

wispy pewter
#

but recommended when working with API's

formal nimbus
#

well maybe in my next project I'll use it

#

for now though I'll just stick to using camel case for everything

wispy pewter
#

For starters its better to learn what the acces modifiers are

#

and what the diffrences are

formal nimbus
#

yus, I think I've at least got that down lool

#

I find it infuriating how you can't change the name of a GUI after it's creation

#

*an inventory

#

would make life easier ):

wispy pewter
#
public class DataManager {

    //This field holds the singleton of the class. The reason its private is because we dont want people to create a second instance.
    private static DataManager _instance;

    //Holds a collection of names. The reason that its private is because we dont want people to directly access it.
    private final List<String> _names = new ArrayList<String>();

    private DataManager() {}

    public static DataManager getInstance() {
        if(_instance == null)
            return _instance = new DataManager();
        return _instance;
    }

    public List<String> getNames() {
        return _names;
    }
#

So lets say you have a data manager class that stores data

#

That means you dont want to have multiple instances floating around.

#

The perpose of the singleton is to ensure there is always a single instance.

formal nimbus
#

uh huh

wispy pewter
#

For example. in this sample you see a List of names right?

formal nimbus
#

yep

#

means you don't get 2 lists

#

but u don't have to make it static

wispy pewter
#

Well if people constantly create new instances the names collection will never be the same

formal nimbus
#

yep

wispy pewter
#

Because we dont want people to access the field directly

formal nimbus
#

or if you had a constant, you would end up with duplicates of the exact same thing

wispy pewter
#

because then they can screw up the behaviour and the data

formal nimbus
#

yee

#

for something like this

#

it's an ItemStack factory (I think?)

#

anyway it's a helper method

#

can I just make it static?

wispy pewter
#

Factories basically provide a easier way of creating instances

formal nimbus
#

right, so it is a factory then

wispy pewter
#

Item stack isnt

#

Factory's are always static

formal nimbus
#

aight

#

so I should make it static

wispy pewter
#

Because they don't store any data

#

They just create a new instance and return it

formal nimbus
#

cool

#

so if I had a helper class

wispy pewter
#

Your createItem method should be static

formal nimbus
#

with a lot of helper methods

#

I could make the class static

#

as long as it doesn't store any data

wispy pewter
#

Creating a static class means its members can only be static

formal nimbus
#

oh

#

so it doesn't make the methods static

#

or is a method a member of a class?

wispy pewter
#

Everything inside a class are defined as members

#

See a class as a blueprint

#

they store data

#

For examplle you have a person class that stores the Name, Age and Gender of the person

#

Its basically a blueprint of a person

formal nimbus
#

yeah

#

apparently static is an invalid modifier for a class?

wispy pewter
#

Uuh lets see. In C# this works so....

#

๐Ÿ˜‚

#

I never really got into java

#

its different in some aspects.

formal nimbus
#

lol

#

aight, well I guess I'll just make everything static manually

wispy pewter
#

As i see, java doesnt support static classes

#

But its not a big problem since you can create static methods only

formal nimbus
#

yep

wispy pewter
#

After you got the understanding of how classes work, go try to refactor your code

#

Like create certian fields readonly

#

Thats why in my code example the names list is marked as final

#

So java knows it will never be re-instantiated

#

Which results in saving -up memory

#

Which corresponds to a faster plugin.

formal nimbus
#

yus

#

I've already been trying to make all the variable which I can final

#

can I make an ArrayList final?

#

I mean it changes in size

#

@wispy pewter

wispy pewter
#

yes it can

formal nimbus
#

o

wispy pewter
#

final aka readonly means it can only be instantiated one time

#

if you want to know better info call me

#

I can explain better in call.

formal nimbus
#

aight

#

well I think I got everything down

wispy pewter
#

Call me if you can or want

twin cosmos
#

can someone help me i got an error in
plugin.getConfig().getString

wispy pewter
#

I will give a proper explenation of a factory's work

#

and why and when you should use private and final

#

@twin cosmos The plugin variable is only available in the main class of the plugin

#

Make a instance of the main class

#

and call it trough there

hollow thorn
#

what materials cant be used for crafting?

mellow wave
#

...

hollow thorn
#

because for some reason whenever i try to use Iron Ingots in a crafting recipe the recpie no longer exists

formal nimbus
#

Call me if you can or want
@wispy pewter I appreciate the offer, but I can't do a call atm

#

though I might be able to at a later point

wispy pewter
#

That's fine.

tranquil aurora
#

Is there a spigot API

mellow wave
#

Yes

tranquil aurora
#

To check if a user has brought a plugin

mellow wave
#

oh no I got warned again -.-

wispy pewter
#

You mean checking if an plugin is loaded?

tranquil aurora
#

No

#

Like on the website

mellow wave
#

Buyers check

tranquil aurora
#

Ye

mellow wave
#

Look at MVdW example

tranquil aurora
#

Is there like an API json

hollow thorn
#

what materials cant be used for crafting? because for some reason whenever i try to use Iron Ingots in a crafting recipe the recpie no longer exists

mellow wave
#

There is a JSON API

celest current
formal nimbus
#

making singleton classes has cleared up my main so much $_$

#

it was 65 lines before lol

mellow wave
#

Nice :)

wispy pewter
#

Amazing

mellow wave
#

@celest current No need to do a == check to true. That's just redundant

formal nimbus
#

oops

#

just saw an error

wispy pewter
#

Your getInstance is missing the null check

formal nimbus
#

it's allowed me to make the saver final too ๐Ÿ˜„

mellow wave
#

You don't need it

#

And you don't want it in the main

balmy sentinel
#

you don't need to add the "this."

hollow thorn
#

hat materials cant be used for crafting? because for some reason whenever i try to use Iron Ingots in a crafting recipe the recpie no longer exists

wispy pewter
#

oh wait nvm

#

I'm being retarded

#

๐Ÿ˜‚

formal nimbus
#

๐Ÿ‘

wispy pewter
#

you don't need to add the "this."
@balmy sentinel Not needed but it makes your code more readable.

#

better would it to change to super.

#

so you always know it refers the the class it inherits from.

hollow thorn
#

hat materials cant be used for crafting? because for some reason whenever i try to use Iron Ingots in a crafting recipe the recpie no longer exists

formal nimbus
#

I just realised that bukkit already has a class called ItemFactory :/

mellow wave
#

It's for ItemMeta

formal nimbus
#

and I named my ItemStack factory class ItemFactory ;-;

mellow wave
#

That's fine just make sure you import the right one

lone fog
#

All materials work fine for crafting

formal nimbus
#

aight

wispy pewter
#

Well guys, I'm going to eat

lone fog
#

Aside from ones that don't exist as items

wispy pewter
#

See y'll soon

celest current
#

@celest current No need to do a == check to true. That's just redundant
@mellow wave if I only have one = than this happens: http://prntscr.com/tty34s

Lightshot

Captured with Lightshot

lone fog
#

don't add any at all

twin cosmos
#

@wispy pewter ty

wispy pewter
#

because the = operator is used to define variables

lone fog
#

You can just do if (boolean)

wispy pewter
#

just use if(boolean)

mellow wave
#

Remove = true @celest current

wispy pewter
#

I would also recommend to create a custom variable for the getconfig

#

so you dont have to write that piece of code everytime

formal nimbus
#

.getBoolean("crafting.xp-bottle") already has a boolean value

#

by default, if() will check if something is true

mellow wave
#

And the way you're getting the recipe is depricated an item may have multiple recipes

wispy pewter
#

var config = instance.getConfig();

formal nimbus
#

so you don't need to check if it's true, as the if statement already does it

wispy pewter
#

try making your life easier

lone fog
#

Add a namespaced key to your recipe

celest current
#

yeah asking if its true is redundant

formal nimbus
#

lol this poor guy is being bombarded by a million criticisms xD

celest current
#

Nah mate I love it

wispy pewter
#

Criticism makes you better

formal nimbus
#

tru

mellow wave
#

Anyway did you see what I said about the way you're getting the recipes. Use Bukkit#getRecipesFor instead and read the list

lone fog
#

Constructive criticism makes you better

celest current
#

The people in this community are mega bigbrain so their criticism is usually really good advice

wispy pewter
#

@celest current When you have to write a line ass line to acces something, Make it easier by making a custom variable

#

It makes your life way easier

#

And also makes your code cleaner ๐Ÿ˜‰

#

Incase you want to flex on some noobs

celest current
#

instance.config() = config or sumn like dat

wispy pewter
#

var config = instance.getConfig();

celest current
#

uno reverse to the max

mellow wave
#

var doesn't exist in java

celest current
#

thats JavaScript

wispy pewter
#

it works for me ๐Ÿ˜‰

mellow wave
#

Are you using kotlin by any chance

#

:Y

wispy pewter
#

No

#

ahahha

lone fog
#

Var is in java 8

#

or is it 10? idk

mellow wave
#

Yeah I believe 10

formal nimbus
#

Hmm

jagged torrent
#

its not in 8

wispy pewter
#

I use 14 atm

formal nimbus
#

Olivio/MichielA, can't private fields be changed using reflection, so making them all private is kind of redundant?

mellow wave
#

@wispy pewter JDK 14, most servers use 8 which does not have var

wispy pewter
#

Yeah could be related to the version of java

lone fog
#

Just because they can doesn't mean they should

wispy pewter
#

@wispy pewter JDK 14, most servers use 8 which does not have var
@mellow wave Ooh oke. Didnt know that, thanks.

mellow wave
#

I've always used 8 so I didn't know they added var

lone fog
#

If someone is using reflection they should know that the field wasn't meant to be changed that way

wispy pewter
#

fuck off bot

formal nimbus
#

xD

#

I saw ur message for a split section before it got yoinked

wispy pewter
#

Reflection can access anything

mellow wave
#

^ It's really useful

formal nimbus
#

right, so what's the point of making everything private and making getters and setters

#

if it can be changed by reflection?

wispy pewter
formal nimbus
#

why not just leave it public

wispy pewter
#

Mentions one person

mellow wave
#

Reflection is slow

wispy pewter
#

why not just leave it public
@formal nimbus Because private fields can only access in the calss itself

mellow wave
#

Yeah I have 2 warnings for typing the same message 2 times :&

lone fog
#

And encapsulation is good practice

formal nimbus
#

@formal nimbus Because private fields can only access in the calss itself
@wispy pewter but they can be accessed using reflection...

lone fog
#

Plus getters and setters can add additional logic

wispy pewter
#

Yes thats true

#

^

formal nimbus
#

And encapsulation is good practice
@lone fog but why

mellow wave
#

Reflection is slow and if someone uses it they most likley know what they're doing. I doubt some new to java would use it

formal nimbus
#

right soo

#

it's to stop values being changed by people who don't know what they;re doing?

wispy pewter
#

reflection is more for advanced users

mellow wave
#

Anyway don't worry about someone using reflection on your class. If someone messes up it's their problem

wispy pewter
#

Now i need to go afk

formal nimbus
#

Anyway don't worry about someone using reflection on your class. If someone messes up it's their problem

#

I guess

lone fog
#

It 100% is

#

I could use reflection to change true to false, but that would break everything and it would be my fault

wispy pewter
#

I dont want to leave xD

celest current
#

instance.getConfig().getBoolean("crafting.powerdirt") still doesnt work tho? Its set to false in config but I can still craft the almighty dirt cube of ultimate power and strength

wispy pewter
#

having to much fun

formal nimbus
#

sure, but doesn't this leave security issues for java programmes?

#

lol

wispy pewter
#

I literally eat, shit, breath binary

formal nimbus
#

repeat

lone fog
#

If you have security concerns you can use a SecurityManager

wispy pewter
#

When i get mad. i throw binary

#

64 bit

#

ofcourse

formal nimbus
#

If you have security concerns you can use a SecurityManager
@lone fog lol I don't, but I'm just thinking of programmes which need security

wispy pewter
#

If you want security go obfuscate your code

mellow wave
#

They probably will use C++

formal nimbus
#

right

mellow wave
#

Or some obfuscation

edgy cove
#

hey guys

formal nimbus
#

hey

mellow wave
#

hi

edgy cove
#

Why do all the comments of my configuration file disappier

#

in BungeeCord not spigot btw

#

My code rn is:

try {
            if (!getDataFolder().exists())
                getDataFolder().mkdir();

            File file = new File(getDataFolder(), "config.yml");

       
            if (!file.exists()) {
                InputStream in = getResourceAsStream("config.yml");
                Files.copy(in, file.toPath());
            }
            Configuration configuration = ConfigurationProvider.getProvider(YamlConfiguration.class).load(new File(getDataFolder(), "config.yml"));
            ConfigurationProvider.getProvider(YamlConfiguration.class).save(configuration, new File(getDataFolder(), "config.yml"));
            config = configuration;
        } catch(Exception ex) {
            System.out.println("Erro a criar o ficheiro de configuraรงรฃo. Comandos, eventos e outras funรงรตes serรฃo desativadas. Por favor contacte o desenvolvedor (Picono435#2011).");
            ex.printStackTrace();
            return;
        }```
mellow wave
#

ah own plugin

#

If you save a config it will remove all comments

lone fog
#

Unless you write your own implementation

edgy cove
#

so... how do I solve this? hahaha

lone fog
#

Also, does bungee not have saveDefaultConfig?

edgy cove
#

nop

tiny dagger
#

i have my own yaml wrapper

edgy cove
#

it does not

tiny dagger
#

not sure if any of you is interested

edgy cove
#

If u can send me it for I see how it is...

mellow wave
#

@tiny dagger Any chance I could take a look ๐Ÿ‘€

edgy cove
#

@tiny dagger does it work with bungee?

#

and does it save comments?

mellow wave
#

I already have a method of saving comments

#

in my own wrapper

hollow thorn
#
java.lang.UnsupportedOperationException: null
    at com.google.common.collect.ImmutableCollection.clear(ImmutableCollection.java:294) ~[spigot.jar:git-Spigot-0509002-7c03d25]
    at com.javaminecraft.Elytra$1.run(Elytra.java:117) ~[?:?]
    at org.bukkit.craftbukkit.v1_16_R1.scheduler.CraftTask.run(CraftTask.java:81) ~[spigot.jar:git-Spigot-0509002-7c03d25]
    at org.bukkit.craftbukkit.v1_16_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:400) ~[spigot.jar:git-Spigot-0509002-7c03d25]
    at net.minecraft.server.v1_16_R1.MinecraftServer.b(MinecraftServer.java:1061) ~[spigot.jar:git-Spigot-0509002-7c03d25]
    at net.minecraft.server.v1_16_R1.DedicatedServer.b(DedicatedServer.java:354) ~[spigot.jar:git-Spigot-0509002-7c03d25]
    at net.minecraft.server.v1_16_R1.MinecraftServer.a(MinecraftServer.java:1009) ~[spigot.jar:git-Spigot-0509002-7c03d25]
    at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:848) ~[spigot.jar:git-Spigot-0509002-7c03d25]
    at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot.jar:git-Spigot-0509002-7c03d25]
    at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]``` halp
tiny dagger
#

it's just a wrapper of what there is already

#

it just makes it cleaner

#

and easier to translate to whatever type

#

with custom deserializer if i choose so

mellow wave
#

Elytra.java line 117 uses a null value @hollow thorn

#

Interessting

hollow thorn
#

how do i get the time of day in minecraft

edgy cove
#

I still dont know what is causing the comments to disappier

#

Click F3

#

oh in coding lol

mellow wave
#

Use the java docs please... I've already told you @hollow thorn

edgy cove
mellow wave
#

It's not hard to search

edgy cove
#

take a look on the code

#

I have the method somewhere there

#

to see the time

#

in the main class if Im correct

#

so any idea of what can be causing the comments to do PUFF in bungeecord?

mellow wave
#

Yaml doesn't store comments in anyway

tiny dagger
#

^

mellow wave
#

It's litteraly invisible

tiny dagger
#

those are files only

#

or if you manually modify the file

#

to append them on top

edgy cove
#

But I copy them

mellow wave
#

That's what I've been doing

edgy cove
#

as file

mellow wave
#

In to a YamlConfiguration

#

Which makes it loose the comments

edgy cove
#
File file = new File(getDataFolder(), "config.yml");

       
            if (!file.exists()) {
                InputStream in = getResourceAsStream("config.yml");
                Files.copy(in, file.toPath());
            }```
rare prairie
#

use json if you want comments save

edgy cove
#
Configuration configuration = 
ConfigurationProvider.getProvider(YamlConfiguration.class).load(new File(getDataFolder(), "config.yml"));```
oh then this is the line that is causing the issues?
tiny dagger
#

json isn't that user friendly

mellow wave
#

Yes if you save that with edited values it will loose comments

lone fog
#
ConfigurationProvider.getProvider(YamlConfiguration.class).save(configuration, new File(getDataFolder(), "config.yml"));```
tiny dagger
#

i feel like if i switched to it i would have people scream at me ๐Ÿ‘€

lone fog
#

Why do you load and then save it right away

edgy cove
#

its what was in the spigot docs?

#

uh let me try removing it hum

#

testing..

#

uh lalallalalala

#

love u guys ty

#

:3

lofty meadow
#

Hello! How can I store a custom data (Custom Tag) in an ItemStack?

lone fog
#

Use PersistantDataContainer

#

assuming 1.14+

lofty meadow
#

Ahh ๐Ÿค”

quick arch
#

far better than custom item tag ^^

lofty meadow
#

Okay, thanks!

formal nimbus
#

uhhh

#

I'm getting a null

#

line 28

#

no idea why?

#

it has a config...

#

and the config has been working fine ):

#

up until now

leaden nebula
#

I know that I should probably ask this on the forums, but has anyone else noticed that mobs are spawning on top trapdoors?

#

I am on the latest version of spigot

formal nimbus
#

I think that's normal...?

hollow grail
#

Hi, Are you familiar with the plugin "jail"?

umbral dirge
#

How do I make it with MySQL like Coins You got in the last 7 Days:

Yesterday: 5 Coins
Sunday: 10 Coins

hollow grail
#

I can't set it up, internal error ..

#

@umbral dirge Can I drop it in a personal?

umbral dirge
#

Wdym?

#

In a dm?

#

Sure

balmy sentinel
#

How do I make it with MySQL like Coins You got in the last 7 Days:

Yesterday: 5 Coins
Sunday: 10 Coins
@umbral dirge like you want to save how many coins a player gets each day?

umbral dirge
#

Yes

balmy sentinel
#

I would create a new table coin_log and save the user's uuid, their amount of coins earned, and the timestamp. When you want to check how many coins a player earned on a certain date SELECT * FROM coin_log WHERE uuid=playerUUID AND date=date;

wispy pewter
#

Lol i just looked up some code i wrote a year ago and the first thing i thought was, i should be send to prison.

#

@hollow thorn no, it will always increment by one

lofty meadow
#

Hey! can I get item id from ItemStack?

wispy pewter
#

@formal nimbus assign the field under the enable method

fluid marlin
#
            if (location.getBlock().getType().equals(Material.CHEST)) {
                chests.put(key, location);

How come location#getBlock() returns null when its annonated @Notnull

#

a block can be null?

cerulean musk
#

Guys what is best Java decomplier ?

fluid marlin
#

I use JD-gui

wispy pewter
#

Windows vista

cerulean musk
#

@fluid marlin it shows everything?

wispy pewter
#

@fluid marlin how are you so sure the getblock is null?

#

Maybe its something without the gettype

fluid marlin
#

I checked

#

I debugged it

wispy pewter
#

Thst means the getblock method cannot be null

fluid marlin
#

Well it is

#

Does a block of air count as null?

wispy pewter
#

Add a null check only for getblock

floral isle
#

Hello everyone I have a problem with this java method that generates me a NullPointerException
but I can't find the error

fluid marlin
#

Send the method

floral isle
#

un sec

#

on string 128 and 78 is the error in the console

lofty meadow
#

itemStack.getData().getItemType().getId() has deprecated, so how can I get the item id?

floral isle
#

in what version of Minecraft?

lofty meadow
#

1.15.2

quick arch
#

the number id?

#

You'll have to use a library for that

#

Don't know why you'd want it because they're dumb

floral isle
#

after 1.13.2 all id's have been archived as deprecated you don't have to use the id in this version

lofty meadow
#

Hmm ๐Ÿค”

#

Can you send me that library?

tiny dagger
#

just make 2 version jeez

#

lol

#

don't use workarounds

#

it's just gonna bite you

#

you could make a legacy version from 1.8.8 up to 1.13+ just fine i think ๐Ÿค”

frigid ember
#

Hi

#

can someone help me with bungeecords configuration system?

#

Is there any way to load a resource as a template configuration and update a already existing config file on the server with it?

#

like checking if paths no longer exist in the template

#

and adding some if they are missing

#

and replacing values if the object type doesn't match

#

I thought maybe loading a resource stream would help me, but

winged sparrow
#

Why would anyone want numeric ids

#

I simply donโ€™t get it

frigid ember
#

there is no default values system

#

so

#

i would need to do it myself

#

but

#

its not that easy

#

via iterating through everything

#

i tried to do that

jagged torrent
#

Numeric ids have been deprecated for over 5 years

#

Why would anyone still use them

quick arch
#

^

frigid ember
#

but theres no in depth key searching

jagged torrent
#

And why would you need that

frigid ember
#

i could only get the root keys

#

and iterate through them

#

but i have no idea where to start

#

with coding that

#

(a recursive key searcher)

jagged torrent
#

U mean copying unset values from a fallback config?

frigid ember
#

is there anything more easy i could use?

#

yes and removing non existing ones

light stone
#

Why would anyone still use them
They're easier to type.

#

I still wish I could give myself 137.

quick arch
#

๐Ÿค”

jagged torrent
#

They are removed from a reason

#

Even in 1.8 they are deprecated

quick arch
#

They're easier to type, but harder to remember

frigid ember
#

the new id system

#

Material enums are compatible with more versions

#

were talking about item ids?

quick arch
#

The new material enums are easier to remember ๐Ÿค”

frigid ember
#

They were even deprecated in 1.7

#

can someone please help me with my well detailed issue?

#

i am really struggling with this one

#

i think bungeechat just saves objects instead of yaml

#

but thats not the goal i want to achieve

#

why is there no system like in bukkit?

#

that would make devs the work much easier

hollow thorn
#

for some reason this Bukkit.getWorlds().get(0).getTime()/1200 isnt working

frigid ember
#

what is Bukkit.getWorlds().get(0).getTime() returning?

lone fog
#

Should be a long from 0 to 24000

hollow thorn
#

timee.setProgress((Bukkit.getWorlds().get(0).getTime()/1200));

#

i dont know for some reason it isnt giving anything inbetween 0-1

frigid ember
#

what is Bukkit.getWorlds().get(0).getTime() returning?

#

i mean. What value?

lone fog
#

Divide by 24000

hollow thorn
#

but that will give me over the hole day

#

i only want over sun time

#

so when it is over 1 i made a small if statement that just sets it to 1

frigid ember
#

what is Bukkit.getWorlds().get(0).getTime() returning?

lone fog
#

Sun time would still be about 12000

#

Not 1200

hollow thorn
#

that doesnt change the fact that it doesnt seem to be giving me a decimal

lone fog
#

Ah

#

Cast the number to a double

#

Pretty sure you can just do 1200d

quick arch
#

it returns a long

wispy pewter
#

I'm sure that's mostlikely going to be a floating point

formal nimbus
#

@formal nimbus assign the field under the enable method
@wispy pewter sorry I was afk

#

will look into it now

#

@wispy pewter hasn't worked ;-;

wispy pewter
#

You are assigning the config field before the on enable method is called

formal nimbus
#

oh

#

I'm dumb

wispy pewter
#

Assign the config under the enable method

quick arch
#

Is that an infinite loop

#

๐Ÿค”

formal nimbus
#

no?

#

Assign the config under the enable method
@wispy pewter yessir

#

still happening ๐Ÿค”

wispy pewter
#

Show me again

formal nimbus
wispy pewter
#

Why are you calling it trough instance?

#

You are already in the class itself

formal nimbus
#

good point...

#

still doesn't help....?

#

maybe that's not the issue?

wispy pewter
#

Wait

lone fog
#

You are calling saver.getInstance

wispy pewter
#

I think getconfig is null ny default

lone fog
#

Which requires crateplugin.getInstance

#

Which is still null

wispy pewter
#

Do config = new fileconfiguration

#

Im on phone, its hard for me to help atm

formal nimbus
#

it won't let me instantiate it ):

#

it just says type FileConfiguration can't be instantiated

#

You are calling saver.getInstance
@lone fog ....

wispy pewter
#

Kek

lone fog
wispy pewter
#

@lone fog that should work as long the saver class has been loaded first

formal nimbus
#

yep

wispy pewter
#

Oh wait that class is inside his plugin

formal nimbus
#

ur correct

#

fixed it

#

well spotted ๐Ÿ˜„

wispy pewter
#

I thought it belonged to a different plugin

hollow thorn
#

?paste

worldly heathBOT
hollow thorn
lone fog
#

You have a null at line 266

dull shell
hollow thorn
#

You have a null at line 266
@lone fog ```if(item.getItemMeta()!=null &&item.getItemMeta().getLocalizedName().contains("watch")){

          Biome b = loc.getBlock().getBiome();
                         String world = loc.getWorld().getName();
                         String x= String.valueOf(loc.getX());
                         String y= String.valueOf(loc.getY());
                         String z = String.valueOf(loc.getZ());
                         String biome = String.valueOf(b);
                         biome.toLowerCase();
                         StringUtils.remove(biome, "_");
                         StringUtils.capitaliseAllWords(biome);
                         List<String> text= new ArrayList<>();
                         text.add(e.getPlayer().getName()+":"+" World:"+world);
                         text.add("X: "+x+"Y: "+y+" Z:"+z);
                         text.add("Biome:"+biome);
                         String entities="Nearby";
                         for(Entity ent:e.getPlayer().getNearbyEntities(50, 50, 50)){
                             entities += String.valueOf(ent.getType());
                             if(ent.getCustomName()!=null){
                                 entities+=" :"+String.valueOf(ent.getCustomName());
                             }
                             entities+=" , ";
                         }
                         text.add(entities);
                         ItemMeta im = item.getItemMeta();
                         im.setLore(text);
                         item.setItemMeta(im);
                         
                         me.updateInventory();
                         
      }

}
}``` this is the code leading up to line 266 and after it

mellow wave
#

And which line is 266

#

also bime.toLowerCase(); does nothing

frigid ember
#

?paste

mellow wave
#

^ that too

hollow thorn
#

the if statement

#

if(item.getItemMeta()!=null &&item.getItemMeta().getLocalizedName().contains("watch")){ is line 266

#

?paste
@frigid ember why didnt that work

#

NANI

mellow wave
#

Bot is slow

hollow thorn
#

?paste

worldly heathBOT
frigid ember
#

idk

#

WHAT

#

goddamn the bot hates me :โ€™(

quick arch
hollow thorn
#

with the item being used it has a localized name

mellow wave
#

Doesn't matter add the check

hollow thorn
mellow wave
#

Not the same

#

That error is an ArrayOutOfBoundsExeption

#

You tried to use a value in an array that doesn't exist

#

In this case the ArrayList on line 278

#

Now you should probably learn how to read those errors, there are guides online

wispy pewter
#

People really need to read their errors and understand what they mean.

hollow thorn
#

That error is an ArrayOutOfBoundsExeption
@mellow wave found out what it was used the wrong variable

mellow wave
#

Alright but still you should look up how to read those errors

wispy pewter
#

Not only read. Also what they mean

mellow wave
#

Yeah that's what I meant xd

wispy pewter
#

๐Ÿ‘

quick arch
#

Java 14 helpful npe flag ๐Ÿ‘€

wispy pewter
#

if you write clean code then errors are easier to fix

#

Michiel - 2020

tiny dagger
#

oh yes

quick arch
#

Just put em' in an empty try catch scope, boom no errors appear

#

kappa

wispy pewter
#

Who also doesn't like python?

quick arch
#

Ivan iirc

winged sparrow
#

hot take: brackets are better than forced indentation

hollow thorn
#

for some reason my plugin only works after i have reloaded it

wispy pewter
#

Exactly

tiny dagger
#

looks like you're trying to load stuff before it actually loaded

frigid ember
#

Whats the best way to check if a player has certian items in inventory? This is what I have and it doesnt seem to go into the next part after Checking for Gold Ingot:

if(inv.getItemInHand().getType().equals(Material.GOLD_INGOT)){
ItemStack pin1 = new ItemStack(Material.POTATO, 1);
ItemStack pin2 = new ItemStack(Material.LEASH, 1);
if (p.getInventory().contains(Material.POTATO) && p.getInventory().contains(Material.LEASH)) {            p.getInventory().getItemInHand().setAmount(p.getInventory().getItemInHand().getAmount()-1);
p.getInventory().remove(new ItemStack(pin1));
p.getInventory().remove(new ItemStack(pin2));
}
}```
winged sparrow
#

Use == instead of .equals() when comparing enums

#
if (inv.getInventory().getItemInMainHand().getType() == Material.GOLD_INGOT) {
// le code
}```
#

Might fix your problem, but put some debug outputs in there to see how far it gets

frigid ember
#

ok ty

rustic glade
#

Use == instead of .equals() when comparing enums
if only Java had operator overloading...

#

with Java, when comparing things, you'll almost always need to use equals

wispy pewter
#

If you're working with multiple enum checks i recommend using the switch-case statement

winged sparrow
#

^

wispy pewter
#

Cleaner and faster Code

frigid ember
#

well in reality it will need to check if you have 25 different items in your inventory and ifso remove 1 of each and run the rest of code

#

Im testing with 2 before adding more

winged sparrow
#

in that case definitely use a switch-case statement.

wispy pewter
#

if you dont know how switch case works, here is an example.

Animal Enum:

public enum Animal {
    DOG, COW, CAT, SHEEP
}

Switch-Case

  public class Main {

    public static void main(String[] args) {

        Animal animal = Animal.CAT;

        switch (animal)
        {
            case DOG:
                Log("Doggo");
                break;
            case COW:
                Log("Big Cow");
                break;
            case CAT:
                Log("Cat");
                break;
            case SHEEP:
                Log("Sheep");
                break;
        }

    }
    static void Log(String msg)
    {
        System.out.println(msg);
    }
frigid ember
#

Oh.... I think (maybe im wrong) but I wanted it to check if player was holding the gold_ingot in main hand, then if true, check if they are holding 25 other items in their inventory, and if true remove 1 of each item of the prior 26 materials and run an event so switch-case wouldnt work?

paper ember
#

Anyone has an idea whats the best way to make a 1 Block wide world?
When i use the ChunkPopulateEvent it crashes the server

#

And I have no ideas with ChunkGenerators

solid sundial
#

ok, I've been trying to make a NPC plugin. rn I have it so that when you shift + right click it selects the NPC. I dunno how I want to store which NPC is selected but if someone knows, that would be AWESOME!

winged sparrow
#

@solid sundial I'd just use a hashmap

#

with the player uuid as the key and the npc or entity object

solid sundial
#

yeah that was what i tried

#

it is 'null'

winged sparrow
#

Hmm why didn't it work out for you?

#

Then you probably aren't doing it right

solid sundial
#

public static Map<Player, EntityPlayer> map = new HashMap<>();

winged sparrow
#

I'm not experienced with messing with packet generated entities but aren't packet generated entities not real entities?

#

I'd recommend giving the npc an id and call to it using some other method to retrieve it

solid sundial
#

yeah

#

i've been wondering if I should make some kind of id, but i dunno how...

#

do you?

bold anchor
#

Dafuq

#

Donโ€™t do that

solid sundial
#

wat

winged sparrow
#

why is that map static exactly?

bold anchor
#

A npc will also have an uuid use that not the npc object

solid sundial
#

it is static because i want to use what is in the Map in my commands

#

wait, a uuid

#

how can i find that?

lone fog
#

Don't make it static

#

Use dependency injection

solid sundial
#

wat that

wispy pewter
#

Dependency injection is not needed probably

#

Singleton is fine

#

Dependency injection is more for working with Interfaces

bold anchor
#

Any entity has an uuid

#

Just retrieve it from the object

solid sundial
#

huh ok

#

lol i cant think rn, im braindead... just how to get uuid?

lone fog
#

Probably getUUID or something

#

Or obfuscated nonsense

solid sundial
#

i guess ill just mess around with the syntax ๐Ÿ™‚

quick arch
#

your spawning the entity with nms?

#

c() is the uuid

solid sundial
#

ok thanks

#

yes NMS

quick arch
#

that's for PacketPlayOutSpawnEntity

#

not sure if that's a living entity

hollow grail
#

People can't write, doesn't write enough rights! What to do? Plugin: ChatEX

solid sundial
#

ok, so when player selects.
map.put(event.getPlayer(), event.getNPC());
what should i put instead of getNPC?

winged sparrow
#

I'd honestly store just the uuid of the player, and the uuid of the npc

solid sundial
#

so...

winged sparrow
#

so it stores less information in the cache

frigid ember
#

@hollow grail What permissions plugin are you using

wispy pewter
#

Always use the ID in ulong format

#

Its always unique and fast

winged sparrow
#

I typically just use the UUID format, is there a particular benefit to using a ulong?

solid sundial
#

i dunno what you are talking about? but what should i put instead of getNPC... lol

wispy pewter
#

UID = ulong i assume

#

@solid sundial The uid of the player

solid sundial
#

ok

#

wait, the player or NPC?

winged sparrow
#

get the unique id of the npc

#

both honestly

solid sundial
#

im confused

wispy pewter
#

@winged sparrow Its in long xD

winged sparrow
#

Player#getUniqueId()

#

npc.getUniqueId()

wispy pewter
#

I forgot java doesnt support unsigned integers does it?

winged sparrow
#

so, new Map<UUID, UUID> map = new Map<>()

solid sundial
#

ok

#

thanks

wispy pewter
#

What is the Datatype of UUID?

#

long?

winged sparrow
#

yes

#

uh

#

no clue I'm living in the comfort of abstracted concepts ๐Ÿ˜Ž

wispy pewter
#

I wouldnt really recommend using a class as key

jagged torrent
#

UUID is 128 bits -> 2 longs

winged sparrow
#

๐ŸŒˆ the more you know

solid sundial
#

yes

wispy pewter
#

i'm used to C#

hollow grail
#

@frigid ember luskperms

wispy pewter
#

where we have uint, ulong etc

jagged torrent
#

hence why you store it in a database as BINARY(16) and not varchar

solid sundial
#

npc is my class

hollow grail
#

but I didnโ€™t do anything in it, it was just installed.

wispy pewter
#

I like Struct

solid sundial
#

how to get the UUID of that specific npc... am i stupid idot

wispy pewter
#

getUUID?

#

Something like that ๐Ÿ˜‚

winged sparrow
#

Well if it's a EntityPlayer, there should be some kind of method to retrieve it

wispy pewter
#

or instanceID

#

idk

winged sparrow
#

getUniqueId()

wispy pewter
#

^

#

Makes sense lol

winged sparrow
#

is the method you use for getting uuids from players and entities

wispy pewter
#

UUID = Universally unique identifier

solid sundial
#

yeah... getUniqueId of player works

#

but when i do NPC.getUniqueId it asks me to make a new method

tiny dagger
#

cough except for minecraft devs

wispy pewter
#

bedrock

winged sparrow
#

EntityPlayer is a nms data format, right?

#

you're gonna have to do some digging for that.

wispy pewter
#

Check the docs lol

tiny dagger
#

your npc doesn't inheret the craftplayer methods

#

๐Ÿ‘Œ

wispy pewter
#

There is a reason why there is something called "Docs"

solid sundial
#

i am using CraftPlayer

#

lol ur right

frigid ember
#

@hollow grail you need to give the players the correct perms for ChatEX to type then

solid sundial
#

wait, some of you are saying to make my Map <UUID, UUID> and some are saying <UUID, EntityPlayer> which one

winged sparrow
#

Is it a bad idea to hijack player messages on the chat event and replace it with a textcomponent?

#

Store two uuids

#

one for the player, one for the selected npc

#

I don't recommend storing class objects in maps

solid sundial
#

ok...

#

thanks a lot lol

#

i will tell you if i find method

winged sparrow
#

Good luck!

solid sundial
#

thanks ๐Ÿ™‚

winged sparrow
#
        EntityPlayer nmsPlayer = ((CraftPlayer) player).getHandle();
        nmsPlayer.getUniqueID();```
@solid sundial
#

getUniqueID() is a easily accessible method from an entity player

solid sundial
#

yeah

#

but my hashmap wants two UUIDs right

#

and i am dum

winged sparrow
#

And that will give it to you

solid sundial
#

see my mistake

winged sparrow
#

That should be exactly what you need

solid sundial
#

THANK SO MUCH EVERYONE!

wispy pewter
#

SOmeone's happy

winged sparrow
#
map.put(Player#getUniqueId(), NPC#getUniqueId();```
solid sundial
#

ive been spending hours on this lol

#

yeah yeah

#

i know thanks everyone

winged sparrow
#

Good luck!

solid sundial
#

yup

#

your guys are the best

wispy pewter
#

Thanks

#

i feel flatten

solid sundial
#

all those forums always have super indirect answers

#

yall just got to the point

wispy pewter
#

Stackoverflow

#

Minecraft overflow

solid sundial
#

yes

#

use it all the time for python

wispy pewter
#

Memoryoverflow

solid sundial
#

sometimes

#

this time i just couldnt find ANYTHING!

wispy pewter
#

You had a memory overflow

#

Brain.exe is not responding moment

solid sundial
#

yes

#

a virus had been detected

wispy pewter
#

Oops i forgot its Brain.jar

solid sundial
#

yes

#

your a comedian now

wispy pewter
#

Feminists

lusty hazel
#

If in a future version, the Inventory#getItemInHand method is removed and only getItemInMainHand will be left, what would be the way to make the plugin backwards compatible down to 1.8 where getItemInMainHand didn't exist yet?

ancient ridge
#

Don't.

lusty hazel
#

I'm looking for a way to do it, not for a way to just not do it at all

bold anchor
#

Abstraction or reflection i suppose

lone fog
#

Abstraction is probably best

#

Though I don't think MD likes to remove stuff like that anyway

bold anchor
#

He will probably rip it out suddenly when he feels like itโ€™s annoying

#

Like getTitle in an inventory

ancient ridge
#

Why was that ripped out

#

It wasn't even deprecated beforehand

bold anchor
#

Somesomething inventories donโ€™t sctually have titles or smth

lusty hazel
#

Alright, thank you guys. I'll take a look into abstractions.

ancient ridge
#

So basically deprecate = never remove but anything else can be removed at any time ๐Ÿ˜‚

lone fog
#

According to the internet it was deprecated in 1.13

bold anchor
#

Deprecation in bukkit is ๐Ÿคท๐Ÿผโ€โ™‚๏ธ

ancient ridge
#

๐Ÿค”

#

It doesn't exist in 1.13 for me

bold anchor
#

Was prolly removed in 1.13

dusty briar
#

help

Kicked whilst connecting to lobby: If you wish to use IP forwarding, please enable it in your BungeeCord config as well!

ancient ridge
#

'tis plain english

sturdy oar
#

Imagine if stack traces were random text without any meaning

frigid ember
#

hey, after updating my server and all plugins from 1.15.2 to 1.16.1 i'm getting tons of these messages

[21:44:59] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 8286ms or 165 ticks behind
[21:45:37] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 8128ms or 162 ticks behind
[21:46:15] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 8019ms or 160 ticks behind
[21:46:53] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 7814ms or 156 ticks behind```

and TPS drops that I was not having before. A fresh install of the 1.16.1 server reproduced the same issue. It was working perfectly fine on previous versions of Spigot
dusty briar
#

help

#

help

Kicked whilst connecting to lobby: If you wish to use IP forwarding, please enable it in your BungeeCord config as well!

bold anchor
#

no

sturdy oar
#

@bold anchor can you send the "dog help no info" meme from paper pinned messages

#

it's in their #general

bold anchor
#

I'm the one who posted it in general lol

sturdy oar
#

Exactly

#

I need it for this discord as well

#

make Choco pin it

sinful spire
#

ah yes, paperhub

frigid ember
#

oh I thought you meant

bold anchor
#

Sry Phangout

frigid ember
#

error : https://paste.md-5.net/uxavewivep.cs
I'm getting this nullpointer for some reason?

  e9d30742-403e-4726-8b0f-de85903ede35:
    '0':
      location: world, 205, 70, 293
      reason: Lazinq fell out of the world
      time: 1596497014631```
https://paste.md-5.net/iqafiqobog.cs
#

74:
public Location stringToLoc(final String input) {
final String[] args = input.split(", ");
__ return new Location(Bukkit.getWorld(args[0]), Integer.valueOf(args[1]), Integer.valueOf(args[2]), Integer.valueOf(args[3]));__
}

neat orbit
#

Does anybody know any free plugins similar to PlayerVault?

frigid ember
#

Anyone know if there is a way to convert
/summon fireworks_rocket -10 80 338 {LifeTime:20,FireworksItem:{id:fireworks,Count:1,tag:{Fireworks:{Explosions:[{Type:4,Flicker:0,Trail:1,Colors:[I;16777215],FadeColors:[16777215]}]}}}} to API? (like some conversion tool to help, I have about 240 of these)

quartz trench
#

probably no tool

#

I would say make your own /summon that takes those args and gives you something more useful for usage with api

#

and then just run your 200 commands

#

or just make a parsing script

fierce briar
#

So, I remember Spigot having this Ore Hider (Once Upon a time). Is there a way to Enable it? Or a Plugin that is very good, and works with RSS packs/Mods?

#

@ me ๐Ÿ˜‰ if you have an answer โ˜๏ธ Up top(since you donโ€™t read upwards.

quick arch
#

pretty sure Spigot removed it a while ago

fierce briar
#

Thanks.

#

Now Finding The right amount of Packets to Send/Receive. To help with mods. xD

#

๐Ÿค” Nvm, I think I tab saved that one.

tough kraken
#

why the fuck is maven saying my dependency is not existing?

#

it is

bold anchor
#

Cause u doing it wrong

tough kraken
#

doesnt looks like its wrong

bold anchor
#

It does tho

tough kraken
#

then tell me what is wrong

quick arch
#

do you have the bintray repository

#

oh wait

tough kraken
#

yes

tough kraken
#

it doesnt matter which version i use

bold anchor
#

Why not use latest then

tough kraken
quick arch
#

๐Ÿค”

tough kraken
#

nah, it just shows errors

#

nvm fuck my life

quick arch
#

o

tough kraken
#

yeah now the bot starts... thanks

quick arch
#

noice

#

maven dumb

frigid ember
#

Can someone point me in the right direction on where to learn how to grab an armorstand at a specific location that I can edit its pose?

dusty topaz
#

And use getNearbyEntities

frigid ember
#

excellent, thank you

golden geyser
#

@quick arch uh did you mean javaplayer not lavaplayer?

quick arch
#

no, lavaplayer

golden geyser
#

oh

quick arch
#

It's audio for Discord Bots

golden geyser
#

oh that makes more sense

frigid ember
#
                            player.sendMessage(applyCC("&6World:&f " + data.getLocation().getWorld().getName() + " &6X:&f " + data.getLocation().getBlockX() + " &6Y:&f " + data.getLocation().getBlockY() + " &6Z:&f " + data.getLocation().getBlockZ() + " &6Reason:&f " + data.getReason() + " &6Time:&f " + data.getTime()));```
#

&6Time:&f " + data.getTime()

#

so Im sending this

languid sky
#

Any staff who can help me with a purchase problem?

lone fog
#

Why are you creating a simpleDateFormat and not using it

frigid ember
#

but it will literally give the System.current.timemillies

#

yes

#

how can I properly use it?

#

I tried it

#

but then it says it hasnt been itialised

#

I put it like this:

death.add(new Data(e.getEntity().getLocation(), e.getDeathMessage(), System.currentTimeMillis()));```
#

System.currentTimeMillis()

#

then it should be converted to the regular time

#

when the command gets executed

lone fog
#

sDF.format

frigid ember
#

doesnt change anything?

lone fog
#

SimpleDateFormat sDF = new SimpleDateFormat("HH:mm");
return sDF.format(time);

#

Won't be a long anymore

#

Think it's a string

frigid ember
#

yes

quick arch
#

Jan 1, 1997

#

๐Ÿค”

frigid ember
#

millieseconds since 1997 yea

#

but can be converted to real time

#

death.add(new Data(e.getEntity().getLocation(), e.getDeathMessage(), System.currentTimeMillis()));

#

System.currentTimeMillis() = long

lone fog
#

1970 actually

frigid ember
#

so what should I put

lone fog
#

SimpleDateFormat sDF = new SimpleDateFormat("HH:mm");
return sDF.format(time);

frigid ember
#

yea

#

but put it into the hashmap

#

deaths.add(new Data(e.getEntity().getLocation(), e.getDeathMessage(), System.currentTimeMillis()));

#

System.currentTimeMillis = long

lone fog
#

So convert it when you take it out of the map

#

Or change it to a string

frigid ember
#

Derp question but this:

(from /summon armor_stand) Pose:{LeftLeg:[56f,46f,63f]}}
``` Are these EulerAngles? Or do I need to find a way to convert this?
void hawk
#

hi guys, could do with a little help, currently lava donesnt damage people and creeepers dont blow up on my paper server

#

they charge but no explosion

frigid ember
#

Check paper.yml

#

those are disabled then

#

@lone fog

#

says its 1.23 rn

#

while its 2.57 here rn ๐Ÿ˜ฆ

#

ohh nvm

#

srry for ghost tag

void hawk
#

what am i looking for exactly, i dont see creeper explosions

frigid ember
#

Lets rule out something first, Are you using worldguard also?

void hawk
#

yes

frigid ember
#

in worldguard > config.yml

    block-creeper-explosions: false
    block-creeper-block-damage: false
player-damage:
    disable-lava-damage: false

Look around the config to setup how you like then save and restart server ๐Ÿ™‚

void hawk
#

ah okay, thanks. I was looking in the wrong plugins. I thought it was related to the spawn in particular

frigid ember
#

All good, I went though the same thing almost when I first started a server

void hawk
#

so given i am disabling creeper block damage. This will be unaffected with claims inside of redprotect. not sure if you have experience with it?

frigid ember
#

havent used redprotect so unsure....

steel swift
#

this may be a stupid question, but I just started using bukkit/spigot. Is there a way to get rid of the stupid bukkit help that replaces /help and maybe even create a whole new version of that

#

and does anyone know what the best permissions tutorial is

void hawk
#

hey guys, i have another question. Using votifier and votingplugin. Is it possible to give essentials balance increase as a reward?

lone fog
#

Make the reward /eco give {player} amount

#

I think that's the syntax anyway

potent crypt
#

Is there a discord for NoCheatplus.

frigid ember
#

System.out.println() & System.out.print() both return spaces, correct?

potent crypt
#

Is this the place to go when you need help with plugins?

bronze acorn
#

yes

potent crypt
#

Can anyone help me with NoCheatplus?

#

I wanna ask something.

void hawk
#

@lone fog where abouts is this stated? here under rewards like this?

#

VoteDelay: 24
Item:
Material: 'TRIPWIRE_HOOK'
Amount: 1
Chance: 100
Name: '&aPirates Chance Key'
Enchants:
fortune: 1
Rewards:
Commands:
- say hello
AdvancedPriority:
Reward1:
Money:
Min: 100
Max: 3000
EXPLevels:
Min: 1
Max: 5

lone fog
#

Commands

#

Replace the say hello

void hawk
#

slash needed?

potent crypt
#

Im using NoCheatplus in 1.16 but it's blocking crossbows how do I fix it or replace what to replace it with.

#

Can anyone help me or there is another server to help with this problem.

eager lagoon
undone narwhal
#

BlockCanBuild is thrown when you try to place a block, even if you can't place it for x reason

frigid ember
#
        for(i=0, j=10; i < j; i++, j--)
            System.out.println("I and J: " + i + " " + j);
```So this loop will end when I is greater than J?
eager lagoon
#

what would be that reason

#

like spawn protection?