#help-archived

1 messages · Page 28 of 1

meager lantern
#

Zax what we're talking about atm isn't actually so much development as it is systems administration

hoary parcel
#

It's soooo stupid

frigid ember
#

yeah

wanton delta
#

no obfuscating

tropic swallow
#

like com.masterwolfx.main

frigid ember
#

i want to see matrix code 😔

radiant pollen
#

Use your domain or email address @tropic swallow

tropic swallow
#

all other classes can be obfuscated?

wanton delta
#

no

#

dont obfuscate

#

it might be technically allowed

#

but dont bother

hoary parcel
#

Don't use a domain you don't own in your package

tropic swallow
#

it was just an example, im not using it

frigid ember
#

also what happened to the low effort rule

#

like fr

wanton delta
#

wdym what happened

radiant pollen
#

I've always been told an email address works. Am i wrong?

tropic swallow
#

i should not obfuscate?

frigid ember
#

its not enforced at all lmao

radiant pollen
#

so?

hoary parcel
#

Yeah an email is fine

wanton delta
#

low effort doenst necessarily mean good plugin

hoary parcel
#

Or com.github.username

wanton delta
#

dont obfuscate

hoary parcel
#

Low effort is hard to enforce

#

But bunch of shit is rejected

chrome lark
#

obfuscation really doesn't stop anybody who really what's to release a copy of your plugin

frigid ember
#

someone messed up a /fly command 😔

chrome lark
#

honestly, you're just inducing more stuff for yourself to deal with, nor are you really preventing much

tropic swallow
#

i just wanted to prevent some people from modify the code

wanton delta
#

yea dont

#

its not worth it

hoary parcel
#

You can't stop ppl from modifying your code

wanton delta
#

why would you want to prevent someone modifying code

hoary parcel
#

Minecraft is obfuscated and we still all here

wanton delta
#

which would make it better for them

tropic swallow
#

i can stop a small part of who wants to modify it

hoary parcel
#

But why?

wanton delta
#

modifying code isnt a bad thing

#

redistributing it is, and that isnt solved via obfuscation

tropic swallow
#

it cant be solved at all with mc plugins

#

well, im not going to obfuscate it..

wanton delta
#

what is your plugin

silk bane
#

the thrilling conclusion

wanton delta
#

out of curiosity

tropic swallow
#

its about item upgrades

boreal tiger
#

high tech stuff, better register a patent

tropic swallow
#

i made a remake of an old plugin i found on the internet, HeavenStones

sour dock
#

how about seacrching on google

boreal tiger
#

@pale plaza stop asking people for plugins

#

do some research

silk bane
#

try bing

wanton delta
#

if your faction plugin doesnt have an f top command

#

use a different faction plugin lmao

#

bs theres 100s

sour dock
#

spigot should just force all plugins in the resource section to be open source

#

better for everyone

tiny dagger
#

no

rapid yacht
#

@wanton delta true LOL

boreal tiger
#

isnt massive factions outdated

#

or is there another fork

wanton delta
#

massivecraft factions has an ftop command

#

theres no way it wouldnt

frail charm
#

guys can i use essentials Eco in the jobs plugin? like when i use essentials money i can buy in jobs shop

boreal tiger
#

there are many jobs plugins, what jobs plugin is this?

frail charm
#

Jobs4.15.7.jar

wanton delta
#

im surprised that massive doesnt have f top

rapid yacht
#

Here's my advice on a factions server - Don't make one

wanton delta
#

YEA LMAO

rapid yacht
#

there are too many

wanton delta
#

was about to say

rapid yacht
#

players wont have any reason to join yours

radiant pollen
#

@frail charm It probably involves using Vault.

rapid yacht
#

anything "unique" has been done before.

radiant pollen
#

Check the description of the Jobs plugin and see if it requires Vault.

frail charm
#

it does require vault and i have vault plugin installed

radiant pollen
#

There's probably some config options to setup economy stuff for the jobs plugin.

#

@pale plaza Please stop...

rapid yacht
#

@pale plaza check out what I said before

lofty otter
#

guys im getting a NoClassDefFOundError for kotlin stuff

#

ive included the kotlin-plugin

#

but its still being thrown

radiant pollen
#

When are you getting the error? @lofty otter

lofty otter
#

when I run a command

#

java.util.concurrent.CompletionException: java.lang.NoClassDefFoundError: Could not initialize class jetbrains.exodus.env.EnvironmentConfig

#

and i get the same error on sponge if i dont include the kotlin lib

#

works fine if its there

#

but somehow its not getting the kotlin dep from the other jar

#

on spigot

radiant pollen
#

I could be completely wrong on this, but don't you need the kotlin stuff shaded? It's not gonna be on the server unless it is, right?

lofty otter
#

yes

#

it is shaded

radiant pollen
#

Hmmm.

lofty otter
#

not in my jar though

boreal tiger
#

you need to load after that plugin

lofty otter
radiant pollen
#

Yeah just make sure it's a depend.

lofty otter
#

ive added a softdepend on it

boreal tiger
#

is softdepend enough?

tiny dagger
#

how safe is to pass string as key in a hashmap? 🤔

lofty otter
#

i dont always need kotlin

#

only when they want to use a specific database type

#

so thats why its soft

radiant pollen
#

I would change it to a depend for now and see if the plugin still loads correctly.

boreal tiger
#

try with depend just in case 🤷‍♂️

rapid yacht
#

@pale plaza I said that making a factions server is a waste of time

radiant pollen
#

If your plugin doesn't work after you change it to depend, then it's an issue with the kotlin plugin.

rapid yacht
#

since it has been done before so many times

#

players won't have a reason to join u

lofty otter
#

same error

#

even with depend

radiant pollen
#

Hmmm. Maybe the kotlin version your plugin is using is newer than this one?

lofty otter
#

nope

#

on sponge I use spotlin to shade kotlin

#

and it shades 1.3.40

#

and the spigot one shades 1.3.41

rapid yacht
#

Honestly it goes the same for KitPVP, Skyblock and all that

lofty otter
#

im pretty sure this kotlin plugin is busted

radiant pollen
#

It could be. Maybe just shade it yourself and see if it works after that?

lofty otter
#

ill try that

#

do you need a kotlin gradle build script or will a normal one suffice

boreal tiger
#

are you relocating?

lofty otter
#

no

#

just shading

#

now im getting
No signature of method: build_45avc9trbo033d6wg4ng987m4.shadowJar() is applicable for argument types: (build_45avc9trbo033d6wg4ng987m4$_run_closure3) values: [build_45avc9trbo033d6wg4ng987m4$_run_closure3@9a89917]

boreal tiger
#

👀

radiant pollen
#

You should be able to just make it a compile dependency.

lofty otter
#

error was because of a typo

#

i shaded it now

#

but jar only went up by 10 kb

#

which is sketch af

sour dock
#

minimizeJar?

lofty otter
#

well it was 15 kb

#

but how are you going to fit all of kotlin in 15 kb

#

ah i know why

#

im looking in the jar

#

while all the kotlin packages are there, the classes are not

#

im shading just the jdk8 kotlin stdlib

#

do i need to shade the normal one too...

#

yes that seems to have done it

fleet burrow
#

so, i've been storing data in a block's persistent data

#

and

#

java.io.UTFDataFormatException: encoded string too long: 83646 bytes i've encountered this problem

#

😅

wanton delta
#

for those that cared (probably no one 🙁 ) i figured out LibsDisguises is what was cancelling my entity euipment events

#

i guess it was updated to handle equipment on its own :p

vagrant widget
#

Is there a crate plugin that let me set any block as a crate instead of a chest?

inland meteor
#

Bungeecord textcomponents, why does the text go white if the text overflows onto another line?

