#help-development

1 messages · Page 1586 of 1

manic crater
#

.....

#

for ur tab complete issue,/...

quaint mantle
#

well yeah but like plugin.yml?

#
name: Nectar
main: com.ankledev.nectar.main.Main
version: 0
api-version: 1.17

commands:
  discord:
    permission: nectar.regular
  spawn:
    permission: nectar.regular
  say:
    permission: nectar.staff
  warn:
    permission: nectar.staff
  kick:
    permission: nectar.staff
  mute:
    permission: nectar.staff
  ban:
    permission: nectar.staff
  vanish:
    aliases: [v]
    permission: nectar.staff
  mtp:
    aliases: [modtp]
    permission: nectar.staff
  s:
    aliases: [staffchat]
    permission: nectar.staff
  who:
    aliases: [whois]
    permission: nectar.staff
  setrank:
    permission: nectar.moderator
  toggledev:
    permission: nectar.admin
manic crater
quaint mantle
manic crater
#

im talking about ur actual code, for the tab complete.

manic crater
quaint mantle
#

i just cant see the commands that i have assigned permissions to in plugin.yml, despite having the plugin to run the command

manic crater
#

hm

#

thats weird tbh

quaint mantle
#

yeah

manic crater
#

have u tried restarting ur server/??

#

since /rl can bug out things

#

and it isnt recommended

quaint mantle
#

i dont /rl ever

#

only restarts

#

and yes

manic crater
#

hm,

quaint mantle
#

i've said that i've tried restarting several times

#

successful loads

manic crater
#

well man thats weird,

#

idrk what to do in this situation....

glossy dirge
#

if i do this, how did it return if it false

quaint mantle
#

add the exclamation point

manic crater
#

....

manic crater
quaint mantle
#

oh i misunderstand

#

i agree

#

tbh im still learning java but like, i do have a background knowledge of it

manic crater
#

cuz yeah ill admit it, im new to java, BUT at least i know some what on what im doing, i already figured out how to make guis with different clicking methods and etc, so, kind of feel super accomplished about that,

glossy dirge
manic crater
manic crater
quaint mantle
manic crater
quaint mantle
#

:D

#

ayo ima spit my plugin.yml problem into #help-server again! hope i dont get called a retard again :D #WAP

manic crater
copper dove
#

i have a question as i have made a task that is setup on a timer and i am trying to get it setup in the onEnable to be able to run it but how would i pass in a player from the main class so that it can access the things needed 🤔

crude charm
crude charm
#

Dont run the player instance through your constructor

copper dove
#

okay guess back to the drawing board on how to get the player stuff i need into the task

stable plinth
#

guys do attribute flying speed affects the speed of elytra? or does this attribute applies on player ?

crude charm
stable plinth
#

so attribute modifier doesnt work right?

crude charm
true sorrel
#

hi, so im trying to make it to where a specific person cant enter a certain region (my base) im assuming i could make it to where they get tped when they enter a certain radius of my base but i was hoping that there is a plugin side solution instead, does anyone know what i could do (im willing to install any plugin or anything like that if i need to for it to work)

tacit storm
true sorrel
#

how could i do it with worldedit?

#

i already have that installed

tacit storm
#

WorldGuard does it, WorldEdit is just a dependency for it

#

I dont really know the command out of mind right now sadly

true sorrel
#

ahh i see, ill download worldguard then, do you know what i should look up to be able to find how to do it?

granite stirrup
#

you disable passthrough when you make a new region im pretty sure

tacit storm
#

Okay so, here's how you should be able to do it:

  • Select a Region with WE
  • Run command /rg define [RegionName]
  • Run command /rg flag [RegionName] entry deny
    After that you can add a Owner and Member to Regions using:
  • /rg addowner [Region] <PlayerName>
  • /rg addmember [Region] <PlayerName>
#

I think this is how it works, just scratched that out the back of my mind @true sorrel

true sorrel
#

okay thank you so much! how do i create the region cause i dont have one set yet?

tacit storm
#
  • Select a Region with WE
  • Run command /rg define [RegionName]
true sorrel
#

ahh i see ty

#

will this make it to where no one can enter my base or just the specific person cause i only want to deny entry for one specific person

random saddle
#

o:

outer sorrel
#

whats the best way to get the players actual fall distance? player.getFallDistance() can get spoofed and could cause issues

tacit storm
#

I am not entirely sure if there's a way to make it denying for only one person tbh

fluid cypress
#

how can i do this? i cant access seconds

int seconds = 3;
new BukkitRunnable() {
    @Override
    public void run() {
        seconds--;
        if (seconds != 0)
            player.sendMessage("teleporting in " + seconds + " seconds...");
        else
            player.teleport(blabla);
    }
}.runTaskTimer(BetterWarps.instance, 0L, 20L * 3L);

also, how do i stop the timer?

true sorrel
#

it wont let me send a pic in this channel but i dmed it to you @tacit storm

hybrid spoke
#

also you can use a returning method of the class just like #schedule bla bla and get the returned int/BukkitTask

summer scroll
#

Back to my yesterday issues, I need somehow to create a module for version 1.16.5 and 1.17.1, the thing is 1.17.1 requires Java 16, how can I create a module that support those version?

fluid cypress
#

what about stopping the timer?

summer scroll
#
new BukkitRunnable(){
  int seconds = 3;
  @Override
  public void run(){
    ....
  }
}.runTask...
fluid cypress
#

thanks

silk mirage
#

.

silk mirage
#

Maven/Gradle has ability for multi-module project

cyan oyster
#

[14:31:17] [Server thread/ERROR]: Could not load 'plugins\Hello.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:160) ~[server.jar:git-Spigot-a93cbb1-7a6c3c9]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:144) ~[server.jar:git-Spigot-a93cbb1-7a6c3c9]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:383) ~[server.jar:git-Spigot-a93cbb1-7a6c3c9]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:185) ~[server.jar:git-Spigot-a93cbb1-7a6c3c9]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:809) ~[server.jar:git-Spigot-a93cbb1-7a6c3c9]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[server.jar:git-Spigot-a93cbb1-7a6c3c9]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_291]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 7 more

silk mirage
#

just use any one of those build tools

silk mirage
#

your plugin.yml is invalid

summer scroll
hybrid spoke
#

Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml

cyan oyster
#

i need to name it plugin.yml?

hybrid spoke
#

it needs a plugin.yml

silk mirage
summer scroll
cyan oyster
silk mirage
cyan oyster
#

myyy typo

silk mirage
cyan oyster
#

i named it plugins.yml

summer scroll
fluid cypress
#

any recommendation for an "error" sound effect? i dont really remember all minecraft sounds

summer scroll
hybrid spoke
#

you can just set java 8 as your project sdk

summer scroll
#

