#help-development

1 messages ยท Page 1459 of 1

granite stirrup
#

lmao

cold tartan
#

ik, because i don't need to with forEach

#

i just wanted to iterate thru it

#

and thats how i did it

#

no i do

ivory sleet
#

no you dont

paper viper
#

^

cold tartan
#

i mean i dont

#

but whatever

ivory sleet
#

you can use the higher order function forEach, fori and for each

paper viper
#

The ONLY reason to use iterator is cause of removing while iterating. Otherwise you are basically taking away performance

cold tartan
#

ohhhh

#

ok

paper viper
#

for each loop

quaint mantle
cold tartan
#

ok fixed it

#

wdyum

paper viper
cold tartan
#
    @EventHandler
    public static void onExplosion(EntityExplodeEvent event) {
        HashMap<Block, Material> reset = new HashMap<>();

        event.blockList().forEach(b -> {
            reset.put(b, b.getType());
            b.setType(Material.BEDROCK);
            event.setCancelled(true);
        });

        event.getLocation().getWorld().createExplosion(event.getLocation(), 4F);

        reset.forEach((b, m) -> b.setType(m));
    }
#

there is the code but better

quaint mantle
cold tartan
#

why tho

paper viper
#

they are the same speed actually

cold tartan
#

wait shoot

quaint mantle
#

well yes, because enhanced for loops compile to iterator

cold tartan
#

i screwed up

#

i forgot to add the if statement back

#

there we go

#

now its actually fixed

#
    @EventHandler
    public static void onExplosion(EntityExplodeEvent event) {
        HashMap<Block, Material> reset = new HashMap<>();

        event.blockList().forEach(b -> {
            if (!(Bedwars.weakBlocks.contains(b.getType()))) {
                reset.put(b, b.getType());
                b.setType(Material.BEDROCK);
            }
        });

        event.getLocation().getWorld().createExplosion(event.getLocation(), 4F);

        reset.forEach((b, m) -> b.setType(m));

        event.setCancelled(true);
    }
paper viper
#

static abuse

#

๐Ÿ˜ซ

quaint mantle
#

Do static event handlers even work..?

paper viper
#

they shouldnt

#

i just noticed that as well

quaint mantle
#

Block::setType though ๐Ÿ˜Œ

granite stirrup
#

how do i make a command that reloads my plugin

cold tartan
#