sour dock
#

I remember having this issue as well, don't remember how I solved it though

silk gate
#

dont use colour codes

sour dock
#

are you using legacy text?

silk gate
#

use they actual

#

.color method

inland meteor
#

Trying to do it config based :/

sour dock
#

if so, make sure to properly convert using TextComponent.fromLegacyText

inland meteor
#

AHHHH

#

that's the method

#

god im an idiot

#

xD

slim hemlock
#

is there an event for when players switch an item from mainhand to offhand?

inland meteor
#

wait @silk gate where do i know you from

#

OH

#

wait

#

nvm i realise now, you're ryan xD

slim hemlock
#

nvm found it

inland meteor
#

lmao

silk gate
#

hmm

inland meteor
#

tickets

silk gate
#

ah

#

yes

inland meteor
#

haha

vestal pebble
#

DOes anyone know a scoreboard plugin that shows your kills deaths money KDR and killstreak and your name doesnt matter if premium or whatever and I want it to be able to enable it in certain worlds if u do know dm me or @ me

frigid ember
#

Question: Is it possible to get a resource's (plugin's) data, such as version etc. in the form of JSON? What I want to do is display the current plugin version on my website.

velvet halo
#

Yeah you can easily do that

#

Do you want it to be all plugins on your server or just a specific plugin?

frigid ember
#

@velvet halo I want to get information of my own plugin from Spigot's website

velvet halo
#

Oh I thought you meant getting information from an online server. I don't have website experience but I am sure you can.

#

I think I saw something on your question a while ago

frigid ember
#

Also I cannot get the system to verify me 😂 where am I supposed to receive that message

radiant pollen
#

It'll be in your spigotforum pms.

velvet halo
#

The verification message gets sent to your spigotmc forums account

frigid ember
#

It wasn't working like a week ago lol, just worked tho

velvet halo
frigid ember
#

wow what did you search i have been searching for hours xD

#

Thanks you are awesome 👌

velvet halo
#

I remember coming across it a while ago and the name just suddenly came into my mind xD

#

no problem

frigid ember
#

cool lol

silk bane
#

will World#getEntitiesByClass(LivingEntity.class) get all living entities, or do i need to pass in a specific entity interface?

hoary parcel
#

uuuhm

#

just

#

World#getLivingEntities?

#

😄

#

but yes, it would call LivingEntitiy.class.isAssignableFrom(Zombie.class)

dense rampart
#

ok so my priorities for bungeecord are

priorities:
- Server1
- Server2

however if server1 is down, I can't connect at all, even if server2 is up

tiny dagger
#

i doubt any world based getentities is worth it

silk bane
#

also i assume it only gets loaded entities

#

ok another question

#

does the server reuse entity ids?

hoary parcel
#

it only gets "valid" entities

#

so not dead and loaded and stuff

#

public boolean isValid() {
return entity.isAlive() && entity.valid && entity.isChunkLoaded();
}

silk bane
#

cool

hoary parcel
#

and no, I dont find ids are reused

#

iirc the server just counts up

#

this.id = Entity.entityCount.incrementAndGet();

#

yep

#

its never getting reset either if IJ doesnt fool me

silk bane
#

cool

#

why is com.google.common.collect.EvictingQueue beta tho

#

what could possibly go wrong

idle tulip
#

onEnable "this.getCommand("pricamc reload").setExecutor(this);" is it correct? When I have onCommand in main class

subtle blade
#

No need to. It defaults to your plugin

#

You should only have to set the executor if it's in another class

#

However, you can't just get a command with its arguments. You have to check the arguments in the onCommand() method (as is the reason String[] args exists)

idle tulip
#

so it registers automatically when i have onCommand in main class?

subtle blade
#

All commands created by your plugin are executed through your main class unless otherwise specified, yes

idle tulip
#

ok thanks

subtle blade
#

But this, this.getCommand("pricamc reload"), is invalid

idle tulip
#

yeah, you told already, i'll use args

subtle blade
minor spruce
#

i have a problem with an ArrayStoreException. i have 2 classes called Tracker and TrackerDisabled that are both subclasses of TrackerBase, but a TrackerBase array is only letting me add Tracker. can anyone explain why this is?

wanton delta
#

Arrays are fixed, they cannot add or remove objects

radiant pollen
#

@wanton delta that's not what he's asking

wanton delta
#

oh my bad

radiant pollen
#

@minor spruce Can you show your class definitions?

hoary parcel
#

What's the compiler error?

wanton delta
#

i mustve misunderstood :L

silk bane
#

if i use the scheduler to schedule a synchronous task, is there a difference between specifying a 1 tick delay and not specifying a delay?

idle tulip
radiant pollen
#

@silk bane AFAIK, no delay is on the next tick and 1 tick delay is one tick after the next tick.

silk bane
#

cool

minor spruce
#

this is gonna sound like a stupid question but whats the class definition

radiant pollen
#

@minor spruce public abstract class TrackerBase etc etc.

minor spruce
#

oh right, yea thats what the TrackerBase one looks like

#

then Tracker and TrackerDisabled both extend TrackerBase

hoary parcel
#

What is the compiler error?

minor spruce
#

theres no compiler error it only happens when the plugin is running on the server

radiant pollen
#

Can you give the stacktrace?

#

@idle tulip Did you add the command to the plugin.yml?

minor spruce
idle tulip
#

hm, i don't have plugin.yml, i have to lookup how to add that to intellij with maven

radiant pollen
#

@idle tulip If you don't have a plugin.yml, then your plugin isn't loading.

idle tulip
#

oh wait, i do have... let me look up what i need to add there

radiant pollen
dusty topaz
#

@minor spruce show the lines of code leading up to the error

radiant pollen
#

@minor spruce Can you show us the code that it throws the error on?

#

The method at PlayerLoader line 57

hoary parcel
#

Array store exceptions are dum

#

Show the code

pure belfry
#

anyone know how to fix this? Plugin has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0

hoary parcel
#

You do something wrong with your times

#

Update java @pure belfry

pure belfry
#

I have

dusty topaz
#

Evidently not

hoary parcel
#

Output of java -version?

pure belfry
#

from where

dusty topaz
#

A terminal

radiant pollen
#

@pure belfry the server's java version is outdated. do you have a host or are you running it on your computer?

minor spruce
#

oh wait i just realised im an idiot

#

lemme test this

pure belfry
#

running it on my computer

dusty topaz
#

Press windows key R

#

Type cmd

radiant pollen
#

Open up a terminal and do java -version

pure belfry
#

I guess you're right it says java 1.8

minor spruce
#

yea im stupid, accidentally made a Tracker array instead of a TrackerBase array, thanks for the help

dusty topaz
#

What reason to use arrays over a list

frigid ember
#

hello all, im looking for a partner to make a management and marketing firm together. if you want to do it then dm me.

hoary parcel
#

😂 😂

idle tulip
#

Hm weird, I added command to plugin.yml and in console it knows command, but it won't execute that reloadConfig() etc

dusty topaz
#

Management and marketing firm

radiant pollen
#

@dusty topaz If you know the size at compile time, and you fill all of it, you should use an array.

dusty topaz
#

I'm lazy

radiant pollen
#

@frigid ember wrong chat

frigid ember
#

yes, @dusty topaz

hoary parcel
#

Arrays are faster than lists

dusty topaz
#

Say I have a list of materials that I want I do Sets.newHashSet(stuff)

frigid ember
#

this is the right chat @radiant pollen

hoary parcel
#

Well, a set is very different to an array

pure belfry
#

is java 8 not the latest version of java?

hoary parcel
#

It's not ordered for starters

frigid ember
#

it is the help one

hoary parcel
#

Iteration is also slower