I use interface right now, but I got problem with the java version

hybrid spoke
#

it will work

silk mirage
#

uh, ArmorStandMeta exists but idk if it has a method for it

hybrid spoke
#

just the server needs java 16

summer scroll
silk mirage
#

uhm

hybrid spoke
silk mirage
#

you are thinking of worthless issues

#

every java 8 classes are available at java 16

hybrid spoke
#

you can compile your plugin on an older java version

#

and it will run on a 1.17 server

#

since java is backwards compatible

summer scroll
silk mirage
#

as far as i remember, old bytecode type can work on newer JVM but not at older

silk mirage
#

but on development use java 8

summer scroll
#

It can't even compile

silk mirage
#

your issue will be fixed.

silk mirage
summer scroll
#

That's compilation error

silk mirage
#

That much only?

#

you said you were using maven

summer scroll
#

i'm using maven, yes

silk mirage
#

send full log

hybrid spoke
#

so if you need to update for that single class, just update your java version to 1.16

summer scroll
#

that's the full log, one error only

silk mirage
summer scroll
#

oh one sec

silk mirage
#

you using intellij to compile?

summer scroll
silk mirage
#

okay cool

iron condor
#

hey I'm not really sure how tab complete works

    @Override
    public List<String> onTabComplete(CommandSender sender, Command cde, String arg, String[] args) {

        List<String> list = new ArrayList<String>();

        if (args[0].equalsIgnoreCase("pay")) {

            for (Player player : getServer().getOnlinePlayers()) {
                list.add(player.getName());
            }

        } else if (args.length == 0) {
            list.add("pay");
        }

        return list;

    }
#

this is what I have so far but this doesnt work

hybrid spoke
silk mirage
#

aglerr, you could create your own mask class

hybrid spoke
#

more like "register" it to your command?

summer scroll
iron condor
#

lmao

            this.getCommand("bits").setExecutor(this);
            this.getCommand("bits").setExecutor(this);
#

on accident

hybrid spoke
iron condor
#
            this.getCommand("bits").setExecutor(this);
            this.getCommand("bits").setTabCompleter(this);
#

fixed thanks

silk mirage
#

ok bye

summer scroll
#

so change the sources and the dependencies to 16?

silk mirage
#

do you have JDK 16 installed?

summer scroll
#

yes i do

silk mirage
#

You using intellij?

summer scroll
#

yes

silk mirage
#

Press ALT + SHIFT + CTRL + S

#

and send the screenshot of the thing that poped up

summer scroll
silk mirage
#

click on project

hybrid spoke
#

ignoring is bad

silk mirage
summer scroll
#

sorry don't mean to ignore you i just dont understand

silk mirage
hybrid spoke
summer scroll
#

project sdk and project language level

#

it was 1.8, and now i've changed it to 16

silk mirage
#

yep cool

#

now try to compile

summer scroll
#

yep it's working now

silk mirage
summer scroll
#

thank you so much

silk mirage
#

Alright, Have a nice day!

summer scroll
#

for both of you

opal juniper
#

Ayyy it’s backpack man

outer sorrel
#

whats the best way to make a double only have 8 decimal places instead of 20? I can only find ways to round it but i dont want to round

silk mirage
hybrid spoke
#

first google result

silk mirage
#
DecimalFormat df = new DecimalFormat("#.#####");
df.format(0.912385);
#

Here you do

#

Replace the #.##### with how much numbers and decimal places you want

silk mirage
outer sorrel
#

why does it return a string?

opal juniper
silk mirage
outer sorrel
#

ok thanks

#

my brain is dead

silk mirage
#

Cool!

wooden fable
opal juniper
#

Error 1 means you clicked out of the inventory

#

so you clicked no inventory

#

Dont use the inventory title to check the inventory

#

you should implement a custom inventory holder

#

and wtf is this code

hybrid spoke
opal juniper
#

have you heard of a loop?

silk mirage
#

and also, @wooden fable Please just use a loop

wooden fable
#

oh

ivory sleet
opal juniper
#

recursion is a stupid loop

hybrid spoke
#

in this case it is

silk mirage
opal juniper
#

there are a few instances where it is not

silk mirage
#

People when then first try recursion

public void doRecursion(){
    int i = 0; 
    System.out.println(i);
    i++;
    doRecursion();
}

comes into a google and type Why do I get StackOverFlow exception while doing recursion

granite stirrup
#

im making a fake server hosting with skript :)

#

because bored af

#

and skript is the easiest to use

wooden fable
#
                Random rand = new Random();

                for(int i = 0; i < 27; i++) {
                    int randomNum = rand.nextInt((max - min) + 1) + min;
                    ItemStack RandomItem = new ItemStack(Material.matchMaterial(Main.plugin.getConfig().getString("PackMachine.p." + randomNum)));
                }