cuz, that way it treats it like obsidian (blocks behind it relative to the explosion aren't exploded)

granite stirrup
#

uh

#

wtf my item is gone when i clicked on it XD

cold tartan
granite stirrup
#

in a gui

granite stirrup
#

aNd i just want to reload my plugn

obsidian tree
#

how can i cancel riptide

cold tartan
#

PlayerRiptideEvent

#

@obsidian tree

obsidian tree
#

there is no setCancelled() method

cold tartan
#

oh

#

i thought there was srry

obsidian tree
#

only way to cancel is using DataWatcher

#

and i don't know how to use

cold tartan
#

yep thats intentional

#

i want the weak blocks destroyed, and all the other blocks treated like obsidian (the blocks behind them wont get destroyed)

#

it does tho

#

like in game, it works

#

that is intentional

#

thats what i want

#

so that only weak blocks can be destroyed

#

no, it is intentional, that way the explosion treats it like its bedrock

ivory sleet
#

lol

cold tartan
#

so the blocks behind it dont get destroyed

paper viper
#

lol

cold tartan
#

yes

paper viper
#

you know, you can skip the vanilla mechanic and jump directly to setting which blocks are exploded or not...

cold tartan
#

because the way i had it before blocks behind unbreakable blocks would still get destroyed

paper viper
#

oh

cold tartan
#

and to fix that, i did what i did

paper viper
#

Yeah that isn't fun to code

granite stirrup
cold tartan
#

exactly, PulseBeat_02 the only other way i could fix it is by ray tracing the explosion myself and that seems painful, so i used vanilla which did that for me

granite stirrup
#

what happend

#

i think i broke viaversion

cold tartan
#

ok

#

is there a way to disable block updates for a short amount of time?

#

wait

#

i have a much better way of doing what i did

#

lmfao

#

i just have a list of blocks placed by a player

#

and if the block isnt in blockList then i remove it

#

lmfaoooooooooooooo

ivory sleet
#

when ur brain is too big to physically fit

paper viper
#

๐Ÿคก

cold tartan
#

should events not have static?

dusk flicker
#

they should not.

dusty herald
#

I'm sorry what

paper viper
#

lol

cold tartan
#

idk this tutorial i watched told me to put them in

snow bane
#

hey so i have this class that has a constructor and an event i want to register right

#

but i can register it because the constructor passes other variables other than the main file

#

i cant register events from this class because it requires different variables in the constructor

#

and also this class is meant to be extended

paper viper
#

alright i would bash on you any day

#

about a ton of stuff

#

but im confused from what you are asking tho

#

are you trying to make Scoped_Rifle be an event too?

dusk flicker
#

you really shouldent be putting listeners in object classes tbh

#

also you need to follow naming conventions

paper viper
#

Yeah

#

fuck it i will just say it

cold tartan
#

hmmmmmmm, im getting a CME with this:

    @EventHandler
    public void onExplosion(EntityExplodeEvent event) {
        for (Block b : event.blockList()) {
            if (!(placedBlocks.contains(b))) {
                event.blockList().remove(b);
            } else {
                placedBlocks.remove(b);
            }
        }
    }
paper viper
#
  1. stop using public fields and start using more private fields
  2. Name your variables and classes better. Instead of mag_size, name it magSize. Always name it camelcase. Your class has to be PascalCase, so instead of Scoped_Rifle do ScopedRifle.
  3. stop using static when you don't have to
dusk flicker
#

but you got to provide us with the error my dude

cold tartan
#
  1. Keep your name forever i love it
paper viper
sturdy elk
#
  1. How i can filter META-INF :v?
paper viper
#

maven or gradle

#

?

dusty herald
#

what is wrong with meta inf ๐Ÿ˜ญ

dusk flicker
#

What do you mean filter

sturdy elk
#

maven

dusty herald
#

remove it from the compiled jar ig

dusk flicker
#

I feel like thatd be an XY

sturdy elk
#

e :v?

paper viper
#

if it is from the shading plugin

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>2.4.1</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals>
                <goal>shade</goal>
            </goals>
            <configuration>
                <filters>
                    <filter>
                        <artifact>*:*</artifact>
                        <excludes>
                            <exclude>META-INF/maven/**</exclude>
                        </excludes>
                    </filter>
                </filters>
            </configuration>
        </execution>
    </executions>
</plugin>

use filters

cold tartan
paper viper
#

but if you arent using shade plugin, then its an xy problem likely

paper viper
#

You

#

Cannot

paper viper
#

Remove

#

Elements

#

During

#

Looping

sturdy elk
#

a

paper viper
#

more specifically like the for/foreach loops

dusk flicker
#

Alic what the fuck are you saying

#

'capo' etc?

sturdy elk
#

it's spanish uh

cold tartan
paper viper
#

As mentioned above... iterator

dusty herald
#

mystical magic called ๐Ÿ‘ learn ๐Ÿ‘ java ๐Ÿ‘ before ๐Ÿ‘ apis

paper viper
#

^

cold tartan
#

but this still throws:

    @EventHandler
    public void onExplosion(EntityExplodeEvent event) {
        Iterator<Block> iterator = event.blockList().iterator();

        while (iterator.hasNext()) {
            Block b = iterator.next();
            if (!(placedBlocks.contains(b))) {
                event.blockList().remove(b);
            } else {
                placedBlocks.remove(b);
            }
        }
    }
dusk flicker
#

^^

paper viper
#

ok

dusk flicker
#

dear lord

paper viper
#

idk what to say

#

lmao

dusk flicker
#

learn java please

#

this is fucking basic

paper viper
#

you arent using iterator correctly

cold tartan
#

oh

dusk flicker
#

you physically CANNOT remove something from an immutable list

paper viper
#

event.blockList().remove(b);

cold tartan
#

i think that was how conclure told me

paper viper
#

?

#

What?

snow bane
#

yeah im used to using python so i use the python naming convention a lot by accident

paper viper
#

ic

cold tartan
dusk flicker
#

Not like that

snow bane
#

and for the static thing it fixed an error with creating a variable before the "super"

dusk flicker
#

static really shouldent fix anything

#

Thats a poor excuse / solution

paper viper
#

didn't md say blockList was mutable tho?

snow bane
#

fixed it somehow

#

idk

cold tartan
dusk flicker
#

ima check this

paper viper
cold tartan
#

im mutated it before

paper viper
#

but you arent mutating it correctly

#

if that makes sense

cold tartan
#

it does

dusk flicker
#

It doesn't say shit about mutable/non in the JD

cold tartan
#

so how would i mutate it correctly?

snow bane
#

ok wait so is there a way for me to register the class as an event?

dusk flicker
#

it may be the placedBlocks.remove(b);

snow bane
#

or do i have to rewrite shit

paper viper
#

Ok just saying, I REALLY shouldnt be having to spoonfeed this to you

dusk flicker
#

?spoon

queen dragonBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

paper viper
#

lmao

snow bane
#

@cold tartan wait so whats ur problem exactly

#

oh nvm

cold tartan
#

is there a way to get the max of an explosion size?

#

like the max block list of an explosion

wraith rapids
#

define max

cold tartan
#

like you know how explosions are (partially) random

#

like in the blocks they break

wraith rapids
#

yes

cold tartan
#

like how that is random

wraith rapids
#

yes

cold tartan
#

is there a way to get the max range that it breaks?

wraith rapids
#

the range depends on the explosion power and block hardness

#

so not really

cold tartan
#

ok

wraith rapids
#

you could maybe look into nms to find or come up with a math function that roughly estimates it for a given hardness

cold tartan
#

the number i found (not counting hardness) is 1.3 * power

wraith rapids
#

what are you trying to do anyway

cold tartan
#

hard to explain

#

it would take a decent amount of time

#

is that ok?

wraith rapids
#

it's not like i have to read it

cold tartan
#

i could explain it in a voice chat if u want

#

that way it goes faster

wraith rapids
#

write it down and someone might read it at some point

cold tartan
#

ok

#

so at the core, what im trying to do is make explosions only break certain block

#

but the way i do it doesn't account for randomness

#

the way i do it is I get the blocklist of an EntityExplodeEvent, then I take all of those blocks that aren't in my list of explodable blocks and set them to bedrock

#

then i cancel the original explosion, and create a new one

#

then i set all the blocks that i set to bedrock back to what they originally were

#

the issue is, the blockList of the original explosion can be different from the blockList of the new explosion, which causes some blocks to still explode

wraith rapids
#

can't you just remove the blocks from the list to make them not blow up

#

it's mutable iirc

cold tartan
#

that wouldnt work, lemme explain why

#

if i did that then the blocks behind the non-explodable blocks would still be exploded because the explosion raytracing would not treat the blocks like bedrock/obsidian

wraith rapids
#

do your own raytraces and remove them from the list if they're blocked

cold tartan
#

thats what im trying to avoid

#

but if you think its necessary I guess i could

#

it just seems very hard

wraith rapids
#

yeah well it's still infinitely better than running around creating several explosions and setting shit to bedrock

cold tartan
#

no its only 1 extra explosion

wraith rapids
#

you don't even need to access the world, you just need to check whether any given block in the list is blocked by a block you've removed from the list

#

a good excercise in how to vector math and do spatial logic if nothing else

cold tartan
#

fair point

#

i would also have to research minecraft's explosion system

#

and get all the rays that it uses

#

as well as how it does hardness

wraith rapids
#

not necessarily

cold tartan
#

wdym

wraith rapids
#

or well i don't really remember how explosions work but iirc it's pretty trivial

#

just a plain raytrace checking whether there are obstructing blocks in between the center of the block being tested and the center of the explosion will probably be enough

cold tartan
#

but i would need to detect hardness because blocks can be destroyed 2+ deep

wraith rapids
#

by obstructing blocks i mean your special whatever blocks that you removed from the list

#

the server has already done the calculations for the other blocks

#

the only change that removing them should make is to prevent blocks from blowing up

#

and the only blocks that are prevented from blowing up are the blocks you remove

#

and the blocks that are shielded by the blocks that you removed

#

therefore; raytrace outward from each removed block and then protect those blocks as well

cold tartan
#

i see

#

ok, so how would you ray trace from those removed blocks?

#

i know how to raytrace from where entities are looking, but im not sure how to continue the line between the tnt & the block

wraith rapids
#

i'd probably draw a line from the center of each block to the center of the explosion, and see if it intersects with any of the blocks I removed from the list

#

which would involve writing my own simple raytrace function, but that is quite easy

#

the alternative method is to get the distance of the removed block from the explosion center, normalize, and then repeatedly add the normalized distance to the location of the block

#

drawing an outward stretching line of blocks starting from the removed block

#

and then calling .remove on the list or set or whatever with each iteration

#

the results aren't as good and the performance is probably a bit worse if you have a lot of removals for a large explosion

#

but it should still be 'fine'

sweet oak
#

Hello, So recently I learn java. But I am having to figure out how the plugin.yml works and tutorials on yt arent helping. I am looking for anyone that could help me or spigot example plugin that is working on 1.16.5. The server keep saying unable to find main class

wispy fossil
#

share your plugin.yml and project hierarchy

sweet oak
#

thanks

sweet oak
sage swift
wispy fossil
#

nonono

#

send a screencap of ur plugin.yml

#

and also

#

your project hierarchy

#

like that

sweet oak
#

here sorry i had to verify first

sage swift
#

send a screencap of ur plugin.yml

sweet oak
sage swift
#

lol

sweet oak
#

this?

sage swift
#

does ServerCore extend JavaPlugin?

sweet oak
#

yes

sage swift
#

hmm do you see the problem

#

i do

sweet oak
#

no

#

I am new to java

sage swift
#

how is it not showing an error

#

you have two public class ServerCore

#

class within a class

#

mismatched brackets

#

how did it even compile

sweet oak
#

lol

sage swift
#

also it really should be a maven project

sweet oak
sage swift
#

well you made your first plugin project that way

#

but it basically does all the building for you

sweet oak
#

its not working

sage swift
#

and adds dependencies

sweet oak
#

oh ok

sage swift
#

"its not working" is not enough for us to help you. ideally, you would explain what you changed and what the current problem is

sweet oak
#
org.bukkit.plugin.InvalidPluginException: Cannot find main class `ca.imperialskies.core.SpigotPlugin'
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:69) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:145) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:382) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:224) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:928) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.ClassNotFoundException: ca.imperialskies.core.SpigotPlugin
    at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:138) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:519) ~[?:?]
    at java.lang.Class.forName0(Native Method) ~[?:?]
    at java.lang.Class.forName(Class.java:466) ~[?:?]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:67) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    ... 8 more
sweet oak
sage swift
#

yes you explained that the problem was that the main class was not found

sweet oak
#

so? what am I looking for

sage swift
#

did you change anything?

sweet oak
#

like fix the correction?

sage swift
#

and after recompiling and replacing the plugin it still shows the error?

sweet oak
#

yes

sage swift
#

well it's private

sweet oak
#

oh lol didnt know

sage swift
#

but in any case you should switch to maven

sweet oak
#

there

wispy fossil
sweet oak
wispy fossil
#

ooh there it is

sweet oak
#

yep thanks btw

wispy fossil
#

is it working now or no?

sweet oak
#

no its not

wispy fossil
#

org.bukkit.plugin.InvalidPluginException: Cannot find main class `ca.imperialskies.core.SpigotPlugin'
says SpigotPlugin
class name is ServerCore
but in your repo's plugin.yml the class name is right
did you try again after fixing this?
or is it the same error?

sweet oak
#

My brain is like so tried rn i am sorry for these stupid mistakes

wispy fossil
#

lol np im tired asf too
can u try running the plugin on the most recent code, and paste the stack trace?
looks like the error in the link above doesnt match up with what's in the plugin yml

sweet oak
#

it says Server core not SpigotPlugin

wispy fossil
#

yep

sweet oak
#
org.bukkit.plugin.InvalidPluginException: Cannot find main class `ca.imperialskies.core.SpigotPlugin'
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:69) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:145) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:394) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:301) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:382) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:224) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:928) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.ClassNotFoundException: ca.imperialskies.core.SpigotPlugin
    at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:138) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:99) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:519) ~[?:?]
    at java.lang.Class.forName0(Native Method) ~[?:?]
    at java.lang.Class.forName(Class.java:466) ~[?:?]
    at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:67) ~[server.jar:3076-Spigot-9fb885e-1e8c432]
    ... 8 more```
wispy fossil
#

send me a screenshot of the file plugin.yml in Eclipse

sweet oak
wispy fossil
#

move the ServerCore.java up so it's right under the package core (out of the folder)
then, set your main: in the plugin.yml to:
ca.imperialskies.ServerCore

#

idk my best guess is that the package is reading itself without any classes
so it doesnt think your ServerCore.java is part of the core package

#

the white icon usually means empty

sweet oak
#

ok

wispy fossil
#

send the same screenshot after youve done that

sweet oak
wispy fossil
#

yes

sweet oak
wispy fossil
sweet oak
#

btw do permission get set in the plugin.yml or the code or both?

candid galleon
#

both

sage swift
#

although if you want to set a direct command permission you can set it only in the plugin.yml i believe

worldly ingot
# wispy fossil

This means that the folder isn't part of the build path btw. "ca/imperialskies" is but "core" is not

sweet oak
#

thanks

merry cargo
#

can anyone help me? I can't run my plugin, and this is the error code

#

[ERROR] Could not load 'plugins/test.jar' in folder 'plugins'

quaint mantle
#

show the full error

weak mauve
#

why my .xml broke any1 can help me?

quaint mantle
weak mauve
#

like

quaint mantle
queen dragonBOT
weak mauve
quaint mantle
#

whats the error

weak mauve
#

timed out

#

when downloading dependencies

weak mauve
#

1,8

quaint mantle
#

How to get offline player's name?Bukkit.getOfflinePlayer(uuid).getName() it returns uuid ๐Ÿ˜ฆ

sage swift
#

it shouldnt return the uuid if it's a valid player

weak mauve
sage swift
#

well 1.8 is an unsupported version so ยฏ_(ใƒ„)_/ยฏ

quaint mantle
sage swift
#

why not just use 1.8 spigot repo

weak mauve
#

can u give me or edit the pom.xml for me, i jsut lost in finding spigot one

sage swift
#

remove the bukkit dependency

weak mauve
#

let me see

merry cargo
# quaint mantle show the full error

[WARNING] Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!

[WARNING] Legacy plugin HellowWord v1.16.5 does not specify an api-version.

[ERROR] Could not load 'plugins/test.jar' in folder 'plugins'

quaint mantle
#

you need to put the api-version in the plugin.yml

merry cargo
#

like this?

weak mauve
#

um

#

i removed

#

still said error

#
Failed to execute goal on project Spectaculation: Could not resolve dependencies for project Spectaculation:Spectaculation:jar:1.0-SNAPSHOT: Failure to find net.citizensnpcs:citizens:jar:2.0.27 in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of spigotmc-repo has elapsed or updates are forced -> [Help 1]
#

halp

sage swift
quaint mantle
#

they dont listen

#

i said show the full error

weak mauve
#

@quaint mantle can you, check out the error for me? Its ok if u dont wanted to

#

its said "Missing Artifacts"

#

WHEN i remove bukkit from dependencies

#

this happended

#

package net.minecraft.server.v1_8_R3 does not exist

weak mauve
#

i have swapped to spigotmc

#

still

restive mantle
#

perhaps you have to add -SNAPSHOT to the maven version of citizens

weak mauve
#

the problem here is the spigot mc

#
   <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
        <repository>
            <id>everything</id>
            <url>https://repo.citizensnpcs.co/</url>
        </repository>
        <repository>
            <id>enginehub-maven</id>
            <url>http://maven.enginehub.org/repo/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
         <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>craftbukkit</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
restive mantle
#

so its saying it can't resolve spigot-api?

weak mauve
#

the pom.xml displays no error

#

but when complie

#

it said there is no minecraft

restive mantle
weak mauve
#

this

#

want to see pom.xml

restive mantle
#

I'd like to see the error perferably

weak mauve
#
[10:50:41 INFO]: [Spectaculation] Enabling Spectaculation v1.0-SNAPSHOT
[10:50:41 ERROR]: Error occurred while enabling Spectaculation v1.0-SNAPSHOT (Is it up to date?)
java.lang.Error: Unresolved compilation problem: 
    Unhandled exception type ClassNotFoundException

    at me.superischroma.spectaculation.Spectaculation.onEnable(Spectaculation.java:129) ~[?:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:414) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:378) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:333) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:263) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot.jar:git-Spigot-db6de12-18fbb24]
    at java.base/java.lang.Thread.run(Thread.java:832) [?:?]
#

this

#

and heck tons of errors

restive mantle
#

what class is line 129 referring to

weak mauve
#

i cannot send picture here

#

but

#

let me upload pic

restive mantle
#

ok

weak mauve
restive mantle
#

huh?

weak mauve
#

i want craftbukkit in my plugins

#

so

sage swift
#

spigot

#

is a fork of bukkit

#

it has everything bukkit has and more

restive mantle
#

yeah

#

you don't need craftbukkit if you have spigot

weak mauve
#
[WARNING] Spectaculation-1.0-SNAPSHOT.jar, bukkit-1.8.8-R0.1-SNAPSHOT.jar, commons-lang-2.6.jar, ebean-2.8.1.jar, gson-2.2.4.jar, guava-17.0.jar, hamcrest-core-1.1.jar, json-simple-1.1.1.jar, junit-4.10.jar, persistence-api-1.0.jar, snakeyaml-1.15.jar, sqlite-jdbc-3.32.3.2.jar define 1 overlapping resource: 
[WARNING]   - META-INF/MANIFEST.MF
[WARNING] commons-lang-2.6.jar, persistence-api-1.0.jar define 1 overlapping resource: 
[WARNING]   - META-INF/LICENSE.txt
[WARNING] hamcrest-core-1.1.jar, junit-4.10.jar define 22 overlapping class and resource: 
[WARNING]   - LICENSE.txt
[WARNING]   - org.hamcrest.BaseDescription
[WARNING]   - org.hamcrest.BaseMatcher
[WARNING]   - org.hamcrest.CoreMatchers
[WARNING]   - org.hamcrest.Description
[WARNING]   - org.hamcrest.Factory
[WARNING]   - org.hamcrest.Matcher
[WARNING]   - org.hamcrest.SelfDescribing
[WARNING]   - org.hamcrest.StringDescription
[WARNING]   - org.hamcrest.core.AllOf
[WARNING]   - 12 more...
[WARNING] maven-shade-plugin has detected that some class files are
[WARNING] present in two or more JARs. When this happens, only one
[WARNING] single version of the class is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
[WARNING] See http://maven.apache.org/plugins/maven-shade-plugin/
[INFO] Replacing original artifact with shaded artifact.
[INFO] Replacing /Users/giakhanh/Documents/Spectaculation-main 3/target/Spectaculation-1.0-SNAPSHOT.jar with /Users/giakhanh/Documents/Spectaculation-main 3/target/Spectaculation-1.0-SNAPSHOT-shaded.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ Spectaculation ---
[INFO] Installing /Users/giakhanh/Documents/Spectaculation-main 3/target/Spectaculation-1.0-SNAPSHOT.jar to /Users/giakhanh/.m2/repository/Spectaculation/Spectaculation/1.0-SNAPSHOT/Spectaculation-1...
#

annd its said build success

#

but cannot execute

#

:/

sage swift
#

what lol

#

?paste first of all

queen dragonBOT
weak mauve
#

ok

restive mantle
#

well it successful because their warnings

#

not errors

weak mauve
#

pom.xml

restive mantle
#

which output file are you using

weak mauve
#

.jar

restive mantle
#

shaded or not

weak mauve
#

yes

#

shaded

restive mantle
#

so this one? Spectaculation-1.0-SNAPSHOT.jar

weak mauve
#

ye\

#

ingame its like this plugins (2) Specta, worldedit

#

still recognized as a plugin

restive mantle
#

have you opened the jar to check it has all the classes that you made?

weak mauve
restive mantle
#

well one thing might be that your not shading anything

weak mauve
#

sooo where its making errors, this is an abandoned plugin, i added something and doesn't know how to complie

#

:/

restive mantle
#

I mean I could be wrong but in order for things to be shaded you have to set up relocations within the shade plugins config

weak mauve
# restive mantle I mean I could be wrong but in order for things to be shaded you have to set up ...

maven-shade-plugin has detected that some class files are
[WARNING] present in two or more JARs. When this happens, only one
[WARNING] single version of the class is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
[WARNING] See http://maven.apache.org/plugins/maven-shade-plugin/

#

?????

#

the problem said is "net.minecraft cannot be resolved"

restive mantle
#

where at? within the build or on the server console?

weak mauve
#

the source code

sage swift
#

well yeah if you use the spigot api it's not gonna fuckin work

weak mauve
#

ik

#

so im finding craft bukkit

sage swift
#

?bt you need to use this

queen dragonBOT
weak mauve
#

ok

#

then next?

#

i want to merge this to the code, how

sage swift
#

remove bukkit dependency

#

change spigot-api to spigot

weak mauve
#

then move the retirved file to?

weak mauve
sage swift
#

did you run buildtools or just download it blindly

weak mauve
#

run buildtools

#

oh

#

no

#

download

sage swift
#

should be good to follow my instructions then

weak mauve
sage swift
#

congratulations, you are running buildtools

weak mauve
#

gud

wispy fossil
#

yo quick (non spigot) question,
im messing with a silly project and I have almost no networking experience

any tools out there to create a bridge between a local Java applet, and a remote Node server?

I'm completely unfamiliar in this territory and I don't know what direction to take.
And before ya say it, a 'quick google search' aint helpin

restive mantle
wispy fossil
#

ooh a good thought
i have almost no idea where to go with that
but it's a start
ty

restive mantle
#

I found spark/jetty to be good for websockets

wispy fossil
#

ty

subtle kite
#

Anyone have any tips or anything to set up a config...I tried a lot of youtube videos and websites , but nothing really helped me.

eternal oxide
subtle kite
#

ok thanks ,
funny thing is I already looked @ like 3 differn't spigot config stuff

wispy fossil
wispy fossil
lusty cipher
#

Is there like a way I could "save" or reference a class/string inside a Inventory so I can later identify the inventory by it?

sage swift
#

implement InventoryGUI

eternal night
#

Or if you don't use a random library, you could implement your own InventoryHolder

quaint mantle
#

That's the unsupported usage of api ๐Ÿ˜›

lusty cipher
eternal night
#

So is reflection XD

lusty cipher
#

it seems like a good idea

eternal night
#

To be honest, a Map<Inventory,X> works great

quaint mantle
eternal night
#

InventoryCloseEvent to clean the map

#

And you are good

lusty cipher
#

too much unnecessary work

quaint mantle
#

๐Ÿคจ

eternal night
#

Ahhaaa. Unnecessary work is the basic idea of spigot API what are you talking about

lusty cipher
#

implementing InventoryHolder seems simpler and a more object oriented approach

#

and having a Map would be finicky and very error prone

eternal night
#

I mean custom inventory holder seems fine too yeah

quaint mantle
#

Nah its hacky api usage of interface thst wasnt designed to be implemented by plugins

sage swift
#

and yet it has worked in every case ๐Ÿ‘€

eternal night
#

So XD I don't see your point

#

Isn't even marked for depreciation

#

They tried to remove it in a PR once, failed.

quaint mantle
#

What will happen if md_5 will add some new methods in this interface?

eternal night
#

You are fucked

#

ยฏ\_(ใƒ„)_/ยฏ

lusty cipher
#

I mean realistically they will rarely just fuck over so many plugins by changing a interface so drastically

quaint mantle
#

Works != good

eternal night
#

Eh, I mean the interface is specifically not to be implemented XD

#

Like manya is right, this is not supposed to be used

#

So I wouldn't count on spigot not changing it

#

It's like saying "oh sure that NMS method won't change because people use it"

#

Tbh I hadn't had any issues with a straight up map approach

#

If you are increadiblty scared of leaking inventories you can also periodically cleanse the map

lusty cipher
#

well my issue is currently: I allow the server admin to change inventory names and translations and stuff.
And up to this point I have been identifying the inventories in the clicks/closes by their name, so this has been getting a bit dirty.
And if the name Strings are the same, it's impossible to distinguish...

#

But using a map with Map<Inventory, Class> wouldn't work, would it?

weak mauve
#

hello

#

i have issues

#

again

lusty cipher
#

cause there would possibly be many many copies of different Inventory of the same Class.

eternal night
#

So?

lusty cipher
#

which would lead to it being hard to manage and unnecessary memory and speed wasting

weak mauve
#

its doesn't want to workat all! Any1 tell me how i can complie a craftbukkit plugin

#

i tried bukkit repos

eternal night
#

A hashmap has O(1) lookup

weak mauve
#

but its gone

eternal night
#

Not much of a speed issue

#

Memory wise, idk how many inventories you open simultaneously, but eh

#

You are removing inventories from the map the second they are closed/no longer displayed

lusty cipher
#

I imagine a lot of code

eternal night
#

I haven't looked at an inventories hashcode function but I can't imagine that speed difference actually being an issue

sage swift
#

definitely do not use the name of the inventory to find the one you need

#

what if someone renames a chest to it?

lusty cipher
#

I just figured, as I have implemented a inventory state system, I could maybe cache the handler class' in there and change it

lusty cipher
eternal night
#

I mean, tbh inventory holder hasnt changed in a long time. You can use it XD just know that it might be changed

#

Keep an eye out for changes in new releases

#

And update things accordingly if you use InventoryHolder

lusty cipher
quaint mantle
#

Spigot may be just disable custom inventoryholder implementations, like they did with Recipes or MaterialChoices, for example

eternal night
#

I mean, check in with new changes on the spigot sourc code repositories

#

Tho breaking changes like this are usually only to be expected with a new version

#

Breaking things like this mid version is doubtful

quaint mantle
#

hi how can i set timeout to 1 second in this code?

String hostname = instance.getConfigHandler().CONNECTION_MYSQL_HOSTNAME;
                int port = instance.getConfigHandler().CONNECTION_MYSQL_PORT;
                String database = instance.getConfigHandler().CONNECTION_MYSQL_DATABASE;
                String options = "?autoReconnect=true";
                String username = instance.getConfigHandler().CONNECTION_MYSQL_USERNAME;
                String password = instance.getConfigHandler().CONNECTION_MYSQL_PASSWORD;

                String connectionString = "jdbc:mysql://"+hostname+":"+port+"/"+database+options+"&user="+username+"&password="+password;
                Properties properties = new Properties();
                properties.put("connectTimeout", "1000");
                con = DriverManager.getConnection(connectionString, properties);
#

or like not make it to reconnect 3 times

visual tide
#

can i use Objects#equals if i want to check if two materials are the same?

eternal night
#

I think there is an initial timeout you can set using DriverManager#setLoginTimeoit

quaint mantle
#

okay

eternal night
#

Obviously that only works for the initial creation of the connection

#

I think other timeouts are specific to the statements ?

quaint mantle
#

maaybe socketTimeout?

visual tide
eternal night
#

There is this

quaint mantle
#

oh nice ill try

eternal night
#

On a statement level tho XD

#

Which is a yikes

quaint mantle
#

oh

#

i need something for DriverManager or Connection

eternal night
#

This seems to be the method for you then

quaint mantle
#

what do i put into the executor thing?

eternal night
#

Idk XD

quaint mantle
#

me too xd

lusty cipher
#

The "Creating a GUI with the Spigot API" article on the wiki references libraries of which all I've checked implement InventoryHolder

quaint mantle
#

oh nice found smthing

eternal night
#

Just because they use it doesn't mean it's right XD

#

It's a common way to do it, just not supported

lusty cipher
#

I mean if the Spigot Wiki acknowledges their existence and their usage, I doubt they'd just fuck all of them over

eternal night
#

If you wanna believe that XD

#

Tbh with spigots healthy obsession with backwards compatibility you are probably right

lusty cipher
#

yeah imagine like 1.18 releasing and all of the old stuff to just be gone

#

I'd imagine they'd be deprecated but who cares if I am calling deprecated functions if they work

eternal night
#

Doesn't seem like a problem for me

#

Tbh plugins that are not maintained and don't update to new API standards might not be a very good choice for usage in the first place

lusty cipher
#

yeah obviously

sage swift
#

big releases like 1.10 and 1.20

eternal night
#

Hence I wouldn't have much of an issue with things being gone lol

lusty cipher
#

and if they deprecate it, I would figure they'd supply us with a new alternative option

eternal night
#

maybe ยฏ\_(ใƒ„)_/ยฏ

#

Oh btw @quaint mantle what executor did you use

quaint mantle
#

Executors.newFixedThreadPool(1)

eternal night
#

Ah okay

quaint mantle
#

yea

eternal night
#

It would be interested to know what executed the jdbc connections use by default

#

Tho I guess that differs from jdbc impl to impl

keen kelp
#

how do I combine TextComponent's

quaint mantle
#

cuz like everytime i use my reload method it duplicates messages

vague mason
#

Never use reload command XD

quaint mantle
#

just test server with viaversion and my plugin so i dont mind

eternal night
#

Is that your plugin ?

quaint mantle
#

yes

eternal night
#

I mean I don't know what it would send twice. Must be faulty logic somewhere in your code base then

quaint mantle
#

idk bcz like it should overwrite the string

eternal night
#

where are you removing your listeners o.O

quaint mantle
#

nowheree xd

eternal night
#

if you have custom reload logic you might wanna do that

quaint mantle
#

yea

#

thought of that before

eternal night
#

could maybe also explain double sending

#

maybe some listeners are doing funky action

quaint mantle
#

Event.getHandlerList.unregister(Listener) unregisters listener right?

eternal night
#

I think just HandlerList.unregisterAll or something

quaint mantle
#

never did that

#

okay

eternal night
#

wait not all xD

#

that is all listeners

#

I lied

#
HandlerList.unregisterAll(myListenerInstance);
#

obviously means you will need to store your listener instances somewhere

quaint mantle
#

oh

#

okay

eternal night
#

or if you wanna remove all listeners registered by your plugin

#

there is HandlerList.unregisterAll(myPluginInstance)

quaint mantle
#

oh nice that will be better

eternal night
#

Yea just means you will have to register everything again

quaint mantle
#

oh nice it works

#

thank you

eternal night
#

np

quaint mantle
#

umm how can i make maven to not put some of my dependencies not in jar?

eternal night
#

maven shade plugin should not compile dependencies marked with the provided scope

#

if you need further customisation, lookup the maven shade plugin excludes/includes

quaint mantle
#

i did set it all to provided

weak mauve
#

any1 willing to complie a plugin for me :/ just ask

sage swift
#

you can do it yourself, we've given you solutions to all your problems

weak mauve
#

the error spam me to death

#

i know how to code, but complie, no

#

strange

quaint mantle
#

what error

#

@weak mauve

weak mauve
#

its like, don't even wanted to run

#

no craftbukkit?

#

even i added them

quaint mantle
#

wanna go voicecall and screenshare?

sage swift
#

lol

quaint mantle
#

just to screenshare not to talk or anything

weak mauve
#

ok

#

DM

quaint mantle
weak mauve
#

i cant stream here

#

F

quaint mantle
#

oh

#

me too

weak mauve
#

dm

quaint mantle
#

lets just dm

weak mauve
#

lol

grave kite
#

is it possible to limit markers on maps? It can be exploited to lower client's fps significantly

quaint mantle
#

Is editing spigot/paper jar and using allowed?

visual tide
#

can i just .toString to get the items name from material

#

@quaint mantle i mean like ACACIA_BOAT

chrome beacon
quaint mantle
#

spigot copy pasted nms to their jar

#

but why I cant copy and paste?

chrome beacon
#

You can do it in the same way as them

quaint mantle
#

ah thanks you!

#

I have question too

#

what does fork mean?

#

I guess it means edit

junior tinsel
#

Fork does not equal edit.

quaint mantle
#

hmm ok

#

can you tell me what does mean?

junior tinsel
#

You basically โ€œforkโ€ the repository or code to your own namespace, your own version which you then can edit in any way you want without affecting the original repository or code.

#

I assume you ask this because of a git reference? If you search Git you can see some basic terms and what they mean.
It has to do with version control.

quaint mantle
#

ah thanks you!

#

hmm

#

I have question

#

you said -> "affecting the original repository or code." did you mean that I can't remove original code?

#

like Bukkit.broadcastMessage()

#

or change name

#

example: Bukkit.broadcastMessage() -> Bukkit.hehehe()

chrome beacon
#

No

junior tinsel
#

I missed some context to your original message. But if your talking about โ€œforkingโ€ a project. You can do whatever you want with the code after that. Itโ€™s your own version.

#

Forking does not mean that you can add methods to the Bukkit class.

quaint mantle
#

ahhh so I can't add / remove / change method in original class or package?

#

but i can create class

#

and package

junior tinsel
#

I scrolled back a little bit. You were walking about forking bukkit? Yeah then you could add everything you like to it. Also methods.

#

Thatโ€™s the theory. If you want to do that, I doubt it ๐Ÿ˜›

quaint mantle
#

thanks you

quaint mantle
#

how can i get the server/plugins/ folder?

eternal night
#

Probably use Server#getWorldContainer

#

And then append /plugins

quaint mantle
#

okay ty

eternal night
#

Don't know if that location can actually change tho

#

ยฏ\_(ใƒ„)_/ยฏ

wraith rapids
#

you get the parent directory of your plugin directory

#

both the world container and the plugin directory locations can be changed arbitrarily

quaint mantle
#

okay

keen kelp
#

how do I make intellij auto-upload the artifact to sftp

eternal night
#

you use google

keen kelp
#

I think I did find this page

wraith rapids
#

the next step is to read it

keen kelp
#

I followed it and set the sftp server up, but what do I do with it

wraith rapids
#

what

#

you upload the shit to the sftp

#

isn't that what you want

keen kelp
#

what'sthe interfeace

#

like

wraith rapids
#

what

keen kelp
#

how do I access the UI to upload it

wraith rapids
#

look at the sidebar on the left

#

this page is for further customization

#

you need to set the actual deployment up

keen kelp
#

I added the sftp, what next

wraith rapids
#

ask the page

keen kelp
#

there's nothing after adding sftp

#

that's the thing

wraith rapids
#

look at the sidebar

#

there are many things, before and after

sleek pond
#

it's called a fork because it's like a fork in the road

#

up to this point everything has been the same

#

and then it goes 2 paths

#

one path is the way you edit you part

#

and the other is how the bukkit devs edit the main part

quaint mantle
#

ahhh

#

can I edit Bukkit class?

#

and rename Bukkit class to toto class

#

xD

sleek pond
#

if you make a fork

#

yes

quaint mantle
#

it's allowed?

#

ok

wraith rapids
#

see the license for whether it's allowed or not

sleek pond
#

that too

quaint mantle
#

okay

wraith rapids
#

generally you are free to edit and change mostly anything for your own private use

#

but some licenses will prohibit you from republishing the changes or distributing the modified product

wispy monolith
#

Hi

#

ik this may seem not releated to spigot but I'm making a plugin that have a discord bot but the JDA community is not helpful at all they just send docs links that doesn't have enough description, so please can anyone help me I'm trying to edit the channel perms

eternal oxide
wispy monolith
eternal oxide
#

This channel is for Spigot/Bungee plugin development. If you need help on setting up your server you need the channel #help-server

sleek pond
#

it's a plugin

sleek pond
#

its not discord srv

sleek pond
wispy monolith
sleek pond
#

i made a semi-complete proximity chat plugin with discord

sleek pond
wispy monolith
#
channel.getManager().putPermissionOverride(<the role>,<what should I put here?>, <and what in here also?>);
sleek pond
#

yea that too

wispy monolith
sleek pond
#

permissionoverrides aren't what you need

wispy monolith
sleek pond
#

and how do you get your channel?

wispy monolith
#

event.getChannel

sleek pond
#

can I see the line of code?

wispy monolith
#
TextChannel channel = event.getChannel();
sleek pond
#

ok

#

one sec

#

do you have an Ipermissionsholder?

#

and what did the jda discord link you to

ivory sleet
#

channel.getManager().putPermissionOverride(role,allowedPermissions,deniedPermissions).queue()

#

Or smtng iirc

sleek pond
#

yes

#

but he needs a ipermissionsholder

#

unless a role already extends that

#

which it probably does

ivory sleet
#

It does

sleek pond
#

yea it does

#

ok

wispy monolith
sleek pond
#

what error

wispy monolith
#

just a sec

sleek pond
#

and you need a collection

wispy monolith
#

Cannot resolve method 'putPermissionOverride(net.dv8tion.jda.api.entities.Role, net.dv8tion.jda.api.Permission, net.dv8tion.jda.api.Permission)'

sleek pond
#

yea

#

becuz you need a collection of permissions

#

or

#

one sec

#

do this

#

Permission.WRITE_MESSAGES.getRawValue()

#

add the rawValue bit for both of them

wispy monolith
#

ok

#

just like that?

sleek pond
#

try it

#

it should work

#

but why would you want them to be able to write messages but not see the channel

wispy monolith
#

No errors

sleek pond
#

ah

#

i see

#

ok

wispy monolith
#

Thank u so much

sleek pond
#

what does the error say?

#

and I would assume, that the reason itemstack isn't there is becuz you would need the same itemmeta and stuff

#

k

keen kelp
#

in the ssh config it says successfully connected but in Deployment it gets stuck on connecting, what could be happening

sleek pond
#

oo

#

you need at exact choice

#

do this

#

recipe.setIngredient('D', new ExactChoice(ItemHandler.AncientGem()));

#

try that

#

but it only works for shaped recipes

#

ok

#

try it

#

the code I put

#

recipe.setIngredient('D', new ExactChoice(ItemHandler.AncientGem()));

#

oh

#

yea

#

same thing

#

does it work?

#

ok

keen kelp
#

is there any reason Intellij times out when trying to connect to the sftp server but filezilla works fine?

sleek pond
#

what's a defauly diamond>

#

screenshot?

#

wait

#

wdym?

#

could you screenshot?

#

like your game

#

yes

#

i know that

#

but what do you mean by it's a default diamond

#

what is a default diamond

#

oh

#

hmmmmm

#

so it only works with a regular diamond?

#

maybe you can't have a custom one

fleet falcon
#

can i get tab completer class from tab complete event?

#

maybe from tab complete packet event

urban trout
#

hello, how would i add an action bar countdown to my tag plugin?

vivid hill
#

is there a possibility to change the prefix from essentials with a plugin?

sleek pond
#

no

vivid hill
#

okey

young knoll
#

I mean maybe

young knoll
#

But essentials has a Lang file

opal juniper
#

Why does this code:

        ItemStack[] contents;
        contents = inventory.getContents();

        Set<Player> players = this.plugin.getSlaves(inventory.getLocation());
        if (players == null) return;
        if (players.size() == 0) return;

        for(Player player : players) {
            player.getOpenInventory().getTopInventory().setContents(contents);
            player.getOpenInventory().getTopInventory().setItem(0, new ItemStack(Material.RED_STAINED_GLASS_PANE));
        }

Keep causing a stack overflow error

#

the getSlaves is just this:

    public Set<Player> getSlaves(Location location) {
        return this.benchSlaves.get(location);
    }
eternal night
#

questionable method naming

opal juniper
#

lmao

wraith rapids
#

show an excerpt of the stack trace

opal juniper
#

they aren't slaves in the traditional message

#

sure

#

whats the limit on paste

#

?paste

queen dragonBOT
wraith rapids
#

master and slave is a well established pair of terms in technology and software

#

i only need like 20 lines or so

sleek pond
#

yea

#

the naming is a bit wonk

#

but oh well

#

or just the tradition in general

eternal night
#

master and slave is being sorted out everywhere from git main branch names and the linux kernel

opal juniper
#

There is quite a chunk, its talking about something being null

#

lemme find the caused by bit

sleek pond
eternal night
#

no mostly master in git

opal juniper
wraith rapids
#

it isn't

#

the exception message is null

opal juniper
#

my log is 50,000 lines long ><

wraith rapids
#

not to be confused with npe

opal juniper
#

im confused?

wraith rapids
#

InventoryCrafting.setItem

#

you are calling setItem

opal juniper
#

yeah...

wraith rapids
#

modifying the crafting matrix in any way fires a pre craft event

#

CraftEventFactory.callPreCraftEvent

opal juniper
#

oohhhhhhhhhhh

#

that makes sense ><

wraith rapids
#

which fires your listener

opal juniper
#

i get ya

#

we in recursion town

wraith rapids
#

have a boolean field or something in your listener that you set to true when you're handling an event

#

and ignore subsequent events if it's true

#

set it back to false once you're done handling the event

opal juniper
#

could i just add the item stack to the contents?

#

i just found it didn't always work

sleek pond
young knoll
#

Isnโ€™t that a clone

opal juniper
#

yeah

#

i think

#

and then i am just setting it

wraith rapids
#

well no matter how you set it, it's still going to spin the event logic

opal juniper
#

Huuuuuuhhh

vivid hill
#

can anyone make me a plugin ?

wraith rapids
#

no

opal juniper
#

?services

queen dragonBOT
eternal oxide
#

?services

queen dragonBOT
eternal oxide
#

me slow

opal juniper
#

beat ya to it

wraith rapids
#

making plugins is forbidden

#

shoo

opal juniper
#

lmao

#

how do i do the whole boolean thing

wraith rapids
#

declare a field

#

then write to the field and read from the field accordingly

#
if (bool) return;
bool = true;
//event logic here
bool = false;
weak mauve
#

i need help, the third time

#

but this time i actually make some progress

eternal oxide
#

at teh beginning of your listener java if (myBool) { myBool = false; return; }

young knoll
#

You donโ€™t want to be setting it back to false there

wraith rapids
#

you do

#

otherwise it'll never fire more than once per server session

eternal oxide
#

you reset the bool every time its true else you skip ALL iterations of your loop after the first one.

wraith rapids
#

no, you don't

#

if you do that, you will set it to false every time you recurse

#

which makes your event fire again

#

and you get a new stackoverflow

eternal oxide
#

you only want to skip the one triggered by your code

wraith rapids
#

yes

#

but there may be several of them

#

not just one

young knoll
#

Best to just set it back after your code

eternal oxide
#

it looked like it was his setItem that fired it

young knoll
#

The one upside of it all being sync

weak mauve
#

my plugin NEED craft bukkit, but org.bukkit died so i swapped the version to my local file, can it be possible?
i have already did this

young knoll
#

What

urban trout
#

TagCommand = https://paste.md-5.net/ohametixun.java
line 30: this.plugin.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
is underlined in red because Description Resource Path Location Type The method scheduleSyncRepeatingTask(Plugin, Runnable, long, long) in the type BukkitScheduler is not applicable for the arguments (TagCommand, new Runnable(){}, long, long) TagCommand.java /tag/src/me/renndrew/tag line 30 Java Problem

weak mauve
#
        <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>craftbukkit</artifactId>
            <version>1.8.8-R0.1-SNAPSHOT</version>
            <scope>system</scope>
            <systemPath>/Users/giakhanh/Documents/craftbukkit-1.8.8-R0.1-SNAPSHOT.jar</systemPath>
        </dependency>
young knoll
#

Run buildtools and then depend on spigot

chrome beacon
#

?bt

queen dragonBOT
weak mauve
eternal oxide
#

cb is IN spigot

opal juniper
wraith rapids
#

in the class

eternal oxide
#

a global field

opal juniper
#

ok

wraith rapids
#

it's a field, so it's declared in the class

opal juniper
#

sorry ><

wraith rapids
#

variables are declared in method bodies

weak mauve
#

mport org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftHumanEntity;

opal juniper
#

oh that makes sense

wraith rapids
#

yes, spigot includes craftbukkit

#

literally fucking read

weak mauve
#

oh ye

#

forgot

#

fk myself

#

i just moved to pl developing

urban trout
weak mauve
#

i mainly make clients

#

hack included

young knoll
#

Cool?

wraith rapids
#

as expected of a typical 1.8 user

weak mauve
#

f u

wraith rapids
#

gl

weak mauve
#

skyblocc

#

slayers done

young knoll
#

Hypixel the server or hypixel the person

opal juniper
#

what? @eternal oxide

opal juniper
young knoll
#

Are you sure

wraith rapids
#

there is no pickle emoticon

#

very sad

#

hy:pickle:

opal juniper
#

i wish there was a :cringe:

eternal oxide
young knoll
#

Spigot sees its fair share of unregulated cloning

opal juniper
wraith rapids
#

you have to clone everything because stuff is mutable and the developer base can't be trusted not to fuck up with mutable stuff

young knoll
#

I would love to see the result of non-cloned locations in the move event

wraith rapids
#

"oops"

opal juniper
#
        if (shouldntRun) return;
        shouldntRun = true;

this seems to be kinda mucking other things up

wraith rapids
#

is that sentence supposed to mean something

opal juniper
#

i mean, it is having an adverse affect on other pieces of code that set items

#

but idk what to do, cause the PrepareItemCraftEvent is the only one that reliably gets called when items change

wraith rapids
#

what do you mean > i mean, it is having an adverse affect on other pieces of code that set items

opal juniper
#

one sec

eternal oxide
#

put the if at the top of your code, reset to false at the bottom.

quaint mantle
#

View distance doesn't make fog like render distance's fog

wraith rapids
#

yes

quaint mantle
#

is there way exists to make fog?

wraith rapids
#

fog is clientside

quaint mantle
#

okay D:

#

thanks you

wraith rapids
#

spawn 2000 million smoke particles

quaint mantle
#

xd

young knoll
#

Boss bars have a setting to mess with stuff