radiant pollen
#

@frigid ember No it isn't. You're not asking for help.

#

?services

worldly heathBOT
hoary parcel
#

The latest version of java is 14, lol

pure belfry
#

do I get it from the java site or oracle

hoary parcel
#

15 comes out in October

dusty topaz
#

But #contains is O(1) right?

pure belfry
#

am I allowed to post links?

dusty topaz
#

For sets

hoary parcel
#

You get it from adoptopenjdk

#

Yes it is

radiant pollen
#

wtf? it is?

#

oh right yeah

tiny dagger
#

anyone knows if intobjecthashmap is better than an hashmap in terms of time complexity 🤔

hoary parcel
#

It really depends on what you want to do, choosing the right data types ismone of the most important thing

dusty topaz
#

Yeah so I just use sets if I need to check contents

#

I never find myself using arrays tbh

#

Probably bad

hoary parcel
#

Fastutil stuff saves you from auto boxing

#

Time complexity is the same

#

Actual runtime can be much faster

dusty topaz
#

Fastutil?

hoary parcel
#

It's a collection lib that offers primitive collection types

idle tulip
#

https://pastebin.com/raw/hGWj3JjT is this correct? i have command added in plugin.yml and it recognizes command (doesn't say unknown command), but it won't execute that onCommand in main class

hoary parcel
#

So IntObjectHashMap<String> over hashmap<Integer, String>

dusty topaz
#

Huh

hoary parcel
#

Since java doesn't have primitive generics

#

Yet anyways

#

Long life project Valhalla

dusty topaz
#

Possible to have int value?

tiny dagger
#

i read somewhere that intobjecthashmap goes into O(n) at remove 🤔

#

also any difference between intobjecthashmap and trove's one?

silk bane
#

how significant is the performance difference?

#

there's like a million different implementations of it as well

dusty topaz
#

I wouldnt imagine crazily

tiny dagger
#

it's so hard lol

dusty topaz
#

Unless you're storing thousands

hoary parcel
#

Well, all hashmaps can degrade

radiant pollen
#

degrade?

hoary parcel
#

If you get to much collisions, operations on hash maps can all go to 0n

silk bane
#

make the hash table bigger

radiant pollen
#

ohhh right

tiny dagger
#

but it's probabily safe for most 🤔

pure belfry
#

does the jdk kit not come with java?

dusty topaz
#

What is meant by collisions

tiny dagger
#

2 objects with same hash

dusty topaz
#

Hashcode?

tiny dagger
#

their equals differs yet the hashcode is the same

dusty topaz
#

Ah

silk bane
#

which doesn't really happen for integers

#

cuz you know

tiny dagger
#

but for strings tho

silk bane
#

they are their hash

hoary parcel
#

Ppl should learn more about datatypes

tiny dagger
#

i'm scared to touch strings

dusty topaz
#

Where to learn this stuff though

#

Books?

tiny dagger
#

just practice

silk bane
#

(university)

hoary parcel
#

University 😂

#

Practice doesn't help you hear

#

Here

#

You need to know the details of the major collections and datatypes

#

There is ton of literature out there for that I guess

dusty topaz
#

Any youd recommend?

hoary parcel
#

Just implementing the simple data types by hand gives you great insight

#

Not really, I learned this stuff at uni

#

I had a whole semester just about data types

#

And another semester a course just about algos

dusty topaz
#

Uni is a couple years off for me unfortunately

tiny dagger
#

so can you rough categorize them? 🤔

silk bane
#

guess it depends on exactly what's on your course

dusty topaz
#

a level comp sci isn't the most comprehensive

silk bane
#

afaik most uk unis don't even care about a level comp sci

#

they just want maths

dusty topaz
#

yeah also doing maths fm phys

#

trying for cambridge

silk bane
#

jeeeez

dusty topaz
#

fun life i know

silk bane
#

sounds great, best of luck

dusty topaz
#

haha cheers

hoary parcel
#

I actually learned a ton of algo and datatypes stuff at school

fleet burrow
#

Say I have a foreach of list x and in the foreach i add to list x, will the item i added be iterated over?

hoary parcel
#

Sorting algos and different list and stack etc

dusty topaz
#

yes @fleet burrow

fleet burrow
#

thank god

#

ok good

#

haha

dusty topaz
#

i think

silk bane
#

@fleet burrow you'll actually get a concurrentmod exception

hoary parcel
#

It will throw a concurrent modification exception most likely, lol

silk bane
#

oof

fleet burrow
#

damnit xd

dusty topaz
#

adding throws concurrent?

silk bane
#

yep

dusty topaz
#

i did not know that one

tiny dagger
#

what's Stack used for really? 🤔

hoary parcel
#

Unless its a concurrent list impl

silk bane
#

"modification" causes concurrent

dusty topaz
#

i used stack somewhere recently

#

can't remember where though

hoary parcel
#

Stack is used whenever you process stuff last in first out

silk bane
#

@fleet burrow store a list of the stuff you want to add

#

add it all at the end

tiny dagger
#

isn't queue faster tho?

dusty topaz
#

queue is FIFO

hoary parcel
#

A calculator is the example stacks are getting taught with

silk bane
#

ArrayDeque implements all of them

hoary parcel
#

Where you just add all operations on a stack

silk bane
#

there's really no speed difference

fleet burrow
#

i'll just refactor the code to use a set

#

much better suited

#

im just lazy

silk bane
#

and he should have used ArrayDeque ^^

tiny dagger
#

i use deque, so usefull for rollback

hoary parcel
#

Whenever a color tag opens, I push the color on the stack, whenever it's closed, it gets removed again

hoary parcel
#

And then for every component I just peek and add the color

subtle blade
#

People still use Stacks?

silk bane
#

nothing to see here

tiny dagger
#

is optional over returning null that big of a deal? 🤔

hoary parcel
#

It's a garbage object

silk bane
#

optional is possibly one of the most useless things in the java api at the moment

#

ok that's not true

#

but like, it's not that useful

hoary parcel
#

You want to solve nullabilty at compile time via method contracts

#

And then just do null checks when your ide yells at you

#

Untill we have value types

silk bane
#

i guess optional is nice when you want your chain of 28 lambda expressions to look cool

slim hemlock
#

I'm really tired and I think I'm doing something stupid

pseudocode

    private void gameTimer() {
        new BukkitRunnable() {
            @Override
            public void run() {
                Debug.message("players: " + getPlayers().size());
                if (getPlayers().size() < 2)
                    isActive = false;
                if (!isActive) {
                    cancel();
                    endMatch();
                    return;
                }
                gameTimer++;
                matchScoreboard();
            }
        }.runTaskTimer(KeyValues.plugin, 0, 1);
    }
subtle blade
#

I feel like Optional has its very niche use-cases

slim hemlock
#

getPlayers never updates

#

is it because I put it in a runnable

#

and how do I fix it

#

I feel like I'm missing something due to sleep deprivation

subtle blade
#

Though for the most part, yea... screw Optional lol

slim hemlock
#

I am also checking on other classes that the value is different when not in the runnable

silk bane
#

@slim hemlock you haven't shown us the code that updates getplayers

slim hemlock
#

like I'm using the same getter

silk bane
#

if it doesn't exist it might not be surprising that it doesn't update

fleet burrow
slim hemlock
#

it does exist

#
    private HashSet<MatchPlayer> getPlayers() {
        return players;
    }

    private void addPlayer(MatchPlayer matchPlayer) {
        players.add(matchPlayer);
    }

    private void removePlayer(MatchPlayer matchPlayer) {
        players.remove(matchPlayer);
    }

    private HashSet<MatchPlayer> scoreboardPlayers = new HashSet<>();

    private HashSet<MatchPlayer> players = new HashSet<>();