``` is this better?
granite stirrup
#

couldnt you cache the rand variable?

iron condor
#
    @Override
    public List<String> onTabComplete(CommandSender sender, Command cde, String arg, String[] args) {

        List<String> list = new ArrayList<String>();

        if (args[0].equalsIgnoreCase("pay")) {

            for (Player player : getServer().getOnlinePlayers()) {
                list.add(player.getName());
            }

        } else if (args.length == 0) {
            list.add("pay");
        }

        return list;

    }

this still doesnt work

#

is there anything wrong?

ivory sleet
#

Possibly

granite stirrup
#

why cant you do recursion forever?

ivory sleet
#

Probably not that trivial tho

iron condor
#

do I have to do something in plugin.yml?

ivory sleet
#

Ye

iron condor
#

yes

#
            this.getCommand("bits").setTabCompleter(this);
#
public final class BitEconomy extends JavaPlugin implements Economy, Listener, CommandExecutor, TabCompleter {
ivory sleet
#

I mean it’s nice for readability

granite stirrup
#

while just typing doesnt

ivory sleet
#

Pretty sure it does prompt you, just that you will get prompted with a lot more

granite stirrup
#

it doesnt suggest me anything in JavaPlugin without me doing this.

broken hare
#

How can I send the world loading screen to a player?

ivory sleet
#

Hmm I haven’t touched IntelliJ in a week or so, can’t remember

ivory sleet
broken hare
#

Hmm maybe

granite stirrup
broken hare
#

I thought there might be a packet that gets sent?

iron condor
#

I want it to be like /bits <tab complete - pay> <tab complete - online players>

ivory sleet
#

Oh and your current code was?

granite stirrup
#

im gonna go now

ivory sleet
#

Cya

granite stirrup
#

its 9 am

granite stirrup
#

havent slept yet so im gnna go

hybrid spoke
ivory sleet
#

First of all, you probably want to use StringUtil.copyPartialMatches

hybrid spoke
#

not 0

ivory sleet
#

Mye checking 0 is redundant

hybrid spoke
iron condor
#

wait how does it work?

#

isnt args[0] is the "pay" ?

ivory sleet
#

Yes

#

Indices != length tho

broken hare
iron condor
#

but it should auto complete before you write the args

broken hare
ivory sleet
#

It will axilirate

broken hare
#

It should work in theory

hybrid spoke
#

hitting the space = another arg

ivory sleet
#

iirc spaces are included in args

#

Well they’re trimmed before you get to look at that

iron condor
#

testing

ivory sleet
#

What version?

iron condor
#

arrays start at 0 :/

hybrid spoke
#

but not the length

iron condor
#

It works now

hybrid spoke
#

java starts counting from 0

iron condor
#

thanks

#

almost any language has that

#

or every language

drowsy helm
#

not all

ivory sleet
#

lua 🤡🤡

wooden fable
iron condor
#

I understand now why people hate lua

broken hare
#

Now my next simple question is, how can I run a Runnable on a seperate thread (it doesn't access any bukkit/spigot interals). Should I use java threading?

hybrid spoke
#

no. you won't need to create your own thread. you could either use the bukkit async scheduler method or CompletableFuture

broken hare
#

Is the bukkit async scheduler, I need to always be on it's own worker thread it's doing some API operations that take seconds to completed and can't block the main thread

hybrid spoke
#

i would prefer completablefuture

broken hare
#

Is this feature in Bukkit too?

hybrid spoke
#

no

#

java

broken hare
#

Ahh yes I have heard of it thankyou.

ivory sleet
#

There is tho

#

BukkitScheduler#runTaskAsynchronously

#

Or did I read it wrong?

hybrid spoke
#

he asked if CF is a feature in bukkit

ivory sleet
#

Oh yeah right

hybrid spoke
#

not if there is such a feature in bukkit

ivory sleet
#

I mean you could wrap an executor

hybrid spoke
#

thats what CF does

ivory sleet
#

CompletableFuture.runAsync(()->{},runnable-> Bukkit.getScheduler().runTaskAsynchronously(plugin,runnable)); iirc

hybrid spoke
#

what

#

why

ivory sleet
#

That is if you want to use the Bukkit scheduler with CF as it’s totally possible

hybrid spoke
#

but unnecressary

broken hare
#

Yea wouldn't that be redunant

ivory sleet
#

@broken hare what exactly are you trying to do?

hybrid spoke
#

run something async

ivory sleet
#

Exactly what?

hybrid spoke
#

CF#runAsync(runnable) is totally fine

ivory sleet
#

No it hugely depends on what you’re doing async

#

For instance doing if you’re IO it’s preferred to pass a custom fjp to the CF

broken hare
#

Yes it just API stuff

ivory sleet
#

If it’s minecraft/spigot api related, pass the Bukkit scheduler wrapped in an executor

broken hare
#

So what do you suggest I was gonna use runAsyncTask?

ivory sleet
#

I mean necessarily not

broken hare
#

It doesn't need to access bukkit internals or spigot

ivory sleet
broken hare
#

Like calling a public API, how specific do I need to get?

ivory sleet
#

Idk just curious

broken hare
#

Ohh it's just a geocoding api

#

It may need to call one bukkit internal, is that okay. It would just be to do a teleport?

ivory sleet
#

Oh then it’s probably fine with the CF and the common pool

broken hare
#

Is that possible could I call a sync task from a async task?

hybrid spoke
ivory sleet
#

Yes ^

#

This is probably non of your interests but I am just going to publicly blame all spigot devs that use the common pool when doing async stuff that regards IO. 🙂

broken hare
#

So its okay to call teleport in a worker thread?

ivory sleet
#

Idk maybe that has to be triggered on the server thread

broken hare
#

I need to do this because the IO stuff takes 10 secs and if I do this on main thread it will block it

ivory sleet
#

You’re not doing IO?

hybrid spoke
#

teleporting is world modification

#

you will need to do that on the main thread

broken hare
#

Yes first then I want to call a teleport

hybrid spoke
#

use the AsynchronousFileChannel if you are doing something with IO

broken hare
#

Hmmm okay

hidden delta
#

I don’t know I use array list with callback thing and in the async when it completes the thing that i need i add the thing that works only on sync stuff from the async thread to run without any issues

quiet ice
#

You could always teleport on a sync task if everything else fails

broken hare
#

But how if I want execute stuff in a worker thread?

ivory sleet
quiet ice
#

You do all your resource intensive stuff off-thread and use the Bukkit Scheduler to run a task in the next tick that teleports the player

hybrid spoke
#

~ or if you are using a CF you can teleport the player in the callback

broken hare
broken hare
quiet ice
#

yes

ivory sleet
#

Or just nio?

broken hare
#

No spring

ivory sleet
#

Ah

broken hare
#

Is there anything in spring to help?

ivory sleet
#

Wait this plugin of yours uses spring?

broken hare
#

Correct

#

Well technically it uses a library that uses spring which I made

ivory sleet
#

Ah yeah, I mean spring is ridiculously humongous but that gives more context on this problem.

#

But just do what geol said or well luzifer also probably mentioned lol

broken hare
#

Okay will do

ivory sleet
#

Also about IO and the common pool. Thing is a lot of bad plugins mess with IO frequently and use something like CompletableFuture#run/supplyAsync(lambda) which is the same as CompletableFuture#run/supplyAsync(lambda,commonPool) and that slows a lot of other things down, like parallel streams since they also use the forkjoinpool common one and also all other plugins which use CF with the common pool to do heavy computations and so on. That’s usually why we prefer to have our own fork join pool when dealing with IO which should be handled async.

Also for anyone who reads this the fork join pool works by having several workers stealing smaller tasks from each and another. IO tasks can be large thus reducing the effectiveness of the common join pool.

fluid cypress
#

is there any way to remove the id and nbt tags from an item? using it in a gui. also, can i add the enchantment effect somehow? without seeing any enchantment info in the hover popup

quiet ice
#

there is an Itemflag to hide enchantments

fluid cypress
#

what about id and nbt

quiet ice
#

what id?

fluid cypress
#

minecraft:some_block

chrome beacon
#

Tags can be hidden with packets but might cause sideeffects since the client doesn't know the data

fluid cypress
#

ahh you right

ancient whale
#

Hi,
I would like pro's opinion about an issue,
I need to regularly update an armor stand customName, but the thing is that most of the time it spawns in not populated area which means that the chunk unloads
I have thought about 2 solutions:
Prevent chunks where I have my armor stands to unload (which doesn't feel optimized)
Only update the armor stand when the chunk is loaded, this one would be better but I actually can't get to keep updating my armorstand when I get back to the chunk after it has been unloaded even though I keep my armor stand instance in memory

tame coral
#

Can't you get an entity in a world by it's UUID ?

#

I pretty sure you can

#

Here

#

Store its UUID instead of its instance

#

And get it whenever you need to use it with this method

fluid cypress
#

should i use addEnchant to an item meta, or addEnchantment to an itemstack? and why

tame coral
#

probably addEnchant since it doesn't check if it's a legal enchantment

ancient whale
ivory sleet
#

Pretty sure that’s in 1.8 also

dire marsh
#

:outdated:

ancient whale
dire marsh
#

can't wait for 1.18 so I can troll people by pretending I thought they had a typo

ivory sleet
#

lol

ancient whale
#

xd

tame coral
#

You can use a switch statement instead of if

#

But i have no idea how to do this more efficiently

ivory sleet
#

EnumSet

hybrid spoke
#

what am i seeing here

burnt current
#

Hey! Quick question: I'm in the process of creating something that places a few blocks. Among these blocks are glass panes. I would like to work with multifacing for the glass panes in order to connect them with the surrounding blocks. I have already programmed the following:

                BlockData glassData = glass.getBlockData();
                MultipleFacing facing1 = (MultipleFacing) glassData;
                facing1.setFace(...);

Which blockface value must be set to connect the slices to all blocks?

flat kindle
#

I have a question,in the server,properties file,what is the use of this line

#

Would I have to purchase a domain like with a website?

flat kindle
#

oh sorry

eternal night
#

when do you remove these recipes o.O

#

like, onLoad ?

#

I mean, this should technically only happen when players join that had these recipes unlocked

flat kindle
#

but you were on the server?

eternal night
#

so this happens on startup ?

#

without a player online ?

#

you can reproduce this ?

flat kindle
#

getServer().recipeIterator();

#

are server recipes mutable?

eternal night
#

Seems like it

#

well, let me try to reproduce it

#

yeah idk I cannot reproduce your error. I was able to remove it perfectly fine without the error message.

#

[13:37:30 ERROR]: Tried to load unrecognized recipe: minecraft:white_concrete_powder removed now. I can get this error after I crafted white concrete powder -> enabled the plugin -> reconnected

flat kindle
#

is the plugin on Post world?

eternal night
#

huh ?

#

I mean, this is what we were suspecting earlier

#

this error should pop up when a player is loaded that had the recipe unlocked earlier

#

it isn't

#

but it will only happen once

#

after the player was loaded the now faulty data is not stored anymore

flat kindle
#

is there a way to configure unlocked recipes for a player onJoin?

valid solstice
#

is paper api and bukkit api different?

summer scroll
#

If I spawning armor stand with packets, how can I make the armor stand follows player head movement?

eternal night
#

but introduces a bunch of new methods, utilities and systems

summer scroll
#

I'm guessing listen to player move event and send head rotation packet? but will that gonna hurt the performance?

eternal night
#

Well idk if player move is really the best call, concerning you are working with packets you might be fine just running an async timer each tick

valid solstice
#

is there a download for the jar of paper api or is it the same as the spigot api jar?

summer scroll
#

So sending an async packet each tick is the way to go?

eternal night
#

you cannot use paper api without running a paper server

#

also who "downloads" an API ?

#

just use your maven/gradle build system

valid solstice
#

not the api

eternal night
#

oh paper distributes using paperclip

#

go google

waxen barn
#

I think, that I found the problem, but it I don't have any idea how to solve it. When I try to cast the nms Entity to my class, I get this error

java.lang.ClassCastException: class notURL.RedstoneExpert.TridentGamesLobby.Spigot.Meteorite.Meteorite cannot be cast to class notURL.RedstoneExpert.TridentGamesLobby.Spigot.Meteorite.Meteorite (notURL.RedstoneExpert.TridentGamesLobby.Spigot.Meteorite.Meteorite is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @5c6c8692; notURL.RedstoneExpert.TridentGamesLobby.Spigot.Meteorite.Meteorite is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @49449d7c)
eternal night
#

Are you running two instances of your plugin ??

quaint mantle
#

Hello!

#

How can I detect a left click on a fixed item frame?

quiet ice
valid solstice
#

ty

waxen barn
eternal night
#

geol might be right then

quiet ice
#

nah, this is a memory leak

eternal night
#

oh

#

but they said restart

#

not reload

quiet ice
#

oh right

quaint mantle
#

how can I get the item frame then?

quiet ice
#

Yea, then it is a shading issue

waxen barn
eternal night
#

obviously xD

#

if you shaded it into another plugin you will always be fucked

quiet ice
#

if restart is bork reload is bork too

valid solstice
#

can i use paper docs for spigot plugin

quiet ice
#

nyes

summer scroll
quiet ice
#

It works, although with unindended side effects

summer scroll
#

iirc ItemFrame is an entity

eternal night
#

well, not all methods you will find in paper docs are available on spigot

quaint mantle
eternal night
#

you can also not publish plugins to spigot that use paper specific versions and hence not run on spigot only servers

quaint mantle
#

an item frame is an entity, not a block

quiet ice
#

Paper has a LOT of methods deprecated and it will point you to methods that do not exist on spigot

eternal night
#

^^

waxen barn
quiet ice
#

maven or gradle?

#

(please don't say JDT)

eternal night
#

what is JDT xD

quiet ice
#

Eclipse Java development tools, technically the eclipse compiler though

quiet ice
#

?jd You should be able to point to this though

summer scroll
quaint mantle
#

so it can't be broken

eternal night
#

should still take damage

#

also what is a fixed item frame o.O

#

oh I see

quaint mantle
#

according to the javadocs this is an itemframe that was set fixed

summer scroll
#

When true it's not possible to destroy/move the frame (e.g. by damage, interaction, pistons, or missing supporting blocks), rotate the item or place/remove items.

#

So it can't be damaged.

quaint mantle
#

yeah it doesn't trigger the EntityDamageByEntityEvent

#

so how can I detect a left click?

hybrid spoke
#

tricks

#

either trying via nms and or packets or set another invisible entity over it and redirect the click

vital ridge
#

does somebody have any knowledge on gradle here?

summer scroll
#

GodCipher, is it fine to have a async task timer that runs each tick to send a packet to the player? Basically I want to make armor stand head follow the player head rotation.

hybrid spoke
undone axleBOT
#

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.

hybrid spoke
vital ridge
#

Basically im trynna create a client and in order to do that i need to use cmd line and gradle. Now, even if i just run gradlew without any other arguments i get this error:

FAILURE: Build failed with an exception.

* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.9/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------

FAILURE: Build failed with an exception.

* What went wrong:
java.lang.ExceptionInInitializerError (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
summer scroll
hybrid spoke
# summer scroll why's that?

why would you? first i dont know if NMS is actually thread safe, second its redundant. the call would take longer than doing it sync.

vital ridge
hybrid spoke
#

and the performance? for the server its just like calling a middle sized method. after that everyting is clientside

hybrid spoke
#

he always fights for gradle so he have to know it

summer scroll
#

Alright, are there downside calling packets each tick? We're talking about 50+ packets being sent each tick.

waxen barn
#

but many packets are sent every tick event in vanilla

hybrid spoke
#

and still runs perfectly

#

"perfectly"

summer scroll
#

Alright then, thanks.

#

This is gonna be an interesting project xd

waxen barn
waxen barn
hybrid spoke
quaint mantle
#
String[] list = {"uuid.5","uuid2.3","uuid3.0"}

list[0].split(".")[0]

why it return error of index out from bounds? (list[0] return "uuid.5")

hybrid spoke
quaint mantle
#

i use for loop for insert uuid of players and his kills from database

#

after sort
i need to get it out

#

but i cant do split

ivory sleet
#

split takes regex

#

use "\\."

quaint mantle
#

ok i will try

vital ridge
ivory sleet
#

Run with stacktrace flag

#

Also is this in IntelliJ?

vital ridge
#

nope

#

This error happened

#

when i just typed gradlew

ivory sleet
#

Explains why

vital ridge
#

No arguments nothing else

#

What's wrong?

#

You understand?

#

Cuz i clearly dont lol

#

This happens basically everytime i use gradlew with arugments or without arguments

ivory sleet
#

Let me out of curiosity ask you why no IDE?

#

Or like do you use eclipse?

waxen barn
vital ridge
#

I have eclipse and intellij

#

i use em both

#

mainly intellij

ivory sleet
#

Okay but using IntelliJ should fix that I think

vital ridge
#

But like the error happens just when i open cmd and type "gradlew"

#

That shouldnt be connected with my ide

ivory sleet
#

Myes but do u have a gradle wrapper provided then?

#

IDEs usually fix that for you

vital ridge
#

I dont

#

But the thing is, this error started appearing randomly, before when I used eclipse and did this kind of stuff it worked perfectly

quaint mantle
#

Hey is it possible to create an entity without spawning it and without using NMS?

vital ridge
#

Idk I mean I'd love to fix it doing whatever needed but I rly dont know what to do

ivory sleet
#

Cuz gradlew is a relative path to the ./gradle/ path where a gradle wrapper jar is located

#

But my suggestion is to use an ide

#

It will do most of the setup for you

vital ridge
#

Yea but like I dont understand the "use an ide", do I need to change the path or smthing?

#

I was using eclipse stuff before to decomp the workspace

#

I was trynna create a client

#

Then the error first appeared

quaint mantle
ivory sleet
#

Yeah it’s a weird error

vital ridge
#

Well yea the thing is it didnt happen before but then randomly started to happen

hybrid spoke
ivory sleet
#

That’s why I can’t really tell exactly. But how’s your workspace directory looking?

hybrid spoke
#

would be pretty dumb to send moving packets if there is noone moving

vital ridge
#

I mean I dont have a workspace yet, i just needed to change the build.gradle a bit and then define the directory there, then i went to cmd to run a decompWorkSpace or smthing like that

#

And then it first appeared

hybrid spoke
ivory sleet
#

Wait is this with forge or fabric?

vital ridge
#

forge

ivory sleet
#

I’m confused now

#

Oh maybe ask in the forge discord lol

vital ridge
#

If im right they will tell u to f off pretty much when asking this kind of support

ivory sleet
#

Give it a shot

#

Anyways it’s strongly advocated to use IntelliJ for both fabric and forge fyi, so they might also pick on that

vital ridge
#

So you mean just changing path or smthing?

#

I dont know "how to use" intellij in this case

#

I've been just following a tutorial currently and done what they did.

#

I have no idea how I should do smthing different than the tutorial showed in order to fix my issues.

waxen barn
#

when there are no movement, client will send 1 packet per second

hybrid spoke
#

but not a movement packet

waxen barn
#

(you can find this at minecraft protocol documentation or find it when experimenting with protocol lib)

hybrid spoke
#

ofc the connection have to be hold

ivory sleet
hybrid spoke
#

even if there is no interaction

ivory sleet
#

Best I could find which might help

waxen barn
# hybrid spoke even if there is no interaction

it sends a movement packet, this is log from listener that I created 5 minutes ago that logs only movement packets

[12:24:30 INFO]: [TridentGamesLobbyPlugin] 851
[12:24:31 INFO]: [TridentGamesLobbyPlugin] 852
[12:24:32 INFO]: [TridentGamesLobbyPlugin] 853
[12:24:33 INFO]: [TridentGamesLobbyPlugin] 854
[12:24:34 INFO]: [TridentGamesLobbyPlugin] 855
[12:24:35 INFO]: [TridentGamesLobbyPlugin] 856
[12:24:36 INFO]: [TridentGamesLobbyPlugin] 857
[12:24:37 INFO]: [TridentGamesLobbyPlugin] 858
[12:24:38 INFO]: [TridentGamesLobbyPlugin] 859
[12:24:39 INFO]: [TridentGamesLobbyPlugin] 860
[12:24:40 INFO]: [TridentGamesLobbyPlugin] 861
[12:24:41 INFO]: [TridentGamesLobbyPlugin] 862
```(the number is just some number increasing every packet, so it was easier to check, that when player is moving, he sends exactly 20 packets)