silk bane
#

and i guess nothing ever calls addPlayer or removePlayer?

subtle blade
#

> returning implementations

#

> defining implementations

silk bane
#

should probably be Collections.unmodifiableSet(players)

tiny dagger
#

unify those somehow

slim hemlock
#

konsolas I'm using the same getter elsewhere at the same time and it's returning a different value

#

the value is updated

silk bane
#

is it in a different thread

keen compass
#

@slim hemlock why do you set the boolean and then right after check said boolean? Does it get updated outside of the runnable at all ? o.O

#

if not, just remove that check and put your cancel method there instead

subtle blade
#

I was going to say the same. Sounds a lot like a data race

slim hemlock
#

not a race, it's the same value before and after

#

it's a runnable so even if it were a race at some ppoint it'd be updated

#

@keen compass because multiple conditions may end a match that are not all incorporated in that snippet

tiny dagger
#

i would recommand you to have in your game instance an unified playerset because it's easier to handle

silk bane
#

@slim hemlock is addPlayer and removePlayer the only thing that modifies players?

slim hemlock
#

no, they get initialized differently

silk bane
#

as in the field named players

#

does anything other than those two methods modify it

slim hemlock
#

just the thing that initializes the values I think

silk bane
#

what initialises the values

slim hemlock
#

.add

#

directly

silk bane
#

change your HashSet<MatchPlayer> to final Set<MatchPlayer> and your getPlayers to private Set<MatchPlayer> getPlayers() { return Collections.unmodifiableSet(players); }

#

just minimise the number of things that bits of code can screw up

#

use the correct methods to add and remove

#

and with any luck a compile error or an unsupportedoperationexception at runtime will tell you what's happening

#

i'm leaving

#

wait getPlayers is private???

#

what's going on

#

why do you need a private getter

#

i'm definitely leaving now

bitter tendon
#

How can I slove this problem: [Netty Server IO #1/ERROR]: Could not serialize ... - will not be sent to client!?

slim hemlock
#

wait waht

#

oh fuck

tiny dagger
#

look

slim hemlock
#

I'm retarded

tiny dagger
#

i recommand you this thread

slim hemlock
#

see I knew I was too tired

tiny dagger
#

it's old but golden

slim hemlock
#

I was removing people from the arena and not from the match

#

alright thanks

old barn
#
    @EventHandler
public void AoQuebrar(BlockBreakEvent e) {
    Player p = (Player) e.getPlayer();
    if(p.getWorld().getName().equalsIgnoreCase("mina")) {
        Iterator<ItemStack> var3 = e.getBlock().getDrops().iterator();
        while(var3.hasNext()) {
            ItemStack item = (ItemStack)var3.next();
            if (item.getType().equals(Material.STONE)) {
               item.setType(Material.AIR);
            }
        }
        
    }
}

Why is not working?

tiny dagger
#

that's why you should have a unified player set

velvet halo
#

ImmutableSet.copyof() is nice too

silk bane
#

@old barn you probably want COBBLESTONE unless everyone is running around with silk touch

velvet halo
#
public class Manager<T> {

    protected Collection<T> collection;

    public void add(T t) {
        this.collection.add(t);
    }

    public void remove(T t) {
        this.collection.remove(t);
    }

    public void toSet(Collection<T> collection) {
        this.collection = collection;
    }

    public Collection<T> asSet() {
        return ImmutableSet.copyOf(collection);
    }
}
#

easy peasy

subtle blade
#

Oh would ya look at that. A collection wrapper!

silk bane
#

i don't buy that because i don't think you necessarily need a copy

#

since most spigot stuff happens sync

#

unmodifiableSet is better for that

velvet halo
#

Yeah well I need to make sure a lot of things are thread safe for when I code

#

but either way works

slim hemlock
#

literally braindead dev issues

#

I wasn't looking at the right class

velvet halo
#

wtf did I do new HashSet

#

I must be tired

subtle blade
#

That whole class is really, really useless though. You're wrapping a HashSet in another class

#

It's not even iterable, or cloneable. It's a middleman class

#

Hell, it's not even thread safe lol

old barn
#

Actually, I put this block just for testing, I broke stone with silk touch and it keeps dropping
@silk bane

subtle blade
#

Block#getDrops() is immutable

pure belfry
#

Why am I still getting this error ;-; 'java' is not recognized as an internal or external command,
operable program or batch file.

subtle blade
#

Or, rather, it returns a new collection every time it's called

#

Modifying it does not modify the drops

inland heron
#

To give players permissions do you use .addAttachment?

#

or do I need a permissions plugin

old barn
#

So how could you be canceling the drop?

subtle blade
#

BlockBreakEvent has setDropitems(boolean)

#

If the event.getBlock()'s type is stone, setDropItems() to false

velvet halo
#

I am not saying ImmutableSet.copyof() is thread safe, the person using it would have to make sure that the collection they pass in is thread safe

subtle blade
#

Doesn't make your class any more useful. I mentioned thread safety because the class you sent above has no benefit whatsoever

#

You'd be better off defining a collection instead

velvet halo
#

I have used it for many things and it has helped me tons

subtle blade
#

That's great, but it still doesn't make it any more useful lol

velvet halo
#

Not for you but for me it does

subtle blade
#

Again, it's a middleman class

velvet halo
#

Thanks

subtle blade
#

Why do you have to argue everything?

velvet halo
#

I have my opinions

subtle blade
#

Accept criticism, please. Whether or not you use it, the class is useless

tiny dagger
#

^

subtle blade
#

You cannot grow as a developer until you learn to accept criticism

#

You'll be stuck doing the same stupid shit you did when you started

inland heron
#

How do you give players permissions? Do you use .addAttachment or do I need an external plugin?

velvet halo
#

Then what do you suggest?

#

using instead?

pure belfry
#

whenever I download the jdk shouldn't I be able to use java commands in cmd?

subtle blade
#

Just define the collection you want to use directly. If you have to expose that collection publicly, wrap it in a Collections.unmodifiable<WhateverType>()

fair niche
#

What are good moderation plugins? Litebans is doodoo

subtle blade
#

You'd accomplish the same thing you're doing with that class only you're actually able to perform collection operations on it

#

And it's Iterable, Cloneable, etc.

velvet halo
#

That is true

old barn
#

@subtle blade setDropItems() is not exist

subtle blade
#

In BlockBreakEvent?

old barn
#

yes

subtle blade
silk bane
#

that takes a boolean

inland heron
#

setDropItems(false) if block type is stone

slim hemlock
silk bane
#

if only the watchdog would stop interrupting remote debugging

subtle blade
#

Was added in 1.12 if that's of significance though we assume latest version

#

If you're on 1.8.8, I don't know... BlockDropItemEvent?

#

actually that was added even later lol

silk bane
#

there's no way ItemSpawnEvent will work is there

subtle blade
#

It probably would but you wouldn't be able to get the block from which it was dropped

sharp hollow
#

I'll see if there's any event like that on 1.8.8, gimme a bit

silk bane
#

there does not appear to be a suitable event on 1.8.8

old barn
#
    @EventHandler
public void AoQuebrar(BlockBreakEvent e) {
    Player p = (Player) e.getPlayer();
    if(p.getWorld().getName().equalsIgnoreCase("mina")) {
        if(e.getBlock().getType() == Material.STONE) {
            
        }
        
    
    }
}

setdropitem is not exist ;-;

silk bane
#

e.setCancelled(true); e.getBlock().setType(Material.AIR);

subtle blade
#

What version are you using?

old barn
#

1.8.8

subtle blade
#

Yea that's why

#

Newer versions have newer features \o/

#

Even then, setDropItems() is 3 years old, dude

old barn
#

If you add version 1.12, it won't run on a 1.8 server, right?

subtle blade
#

Well... no

old barn
#

So, how do I cancel the drop in version 1.8.8?

subtle blade
#

but if you had a 1.15 server

inland heron
#

How do you give permissions to players? Is it the addAttachment() method?

sharp hollow
#

100% no event like that for 1.8.8, I don't even see any sort of Drop event either

inland heron
#

Should I use an external plugin for permissions?

silk bane
#

yes

radiant pollen
#

@inland heron yes

subtle blade
#

Add an attachment from your plugin, set permissions in the PermissionAttachment

old barn
#

how do I cancel the drop in version 1.8.8? Do you have any method?

inland heron
#

Cool, thank you

subtle blade
#

In 1.8, as mentioned above by konsolas, you had to set the block to air

#

It was a very hacky way to do it, but again, you're running a very, very old version of the game. 5 years old, in fact

radiant pollen
#

1.8 is stupid.

#

No one can change my mind.

subtle blade
#

In here? I'd imagine most would agree

old barn
#

I know about the method of setting the block as Air, but there is a bug in this method that when breaking the block, the pickaxe does not lose durability, but I will try, thanks

radiant pollen
#

I asked for feedback in rate my server about my custom pvp game and the first reply was “I haven’t even gotten on the server but PVP IS BETTER ON 1.8 REEEE”

#

eye roll

subtle blade
#

lol

harsh anvil
#

1.8 can suk me dik tbh

subtle blade
#

you'll never get anybody that plays that version to actually try and like it. They already go in with the idea that it's inferior and are anal about it being true

harsh anvil
#

i like 1.15 pvp more lul

#

performance is a lot better on 1.8 tho but thats about the only thing it got going for it

#

¯_(ツ)_/¯

mossy turtle
#

Would this also be the correct channel to ask about Spigot APIs (plugin dev), or is it just for "users"?

silk bane
#

it's for everyone since md_5 only had the budget for one help channel

radiant pollen
#

Most questions we get here are from people making plugins. @mossy turtle

heavy isle
#

:/

mossy turtle
#

Ah, thats nice to know. I just recently joined, didn't want to abuse the channel 🙂

heavy isle
#

Hmm, anyone familiar with the JavaPluginLoader code?

silk bane
#

?ask

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

heavy isle
#

thx 😉 good point

finite pine
#
    @EventHandler
    public void scChat(AsyncPlayerChatEvent e){
        Player p = e.getPlayer();
        if(StaffChat.scList.contains(p.getUniqueId())){
            e.setCancelled(true);
            for(Player player : Bukkit.getOnlinePlayers()){
                player.sendMessage(Utils.chat("&b&l[SC]&c " + p.getName() + " " + e.getMessage()));
            }
        }

    }
#

why is msg sent twice

heavy isle
#

@finite pine does execution run twice? ie. if you logged in the first line in the method, would you see that twice also?

finite pine
#

no

heavy isle
#

you using /reload to iterate on your plugin by chance?

finite pine
#

no

heavy isle
#

Hmm dunno, seems legit. haven't done much with chat events tho. does priority matter for cancellation?

fading owl
#

is it only being sent twice to the one person executing the chat event?

finite pine
#

all persons who are in the list

fading owl
#

What does Utils.chat do? Is that a part of the Bukkit api?

dusty topaz
#

Will return ChatColor.translateAlternate

#

with & colours

fading owl
#

Okay gotcha

dusty topaz
#

I can't see why that would send twice

fading owl
#

Yeah that is odd.

dusty topaz
#

Is it the only plugin on the server

finite pine
#

what's the best way to register events outside main class?

dusty topaz
#

You need a plugin instance

#

So just have the instance

fading owl
#

^

finite pine
#

i've got that

dusty topaz
#

instance.getServer().getPluginManager().registerEvents(event, instance);

#

Bukkit#getServer also works

finite pine
#

yh i have that

dusty topaz
#

Then that registers it

#

Do you register it twice?

finite pine
#

I have it again in the main class

dusty topaz
#

Yeah thats why it sends twice

#

Only need to registerEvents once

finite pine
#

now staff chat doesn't work

dusty topaz
#

Console error or just not working

finite pine
#

not working

dusty topaz
#

then it likely isn't registered properly

finite pine
#
    public Main plugin;
    public SCListener(Main plugin){
        this.plugin = plugin;
        plugin.getServer().getPluginManager().registerEvents(this, plugin);
    }
#

every other listener worked

dusty topaz
#

Check the event is being called with a debug message, but that looks fine

#

As long as you're actually creating an instance of the class

finite pine
#

where should i place the debug messages?

silk gate
#

in your constructor

dusty topaz
#

One to check the event is being called, then one for your if statement

silk gate
#

would be a good one

dusty topaz
#

Nah, he wants to check if the event is calling correctly

silk gate
#

ah

#

has he sent the whole code

dusty topaz
#

As ever, no

finite pine
#
    public Main plugin;
    public SCListener(Main plugin){
        this.plugin = plugin;
        plugin.getServer().getPluginManager().registerEvents(this, plugin);
    }

    @EventHandler
    public void scChat(AsyncPlayerChatEvent e){
        Player p = e.getPlayer();
        Bukkit.broadcastMessage("ada");
        if(StaffChat.scList.contains(p.getUniqueId())){
            Bukkit.broadcastMessage("ada");
            e.setCancelled(true);
            Bukkit.broadcastMessage("ada");
            for(Player player : Bukkit.getOnlinePlayers()){
                player.sendMessage(Utils.chat("&b&l[SC]&c " + p.getName() + " " + e.getMessage()));
            }
        }

    }
dusty topaz
#

Which messages get broadcasted

#

How many adas

finite pine
#

none

dusty topaz
#

Then that tells you the event isn't being registered

#

Meaning you likely don't donew SCListener(Main);

finite pine
#

wouldn't i do new SCListener(this) in Main?

dusty topaz
#

Yeah

#

You can just do

#
@Override
public void onEnable() {
  new SCListener(this);
}
#

unless you need to use the class later

finite pine
#

still doesn't seem to work

dusty topaz
#

Show your main

finite pine
#

nvm

#

didn't reload

#

works

#

thanks a lot

dusty topaz
#

np

fading owl
#

ouuu never a good idea to hide logic like that inside of a constructor

subtle blade
#

Bukkit#getServer also works
@dusty topaz Fun fact. Bukkit statically mirrors all methods from Server. Calls to getServer() are redundant unless you need the Server.

#

Also,

ouuu never a good idea to hide logic like that inside of a constructor
this ^ ;P

dusty topaz
#

So it does, Bukkit#getPluginManager then

mossy turtle
#

Is it possible to get the Arrow item causing a EntityDamageEvent/EntityDeathEvent if the arrow is a Tipped arrow of Harming? Because in my tests, the resulting effect from the arrow killed the entity, not the arrow itself

#

and as such, I cannot get the causing item

pure arrow
#

Hi.. Im creting a bedwars server wth aternos
can somebody help me
i dont understands how the plugings work

#

please

velvet halo
#

Anyone know an efficient and easy way to replace all contents in an existing file?

#

nvm

#
new FileWriter(file, false) 
// true appends to contents, false overwrite contents
tame bough
#

Hey

#

I keep getting "If you wish to use ip forwarding enable it in your bungee config aswell"

#

I have enabled and Im not sure what else to do

lofty elbow
#

@fleet crane

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        if (event.getInventory().getHolder() instanceof MenuBuilder) {
            Bukkit.broadcastMessage("t");
            MenuBuilder menuBuilder = (MenuBuilder) event.getInventory().getHolder();
            menuBuilder.onInventoryClick(event);
            event.setCancelled(true);
        }
    }