and this is quote from documentation
> Vanilla clients will send Player Position once every 20 ticks even for a stationary player.
hybrid spoke
waxen barn
#

i also don't have any idea why it works as this
i understand why server does similar thing when replicating entities to client, but here I don't have any idea, because the server should be the one with the correct data, so if client is standing on block, that server doesn't have, the server should be true and the client should fall anyways

but this is just how minecraft works and if you will be listening to the packets instead to the event for some reason, be sure to know, that movement packet ≠ player has moved

quaint mantle
#

Hello I need help with item frames placing:

#
        ItemFrame itemFrame = (ItemFrame) target.getWorld().spawnEntity(target.getLocation(), EntityType.ITEM_FRAME);
        itemFrame.setVisible(false);
        itemFrame.setFixed(true);
        itemFrame.setPersistent(true);
        itemFrame.setItemDropChance(0);
        itemFrame.setItem(item);
        itemFrame.getPersistentDataContainer().set(FURNITURE_KEY, PersistentDataType.STRING, itemID);```
waxen barn
hybrid spoke
quaint mantle
#

Oh man I'm sorry

#

I think I got the response

#

I would like to spawn invisible item frames

#

but I think I need NMS

#

because currently you see them visible and then they become invisible the next tick

#

because I can't create an entity and spawn it after without NMS, right?

hybrid spoke
#

define create entity

#

you can spawn the entity and modify it right after

#

that would take less than a tick

opal juniper
#

you can only modify existing entities - not make new ones

waxen barn
hybrid spoke
waxen barn
waxen barn
hybrid spoke
quaint mantle
#

Oh thank you very much @waxen barn

hybrid spoke
#

at least serversided

tardy delta
#

is there a way to let a class only be extended by 1 other class?

quaint mantle
#

This works perfectly, thank you very much @waxen barn

waxen barn
#

and why do you need it?

tardy delta
#

ah it is a class with codes that can only be written by one class

#

to avoid abuse

waxen barn
# tardy delta to avoid abuse

if you want to make public framework and avoid abuse there, this sin't the way to go, because java is really easy to decompile

ivory sleet
#

Make a reactive system.

tardy delta
#

yea i saw something like a sealed class in C# and thought maybe java could do something similar

ivory sleet
#

Also yeah notify and wait is kinda oldish

#

Also synchronized

#

Actually what are you trying to do?

#

?jd-b

#

Uh

#

?jd-bc

waxen barn
ivory sleet
#

Why not use PostLoginEvent or PreLoginEvent

#

Sealed classes are coming in j17

tardy delta
#

but yea thanks

ivory sleet
#

You said with bungee sysdm? Maybe explain a little bit more detailed heh

waxen barn
ivory sleet
#

fina for a class prevents any other class from deriving it, sealed is a way to whitelist only certain explicitly declared classes to derive from it.

waxen barn
#

oh, ok

ivory sleet
#

Okay but can’t all this be done or AsyncPlayerPreLoginEvent, like you send a pmc message and await a response

#

Or well you would need that listener

#

Yeah

#

Uh I’m on phone so can’t give you a concrete example but uh maybe someone else can give you further assistance

hybrid spoke
#

so basically you want to achieve something like:
send request for the servers name a player is on
"Please wait OKAY?!"
received server name
"Okay, here we go."

#

and why exactly do you have to wait?

silk mirage
#

a new thread is async right?

#

My browser aint working so i had to ask here

ivory sleet
#

Yes

silk mirage
ivory sleet
#

It’s async in respect to all other threads

#

Or it executes the given runnable async rather but yeye

hybrid spoke
#

callbacks are a thing

#

what exactly are you trying? just sending a method?

silk mirage
#

Just search consumers

hybrid spoke
#

there are not only consumers

ivory sleet
#

It’s just a function which you pass to something and is at a later point of time executed

hybrid spoke
#

yeah just like a runnable

ivory sleet
#

^

silk mirage
hybrid spoke
#

supplier, function, bifunction, consumer, biconsumer...

silk mirage
#

kotlin is the best for top level functions

hybrid spoke
#

there are many functional interfaces

ivory sleet
#

We can consider functional interfaces to be first class function objects in the way Java treats them

hybrid spoke
#

you can use a consumer

silk mirage
ivory sleet
#

Any -> Unit

#

(:

silk mirage
#

yes kotlin best

hybrid spoke
#

pog

#

no they actually dont

silk mirage
ivory sleet
#

A functional interface is just an interface with a single abstract method and thus the lambda is allowed

#

interface A { void lol(B b, C c, D d); } even that would allow a lambda

hybrid spoke
#

depends on what you are trying to do

silk mirage
hybrid spoke
#

so ready up a consumer which accepts later on the player to send the message

ivory sleet
silk mirage
#

ah another question,

I can do this right?

private void something(String eh) {
  new Thread(() -> System.out.println(eh));
}
hybrid spoke
#

but i assume you have to keep track of the players request with the player so nobody else gets the response of your request

ivory sleet
#

Yes

hybrid spoke
#

but you have to start the thread

ivory sleet
#

^

silk mirage
#

oh yea, thanks for reminding i totally forgot to add .start()

#

i'm doing all mysql tasks in new thread ik not the best idea

plain scroll
#

how can i change a players skin via a command ?

ivory sleet
#

You should use an executor service probably sushant

hybrid spoke
plain scroll
silk mirage
ivory sleet
#

Reusing resources are good mostly

plain scroll
#

like player.setskin?

hybrid spoke
silk mirage
hybrid spoke
#

as conclure said use an executorservice

ivory sleet
#

Well take a look at the Executors class

plain scroll
#

oki

silk mirage
#

its gonna take just bunch of more time

hybrid spoke
#

CF or ForkJoinPool

hybrid spoke
proud basin
#

So I have a javafx project and I tried to wrap the javafx dlls using the build artifact but it seems to do nothing. I may be doing something wrong but im not too sure.

plain scroll
#

oh lmao

silk mirage
hybrid spoke
#

@plain scroll google for it. first google result will be your solution for sure

proud basin
hybrid spoke
# proud basin Yes I am

Serious Spigot and BungeeCord programming/development help | Ask other questions here are you sure?

#

oh well

#

"Ask other questions here"

ivory sleet
#

Programming questions are allowed I guess

proud basin
#

Ask other questions here

ivory sleet
#

I mean they don’t suit any other channel better

hybrid spoke
#

that shot came back real quick

silk mirage
ivory sleet
#

Lmao

silk mirage
#

some of the jdks doesn't have JavaFx pre installed

ivory sleet
#

I have never used javafx, tornado and that stuff.

proud basin
#

I’m using jdk 8 so it’s built inside

hybrid spoke
silk mirage
#

Just use swing

#

):

hybrid spoke
#

they are in the jar anyways

hybrid spoke
#

jfx is a great framework for professional application development

#

swing is for smaller applications

#

maybe he is developing instagram 2.0

silk mirage
#

I barely know anything about JavaFx all i know is to create a javafx application, you must extend Application class from JavaFx at the main class

proud basin
#

Because when I give the user the exe file I don’t wanna have to give them all the dlls with it

silk mirage
#

electron

#

ah

ivory sleet
#

Isn’t that for mobile development exclusively

hybrid spoke
#

fuck electron

ivory sleet
#

React native and flutter

#

Etc

hybrid spoke
#

yeah

silk mirage
#

I think react native can be convereted into a web packagge

ivory sleet
#

Ah

hybrid spoke
#

fitted to my answer about instagram 2.0

ivory sleet
#

Probably ye

proud basin
#

Swift

silk mirage
#

no swift

#

eww, that is most erotic language that i ever saw

proud basin
#

So yeah that’s why GodCipher

ivory sleet
#

Swift is pretty poggers I heard

quaint mantle
#

are bossbars async?

proud basin
#

Used it 3 times and never touched it again

ivory sleet
#

Koto probably not

quaint mantle
#

ty

hybrid spoke
#

Vaadin

silk mirage
#

i regret using static variables rather dep injection

#

static are not so safe ):

proud basin
ivory sleet
#

Never bothered

hybrid spoke
#

he was probably minecraft addicted while learning java

ivory sleet
#

I use python when it comes to that stuff

#

Don’t blame me lol

silk mirage
hybrid spoke
#

Conclure do you want to work later as a java developer?

#

if so have fun with javafx

silk mirage
#

combied all those and became fullstack

ivory sleet
#

Probably lol, I mean kotlin is also quite persuasive

proud basin
#

Javafx isn’t even that hard

hybrid spoke
#

depends

#

you are probably not even handling with webservices and design patterns just like MVVM

silk mirage
#

I mean, I think I'm the best kid living inside country.. I'm just 15 years old and I know the concept of progamming and other stuff.. I feel proud about it

#

.-.

proud basin
#

Web servers I will be

hybrid spoke
#

webservices*

#

just keep going

#

its not necressary yet to wrap any dlls

proud basin
#

smoochie

ivory sleet
proud basin
#

Yes

#

it is

#

I don’t wanna give the jre file and shit

quiet ice
proud basin
#

hm

rigid otter
#

Hello! How to get the instance of SimpleCommandMap?

#

In order to be able to register() a command

quiet ice
#

nope, but from looking at it it looks like a standard OpenJDK which I have used before

proud basin
#

wait was I not suppose to download it

#

because I just did

late sonnet
#

Hi.. im try to make changes in craftbukkit but have this error on compile..

the error says about "implement the inherited abstract method" but the method is implemented in CraftEntity (all the class with the error use extends of CraftEntity then dont know why still show the error

quiet ice
slow oyster
#

Is this new Library Loader feature only in 1.17 or is it in 1.16.5?

ivory sleet
#

Believe 1.17 exclusive

sick bane
#

Yes

slow oyster
#

Okay, it seems like it'd be really useful to use with Hibernate/H2 etc to reduce jar sizes. But I also currently support back to 1.14

ivory sleet
#

Wrong

#

But I believe slimjar or smtng like pdm could fix that

slow oyster
#

Oh nice, that looks like exactly what I'm looking for

ivory sleet
#

(:

slow oyster
#

I use Maven and there doesn't seem to be any Maven documentation for it

unkempt ore
#

Does giving an item with NBT tags set metadata keys?

#

Or is that different

main dew
#

You know good plugin to disable phycics (water,lava,gravel,sand,itp)?

ivory sleet
#

@slow oyster oh yeah my bad it’s hardcore gradle (since it uses a gradle plugin)

rain lynx
#

What is support ecoenchants?

ivory sleet
#

?

#

Wym

rain lynx
#

Plugib

#

Plugin

#

My ecoEnchants plugin isnt working

ivory sleet
#

Contact @covert valve

covert valve
#

ecoenchants is in my discord

#

it's linked on my plugins pages

rain lynx
#

Discord link pls

slow oyster
#

@ivory sleet know of anything similar for maven

ivory sleet
#

Hmm sorry I don’t

sharp bough
#

im trying to test something but its too big for my shitty pc

#

how could i try it anyways?

#

i already crashed my server, 6 times out of 7 attempts xd

ivory sleet
#

What are you trying to test?

sharp bough
#

no nvm i think i found a way

#

its not the best but it works xd

slow oyster
#

Hmm surely there has to be a runtime dependency downloader library somewhere

sharp bough
#

is it possible to create blocks arround a block?

#

for example

quaint mantle
#

yes

vague oracle
#

block.getLocation().add(1,1,1).getBlock().setType()

eternal oxide
#

forEach Blockface

sharp bough
#

it makes this

sharp bough
#

like 25 times

#

if its 5x5

sharp bough
quaint mantle
#

yes....

#

each side of the block is a face

vague oracle
#

You already have the code you need?

#

Just remove the remainders

proud basin
quiet ice
#

You shadowed in the JRE?

burnt current
#

Hey! Quick question: I'm in the process of creating something that places a few blocks. Among these blocks are glass panes. I would like to work with multifacing for the glass panes in order to connect them with the surrounding blocks. I have already programmed the following:

                BlockData glassData = glass.getBlockData();
                MultipleFacing facing1 = (MultipleFacing) glassData;
                facing1.setFace(...);

Which blockface value must be set to connect the slices to all blocks?

vital ridge
#

Does somebody have any expierence with gradlew? I cannot use gradlew at all in my cmd line, every time i do this error shows up:
https://paste.md-5.net/itonalixoj.cs
Like something is wrong somewhere in general

#

I can run gradlew with or without arguments and the same error keeps popping up

eternal night
#

what gradle version is this ?

vital ridge
#

how can i check this>?

eternal night
#

also did you modify your ~/.gradle/gradle.properties

vital ridge
#

na i dont think so

eternal night
#

gradle --version

vital ridge
#

ive never touched them

eternal night
#

to get the verison

vital ridge
#

as far as i know

proud basin
quaint mantle
#

can i detect sound start playing?

#

From any entity

proud basin
#

Screw them they can download java themselves

vital ridge
#
Gradle 4.9
------------------------------------------------------------

Build time:   2018-07-16 08:14:03 UTC
Revision:     efcf8c1cf533b03c70f394f270f46a174c738efc

Kotlin DSL:   0.18.4
Kotlin:       1.2.41
Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM:          16.0.1 (Oracle Corporation 16.0.1+9-24)
OS:           Windows 10 10.0 amd64
eternal night
#

god you are out of date

#

7.1.1 is latest xD

vital ridge
#

Whats the cmd line

#

to install the latest

#

If you know

eternal night
#

read up

#

also remove the old one

#

wherever/however you installed it

vital ridge
#

I dont remember how did I even installed it lmao

#

But ill try to uninstall it

vital ridge
#

I have a jre 1.16

#

But i heard you need to have 1.8

#

Can that be the case?

eternal night
#

idk I am running gradle 7.1.1 with 16.0.1 adopt jdk

quiet ice
#

./gradlew wrapper --gradle-version=7.1.1

#

you should not install gradle

eternal night
#

wrappers are overrated

quiet ice
#

not using the wrapper leads to bigger issues

eternal night
#

hmm, maybe it is like gradle is a compatibility trash can that redefines how they do things every other day

quiet ice
#

in 90% of cases it is gradle and java on agreeing on stuff

vital ridge
#

KK im on latest gradle now

eternal night
#

can it start your daemon ?

vital ridge
#

No it cant, cmon you mean anyone else hasnt had this error?

#

I cant be 1/7000000000

eternal night
#

does using gradlew help ?

#

e.g. the project you are using, running what geol suggested

vital ridge
#

I cant do anything with gradlew

#

The same error

#

So what should I do?

#

It worked before tho

#

It just stopped working at some point

#

I dont remember me messing up anything tho

eternal night
#

well check your systems gradle.properties

#

~/.gradle/gradle.properties

#

maybe that file contains some funny properties

vital ridge
#

~ not regocnized

eternal night
#

are you on windows ?

vital ridge
#

yep

eternal night
#

C:\Users\<username>\.gradle\gradle.properties

quaint mantle
#

or %userprofile%\.gradle

eternal night
#

$HOME/.gradle reigns supreme

vital ridge
#

its in another subfolder

#

but idk where xd

#

I mean or I just dont have the properties

waxen barn
#

btw, is it possible to make custom entity extending EntityInsentient render as armor stand on the client side?

burnt current
#

Hey! Quick question: I'm in the process of creating something that places a few blocks. Among these blocks are glass panes. I would like to work with multifacing for the glass panes in order to connect them with the surrounding blocks. I have already programmed the following:

                BlockData glassData = glass.getBlockData();
                MultipleFacing facing1 = (MultipleFacing) glassData;
                facing1.setFace(...);

Which blockface value must be set to connect the slices to all blocks?

vital ridge
#

@eternal night I tried to just type gradle in my cmd and it started a daemon but the build failed:

FAILURE: Build failed with an exception.

* What went wrong:
Executing Gradle tasks as part of a build without a settings file is not supported. Make sure that you are executing Gradle from a directory within your Gradle project. Your project should have a 'settings.gradle(.kts)' file in the root directory.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s
eternal night
#

I mean

#

it tells you why

#

it is missing a settings.gradle file

vital ridge
#

I understand that but its talking bout a root directory

#

wheres exavtly the root directory?

eternal night
#

root directly of your project

vital ridge
#

I have 2 gradle places

#

I mean how is it even associated with any of my projects I just wrote gradle in cmd line

#

without doing anything first

eternal night
#

yes that doesn't work

#

running this in a dir without a gradle project obviously fails

#

because there is just no project

vital ridge
#

i ran it in my project folder, something is now going on

#

i mean the build is in progress

eternal night
#

sweet

vital ridge
#

Kk i need to downgrade to 6.0.0

#

newer arent supported

eternal night
#

hence why your project should have a wrapper

#

e.g.

vital ridge
#

In fg3 and in fg4

eternal night
#

./gradlew

#

or whatever it is on windows

vital ridge
#

yeah but gradlew fails

#

And Idk how tf im supposed to get the wrapper

#

I mean i dont even understand what it is

eternal night
#

gradle wrapper --gradle-version 6.0.0

#

should create a wrapper for you

#

in the project

grim ice
#

how to get player from InventoryMoveItemEvent

regal lake
#

@grim ice not possible, because no user interact with that event..

#

Called when some entity or block (e.g. hopper) tries to move items directly from one inventory to another.

grim ice
#

How to prevent a player from moving a itemstack in his inventory?

eternal night
#

InventoryInteractEvent

#

or pickup item event

grim ice
#

oh

grim ice
#

i dont understand how am i supposed to use this for that

eternal night
#

the documentation is rather clear

unkempt ore
#

How could I make it so I can give myself an item with custom NBT tags, and then check what those tags are set to later?

paper viper
#

PDC

unkempt ore
#

Ohh

#

So that's what that is

grim ice
#

You have linked me the wrong link

#

this is InventoryClickEvent, not Interact

paper viper
#

?

eternal night
#

inventory interact is an abstract parent class

#

which, afaik, cannot be listened to

grim ice
#

so

eternal night
#

hence why I linked you the click event

#

which should do the trick for you

torn shuttle
#

quick q: does anyone know if there is a utility method to quickly check if a location is under open sky or if there is a block above it?

grim ice
#

@EventHandler
public void onmoveeee(InventoryClickEvent e){
if(e.getCurrentItem().isSimilar(Star)){
e.setCancelled(true);

#

u think this would work?

vital ridge
#

Like something is VERY VERY fcked

#

some where

ivory sleet
#

I know there’s a method in nms magma, doubt exposed in api

torn shuttle
#

I know there's the getHighestBlockAty

#

actually I'm stupid right

ivory sleet
#

Lol

torn shuttle
#

I can cross reference that with the current y huh

#

hm

eternal night
#

give it a tryyy

grim ice
#

okay

#

@eternal night Im sorry for the ping, but im making a plugin that involves gui so it uses the same event to check if the item is clicked

#

and if i make it cancel the event when clicked it will break the plugin right?

#

i just want the player to not be able to drag the item to his inventory, but he should be able to click it]

vital ridge
#

No it wont

#

You need to cancel the event after certain checks (to detect if the inventory clicked was your gui)

#

So you cant move things around

#

You can check if the inv clicked was ur gui by checking for a certain title or some other way

grim ice
#

i alr did

#

i check if a certain itemstack is in the inventory

vital ridge
#

Well thats not a good check since the same itemstack can be anywhere

grim ice
#

not really

#

it wont have the same lore and same everything

vital ridge
#

Okay in that case ur right

#

so whats the problem?

#

You can still move stuff around?

#

Any errors?

grim ice
#

I'm wondering if the player can drag the item he clicked on

#

to his inventory

vital ridge
#

If you cancel the event then he cant

grim ice
#

he can't if i close the inventory right

#

oh

#

will

#

e.getWhoClicked().closeInventory();

#

stop him from that

vital ridge
#

Whats ur goal?

#

U want a player to not be able to move stuff around?

unkempt ore
#

@paper viper Wait, that wouldn't work for custom NBT tags given by the /give command, for example, or would it?

vital ridge
#

Or vise versa?

grim ice
#
if (e.getClickedInventory().contains(Go)) {
                if (e.getSlot() == 7) {
                    if (e.getWhoClicked().getInventory().contains(new ItemStack((Material.AIR)), 1)) {

                        if (e.getWhoClicked().getInventory().contains(new ItemStack(Material.DIAMOND, 8))) {
                            if (e.getWhoClicked().getInventory().contains(new ItemStack(Material.PORKCHOP, 16))) {
                                e.getWhoClicked().getInventory().removeItem(new ItemStack(Material.DIAMOND, 8));
                                e.getWhoClicked().getInventory().removeItem(new ItemStack(Material.PORKCHOP, 16));
                                e.getWhoClicked().getInventory().addItem(new ItemStack(Material.PIG_SPAWN_EGG));
                                e.getWhoClicked().closeInventory();
                            }
                        }
                    }
                }```
#

that is my code right now

#

I want the player

grim ice
#

to not be able to drag stuff around when he trades the items

paper viper
#

Oh

#

I think it should work?

#

Perhaps

unkempt ore
#

Hmmm, it doesn't seem to be

paper viper
#

Never thought of that actually

unkempt ore
#

That's what I want

vital ridge
#

Just check if the clicked inventory title is equal to your gui title

#

Make sure to translate the colors

#

aswell