```how come that works with paperspigot and not normal spigot?
lone rapids
#

Should I be creating a new class for each listener I create?

silk gate
#

why would you ping md5

potent blade
#

Hi, I've just bought FactionsUUID
If someone tries to /f fly
it enables, but after a few seconds he just falls down
and needs to retype the command... Anyone who can help me?

naive stratus
#

@potent blade Could there be another plugin removing the ability?

potent blade
#

Im trying that rn

#

if u have a moment pls

naive stratus
#

Not sure how I can help to be honest

potent blade
#

Do i need massivecore when using factionsuuid?

velvet halo
#

I think it probably says in the documentation wether you need massivecore or not

#

What dependencies it needs

vital turtle
#

I want to create a mc server running the newest 1.16 snapshot on my raspberry pi 4 (4g ram), is there anywhere I can get help for this?

lone rapids
#

Is the reason I'm getting an EventException because helmet, chestplate, leggings, and boots could all be set to null?

hot girder
#

EventException just wraps other exception

lone rapids
#

oh

hot girder
#

send stack trace

lone rapids
#

This is the beginning

subtle blade
#

yea we need the other half of that exception

#

and update your server

lone rapids
#

Ye

subtle blade
#

you're 5 years out of date

lone rapids
#

I also get illegal reflective access

#

Or somethign like that

#

lol

#

Still lets me run tho 😄

tender token
#

This the right place to ask some bungeecord questions?

lone rapids
#

Here's the end

velvet halo
#

Could you show us the line numbers of your code also? 😛

lone rapids
#

Of course

#

If you look up a bit there are some lines

#

I will show the rest

subtle blade
#

event.getItem() can return null if no item is in hand

lone rapids
#

Ok, thanks

#

Also...

#

You saw that first picture I sent? With the InventoryInteractEvent

#

For some reason it doesn't set "sorcerer" to true when I have full gold equipped

#

I also assume the p.getInventory().getHelmet() can return null too

wanton delta
#

everything is colored LOL

#

sorry for being off topic

#

but that is vibrant

lone rapids
#

Lol, using eclipse and default dark mode

wanton delta
#

thats default?

#

wow

lone rapids
#

Well it's not default. White is actually default. But this was called "Default dark mode" under view

wanton delta
#

this is a sample of what i got

#

well yea default dark

spice loom
#

is there an easy way to check for if a block is a tile entity?

lone rapids
#

Yeah, it's very nice having color

spice loom
#

like a chest

wanton delta
#

possibly Material#isInteractable?

#

@spice loom im not an expert on this

spice loom
#

yeah just tried it, doesn't seem to work

wanton delta
#

but you could try BlockState instanceof TileState

spice loom
#

hmm

#

will try

wanton delta
#

Represents a block state that also hosts a tile entity at the given location. This interface alone is merely a marker that does not provide any data. Data about the tile entities is provided by the respective interface for each tile entity type. After modifying the data provided by a TileState, BlockState.update() needs to be called to store the data.

#

i think it could work

#
All Known Subinterfaces:
    Banner, Barrel, Beacon, Bed, Beehive, Bell, BlastFurnace, BrewingStand, Campfire, Chest, CommandBlock, Comparator, Conduit, Container, CreatureSpawner, DaylightDetector, Dispenser, Dropper, EnchantingTable, EnderChest, EndGateway, EntityBlockStorage<T>, Furnace, Hopper, Jigsaw, Jukebox, Lectern, ShulkerBox, Sign, Skull, Smoker, Structure ```
subtle blade
#

That is how you would do it, yes

wanton delta
#

woo

subtle blade
#

TileState check the BlockState

wanton delta
#

i know how to readd docs lol

#

as i read them more i understand things more, crazy how that works out. lol

open turtle
#

yo is there like a list or something with all the like spigot lines of code or something (im new and trying to like learn and stuff so sorry if you got no clue what im talking about)

silk gate
#

javadocs?

open turtle
#

idk

lone rapids
#

I’d say come up with something you want to create first

open turtle
#

thats the thing I want to learn how to, but like I don't learn anything from video tutorials

lone rapids
#

Ok

open turtle
#

I just like copy them but I dont learn

#

idk how to actually learn it so that I can do it myself

lone rapids
#

Pick something on a server. Like a mini game. Get as far as you can. When you can’t get any further look for what you need in bukkit java docs or google a piece of your problem and slowly build that mini game. At the end you’ll have learned about many things and feel more comfortable about building unique plugins.

open turtle
#

I mean I guess thing is like the only thing I know atm is like the beginning things that enables and disables the plugin

lone rapids
#

Ok

open turtle
#

I can possibly try looking at the doc and see if I can learn from there

#

but like I dont wanna copy someone and then believe I learned something

#

when all I did was copy

lone rapids
#

I’d suggest looking at a video on how to make your own command. Then after that make your own command but make it more complex than they did.

open turtle
#

mk ill try that

#

thank you so much man

#

I really want to learn how to make my own plugins just for the hell of it so again thanks xd

lone rapids
#

Cool, I just started last week and know how tough it is to learn stuff.

open turtle
#

So like should I make 1.8.8 plugins or is that like super irrelevant?

#

since from what I see in the docs

#

its for 1.15.2

lone rapids
#

I’m not sure, if you’re trying to mess around I would use the latest

open turtle
#

alright

#

ill try

vagrant widget
#

question

#

have anyone here used the plugin citizens

vestal compass
#

Yes

tall pewter
#

Hey can someone help update a plugin for me? its a super small one. Owner has quit the community years ago and we need this plugin to redesign a remake of the server

#

"paper" spigot server

vestal compass
#

Is there a deadline, what version do you want it updated to?

tall pewter
#

1.15.2

#

there is no dedicated deadline as we are still configing other plugins

#

but would be heavily appreciated 🙂

#

to be noted* It was originally written in a code called "rainbow"

vestal compass
#

Never heard of it

tall pewter
#

yeah it was a very small used plugin custom made for 1 server and that was his own coding pretty much

#

I can pay if someone can update and get these two working

#

joemarriage works on 1.15.2 but has 1 error message when the other player does /marry

#

guessing sorce code isnt up to date?

frigid ember
#

is this a good vps for a small survival server?

#

7 players max

#

not very many plugins

vagrant widget
#

@frigid ember yeah that's good

#

if ur not asking for much

frigid ember
#

im not

#

thank you

velvet halo
#

@frigid ember is that vultr?

frigid ember
#

OVH

vagrant widget
#

I use galaxygate

dark jay
#

Hello! I hope everyone is doing well in this crazy time.

I own a SMP minecraft server with about 50 players (at most 27 at one time playing)

We just reset and changed our server hosting platform (henzner cloud using pterodactyl) and have been experiencing a LOT of lag,
When we have 20ish or more people online we can easily get down to 7 or 8 tps and we might get up to 12 at max.

We have now spent multiple days trying to optimize the server and seem to not be making much progress, its getting super annoying
We have some top spec hardware (16gb ram, quad core AMD cpu) and it seems to be plenty when we have 10 ish players on its a steady 20 rarely dropping below 19.

I am running out of ideas, and it seems like i have got plenty competent server hardware, so i dont really know what to do.

Some other info:

we are using a few plugins, a discord SRV, Tps pluin, coreprotect, a custom coded grave plugin, and pingplayer
as for datapacks we have a lot, most from vanilla tweaks.
Please Help me, it would be much appreciated!

velvet halo
finite belfry
#

help

#

crashed

velvet halo
#

Please contact your host, they are the ones who can help you the quickest.

#
  • There is nothing the spigot community can do about it...
untold notch
#

Question to all the java wizards out there, First off hi! I am new to the Spigot Discord. Secondly I am also starting to slowly learn and develop a custom plugin for my server. Currently I am stuck with adding one line...

I currently have my plugin set to deny the drop of the "Compass" which is the menu item. However when the player dies they drop everything like normal. Is it possible to prevent players from dropping the compass on death, and still allow them to drop all other items?

jolly surge
#

sorry to bother everyone im in need of some help. i recently added bungeecord to my servers and i am now running into a ploblem i cant seem to fix. The connection works fine but when players get into my economy server through the bungeecord lobby they cant seem to use any permissions i set up for them in the economy server. {i use ultra perms to set up the permissions}. for some reason they can only use the bungeecord perms. i probably explained this all weird and im really sorry. its hard to explain.

velvet halo
untold notch
#

@velvet halo Thank you !! Much apprecaited I will test this out and let you know the results. I am hoping to just make it to where it either gives them a compass after death or it prevents it from being dropped on death.

velvet halo
#

@jolly surge Did you install the luckperms plugin on your economy server?

jolly surge
#

i use ultraperms

velvet halo
#

sorry ultra

jolly surge
#

ohh no i didnt

#

yeah its already installed onto my server

#

with everything setup

#

its just weird. players cant use any commands for some reason without me giving op and thats dangerous

#

they can only use the bungeecord commands

#

i can try to install the ultraperms onto the bungeecord server too

velvet halo
#

No you only have to install your permissions plugins on spigot/bukkit servers

#

Bungeecord is a bridge between your servers.

jolly surge
#

ok thats already done then

velvet halo
#

Are you wanting your permissions to be global or have permissions specific to a server?

jolly surge
#

permissions specific servers

#

so basically each server will have its own

#

but i want players to be able to use bungeecord perms as well

#

[ex. /server skyblock or /server lobby]

velvet halo
#
permissions:
  default:
  - bungeecord.command.server
  - bungeecord.command.list
  admin:
  - bungeecord.command.alert
  - bungeecord.command.end
  - bungeecord.command.ip
  - bungeecord.command.reload
``` Bungeecord config has a permissions section in the `config.yml` this is where you can add the permissions.
#

Everything labeled under default will be allowed by all users on your servers.

jolly surge
#

ok so why cant anyone use the perms i already have setup on the economy server?

#

anyone can use those i set them up already 🙂

velvet halo
#

Could you send me over the files you have setup for the groups so I can take a closer look? 😮

#

?paste

worldly heathBOT
velvet halo
#

😉

jolly surge
#

i can give you file acces if that will be easier. sorry im new to a;; this stuff and still learning

#

all"

wanton delta
#

@frigid ember i would NOT recommend that VPS

#

vCores are not good for minecraft servers, youll need at least 2 or 3... and my experience with OVH vps are not that great when it comes to minecraft

#

2 GHz not great

#

4 GB ram also..... youll be running out quick

#

I would look into purchasing a Kimsufi dedi, kimsufi is child company of OVH and ive heard good things about them

velvet halo
#

Yeah sure I can help you if you want @jolly surge let me add you as friend.

frigid ember
#

yo, is there any sort of packet which allows biome change?

#

I am thinking of making some sort of "event" system in my plugin, and part of this involves changing the color of the sky

#

so if I change the biome to the end biome, the sky will appear grey

#

just can't change the actual biome though, looking to make it clientside

radiant pollen
#

biome info, and the rendering of the sky depending on the biome, is all client side based on loaded world information.

#

You can change the biome of an area, but the player has to reload the world to see the change

finite belfry
#

is there any plugin that i can enchant everything to 1000 for 1.15?

lusty vortex
#

@frigid ember You can fuck with the sky using rain manipulation

#

But you can't exactly replace a biome easily

#

Since it's binded to the chunk

#

A 256 length array in the chunk class contains each block's biome in the chunk

open turtle
#

Is there anyone who knows a good tutorial series to like start coding my own plugins?

#

Without like me just copying and getting no where

dusky herald
#

Honestly just read the Plugin Development tutorial

#

and learn Java @ the Oracle website

#

You aren't going to learn it in a day by any means.

#

But you could easily get a basic plugin started on your first day for sure.

fleet burrow
#

I don't think the point of tutorials is to copy code tbh

#

If you actually want to learn take what's in that tutorial and expand on it, change stuff.

radiant pollen
#

Also, once you have the basics down, don't follow an entire tutorial series. Find tutorials for specific things you want to do. It's more motivating to accomplish things you want to rather than trudging through an entire series just to learn how to do the one thing you really want to do.

finite belfry
#

is there any plugin that can change gamemode on join?

radiant pollen
twin nexus
#

hey

#

someone to help me?

fleet crane
#

?ask

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

twin nexus
#

every time I disconnect my mobs disappear, it happens to me in the iron farm

#

it doesn't matter if they have a nametag, they still disappear

hoary smelt
#

hey , can someone help me ?
when i command /is top , the head is not load the skin but i already use skinrestorer. how can i fix /is top so the head has skin

i use skinrestorer and bskyblock

fleet crane
#

online-mode=true, stop pirating the game

twin nexus
#

every time I disconnect my mobs disappear, it happens to me in the iron farm
it doesn't matter if they have a nametag, they still disappear🙄

radiant pollen
#

@twin nexus You aren't providing enough information. What plugins do you have installed that could be messing with mobs?

twin nexus
#

mmh

#

lagassist

radiant pollen
#

It's probably that then

untold notch
#

Anyone free to assist with something?

naive goblet
#

Sure

untold notch
#

So I am working on this still, I want to give an item to the player after death being the compass...

#

I am unsure how to "cast" or add this to my class

naive goblet
#

So basically keep a compass on death?

untold notch
#

Yeah I want to give the compass on respawn I should say

naive goblet
#

Send current code

untold notch
#

paste bin or plain text

naive goblet
#

Keep it on death or just recieve it again on respawn?

#

Never pastebin

untold notch
#

get it on respawn again

naive goblet
#

Mhm okay

untold notch
naive goblet
#

so

#

Its event.getDrops()

untold notch
#

Oh... so it wasn't getItemDrops... I am still learning this haha and I am clearly bad

naive goblet
#

Its ok (:

velvet halo
#

Equals should only be used with Strings

chrome lark
#

ew

#

er*

#

wut

#

you use what makes sense, .equals is perfectly valid, but given that enums are garaunteed singletons, == works there and is preferred

untold notch
#

gotcha! That is just how I have been learning..

naive goblet
#

@untold notch I could give you some advanced code otherwise just loop through the drops

chrome lark
#

you should have the javadocs for cross-reffing methods on events, etc

velvet halo
#

Shouldn't you loop through the drops when a player dies?

#

rather than respawn?

untold notch
#

@naive goblet advanced code would work haha been on this for about an hour

naive goblet
#
for (ItemStack item : event.getDrops()) {
  if (item.getType() == Material.COMPASS) {
event.getPlayer().getInventory().addItem(item.clone());
}
}```
#

This is simplified lets skip lambdas and consumers this time

#

I might have done something wrong, on mobile

untold notch
#

no worries I will try this

bronze marten
#

Equals should only be used with Strings
@velvet halo bruh no, anything that isn’t a primitive

untold notch
#

for what ever reason it is still wanting me to cast the getDrops event 0.o

naive goblet
#
event.getDrops().stream().filter(item->item.getType() == Material.COMPASS).findFirst(item -> event.getPlayer().getInventory().addItem(item.clone()).orElse(null);```
#

Cast it to what?

untold notch
#

Just recommends adding a cast? Eclipse shows me an error there o.0

naive goblet
#

Try do as they want

bronze marten
#

eclipse

naive goblet
#

What would it add then?

velvet halo
#

getDrops() should return a list of itemstacks.

naive goblet
#

Yes?

velvet halo
#

You shouldn't need to cast it to anything

chrome lark
#

with eclipse, you basically need to save often, otherwise it goes janky

untold notch
#

Gotcha let me truy

#

So for example I have this @EventHandler
public void onDeath(PlayerRespawnEvent event) {
for (ItemStack item : ((Object) event).getDrops()) {
if (item.getType() == Material.COMPASS) {
event.getPlayer().getInventory().addItem(item.clone(Material.COMPASS));

#

The object is placed when I do the recommended "Cast" for eclipse

naive goblet
#

Your casting getDrops

#

Whut

chrome lark
#

cast to object

#

erm...

#

your IDE is being moronic

naive goblet
#

You’re casting event

#

@untold notch I’d recommend switching to IntelliJ

untold notch
#

yeah ikr maybe it is messing up or i am lmao

#

idk how to use it but I will switch and give it a shot

#

seems to be easier when coding plugins for minecraft i guess

naive goblet
#

Its the same but better in my opinion

chrome lark
#

there is a plugin for creating ez maven/gradle projects for plugins

#

minecraft development

untold notch
#

thanks guys ! I will attempt in the morning, its late here have a good one ya all

naive goblet
#

(:

bronze marten
#

rm rf eclipse && wget intelij

round dock
#

:v

bronze marten
#

😳

chrome lark
#

I've tried multiple times to use eclipse for a day to try to understand how people work with it and believe that it's not all that bad

#

I erm...

#

I think my record was 5 minutes

bronze marten
#

Hahahha

#

We had to use it for a course

#

Bcs exams pcs were only with eclipse

#

😑

naive goblet
#

I’d say it saves memory other than that it’s quite not my style

chrome lark
#

well, IJ uses a lot of memory for the PSI, so heavily depends on what you're working on

naive goblet
#

Mhm

#

Well, eclipse has a project view where you can see all your projects at once which I like

bronze marten
#

Intellij can have as much memory it needs ❤️

chrome lark
#

I dislike that heavily

round dock
#

xD

naive goblet
#

For instance say that you work on a framework and another project it wouldn’t be dumb to just being able with 2 clicks or so to switch

#

And not having to wait for a project to reload

chrome lark
#

Pretty sure that there is literally only eclipse and glorified text editors which really preach having a workspace, any other programming software works akin to IJ

#

I can already do that with IJ

naive goblet
#

There is no really overall projects view in IJ?

chrome lark
#

you can have multiple windows open

naive goblet
#

Lol nah that’s just messed up

chrome lark
#

I mean, I also have tabs disabled

naive goblet
#

Interesting

chrome lark
#

So, having two windows makes it a muuuuch easier flow for me

naive goblet
#

Uh I like the eclipse thingy 🤨

zenith siren
#

Does anyone know how to stop a BungeeCord runnable? I got this code but I can't seem to find a way to stop it without stopping all runnables in my plugin

        plugin.getProxy().getScheduler().schedule(plugin, new Runnable() {
            public void run() {
                if(p.getServer() != null) {
                    String serverName = p.getServer().getInfo().getName();
                    BaseComponent message;
                    if(p.hasPermission("arcadia.staffchat")) {
                        message = new TextComponent(Utils.chat("&4&l[STAFF] &c" + p.getName() + " &4joined the network on &c" + serverName + "&4!"));
                        for(ProxiedPlayer player : BungeeCord.getInstance().getPlayers()) {
                            if(player.hasPermission("arcadia.staffchat")) {
                                player.sendMessage(message);
                            }
                        }
                    } else {
                        message = new TextComponent(Utils.chat("&e" + p.getName() + " joined the network on " + serverName));
                        for(ProxiedPlayer player : BungeeCord.getInstance().getPlayers()) {
                            player.sendMessage(message);
                        }
                    }
                    //STOP THE RUNNABLE HERE
                    //STOP THE RUNNABLE HERE
                }
            }
        }, 0, 10, TimeUnit.MILLISECONDS);
naive goblet
#

Use lambdas

bronze marten
#

.schedule returns a taskid, no?

#

With that taskid you can cancel it

naive goblet
#

Do you even need task ids?

chrome lark
#

if you wanna cancel it, yea

naive goblet
#

Isn’t there a cancel method for all tasks like spigot?

bronze marten
#

Yeah i think there’s no method inside a runnable to cancel it from inside

chrome lark
#

Nope

naive goblet
#

Ouch

chrome lark
#

Well, there is one for a plugin

#

oh, actually

#

schedule returns a ScheduledTask

#

So, you can cancel it on that, but, that's not actually passed in, so you'd need to ref it

lofty otter
#

how can I run a code after all plugins are done initializing? Ive got this right now but I dont like the idea of running this code on the first tick

chrome lark
#

there is an event now in the server for that

#

So, if you only need to support latest, can do that, otherwise, scheduler is all you got

naive goblet
#

I think you can define that in plugin yaml

#

Or am I just dumb?

lofty otter
#

are you guys talking to me?

naive goblet
#

Yes

zenith siren
#

So, you can cancel it on that, but, that's not actually passed in, so you'd need to ref it
@chrome lark

I understood everything except this sentence. I made a variable of the returned ScheduledTask but when I do task.cancel() it gives me an error that the variable might not have been initialized yet :/

naive goblet
#

Cable I there is 1 way but its not something you should use

lofty otter
chrome lark
#

Basically, there is no super clean way to do what you wanna do

naive goblet
#

You could load your plugin on start up and then manipulate stuff to make it disable and enables last

chrome lark
#

Using a 0 sized array is generally the goto for that type of stuff, you'd basically need to find some way to throw a reference to the returned task

bronze marten
#

@zenith siren split of the runnable from the task

chrome lark
#

0 index array could work, gross, but, yea...

lofty otter
#

this completeinitialization needs to happen after all plugin constructors have run

#

and after all commands are loaded from the plugin.yml

naive goblet
#

Yeah read what I sent

lofty otter
#

well what do I do concretely

#

what are you suggesting

naive goblet
#

Cable

#

Schedule a synced task otherwise

#

That will run after all plugins perhaps

lofty otter
#

thats what im doing right now

chrome lark
#

Bukkit literally has an event for when the servers about to start ticking

lofty otter
#

^ thats what i need

naive goblet
#

Well plugins can be enabled and disabled here and there, just so you are aware of that.

chrome lark
#

ServerLoadEvent

zenith siren
#

@zenith siren split of the runnable from the task
@bronze marten

Thanks, but how....
This doesn't work because the variable task hasn't even been declared yet

        Runnable runnable = new Runnable() {
            public void run() {
                if(p.getServer() != null) {
                    String serverName = p.getServer().getInfo().getName();
                    BaseComponent message;
                    if(p.hasPermission("arcadia.staffchat")) {
                        message = new TextComponent(Utils.chat("&4&l[STAFF] &c" + p.getName() + " &4joined the network on &c" + serverName + "&4!"));
                        for(ProxiedPlayer player : BungeeCord.getInstance().getPlayers()) {
                            if(player.hasPermission("arcadia.staffchat")) {
                                player.sendMessage(message);
                            }
                        }
                    } else {
                        message = new TextComponent(Utils.chat("&e" + p.getName() + " joined the network on " + serverName));
                        for(ProxiedPlayer player : BungeeCord.getInstance().getPlayers()) {
                            player.sendMessage(message);
                        }
                    }
                    task.cancel();
                }
            }
        };
        ScheduledTask task = plugin.getProxy().getScheduler().schedule(plugin, runnable, 0, 10, TimeUnit.MILLISECONDS);